All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M > Class Template Reference

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

#include <SurgSim/DataStructures/TriangleMeshPlyReaderDelegate.h>

Inheritance diagram for SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >:
Inheritance graph
[legend]
Collaboration diagram for SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >:
Collaboration graph
[legend]

Classes

struct  FaceData
 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. More...
 
 TriangleMeshPlyReaderDelegate (std::shared_ptr< MeshType > mesh)
 Constructor. More...
 
std::shared_ptr< MeshTypegetMesh ()
 Gets the mesh. More...
 
virtual bool registerDelegate (PlyReader *reader) override
 Registers the delegate with the reader, overridden from. More...
 
virtual 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 endFile ()
 Callback function to finalize processing of the mesh. More...
 
- Public Member Functions inherited from SurgSim::DataStructures::PlyReaderDelegate
virtual ~PlyReaderDelegate ()
 Virtual destructor. More...
 

Protected Member Functions

bool hasTextureCoordinates ()
 

Protected Attributes

struct
SurgSim::DataStructures::TriangleMeshPlyReaderDelegate::VertexData 
m_vertexData
 
struct
SurgSim::DataStructures::TriangleMeshPlyReaderDelegate::FaceData 
m_faceData
 
std::shared_ptr< MeshTypem_mesh
 The mesh that will be created. More...
 
std::array< size_t, 3 > m_indices
 

Private Attributes

bool m_hasTextureCoordinates
 Set to true if s/t coordinates are found in the .ply file. More...
 

Detailed Description

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

Implementation of PlyReaderDelegate for simple triangle meshes.

Member Typedef Documentation

Constructor & Destructor Documentation

Default constructor.

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

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.
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.
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.
template<class M >
void SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::endFile ( )

Callback function to finalize processing of the mesh.

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.
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.

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

Gets the mesh.

Returns
The mesh.
template<class M >
bool SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::hasTextureCoordinates ( )
protected
Returns
true if s/t coordinates where found in the ply file on registration.
template<class M >
void SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::processFace ( const std::string &  elementName)

Callback function to process one face.

Parameters
elementNameName of the element.
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.

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.

Member Data Documentation

template<class M>
bool SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::m_hasTextureCoordinates
private

Set to true if s/t coordinates are found in the .ply file.

template<class M>
std::array<size_t, 3> SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::m_indices
protected
template<class M>
std::shared_ptr<MeshType> SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::m_mesh
protected

The mesh that will be created.


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