38#ifndef DRAIN_TREE_UTILS_SVG
39#define DRAIN_TREE_UTILS_SVG
43#include <drain/Enum.h>
44#include <drain/util/Frame.h>
45#include <drain/util/Rectangle.h>
47#include "AlignAnchorSVG.h"
92DRAIN_ENUM_DICT(TreeUtilsSVG::Roles);
93DRAIN_ENUM_OSTREAM(TreeUtilsSVG::Roles);
102 const std::string dir;
105 const std::string prefix;
109 dir(filepath.dir.empty() ?
"" : filepath.dir.str()+
'/'),
113 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
127 const std::string LOCAL;
130 const std::string SHARED;
140 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override {
145 int visitPostfix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
152 typedef std::map<std::string, unsigned short> variableStat_t;
165 const std::string CLIP;
186 TreeSVG &
getClippingRect(TreeSVG & root,
size_t width,
size_t height);
189 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override {
194 int visitPostfix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
211 const std::string MASK_ID;
233 TreeSVG &
getMask(TreeSVG & root,
const std::string & maskId);
243 drain::image::TreeSVG &
updateMask(TreeSVG & mask,
int width,
int height,
const NodeSVG & contourNode);
251 TreeSVG &
createMask(TreeSVG & root, TreeSVG & group,
int width=0,
int height=0,
const NodeSVG & node =
NodeSVG(svg::UNDEFINED));
262 void linkMask(
const TreeSVG & mask, TreeSVG & obj);
274 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override {
278 int visitPostfix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
A wrapper marking string an CSS effect.
Definition ClassXML.h:57
Extracts and stores directory path, base filename and extension.
Definition FilePath.h:58
Default implementation of a tree visitor (concept) compatible TreeUtils::traverser()
Definition TreeUtils.h:270
VariableT is a final class applied through typedefs Variable, Reference and FlexibleVariable.
Definition VariableT.h:87
Definition TreeUtilsSVG.h:160
static TreeSVG & getClippingRect(TreeSVG &root, size_t width, size_t height)
Ensures a clipping path o f type RECT of given size.
Definition TreeUtilsSVG.cpp:286
Tools for creating masks for graphic objects based on their contours.
Definition TreeUtilsSVG.h:206
static void linkMask(const TreeSVG &mask, TreeSVG &obj)
Finally, associate the object with a mask by assigning MASK elements ID to the mask attribute of obje...
Definition TreeUtilsSVG.cpp:440
static drain::image::TreeSVG & updateMask(TreeSVG &mask, int width, int height, const NodeSVG &contourNode)
Method for an object to copy its contour.
Definition TreeUtilsSVG.cpp:395
static TreeSVG & getMask(TreeSVG &root, const std::string &maskId)
From global document definitions (DEFS), retrieve the mask designed for this group.
Definition TreeUtilsSVG.cpp:360
static const drain::FlexibleVariable & createMaskId(TreeSVG &group)
Mark an overlay group "masked", meaning that at least one of its objects (also) creates a mask for th...
Definition TreeUtilsSVG.cpp:354
int visitPrefix(TreeSVG &tree, const TreeSVG::path_t &path) override
Ensures a clipping path o f type RECT of given size.
Definition TreeUtilsSVG.h:274
static TreeSVG & createMask(TreeSVG &root, TreeSVG &group, int width=0, int height=0, const NodeSVG &node=NodeSVG(svg::UNDEFINED))
Calls createMaskId(), getMask() and updateMask().
Definition TreeUtilsSVG.cpp:416
Definition TreeUtilsSVG.h:97
int visitPrefix(TreeSVG &tree, const TreeSVG::path_t &path) override
Create a new entry, unless already defined.
Definition TreeUtilsSVG.cpp:122
Definition DataSelector.cpp:1277
SVG classes marking requests of relative horizontal and vertical alignment.
Definition TreeUtilsSVG.h:65