Skip to content

EntropyCanvas::ISceneGraph

Interface for scene graph implementations. More…

#include <ISceneGraph.h>

Inherited by EntropyCanvas::SceneGraph

Name
virtual~ISceneGraph() =default
virtual booltick(float deltaTime) =0
Tick the scene (process systems, observers, etc.).
virtual voidsetTransform(flecs::entity entity, const Transform & transform) =0
Update Transform component (triggers observers).
virtual voidsetParent(flecs::entity child, flecs::entity parent) =0
Set parent-child relationship.
virtual voidqueryTransforms(std::function< void(flecs::entity, const Transform &)> callback) const =0
Query all entities with Transform component.
virtual boolmodifyTransform(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::entitygetParent(flecs::entity entity) const =0
Get parent entity.
virtual size_tgetEntityCount() const =0
Get total entity count.
virtual std::vector< flecs::entity >getChildren(flecs::entity entity) const =0
Get all children of an entity.
virtual voiddestroyEntity(flecs::entity entity) =0
Destroy an entity and all its children (cascade delete via ChildOf).
virtual flecs::entitycreateEntity(const char * name =nullptr, const Transform * transform =nullptr, flecs::entity parent =flecs::entity::null()) =0
Create a new entity with optional Transform component.
virtual voidclear() =0
Clear all entities (reset scene).
virtual voidaddTransform(flecs::entity entity, const Transform & transform) =0
Add Transform component to an entity.
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)
virtual ~ISceneGraph() =default
virtual bool tick(
float deltaTime
) =0

Tick the scene (process systems, observers, etc.).

Parameters:

  • deltaTime Time step in seconds

Return: True if world is still active

Reimplemented by: EntropyCanvas::SceneGraph::tick

virtual void setTransform(
flecs::entity entity,
const Transform & transform
) =0

Update Transform component (triggers observers).

Parameters:

  • entity Target entity
  • transform New transform value

Reimplemented by: EntropyCanvas::SceneGraph::setTransform

virtual void setParent(
flecs::entity child,
flecs::entity parent
) =0

Set parent-child relationship.

Parameters:

  • child Child entity
  • parent Parent entity (null to remove parent)

Reimplemented by: EntropyCanvas::SceneGraph::setParent

virtual void queryTransforms(
std::function< void(flecs::entity, const Transform &)> callback
) const =0

Query all entities with Transform component.

Parameters:

  • callback Function called for each entity

Reimplemented by: EntropyCanvas::SceneGraph::queryTransforms

virtual bool modifyTransform(
flecs::entity entity,
std::function< void(Transform &)> callback
) =0

Modify 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

virtual flecs::world & getWorld() =0

Get the underlying Flecs world (for advanced use).

Return: Reference to Flecs world

Reimplemented by: EntropyCanvas::SceneGraph::getWorld

virtual const flecs::world & getWorld() const =0

Reimplemented by: EntropyCanvas::SceneGraph::getWorld

virtual std::optional< Transform > getTransform(
flecs::entity entity
) const =0

Get Transform component from an entity.

Parameters:

  • entity Target entity

Return: Optional transform value

Reimplemented by: EntropyCanvas::SceneGraph::getTransform

virtual flecs::entity getParent(
flecs::entity entity
) const =0

Get parent entity.

Parameters:

  • entity Child entity

Return: Parent entity (null if no parent)

Reimplemented by: EntropyCanvas::SceneGraph::getParent

virtual size_t getEntityCount() const =0

Get total entity count.

Reimplemented by: EntropyCanvas::SceneGraph::getEntityCount

virtual std::vector< flecs::entity > getChildren(
flecs::entity entity
) const =0

Get all children of an entity.

Parameters:

  • entity Parent entity

Return: Vector of child entities

Reimplemented by: EntropyCanvas::SceneGraph::getChildren

virtual void destroyEntity(
flecs::entity entity
) =0

Destroy an entity and all its children (cascade delete via ChildOf).

Parameters:

  • entity Entity to destroy

Reimplemented by: EntropyCanvas::SceneGraph::destroyEntity

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.

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

virtual void clear() =0

Clear all entities (reset scene).

Reimplemented by: EntropyCanvas::SceneGraph::clear

virtual void addTransform(
flecs::entity entity,
const Transform & transform
) =0

Add 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