Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::components::ShadowTreeComponent Class Reference

Indicates the entry point to a shadow tree, which instantiates a virtual tree of entities mirroring another entity's tree. More...

#include "donner/svg/components/shadow/ShadowTreeComponent.h"

Public Member Functions

 ShadowTreeComponent ()=default
 Constructor.
 
std::optional< RcStringmainHref () const
 Get the href attribute for the shadow tree target.
 
void setMainHref (const RcStringOrRef &href)
 Set the href attribute for the shadow tree target, which must be an element reference (e.g.
 
std::optional< ResolvedReferencemainTargetEntity (Registry &registry) const
 Get the resolved entity for the main target of the shadow tree, if the mainHref was able to be resolved.
 

Public Attributes

bool setsContextColors = false
 Whether this shadow tree inherits the CSS context-color from the parent tree.
 

Detailed Description

Indicates the entry point to a shadow tree, which instantiates a virtual tree of entities mirroring another entity's tree.

For more information about shadow trees:

Note that only "<use>" elements are true shadow trees, paint servers are technically re-used graphics.

To use, create and call ShadowTreeComponent::setMainHref.

When instantiated, creates a BranchType::Main shadow tree, which is the main render graph. For other shadow trees, see OffscreenShadowTreeComponent.

Member Function Documentation

◆ mainHref()

std::optional< RcString > donner::svg::components::ShadowTreeComponent::mainHref ( ) const
inline

Get the href attribute for the shadow tree target.

Returns
The href attribute, or std::nullopt if not set.

◆ mainTargetEntity()

std::optional< ResolvedReference > donner::svg::components::ShadowTreeComponent::mainTargetEntity ( Registry & registry) const
inline

Get the resolved entity for the main target of the shadow tree, if the mainHref was able to be resolved.

Parameters
registryThe registry.
Returns
The resolved entity, or std::nullopt if not set.

◆ setMainHref()

void donner::svg::components::ShadowTreeComponent::setMainHref ( const RcStringOrRef & href)
inline

Set the href attribute for the shadow tree target, which must be an element reference (e.g.

"#otherEntity").

Parameters
hrefThe href attribute value.

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