Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SurgSim::Physics::FemPlyReaderDelegate Class Referenceabstract

Common part of implementation of PlyReaderDelegate for FemRepresentations. More...

#include <SurgSim/Physics/FemPlyReaderDelegate.h>

Inheritance diagram for SurgSim::Physics::FemPlyReaderDelegate:
SurgSim::DataStructures::PlyReaderDelegate SurgSim::Physics::Fem1DPlyReaderDelegate SurgSim::Physics::Fem2DPlyReaderDelegate SurgSim::Physics::Fem3DPlyReaderDelegate

Classes

struct  ElementData
 Internal data to receive the fem element. More...
 
struct  MaterialData
 Internal data to receive the "material" data. More...
 

Public Member Functions

 FemPlyReaderDelegate (std::shared_ptr< FemRepresentation > fem)
 Constructor. More...
 
- Public Member Functions inherited from SurgSim::DataStructures::PlyReaderDelegate
virtual ~PlyReaderDelegate ()
 Virtual destructor. More...
 

Protected Member Functions

virtual std::string getElementName () const =0
 
virtual bool registerDelegate (SurgSim::DataStructures::PlyReader *reader) override
 Registers the delegate with the reader. More...
 
virtual 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 to make sure that all the elements and properties that are required are available in the file encapsulated by the reader. More...
 
void startParseFile ()
 Callback for beginning of PlyReader::parseFile. More...
 
virtual void endParseFile ()
 Callback for end of PlyReader::parseFile. More...
 
void * beginVertices (const std::string &elementName, size_t vertexCount)
 Callback function, begin the processing of vertices. More...
 
void processVertex (const std::string &elementName)
 Callback function to process one vertex. More...
 
void endVertices (const std::string &elementName)
 Callback function to finalize processing of vertices. More...
 
void * beginFemElements (const std::string &elementName, size_t elementCount)
 Callback function, begin the processing of FemElements. More...
 
virtual void processFemElement (const std::string &elementName)=0
 Callback function to process one FemElement. More...
 
void endFemElements (const std::string &elementName)
 Callback function to finalize processing of FemElements. More...
 
void * beginMaterials (const std::string &elementName, size_t materialCount)
 Callback function, begin the processing of materials. More...
 
void endMaterials (const std::string &elementName)
 Callback function, end the processing of materials. More...
 
void * beginBoundaryConditions (const std::string &elementName, size_t boundaryConditionCount)
 Callback function, begin the processing of boundary conditions. More...
 
void processBoundaryCondition (const std::string &elementName)
 Callback function to process one boundary condition. More...
 

Protected Attributes

bool m_hasBoundaryConditions
 Flag indicating if the associated file has boundary conditions. More...
 
unsigned int m_boundaryConditionData
 Internal data to receive the "boundary_condition" element. More...
 
double * m_vertexIterator
 Internal iterator to save the "vertex" element. More...
 
std::array< double, 3 > m_vertexData
 Internal data to receive the "vertex" element. More...
 
std::shared_ptr< FemRepresentationm_fem
 The fem that will be created by loading. More...
 
std::shared_ptr< SurgSim::Math::OdeStatem_state
 The state that will be created by loading. More...
 
struct SurgSim::Physics::FemPlyReaderDelegate::MaterialData m_materialData
 
struct SurgSim::Physics::FemPlyReaderDelegate::ElementData m_femData
 

Detailed Description

Common part of implementation of PlyReaderDelegate for FemRepresentations.

This is an abstract class and needs to be inherited. Methods 'registerDelegate()' and 'fileIsAcceptable()' need to be overridden.

Constructor & Destructor Documentation

SurgSim::Physics::FemPlyReaderDelegate::FemPlyReaderDelegate ( std::shared_ptr< FemRepresentation fem)
explicit

Constructor.

Parameters
femThe object that is updated when PlyReader::parseFile is called.

Member Function Documentation

void * SurgSim::Physics::FemPlyReaderDelegate::beginBoundaryConditions ( const std::string elementName,
size_t  boundaryConditionCount 
)
protected

Callback function, begin the processing of boundary conditions.

Parameters
elementNameName of the element.
boundaryConditionCountNumber of boundary conditions.
Returns
memory for boundary conditions data to the reader.
void * SurgSim::Physics::FemPlyReaderDelegate::beginFemElements ( const std::string elementName,
size_t  elementCount 
)
protected

Callback function, begin the processing of FemElements.

Parameters
elementNameName of the element.
elementCountNumber of elements.
Returns
memory for FemElement data to the reader.
void * SurgSim::Physics::FemPlyReaderDelegate::beginMaterials ( const std::string elementName,
size_t  materialCount 
)
protected

Callback function, begin the processing of materials.

Parameters
elementNameName of the element.
materialCountNumber of materials.
Returns
memory for material data to the reader.
void * SurgSim::Physics::FemPlyReaderDelegate::beginVertices ( const std::string elementName,
size_t  vertexCount 
)
protected

Callback function, begin the processing of vertices.

Parameters
elementNameName of the element.
vertexCountNumber of vertices.
Returns
memory for vertex data to the reader.
void SurgSim::Physics::FemPlyReaderDelegate::endFemElements ( const std::string elementName)
protected

Callback function to finalize processing of FemElements.

Parameters
elementNameName of the element.
void SurgSim::Physics::FemPlyReaderDelegate::endMaterials ( const std::string elementName)
protected

Callback function, end the processing of materials.

Parameters
elementNameName of the element.
void SurgSim::Physics::FemPlyReaderDelegate::endParseFile ( )
protectedvirtual
void SurgSim::Physics::FemPlyReaderDelegate::endVertices ( const std::string elementName)
protected

Callback function to finalize processing of vertices.

Parameters
elementNameName of the element.
bool SurgSim::Physics::FemPlyReaderDelegate::fileIsAcceptable ( const SurgSim::DataStructures::PlyReader reader)
overrideprotectedvirtual

Check whether the file in the reader can be used with this delegate, this gives the delegate a chance to make sure that all the elements and properties that are required are available in the file encapsulated by the reader.

Implements SurgSim::DataStructures::PlyReaderDelegate.

Reimplemented in SurgSim::Physics::Fem1DPlyReaderDelegate, and SurgSim::Physics::Fem2DPlyReaderDelegate.

virtual std::string SurgSim::Physics::FemPlyReaderDelegate::getElementName ( ) const
protectedpure virtual
void SurgSim::Physics::FemPlyReaderDelegate::processBoundaryCondition ( const std::string elementName)
protected

Callback function to process one boundary condition.

Parameters
elementNameName of the element.
virtual void SurgSim::Physics::FemPlyReaderDelegate::processFemElement ( const std::string elementName)
protectedpure virtual

Callback function to process one FemElement.

Parameters
elementNameName of the element.

Implemented in SurgSim::Physics::Fem1DPlyReaderDelegate, SurgSim::Physics::Fem2DPlyReaderDelegate, and SurgSim::Physics::Fem3DPlyReaderDelegate.

void SurgSim::Physics::FemPlyReaderDelegate::processVertex ( const std::string elementName)
protected

Callback function to process one vertex.

Parameters
elementNameName of the element.
bool SurgSim::Physics::FemPlyReaderDelegate::registerDelegate ( SurgSim::DataStructures::PlyReader reader)
overrideprotectedvirtual

Registers the delegate with the reader.

Parameters
[out]readerThe reader that should be used by the delegate.
Returns
true usually if the reader is valid and fileIsAcceptable() is true.

Implements SurgSim::DataStructures::PlyReaderDelegate.

Reimplemented in SurgSim::Physics::Fem1DPlyReaderDelegate, and SurgSim::Physics::Fem2DPlyReaderDelegate.

void SurgSim::Physics::FemPlyReaderDelegate::startParseFile ( )
protected

Callback for beginning of PlyReader::parseFile.

Member Data Documentation

unsigned int SurgSim::Physics::FemPlyReaderDelegate::m_boundaryConditionData
protected

Internal data to receive the "boundary_condition" element.

std::shared_ptr<FemRepresentation> SurgSim::Physics::FemPlyReaderDelegate::m_fem
protected

The fem that will be created by loading.

struct SurgSim::Physics::FemPlyReaderDelegate::ElementData SurgSim::Physics::FemPlyReaderDelegate::m_femData
protected
bool SurgSim::Physics::FemPlyReaderDelegate::m_hasBoundaryConditions
protected

Flag indicating if the associated file has boundary conditions.

struct SurgSim::Physics::FemPlyReaderDelegate::MaterialData SurgSim::Physics::FemPlyReaderDelegate::m_materialData
protected
std::shared_ptr<SurgSim::Math::OdeState> SurgSim::Physics::FemPlyReaderDelegate::m_state
protected

The state that will be created by loading.

std::array<double, 3> SurgSim::Physics::FemPlyReaderDelegate::m_vertexData
protected

Internal data to receive the "vertex" element.

double* SurgSim::Physics::FemPlyReaderDelegate::m_vertexIterator
protected

Internal iterator to save the "vertex" element.


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