CIvfComposite Class Reference

#include <ivf/IvfComposite.h>

Inheritance diagram for CIvfComposite:

CIvfShape CIvfObject CIvfBase CIvfRefCountBase CIvfRTTIBase CIvfArrow CIvfAxis CIvfBillboard CIvfCoordinateSystem CIvfCulledComposite CIvfCursor CIvfLightComposite CIvfSelectComposite CIvfSwitch CIvfTransform CIvfUIComposite List of all members.

Public Member Functions

 CIvfComposite ()
virtual ~CIvfComposite ()
 IvfClassInfo ("CIvfComposite", CIvfShape)
virtual void refresh ()
void setUseReference (bool flag)
void setRenderInterval (int interval)
void setHighlightChildren (THighlightState state)
void setHighlight (THighlightState state)
void setHighlightComposite (THighlightState state)
void setSelectChildren (TSelectState state)
void refreshChildren ()
void deleteAll ()
virtual CIvfShaperemoveChild (int index)
virtual CIvfShaperemoveShape (CIvfShape *removeShape)
virtual void addChild (CIvfShape *shape)
virtual void deleteChild (int index)
CIvfShapegetChild (int index)
void clear ()
int getSize ()
void updateBoundingSphere ()
CIvfShapefindShape (const char *name)

Protected Member Functions

void compositeRemove (CIvfComposite *composite, CIvfShape *deleteChild)
virtual void createGeometry ()

Detailed Description

Composite shape class.

CIvfComposite implements an shape consisting of multiple child objects. Example:

 void CExampleWindow::onInit(int width, int heigth)
 {
     .
     .
          
     m_scene = new CIvfComposite();
     
     CIvfSphere* sphere = new CIvfSphere();
     sphere->setPosition(3.0, 0.0, 0.0);
     CIvfCube* cube = new CIvfCube();
     cube->setPosition(-3.0, 0.0, 0.0);

     m_scene->addChild(sphere);
     m_scene->addChild(cube);
     
     .
     .
     .
 }
 
 .
 .
 .
 void CExampleWindow::onRender()
 {
     .
     .
   
     m_scene->render();

     .
     .
 }
 *

Author:
Jonas Lindemann
Examples:

ac3dreader.cpp, actionctl.cpp, advgeom.cpp, controllers.cpp, culling.cpp, extrusion.cpp, lighting.cpp, lod.cpp, placement.cpp, robot.cpp, selection.cpp, and textures.cpp.

Definition at line 77 of file IvfComposite.h.


Constructor & Destructor Documentation

CIvfComposite::CIvfComposite  ) 
 

CIvfComposite constructor.

virtual CIvfComposite::~CIvfComposite  )  [virtual]
 

CIvfComposite destructor.


Member Function Documentation

virtual void CIvfComposite::addChild CIvfShape shape  )  [virtual]
 

Add child

Adds a CIvfShape object to the composite object.

Parameters:
shape CIvfShape object to be added.

Reimplemented in CIvfCulledComposite, CIvfSelectComposite, and CIvfUIComposite.

void CIvfComposite::clear  ) 
 

Clear composite object

Removes all object references without deleting objects. If object reference counting is used all objects are dereferenced before being removed.

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

Forces an object recalculation.

Reimplemented from CIvfShape.

Reimplemented in CIvfBillboard, CIvfCulledComposite, CIvfCursor, CIvfLightComposite, CIvfOldScene, CIvfSelectComposite, and CIvfSwitch.

void CIvfComposite::deleteAll  ) 
 

Deletes all child objects

Deletes all child objects if they are unreferenced.

virtual void CIvfComposite::deleteChild int  index  )  [virtual]
 

Delete child

Deletes child at index. To be deleted the child object must be unreferenced.

Parameters:
index Index of child object to be deleted.

Reimplemented in CIvfSelectComposite.

CIvfShape* CIvfComposite::findShape const char *  name  ) 
 

Finds a named shape

This method recursively searches the composite for a shape with a given name. This name is assigned using the setName() method. This function is often used in conjunction with the AC3D file reader which assigns names to each shape.

CIvfShape* CIvfComposite::getChild int  index  ) 
 

Return child

Returns a reference to the child at a given position.

Parameters:
index Index of child to be returned (zero based)
Returns:
Reference to a CIvfShape object. If invalid index NULL is returned.

int CIvfComposite::getSize  ) 
 

Returns the number of objects in the composite object.

virtual void CIvfComposite::refresh  )  [virtual]
 

Force object refresh

Reimplemented from CIvfShape.

void CIvfComposite::refreshChildren  ) 
 

Refreshes all children

virtual CIvfShape* CIvfComposite::removeChild int  index  )  [virtual]
 

Removes child

Removes specified child at index dereferences it and returns a reference.

Parameters:
index Index of child to be removed (zero based)
Returns:
Reference to removed object.

Reimplemented in CIvfSelectComposite.

virtual CIvfShape* CIvfComposite::removeShape CIvfShape removeShape  )  [virtual]
 

Removes child shape

Remove specified CIvfShape instance, dereferences it and returns a reference.

Parameters:
removeShape Reference of object to remove
Returns:
Reference to removed object. Returns NULL if object was not found.

Reimplemented in CIvfSelectComposite.

void CIvfComposite::setHighlight THighlightState  state  ) 
 

Set the highlight state of the child objects.

Loops through the child objects and calls their setHighlight() methods.

Parameters:
state HS_ON highlights all child objects. HS_OFF removes highlight from child objects.

Reimplemented in CIvfUIComposite.

void CIvfComposite::setHighlightChildren THighlightState  state  ) 
 

Set the highlight state of the child objects.

Loops through the child objects and calls their setHighlight() methods.

Parameters:
state HS_ON highlights all child objects. HS_OFF removes highlight from child objects.

void CIvfComposite::setRenderInterval int  interval  ) 
 

Set rendering interval

Parameters:
interval - Renders every interval object in the composite

void CIvfComposite::setSelectChildren TSelectState  state  ) 
 

Set the select state of the child objects.

Loops through the child objects and class their setSelect() methods.

Parameters:
state IVF_SELECT_ON selectes all child objects. IVF_SELECT_OFF deselects all child objects.

void CIvfComposite::setUseReference bool  flag  ) 
 

Determines if objects should be referenced.

If set to true child object reference counting is to be used. If a child object is not referenced when it has been dereferenced by CIvfComposite it is deleted. If this property is set to false CIvfComposite does not reference its child objects.

void CIvfComposite::updateBoundingSphere  )  [virtual]
 

Updates bounding sphere

Upates the radius of the assigned bounding sphere, if any.

Reimplemented from CIvfObject.


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