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

An instantiated ShadowTreeComponent, which points to the roots of parallel entity trees. More...

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

Collaboration diagram for donner::svg::components::ComputedShadowTreeComponent:
[legend]

Classes

struct  BranchStorage
 Storage for a single shadow tree. More...
 

Public Member Functions

 ComputedShadowTreeComponent ()=default
 Default constructor.
 
Entity mainLightRoot () const
 Get the target element for the main branch root, or entt::null if there is no main branch.
 
size_t offscreenShadowCount () const
 Get the number of additional shadow trees (offscreen trees).
 
std::span< const EntityoffscreenShadowEntities (size_t index) const
 Get the target element for the offscreen shadow tree.
 
Entity offscreenShadowRoot (size_t index) const
 Get the target element for the offscreen shadow tree.
 
std::optional< size_t > findOffscreenShadow (ShadowBranchType branchType) const
 Find the index of the offscreen shadow tree with the given branch type.
 

Public Attributes

std::optional< BranchStoragemainBranch
 If set, points to main branch of the shadow tree, or std::nullopt if there is no main branch instantiated.
 
std::vector< BranchStoragebranches
 Storage for additional shadow trees, such as ShadowBranchType::OffscreenFill or OffscreenStroke.
 

Detailed Description

An instantiated ShadowTreeComponent, which points to the roots of parallel entity trees.

This component attaches to the shadow host (where the tree is instantiated), and contains one or more shadow trees. Each shadow tree is a tree of entities, which are all children of the shadow host.

Each entity in the shadow tree has a ShadowEntityComponent attached.

Member Function Documentation

◆ findOffscreenShadow()

std::optional< size_t > donner::svg::components::ComputedShadowTreeComponent::findOffscreenShadow ( ShadowBranchType branchType) const
inline

Find the index of the offscreen shadow tree with the given branch type.

Parameters
branchTypeThe branch type to search for.
Returns
The index of the offscreen shadow tree, or std::nullopt if not found.

◆ offscreenShadowEntities()

std::span< const Entity > donner::svg::components::ComputedShadowTreeComponent::offscreenShadowEntities ( size_t index) const
inline

Get the target element for the offscreen shadow tree.

Parameters
indexThe index of the offscreen shadow tree, must be less than offscreenShadowCount().

◆ offscreenShadowRoot()

Entity donner::svg::components::ComputedShadowTreeComponent::offscreenShadowRoot ( size_t index) const
inline

Get the target element for the offscreen shadow tree.

Parameters
indexThe index of the offscreen shadow tree, must be less than offscreenShadowCount().

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