EBGeometry 1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
PLY< T > Class Template Reference

Class for storing Stanford PLY meshes. More...

#include <EBGeometry_PLY.hpp>

Public Member Functions

 PLY () noexcept
 Default constructor. Initializes empty member data holder.
 
 PLY (const std::string a_id) noexcept
 Constructor. Initializes empty vertices and facets but sets the PLY ID (usually the file name.
 
virtual ~PLY () noexcept
 Destructor. Clears all data.
 
std::string & getID () noexcept
 Get the identifier for this object.
 
const std::string & getID () const noexcept
 Get the identifier for this object.
 
std::vector< Vec3T< T > > & getVertexCoordinates () noexcept
 Get the vertex coordinates.
 
const std::vector< Vec3T< T > > & getVertexCoordinates () const noexcept
 Get the vertex coordinates.
 
std::vector< std::vector< size_t > > & getFacets () noexcept
 Get the face indices.
 
const std::vector< std::vector< size_t > > & getFacets () const noexcept
 Get the face indices.
 
std::vector< T > & getVertexProperties (const std::string a_property) noexcept
 Get the vertex properties.
 
const std::vector< T > & getVertexProperties (const std::string a_property) const noexcept
 Get the vertex properties.
 
std::vector< T > & getFaceProperties (const std::string a_property) noexcept
 Get the face properties.
 
const std::vector< T > & getFaceProperties (const std::string a_property) const noexcept
 Get the vertex properties.
 
void setVertexProperties (const std::string a_property, const std::vector< T > &a_data) noexcept
 Set vertex properties.
 
void setFaceProperties (const std::string a_property, const std::vector< T > &a_data) noexcept
 Set face properties.
 
template<typename Meta >
std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > convertToDCEL () const noexcept
 Turn the PLY mesh into a DCEL mesh.
 

Protected Attributes

std::string m_id
 PLY object ID.
 
std::vector< Vec3T< T > > m_vertexCoordinates
 Vertex coordinates.
 
std::vector< std::vector< size_t > > m_facets
 Faces – each entry in the outer vector contains the indices defining one face.
 
std::map< std::string, std::vector< T > > m_vertexProperties
 Vertex properties.
 
std::map< std::string, std::vector< T > > m_faceProperties
 Face properties.
 

Detailed Description

template<typename T>
class PLY< T >

Class for storing Stanford PLY meshes.

Note
T is the precision used for storing the mesh.

Constructor & Destructor Documentation

◆ PLY()

template<typename T >
PLY< T >::PLY ( const std::string  a_id)
noexcept

Constructor. Initializes empty vertices and facets but sets the PLY ID (usually the file name.

Parameters
[in]a_idIdentifier for PLY object

Member Function Documentation

◆ convertToDCEL()

template<typename T >
template<typename Meta >
std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > PLY< T >::convertToDCEL ( ) const
noexcept

Turn the PLY mesh into a DCEL mesh.

This call does not populate any meta-data in the DCEL mesh structures. If you need to also populate the meta-data on vertices and faces, you should not use this function but supply your own constructor.

◆ getFaceProperties() [1/2]

template<typename T >
const std::vector< T > & PLY< T >::getFaceProperties ( const std::string  a_property) const
noexcept

Get the vertex properties.

Parameters
[in]a_propertyWhich property to fetch
Note
Function will fail if the property does not exist
Returns
m_vertexProperties at provided property

◆ getFaceProperties() [2/2]

template<typename T >
std::vector< T > & PLY< T >::getFaceProperties ( const std::string  a_property)
noexcept

Get the face properties.

Parameters
[in]a_propertyWhich property to fetch
Note
Function will fail if the property does not exist
Returns
m_faceProperties at provided property

◆ getFacets() [1/2]

template<typename T >
const std::vector< std::vector< size_t > > & PLY< T >::getFacets ( ) const
noexcept

Get the face indices.

Returns
m_facets

◆ getFacets() [2/2]

template<typename T >
std::vector< std::vector< size_t > > & PLY< T >::getFacets ( )
noexcept

Get the face indices.

Returns
m_facets

◆ getVertexCoordinates() [1/2]

template<typename T >
const std::vector< Vec3T< T > > & PLY< T >::getVertexCoordinates ( ) const
noexcept

Get the vertex coordinates.

Returns
m_vertexCoordinates

◆ getVertexCoordinates() [2/2]

template<typename T >
std::vector< Vec3T< T > > & PLY< T >::getVertexCoordinates ( )
noexcept

Get the vertex coordinates.

Returns
m_vertexCoordinates

◆ getVertexProperties() [1/2]

template<typename T >
const std::vector< T > & PLY< T >::getVertexProperties ( const std::string  a_property) const
noexcept

Get the vertex properties.

Parameters
[in]a_propertyWhich property to fetch
Note
Function will fail if the property does not exist
Returns
m_vertexProperties at provided property

◆ getVertexProperties() [2/2]

template<typename T >
std::vector< T > & PLY< T >::getVertexProperties ( const std::string  a_property)
noexcept

Get the vertex properties.

Parameters
[in]a_propertyWhich property to fetch
Note
Function will fail if the property does not exist
Returns
m_vertexProperties at provided property

◆ setFaceProperties()

template<typename T >
void PLY< T >::setFaceProperties ( const std::string  a_property,
const std::vector< T > &  a_data 
)
noexcept

Set face properties.

Parameters
[in]a_propertyProperty name
[in]a_dataProperty data

◆ setVertexProperties()

template<typename T >
void PLY< T >::setVertexProperties ( const std::string  a_property,
const std::vector< T > &  a_data 
)
noexcept

Set vertex properties.

Parameters
[in]a_propertyProperty name
[in]a_dataProperty data

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