iMSTK
Interactive Medical Simulation Toolkit
|
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>
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< CollisionData > | getInputCD () 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 |
![]() | |
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< RenderMaterial > | getPointMaterial () const |
Accessors. | |
std::shared_ptr< RenderMaterial > | getLineMaterial () const |
std::shared_ptr< RenderMaterial > | getFaceMaterial () 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 |
![]() | |
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 Attributes | |
std::shared_ptr< CollisionData > | m_cdData = nullptr |
bool | m_printContacts = false |
int | m_clearRate = 1 |
int | m_frameCounter = 0 |
bool | m_countEmptyFrames = true |
![]() | |
double | m_arrowScale |
Color | m_arrowColor |
std::shared_ptr< VisualModel > | m_debugLineModel |
std::shared_ptr< VisualModel > | m_debugPointModel |
std::shared_ptr< VisualModel > | m_debugSurfModel |
std::shared_ptr< LineMesh > | m_debugLineMesh |
std::shared_ptr< PointSet > | m_debugPointSet |
std::shared_ptr< SurfaceMesh > | m_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 |
![]() | |
std::shared_ptr< TaskGraph > | m_taskGraph = nullptr |
![]() | |
std::string | m_name |
std::weak_ptr< Entity > | m_entity |
Parent entity this component exists on. | |
Additional Inherited Members | |
![]() | |
void | init () override |
Initialize the component, called at a later time after all component construction is complete. | |
![]() | |
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") | |
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.