CIvfObject Class Reference

#include <ivf/IvfObject.h>

Inheritance diagram for CIvfObject:

CIvfBase CIvfRefCountBase CIvfRTTIBase CIvfMaterial CIvfOldLight CIvfOldLightModel CIvfShape CIvfTexture CIvfView CIvfBitmapFont CIvfComposite CIvfCone CIvfConstructionPlane CIvfExtrArrow CIvfExtrusion CIvfFaceSet CIvfFont CIvfGleExtrudedBase CIvfGleLine CIvfGleSpiral CIvfGleTwistExtrusion CIvfGLPrimitive CIvfGrid CIvfLight CIvfMesh CIvfMultiply CIvfNode CIvfNodeCursor CIvfPixmapFont CIvfPlane CIvfRasterFont CIvfRuler CIvfSceneBase CIvfShapeSelection CIvfSimpleLineSet CIvfSphere CIvfText CIvfVertexElements CIvfCamera CIvfOrthoCamera List of all members.

Public Types

enum  TObjectState { OS_ON, OS_OFF }
enum  TSelectState { SS_ON, SS_OFF }

Public Member Functions

bool getRenderMaterial ()
void setRenderMaterial (bool flag)
bool isSelectEnabled ()
void disableSelect ()
void enableSelect ()
bool isEnabled ()
void disable ()
void enable ()
 CIvfObject ()
 CIvfObject (const CIvfObject &)
virtual ~CIvfObject ()
CIvfObjectoperator= (const CIvfObject &arg)
 IvfClassInfo ("CIvfObject", CIvfBase)
void setTag (long tag)
long getTag ()
void setSelect (TSelectState selectState)
TSelectState getSelect ()
void setState (TObjectState state)
TObjectState getState ()
bool getUseSelectShape ()
void setUseSelectShape (bool flag)
CIvfBoundingSpheregetBoundingSphere ()
void setDisplayList (GLuint nList)
GLuint getDisplayList ()
void setUselist (bool flag)
bool getUselist ()
virtual void render ()
void initBoundingSphere ()
virtual void updateBoundingSphere ()
void setCulled (bool flag)
bool getCulled ()
const char * getName ()
void setName (const char *name)
void setRenderState (CIvfRenderState *state)
CIvfRenderStategetRenderState ()

Protected Member Functions

virtual void preGeometry ()
virtual void postGeometry ()
virtual void compileList ()
virtual void createSelect ()
virtual void createGeometry ()
virtual void createMaterial ()
virtual void beginTransform ()
virtual void endTransform ()

Detailed Description

Root class "renderable" objects

CIvfObject has virtual functions for handling drawing and transformations in OpenGL.

Author:
Jonas Lindemann

Definition at line 46 of file IvfObject.h.


Constructor & Destructor Documentation

CIvfObject::CIvfObject  ) 
 

CIvfObject constructor

CIvfObject::CIvfObject const CIvfObject  ) 
 

CIvfObject constructor

virtual CIvfObject::~CIvfObject  )  [virtual]
 

CIvfObject destructor


Member Function Documentation

virtual void CIvfObject::beginTransform  )  [protected, virtual]
 

Start transform

Implements a OpenGL transform. This routine should call a glPushMatrix() and then call OpenGL routines transforming the object. The method is the first routine to be called in the render() method.

Reimplemented in CIvfOldScene, CIvfSelectComposite, CIvfShape, and CIvfView.

virtual void CIvfObject::compileList  )  [protected, virtual]
 

Compiles display list.

To be implemented.

virtual void CIvfObject::createGeometry  )  [protected, virtual]
 

Creates the geometry of the object.

This method is called from the render() method when geometry rendering is to be done. Objects derived from CIvfObject should implement rendering routines from this method using OpenGL.

Reimplemented in CIvfBillboard, CIvfComposite, CIvfCone, CIvfConstructionPlane, CIvfCulledComposite, CIvfCulledScene, CIvfCursor, CIvfExtrArrow, CIvfExtrusion, CIvfFaceSet, CIvfGrid, CIvfLight, CIvfLightComposite, CIvfLineSet, CIvfLineStripSet, CIvfMesh, CIvfMultiply, CIvfNode, CIvfNodeCursor, CIvfOldScene, CIvfPointSet, CIvfPolySet, CIvfQuadSet, CIvfQuadStripSet, CIvfRuler, CIvfSceneBase, CIvfSelectComposite, CIvfSelectionBox, CIvfShape, CIvfShapeSelection, CIvfSimpleLineSet, CIvfSphere, CIvfSwitch, CIvfTriSet, CIvfTriStripSet, CIvfVertexElements, CIvfWireBrick, CIvfWorkspace, CIvfBitmapFont, CIvfExtrudedFont, CIvfOutlineFont, CIvfPixmapFont, CIvfPolygonalFont, CIvfRasterFont, CIvfText, CIvfTextureFont, CIvfGleExtrusion, CIvfGlePolyCone, CIvfGlePolyCylinder, CIvfGleSpiral, and CIvfGleTwistExtrusion.

virtual void CIvfObject::createMaterial  )  [protected, virtual]
 

Creates the material of the object.

This method is called from the render() method when material rendering is to be done. Objects derived from CIvfObject should implement material routines from this method using OpenGL.

Reimplemented in CIvfMaterial, and CIvfShape.

virtual void CIvfObject::createSelect  )  [protected, virtual]
 

Creates the select object.

When the object is selected. This method is called to create the object respresenting the select state.

Reimplemented in CIvfBrick, CIvfCone, CIvfExtrusion, CIvfNode, CIvfShape, and CIvfSphere.

virtual void CIvfObject::endTransform  )  [protected, virtual]
 

End transform

This is the last method called in the render() method. if a glPushMatrix() is called in the beginTransform() a glPopMatrix() should be called in this routine.

Reimplemented in CIvfOldScene, CIvfSelectComposite, and CIvfShape.

CIvfBoundingSphere* CIvfObject::getBoundingSphere  ) 
 

Returns object bounding sphere.

To be implemented.

bool CIvfObject::getCulled  ) 
 

Returns cull status

GLuint CIvfObject::getDisplayList  ) 
 

Return display list number.

To be implemented.

const char* CIvfObject::getName  ) 
 

Returns object name (default=NULL)

Reimplemented in CIvfTexture.

CIvfRenderState* CIvfObject::getRenderState  ) 
 

Return assigned render state

TSelectState CIvfObject::getSelect  ) 
 

Returns the select state of an object.

TObjectState CIvfObject::getState  ) 
 

Returns object state.

long CIvfObject::getTag  ) 
 

Returns the tag property of an object.

bool CIvfObject::getUselist  ) 
 

Returns diusplay list usage.

void CIvfObject::initBoundingSphere  ) 
 

Initializes use of bounding sphere

If no bounding sphere is assigned to object, one is created. The updateBoundingSphere is called to update the size of the bounding sphere.

virtual void CIvfObject::render  )  [virtual]
 

Renders the object

This method renders the object to screen. The code example below shows which routines are called when the render() method is called. To derive a new class based on CIvfObject the methods shown in the code example should be overridden.

 beginTransform();
 if (getSelectState() == IVF_SELECT_ON)
   createSelect();
 createMaterial();
 createGeomtry();
 endTransform();
         *

Reimplemented in CIvfOldLight, and CIvfOldLightModel.

void CIvfObject::setCulled bool  flag  ) 
 

Sets the cull flag

If set to true the objects has been culled. The cull flag is set to false after each call to render.

void CIvfObject::setDisplayList GLuint  nList  ) 
 

Sets the display list number.

To be implemented.

void CIvfObject::setName const char *  name  ) 
 

Gives the object a name

void CIvfObject::setRenderState CIvfRenderState state  ) 
 

Set object render state

The render state encapsulates an OpenGL state change using the glEnable()/glDisable() pair. The state will be applied in the beginning of the render() method and removed before exiting the render() method. The render state should be handled like a material or texture.

void CIvfObject::setSelect TSelectState  selectState  ) 
 

Sets the select property of an object.

This property is used to indicate if the object is selected. If the select state is IVF_SELECT_ON the virtual method createSelect is called to create the object that is used to indicate the select state. if the select state is SS_OFF the object is rendered as normal. Default state is SS_OFF.

Parameters:
selectState SS_ON, object selected. SS_OFF, object is not selected.

void CIvfObject::setState TObjectState  state  ) 
 

Sets object state.

The state of the object is used to determine if the object is to be drawn or not. OS_ON renders the object (default) OS_OFF turns the object off.

Parameters:
state OS_ON object is rendered. OS_OFF object is not rendered.

void CIvfObject::setTag long  tag  ) 
 

Sets the tag property of an object.

The tag property can be used to assign special properties to the object.

void CIvfObject::setUselist bool  flag  ) 
 

Sets display list usage.

Determines if display lists are to be used when drawing the object. To be implemented.

virtual void CIvfObject::updateBoundingSphere  )  [virtual]
 

Updates the size of bounding sphere

Classes used in cull operations should override this method and update the size of the bounding sphere this method should be called if the object has changed size and is also called when the initBoundingSphere is called when culling is used.

Reimplemented in CIvfComposite, CIvfCone, CIvfConstructionPlane, CIvfExtrArrow, CIvfExtrusion, CIvfGLPrimitive, CIvfGrid, CIvfNode, CIvfOldGrid, and CIvfSphere.


The documentation for this class was generated from the following file:
Generated on Fri Sep 1 15:36:54 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO