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 >:
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. More...
 
 TriangleMeshPlyReaderDelegate (std::shared_ptr< MeshType > mesh)
 Constructor. More...
 
std::shared_ptr< MeshTypegetMesh ()
 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. 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::ListData m_listData
 
std::shared_ptr< MeshTypem_mesh
 The mesh that will be created. More...
 
std::array< size_t, 3 > m_face
 
std::array< size_t, 2 > m_edge
 

Private Attributes

bool m_hasTextureCoordinates
 Set to true if s/t coordinates are found in the .ply file. More...
 
bool m_hasFaces
 Set to true if faces are found in the .ply file. More...
 
bool m_hasEdges
 Set to true if edges 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

◆ MeshType

Constructor & Destructor Documentation

◆ TriangleMeshPlyReaderDelegate() [1/2]

Default constructor.

◆ TriangleMeshPlyReaderDelegate() [2/2]

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

◆ beginEdges()

template<class M >
void * SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::beginEdges ( const std::string elementName,
size_t  edgeCount 
)

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

◆ endEdges()

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

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

◆ endFile()

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

Callback function to finalize processing of the mesh.

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

◆ processEdge()

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

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

Member Data Documentation

◆ m_edge

template<class M >
std::array<size_t, 2> SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::m_edge
protected

◆ m_face

template<class M >
std::array<size_t, 3> SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::m_face
protected

◆ m_hasEdges

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

Set to true if edges are found in the .ply file.

◆ m_hasFaces

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

Set to true if faces are found in the .ply file.

◆ m_hasTextureCoordinates

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

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

◆ m_listData

◆ m_mesh

template<class M >
std::shared_ptr<MeshType> SurgSim::DataStructures::TriangleMeshPlyReaderDelegate< M >::m_mesh
protected

The mesh that will be created.

◆ m_vertexData


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