rcrt::MaterialLoader Class Reference

#include <MaterialLoader.h>

Inheritance diagram for rcrt::MaterialLoader:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MaterialLoader (std::string matFile)
virtual ~MaterialLoader ()
MaterialgetMaterial (std::string name)
bool goToFrame (const int &n)
bool nextFrame ()

Private Member Functions

void init ()
std::string initBSDF (std::string name, std::complex< float > ior)
std::string initWood (std::string name, std::complex< float > ior)
std::string initWall (std::string name, std::complex< float > ior)
std::string initFloor (std::string name, std::complex< float > ior)
std::string initDielectric (std::string name, std::complex< float > ior)
std::string initWater (std::string name, std::complex< float > ior)
std::string initMirror (std::string name, std::complex< float > ior)
std::string initImg (std::string name, std::complex< float > ior)
void loadCookT (BSDF *bsdf, std::complex< float > ior)
void loadPhong (BSDF *bsdf)
void loadLambert (BSDF *bsdf)

Private Attributes

std::map
< std::string,
Material * > 
materials
bool initialised


Detailed Description

Loads material data from a file.

Definition at line 17 of file MaterialLoader.h.


Constructor & Destructor Documentation

rcrt::MaterialLoader::MaterialLoader ( std::string  matFile  ) 

Definition at line 20 of file MaterialLoader.cpp.

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

Definition at line 24 of file MaterialLoader.cpp.


Member Function Documentation

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

Definition at line 28 of file MaterialLoader.cpp.

References initBSDF(), initDielectric(), initFloor(), initialised, initImg(), initMirror(), initWall(), initWater(), initWood(), rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by goToFrame(), and nextFrame().

string rcrt::MaterialLoader::initBSDF ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 66 of file MaterialLoader.cpp.

References rcrt::XMLLoader::eof, loadCookT(), loadLambert(), loadPhong(), materials, rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by init().

string rcrt::MaterialLoader::initWood ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 93 of file MaterialLoader.cpp.

References materials, rcrt::XMLLoader::nextStartTag(), rcrt::Vec3D::normalize(), and rcrt::XMLLoader::parser.

Referenced by init().

string rcrt::MaterialLoader::initWall ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 119 of file MaterialLoader.cpp.

References rcrt::BSDF::addBXDF(), materials, rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by init().

string rcrt::MaterialLoader::initFloor ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 131 of file MaterialLoader.cpp.

References rcrt::BSDF::addBXDF(), materials, rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by init().

string rcrt::MaterialLoader::initDielectric ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 143 of file MaterialLoader.cpp.

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

Referenced by init().

string rcrt::MaterialLoader::initWater ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 154 of file MaterialLoader.cpp.

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

Referenced by init().

string rcrt::MaterialLoader::initMirror ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 168 of file MaterialLoader.cpp.

Referenced by init().

string rcrt::MaterialLoader::initImg ( std::string  name,
std::complex< float >  ior 
) [private]

Definition at line 174 of file MaterialLoader.cpp.

References rcrt::XMLLoader::file, materials, rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by init().

void rcrt::MaterialLoader::loadCookT ( BSDF bsdf,
std::complex< float >  ior 
) [private]

Definition at line 189 of file MaterialLoader.cpp.

References rcrt::BSDF::addBXDF(), rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by initBSDF().

void rcrt::MaterialLoader::loadPhong ( BSDF bsdf  )  [private]

Definition at line 204 of file MaterialLoader.cpp.

References rcrt::BSDF::addBXDF(), rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by initBSDF().

void rcrt::MaterialLoader::loadLambert ( BSDF bsdf  )  [private]

Definition at line 219 of file MaterialLoader.cpp.

References rcrt::BSDF::addBXDF(), rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.

Referenced by initBSDF().

Material * rcrt::MaterialLoader::getMaterial ( std::string  name  ) 

Definition at line 229 of file MaterialLoader.cpp.

References materials.

Referenced by rcrt::ObjectLoader::init().

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

Loads info of frame n.

Implements rcrt::XMLLoader.

Definition at line 246 of file MaterialLoader.cpp.

References init(), and initialised.

Referenced by rcrt::AnimLoader::goToFrame().

bool rcrt::MaterialLoader::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 238 of file MaterialLoader.cpp.

References init(), and initialised.

Referenced by rcrt::AnimLoader::nextFrame().


Member Data Documentation

std::map<std::string, Material*> rcrt::MaterialLoader::materials [private]

Definition at line 20 of file MaterialLoader.h.

Referenced by getMaterial(), initBSDF(), initDielectric(), initFloor(), initImg(), initWall(), initWater(), and initWood().

bool rcrt::MaterialLoader::initialised [private]

Definition at line 23 of file MaterialLoader.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:42 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3