EntropyCanvas::ISceneGraph
EntropyCanvas::ISceneGraph
Section titled “EntropyCanvas::ISceneGraph”Interface for scene graph implementations. More…
#include <ISceneGraph.h>
Inherited by EntropyCanvas::SceneGraph
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual | ~ISceneGraph() =default |
| virtual bool | tick(float deltaTime) =0 Tick the scene (process systems, observers, etc.). |
| virtual void | setTransform(flecs::entity entity, const Transform & transform) =0 Update Transform component (triggers observers). |
| virtual void | setParent(flecs::entity child, flecs::entity parent) =0 Set parent-child relationship. |
| virtual void | queryTransforms(std::function< void(flecs::entity, const Transform &)> callback) const =0 Query all entities with Transform component. |
| virtual bool | modifyTransform(flecs::entity entity, std::function< void(Transform &)> callback) =0 Modify Transform component with a callback. |
| virtual flecs::world & | getWorld() =0 Get the underlying Flecs world (for advanced use). |
| virtual const flecs::world & | getWorld() const =0 |
| virtual std::optional< Transform > | getTransform(flecs::entity entity) const =0 Get Transform component from an entity. |
| virtual flecs::entity | getParent(flecs::entity entity) const =0 Get parent entity. |
| virtual size_t | getEntityCount() const =0 Get total entity count. |
| virtual std::vector< flecs::entity > | getChildren(flecs::entity entity) const =0 Get all children of an entity. |
| virtual void | destroyEntity(flecs::entity entity) =0 Destroy an entity and all its children (cascade delete via ChildOf). |
| virtual flecs::entity | createEntity(const char * name =nullptr, const Transform * transform =nullptr, flecs::entity parent =flecs::entity::null()) =0 Create a new entity with optional Transform component. |
| virtual void | clear() =0 Clear all entities (reset scene). |
| virtual void | addTransform(flecs::entity entity, const Transform & transform) =0 Add Transform component to an entity. |
Detailed Description
Section titled “Detailed Description”class EntropyCanvas::ISceneGraph;Interface for scene graph implementations.
Defines the core scene graph contract used by SDK, Portal, and CanvasEngine. Implementations provide entity management, hierarchy, and component operations.
- SceneGraph: Basic implementation (SDK/Portal)
- PersistentSceneGraph: Adds USD persistence, DeltaTracker, etc. (CanvasEngine)
Public Functions Documentation
Section titled “Public Functions Documentation”function ~ISceneGraph
Section titled “function ~ISceneGraph”virtual ~ISceneGraph() =defaultfunction tick
Section titled “function tick”virtual bool tick( float deltaTime) =0Tick the scene (process systems, observers, etc.).
Parameters:
- deltaTime Time step in seconds
Return: True if world is still active
Reimplemented by: EntropyCanvas::SceneGraph::tick
function setTransform
Section titled “function setTransform”virtual void setTransform( flecs::entity entity, const Transform & transform) =0Update Transform component (triggers observers).
Parameters:
- entity Target entity
- transform New transform value
Reimplemented by: EntropyCanvas::SceneGraph::setTransform
function setParent
Section titled “function setParent”virtual void setParent( flecs::entity child, flecs::entity parent) =0Set parent-child relationship.
Parameters:
- child Child entity
- parent Parent entity (null to remove parent)
Reimplemented by: EntropyCanvas::SceneGraph::setParent
function queryTransforms
Section titled “function queryTransforms”virtual void queryTransforms( std::function< void(flecs::entity, const Transform &)> callback) const =0Query all entities with Transform component.
Parameters:
- callback Function called for each entity
Reimplemented by: EntropyCanvas::SceneGraph::queryTransforms
function modifyTransform
Section titled “function modifyTransform”virtual bool modifyTransform( flecs::entity entity, std::function< void(Transform &)> callback) =0Modify Transform component with a callback.
Parameters:
- entity Target entity
- callback Function to modify the transform
Return: True if entity has Transform and callback was executed
Reimplemented by: EntropyCanvas::SceneGraph::modifyTransform
function getWorld
Section titled “function getWorld”virtual flecs::world & getWorld() =0Get the underlying Flecs world (for advanced use).
Return: Reference to Flecs world
Reimplemented by: EntropyCanvas::SceneGraph::getWorld
function getWorld
Section titled “function getWorld”virtual const flecs::world & getWorld() const =0Reimplemented by: EntropyCanvas::SceneGraph::getWorld
function getTransform
Section titled “function getTransform”virtual std::optional< Transform > getTransform( flecs::entity entity) const =0Get Transform component from an entity.
Parameters:
- entity Target entity
Return: Optional transform value
Reimplemented by: EntropyCanvas::SceneGraph::getTransform
function getParent
Section titled “function getParent”virtual flecs::entity getParent( flecs::entity entity) const =0Get parent entity.
Parameters:
- entity Child entity
Return: Parent entity (null if no parent)
Reimplemented by: EntropyCanvas::SceneGraph::getParent
function getEntityCount
Section titled “function getEntityCount”virtual size_t getEntityCount() const =0Get total entity count.
Reimplemented by: EntropyCanvas::SceneGraph::getEntityCount
function getChildren
Section titled “function getChildren”virtual std::vector< flecs::entity > getChildren( flecs::entity entity) const =0Get all children of an entity.
Parameters:
- entity Parent entity
Return: Vector of child entities
Reimplemented by: EntropyCanvas::SceneGraph::getChildren
function destroyEntity
Section titled “function destroyEntity”virtual void destroyEntity( flecs::entity entity) =0Destroy an entity and all its children (cascade delete via ChildOf).
Parameters:
- entity Entity to destroy
Reimplemented by: EntropyCanvas::SceneGraph::destroyEntity
function createEntity
Section titled “function createEntity”virtual flecs::entity createEntity( const char * name =nullptr, const Transform * transform =nullptr, flecs::entity parent =flecs::entity::null()) =0Create a new entity with optional Transform component.
Parameters:
- name Optional entity name (for debugging)
- transform Optional initial transform
- parent Optional parent entity (creates ChildOf relationship)
Return: Flecs entity handle
Reimplemented by: EntropyCanvas::SceneGraph::createEntity
function clear
Section titled “function clear”virtual void clear() =0Clear all entities (reset scene).
Reimplemented by: EntropyCanvas::SceneGraph::clear
function addTransform
Section titled “function addTransform”virtual void addTransform( flecs::entity entity, const Transform & transform) =0Add Transform component to an entity.
Parameters:
- entity Target entity
- transform Initial transform value
Reimplemented by: EntropyCanvas::SceneGraph::addTransform
Updated on 2026-01-26 at 17:14:35 -0500