Represents a group of SVG elements. http://www.w3.org/TR/SVG/struct.html#Groups. More...
#include <Svg.h>
Inherits cinder::svg::Node, and noncopyable.
Inherited by cinder::svg::Doc.
Public Member Functions | |
| Group (const Node *parent) | |
| Group (const Node *parent, const XmlTree &xml) | |
| ~Group () | |
| template<typename T > | |
| const T * | find (const std::string &id) |
Recursively searches for a child element of type svg::T named id. Returns NULL on failure to find the object or if it is not of type T. More... | |
| const Node * | findNode (const std::string &id, bool recurse=true) const |
| Recursively searches for a child element named id. Returns NULL on failure. More... | |
| template<typename T > | |
| const T * | findByIdContains (const std::string &idPartial) |
Recursively searches for a child element of type svg::T whose name contains idPartial. Returns NULL on failure to find the object or if it is not of type T. More... | |
| const Node * | findNodeByIdContains (const std::string &idPartial, bool recurse=true) const |
| Recursively searches for a child element whose name contains idPartial. Returns NULL on failure. (null_ptr later?) More... | |
| virtual const Node * | findInAncestors (const std::string &elementId) const |
| Finds the node with ID elementId amongst this Node's ancestors. Returns NULL on failure. More... | |
| const Node & | getChild (const std::string &id) const |
| Returns a reference to the child named id. Throws svg::ExcChildNotFound if not found. More... | |
| const Node & | operator/ (const std::string &id) const |
| Returns a reference to the child named id. Throws svg::ExcChildNotFound if not found. More... | |
| virtual Shape2d | getShape () const |
| Returns the merged Shape2d for all children of the group. More... | |
| void | appendMergedShape2d (Shape2d *appendTo) const |
| Appends the merged Shape2d for the group to appentTo. More... | |
| const std::list< Node * > & | getChildren () const |
| Returns a reference to the list of the Group's children. More... | |
| std::list< Node * > & | getChildren () |
| Returns a reference to the list of the Group's children. More... | |
| class Doc * | getDoc () const |
| Returns the svg::Doc this Node is an element of. More... | |
| const Node * | getParent () const |
| Returns the immediate parent of this node. More... | |
| const std::string & | getId () const |
| Returns the ID of this Node when present. More... | |
| std::string | getDomPath () const |
| Returns a DOM-style path to this node. More... | |
| const Style & | getStyle () const |
| Returns the style elements defined on this Node but not inherited from ancestors. More... | |
| void | setStyle (const Style &style) |
| Sets the style defined on this Node but not inherited from ancestors. More... | |
| Style | calcInheritedStyle () const |
| Returns the node's Style, including attributes inherited from its ancestors for attributes it does not specify. More... | |
| virtual bool | containsPoint (const Vec2f &pt) const |
| Returns whether the point pt is inside of the Node's shape. More... | |
| void | render (Renderer &renderer) const |
| Renders the node and its descendants. More... | |
| Paint | findPaintInAncestors (const std::string &paintName) const |
| Finds the svg::Paint node with ID elementId amongst this Node's ancestors. Returns a default svg::Paint instance on failure. More... | |
| bool | specifiesTransform () const |
| Returns whether this Node specifies a transformation. More... | |
| MatrixAffine2f | getTransform () const |
| Returns the local transformation of this node. Returns identity if the Node's transform isn't specified. More... | |
| void | setTransform (const MatrixAffine2f &transform) |
| Sets the local transformation of this node. More... | |
| void | unspecifyTransform () |
| Removes the local transformation of this node, effectively making it the identity matrix. More... | |
| MatrixAffine2f | getTransformInverse () const |
| Returns the inverse of the local transformation of this node. Returns identity if the Node's transform isn't specified. More... | |
| MatrixAffine2f | getTransformAbsolute () const |
| Returns the absolute transformation of this node, which includes inherited transformations. More... | |
| MatrixAffine2f | getTransformAbsoluteInverse () const |
| Returns the inverse of the absolute transformation of this node, which includes inherited transformations. More... | |
| Rectf | getBoundingBox () const |
| Returns the local bounding box of the Node. Calculated and cached the first time it is requested. More... | |
| Rectf | getBoundingBoxAbsolute () const |
| Returns the absolute bounding box of the Node. Calculated and cached the first time it is requested. More... | |
| Shape2d | getShapeAbsolute () const |
| Returns a Shape2d representing the node in absolute coordinates. Not supported for Text. More... | |
| const Paint & | getFill () const |
| Returns node's fill, or the first among its ancestors when it has none. More... | |
| const Paint & | getStroke () const |
| Returns node's stroke, or the first among its ancestors when it has none. More... | |
| float | getOpacity () const |
| Returns node's opacity, or the first among its ancestors when it has none. More... | |
| float | getFillOpacity () const |
| Returns node's fill opacity, or the first among its ancestors when it has none. More... | |
| float | getStrokeOpacity () const |
| Returns node's stroke opacity, or the first among its ancestors when it has none. More... | |
| FillRule | getFillRule () const |
| Returns node's fill rule, or the first among its ancestors when it has none. More... | |
| LineCap | getLineCap () const |
| Returns node's line cap, or the first among its ancestors when it has none. More... | |
| LineJoin | getLineJoin () const |
| Returns node's line join, or the first among its ancestors when it has none. More... | |
| float | getStrokeWidth () const |
| Returns node's stroke width, or the first among its ancestors when it has none. More... | |
| const std::vector< std::string > & | getFontFamilies () const |
| Returns node's font families, or the first among its ancestors when it has none. More... | |
| Value | getFontSize () const |
| Returns node's font size, or the first among its ancestors when it has none. More... | |
| bool | isVisible () const |
| Returns whether this Node is visible, or the first among its ancestors when unspecified. More... | |
| bool | isDisplayNone () const |
| Returns whether the Display property of this Node is set to 'None', preventing rendering of the node and its children. More... | |
Protected Member Functions | |
| Node * | nodeUnderPoint (const Vec2f &absolutePoint, const MatrixAffine2f &parentInverseMatrix) const |
| Shape2d | getMergedShape2d () const |
| virtual void | renderSelf (Renderer &renderer) const |
| virtual Rectf | calcBoundingBox () const |
| virtual bool | isDrawable () const |
| void | parse (const XmlTree &xml) |
| void | startRender (Renderer &renderer, const Style &style) const |
| void | finishRender (Renderer &renderer, const Style &style) const |
| void | parseStyle (const std::string &value) |
Static Protected Member Functions | |
| static Paint | parsePaint (const char *value, bool *specified, const Node *parentNode) |
| static MatrixAffine2f | parseTransform (const std::string &value) |
| static bool | parseTransformComponent (const char **c, MatrixAffine2f *result) |
| static std::string | findStyleValue (const std::string &styleString, const std::string &key) |
Protected Attributes | |
| std::list< Node * > | mChildren |
| std::shared_ptr< Group > | mDefs |
| const Node * | mParent |
| std::string | mId |
| Style | mStyle |
| bool | mSpecifiesTransform |
| MatrixAffine2f | mTransform |
| bool | mBoundingBoxCached |
| Rectf | mBoundingBox |
Represents a group of SVG elements. http://www.w3.org/TR/SVG/struct.html#Groups.
| cinder::svg::Group::Group | ( | const Node * | parent | ) |
| cinder::svg::Group::~Group | ( | ) |
| const T* cinder::svg::Group::find | ( | const std::string & | id | ) |
Recursively searches for a child element of type svg::T named id. Returns NULL on failure to find the object or if it is not of type T.
| const Node * cinder::svg::Group::findNode | ( | const std::string & | id, |
| bool | recurse = true |
||
| ) | const |
Recursively searches for a child element named id. Returns NULL on failure.
| const T* cinder::svg::Group::findByIdContains | ( | const std::string & | idPartial | ) |
Recursively searches for a child element of type svg::T whose name contains idPartial. Returns NULL on failure to find the object or if it is not of type T.
| const Node * cinder::svg::Group::findNodeByIdContains | ( | const std::string & | idPartial, |
| bool | recurse = true |
||
| ) | const |
Recursively searches for a child element whose name contains idPartial. Returns NULL on failure. (null_ptr later?)
|
virtual |
Finds the node with ID elementId amongst this Node's ancestors. Returns NULL on failure.
Reimplemented from cinder::svg::Node.
| const Node & cinder::svg::Group::getChild | ( | const std::string & | id | ) | const |
Returns a reference to the child named id. Throws svg::ExcChildNotFound if not found.
| const Node& cinder::svg::Group::operator/ | ( | const std::string & | id | ) | const |
Returns a reference to the child named id. Throws svg::ExcChildNotFound if not found.
|
virtual |
Returns the merged Shape2d for all children of the group.
Reimplemented from cinder::svg::Node.
| void cinder::svg::Group::appendMergedShape2d | ( | Shape2d * | appendTo | ) | const |
Appends the merged Shape2d for the group to appentTo.
| const std::list<Node*>& cinder::svg::Group::getChildren | ( | ) | const |
Returns a reference to the list of the Group's children.
| std::list<Node*>& cinder::svg::Group::getChildren | ( | ) |
Returns a reference to the list of the Group's children.
|
protected |
|
protected |
|
protectedvirtual |
Implements cinder::svg::Node.
|
protectedvirtual |
Reimplemented from cinder::svg::Node.
|
protectedvirtual |
Reimplemented from cinder::svg::Node.
|
protected |
|
inherited |
|
inherited |
Returns the immediate parent of this node.
|
inherited |
Returns the ID of this Node when present.
|
inherited |
Returns a DOM-style path to this node.
|
inherited |
Returns the style elements defined on this Node but not inherited from ancestors.
|
inherited |
Sets the style defined on this Node but not inherited from ancestors.
|
inherited |
Returns the node's Style, including attributes inherited from its ancestors for attributes it does not specify.
|
virtualinherited |
Returns whether the point pt is inside of the Node's shape.
Reimplemented in cinder::svg::Image, cinder::svg::Polyline, cinder::svg::Polygon, cinder::svg::Rect, cinder::svg::Path, cinder::svg::Ellipse, and cinder::svg::Circle.
|
inherited |
Renders the node and its descendants.
|
inherited |
Finds the svg::Paint node with ID elementId amongst this Node's ancestors. Returns a default svg::Paint instance on failure.
|
inherited |
Returns whether this Node specifies a transformation.
|
inherited |
Returns the local transformation of this node. Returns identity if the Node's transform isn't specified.
|
inherited |
Sets the local transformation of this node.
|
inherited |
Removes the local transformation of this node, effectively making it the identity matrix.
|
inherited |
Returns the inverse of the local transformation of this node. Returns identity if the Node's transform isn't specified.
|
inherited |
Returns the absolute transformation of this node, which includes inherited transformations.
|
inherited |
Returns the inverse of the absolute transformation of this node, which includes inherited transformations.
|
inherited |
Returns the local bounding box of the Node. Calculated and cached the first time it is requested.
|
inherited |
Returns the absolute bounding box of the Node. Calculated and cached the first time it is requested.
|
inherited |
|
inherited |
Returns node's fill, or the first among its ancestors when it has none.
|
inherited |
Returns node's stroke, or the first among its ancestors when it has none.
|
inherited |
Returns node's opacity, or the first among its ancestors when it has none.
|
inherited |
Returns node's fill opacity, or the first among its ancestors when it has none.
|
inherited |
Returns node's stroke opacity, or the first among its ancestors when it has none.
|
inherited |
Returns node's fill rule, or the first among its ancestors when it has none.
|
inherited |
Returns node's line cap, or the first among its ancestors when it has none.
|
inherited |
Returns node's line join, or the first among its ancestors when it has none.
|
inherited |
Returns node's stroke width, or the first among its ancestors when it has none.
|
inherited |
Returns node's font families, or the first among its ancestors when it has none.
|
inherited |
Returns node's font size, or the first among its ancestors when it has none.
|
inherited |
Returns whether this Node is visible, or the first among its ancestors when unspecified.
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
protectedinherited |
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |
|
mutableprotectedinherited |