Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Model Class Reference

One or more meshes that share a Texture. More...

#include <model.h>

Inherited by _classes_ [private].

Inheritance diagram for Model:

Inheritance graph
[legend]
Collaboration diagram for Model:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TSub< Texture, std::string > SubTexture
typedef RefClass< Texture,
std::string, SubTexture
RefTexture
 The RefClass of a Texture so that the texture is only generated once per filename. More...


Public Methods

float getRadius () const
 The accessor function for the radial size (rsize). More...

const VectorgetMin () const
 Gets the minimum of the bounding box (in local coordinates. More...

const VectorgetMax () const
 Gets the minimum of the bounding box (in local coordinates. More...

 Model (const Model &m)
 Basic copy constructor. More...

 Model (const std::string &filename)
 This generates a model by reading information from filename . More...

 ~Model ()
Model & operator= (const Model &m)
 This is the basic = opeerator. More...

bool operator== (const Model &m) const
bool operator< (const Model &m) const
void draw (const Matrix &mat)
 This function draws given a position Matrix using opengl commands; in cpp file. More...


Private Methods

void calcbb ()
 To calculate/ecalculat the bounding box. More...


Private Attributes

float radius
 The radial size of the mesh. More...

int vertexList
 The list of verticies. More...

Vector min
 The bounding box of the model (in local coordinates). More...

Vector max
 The bounding box of the model (in local coordinates). More...

RefTexture tex

Detailed Description

One or more meshes that share a Texture.


Member Typedef Documentation

typedef RefClass<Texture,std::string,SubTexture> Model::RefTexture
 

The RefClass of a Texture so that the texture is only generated once per filename.

typedef TSub<Texture,std::string> Model::SubTexture
 


Constructor & Destructor Documentation

Model::Model const Model &    m
 

Basic copy constructor.

00037                                :tex(model.tex) {
00038     assert(0);
00039     printf("copying...\n");
00040     vertexList =  model.vertexList;//FIXME
00041     min=model.min;
00042     max=model.max;
00043     radius=model.radius;
00044 }

Model::Model const std::string &    filename
 

This generates a model by reading information from filename .

00097                                  :tex(str) {
00098     assert(0);
00099     printf ("creating Model with %s\n", str.c_str());
00100     calcbb();
00101     radius=maximum(this->min.Magnitude(), this->max.Magnitude());
00102 }

Model::~Model  
 

00019                {
00020     assert(0);
00021 }


Member Function Documentation

void Model::calcbb   [private]
 

To calculate/ecalculat the bounding box.

00110                     {
00111     printf ("model::calcbb = ");
00112     this->min=Vector(-((((float)rand())/RAND_MAX)*5),-((((float)rand())/RAND_MAX)*5),-((((float)rand())/RAND_MAX)*5));
00113     this->max=Vector((((float)rand())/RAND_MAX)*5,(((float)rand())/RAND_MAX)*5,(((float)rand())/RAND_MAX)*5);
00114     printf("<%f,%f,%f>,<%f,%f,%f>\n",min.i,min.j,min.k,max.i,max.j,max.k);
00115 }

void Model::draw const Matrix   mat
 

This function draws given a position Matrix using opengl commands; in cpp file.

const Vector& Model::getMax   const [inline]
 

Gets the minimum of the bounding box (in local coordinates.

00054                                  {
00055         return max;
00056     }

const Vector& Model::getMin   const [inline]
 

Gets the minimum of the bounding box (in local coordinates.

00050                                  {
00051         return min;
00052     }

float Model::getRadius   const [inline]
 

The accessor function for the radial size (rsize).

00048 {return radius;}

bool Model::operator< const Model &    m const [inline]
 

00066                                             {
00067         if (tex< m.tex) {
00068             return true;
00069         }else if (tex == m.tex) {
00070             return this < &m;
00071         }
00072         return false;
00073     }

Model& Model::operator= const Model &    m
 

This is the basic = opeerator.

bool Model::operator== const Model &    m const [inline]
 

00063                                             {
00064         return this==&m;
00065     }


Member Data Documentation

Vector Model::max [private]
 

The bounding box of the model (in local coordinates).

Vector Model::min [private]
 

The bounding box of the model (in local coordinates).

float Model::radius [private]
 

The radial size of the mesh.

RefTexture Model::tex [private]
 

int Model::vertexList [private]
 

The list of verticies.


The documentation for this class was generated from the following files:
Generated on Mon Jul 7 21:13:53 2003 for Ethereal by doxygen1.2.15