38#ifndef DRAIN_TREE_LAYOUT_SVG
39#define DRAIN_TREE_LAYOUT_SVG
43#include <drain/Enum.h>
48#include "AlignAnchorSVG.h"
70 void detectBox(TreeSVG & group,
bool debug =
false);
76 if (node.
typeIs(svg::TEXT)){
80 bbox.x += node.transform.translate.x;
81 bbox.y += node.transform.translate.y;
85 template <AlignBase::Axis AX>
103 AlignBase::Axis orientation = AlignBase::Axis::HORZ,
104 LayoutSVG::DirectionHorz directionHorz = LayoutSVG::DirectionHorz::RIGHT,
105 LayoutSVG::DirectionVert directionVert = LayoutSVG::DirectionVert::DOWN,
106 unsigned short depth=0);
115 void setStackLayout(
NodeSVG & node, AlignBase::Axis orientation, LayoutSVG::DirectionHorz dirHorz, LayoutSVG::DirectionVert dirVert);
123 template <AlignBase::Axis AX>
148const image::TreeSVG::key_t & image::TreeSVG::getKey(
const image::AnchorElem::Anchor & type){
155const image::TreeSVG::key_t & image::TreeSVG::getKey(
const image::AnchorElem & elem){
156 return image::TreeSVG::getKey(elem.str());
bool typeIs(const T2 &arg, const T3... args) const
Return true, if type is any of the arguments.
Definition XML.h:230
const BBoxSVG & getBoundingBox() const
Set attribute value, handling units in string arguments, like in "50%" or "640px".
Definition TreeSVG.h:228
A container for a static dictionary of enumeration values.
Definition Enum.h:51
static const std::string & getKey(const std::string &s, bool lenient=true)
Convenience for object.set(...) like commands.
Definition Enum.h:144
Definition CoordsSVG.h:92
Definition TreeLayoutSVG.h:58
static void superAlign(TreeSVG &node)
Definition TreeLayoutSVG.cpp:379
static void addStackLayout(TreeSVG &object, AlignBase::Axis orientation=AlignBase::Axis::HORZ, LayoutSVG::DirectionHorz directionHorz=LayoutSVG::DirectionHorz::RIGHT, LayoutSVG::DirectionVert directionVert=LayoutSVG::DirectionVert::DOWN, unsigned short depth=0)
Set stack layout as a default in a subtree.
Definition TreeLayoutSVG.cpp:156
static void setStackLayout(NodeSVG &node, AlignBase::Axis orientation, LayoutSVG::DirectionHorz dirHorz, LayoutSVG::DirectionVert dirVert)
Sets alignment applying stack layout in a single node.
Definition TreeLayoutSVG.cpp:209
static void adjustLocation(TreeSVG &group, NodeSVG &node, CoordSpan< AX > anchorSpan)
Definition TreeLayoutSVG.cpp:293
static void detectBox(TreeSVG &group, bool debug=false)
Compute the bounding box recursively in objects of type IMAGE, RECT, POLYGON and G (group).
Definition TreeLayoutSVG.cpp:44