38 #ifndef DRAIN_TREE_UTILS_SVG
39 #define DRAIN_TREE_UTILS_SVG
43 #include <drain/util/Frame.h>
44 #include <drain/util/EnumFlags.h>
45 #include <drain/util/Rectangle.h>
122 void superAlign(TreeSVG & node, AlignBase::Axis orientation = AlignBase::Axis::HORZ, LayoutSVG::Direction direction = LayoutSVG::Direction::INCR);
170 template <
typename T>
174 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
187 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
189 int visitPostfix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
197 const std::string dir;
201 dir(filepath.dir.empty() ?
"" : filepath.dir.str()+
'/') {
204 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
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
Definition: TreeUtilsSVG.h:180
Definition: TreeUtilsSVG.h:193
Definition: TreeUtilsSVG.h:160
int visitPrefix(TreeSVG &tree, const TreeSVG::path_t &path) override
Definition: TreeUtilsSVG.cpp:498
Definition: DataSelector.cpp:1277
SVG classes marking requests of relative horizontal and vertical alignment.
Definition: TreeUtilsSVG.h:78
static void superAlign(TreeSVG &node, AlignBase::Axis orientation=AlignBase::Axis::HORZ, LayoutSVG::Direction direction=LayoutSVG::Direction::INCR)
Definition: TreeUtilsSVG.cpp:293
static void finalizeBoundingBox(TreeSVG &svg)
Compute bounding box and set the top-level SVG width, height and viewBox properties.
Definition: TreeUtilsSVG.cpp:58
static bool computeBoundingBox(const TreeSVG &group, drain::Box< svg::coord_t > &box)
Compute bounding box of the whole structure.
Definition: TreeUtilsSVG.cpp:514
static void realignObjectVert(TreeSVG &obj, const Box< svg::coord_t > &anchorBoxVert)
Definition: TreeUtilsSVG.cpp:176
static void translateAll(TreeSVG &group, const Point2D< svg::coord_t > &offset)
Recursively move elements with (x, y).
Definition: TreeUtilsSVG.cpp:463
static void setRelativePaths(drain::image::TreeSVG &object, const drain::FilePath &filepath)
Computes the width and height for a bounding box IMAGE and RECT elements.
static void realignObject(const Box< svg::coord_t > &anchorBoxHorz, const Box< svg::coord_t > &anchorBoxVert, TreeSVG &obj)
Align object respect to an anchor frame.