CIvfShape Class Reference

#include <ivf/IvfShape.h>

Inheritance diagram for CIvfShape:

CIvfObject CIvfBase CIvfRefCountBase CIvfRTTIBase 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 List of all members.

Public Types

enum  THighlightState { HS_ON, HS_OFF }
enum  THighlightType { HT_MATERIAL, HT_LIGHTEN }

Public Member Functions

bool isEnabledHighlight ()
void disableHighlight ()
void enableHighlight ()
void setHighlightType (THighlightType type)
 CIvfShape ()
virtual ~CIvfShape ()
 IvfClassInfo ("CIvfShape", CIvfObject)
virtual void refresh ()
virtual void setHighlight (THighlightState state)
THighlightState getHighlight ()
void setUseName (bool flag)
bool getUseName ()
void setObjectName (GLuint name)
GLuint getObjectName ()
void assignPointTo (CIvfPoint3d *point)
void assignPositionTo (CIvfShape *shape)
void setHighlightMaterial (CIvfMaterial *material)
CIvfMaterialgetHightlightMaterial ()
void setMaterial (CIvfMaterial *material)
virtual CIvfMaterialgetMaterial ()
void setTexture (CIvfTexture *texture)
CIvfTexturegetTexture ()
void setRotationQuat (double vx, double vy, double vz, double theta)
void setRotation (CIvfQuat &q)
void getRotationQuat (double &vx, double &vy, double &vz, double &theta)
void setRotation (const double xRot, const double yRot, const double zRot)
void getRotation (double &xRot, double &yRot, double &zRot)
virtual void setPosition (const double x, const double y, const double z)
virtual void setPosition (CIvfShape *shape)
virtual void setPosition (CIvfPoint3d *point)
virtual void setPosition (CIvfPoint3d &pos)
virtual void setPosition (CIvfVec3d &pos)
virtual void getPosition (double &x, double &y, double &z)
virtual void getPosition (CIvfShape *shape)
virtual void getPosition (CIvfPoint3d *point)
virtual CIvfVec3dgetPosition ()
void setScale (const double xScale, const double yScale, const double zScale)
void getScale (double &xScale, double &yScale, double &zScale)
void setSelectMaterial (CIvfMaterial *material)
void setNormalize (bool flag)

Protected Member Functions

virtual void createGeometry ()
virtual void createSelect ()
virtual void endTransform ()
virtual void beginTransform ()
virtual void createMaterial ()

Detailed Description

Abstract shape class with material and position.

CIvfShape implements a CIvfObject with a material and a position. Methods for moving, and rotation are implemented. The CIvfShape also has a special material and state for a highlight effect. CIvfShape should be considered an abstract class. Classes derived from CIvfShape should override the createGeometry, createSelect methods.

Author:
Jonas Lindemann
Examples:

handlers.cpp, and manip.cpp.

Definition at line 55 of file IvfShape.h.


Constructor & Destructor Documentation

CIvfShape::CIvfShape  ) 
 

CIvfShape constructor

virtual CIvfShape::~CIvfShape  )  [virtual]
 

CIvfShape destructor


Member Function Documentation

void CIvfShape::assignPointTo CIvfPoint3d point  ) 
 

Assign a CIvfPoint the position of the object.

Parameters:
point Reference to a CIvfPoint instance.

void CIvfShape::assignPositionTo CIvfShape shape  ) 
 

Assigns the position of the object to a CIvfShape instance.

Parameters:
shape Reference to a CIvfShape instance.

virtual void CIvfShape::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 from CIvfObject.

Reimplemented in CIvfOldScene, and CIvfSelectComposite.

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

Forces an object recalculation.

Reimplemented from CIvfObject.

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, 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 CIvfShape::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 from CIvfObject.

virtual void CIvfShape::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 from CIvfObject.

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

virtual void CIvfShape::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 from CIvfObject.

Reimplemented in CIvfOldScene, and CIvfSelectComposite.

THighlightState CIvfShape::getHighlight  ) 
 

Returns the highlight state

CIvfMaterial* CIvfShape::getHightlightMaterial  ) 
 

Returns the used highlight material

virtual CIvfMaterial* CIvfShape::getMaterial  )  [virtual]
 

Returns the used material

GLuint CIvfShape::getObjectName  ) 
 

Returns object name (number).

virtual CIvfVec3d& CIvfShape::getPosition  )  [virtual]
 

Return position of object

virtual void CIvfShape::getPosition CIvfPoint3d point  )  [virtual]
 

Return position of object

virtual void CIvfShape::getPosition CIvfShape shape  )  [virtual]
 

Return position of object

virtual void CIvfShape::getPosition double &  x,
double &  y,
double &  z
[virtual]
 

Return position of object

Reimplemented in CIvfConstructionPlane.

void CIvfShape::getRotation double &  xRot,
double &  yRot,
double &  zRot
 

Get rotation of object (obsolete)

void CIvfShape::getRotationQuat double &  vx,
double &  vy,
double &  vz,
double &  theta
 

Return quaternion rotation of the object

void CIvfShape::getScale double &  xScale,
double &  yScale,
double &  zScale
 

Return object scale

CIvfTexture* CIvfShape::getTexture  ) 
 

Returns used texture

bool CIvfShape::getUseName  ) 
 

Returns name rendering flag.

virtual void CIvfShape::refresh  )  [virtual]
 

Force object refresh

Reimplemented in CIvfComposite, CIvfGLPrimitive, CIvfGrid, CIvfMultiply, CIvfSolidLine, CIvfSplineTube, and CIvfTubeExtrusion.

virtual void CIvfShape::setHighlight THighlightState  state  )  [virtual]
 

Sets the highlight state of the object.

If the highlight state is IVF_HIGHLIGHT_ON the object is rendered using the highlight material instead of the normal material. This can be used to change object appearance when the mouse moves over it.

Parameters:
state HS_ON object is rendered using the highlightmaterial. HS_OFF the object is rendered using the normal material.

void CIvfShape::setHighlightMaterial CIvfMaterial material  ) 
 

Assign highlight material

Assigns the material used to highlight the object. The CIvfShape class increases the reference count of the material when it is assigned to the class. When the destructor of the class is called the reference count is decreased. If the material is not referenced it is deleted.

Parameters:
material Reference of a CIvfMaterial instance.

Reimplemented in CIvfShapeSelection.

void CIvfShape::setMaterial CIvfMaterial material  ) 
 

Assign material

Assigns the default material to the object. The CIvfShape class increases the reference count of the material when it is assigned to the class. When the destructor of the class is called the reference count is decreased. If the material is not referenced it is deleted.

Parameters:
material Reference of a CIvfMaterial instance.

void CIvfShape::setNormalize bool  flag  ) 
 

Enable/disable normalization of normals

void CIvfShape::setObjectName GLuint  name  ) 
 

Object name

Sets the name (number) of the object to be rendered if the name rendering flag is set to true.

virtual void CIvfShape::setPosition CIvfVec3d pos  )  [virtual]
 

Position of object

Sets the position of the object int the global coordinate system.

Parameters:
pos Point used to retrieve position from.

virtual void CIvfShape::setPosition CIvfPoint3d pos  )  [virtual]
 

Position of object

Sets the position of the object int the global coordinate system.

Parameters:
pos Point used to retrieve position from.

virtual void CIvfShape::setPosition CIvfPoint3d point  )  [virtual]
 

Position of object

Sets the position of the object int the global coordinate system.

Parameters:
point Point used to retrieve position from.

virtual void CIvfShape::setPosition CIvfShape shape  )  [virtual]
 

Position of object

Sets the position of the object int the global coordinate system.

Parameters:
shape Shape used to retrieve position from.

virtual void CIvfShape::setPosition const double  x,
const double  y,
const double  z
[virtual]
 

Position of object

Sets the position of the object in the global coordinate system.

Parameters:
x X coordinate
y Y coordinate
z Z coordinate

Reimplemented in CIvfConstructionPlane.

void CIvfShape::setRotation const double  xRot,
const double  yRot,
const double  zRot
 

Set rotation of object (obsolete)

void CIvfShape::setRotation CIvfQuat q  ) 
 

Sets the rotation of the object specified by an CIvfQuat.

void CIvfShape::setRotationQuat double  vx,
double  vy,
double  vz,
double  theta
 

Set the quaternion rotation of the object.

Sets the rotation of the object specifying a rotation axis and a rotation angle.

Parameters:
vx X component of the rotation axis
vy Y component of the rotation axis
vz Z component of the rotation axis
theta Angle specifying rotation in degrees.

Reimplemented in CIvfConstructionPlane.

void CIvfShape::setScale const double  xScale,
const double  yScale,
const double  zScale
 

Object scale

Sets the scaling of the object in x,y and z directions.

Parameters:
xScale Scaling in the x-direction
yScale Scaling in the y-direction
zScale Scaling in the z-direction

void CIvfShape::setSelectMaterial CIvfMaterial material  ) 
 

Set material for selection

void CIvfShape::setTexture CIvfTexture texture  ) 
 

Assign texture

Assigns the default texture to the object. The CIvfShape class increases the reference count of the texture when it is assigned to the class. When the destructor of the class is called the reference count is decreased. If the texture is not referenced it is deleted.

Parameters:
texture Reference of a CIvfTexture instance.

Reimplemented in CIvfQuadPlane.

void CIvfShape::setUseName bool  flag  ) 
 

Sets name rendering flag.

Names are used when using selection in OpenGL.

Parameters:
flag If true the shape is rendered using a name. (default). if false no name is used when rendering.


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