9 #include "imstkComponent.h" 10 #include "imstkColor.h" 11 #include "imstkMath.h" 19 template<
typename T,
int N>
class VecDataArray;
42 void addLine(
const Vec3d& a,
const Vec3d& b);
47 void addLine(
const Vec3d& a,
const Vec3d& b,
const Color& color);
52 void addTriangle(
const Vec3d& a,
const Vec3d& b,
const Vec3d& c);
57 void addTriangle(
const Vec3d& a,
const Vec3d& b,
const Vec3d& c,
const Color& color);
77 void addArrow(
const Vec3d& start,
const Vec3d& end);
85 void addArrow(
const Vec3d& start,
const Vec3d& end,
const Color& color);
94 std::shared_ptr<RenderMaterial> getLineMaterial()
const;
95 std::shared_ptr<RenderMaterial> getFaceMaterial()
const;
102 void setLineWidth(
const double width);
104 void setTriColor(
const Color& color);
105 void setLineColor(
const Color& color);
106 void setPointColor(
const Color& color);
107 void setArrowColor(
const Color& color);
109 void setPointSize(
const double size);
111 void setArrowScale(
const double arrowScale) { m_arrowScale = arrowScale; }
113 int getNumPoints()
const;
114 int getNumLines()
const;
115 int getNumTriangles()
const;
121 std::shared_ptr<VisualModel> m_debugLineModel;
122 std::shared_ptr<VisualModel> m_debugPointModel;
123 std::shared_ptr<VisualModel> m_debugSurfModel;
125 std::shared_ptr<LineMesh> m_debugLineMesh;
126 std::shared_ptr<PointSet> m_debugPointSet;
127 std::shared_ptr<SurfaceMesh> m_debugSurfMesh;
129 std::shared_ptr<VecDataArray<double, 3>> m_triVerticesPtr;
130 std::shared_ptr<VecDataArray<int, 3>> m_triIndicesPtr;
131 std::shared_ptr<VecDataArray<unsigned char, 3>> m_triColorsPtr;
132 bool m_trianglesChanged;
134 std::shared_ptr<VecDataArray<double, 3>> m_lineVerticesPtr;
135 std::shared_ptr<VecDataArray<int, 2>> m_lineIndicesPtr;
136 std::shared_ptr<VecDataArray<unsigned char, 3>> m_lineColorsPtr;
139 std::shared_ptr<VecDataArray<double, 3>> m_pointVerticesPtr;
140 std::shared_ptr<VecDataArray<unsigned char, 3>> m_pointColorsPtr;
void visualUpdate(const double &dt) override
Update the primitives.
Class for quickly rendering and showing various primivites such as line segments, triangles...
void addTriangle(const Vec3d &a, const Vec3d &b, const Vec3d &c)
Adds a triangle to the debug triangles with default color.
void addPoint(const Vec3d &a)
Adds a point to the debug points.
void init() override
Initialize the component, called at a later time after all component construction is complete...
A Behaviour represents a single component system A template is used here for UpdateInfo to keep the C...
void addLine(const Vec3d &a, const Vec3d &b)
Adds a line to the debug lines with default color.
std::shared_ptr< RenderMaterial > getPointMaterial() const
Accessors.
void addArrow(const Vec3d &start, const Vec3d &end)
Adds an arrow to the debug arrows.
void clear()
Clears all primitives.