Base class for SVG Gradients. See SVG Gradients: http://www.w3.org/TR/SVG/pservers.html#Gradients. More...
#include <Svg.h>
Inherits cinder::svg::Node.
Inherited by cinder::svg::LinearGradient, and cinder::svg::RadialGradient.
Classes | |
class | Stop |
Public Member Functions | |
Gradient (const Node *parent, const XmlTree &xml) | |
bool | useObjectBoundingBox () const |
bool | specifiesTransform () const |
Returns whether this Node specifies a transformation. | |
class Doc * | getDoc () const |
Returns the svg::Doc this Node is an element of. | |
const Node * | getParent () const |
Returns the immediate parent of this node. | |
const std::string & | getId () const |
Returns the ID of this Node when present. | |
std::string | getDomPath () const |
Returns a DOM-style path to this node. | |
const Style & | getStyle () const |
Returns the style elements defined on this Node but not inherited from ancestors. | |
void | setStyle (const Style &style) |
Sets the style defined on this Node but not inherited from ancestors. | |
Style | calcInheritedStyle () const |
Returns the node's Style, including attributes inherited from its ancestors for attributes it does not specify. | |
virtual bool | containsPoint (const Vec2f &pt) const |
Returns whether the point pt is inside of the Node's shape. | |
void | render (Renderer &renderer) const |
Renders the node and its descendants. | |
virtual const Node * | findInAncestors (const std::string &elementId) const |
Finds the node with ID elementId amongst this Node's ancestors. Returns NULL on failure. | |
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. | |
MatrixAffine2f | getTransform () const |
Returns the local transformation of this node. Returns identity if the Node's transform isn't specified. | |
void | setTransform (const MatrixAffine2f &transform) |
Sets the local transformation of this node. | |
void | unspecifyTransform () |
Removes the local transformation of this node, effectively making it the identity matrix. | |
MatrixAffine2f | getTransformInverse () const |
Returns the inverse of the local transformation of this node. Returns identity if the Node's transform isn't specified. | |
MatrixAffine2f | getTransformAbsolute () const |
Returns the absolute transformation of this node, which includes inherited transformations. | |
MatrixAffine2f | getTransformAbsoluteInverse () const |
Returns the inverse of the absolute transformation of this node, which includes inherited transformations. | |
Rectf | getBoundingBox () const |
Returns the local bounding box of the Node. Calculated and cached the first time it is requested. | |
Rectf | getBoundingBoxAbsolute () const |
Returns the absolute bounding box of the Node. Calculated and cached the first time it is requested. | |
virtual Shape2d | getShape () const |
Returns a Shape2d representing the node in local coordinates. Not supported for Text. | |
Shape2d | getShapeAbsolute () const |
Returns a Shape2d representing the node in absolute coordinates. Not supported for Text. | |
const Paint & | getFill () const |
Returns node's fill, or the first among its ancestors when it has none. | |
const Paint & | getStroke () const |
Returns node's stroke, or the first among its ancestors when it has none. | |
float | getOpacity () const |
Returns node's opacity, or the first among its ancestors when it has none. | |
float | getFillOpacity () const |
Returns node's fill opacity, or the first among its ancestors when it has none. | |
float | getStrokeOpacity () const |
Returns node's stroke opacity, or the first among its ancestors when it has none. | |
FillRule | getFillRule () const |
Returns node's fill rule, or the first among its ancestors when it has none. | |
LineCap | getLineCap () const |
Returns node's line cap, or the first among its ancestors when it has none. | |
LineJoin | getLineJoin () const |
Returns node's line join, or the first among its ancestors when it has none. | |
float | getStrokeWidth () const |
Returns node's stroke width, or the first among its ancestors when it has none. | |
const std::vector< std::string > & | getFontFamilies () const |
Returns node's font families, or the first among its ancestors when it has none. | |
Value | getFontSize () const |
Returns node's font size, or the first among its ancestors when it has none. | |
bool | isVisible () const |
Returns whether this Node is visible, or the first among its ancestors when unspecified. | |
bool | isDisplayNone () const |
Returns whether the Display property of this Node is set to 'None', preventing rendering of the node and its children. | |
Protected Member Functions | |
virtual void | renderSelf (Renderer &renderer) const |
void | parse (const Node *parent, const XmlTree &xml) |
void | copyAttributesFrom (const Gradient &rhs) |
Paint | asPaint () const |
virtual bool | isDrawable () const |
void | startRender (Renderer &renderer, const Style &style) const |
void | finishRender (Renderer &renderer, const Style &style) const |
virtual Rectf | calcBoundingBox () 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::vector< Stop > | mStops |
Vec2f | mCoords0 |
Vec2f | mCoords1 |
bool | mUseObjectBoundingBox |
bool | mSpecifiesTransform |
MatrixAffine2f | mTransform |
const Node * | mParent |
std::string | mId |
Style | mStyle |
bool | mBoundingBoxCached |
Rectf | mBoundingBox |
Base class for SVG Gradients. See SVG Gradients: http://www.w3.org/TR/SVG/pservers.html#Gradients.
bool cinder::svg::Gradient::useObjectBoundingBox | ( | ) | const |
bool cinder::svg::Gradient::specifiesTransform | ( | ) | const |
Returns whether this Node specifies a transformation.
Reimplemented from cinder::svg::Node.
virtual void cinder::svg::Gradient::renderSelf | ( | Renderer & | renderer | ) | const [protected, virtual] |
Implements cinder::svg::Node.
void cinder::svg::Gradient::copyAttributesFrom | ( | const Gradient & | rhs | ) | [protected] |
Paint cinder::svg::Gradient::asPaint | ( | ) | const [protected] |
Reimplemented in cinder::svg::LinearGradient, and cinder::svg::RadialGradient.
Doc * cinder::svg::Node::getDoc | ( | ) | const [inherited] |
const Node* cinder::svg::Node::getParent | ( | ) | const [inherited] |
Returns the immediate parent of this node.
const std::string& cinder::svg::Node::getId | ( | ) | const [inherited] |
Returns the ID of this Node when present.
string cinder::svg::Node::getDomPath | ( | ) | const [inherited] |
Returns a DOM-style path to this node.
const Style& cinder::svg::Node::getStyle | ( | ) | const [inherited] |
Returns the style elements defined on this Node but not inherited from ancestors.
void cinder::svg::Node::setStyle | ( | const Style & | style | ) | [inherited] |
Sets the style defined on this Node but not inherited from ancestors.
Style cinder::svg::Node::calcInheritedStyle | ( | ) | const [inherited] |
Returns the node's Style, including attributes inherited from its ancestors for attributes it does not specify.
virtual bool cinder::svg::Node::containsPoint | ( | const Vec2f & | pt | ) | const [virtual, inherited] |
Returns whether the point pt is inside of the Node's shape.
Reimplemented in cinder::svg::Circle, cinder::svg::Ellipse, cinder::svg::Path, cinder::svg::Rect, cinder::svg::Polygon, cinder::svg::Polyline, and cinder::svg::Image.
void cinder::svg::Node::render | ( | Renderer & | renderer | ) | const [inherited] |
Renders the node and its descendants.
const Node * cinder::svg::Node::findInAncestors | ( | const std::string & | elementId | ) | const [virtual, inherited] |
Finds the node with ID elementId amongst this Node's ancestors. Returns NULL on failure.
Reimplemented in cinder::svg::Group.
Paint cinder::svg::Node::findPaintInAncestors | ( | const std::string & | paintName | ) | const [inherited] |
Finds the svg::Paint node with ID elementId amongst this Node's ancestors. Returns a default svg::Paint instance on failure.
MatrixAffine2f cinder::svg::Node::getTransform | ( | ) | const [inherited] |
Returns the local transformation of this node. Returns identity if the Node's transform isn't specified.
void cinder::svg::Node::setTransform | ( | const MatrixAffine2f & | transform | ) | [inherited] |
Sets the local transformation of this node.
void cinder::svg::Node::unspecifyTransform | ( | ) | [inherited] |
Removes the local transformation of this node, effectively making it the identity matrix.
MatrixAffine2f cinder::svg::Node::getTransformInverse | ( | ) | const [inherited] |
Returns the inverse of the local transformation of this node. Returns identity if the Node's transform isn't specified.
MatrixAffine2f cinder::svg::Node::getTransformAbsolute | ( | ) | const [inherited] |
Returns the absolute transformation of this node, which includes inherited transformations.
MatrixAffine2f cinder::svg::Node::getTransformAbsoluteInverse | ( | ) | const [inherited] |
Returns the inverse of the absolute transformation of this node, which includes inherited transformations.
Rectf cinder::svg::Node::getBoundingBox | ( | ) | const [inherited] |
Returns the local bounding box of the Node. Calculated and cached the first time it is requested.
Rectf cinder::svg::Node::getBoundingBoxAbsolute | ( | ) | const [inherited] |
Returns the absolute bounding box of the Node. Calculated and cached the first time it is requested.
virtual Shape2d cinder::svg::Node::getShape | ( | ) | const [virtual, inherited] |
Returns a Shape2d representing the node in local coordinates. Not supported for Text.
Reimplemented in cinder::svg::Circle, cinder::svg::Ellipse, cinder::svg::Path, cinder::svg::Line, cinder::svg::Rect, cinder::svg::Polygon, cinder::svg::Polyline, cinder::svg::Use, and cinder::svg::Group.
Shape2d cinder::svg::Node::getShapeAbsolute | ( | ) | const [inherited] |
const Paint & cinder::svg::Node::getFill | ( | ) | const [inherited] |
Returns node's fill, or the first among its ancestors when it has none.
const Paint & cinder::svg::Node::getStroke | ( | ) | const [inherited] |
Returns node's stroke, or the first among its ancestors when it has none.
float cinder::svg::Node::getOpacity | ( | ) | const [inherited] |
Returns node's opacity, or the first among its ancestors when it has none.
float cinder::svg::Node::getFillOpacity | ( | ) | const [inherited] |
Returns node's fill opacity, or the first among its ancestors when it has none.
float cinder::svg::Node::getStrokeOpacity | ( | ) | const [inherited] |
Returns node's stroke opacity, or the first among its ancestors when it has none.
FillRule cinder::svg::Node::getFillRule | ( | ) | const [inherited] |
Returns node's fill rule, or the first among its ancestors when it has none.
LineCap cinder::svg::Node::getLineCap | ( | ) | const [inherited] |
Returns node's line cap, or the first among its ancestors when it has none.
LineJoin cinder::svg::Node::getLineJoin | ( | ) | const [inherited] |
Returns node's line join, or the first among its ancestors when it has none.
float cinder::svg::Node::getStrokeWidth | ( | ) | const [inherited] |
Returns node's stroke width, or the first among its ancestors when it has none.
const vector< string > & cinder::svg::Node::getFontFamilies | ( | ) | const [inherited] |
Returns node's font families, or the first among its ancestors when it has none.
Value cinder::svg::Node::getFontSize | ( | ) | const [inherited] |
Returns node's font size, or the first among its ancestors when it has none.
bool cinder::svg::Node::isVisible | ( | ) | const [inherited] |
Returns whether this Node is visible, or the first among its ancestors when unspecified.
bool cinder::svg::Node::isDisplayNone | ( | ) | const [inherited] |
virtual bool cinder::svg::Node::isDrawable | ( | ) | const [protected, virtual, inherited] |
Reimplemented in cinder::svg::LinearGradient, cinder::svg::RadialGradient, cinder::svg::Use, and cinder::svg::Group.
void cinder::svg::Node::startRender | ( | Renderer & | renderer, | |
const Style & | style | |||
) | const [protected, inherited] |
void cinder::svg::Node::finishRender | ( | Renderer & | renderer, | |
const Style & | style | |||
) | const [protected, inherited] |
virtual Rectf cinder::svg::Node::calcBoundingBox | ( | ) | const [protected, virtual, inherited] |
Paint cinder::svg::Node::parsePaint | ( | const char * | value, | |
bool * | specified, | |||
const Node * | parentNode | |||
) | [static, protected, inherited] |
MatrixAffine2f cinder::svg::Node::parseTransform | ( | const std::string & | value | ) | [static, protected, inherited] |
bool cinder::svg::Node::parseTransformComponent | ( | const char ** | c, | |
MatrixAffine2f * | result | |||
) | [static, protected, inherited] |
std::string cinder::svg::Node::findStyleValue | ( | const std::string & | styleString, | |
const std::string & | key | |||
) | [static, protected, inherited] |
void cinder::svg::Node::parseStyle | ( | const std::string & | value | ) | [protected, inherited] |
std::vector<Stop> cinder::svg::Gradient::mStops [protected] |
Vec2f cinder::svg::Gradient::mCoords0 [protected] |
Vec2f cinder::svg::Gradient::mCoords1 [protected] |
bool cinder::svg::Gradient::mUseObjectBoundingBox [protected] |
bool cinder::svg::Gradient::mSpecifiesTransform [protected] |
Reimplemented from cinder::svg::Node.
MatrixAffine2f cinder::svg::Gradient::mTransform [protected] |
Reimplemented from cinder::svg::Node.
const Node* cinder::svg::Node::mParent [protected, inherited] |
std::string cinder::svg::Node::mId [protected, inherited] |
Style cinder::svg::Node::mStyle [protected, inherited] |
bool cinder::svg::Node::mBoundingBoxCached [mutable, protected, inherited] |
Rectf cinder::svg::Node::mBoundingBox [mutable, protected, inherited] |