iMSTK
Interactive Medical Simulation Toolkit
|
The FemurObject implements a localized marching cubes. That is we've split up an image into a bunch of chunks. Our model reports on which voxels of the image were modified, we supply this to the local marching cubes and it will update only the respective chunks. More...
#include <FemurObject.h>
Public Member Functions | |
bool | initialize () override |
Initialize the scene object. | |
void | visualUpdate () override |
Update the isosurface before rendering, the isosurface is not used for simulation so we can afford to update it less frequently. | |
void | createVisualModels () |
Creates visual models for any chunk that has non-zero vertices and is not already generated. | |
void | setUseRandomChunkColors (const bool useRandom) |
bool | getUseRandomChunkColors () const |
![]() | |
LevelSetDeformableObject (const std::string &name="LevelSetDeformableObject") | |
std::shared_ptr< LevelSetModel > | getLevelSetModel () |
Get the LevelSet model of the object. | |
bool | initialize () override |
Initialize the LevelSet scene object. | |
![]() | |
size_t | getNumOfDOF () const |
Returns the number of degree of freedom. | |
void | updateGeometries () final |
Update the physics geometry and the apply the maps (if defined) | |
virtual void | updatePhysicsGeometry () |
Update only the physics geometry and apply collision map. | |
void | reset () override |
Reset the dynamic object by reseting the respective DynamicalModel and Geometry. | |
std::shared_ptr< Geometry > | getPhysicsGeometry () const |
Set/Get the geometry used for Physics computations. | |
virtual void | setPhysicsGeometry (std::shared_ptr< Geometry > geometry) |
std::shared_ptr< GeometryMap > | getPhysicsToCollidingMap () const |
Set/Get the Physics-to-Collision map. | |
void | setPhysicsToCollidingMap (std::shared_ptr< GeometryMap > map) |
std::shared_ptr< GeometryMap > | getPhysicsToVisualMap () const |
Set/Get the Physics-to-Visual map. | |
void | setPhysicsToVisualMap (std::shared_ptr< GeometryMap > map) |
virtual std::shared_ptr< AbstractDynamicalModel > | getDynamicalModel () const |
Set/Get dynamical model. | |
virtual void | setDynamicalModel (std::shared_ptr< AbstractDynamicalModel > dynaModel) |
![]() | |
CollidingObject (const std::string &name="CollidingObject") | |
void | update () override |
Update the SceneObject, called during scene update. | |
bool | didCollide (std::shared_ptr< CollidingObject > other) |
void | addCollision (std::shared_ptr< CollidingObject > other, std::shared_ptr< imstk::CollisionData > data) |
Add data for collision with the object `other. | |
const std::vector< std::shared_ptr< imstk::CollisionData > > & | getCollisions (std::shared_ptr< CollidingObject > other) const |
std::shared_ptr< Geometry > | getCollidingGeometry () const |
void | setCollidingGeometry (std::shared_ptr< Geometry > geometry) |
std::shared_ptr< GeometryMap > | getCollidingToVisualMap () const |
void | setCollidingToVisualMap (std::shared_ptr< GeometryMap > map) |
![]() | |
SceneObject (const std::string &name="SceneObject") | |
std::shared_ptr< TaskGraph > | getTaskGraph () const |
Get the computational graph. | |
std::shared_ptr< Geometry > | getVisualGeometry () const |
Sets the visual geometry, adds (sets the first) VisualModel. | |
void | setVisualGeometry (std::shared_ptr< Geometry > geometry) |
std::shared_ptr< VisualModel > | getVisualModel (const int index) const |
Get/add visual model. | |
void | addVisualModel (std::shared_ptr< VisualModel > visualModel) |
void | removeVisualModel (std::shared_ptr< VisualModel > visualModel) |
std::shared_ptr< TaskNode > | getUpdateNode () const |
Returns the computational node for updating. | |
std::shared_ptr< TaskNode > | getUpdateGeometryNode () const |
Returns the computational node for updating geometry. | |
void | initGraphEdges () |
Initializes the edges of the SceneObject's computational graph. | |
![]() | |
Entity (const std::string &name="Entity") | |
SIGNAL (Entity, modified) | |
EntityID | getID () const |
Get ID (ALWAYS query the ID in your code, DO NOT hardcode it) More... | |
virtual const std::string | getTypeName () const |
template<typename T > | |
std::shared_ptr< T > | addComponent () |
Create and return a component on this entity. | |
template<typename T > | |
std::shared_ptr< T > | addComponent (std::string name) |
void | addComponent (std::shared_ptr< Component > component) |
Add existing component to entity. | |
std::shared_ptr< Component > | getComponent (const unsigned int index) const |
Get a component by index. | |
template<typename T > | |
std::shared_ptr< T > | getComponent () const |
Get the first component of type T. | |
template<typename T > | |
std::shared_ptr< T > | getComponentN (const int index) const |
Get's the Nth component of type T. | |
template<class T > | |
bool | containsComponent () const |
Check if contains component of type T. | |
bool | containsComponent (std::shared_ptr< Component > component) const |
Check if contains given component. | |
template<typename T > | |
std::vector< std::shared_ptr< T > > | getComponents () const |
Get all components of type T. | |
const std::vector< std::shared_ptr< Component > > & | getComponents () |
void | removeComponent (std::shared_ptr< Component > component) |
Remove component if it exists. | |
const std::string & | getName () const |
Get/Set the name of the entity. | |
void | setName (const std::string &name) |
![]() | |
template<typename T > | |
void | postEvent (const T &e) |
Emits the event Direct observers will be immediately called, in sync Queued observers will receive the Command in their queue for later execution, reciever must implement doEvent. | |
template<typename T > | |
void | queueEvent (const T &e) |
Queues event directly to this. | |
void | doEvent () |
Do an event, if none exists return. | |
void | doAllEvents () |
Do all the events in the event queue. | |
void | foreachEvent (std::function< void(Command cmd)> func) |
Thread safe loop over all event commands, one can implement a custom handler. | |
void | rforeachEvent (std::function< void(Command cmd)> func) |
thread safe reverse loop over all event commands, one can implement a custom handler | |
void | clearEvents () |
Removes all events from queue cleans up copies of the event. | |
Protected Member Functions | |
void | updateModifiedVoxels () |
Forwards/copies the levelsets list of modified voxels to the isosurface extraction filters list of modified voxels. | |
virtual void | initGraphEdges (std::shared_ptr< TaskNode > source, std::shared_ptr< TaskNode > sink) override |
Setup connectivity of task graph. | |
![]() | |
void | initGraphEdges (std::shared_ptr< TaskNode > source, std::shared_ptr< TaskNode > sink) override |
Setup connectivity of task graph. | |
void | postModifiedAll () override |
Posts modified for all geometries. | |
DynamicObject (const std::string &name) | |
![]() | |
void | clearCollisions () |
resets the collision information | |
Protected Attributes | |
std::shared_ptr< LocalMarchingCubes > | m_isoExtract |
std::unordered_set< int > | m_chunksGenerated |
std::shared_ptr< TaskNode > | m_forwardModifiedVoxels |
bool | m_useRandomChunkColors = false |
![]() | |
std::shared_ptr< LevelSetModel > | m_levelSetModel = nullptr |
LevelSet mathematical model. | |
![]() | |
std::shared_ptr< AbstractDynamicalModel > | m_dynamicalModel = nullptr |
Dynamical model. | |
std::shared_ptr< Geometry > | m_physicsGeometry = nullptr |
Geometry used for Physics. | |
std::shared_ptr< GeometryMap > | m_physicsToCollidingGeomMap = nullptr |
Maps from Physics to collision geometry. | |
std::shared_ptr< GeometryMap > | m_physicsToVisualGeomMap = nullptr |
Maps from Physics to visual geometry. | |
![]() | |
std::shared_ptr< Geometry > | m_collidingGeometry = nullptr |
Geometry for collisions. | |
std::shared_ptr< GeometryMap > | m_collidingToVisualMap = nullptr |
Maps transformations to visual geometry. | |
Vec3d | m_force = Vec3d::Zero() |
std::unordered_map< std::shared_ptr< CollidingObject >, std::vector< std::shared_ptr< CollisionData > > > | m_collisions |
![]() | |
std::shared_ptr< TaskGraph > | m_taskGraph = nullptr |
Computational Graph. | |
![]() | |
std::vector< std::shared_ptr< Component > > | m_components |
EntityID | m_ID |
unique ID of entity | |
std::string | m_name |
Not unique name. | |
![]() | |
ParallelUtils::SpinLock | eventQueueLock |
std::deque< Command > | eventQueue |
std::vector< std::pair< std::string, std::vector< Observer > > > | queuedObservers |
std::vector< std::pair< std::string, std::vector< Observer > > > | directObservers |
Additional Inherited Members | |
![]() | |
using | Observer = std::tuple< bool, std::weak_ptr< EventObject >, std::function< void(Event *)> > |
![]() | |
static std::atomic< EntityID > | m_count { 0 } |
current count of entities | |
The FemurObject implements a localized marching cubes. That is we've split up an image into a bunch of chunks. Our model reports on which voxels of the image were modified, we supply this to the local marching cubes and it will update only the respective chunks.
Definition at line 29 of file FemurObject.h.