VR-Forces 4.1.1 Class Documentation
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
makVrv::DtSpeedTreeForest Class Reference

A DtSpeedTreeForest replaces a DtOsgForest and creates nice looking realistic trees. More...

Inheritance diagram for makVrv::DtSpeedTreeForest:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtSpeedTreeForest ()
 Destructor.
Driver bound methods

These methods are bound to the driver.

virtual void removeTree (DtUniqueID record)
 Remove a tree from the forest.
virtual void setTreeClippingPlane (float fFar)
 Set the distance that trees are clipped.
virtual void setTreeLodDistances (float fNear, float fFar)
 Set the distances for tree LOD's.
virtual void setPerformanceProfile (int profile)
 Set the performance profile for the forest.
Unbound methods

These methods are NOT bound to the driver.

virtual void addUniqueTree (const DtTreeRecord &record)
 Add a tree to the forest.
virtual DtSpeedTreeModelInstancefindSpeedTreeModelInstance (const std::string &modelDef)
 Find a DtSpeedTreeModelInstance from the model definition name.
bool makeContextCurrent ()
 Attempt to make a context current.
- Public Member Functions inherited from makVrv::DtOsgForest
virtual ~DtOsgForest ()
 Destructor.
virtual void removeAllTrees ()
 Remove all trees.
virtual void getTreeClippingPlane (float &fFar)
 Get the distance that trees are clipped.
virtual void getTreeLodDistances (float &fNear, float &fFar)
 Get the distances for tree LOD's.
unsigned int treeCount () const
 Get the number of trees.
virtual DtTreeRecordfindTreeRecord (DtUniqueID id)
 Find a DtTreeRecord based on it's id.
virtual DtTreeModelfindTreeModel (const std::string &modelDef)
 Find a DtTreeModel from a model definition name.
virtual DtModelInstancefindModelInstance (const std::string &modelDef)
 Find a DtModelInstance from a model definition name.
virtual osg::Group * rootGroup ()
 Get the root group node.
- Public Member Functions inherited from makVrv::DtForestObject
virtual ~DtForestObject ()
 Destructor.
virtual DtDede ()
 IG accessor.
void addTree (const DtTreeRecord &record)
 Add a tree to the forest.
virtual DtModelDefinitionfindModelDefinition (const std::string &modelDef)
 Find a DtModelDefinition* from the model definition name.
virtual const TreeRecordMaptreeRecordMap () const
 Return the treeRecordMap.

Protected Member Functions

 DtSpeedTreeForest (DtDe &de, DtUniqueID id)
 Constructor is protected because this class is created via the creator pattern.
virtual void slot_treeModelInstanceToBeDestroyed (const std::string &modelDef)
 Called when the model instance for a particular model definition is about to be destroyed.
virtual void slot_treeModelInstanceCreated (const std::string &modelDef)
 Called when the model instance for a particular model definition is created.
virtual DtTreeModelcastUpdaterToTreeModel (DtAgentUpdateResolverInterface *updater)
 Casts a DtAgentUpdateResolverInterface to a DtSpeedTreeModel.
virtual bool createTree (const DtTreeRecord &record)
 No-op. Always returns true.
- Protected Member Functions inherited from makVrv::DtOsgForest
 DtOsgForest (DtDe &de, DtUniqueID id)
 Constructor is protected because this class is created via the creator pattern.
virtual
osg::PositionAttitudeTransform * 
createPat (const DtTreeRecord &record)
virtual DtOsgModelInstancefindOsgModelInstance (const std::string &modelDef)
 Find a DtOsgModelInstance from a model definition name.
virtual
osg::PositionAttitudeTransform * 
findPat (const DtUniqueID id)
 Find a osg::PositionAttitudeTransform* from an id.
virtual void removePat (const DtUniqueID id)
 Find a osg::PositionAttitudeTransform* from an id.
virtual void removeTreeModel (const std::string &modelDef)
 Remove a DtTreeModel of a particular model definition.
- Protected Member Functions inherited from makVrv::DtForestObject
 DtForestObject (DtDe &de, DtUniqueID id)
 Constructor is protected because this class is created via the creator pattern.

Protected Attributes

osg::ref_ptr
< osg::PositionAttitudeTransform > 
myPat
osg::ref_ptr< osg::Geode > myGeode
osg::ref_ptr< DtSpeedTreeDrawablemyDrawable
- Protected Attributes inherited from makVrv::DtOsgForest
TreePatMap myTreePatMap
osg::ref_ptr< osg::Group > myRoot
 The forest is a collection of trees under a group node.
float myFarPlane
float myNearLOD
float myFarLOD
- Protected Attributes inherited from makVrv::DtForestObject
DtDemyDe
TreeRecordMap myTreeRecordMap
TreeModelMap myTreeModelMap

Friends

class DtSpeedTreeForestClassesCreator
 This allows the protected constructor to be called by the DtSpeedTreeForestCreator(2).
class DtSpeedTreeForestCreator

Additional Inherited Members

- Public Types inherited from makVrv::DtOsgForest
typedef std::map< DtUniqueID,
osg::PositionAttitudeTransform * > 
TreePatMap

Detailed Description

A DtSpeedTreeForest replaces a DtOsgForest and creates nice looking realistic trees.

Constructor & Destructor Documentation

virtual makVrv::DtSpeedTreeForest::~DtSpeedTreeForest ( )
virtual

Destructor.

makVrv::DtSpeedTreeForest::DtSpeedTreeForest ( DtDe de,
DtUniqueID  id 
)
protected

Constructor is protected because this class is created via the creator pattern.

Member Function Documentation

virtual void makVrv::DtSpeedTreeForest::removeTree ( DtUniqueID  record)
virtual

Remove a tree from the forest.

Reimplemented from makVrv::DtOsgForest.

virtual void makVrv::DtSpeedTreeForest::setTreeClippingPlane ( float  fFar)
virtual

Set the distance that trees are clipped.

Since trees are expensive, they have their own clipping distances.

Reimplemented from makVrv::DtOsgForest.

virtual void makVrv::DtSpeedTreeForest::setTreeLodDistances ( float  fNear,
float  fFar 
)
virtual

Set the distances for tree LOD's.

float fNear - This parameter represents the distance from the camera where the highest LOD (1.0) begins. Trees that are closer to the camera than this distance retain a 1.0 LOD. Trees farther away than this distance are assigned an LOD value approaching 0.0 as they move toward the far LOD plane. fNear is set using world units, determine solely by the application. float fFar - This parameter represents the distance from the camera where the lowest LOD (0.0) begins. Trees that are farther from the camera than this distance retain a 0.0 LOD. Trees closer than this distance are assigned an LOD value approaching 1.0 as they move toward the near LOD plane. fFar is set using world units, determine solely by the application.

Reimplemented from makVrv::DtOsgForest.

virtual void makVrv::DtSpeedTreeForest::setPerformanceProfile ( int  profile)
virtual

Set the performance profile for the forest.

Reimplemented from makVrv::DtOsgForest.

virtual void makVrv::DtSpeedTreeForest::addUniqueTree ( const DtTreeRecord record)
virtual

Add a tree to the forest.

Reimplemented from makVrv::DtOsgForest.

virtual DtSpeedTreeModelInstance* makVrv::DtSpeedTreeForest::findSpeedTreeModelInstance ( const std::string &  modelDef)
virtual

Find a DtSpeedTreeModelInstance from the model definition name.

bool makVrv::DtSpeedTreeForest::makeContextCurrent ( )

Attempt to make a context current.

virtual void makVrv::DtSpeedTreeForest::slot_treeModelInstanceToBeDestroyed ( const std::string &  modelDef)
protectedvirtual

Called when the model instance for a particular model definition is about to be destroyed.

Reimplemented from makVrv::DtOsgForest.

virtual void makVrv::DtSpeedTreeForest::slot_treeModelInstanceCreated ( const std::string &  modelDef)
protectedvirtual

Called when the model instance for a particular model definition is created.

Reimplemented from makVrv::DtOsgForest.

virtual DtTreeModel* makVrv::DtSpeedTreeForest::castUpdaterToTreeModel ( DtAgentUpdateResolverInterface updater)
protectedvirtual
virtual bool makVrv::DtSpeedTreeForest::createTree ( const DtTreeRecord record)
protectedvirtual

No-op. Always returns true.

Reimplemented from makVrv::DtOsgForest.

Friends And Related Function Documentation

friend class DtSpeedTreeForestClassesCreator
friend

This allows the protected constructor to be called by the DtSpeedTreeForestCreator(2).

friend class DtSpeedTreeForestCreator
friend

Member Data Documentation

osg::ref_ptr<osg::PositionAttitudeTransform> makVrv::DtSpeedTreeForest::myPat
protected
osg::ref_ptr<osg::Geode> makVrv::DtSpeedTreeForest::myGeode
protected
osg::ref_ptr<DtSpeedTreeDrawable> makVrv::DtSpeedTreeForest::myDrawable
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)