Class Argos::PlySerializer
ClassList > Argos > PlySerializer
Serialize and deserialize 3D meshes using the Stanford PLY format. More...
#include <PlySerializer.h>
Public Functions
| Type | Name |
|---|---|
| void | deserialize (std::vector< Vector3D< double > > & vertices, std::vector< Face > & faces, std::istream & input) const Read a 3D mesh from a PLY ASCII stream. |
| void | serialize (const std::vector< Vector3D< double > > & vertices, const std::vector< Face > & faces, std::ostream & output) const Serialize a 3D mesh to a PLY ASCII stream. |
Detailed Description
Only a minimal ASCII subset of PLY is supported:
* ASCII format only.
* A vertex element with x, y and z properties of type float (properties may be declared in any order).
* A face element with a vertex_index or vertex_indices property of type list (uchar/char or int count followed by int items).
* Faces may have any number of vertices.
* Extra vertex and face properties are silently ignored.
Normals, texture coordinates, materials and other PLY features are not handled.
Public Functions Documentation
function deserialize
Read a 3D mesh from a PLY ASCII stream.
void Argos::PlySerializer::deserialize (
std::vector< Vector3D < double > > & vertices,
std::vector< Face > & faces,
std::istream & input
) const
Parameters:
verticesOutput vector filled with the vertices read from the stream.facesOutput vector filled with the faces as zero-based vertex indices.inputInput stream providing the PLY text.
Note:
Unknown lines (comments, blank lines) are silently ignored.
Note:
Extra properties and unknown elements are silently ignored.
Note:
Normals, texture coordinates and other PLY features are not supported by the reader.
Note:
Vertex indices read from PLY (zero-based) are kept as-is.
function serialize
Serialize a 3D mesh to a PLY ASCII stream.
void Argos::PlySerializer::serialize (
const std::vector< Vector3D < double > > & vertices,
const std::vector< Face > & faces,
std::ostream & output
) const
Parameters:
verticesVertices of the mesh, written asx y zfloats on a single line per vertex.facesFaces of the mesh given as zero-based vertex indices.outputOutput stream receiving the PLY text.
The documentation for this class was generated from the following file include/serializer/PlySerializer.h