ISAAC
0.2.11
Flight software for the ISAAC project, adding functionality to the Astrobee robot, operating inside the International Space Station.
|
Primary class; represents a set of data in the .ply format. More...
#include <happly.h>
Public Member Functions | |
PLYData () | |
Create an empty PLYData object. | |
PLYData (const std::string &filename, bool verbose=false) | |
Initialize a PLYData by reading from a file. Throws if any failures occur. More... | |
PLYData (std::istream &inStream, bool verbose=false) | |
Initialize a PLYData by reading from a stringstream. Throws if any failures occur. More... | |
void | validate () |
Perform sanity checks on the file, throwing if any fail. | |
void | write (const std::string &filename, DataFormat format=DataFormat::ASCII) |
Write this data to a .ply file. More... | |
void | write (std::ostream &outStream, DataFormat format=DataFormat::ASCII) |
Write this data to an output stream. More... | |
Element & | getElement (const std::string &target) |
Get an element type by name ("vertices") More... | |
bool | hasElement (const std::string &target) |
Check if an element type exists. More... | |
std::vector< std::string > | getElementNames () |
A list of the names of all elements. More... | |
void | addElement (const std::string &name, size_t count) |
Add a new element type to the object. More... | |
std::vector< std::array< double, 3 > > | getVertexPositions (const std::string &vertexElementName="vertex") |
Common-case helper get mesh vertex positions. More... | |
std::vector< std::array< unsigned char, 3 > > | getVertexColors (const std::string &vertexElementName="vertex") |
Common-case helper get mesh vertex colors. More... | |
template<typename T = size_t> | |
std::vector< std::vector< T > > | getFaceIndices () |
Common-case helper to get face indices for a mesh. If not template type is given, size_t is used. Naively converts to requested signedness, which may lead to unexpected values if an unsigned type is used and file contains negative values. More... | |
void | addVertexPositions (std::vector< std::array< double, 3 >> &vertexPositions) |
Common-case helper set mesh vertex positons. Creates vertex element, if necessary. More... | |
void | addVertexColors (std::vector< std::array< unsigned char, 3 >> &colors) |
Common-case helper set mesh vertex colors. Creates a vertex element, if necessary. More... | |
void | addVertexColors (std::vector< std::array< double, 3 >> &colors) |
Common-case helper set mesh vertex colors. Creates a vertex element, if necessary. More... | |
template<typename T > | |
void | addFaceIndices (std::vector< std::vector< T >> &indices) |
Common-case helper to set face indices. Creates a face element if needed. The input type will be casted to a 32 bit integer of the same signedness. More... | |
Public Attributes | |
std::vector< std::string > | comments |
Comments for the file. When writing, each entry will be written as a sequential comment line. | |
std::vector< std::string > | objInfoComments |
obj_info comments for the file. When writing, each entry will be written as a sequential comment line. | |
Primary class; represents a set of data in the .ply format.
|
inline |
Initialize a PLYData by reading from a file. Throws if any failures occur.
filename | The file to read from. |
verbose | If true, print useful info about the file to stdout |
|
inline |
Initialize a PLYData by reading from a stringstream. Throws if any failures occur.
inStream | The stringstream to read from. |
verbose | If true, print useful info about the file to stdout |
|
inline |
Add a new element type to the object.
name | The name of the new element type ("vertices"). |
count | The number of elements of this type. |
|
inline |
Common-case helper to set face indices. Creates a face element if needed. The input type will be casted to a 32 bit integer of the same signedness.
indices | The indices into the vertex list around each face. |
|
inline |
Common-case helper set mesh vertex colors. Creates a vertex element, if necessary.
colors | A vector of vertex colors as floating point [0,1] values. Internally converted to [0,255] chars. |
|
inline |
Common-case helper set mesh vertex colors. Creates a vertex element, if necessary.
colors | A vector of vertex colors (unsigned chars [0,255]). |
|
inline |
Common-case helper set mesh vertex positons. Creates vertex element, if necessary.
vertexPositions | A vector of vertex positions |
|
inline |
Get an element type by name ("vertices")
target | The name of the element type to get |
|
inline |
A list of the names of all elements.
|
inline |
Common-case helper to get face indices for a mesh. If not template type is given, size_t is used. Naively converts to requested signedness, which may lead to unexpected values if an unsigned type is used and file contains negative values.
|
inline |
Common-case helper get mesh vertex colors.
vertexElementName | The element name to use (default: "vertex") |
|
inline |
Common-case helper get mesh vertex positions.
vertexElementName | The element name to use (default: "vertex") |
|
inline |
Check if an element type exists.
target | The name to check for. |
|
inline |
Write this data to a .ply file.
filename | The file to write to. |
format | The format to use (binary or ascii?) |
|
inline |
Write this data to an output stream.
outStream | The output stream to write to. |
format | The format to use (binary or ascii?) |