Ocular Engine
Ocular::Graphics::PLYParser Class Referenceabstract
Inheritance diagram for Ocular::Graphics::PLYParser:
Ocular::Graphics::PLYElementListParser Ocular::Graphics::PLYElementParser

Public Member Functions

virtual bool parse (std::string const &line, std::vector< Vertex > &vertices, std::vector< uint32_t > &indices, uint32_t &currVert, uint32_t &currIndex, Math::Vector3f &min, Math::Vector3f &max, bool isASCII=true)=0

Public Attributes

PLYElementType type
uint32_t count

Protected Member Functions

bool splitProperty (std::string const &line, uint32_t tokenCount, uint32_t *tokens)

Member Function Documentation

virtual bool Ocular::Graphics::PLYParser::parse ( std::string const &  line,
std::vector< Vertex > &  vertices,
std::vector< uint32_t > &  indices,
uint32_t &  currVert,
uint32_t &  currIndex,
Math::Vector3f min,
Math::Vector3f max,
bool  isASCII = true 
pure virtual

Parses a single line of a PLY file.

[in]lineThe currently line of the PLY file to parse
[out]verticesVector of mesh vertices
[out]indicesVector of mesh indices
[out]currVertThe current vertices index. If one or more indices were added in this parse, increment this accordingly.
[out]currIndexThe current indices index. If one or more indices were added in this parse, increment this accordingly.
TRUE if the line was parsed without any errors.

Implemented in Ocular::Graphics::PLYElementParser, and Ocular::Graphics::PLYElementListParser.

bool Ocular::Graphics::PLYParser::splitProperty ( std::string const &  line,
uint32_t  tokenCount,
uint32_t *  tokens 

A very specialized string splitter used to tokenize property lines. Given the nature of the PLY format, the following assumptions can be madeL

- The delimiter is always a space (' ')
- We already know how many tokens to expect

We also don't care about placing the tokens into individual strings or buffers. Instead we can employ just their index, so there is no need to copy string data around.

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