Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::components::AnimationSystem Class Reference

Evaluates declarative SVG animation elements at a document time and applies their values. More...

#include "donner/svg/components/animation/AnimationSystem.h"

Public Member Functions

void advance (Registry &registry, double documentTime, std::vector< ParseDiagnostic > *outWarnings=nullptr)
 Advance all animations to the given document time.
bool isAnimationTarget (Registry &registry, Entity targetEntity) const
 Return true when any animation element targets targetEntity.
bool dispatchMouseEvent (Registry &registry, Entity targetEntity, EventType type, double documentTime)
 Apply declarative begin/end mouse-event triggers to animation runtime state.
bool dispatchEvent (Registry &registry, Entity targetEntity, std::string_view name, bool bubbles, double documentTime)
 Deliver a host event name to declarative timing.

Detailed Description

Evaluates declarative SVG animation elements at a document time and applies their values.

Member Function Documentation

◆ advance()

void donner::svg::components::AnimationSystem::advance ( Registry & registry,
double documentTime,
std::vector< ParseDiagnostic > * outWarnings = nullptr )

Advance all animations to the given document time.

Parameters
registryThe ECS registry.
documentTimeThe current document time in seconds.
outWarningsIf non-null, warnings will be added to this vector.

◆ dispatchEvent()

bool donner::svg::components::AnimationSystem::dispatchEvent ( Registry & registry,
Entity targetEntity,
std::string_view name,
bool bubbles,
double documentTime )

Deliver a host event name to declarative timing.

Parameters
registryDocument storage.
targetEntityTarget element.
nameEvent name; no script is executed.
bubblesWhether ancestors receive the event.
documentTimeCurrent clock time.
Returns
Whether a runtime instance was retained.

◆ dispatchMouseEvent()

bool donner::svg::components::AnimationSystem::dispatchMouseEvent ( Registry & registry,
Entity targetEntity,
EventType type,
double documentTime )

Apply declarative begin/end mouse-event triggers to animation runtime state.

Parameters
registryDocument storage.
targetEntityHit element receiving the event.
typeMouse event type.
documentTimeEvent time in document seconds.
Returns
True when an animation interval changed.

◆ isAnimationTarget()

bool donner::svg::components::AnimationSystem::isAnimationTarget ( Registry & registry,
Entity targetEntity ) const

Return true when any animation element targets targetEntity.

An animation targets the entity named by its href, or its own parent when href is absent, so a container holding an animation element is a target without naming itself anywhere. References are resolved against the attached document without mutating animation state. Resource exhaustion conservatively returns true so structure-preserving edits cannot treat incomplete analysis as proof that an element is unobserved.

Parameters
registryThe ECS registry.
targetEntityEntity to test.
Returns
True for a target or incomplete analysis; false only for a proven non-target.

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