![]() |
|
SVG classes marking requests of relative horizontal and vertical alignment. More...
#include <TreeUtilsSVG.h>
Static Public Member Functions | |
static bool | computeBoundingBox (const TreeSVG &group, drain::Box< svg::coord_t > &box) |
Compute bounding box of the whole structure. | |
static void | finalizeBoundingBox (TreeSVG &svg) |
Compute bounding box and set the top-level SVG width, height and viewBox properties. | |
static void | setRelativePaths (drain::image::TreeSVG &object, const drain::FilePath &filepath) |
Computes the width and height for a bounding box IMAGE and RECT elements. More... | |
static void | superAlign (TreeSVG &node, AlignBase::Axis orientation=AlignBase::Axis::HORZ, LayoutSVG::Direction direction=LayoutSVG::Direction::INCR) |
static void | realignObject (const Box< svg::coord_t > &anchorBoxHorz, const Box< svg::coord_t > &anchorBoxVert, TreeSVG &obj) |
Align object respect to an anchor frame. | |
static void | realignObjectHorz (TreeSVG &obj, const Box< svg::coord_t > &anchorBoxHorz) |
static void | realignObjectVert (TreeSVG &obj, const Box< svg::coord_t > &anchorBoxVert) |
static void | translateAll (TreeSVG &group, const Point2D< svg::coord_t > &offset) |
Recursively move elements with (x, y). More... | |
SVG classes marking requests of relative horizontal and vertical alignment.
|
static |
anchorSpan | - width or height of the achore rectangle. |
|
static |
Computes the width and height for a bounding box IMAGE and RECT elements.
The result is the minimal bounding box that covers the IMAGE and RECT elements aligned non-overlapping in a row (orientation HORZ
) or a column (orientation VERT
).
Future versions may also handle CIRCLE and TEXT (location)
|
static |
anchorSpan | - width or height of the achore rectangle. Traverse the whole thing, at least an ALIGN_GROUP... |
Recursion: before aligning an element, align its contents. Anchors.
In SVG, elements that directly define a graphical object – like RECT
, CIRCLE
or POLYLINE
are here called graphical elements . Examples of other, abstract elements are G
(group), METADATA
or DESC
elements.
Alignment of graphical element can controlled by methods of drain::image::AlignSVG inherited by drain::image::NodeSVG . Elements can be aligned sequentially - stacked in rows or colums - as well as superposing them over other elements.
Elements respect to which another element is aligned is called an anchor. Anchors can be implicit or explicitly set.
G
can explicitly define one of its children (direct descendants) to be the default anchor for all the elements in the group.offset | - start? |
If main orientation (inside containers) is HORZ, stack containers VERT. And vice versa.
mout.special<LOG_WARNING>("Resulting BBOX=", objectBBox, " me: \t", object.data);
mout.accept<LOG_NOTICE>("Expanding ... ", bbox, " now, after: ", entry.second.data);
|
static |
Recursively move elements with (x, y).
Iteratively traverses elements of ALIGN_GROUP, and (re)aligns elements inside them as panels.