Class Argos::ObjSerializer
ClassList > Argos > ObjSerializer
Serialize and deserialize 3D meshes using the Wavefront OBJ format. More...
#include <ObjSerializer.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 an OBJ stream. |
| void | serialize (const std::vector< Vector3D< double > > & vertices, const std::vector< Face > & faces, std::ostream & output) const Serialize a 3D mesh to an OBJ stream. |
| void | serialize (const std::vector< Vector3D< double > > & vertices, const std::vector< Face > & faces, const std::vector< double > & textureCoordinates, std::ostream & output) const Serialize a 3D mesh with per-vertex texture coordinates to an OBJ stream. |
Detailed Description
Only a minimal subset of OBJ is supported:
* Vertices (v x y z).
* Polygonal faces (f i1 i2 i3 ...).
Normals, texture coordinates, materials and other OBJ features are ignored.
Public Functions Documentation
function deserialize
Read a 3D mesh from an OBJ stream.
void Argos::ObjSerializer::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 OBJ text.
Note:
Unknown lines (comments, blank lines) are silently ignored.
Note:
Normals, texture coordinates and other OBJ features are not supported by the reader.
Note:
Vertex indices read from the OBJ (one-based) are converted to zero-based indices.
function serialize [1/2]
Serialize a 3D mesh to an OBJ stream.
void Argos::ObjSerializer::serialize (
const std::vector< Vector3D < double > > & vertices,
const std::vector< Face > & faces,
std::ostream & output
) const
Parameters:
verticesVertices of the mesh, written asv x y zlines.facesFaces of the mesh given as zero-based vertex indices.outputOutput stream receiving the OBJ text.
Note:
Vertex indices are converted from zero-based (C++) to one-based (OBJ) when writing.
function serialize [2/2]
Serialize a 3D mesh with per-vertex texture coordinates to an OBJ stream.
void Argos::ObjSerializer::serialize (
const std::vector< Vector3D < double > > & vertices,
const std::vector< Face > & faces,
const std::vector< double > & textureCoordinates,
std::ostream & output
) const
Parameters:
verticesVertices of the mesh, written asv x y zlines.facesFaces of the mesh given as zero-based vertex indices.textureCoordinatesPer-vertex texture coordinates written asvt ulines (one coordinate per vertex).outputOutput stream receiving the OBJ text.
Note:
Vertex indices are converted from zero-based (C++) to one-based (OBJ) when writing.
The documentation for this class was generated from the following file include/serializer/ObjSerializer.h