PrimManagerBase#
Fully qualified name: isaacsim::core::includes::PrimManagerBase
-
template<class ComponentType>
class PrimManagerBase : public isaacsim::core::includes::ComponentManager, public pxr::TfWeakBase# Base template class for bridge applications managing USD-based components.
Provides core functionality for managing components within a USD stage, including component lifecycle management, event handling, and synchronization with USD changes. This class serves as a bridge between the USD stage and component-based application logic.
Note
This class inherits from ComponentManager and pxr::TfWeakBase
Warning
Derived classes must implement pure virtual functions
- Template Parameters:
ComponentType – The base component type managed by this application
Public Functions
-
PrimManagerBase() = default#
Constructs a new PrimManagerBase instance.
-
inline ~PrimManagerBase()#
Destroys the application instance and cleans up resources.
Releases the notice listener and deletes all managed components
-
inline virtual void initialize(pxr::UsdStageWeakPtr stage)#
Initializes the application with a USD stage.
Sets up the stage reference and creates the notice listener
- Parameters:
stage – [in] Weak pointer to the USD stage to be managed
- Post:
Application is initialized with the stage and notice listener
-
virtual void tick(double dt) = 0#
Updates the application and all components.
Pure virtual function that must be implemented by derived classes
- Parameters:
dt – [in] Time step in seconds since the last tick
-
inline virtual void initComponents()#
Initializes components from the current stage.
Scans the USD stage for prims matching component types and creates corresponding components. Uses the USD runtime API for efficient traversal.
-
virtual std::vector<std::string> getComponentIsAVector() const = 0#
Gets the list of component type names to search for in the stage.
- Returns:
Vector of strings containing component type names
-
virtual void onComponentAdd(const pxr::UsdPrim &prim) = 0#
Creates a new component for the given prim.
Pure virtual function that must be implemented by derived classes
- Parameters:
prim – [in] The USD prim to create a component for
-
inline virtual void onComponentChange(const pxr::UsdPrim &prim)#
Updates a component when its corresponding prim changes.
Triggers the component’s change handler if it exists
- Parameters:
prim – [in] The USD prim that changed
-
inline virtual void onPhysicsStep(float dt)#
Updates components during physics simulation steps.
Override this to implement physics-specific component updates
- Parameters:
dt – [in] Physics time step in seconds
-
inline virtual void onComponentRemove(const pxr::SdfPath &primPath)#
Removes components associated with a prim and its descendants.
Safely removes components when their corresponding prims are deleted from the stage. Uses a mutex to ensure thread-safe component removal.
- Thread Safety
This method is thread-safe
- Parameters:
primPath – [in] Path to the prim being removed
-
inline virtual void deleteAllComponents()#
Removes all components and performs cleanup.
Thread-safe method to remove all components and release their resources
- Thread Safety
This method is thread-safe
-
inline virtual void onStart()#
Handles application start event.
Optional callback that runs when the application starts Override this to implement custom start behavior
-
inline virtual void onStop()#
Handles application stop event.
Optional callback that runs when the application stops Override this to implement custom stop behavior
Protected Attributes
-
std::unordered_map<std::string, std::unique_ptr<ComponentType>> m_components#
Map of component paths to their corresponding component instances.
-
std::unique_ptr<PrimManagerUsdNoticeListener> m_noticeListener#
USD notice listener for stage changes.
-
double m_timeSeconds = 0#
Current simulation time in seconds.
-
int64_t m_timeNanoSeconds = 0#
Current simulation time in nanoseconds.
-
double m_timeDelta = 0#
Time delta for current tick in seconds.