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>
56 bool absolutePaths = true;
58 // Currently, applications are recommended to handle "false" and "none". Or "auto"?
60 // FontSizes fontSize;
62 inline // maxPerGroup(10), layout(Alignment::HORZ, LayoutSVG::INCR), legend(LEFT, EMBED),
63 PanelConfSVG() : absolutePaths(true){
122 void superAlign(TreeSVG & node, AlignBase::Axis orientation = AlignBase::Axis::HORZ, LayoutSVG::Direction direction = LayoutSVG::Direction::INCR);
126 void superAlignNEW(TreeSVG & node, AlignBase::Axis orientation = AlignBase::Axis::HORZ, LayoutSVG::Direction direction = LayoutSVG::Direction::INCR);
172 template <
typename T>
176 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
189 int visitPrefix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
191 int visitPostfix(TreeSVG & tree,
const TreeSVG::path_t & path)
override;
200 const std::string dir;
203 const std::string prefix;
207 dir(filepath.dir.empty() ?
"" : filepath.dir.str()+
'/'),
211 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:182
Definition TreeUtilsSVG.h:195
Definition TreeUtilsSVG.h:162
int visitPrefix(TreeSVG &tree, const TreeSVG::path_t &path) override
Definition TreeUtilsSVG.cpp:524
Definition DataSelector.cpp:1277
Something that has coordinates (x,y) and dimensions (width, height).
Definition Frame.h:160
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)
Computes the width and height for a bounding box IMAGE and RECT elements.
Definition TreeUtilsSVG.cpp:321
static void finalizeBoundingBox(TreeSVG &svg)
Compute bounding box and set the top-level SVG width, height and viewBox properties.
Definition TreeUtilsSVG.cpp:86
static bool computeBoundingBox(const TreeSVG &group, drain::Box< svg::coord_t > &box)
Compute bounding box of the whole structure.
Definition TreeUtilsSVG.cpp:58
static void realignObjectVert(TreeSVG &obj, const Box< svg::coord_t > &anchorBoxVert)
Definition TreeUtilsSVG.cpp:204
static void translateAll(TreeSVG &group, const Point2D< svg::coord_t > &offset)
Recursively move elements with (x, y).
Definition TreeUtilsSVG.cpp:500
static void realignObject(const Box< svg::coord_t > &anchorBoxHorz, const Box< svg::coord_t > &anchorBoxVert, TreeSVG &obj)
Align object respect to an anchor frame.