38#ifndef DRAIN_TREE_LAYOUT_SVG
39#define DRAIN_TREE_LAYOUT_SVG
43#include <drain/util/EnumUtils.h>
44#include <drain/util/Frame.h>
45#include <drain/util/Rectangle.h>
47#include "AlignAnchorSVG.h"
65template <AlignBase::Axis AX>
69 CoordSpan(svg::coord_t pos = 0, svg::coord_t span = 0) : pos(pos), span(span) {
80 svg::coord_t span = 0;
83 void copyFrom(
const NodeSVG & node);
85 void copyFrom(
const BBoxSVG & bbox);
89 return ! (std::isnan(pos) || std::isnan(span));
106 void detectBox(TreeSVG & group,
bool debug =
false);
112 bbox.x += node.transform.translate.x;
113 bbox.y += node.transform.translate.y;
116 template <AlignBase::Axis AX>
132 void addStackLayout(TreeSVG &
object, AlignBase::Axis orientation = AlignBase::Axis::HORZ,
LayoutSVG::Direction direction = LayoutSVG::Direction::INCR,
unsigned short depth=0);
148 template <AlignBase::Axis AX>
Direction
Direction for "Stacked", horziontally or vertically sequentially aligned layout.
Definition LayoutSVG.h:64
const BBoxSVG & getBoundingBox() const
Get position (x,y), width and height of an object.
Definition TreeSVG.h:285
Definition DataSelector.cpp:1277
SVG classes marking requests of relative horizontal and vertical alignment.
Definition TreeLayoutSVG.h:66
Definition TreeLayoutSVG.h:94
static void superAlign(TreeSVG &node)
Definition TreeLayoutSVG.cpp:460
static void adjustLocation(TreeSVG &group, NodeSVG &node, CoordSpan< AX > anchorSpan)
Definition TreeLayoutSVG.cpp:379
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:49
static void setStackLayout(NodeSVG &node, AlignBase::Axis orientation, LayoutSVG::Direction direction)
Sets alignment applying stack layout in a single node.
Definition TreeLayoutSVG.cpp:236
static void addStackLayout(TreeSVG &object, AlignBase::Axis orientation=AlignBase::Axis::HORZ, LayoutSVG::Direction direction=LayoutSVG::Direction::INCR, unsigned short depth=0)
Set stack layout as a default in a subtree.
Definition TreeLayoutSVG.cpp:177