Euclid
Geometry Processing and Shape Analysis in C++
Euclid::CommonPlyReader< VN, FloatType, IndexType, ColorType > Class Template Reference

A ply reader for a common set of properties. More...

#include <PlyIO.h>

Inheritance diagram for Euclid::CommonPlyReader< VN, FloatType, IndexType, ColorType >:
Euclid::PlyReader

Public Member Functions

 CommonPlyReader (std::vector< FloatType > &positions, std::vector< FloatType > *normals=nullptr, std::vector< FloatType > *texcoords=nullptr, std::vector< IndexType > *indices=nullptr, std::vector< ColorType > *colors=nullptr)
 Constructor. More...
 
void on_read (const PlyHeader &header) override
 On reading the header. More...
 
void read (const PlyDoubleProperty *property, std::ifstream &stream, PlyFormat format) override
 Read a PlyDoubleProperty.
 
void read (const PlyFloatProperty *property, std::ifstream &stream, PlyFormat format) override
 Read a PlyFloatProperty.
 
void read (const PlyIntProperty *property, std::ifstream &stream, PlyFormat format) override
 Read a PlyIntProperty.
 
void read (const PlyUintProperty *property, std::ifstream &stream, PlyFormat format) override
 Read a PlyUintProperty.
 
void read (const PlyUcharProperty *property, std::ifstream &stream, PlyFormat format) override
 Read a PlyUcharProperty.
 
- Public Member Functions inherited from Euclid::PlyReader
virtual void read (const PlyShortProperty *, std::ifstream &, PlyFormat)
 Read a PlyShortProperty.
 
virtual void read (const PlyUshortProperty *, std::ifstream &, PlyFormat)
 Read a PlyUshortProperty.
 
virtual void read (const PlyCharProperty *, std::ifstream &, PlyFormat)
 Read a PlyCharProperty.
 

Additional Inherited Members

- Protected Attributes inherited from Euclid::PlyReader
bool _sys_little_endian
 

Detailed Description

template<int VN, typename FloatType, typename IndexType, typename ColorType>
class Euclid::CommonPlyReader< VN, FloatType, IndexType, ColorType >

The most common ply files have the following header specification,

element vertex
property float/double x // vertex position
property float/double y
property float/double z
property float/double nx // vertex normal, optional
property float/double ny
property float/double nz
property float/double s/texture_u // texture coordinate, optional
property float/double y/texture_v
property uchar red // vertex color, optional
property uchar green
property uchar blue
property uchar alpha // alpha is optional for color
element face
property list uchar int/uint vertex_index/vertex_indices // optional

So this class provides a native implementation to read this type of ply files. Note that it's assumed that all faces have the same number of vertices.

Constructor & Destructor Documentation

template<int VN, typename FloatType , typename IndexType , typename ColorType >
Euclid::CommonPlyReader< VN, FloatType, IndexType, ColorType >::CommonPlyReader ( std::vector< FloatType > &  positions,
std::vector< FloatType > *  normals = nullptr,
std::vector< FloatType > *  texcoords = nullptr,
std::vector< IndexType > *  indices = nullptr,
std::vector< ColorType > *  colors = nullptr 
)
inline

The values of the properties are stored into the buffers supplied here. Set to nullptr to omit the values of that property.

Member Function Documentation

template<int VN, typename FloatType , typename IndexType , typename ColorType >
void Euclid::CommonPlyReader< VN, FloatType, IndexType, ColorType >::on_read ( const PlyHeader )
overridevirtual

This function is called right after the header specification is retrieved from the file. Override this function if you wish to do some preprocessing before reading the ply body, e.g. allocating space for buffers.

Reimplemented from Euclid::PlyReader.


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