# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Classes | Public Types | Public Member Functions | Protected Attributes

# vl::PlyLoader Class Reference

Loads a PLY file. More...

`#include <ioPLY.hpp>`

List of all members.

## Classes

class | PlyElement
| Used by PlyLoader. More...
class | PlyPropertyAbstract
| Used by PlyLoader. More...
class | PlyScalar
| Used by PlyLoader. More...
class | PlyScalarList
| Used by PlyLoader. More...

## Public Types

enum | EType { PlyError, PlyChar, PlyUChar, PlyShort, PlyUShort, PlyInt, PlyUInt, PlyFloat, PlyDouble }

## Public Member Functions

| PlyLoader ()
| Constructor.
ref< ResourceDatabase > | loadPly (VirtualFile *file)
| Loads a PLY file.
const std::vector< ref < PlyElement > > & | elements () const
std::vector< ref< PlyElement > > & | elements ()
bool | binary () const
bool | littleEndian () const
void | readElements (VirtualFile *file)
void | readElements (TextStream *text)
void | newElement (PlyElement *el)
EType | translateType (const String &type)
void | analyzeHeader ()
bool | readHeader (TextStream *line_reader)

## Protected Attributes

std::vector< ref< PlyElement > > | mElements
ref< ArrayFloat3 > | mVerts
ref< ArrayFloat3 > | mNormals
ref< ArrayUByte4 > | mColors
std::vector< unsigned int > | mIndices
int | mVertexIndex
bool | mBinary
bool | mLittleEndian

## Detailed Description

Loads a PLY file.

Definition at line 91 of file ioPLY.hpp.

## Member Enumeration Documentation

enum vl::PlyLoader::EType

Enumerator:

  PlyError |
  PlyChar |
  PlyUChar |
  PlyShort |
  PlyUShort |
  PlyInt |
  PlyUInt |
  PlyFloat |
  PlyDouble |

Definition at line 94 of file ioPLY.hpp.

## Constructor & Destructor Documentation

vl::PlyLoader::PlyLoader | ( | ) | `[inline]`

Constructor.

Definition at line 239 of file ioPLY.hpp.

## Member Function Documentation

ref< ResourceDatabase > PlyLoader::loadPly | ( | VirtualFile * | file ) |

Loads a PLY file.

Definition at line 393 of file ioPLY.cpp.

References binary(), vl::VirtualFile::close(), vl::EN_DEPTH_TEST, vl::EN_LIGHTING, vl::Shader::enable(), vl::ref< T >::get(), mColors, mIndices, mNormals, mVerts, NULL, vl::PT_TRIANGLES, readElements(), readHeader(), and vl::Effect::shader().

Referenced by vl::loadPLY().

const std::vector< ref<PlyElement> >& vl::PlyLoader::elements | ( | ) | const`[inline]`

Definition at line 242 of file ioPLY.hpp.

Referenced by analyzeHeader(), and readHeader().

std::vector< ref<PlyElement> >& vl::PlyLoader::elements | ( | ) | `[inline]`

Definition at line 243 of file ioPLY.hpp.

bool vl::PlyLoader::binary | ( | ) | const`[inline]`

Definition at line 244 of file ioPLY.hpp.

Referenced by loadPly().

bool vl::PlyLoader::littleEndian | ( | ) | const`[inline]`

Definition at line 245 of file ioPLY.hpp.

Referenced by readElements().

void PlyLoader::readElements | ( | VirtualFile * | file ) |

Definition at line 178 of file ioPLY.cpp.

References littleEndian(), mElements, newElement(), vl::VirtualFile::readUInt8(), and vl::VirtualFile::seekSet().

Referenced by loadPly().

void PlyLoader::readElements | ( | TextStream * | text ) |

Definition at line 203 of file ioPLY.cpp.

References mElements, and newElement().

void PlyLoader::newElement | ( | PlyElement * | el ) |

Definition at line 212 of file ioPLY.cpp.

References vl::PlyLoader::PlyElement::getColor(), vl::PlyLoader::PlyElement::getNormal(), vl::PlyLoader::PlyElement::getVertex(), mColors, mIndices, mNormals, mVertexIndex, mVerts, vl::PlyLoader::PlyPropertyAbstract::name(), vl::PlyLoader::PlyElement::name(), vl::PlyLoader::PlyElement::properties(), vl::PlyLoader::PlyScalarList::scalars(), and VL_CHECK.

Referenced by readElements().

PlyLoader::EType PlyLoader::translateType | ( | const String & | type ) |

Definition at line 248 of file ioPLY.cpp.

References vl::Log::error(), PlyChar, PlyDouble, PlyError, PlyFloat, PlyInt, PlyShort, PlyUChar, PlyUInt, and PlyUShort.

Referenced by readHeader().

void PlyLoader::analyzeHeader | ( | ) |

Definition at line 272 of file ioPLY.cpp.

References elements(), vl::Log::error(), mColors, mNormals, and mVerts.

Referenced by readHeader().

bool PlyLoader::readHeader | ( | TextStream * | line_reader ) |

Definition at line 306 of file ioPLY.cpp.

References analyzeHeader(), elements(), vl::String::empty(), vl::Log::error(), vl::String::field(), mBinary, mColors, mIndices, mLittleEndian, mNormals, mVertexIndex, mVerts, NULL, vl::TextStream::readLineLF(), vl::String::startsWith(), vl::String::toInt(), translateType(), and vl::String::trim().

Referenced by loadPly().

## Member Data Documentation

std::vector< ref<PlyElement> > vl::PlyLoader::mElements`[protected]`

Definition at line 253 of file ioPLY.hpp.

Referenced by readElements().

ref<ArrayFloat3> vl::PlyLoader::mVerts`[protected]`

Definition at line 254 of file ioPLY.hpp.

Referenced by analyzeHeader(), loadPly(), newElement(), and readHeader().

ref<ArrayFloat3> vl::PlyLoader::mNormals`[protected]`

Definition at line 255 of file ioPLY.hpp.

Referenced by analyzeHeader(), loadPly(), newElement(), and readHeader().

ref<ArrayUByte4> vl::PlyLoader::mColors`[protected]`

Definition at line 256 of file ioPLY.hpp.

Referenced by analyzeHeader(), loadPly(), newElement(), and readHeader().

std::vector<unsigned int> vl::PlyLoader::mIndices`[protected]`

Definition at line 257 of file ioPLY.hpp.

Referenced by loadPly(), newElement(), and readHeader().

int vl::PlyLoader::mVertexIndex`[protected]`

Definition at line 258 of file ioPLY.hpp.

Referenced by newElement(), and readHeader().

bool vl::PlyLoader::mBinary`[protected]`

Definition at line 259 of file ioPLY.hpp.

Referenced by readHeader().

bool vl::PlyLoader::mLittleEndian`[protected]`

Definition at line 260 of file ioPLY.hpp.

Referenced by readHeader().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/plugins/ioPLY.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/plugins/ioPLY.cpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:43.
Permission is granted to use this page to write and publish articles regarding Visualization Library.