Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModelLoader Class Reference

#include <modelfile.h>

Inheritance diagram for ModelLoader:

Inheritance graph
List of all members.

Public Member Functions

const std::stringgetErrorMessage () const
const std::stringgetTexturePath () const
virtual Modelload ()=0
 ModelLoader ()
void setTexturePath (const std::string &)
virtual ~ModelLoader ()

Static Public Member Functions

static ModelLoaderOpenModel (std::istream &in)

Protected Member Functions

virtual void reportError (const std::string &)

Private Attributes

std::string errorMessage
std::string texPath

Constructor & Destructor Documentation

ModelLoader::ModelLoader  ) 
 

Definition at line 179 of file modelfile.cpp.

00180 {
00181 }

ModelLoader::~ModelLoader  )  [virtual]
 

Definition at line 184 of file modelfile.cpp.

00185 {
00186 }


Member Function Documentation

const string & ModelLoader::getErrorMessage  )  const
 

Definition at line 197 of file modelfile.cpp.

References errorMessage.

Referenced by LoadModel().

00198 {
00199     return errorMessage;
00200 }

const string & ModelLoader::getTexturePath  )  const
 

Definition at line 211 of file modelfile.cpp.

References texPath.

Referenced by BinaryModelLoader::loadMaterial(), and AsciiModelLoader::loadMaterial().

00212 {
00213     return texPath;
00214 }

virtual Model* ModelLoader::load  )  [pure virtual]
 

Implemented in AsciiModelLoader, and BinaryModelLoader.

Referenced by LoadModel().

ModelLoader * ModelLoader::OpenModel std::istream &  in  )  [static]
 

Definition at line 242 of file modelfile.cpp.

References CEL_MODEL_HEADER_ASCII, CEL_MODEL_HEADER_BINARY, and CEL_MODEL_HEADER_LENGTH.

Referenced by LoadModel().

00243 {
00244     char header[CEL_MODEL_HEADER_LENGTH + 1];
00245     memset(header, '\0', sizeof(header));
00246 
00247     in.read(header, CEL_MODEL_HEADER_LENGTH);
00248     if (strcmp(header, CEL_MODEL_HEADER_ASCII) == 0)
00249     {
00250         return new AsciiModelLoader(in);
00251     }
00252     else if (strcmp(header, CEL_MODEL_HEADER_BINARY) == 0)
00253     {
00254         return new BinaryModelLoader(in);
00255     }
00256     else
00257     {
00258         cerr << "Model file has invalid header.\n";
00259         return NULL;
00260     }
00261 }

void ModelLoader::reportError const std::string  )  [protected, virtual]
 

Definition at line 190 of file modelfile.cpp.

References errorMessage.

Referenced by BinaryModelLoader::reportError(), and AsciiModelLoader::reportError().

00191 {
00192     errorMessage = msg;
00193 }

void ModelLoader::setTexturePath const std::string  ) 
 

Definition at line 204 of file modelfile.cpp.

References texPath.

Referenced by LoadModel().

00205 {
00206     texPath = _texPath;
00207 }


Member Data Documentation

std::string ModelLoader::errorMessage [private]
 

Definition at line 39 of file modelfile.h.

Referenced by getErrorMessage(), and reportError().

std::string ModelLoader::texPath [private]
 

Definition at line 40 of file modelfile.h.

Referenced by getTexturePath(), and setTexturePath().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:28 2006 for Celestia by  doxygen 1.4.1