16 #ifndef SURGSIM_PHYSICS_MASSSPRINGPLYREADERDELEGATE_H 17 #define SURGSIM_PHYSICS_MASSSPRINGPLYREADERDELEGATE_H 24 #include "SurgSim/DataStructures/PlyReaderDelegate.h" 30 class MassSpringModel;
89 virtual void*
beginVertices(
const std::string& elementName,
size_t vertexCount);
97 virtual void endVertices(
const std::string& elementName);
103 void*
beginElements(
const std::string& elementName,
size_t elementCount);
117 void*
beginSprings(
const std::string& elementName,
size_t elementCount);
125 void endSprings(
const std::string& elementName);
141 void*
beginRadius(
const std::string& elementName,
size_t radiusCount);
145 void endRadius(
const std::string& elementName);
151 void*
beginThickness(
const std::string& elementName,
size_t thicknessCount);
161 double x = std::numeric_limits<double>::signaling_NaN();
162 double y = std::numeric_limits<double>::signaling_NaN();
163 double z = std::numeric_limits<double>::signaling_NaN();
164 double mass = std::numeric_limits<double>::signaling_NaN();
187 unsigned int* indices =
nullptr;
188 unsigned int nodeCount = 0;
189 int64_t overrun2 = -1;
196 unsigned int* indices =
nullptr;
197 unsigned int nodeCount = 0;
198 int64_t overrun2 = -1;
199 double stiffness = std::numeric_limits<double>::signaling_NaN();
200 double damping = std::numeric_limits<double>::signaling_NaN();
206 double m_radius = std::numeric_limits<double>::signaling_NaN();
211 double m_thickness = std::numeric_limits<double>::signaling_NaN();
220 #endif // SURGSIM_PHYSICS_MASSSPRINGPLYREADERDELEGATE_H Internal data to receive the spring (stretching and bending) data.
Definition: MassSpringPlyReaderDelegate.h:193
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
virtual void processSpring(const std::string &elementName)
Callback function to process one Spring.
Definition: MassSpringPlyReaderDelegate.cpp:232
virtual void processElement(const std::string &elementName)
Callback function to process one Element.
Definition: MassSpringPlyReaderDelegate.cpp:205
virtual void processBoundaryCondition(const std::string &elementName)
Callback function to process one boundary condition.
Definition: MassSpringPlyReaderDelegate.cpp:259
int64_t overrun1
Used to check for buffer overruns.
Definition: MassSpringPlyReaderDelegate.h:165
void * beginBoundaryConditions(const std::string &elementName, size_t boundaryConditionCount)
Callback function, begin the processing of boundary conditions.
Definition: MassSpringPlyReaderDelegate.cpp:253
Mass data containing 3 translational dofs and mass.
Definition: MassSpringPlyReaderDelegate.h:159
bool fileIsAcceptable(const SurgSim::DataStructures::PlyReader &reader) override
Check whether the file in the reader can be used with this delegate, this gives the delegate a chance...
Definition: MassSpringPlyReaderDelegate.cpp:142
Internal data to receive the element (nodeId) data.
Definition: MassSpringPlyReaderDelegate.h:184
void * beginThickness(const std::string &elementName, size_t thicknessCount)
Callback function, begin the processing of thickness.
Definition: MassSpringPlyReaderDelegate.cpp:275
virtual void endParseFile()
Callback for end of PlyReader::parseFile.
Definition: MassSpringPlyReaderDelegate.cpp:286
double m_thickness
Thickness information, if any.
Definition: MassSpringPlyReaderDelegate.h:211
unsigned int m_boundaryConditionData
Internal data to receive the "boundary_condition" element.
Definition: MassSpringPlyReaderDelegate.h:172
void * beginRadius(const std::string &elementName, size_t radiusCount)
Callback function, begin the processing of radius.
Definition: MassSpringPlyReaderDelegate.cpp:264
Wrapper for the C .ply file parser This class wraps the main functionality for the original C ...
Definition: PlyReader.h:85
virtual void processVertex(const std::string &elementName)
Callback function to process one vertex.
Definition: MassSpringPlyReaderDelegate.cpp:182
void endRadius(const std::string &elementName)
Callback function, end the processing of radius.
Definition: MassSpringPlyReaderDelegate.cpp:269
bool m_has3dElement
Flag indicating if the associated file has 3d elements.
Definition: MassSpringPlyReaderDelegate.h:181
bool m_hasRadius
Flag indicating if the associated file has a radius.
Definition: MassSpringPlyReaderDelegate.h:204
bool m_has1dElement
Flag indicating if the associated file has 1d elements.
Definition: MassSpringPlyReaderDelegate.h:175
virtual void * beginVertices(const std::string &elementName, size_t vertexCount)
Callback function, begin the processing of vertices.
Definition: MassSpringPlyReaderDelegate.cpp:176
bool m_has2dElement
Flag indicating if the associated file has 2d elements.
Definition: MassSpringPlyReaderDelegate.h:178
double m_radius
Radius information, if any.
Definition: MassSpringPlyReaderDelegate.h:206
void * beginElements(const std::string &elementName, size_t elementCount)
Callback function, begin the processing of Elements.
Definition: MassSpringPlyReaderDelegate.cpp:198
bool m_hasBoundaryConditions
Flag indicating if the associated file has boundary conditions.
Definition: MassSpringPlyReaderDelegate.h:169
MassSpringPlyReaderDelegate()
Default constructor.
Definition: MassSpringPlyReaderDelegate.cpp:30
virtual void endVertices(const std::string &elementName)
Callback function to finalize processing of vertices.
Definition: MassSpringPlyReaderDelegate.cpp:191
Common part of implementation of PlyReaderDelegate for MassSpringRepresentations. ...
Definition: MassSpringPlyReaderDelegate.h:69
void endElements(const std::string &elementName)
Callback function to finalize processing of Elements.
Definition: MassSpringPlyReaderDelegate.cpp:217
void * beginSprings(const std::string &elementName, size_t elementCount)
Callback function, begin the processing of Springs.
Definition: MassSpringPlyReaderDelegate.cpp:225
bool m_hasThickness
Flag indicating if the associated file has a thickness.
Definition: MassSpringPlyReaderDelegate.h:209
void endSprings(const std::string &elementName)
Callback function to finalize processing of Springs.
Definition: MassSpringPlyReaderDelegate.cpp:245
std::shared_ptr< MassSpringModel > m_mesh
MassSpringModel to contain the ply file information.
Definition: MassSpringPlyReaderDelegate.h:214
void endThickness(const std::string &elementName)
Callback function, end the processing of thickness.
Definition: MassSpringPlyReaderDelegate.cpp:280
bool registerDelegate(SurgSim::DataStructures::PlyReader *reader) override
Registers the delegate with the reader.
Definition: MassSpringPlyReaderDelegate.cpp:41
PlyReaderDelegate abstract class.
Definition: PlyReaderDelegate.h:31