iMSTK
Interactive Medical Simulation Toolkit
|
A Behaviour represents a single component system A template is used here for UpdateInfo to keep the ComponentModel library more general and separable. UpdateInfo could be anything you need from outside to update the component, this would generally be your own struct or just a single primitive such as double timestep. More...
#include <imstkComponent.h>
Public Member Functions | |
virtual void | update (const UpdateInfo &imstkNotUsed(updateData)) |
virtual void | visualUpdate (const UpdateInfo &imstkNotUsed(updateData)) |
void | initTaskGraphEdges () |
Setup the edges/connections of the TaskGraph. | |
std::shared_ptr< TaskGraph > | getTaskGraph () const |
![]() | |
const std::string & | getName () const |
void | setName (const std::string &name) |
std::weak_ptr< Entity > | getEntity () const |
Get parent entity. | |
void | initialize () |
Initialize the component, called at a later time after all component construction is complete. | |
Protected Member Functions | |
Behaviour (const std::string &name="Behaviour") | |
Behaviour (const bool useTaskGraph, const std::string &name="Behaviour") | |
virtual void | initGraphEdges (std::shared_ptr< TaskNode > imstkNotUsed(source), std::shared_ptr< TaskNode > imstkNotUsed(sink)) |
Setup the edges/connections of the TaskGraph. More... | |
![]() | |
Component (const std::string &name="Component") | |
virtual void | init () |
Initialize the component, called at a later time after all component construction is complete. | |
Protected Attributes | |
std::shared_ptr< TaskGraph > | m_taskGraph = nullptr |
![]() | |
std::string | m_name |
std::weak_ptr< Entity > | m_entity |
Parent entity this component exists on. | |
A Behaviour represents a single component system A template is used here for UpdateInfo to keep the ComponentModel library more general and separable. UpdateInfo could be anything you need from outside to update the component, this would generally be your own struct or just a single primitive such as double timestep.
Behaviour provides two ways of defining system logic.
All TaskGraph's are joined into the Scene TaskGraph. If any node is shared (occurs in both) between TaskGraphs, they will join/become one. For example, graphA could define A->B->C. Whilst graphB defines D->B->E. B is shared. This allows one to order calls easily and extensibly.
When dealing with large amounts of similar components one may also consider making a separate system of components. For example, how the Scene is a system of Components. The Renderer is a system of VisualModel components. This is more cache friendly.
Definition at line 89 of file imstkComponent.h.
|
inlineprotectedvirtual |
Setup the edges/connections of the TaskGraph.
sink,last | node of the graph (does no function) |
Definition at line 129 of file imstkComponent.h.