Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

ARLib::Graphics::ARObjFile Class Reference

Represents the contents of an OBJ and its associated MTL (material) file. More...

#include <arobjfile.h>

List of all members.

Public Member Functions

bool LoadFromFile (const char *filename)
 Loads the contents from the specified filename.
bool Refresh ()
 Reloads the model data from the obj file.
GLuint CreateDisplayList ()
 Creates a display list for use by OpenGL.
void glDraw ()
 Draws the contents of the obj file using OpenGL.
void glDrawList ()
 Draw the contents using a glDrawList.
void Clear ()
 Clears the contents of the ARObjFile instance.
void SetEnableMaterials (bool enable=true)
 Defines whether materials loaded from the associated MTL file should be used.


Detailed Description

Represents the contents of an OBJ and its associated MTL (material) file.

This class can load the contents of an OBJ file. It will also load the contents of the associated MTL file if one exists. Once loaded the contents can be drawn within an OpenGL context with a single call.

To manage many OBJ files, see the the ARModels static class.


Member Function Documentation

GLuint ARObjFile::CreateDisplayList  ) 
 

Creates a display list for use by OpenGL.

Returns:
The displaylist number allocated by OpenGL.

void ARObjFile::glDrawList  ) 
 

Draw the contents using a glDrawList.

The first time this method is called will automatically create the draw list.

bool ARObjFile::LoadFromFile const char *  filename  ) 
 

Loads the contents from the specified filename.

Parameters:
filename The path of the file to load.
Returns:
True if successfully loaded otherwise false is returned.

bool ARObjFile::Refresh  ) 
 

Reloads the model data from the obj file.

Useful for when modifying the model and what to see the effect without having to reload the application.

Returns:
True if successfully loaded otherwise false is returned.

void ARLib::Graphics::ARObjFile::SetEnableMaterials bool  enable = true  )  [inline]
 

Defines whether materials loaded from the associated MTL file should be used.

Parameters:
enable Use true (default) to use materials other use false.


The documentation for this class was generated from the following files:
Generated on Wed Aug 31 18:01:39 2005 for ARLib by  doxygen 1.3.9.1