Main Page   Namespace List   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Engine Class Reference


Public Methods

 Engine ()
 ~Engine ()
void drawFace (INDEX_FACE iface, SCENE *s)
void drawObject (INDEX_OBJECT iobject, SCENE *s)
void drawSuperVolume (SVOLUME v, SCENE *s)
void drawScene (SCENE *s)
void display (int)
void startTimer (void)
void stopTimer (const char *msg)
int loadFile (const char *fileName)
void setOrthoProjection (double x1, double y1, double x2, double y2)
void xyzview (int param)

Data Fields

Lighting * lighting
 takes care of the light model

Figures * figures
 helps with some figures like axis and BBox

Mouse * mouse
 an instance of mouse taking the mouse actions

int axisSize
 size of the 3 axis

bool drawAxis
 draw axis ON/OFF

bool drawEdges
 draw the edges ON/OFF

bool drawMaterial
 draw material ON/OFF

bool drawBoundingBox
 draw BB ON/OFF

bool drawSpot
 draw spots ON/OFF

bool ready
 scene display is ready ? If not, some actions are skipped

SCENE * scene
 OBJECT describing the scene.


Private Attributes

TessPoly * tessPoly
 structure used for tesselation

timeb tstart
 the start time of an event


Detailed Description

This class handles most of the 3d operations of the application it's a kind of simple 3d engine. It contains an instance of each of the following classes : Mouse, Lighting, Figures and TessPoly. It also contains :


Constructor & Destructor Documentation

Engine::Engine (    ) 
 

Engine constructor. Constructs TessPoly, Lighting, Figures and Mouse objects Inits the others parameters

Engine::~Engine (    ) 
 

Engine Destructor Frees scene and destroys TessPoly


Member Function Documentation

void Engine::display (  int    projMode ) 
 

Main display function

Clears the current buffer, sets the Projection/Perspective mode According to parameters, draws BBos, Axis and spots

Parameters:
projMode  the Projection/Perspective mode

void Engine::drawFace (  INDEX_FACE    iface,
SCENE *    s
) 
 

Drawing a single face

Parameters:
iface  the index of the face to draw
s  a pointer towards the scene

void Engine::drawObject (  INDEX_OBJECT    iobject,
SCENE *    s
) 
 

Draws the objects of the structure SCENE

Parameters:
iobject  the rank of the object in s->tabobj
s  a pointer to a structure scene

void Engine::drawScene (  SCENE *    s ) 
 

Draws an instance of strucure SCENE

Parameters:
s  : a pointer to a structure scene

void Engine::drawSuperVolume (  SVOLUME    v,
SCENE *    s
) 
 

Handles the super volumes of the structure SCENE

Parameters:
v  the rank of the volume in s->tabsv
s  a pointer to a structure scene

int Engine::loadFile (  const char *    fileName ) 
 

Adds a file containing a 3D modelisation in the dat format to the scene or just loads it, allocating the scene object by the way

Parameters:
fileName  : the name of the file to load (may contain its path)

void Engine::setOrthoProjection (  double    x1,
double    y1,
double    x2,
double    y2
) 
 

Sets the orthogonal projection on a rectangle in world coordinates Note that aspect ratio is conserved.

Parameters:
x1, y1  first point defining the rectangle
x2, y2  second point defining the rectangle

void Engine::startTimer (  void    ) 
 

Gets starting time of an event

void Engine::stopTimer (  const char *    msg ) 
 

Displays the duration since last call to startTimer

Parameters:
msg  : the message to display (it should be an action name)

void Engine::xyzview (  int    mode ) 
 

Sets the view to perspective or 3 types of orthogonal projection 0 : OXZ plane projection with perspective 1 : OXZ plane projection 2 : OXY plane projection 3 : OYZ plane projection

Parameters:
mode  : the view chosen


Field Documentation

int Engine::axisSize
 

size of the 3 axis

bool Engine::drawAxis
 

draw axis ON/OFF

bool Engine::drawBoundingBox
 

draw BB ON/OFF

bool Engine::drawEdges
 

draw the edges ON/OFF

bool Engine::drawMaterial
 

draw material ON/OFF

bool Engine::drawSpot
 

draw spots ON/OFF

Figures* Engine::figures
 

helps with some figures like axis and BBox

Lighting* Engine::lighting
 

takes care of the light model

Mouse* Engine::mouse
 

an instance of mouse taking the mouse actions

bool Engine::ready
 

scene display is ready ? If not, some actions are skipped

SCENE* Engine::scene
 

OBJECT describing the scene.

TessPoly* Engine::tessPoly [private]
 

structure used for tesselation

struct timeb Engine::tstart [private]
 

the start time of an event


The documentation for this class was generated from the following files:
Generated on Wed Feb 18 16:32:53 2004 for POVAMA by doxygen1.2.18