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

An instance of the entity in the rendering tree. More...

#include "donner/svg/components/RenderingInstanceComponent.h"

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

Public Member Functions

 RenderingInstanceComponent ()=default
 Default constructor.
 
EntityHandle dataHandle (Registry &registry) const
 Shortcut for creating a handle for the dataEntity, the entity containing the structural components of the instance like ClassComponent.
 
EntityHandle styleHandle (Registry &registry) const
 A handle for the entity containing style information, which may be different than the dataHandle if this instance is within a shadow tree.
 
bool isShadow (Registry &registry) const
 Return true if this is a shadow tree instance.
 

Public Attributes

int drawOrder = 0
 The draw order of the element, computed from the traversal order of the tree.
 
bool visible = true
 Whether the element is visible. Note that elements may still influence rendering behavior when they are hidden, such as "<pattern>" elements.
 
bool isolatedLayer = false
 True if this instance establishes a new rendering layer, such as if there is opacity.
 
Transformd entityFromWorldTransform
 The canvas-space transform of the element, element-from-world.
 
std::optional< BoxdclipRect
 The clip rect of the element, if set.
 
std::optional< ResolvedClipPathclipPath
 The clip path of the element, if set.
 
std::optional< ResolvedMaskmask
 The mask of the element, if set.
 
std::optional< ResolvedMarkermarkerStart
 The resolved marker for marker-start, if any.
 
std::optional< ResolvedMarkermarkerMid
 The resolved marker for marker-mid, if any.
 
std::optional< ResolvedMarkermarkerEnd
 The resolved marker for marker-end, if any.
 
Entity dataEntity = entt::null
 The entity containing the structural components of the instance, element-specific components like IdComponent.
 
ResolvedPaintServer resolvedFill = PaintServer::None()
 The resolved paint server for the instance's fill, if any.
 
ResolvedPaintServer resolvedStroke = PaintServer::None()
 The resolved paint server for the instance's stroke, if any.
 
std::optional< ResolvedFilterEffectresolvedFilter
 The resolved filter effect on this instance, if any.
 
std::optional< SubtreeInfosubtreeInfo
 Information about this elements subtree, if there is a rendering-influencing subtree attached to this entity.
 

Detailed Description

An instance of the entity in the rendering tree.

Each renderered entity has an instance with a unique drawOrder, which enables this list to be sorted and traversed to render the tree.

Member Function Documentation

◆ dataHandle()

EntityHandle donner::svg::components::RenderingInstanceComponent::dataHandle ( Registry & registry) const
inline

Shortcut for creating a handle for the dataEntity, the entity containing the structural components of the instance like ClassComponent.

Parameters
registryThe registry to use.
Returns
A handle for the dataEntity.

◆ isShadow()

bool donner::svg::components::RenderingInstanceComponent::isShadow ( Registry & registry) const
inline

Return true if this is a shadow tree instance.

Parameters
registryThe registry to use.
Returns
True if this is a shadow tree instance.

◆ styleHandle()

EntityHandle donner::svg::components::RenderingInstanceComponent::styleHandle ( Registry & registry) const
inline

A handle for the entity containing style information, which may be different than the dataHandle if this instance is within a shadow tree.

Parameters
registryThe registry to use.
Returns
A handle for the style entity.

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