iMSTK
Interactive Medical Simulation Toolkit
Public Member Functions | Protected Attributes | List of all members
imstk::CollisionDataDebugModel Class Reference

Class for visualizing CollisionData. Give it collision data and add it to the scene This class intentionally does not automatically update it provides debugUpdate which may be called by the user when appropriate (for debug purposes) More...

#include <imstkCollisionDataDebugModel.h>

Inheritance diagram for imstk::CollisionDataDebugModel:
Inheritance graph
[legend]
Collaboration diagram for imstk::CollisionDataDebugModel:
Collaboration graph
[legend]

Public Member Functions

void addCollisionElement (std::shared_ptr< PointSet > pointSet, const CollisionElement &elem)
 Append visual representation to the debug meshes for the given contact and geometry.
 
void printContactInfo (const CollisionElement &elem)
 Print the contact information.
 
void debugUpdate ()
 Updates visual representation to the current cd (we don't use the built in update as its useful to call this in specific spots in code for debug purposes)
 
void setInputCD (std::shared_ptr< CollisionData > cdData)
 Set/Get the input collision data for which geometry is generated for.
 
std::shared_ptr< CollisionDatagetInputCD () const
 
void setPrintContacts (const bool printContacts)
 Print collision contact data to stdout.
 
bool getPrintContacts () const
 
void setClearRate (const int clearRate)
 Set the amount of simulation frames to cache data for, this is useful if you have numerous simulation frames per render and data doesn't persist from one to the next.
 
int getClearRate () const
 
void setCountEmptyFrames (const bool countEmptyFrames)
 If on, frames without collision data won't be counted for clear rate.
 
int getCountEmptyFrames () const
 
- Public Member Functions inherited from imstk::DebugGeometryModel
 DebugGeometryModel (const std::string &name="DebugGeometryModel")
 
void addLine (const Vec3d &a, const Vec3d &b)
 Adds a line to the debug lines with default color.
 
void addLine (const Vec3d &a, const Vec3d &b, const Color &color)
 Adds a line to the debug lines with specified color.
 
void addTriangle (const Vec3d &a, const Vec3d &b, const Vec3d &c)
 Adds a triangle to the debug triangles with default color.
 
void addTriangle (const Vec3d &a, const Vec3d &b, const Vec3d &c, const Color &color)
 Adds a triangle to the debug triangles with specified color.
 
void addPoint (const Vec3d &a)
 Adds a point to the debug points. More...
 
void addPoint (const Vec3d &a, const Color &color)
 Adds a point to the debug points. More...
 
void addArrow (const Vec3d &start, const Vec3d &end)
 Adds an arrow to the debug arrows. More...
 
void addArrow (const Vec3d &start, const Vec3d &end, const Color &color)
 Adds an arrow to the debug arrows. More...
 
void clear ()
 Clears all primitives.
 
std::shared_ptr< RenderMaterialgetPointMaterial () const
 Accessors.
 
std::shared_ptr< RenderMaterialgetLineMaterial () const
 
std::shared_ptr< RenderMaterialgetFaceMaterial () const
 
void visualUpdate (const double &dt) override
 Update the primitives.
 
void setLineWidth (const double width)
 
void setTriColor (const Color &color)
 
void setLineColor (const Color &color)
 
void setPointColor (const Color &color)
 
void setArrowColor (const Color &color)
 
void setPointSize (const double size)
 
void setArrowScale (const double arrowScale)
 
int getNumPoints () const
 
int getNumLines () const
 
int getNumTriangles () const
 
- Public Member Functions inherited from imstk::Behaviour< UpdateInfo >
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< TaskGraphgetTaskGraph () const
 
- Public Member Functions inherited from imstk::Component
const std::string & getName () const
 
void setName (const std::string &name)
 
std::weak_ptr< EntitygetEntity () const
 Get parent entity.
 
void initialize ()
 Initialize the component, called at a later time after all component construction is complete.
 

Protected Attributes

std::shared_ptr< CollisionDatam_cdData = nullptr
 
bool m_printContacts = false
 
int m_clearRate = 1
 
int m_frameCounter = 0
 
bool m_countEmptyFrames = true
 
- Protected Attributes inherited from imstk::DebugGeometryModel
double m_arrowScale
 
Color m_arrowColor
 
std::shared_ptr< VisualModelm_debugLineModel
 
std::shared_ptr< VisualModelm_debugPointModel
 
std::shared_ptr< VisualModelm_debugSurfModel
 
std::shared_ptr< LineMeshm_debugLineMesh
 
std::shared_ptr< PointSetm_debugPointSet
 
std::shared_ptr< SurfaceMeshm_debugSurfMesh
 
std::shared_ptr< VecDataArray< double, 3 > > m_triVerticesPtr
 
std::shared_ptr< VecDataArray< int, 3 > > m_triIndicesPtr
 
std::shared_ptr< VecDataArray< unsigned char, 3 > > m_triColorsPtr
 
bool m_trianglesChanged
 
std::shared_ptr< VecDataArray< double, 3 > > m_lineVerticesPtr
 
std::shared_ptr< VecDataArray< int, 2 > > m_lineIndicesPtr
 
std::shared_ptr< VecDataArray< unsigned char, 3 > > m_lineColorsPtr
 
bool m_linesChanged
 
std::shared_ptr< VecDataArray< double, 3 > > m_pointVerticesPtr
 
std::shared_ptr< VecDataArray< unsigned char, 3 > > m_pointColorsPtr
 
bool m_ptsChanged
 
- Protected Attributes inherited from imstk::Behaviour< UpdateInfo >
std::shared_ptr< TaskGraphm_taskGraph = nullptr
 
- Protected Attributes inherited from imstk::Component
std::string m_name
 
std::weak_ptr< Entitym_entity
 Parent entity this component exists on.
 

Additional Inherited Members

- Protected Member Functions inherited from imstk::DebugGeometryModel
void init () override
 Initialize the component, called at a later time after all component construction is complete.
 
- Protected Member Functions inherited from imstk::Behaviour< UpdateInfo >
 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...
 
- Protected Member Functions inherited from imstk::Component
 Component (const std::string &name="Component")
 

Detailed Description

Class for visualizing CollisionData. Give it collision data and add it to the scene This class intentionally does not automatically update it provides debugUpdate which may be called by the user when appropriate (for debug purposes)

Definition at line 21 of file imstkCollisionDataDebugModel.h.


The documentation for this class was generated from the following files: