VR-Forces 4.0.4 Class Documentation
Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtOsgTerrainPatchObject Class Reference

A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain. More...

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

List of all members.

Classes

struct  ExtractedNode

Public Member Functions

 DtOsgTerrainPatchObject (DtDe &de, DtUniqueID id)
 CTOR.
virtual ~DtOsgTerrainPatchObject ()
 DTOR.
virtual void setTerrainDefinition (const std::string &modelDefinitionName)
 Distributed methods:
virtual void enableOverlay (int type, const std::string &definition)
 Enable specified overlay with specified definition.
virtual void disableOverlay (int type)
 Disable specified overlay.
virtual void disableAllOverlays ()
 Disable all overlays.
virtual void setOverlayScale (int type, double x, double y)
 Set scale of specified overlay.
virtual void setWrapMode (int type, int)
 Set wrap mode of specified overlay. Default is REPEAT.
virtual void setBlendMode (int type, int)
 Set blend mode of specified overlay. Default is MODULATE.
virtual void setOverlayOffset (int type, double x, double y)
 Set offset of specified overlay.
virtual void setLayerEnabled (const std::string &rule, bool status)
 Toggle layers on or off by rule regexp.
virtual void setRasterLayerPosition (int type, int pos)
 Sets the position of the raster layer to draw.
virtual std::string overlayDefinition (int type)
 Local functions.
virtual std::vector< double > overlayScale (int type)
 Non bound methods:
virtual std::vector< double > overlayOffset (int type)
 Non bound methods:
virtual DtTerrainOverlayOperation defaultOverlay (int type)
 Non bound methods:
virtual DtTerrainOverlayOperation currentOverlay (int type)
 Non bound methods:
virtual void getTerrainExtents (DtVector &nw, DtVector &ne, DtVector &sw, DtVector &se) const
 Return the corners of the terrain, useful for calculating draping parameters.
virtual DtVector getDatabaseOrigin () const
 Return the origin of the database in database coordinates.
virtual void getBoundingBoxCenter (float &x, float &y, float &z) const
 Get the bounding box center of the terrain patch.
osg::Group * terrainGroupNode ()
virtual void extractNodes (const std::string &ruleset, bool isRegEx)
 Move nodes via a ruleset.
virtual int countNodes (const std::string &rule) const
 Count nodes via a rule.
virtual bool getExtractedNodePosition (const std::string &rule, unsigned int index, double &x, double &y, double &z) const
 Get the extracted node position.
virtual bool getExtractedNodeOrientation (const std::string &rule, unsigned int index, double &x, double &y, double &z, double &w) const
 Get the extracted node orientation.
virtual void moveNode (DtSceneObject *object, DtModel *model, const std::string &rule, unsigned int index)
 Moves a node to the model and sets the location of an object by its location.
virtual osg::Node * findNode (const std::string &rule, unsigned int index)
 Get a particular node found with a rule & it's index.
virtual bool isGlobalScaleTerrain () const
 Get if the terrain patch is a global scale.
virtual bool getTerrainIntersection (double x, double y, double z, double vx, double vy, double vz, double &retX, double &retY, double &retZ)
 Get a terrain intersection.
virtual void clearElevationCache ()
 If the patch object is using an elevation cache, clear it (otherwise do nothing).
bool isOsgEarth () const

Protected Types

typedef std::vector
< ExtractedNode
NodeList
typedef std::map< std::string,
NodeList
ExtractedNodeListMap

Protected Member Functions

void removeChildNodesAndCache ()
 Unload the terrain.
void removeEmptyParent (osg::Node *node)
void updateBounds ()
virtual bool getElevation (double lonRadians, double latRadians, double &retElevation)
 get an osg earth elevation

Static Protected Member Functions

static void graphBoundingBox (const osg::Node *node, osg::BoundingBox &bbox)

Protected Attributes

osg::ref_ptr< DtTerrainPatchGroupmyRoot
 The OSG Hierarchy starts with myRoot and has one child: myTerrainGroup.
osg::ref_ptr< DtFastGroupmyTerrainGroup
 The myTerrainGroup node holds all the terrain polygons except for reforested trees.
osgEarth::Util::ElevationManager * myElevationManager
osgEarth::MapNode * myMapNode
ExtractedNodeListMap myExtractedNodes
DtOsgTerrainOverlayManager myOverlayManager
bool myGlobalFlag

Private Member Functions

 DtOsgTerrainPatchObject (const DtOsgTerrainPatchObject &)
 Not implemented.
DtOsgTerrainPatchObjectoperator= (const DtOsgTerrainPatchObject &)

Detailed Description

A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain.

When loading a file as a terrain certain post processing steps can be taken. For example, the static trees can be extracted and replaced by dynamically generated trees.


Member Typedef Documentation

typedef std::vector<ExtractedNode> makVrv::DtOsgTerrainPatchObject::NodeList [protected]
typedef std::map<std::string, NodeList > makVrv::DtOsgTerrainPatchObject::ExtractedNodeListMap [protected]

Constructor & Destructor Documentation

CTOR.

DTOR.

Not implemented.


Member Function Documentation

virtual void makVrv::DtOsgTerrainPatchObject::setTerrainDefinition ( const std::string &  modelDefinitionName) [virtual]

Distributed methods:

The model definition will be loaded and post processing will occur.

Reimplemented from makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::enableOverlay ( int  type,
const std::string &  definition 
) [virtual]

Enable specified overlay with specified definition.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::disableOverlay ( int  type) [virtual]

Disable specified overlay.

Implements makVrv::DtTerrainPatchObject.

Disable all overlays.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::setOverlayScale ( int  type,
double  x,
double  y 
) [virtual]

Set scale of specified overlay.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::setWrapMode ( int  type,
int   
) [virtual]

Set wrap mode of specified overlay. Default is REPEAT.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::setBlendMode ( int  type,
int   
) [virtual]

Set blend mode of specified overlay. Default is MODULATE.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::setOverlayOffset ( int  type,
double  x,
double  y 
) [virtual]

Set offset of specified overlay.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::setLayerEnabled ( const std::string &  rule,
bool  status 
) [virtual]

Toggle layers on or off by rule regexp.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::setRasterLayerPosition ( int  type,
int  pos 
) [virtual]

Sets the position of the raster layer to draw.

Implements makVrv::DtTerrainPatchObject.

virtual std::string makVrv::DtOsgTerrainPatchObject::overlayDefinition ( int  type) [virtual]

Local functions.

Implements makVrv::DtTerrainPatchObject.

virtual std::vector<double> makVrv::DtOsgTerrainPatchObject::overlayScale ( int  type) [virtual]

Non bound methods:

Implements makVrv::DtTerrainPatchObject.

virtual std::vector<double> makVrv::DtOsgTerrainPatchObject::overlayOffset ( int  type) [virtual]

Non bound methods:

Implements makVrv::DtTerrainPatchObject.

Non bound methods:

Implements makVrv::DtTerrainPatchObject.

Non bound methods:

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::getTerrainExtents ( DtVector nw,
DtVector ne,
DtVector sw,
DtVector se 
) const [virtual]

Return the corners of the terrain, useful for calculating draping parameters.

Implements makVrv::DtTerrainPatchObject.

Return the origin of the database in database coordinates.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::getBoundingBoxCenter ( float &  x,
float &  y,
float &  z 
) const [virtual]

Get the bounding box center of the terrain patch.

virtual void makVrv::DtOsgTerrainPatchObject::extractNodes ( const std::string &  ruleset,
bool  isRegEx 
) [virtual]

Move nodes via a ruleset.

Implements makVrv::DtTerrainPatchObject.

virtual int makVrv::DtOsgTerrainPatchObject::countNodes ( const std::string &  rule) const [virtual]

Count nodes via a rule.

This checks the current terrain contents without modifying it.

Implements makVrv::DtTerrainPatchObject.

virtual bool makVrv::DtOsgTerrainPatchObject::getExtractedNodePosition ( const std::string &  rule,
unsigned int  index,
double &  x,
double &  y,
double &  z 
) const [virtual]

Get the extracted node position.

Return values:
falseif the node is not found.

Implements makVrv::DtTerrainPatchObject.

virtual bool makVrv::DtOsgTerrainPatchObject::getExtractedNodeOrientation ( const std::string &  rule,
unsigned int  index,
double &  x,
double &  y,
double &  z,
double &  w 
) const [virtual]

Get the extracted node orientation.

Return values:
falseif the node is not found.

Implements makVrv::DtTerrainPatchObject.

virtual void makVrv::DtOsgTerrainPatchObject::moveNode ( DtSceneObject object,
DtModel model,
const std::string &  rule,
unsigned int  index 
) [virtual]

Moves a node to the model and sets the location of an object by its location.

Implements makVrv::DtTerrainPatchObject.

virtual osg::Node* makVrv::DtOsgTerrainPatchObject::findNode ( const std::string &  rule,
unsigned int  index 
) [virtual]

Get a particular node found with a rule & it's index.

Get if the terrain patch is a global scale.

Implements makVrv::DtTerrainPatchObject.

virtual bool makVrv::DtOsgTerrainPatchObject::getTerrainIntersection ( double  x,
double  y,
double  z,
double  vx,
double  vy,
double  vz,
double &  retX,
double &  retY,
double &  retZ 
) [virtual]

Get a terrain intersection.

Implements makVrv::DtTerrainPatchObject.

If the patch object is using an elevation cache, clear it (otherwise do nothing).

Use after making a large number of successive calls, such as while extracting props from a shape file

Implements makVrv::DtTerrainPatchObject.

DtOsgTerrainPatchObject& makVrv::DtOsgTerrainPatchObject::operator= ( const DtOsgTerrainPatchObject ) [private]

Unload the terrain.

static void makVrv::DtOsgTerrainPatchObject::graphBoundingBox ( const osg::Node *  node,
osg::BoundingBox &  bbox 
) [static, protected]
void makVrv::DtOsgTerrainPatchObject::removeEmptyParent ( osg::Node *  node) [protected]
virtual bool makVrv::DtOsgTerrainPatchObject::getElevation ( double  lonRadians,
double  latRadians,
double &  retElevation 
) [protected, virtual]

get an osg earth elevation


Member Data Documentation

The OSG Hierarchy starts with myRoot and has one child: myTerrainGroup.

The myTerrainGroup node holds all the terrain polygons except for reforested trees.

osgEarth::Util::ElevationManager* makVrv::DtOsgTerrainPatchObject::myElevationManager [protected]
osgEarth::MapNode* makVrv::DtOsgTerrainPatchObject::myMapNode [protected]

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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)