NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
novasvg::SVGElement Class Reference

#include <svgelement.h>

Inheritance diagram for novasvg::SVGElement:
Collaboration diagram for novasvg::SVGElement:

Public Member Functions

 SVGElement (Document *document, ElementID id)
 
virtual ~SVGElement ()=default
 
bool hasAttribute (std::string_view name) const
 
const std::string & getAttribute (std::string_view name) const
 
bool setAttribute (std::string_view name, const std::string &value)
 
const Attribute * findAttribute (PropertyID id) const
 
bool hasAttribute (PropertyID id) const
 
const std::string & getAttribute (PropertyID id) const
 
bool setAttribute (int specificity, PropertyID id, const std::string &value)
 
void setAttributes (const AttributeList &attributes)
 
bool setAttribute (const Attribute &attribute)
 
virtual void parseAttribute (PropertyID id, const std::string &value)
 
SVGElement * previousElement () const
 
SVGElement * nextElement () const
 
SVGNode * addChild (std::unique_ptr< SVGNode > child)
 
SVGNode * firstChild () const
 
SVGNode * lastChild () const
 
ElementID id () const
 
const AttributeList & attributes () const
 
const SVGPropertyList & properties () const
 
const SVGNodeList & children () const
 
virtual Transform localTransform () const
 
virtual Rect fillBoundingBox () const
 
virtual Rect strokeBoundingBox () const
 
virtual Rect paintBoundingBox () const
 
SVGMarkerElement * getMarker (std::string_view id) const
 
SVGClipPathElement * getClipper (std::string_view id) const
 
SVGMaskElement * getMasker (std::string_view id) const
 
SVGFilterElement * getFilterElement (std::string_view id) const
 
SVGPaintElement * getPainter (std::string_view id) const
 
SVGElement * elementFromPoint (float x, float y)
 
template<typename T >
void transverse (T callback)
 
void addProperty (SVGProperty &value)
 
SVGProperty * getProperty (PropertyID id) const
 
Size currentViewportSize () const
 
float font_size () const
 
void cloneChildren (SVGElement *parentElement) const
 
std::unique_ptr< SVGNode > clone (bool deep) const final
 
virtual void build ()
 
virtual void layoutElement (const SVGLayoutState &state)
 
void layoutChildren (SVGLayoutState &state)
 
virtual void layout (SVGLayoutState &state)
 
void renderChildren (SVGRenderState &state) const
 
virtual void render (SVGRenderState &state) const
 
virtual std::shared_ptr< Canvas > applyFilterPrimitive (SVGFilterContext &context) const
 
bool isDisplayNone () const
 
bool isOverflowHidden () const
 
bool isVisibilityHidden () const
 
bool isHiddenElement () const
 
bool isPointableElement () const
 
const SVGClipPathElement * clipper () const
 
const SVGMaskElement * masker () const
 
const SVGFilterElement * filterElement () const
 
float opacity () const
 
MixBlendMode mixBlendMode () const
 
bool isElement () const final
 
- Public Member Functions inherited from novasvg::SVGNode
 SVGNode (Document *document)
 
virtual ~SVGNode ()=default
 
virtual bool isTextNode () const
 
virtual bool isPaintElement () const
 
virtual bool isGraphicsElement () const
 
virtual bool isGeometryElement () const
 
virtual bool isTextPositioningElement () const
 
Document * document () const
 
SVGRootElement * rootElement () const
 
SVGElement * parentElement () const
 
void setParentElement (SVGElement *parent)
 
bool isRootElement () const
 

Static Public Member Functions

static std::unique_ptr< SVGElement > create (Document *document, ElementID id)
 

Detailed Description

Definition at line 820 of file svgelement.h.

Constructor & Destructor Documentation

◆ SVGElement()

NOVASVG_INLINE novasvg::SVGElement::SVGElement ( Document *  document,
ElementID  id 
)

Definition at line 5191 of file svgelement.h.

◆ ~SVGElement()

virtual novasvg::SVGElement::~SVGElement ( )
virtualdefault

Member Function Documentation

◆ addChild()

NOVASVG_INLINE SVGNode * novasvg::SVGElement::addChild ( std::unique_ptr< SVGNode >  child)

Definition at line 5333 of file svgelement.h.

References novasvg::SVGNode::setParentElement().

Referenced by novasvg::SVGUseElement::build(), and cloneChildren().

◆ addProperty()

◆ applyFilterPrimitive()

virtual std::shared_ptr< Canvas > novasvg::SVGElement::applyFilterPrimitive ( SVGFilterContext &  context) const
inlinevirtual

◆ attributes()

◆ build()

NOVASVG_INLINE void novasvg::SVGElement::build ( )
virtual

Reimplemented in novasvg::SVGUseElement.

Definition at line 5516 of file svgelement.h.

References novasvg::toSVGElement().

Referenced by novasvg::SVGUseElement::build().

◆ children()

◆ clipper()

const SVGClipPathElement * novasvg::SVGElement::clipper ( ) const
inline

◆ clone()

NOVASVG_INLINE std::unique_ptr< SVGNode > novasvg::SVGElement::clone ( bool  deep) const
finalvirtual

Implements novasvg::SVGNode.

Definition at line 5508 of file svgelement.h.

References cloneChildren(), create(), and novasvg::SVGNode::document().

◆ cloneChildren()

NOVASVG_INLINE void novasvg::SVGElement::cloneChildren ( SVGElement *  parentElement) const

Definition at line 5501 of file svgelement.h.

References addChild(), and novasvg::SVGNode::parentElement().

Referenced by clone().

◆ create()

◆ currentViewportSize()

◆ elementFromPoint()

NOVASVG_INLINE SVGElement * novasvg::SVGElement::elementFromPoint ( float  x,
float  y 
)

◆ fillBoundingBox()

◆ filterElement()

const SVGFilterElement * novasvg::SVGElement::filterElement ( ) const
inline

Definition at line 903 of file svgelement.h.

◆ findAttribute()

NOVASVG_INLINE const Attribute * novasvg::SVGElement::findAttribute ( PropertyID  id) const

Definition at line 5221 of file svgelement.h.

◆ firstChild()

NOVASVG_INLINE SVGNode * novasvg::SVGElement::firstChild ( ) const

Definition at line 5340 of file svgelement.h.

◆ font_size()

float novasvg::SVGElement::font_size ( ) const
inline

Definition at line 871 of file svgelement.h.

Referenced by novasvg::LengthContext::valueForLength().

◆ getAttribute() [1/2]

NOVASVG_INLINE const std::string & novasvg::SVGElement::getAttribute ( PropertyID  id) const

Definition at line 5243 of file svgelement.h.

References novasvg::emptyString, and novasvg::Attribute::value().

◆ getAttribute() [2/2]

NOVASVG_INLINE const std::string & novasvg::SVGElement::getAttribute ( std::string_view  name) const

◆ getClipper()

NOVASVG_INLINE SVGClipPathElement * novasvg::SVGElement::getClipper ( std::string_view  id) const

◆ getFilterElement()

NOVASVG_INLINE SVGFilterElement * novasvg::SVGElement::getFilterElement ( std::string_view  id) const

◆ getMarker()

NOVASVG_INLINE SVGMarkerElement * novasvg::SVGElement::getMarker ( std::string_view  id) const

◆ getMasker()

NOVASVG_INLINE SVGMaskElement * novasvg::SVGElement::getMasker ( std::string_view  id) const

◆ getPainter()

NOVASVG_INLINE SVGPaintElement * novasvg::SVGElement::getPainter ( std::string_view  id) const

◆ getProperty()

NOVASVG_INLINE SVGProperty * novasvg::SVGElement::getProperty ( PropertyID  id) const

Definition at line 5465 of file svgelement.h.

Referenced by parseAttribute().

◆ hasAttribute() [1/2]

NOVASVG_INLINE bool novasvg::SVGElement::hasAttribute ( PropertyID  id) const

Definition at line 5232 of file svgelement.h.

◆ hasAttribute() [2/2]

◆ id()

◆ isDisplayNone()

◆ isElement()

bool novasvg::SVGElement::isElement ( ) const
inlinefinalvirtual

Reimplemented from novasvg::SVGNode.

Definition at line 907 of file svgelement.h.

◆ isHiddenElement()

◆ isOverflowHidden()

bool novasvg::SVGElement::isOverflowHidden ( ) const
inline

◆ isPointableElement()

◆ isVisibilityHidden()

bool novasvg::SVGElement::isVisibilityHidden ( ) const
inline

◆ lastChild()

NOVASVG_INLINE SVGNode * novasvg::SVGElement::lastChild ( ) const

Definition at line 5347 of file svgelement.h.

◆ layout()

NOVASVG_INLINE void novasvg::SVGElement::layout ( SVGLayoutState &  state)
virtual

◆ layoutChildren()

NOVASVG_INLINE void novasvg::SVGElement::layoutChildren ( SVGLayoutState &  state)

Definition at line 5541 of file svgelement.h.

References novasvg::toSVGElement().

Referenced by layout().

◆ layoutElement()

◆ localTransform()

◆ masker()

const SVGMaskElement * novasvg::SVGElement::masker ( ) const
inline

Definition at line 902 of file svgelement.h.

Referenced by novasvg::SVGMaskElement::applyMask().

◆ mixBlendMode()

MixBlendMode novasvg::SVGElement::mixBlendMode ( ) const
inline

Definition at line 905 of file svgelement.h.

◆ nextElement()

NOVASVG_INLINE SVGElement * novasvg::SVGElement::nextElement ( ) const

◆ opacity()

◆ paintBoundingBox()

◆ parseAttribute()

NOVASVG_INLINE void novasvg::SVGElement::parseAttribute ( PropertyID  id,
const std::string &  value 
)
virtual

◆ previousElement()

NOVASVG_INLINE SVGElement * novasvg::SVGElement::previousElement ( ) const

◆ properties()

const SVGPropertyList & novasvg::SVGElement::properties ( ) const
inline

Definition at line 849 of file svgelement.h.

◆ render()

◆ renderChildren()

◆ setAttribute() [1/3]

NOVASVG_INLINE bool novasvg::SVGElement::setAttribute ( const Attribute &  attribute)

◆ setAttribute() [2/3]

NOVASVG_INLINE bool novasvg::SVGElement::setAttribute ( int  specificity,
PropertyID  id,
const std::string &  value 
)

Definition at line 5254 of file svgelement.h.

References parseAttribute().

◆ setAttribute() [3/3]

NOVASVG_INLINE bool novasvg::SVGElement::setAttribute ( std::string_view  name,
const std::string &  value 
)

◆ setAttributes()

NOVASVG_INLINE void novasvg::SVGElement::setAttributes ( const AttributeList &  attributes)

Definition at line 5271 of file svgelement.h.

References attributes(), and setAttribute().

◆ strokeBoundingBox()

◆ transverse()

template<typename T >
void novasvg::SVGElement::transverse ( T  callback)
inline

Definition at line 949 of file svgelement.h.

References novasvg::toSVGElement().


The documentation for this class was generated from the following file: