rcrt::ObjectLoader Class Reference

#include <ObjectLoader.h>

Inheritance diagram for rcrt::ObjectLoader:

Inheritance graph
[legend]
Collaboration diagram for rcrt::ObjectLoader:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ObjectLoader (std::string path, MaterialLoader *mats=0)
virtual ~ObjectLoader ()
ObjectgetObject ()
bool nextFrame ()
bool goToFrame (const int &n)
std::vector
< Triangle * > * 
getTriangles ()

Private Member Functions

void init ()
void initMaterials ()
void updateMesh ()
void initStatic ()
void initAffine ()
void initDynamic ()
void updateMatrix ()

Private Attributes

MaterialLoadermaterials
SolidObjectobject
std::string name
AnimType aType
std::string material
std::vector< Vertexvertices
std::vector< Triangle * > tris
std::vector
< Primitive * > 
primitives
bool initialised


Detailed Description

Loads object data from xml.

Supports loading of static meshes, affine animated meshes (provide a worldmatrix for every frame) and dynamic meshes which are rebuilt every frame.

Definition at line 31 of file ObjectLoader.h.


Constructor & Destructor Documentation

rcrt::ObjectLoader::ObjectLoader ( std::string  path,
MaterialLoader mats = 0 
)

Definition at line 11 of file ObjectLoader.cpp.

rcrt::ObjectLoader::~ObjectLoader (  )  [virtual]

Definition at line 16 of file ObjectLoader.cpp.

References object.


Member Function Documentation

void rcrt::ObjectLoader::init (  )  [private]

Definition at line 21 of file ObjectLoader.cpp.

References rcrt::AFFINE, aType, rcrt::DYNAMIC, rcrt::MaterialLoader::getMaterial(), initAffine(), initDynamic(), initialised, initMaterials(), material, materials, name, rcrt::XMLLoader::nextStartTag(), rcrt::XMLLoader::parser, and rcrt::STATIC.

Referenced by goToFrame(), and nextFrame().

void rcrt::ObjectLoader::initMaterials (  )  [private]

Definition at line 63 of file ObjectLoader.cpp.

References material, rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by init().

void rcrt::ObjectLoader::updateMesh (  )  [private]

Definition at line 83 of file ObjectLoader.cpp.

References rcrt::XMLLoader::currentFrame, rcrt::XMLLoader::eof, rcrt::XMLLoader::nextStartTag(), object, rcrt::XMLLoader::parser, primitives, tris, and vertices.

Referenced by goToFrame(), initAffine(), and nextFrame().

void rcrt::ObjectLoader::initStatic (  )  [private]

void rcrt::ObjectLoader::initAffine (  )  [private]

Definition at line 235 of file ObjectLoader.cpp.

References name, updateMatrix(), and updateMesh().

Referenced by init().

void rcrt::ObjectLoader::initDynamic (  )  [private]

Definition at line 242 of file ObjectLoader.cpp.

References name.

Referenced by init().

void rcrt::ObjectLoader::updateMatrix (  )  [private]

Definition at line 196 of file ObjectLoader.cpp.

References rcrt::XMLLoader::eof, name, rcrt::XMLLoader::nextStartTag(), rcrt::XMLLoader::parser, and rcrt::toString().

Referenced by goToFrame(), and initAffine().

Object * rcrt::ObjectLoader::getObject (  ) 

Definition at line 301 of file ObjectLoader.cpp.

References object.

bool rcrt::ObjectLoader::nextFrame (  )  [virtual]

Loads info from next frame. If on starting tag of frame, load this one, else go to next frame starting tag and load from that.

Implements rcrt::XMLLoader.

Definition at line 247 of file ObjectLoader.cpp.

References rcrt::XMLLoader::currentFrame, rcrt::XMLLoader::eof, init(), initialised, rcrt::XMLLoader::nextStartTag(), rcrt::XMLLoader::parser, and updateMesh().

bool rcrt::ObjectLoader::goToFrame ( const int &  n  )  [virtual]

Loads info of frame n.

Implements rcrt::XMLLoader.

Definition at line 268 of file ObjectLoader.cpp.

References rcrt::AFFINE, aType, rcrt::XMLLoader::currentFrame, rcrt::DYNAMIC, rcrt::XMLLoader::eof, init(), initialised, rcrt::XMLLoader::nextStartTag(), rcrt::XMLLoader::parser, rcrt::STATIC, updateMatrix(), and updateMesh().

vector< Triangle * > * rcrt::ObjectLoader::getTriangles (  ) 

Definition at line 306 of file ObjectLoader.cpp.

References tris.


Member Data Documentation

MaterialLoader* rcrt::ObjectLoader::materials [private]

Definition at line 34 of file ObjectLoader.h.

Referenced by init().

SolidObject* rcrt::ObjectLoader::object [private]

Definition at line 35 of file ObjectLoader.h.

Referenced by getObject(), updateMesh(), and ~ObjectLoader().

std::string rcrt::ObjectLoader::name [private]

Definition at line 36 of file ObjectLoader.h.

Referenced by init(), initAffine(), initDynamic(), and updateMatrix().

AnimType rcrt::ObjectLoader::aType [private]

Definition at line 37 of file ObjectLoader.h.

Referenced by goToFrame(), and init().

std::string rcrt::ObjectLoader::material [private]

Definition at line 38 of file ObjectLoader.h.

Referenced by init(), and initMaterials().

std::vector<Vertex> rcrt::ObjectLoader::vertices [private]

Definition at line 39 of file ObjectLoader.h.

Referenced by updateMesh().

std::vector<Triangle*> rcrt::ObjectLoader::tris [private]

Definition at line 40 of file ObjectLoader.h.

Referenced by getTriangles(), and updateMesh().

std::vector<Primitive*> rcrt::ObjectLoader::primitives [private]

Definition at line 41 of file ObjectLoader.h.

Referenced by updateMesh().

bool rcrt::ObjectLoader::initialised [private]

Definition at line 43 of file ObjectLoader.h.

Referenced by goToFrame(), init(), and nextFrame().


The documentation for this class was generated from the following files:
Generated on Thu Jan 31 19:32:44 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3