opensurgsim
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M > Class Template Reference

Implementation of PlyReaderDelegate for simple triangle meshes. More...

#include <TriangleMeshPlyReaderDelegate.h>

Inheritance diagram for SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >:
SurgSim::DataStructures::PlyReaderDelegate

Classes

struct  ListData
 Internal structure, the received for data from the "face" element. More...
 
struct  VertexData
 Internal structure, the receiver for data from the "vertex" element Provide space for standard ply vertex data, x/y/z and s/t. More...
 

Public Types

typedef M MeshType
 

Public Member Functions

 TriangleMeshPlyReaderDelegate ()
 Default constructor.
 
 TriangleMeshPlyReaderDelegate (std::shared_ptr< MeshType > mesh)
 Constructor. More...
 
std::shared_ptr< MeshType > getMesh ()
 Gets the mesh. More...
 
bool registerDelegate (PlyReader *reader) override
 Registers the delegate with the reader, overridden from. More...
 
bool fileIsAcceptable (const PlyReader &reader) override
 Check whether this file is acceptable to the delegate, overridden from. More...
 
void * beginVertices (const std::string &elementName, size_t vertexCount)
 Callback function, begin the processing of vertices. More...
 
virtual 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 * beginFaces (const std::string &elementName, size_t faceCount)
 Callback function, begin the processing of faces. More...
 
void processFace (const std::string &elementName)
 Callback function to process one face. More...
 
void endFaces (const std::string &elementName)
 Callback function to finalize processing of faces. More...
 
void * beginEdges (const std::string &elementName, size_t edgeCount)
 
void processEdge (const std::string &elementName)
 
void endEdges (const std::string &elementName)
 
void endFile ()
 Callback function to finalize processing of the mesh.
 
- Public Member Functions inherited from SurgSim::DataStructures::PlyReaderDelegate
virtual ~PlyReaderDelegate ()
 Virtual destructor.
 

Protected Member Functions

bool hasTextureCoordinates ()
 

Protected Attributes

struct SurgSim::DataStructures::TriangleMeshPlyReaderDelegate::VertexData m_vertexData
 
struct SurgSim::DataStructures::TriangleMeshPlyReaderDelegate::ListData m_listData
 
std::shared_ptr< MeshType > m_mesh
 The mesh that will be created.
 
std::array< size_t, 3 > m_face
 
std::array< size_t, 2 > m_edge = {}
 

Detailed Description

template<class M>
class SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >

Implementation of PlyReaderDelegate for simple triangle meshes.

Constructor & Destructor Documentation

§ TriangleMeshPlyReaderDelegate()

template<class M >
SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::TriangleMeshPlyReaderDelegate ( std::shared_ptr< MeshType >  mesh)
explicit

Constructor.

Parameters
meshThe mesh to be used, it will be cleared by the constructor.

Member Function Documentation

§ beginFaces()

template<class M >
void * SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::beginFaces ( const std::string &  elementName,
size_t  faceCount 
)

Callback function, begin the processing of faces.

Parameters
elementNameName of the element.
faceCountNumber of faces.
Returns
memory for face data to the reader.

§ beginVertices()

template<class M >
void * SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::beginVertices ( const std::string &  elementName,
size_t  vertexCount 
)

Callback function, begin the processing of vertices.

Parameters
elementNameName of the element.
vertexCountNumber of vertices.
Returns
memory for vertex data to the reader.

§ endFaces()

template<class M >
void SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::endFaces ( const std::string &  elementName)

Callback function to finalize processing of faces.

Parameters
elementNameName of the element.

§ endVertices()

template<class M >
void SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::endVertices ( const std::string &  elementName)

Callback function to finalize processing of vertices.

Parameters
elementNameName of the element.

§ fileIsAcceptable()

template<class M >
bool SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::fileIsAcceptable ( const PlyReader reader)
overridevirtual

Check whether this file is acceptable to the delegate, overridden from.

See also
PlyReaderDelegate.
Parameters
readerThe reader that should be used.
Returns
true if it succeeds, false otherwise.

Implements SurgSim::DataStructures::PlyReaderDelegate.

§ getMesh()

template<class M >
std::shared_ptr< M > SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::getMesh ( )

Gets the mesh.

Returns
The mesh.

§ hasTextureCoordinates()

template<class M >
bool SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::hasTextureCoordinates ( )
protected
Returns
true if s/t coordinates where found in the ply file on registration.

§ processFace()

template<class M >
void SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::processFace ( const std::string &  elementName)

Callback function to process one face.

Parameters
elementNameName of the element.

§ processVertex()

template<class M >
void SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::processVertex ( const std::string &  elementName)
virtual

Callback function to process one vertex.

Parameters
elementNameName of the element.

Reimplemented in SurgSim::Graphics::MeshPlyReaderDelegate.

§ registerDelegate()

template<class M >
bool SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::registerDelegate ( PlyReader reader)
overridevirtual

Registers the delegate with the reader, overridden from.

See also
PlyReaderDelegate.
Parameters
readerThe reader that should be used.
Returns
true if it succeeds, false otherwise.

Implements SurgSim::DataStructures::PlyReaderDelegate.


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