osgTerrain::Terrain Class Reference

`#include <Terrain>`

Inheritance diagram for osgTerrain::Terrain:

## Public Member Functions

| Terrain ()
| Terrain (const Terrain &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
| META_Node (osgTerrain, Terrain)
virtual void | traverse (osg::NodeVisitor &nv)
virtual osgTerrain::Terrain * | asTerrain ()
virtual const osgTerrain::Terrain * | asTerrain () const
void | setSampleRatio (float ratio)
float | getSampleRatio () const
void | setVerticalScale (float scale)
float | getVerticalScale () const
void | setBlendingPolicy (TerrainTile::BlendingPolicy policy)
TerrainTile::BlendingPolicy | getBlendingPolicy () const
void | setEqualizeBoundaries (bool equalizeBoundaries)
bool | getEqualizeBoundaries () const
void | setGeometryPool (GeometryPool *gp)
GeometryPool * | getGeometryPool ()
const GeometryPool * | getGeometryPool () const
TerrainTile * | getTile (const TileID &tileID)
const TerrainTile * | getTile (const TileID &tileID) const
void | setTerrainTechniquePrototype (TerrainTechnique *technique)
TerrainTechnique * | getTerrainTechniquePrototype ()
const TerrainTechnique * | getTerrainTechniquePrototype () const
void | updateTerrainTileOnNextFrame (TerrainTile *terrainTile)
Public Member Functions inherited from osg::CoordinateSystemNode
| CoordinateSystemNode ()
| CoordinateSystemNode (const std::string &format, const std::string &cs)
| CoordinateSystemNode (const CoordinateSystemNode &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
| META_Node (osg, CoordinateSystemNode)
void | set (const CoordinateSystemNode &csn)
void | setFormat (const std::string &format)
const std::string & | getFormat () const
void | setCoordinateSystem (const std::string &cs)
const std::string & | getCoordinateSystem () const
void | setEllipsoidModel (EllipsoidModel *ellipsode)
EllipsoidModel * | getEllipsoidModel ()
const EllipsoidModel * | getEllipsoidModel () const
CoordinateFrame | computeLocalCoordinateFrame (const Vec3d &position) const
osg::Vec3d | computeLocalUpVector (const Vec3d &position) const
Public Member Functions inherited from osg::Group
| Group ()
| Group (const Group &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
| META_Node (osg, Group)
virtual Group * | asGroup ()
virtual const Group * | asGroup () const
virtual bool | addChild (Node *child)
template<class T>
bool | addChild (const ref_ptr< T > &child)
virtual bool | insertChild (unsigned int index, Node *child)
template<class T>
bool | insertChild (unsigned int index, const ref_ptr< T > &child)
virtual bool | removeChild (Node *child)
template<class T>
bool | removeChild (const ref_ptr< T > &child)
bool | removeChild (unsigned int pos, unsigned int numChildrenToRemove=1)
virtual bool | removeChildren (unsigned int pos, unsigned int numChildrenToRemove)
virtual bool | replaceChild (Node *origChild, Node *newChild)
template<class T, class R>
bool | replaceChild (const ref_ptr< T > &origChild, const ref_ptr< R > &newChild)
virtual unsigned int | getNumChildren () const
virtual bool | setChild (unsigned int i, Node *node)
Node * | getChild (unsigned int i)
const Node * | getChild (unsigned int i) const
bool | containsNode (const Node *node) const
template<class T>
bool | containsNode (const ref_ptr< T > &node) const
unsigned int | getChildIndex (const Node *node) const
virtual void | setThreadSafeRefUnref (bool threadSafe)
virtual void | resizeGLObjectBuffers (unsigned int maxSize)
virtual void | releaseGLObjects (osg::State *=0) const
virtual BoundingSphere | computeBound () const
Public Member Functions inherited from osg::Node
| Node ()
| Node (const Node &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual Object * | cloneType () const
virtual Object * | clone (const CopyOp &copyop) const
virtual bool | isSameKindAs (const Object *obj) const
virtual const char * | libraryName () const
virtual const char * | className () const
virtual Node * | asNode ()
virtual const Node * | asNode () const
virtual Drawable * | asDrawable ()
virtual const Drawable * | asDrawable () const
virtual Geometry * | asGeometry ()
virtual const Geometry * | asGeometry () const
virtual Transform * | asTransform ()
virtual const Transform * | asTransform () const
virtual Switch * | asSwitch ()
virtual const Switch * | asSwitch () const
virtual Geode * | asGeode ()
virtual const Geode * | asGeode () const
virtual void | accept (NodeVisitor &nv)
virtual void | ascend (NodeVisitor &nv)
const ParentList & | getParents () const
ParentList | getParents ()
Group * | getParent (unsigned int i)
const Group * | getParent (unsigned int i) const
unsigned int | getNumParents () const
NodePathList | getParentalNodePaths (osg::Node *haltTraversalAtNode=0) const
MatrixList | getWorldMatrices (const osg::Node *haltTraversalAtNode=0) const
void | setUpdateCallback (Callback *nc)
template<class T>
void | setUpdateCallback (const ref_ptr< T > &nc)
Callback * | getUpdateCallback ()
const Callback * | getUpdateCallback () const
void | addUpdateCallback (Callback *nc)
template<class T>
void | addUpdateCallback (const ref_ptr< T > &nc)
void | removeUpdateCallback (Callback *nc)
template<class T>
void | removeUpdateCallback (const ref_ptr< T > &nc)
unsigned int | getNumChildrenRequiringUpdateTraversal () const
void | setEventCallback (Callback *nc)
template<class T>
void | setEventCallback (const ref_ptr< T > &nc)
Callback * | getEventCallback ()
const Callback * | getEventCallback () const
void | addEventCallback (Callback *nc)
template<class T>
void | addEventCallback (const ref_ptr< T > &nc)
void | removeEventCallback (Callback *nc)
template<class T>
void | removeEventCallback (const ref_ptr< T > &nc)
unsigned int | getNumChildrenRequiringEventTraversal () const
void | setCullCallback (Callback *nc)
template<class T>
void | setCullCallback (const ref_ptr< T > &nc)
Callback * | getCullCallback ()
const Callback * | getCullCallback () const
void | addCullCallback (Callback *nc)
template<class T>
void | addCullCallback (const ref_ptr< T > &nc)
void | removeCullCallback (Callback *nc)
template<class T>
void | removeCullCallback (const ref_ptr< T > &nc)
void | setCullingActive (bool active)
bool | getCullingActive () const
unsigned int | getNumChildrenWithCullingDisabled () const
bool | isCullingActive () const
unsigned int | getNumChildrenWithOccluderNodes () const
bool | containsOccluderNodes () const
void | setNodeMask (NodeMask nm)
NodeMask | getNodeMask () const
void | setStateSet (osg::StateSet *stateset)
template<class T>
void | setStateSet (const osg::ref_ptr< T > &stateset)
osg::StateSet * | getOrCreateStateSet ()
osg::StateSet * | getStateSet ()
const osg::StateSet * | getStateSet () const
void | setDescriptions (const DescriptionList &descriptions)
DescriptionList & | getDescriptions ()
const DescriptionList & | getDescriptions () const
const std::string & | getDescription (unsigned int i) const
std::string & | getDescription (unsigned int i)
unsigned int | getNumDescriptions () const
void | addDescription (const std::string &desc)
void | setInitialBound (const osg::BoundingSphere &bsphere)
const BoundingSphere & | getInitialBound () const
void | dirtyBound ()
const BoundingSphere & | getBound () const
void | setComputeBoundingSphereCallback (ComputeBoundingSphereCallback *callback)
template<class T>
void | setComputeBoundingSphereCallback (const ref_ptr< T > &callback)
ComputeBoundingSphereCallback * | getComputeBoundingSphereCallback ()
const ComputeBoundingSphereCallback * | getComputeBoundingSphereCallback () const
Public Member Functions inherited from osg::Object
| Object ()
| Object (bool threadSafeRefUnref)
| Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
std::string | getCompoundClassName () const
virtual NodeVisitor * | asNodeVisitor ()
virtual const NodeVisitor * | asNodeVisitor () const
virtual StateSet * | asStateSet ()
virtual const StateSet * | asStateSet () const
virtual StateAttribute * | asStateAttribute ()
virtual const StateAttribute * | asStateAttribute () const
virtual Uniform * | asUniform ()
virtual const Uniform * | asUniform () const
virtual Camera * | asCamera ()
virtual const Camera * | asCamera () const
virtual Callback * | asCallback ()
virtual const Callback * | asCallback () const
virtual CallbackObject * | asCallbackObject ()
virtual const CallbackObject * | asCallbackObject () const
virtual UserDataContainer * | asUserDataContainer ()
virtual const UserDataContainer * | asUserDataContainer () const
virtual ValueObject * | asValueObject ()
virtual const ValueObject * | asValueObject () const
virtual Image * | asImage ()
virtual const Image * | asImage () const
virtual void | setName (const std::string &name)
void | setName (const char *name)
const std::string & | getName () const
void | setDataVariance (DataVariance dv)
DataVariance | getDataVariance () const
virtual void | computeDataVariance ()
void | setUserDataContainer (osg::UserDataContainer *udc)
template<class T>
void | setUserDataContainer (const ref_ptr< T > &udc)
osg::UserDataContainer * | getUserDataContainer ()
const osg::UserDataContainer * | getUserDataContainer () const
osg::UserDataContainer * | getOrCreateUserDataContainer ()
virtual void | setUserData (Referenced *obj)
template<class T>
void | setUserData (const ref_ptr< T > &ud)
virtual Referenced * | getUserData ()
virtual const Referenced * | getUserData () const
template<typename T>
bool | getUserValue (const std::string &name, T &value) const
template<typename T>
void | setUserValue (const std::string &name, const T &value)
template<typename T>
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool | getUserValue (const std::string &name, T &value) const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Types

typedef std::map< TileID, TerrainTile * > | TerrainTileMap
typedef std::set< TerrainTile * > | TerrainTileSet

## Protected Member Functions

virtual | ~Terrain ()
void | dirtyRegisteredTiles (int dirtyMask=TerrainTile::ALL_DIRTY)
void | registerTerrainTile (TerrainTile *tile)
void | unregisterTerrainTile (TerrainTile *tile)
Protected Member Functions inherited from osg::CoordinateSystemNode
virtual | ~CoordinateSystemNode ()
Protected Member Functions inherited from osg::Group
virtual | ~Group ()
virtual void | childRemoved (unsigned int, unsigned int)
virtual void | childInserted (unsigned int)
Protected Member Functions inherited from osg::Node
virtual | ~Node ()
void | addParent (osg::Group *parent)
void | removeParent (osg::Group *parent)
void | setNumChildrenRequiringUpdateTraversal (unsigned int num)
void | setNumChildrenRequiringEventTraversal (unsigned int num)
void | setNumChildrenWithCullingDisabled (unsigned int num)
void | setNumChildrenWithOccluderNodes (unsigned int num)
Protected Member Functions inherited from osg::Object
virtual | ~Object ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

float | _sampleRatio
float | _verticalScale
TerrainTile::BlendingPolicy | _blendingPolicy
bool | _equalizeBoundaries
osg::ref_ptr< GeometryPool > | _geometryPool
OpenThreads::ReentrantMutex | _mutex
TerrainTileSet | _terrainTileSet
TerrainTileMap | _terrainTileMap
TerrainTileSet | _updateTerrainTileSet
osg::ref_ptr< TerrainTechnique > | _terrainTechnique
Protected Attributes inherited from osg::CoordinateSystemNode
std::string | _format
std::string | _cs
ref_ptr< EllipsoidModel > | _ellipsoidModel
Protected Attributes inherited from osg::Group
NodeList | _children
Protected Attributes inherited from osg::Node
BoundingSphere | _initialBound
ref_ptr< ComputeBoundingSphereCallback > | _computeBoundCallback
BoundingSphere | _boundingSphere
bool | _boundingSphereComputed
ParentList | _parents
ref_ptr< Callback > | _updateCallback
unsigned int | _numChildrenRequiringUpdateTraversal
ref_ptr< Callback > | _eventCallback
unsigned int | _numChildrenRequiringEventTraversal
ref_ptr< Callback > | _cullCallback
bool | _cullingActive
unsigned int | _numChildrenWithCullingDisabled
unsigned int | _numChildrenWithOccluderNodes
NodeMask | _nodeMask
ref_ptr< StateSet > | _stateset
Protected Attributes inherited from osg::Object
std::string | _name
DataVariance | _dataVariance
osg::UserDataContainer * | _userDataContainer
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Friends

class | TerrainTile

## Additional Inherited Members

Public Types inherited from osg::Node
typedef std::vector< Group * > | ParentList
typedef unsigned int | NodeMask
typedef std::vector< std::string > | DescriptionList
Public Types inherited from osg::Object
enum | DataVariance { DYNAMIC , STATIC , UNSPECIFIED }
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Detailed Description

Terrain provides a framework for loosely coupling height field data with height rendering algorithms. This allows TerrainTechniques to be plugged in at runtime.

## Member Typedef Documentation

## TerrainTileMap

typedef std::map< TileID, TerrainTile* > osgTerrain::Terrain::TerrainTileMap

protected

## TerrainTileSet

typedef std::set< TerrainTile* > osgTerrain::Terrain::TerrainTileSet

protected

## Constructor & Destructor Documentation

## Terrain() [1/2]

osgTerrain::Terrain::Terrain | ( |  | ) |

Referenced by META_Node(), and Terrain().

## Terrain() [2/2]

osgTerrain::Terrain::Terrain | ( | const Terrain & | ,
|  | const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY )

Copy constructor using CopyOp to manage deep vs shallow copy.

References osg::CopyOp::SHALLOW_COPY, and Terrain().

## ~Terrain()

virtual osgTerrain::Terrain::~Terrain | ( |  | ) |

protected virtual

## Member Function Documentation

## asTerrain() [1/2]

virtual osgTerrain::Terrain * osgTerrain::Terrain::asTerrain | ( |  | ) |

inline virtual

Convert 'this' into a Transform pointer if Node is a Terrain, otherwise return 0. Equivalent to dynamic_cast<Terrrain*>(this).

Reimplemented from osg::Node.

## asTerrain() [2/2]

virtual const osgTerrain::Terrain * osgTerrain::Terrain::asTerrain | ( |  | ) | const

inline virtual

convert 'const this' into a const Terrain pointer if Node is a Terrain, otherwise return 0. Equivalent to dynamic_cast<const Terrain*>(this).

Reimplemented from osg::Node.

## dirtyRegisteredTiles()

void osgTerrain::Terrain::dirtyRegisteredTiles | ( | int | dirtyMask = TerrainTile::ALL_DIRTY | ) |

protected

References osgTerrain::TerrainTile::ALL_DIRTY.

## getBlendingPolicy()

TerrainTile::BlendingPolicy osgTerrain::Terrain::getBlendingPolicy | ( |  | ) | const

inline

Get the default policy to use when deciding whether to enable/disable blending and use of transparent bin.

References _blendingPolicy.

## getEqualizeBoundaries()

bool osgTerrain::Terrain::getEqualizeBoundaries | ( |  | ) | const

inline

If true the boundaries between adjacent tiles will be equalized.

References _equalizeBoundaries.

## getGeometryPool() [1/2]

GeometryPool * osgTerrain::Terrain::getGeometryPool | ( |  | ) |

inline

Get the GeometryPool.

References _geometryPool.

## getGeometryPool() [2/2]

const GeometryPool * osgTerrain::Terrain::getGeometryPool | ( |  | ) | const

inline

Get the const GeometryPool.

References _geometryPool.

## getSampleRatio()

float osgTerrain::Terrain::getSampleRatio | ( |  | ) | const

inline

Get the sample ratio hint.

References _sampleRatio.

## getTerrainTechniquePrototype() [1/2]

TerrainTechnique * osgTerrain::Terrain::getTerrainTechniquePrototype | ( |  | ) |

inline

Get the TerrainTechnique prototype

References _terrainTechnique.

## getTerrainTechniquePrototype() [2/2]

const TerrainTechnique * osgTerrain::Terrain::getTerrainTechniquePrototype | ( |  | ) | const

inline

Get the const TerrainTechnique protype

References _terrainTechnique.

## getTile() [1/2]

TerrainTile * osgTerrain::Terrain::getTile | ( | const TileID & | tileID | ) |

Get the TerrainTile for a given TileID.

References TerrainTile.

## getTile() [2/2]

const TerrainTile * osgTerrain::Terrain::getTile | ( | const TileID & | tileID | ) | const

Get the const TerrainTile for a given TileID.

References TerrainTile.

## getVerticalScale()

float osgTerrain::Terrain::getVerticalScale | ( |  | ) | const

inline

Get the vertical scale hint.

References _verticalScale.

## META_Node()

osgTerrain::Terrain::META_Node | ( | osgTerrain | ,
|  | Terrain | )

References Terrain().

## registerTerrainTile()

void osgTerrain::Terrain::registerTerrainTile | ( | TerrainTile * | tile | ) |

protected

References TerrainTile.

## setBlendingPolicy()

void osgTerrain::Terrain::setBlendingPolicy | ( | TerrainTile::BlendingPolicy | policy | ) |

Set the default policy to use when deciding whether to enable/disable blending and use of transparent bin. Note, the Terrain::BlendingPolicy value only sets the value for the TerrainTiles it encloses for the TerrainTile's that have their policy set to INHERIT. INHERIT is the default BlendingPolicy for both Terrain and TerrainTile, and if both are left to INERHIT then the policy used is ENABLE_BLENDING_WHEN_ALPHA_PRESENT.

## setEqualizeBoundaries()

void osgTerrain::Terrain::setEqualizeBoundaries | ( | bool | equalizeBoundaries | ) |

If set to true the boundaries between adjacent tiles should be equalized. Note, it is only possible to equalizae boundaries when the TerrainTile's contain properly assigned TileID's, databases built with VirtualPlanetBuilder-0.9.11 and older do not set the TileID, so databases must be built with later versions of VirtualPlanetBuilder to take advantage of boundary equalization.

## setGeometryPool()

void osgTerrain::Terrain::setGeometryPool | ( | GeometryPool * | gp | ) |

inline

Set a custom GeometryPool to be used by TerrainTechniques that share geometry.

References _geometryPool.

## setSampleRatio()

void osgTerrain::Terrain::setSampleRatio | ( | float | ratio | ) |

Set the sample ratio hint that TerrainTile should use when building geometry. Defaults to 1.0, which means use all original sample points.

## setTerrainTechniquePrototype()

void osgTerrain::Terrain::setTerrainTechniquePrototype | ( | TerrainTechnique * | technique | ) |

inline

Set the TerrainTechnique prototype from which TerrainTiles can clone the techniques from.

References _terrainTechnique.

## setVerticalScale()

void osgTerrain::Terrain::setVerticalScale | ( | float | scale | ) |

Set the vertical scale hint.

## traverse()

virtual void osgTerrain::Terrain::traverse | ( | osg::NodeVisitor & |  | ) |

virtual

Traverse downwards : calls children's accept method with NodeVisitor.

Reimplemented from osg::Group.

## unregisterTerrainTile()

void osgTerrain::Terrain::unregisterTerrainTile | ( | TerrainTile * | tile | ) |

protected

References TerrainTile.

## updateTerrainTileOnNextFrame()

void osgTerrain::Terrain::updateTerrainTileOnNextFrame | ( | TerrainTile * | terrainTile | ) |

Tell the Terrain node to call the terrainTile's TerrainTechnique on the next update traversal.

References TerrainTile.

## Friends And Related Symbol Documentation

## TerrainTile

friend class TerrainTile

friend

References TerrainTile.

Referenced by getTile(), getTile(), registerTerrainTile(), TerrainTile, unregisterTerrainTile(), and updateTerrainTileOnNextFrame().

## Member Data Documentation

## _blendingPolicy

TerrainTile::BlendingPolicy osgTerrain::Terrain::_blendingPolicy

protected

Referenced by getBlendingPolicy().

## _equalizeBoundaries

bool osgTerrain::Terrain::_equalizeBoundaries

protected

Referenced by getEqualizeBoundaries().

## _geometryPool

osg::ref_ptr<GeometryPool> osgTerrain::Terrain::_geometryPool

protected

Referenced by getGeometryPool(), getGeometryPool(), and setGeometryPool().

## _mutex

OpenThreads::ReentrantMutex osgTerrain::Terrain::_mutex

mutable protected

## _sampleRatio

float osgTerrain::Terrain::_sampleRatio

protected

Referenced by getSampleRatio().

## _terrainTechnique

osg::ref_ptr<TerrainTechnique> osgTerrain::Terrain::_terrainTechnique

protected

Referenced by getTerrainTechniquePrototype(), getTerrainTechniquePrototype(), and setTerrainTechniquePrototype().

## _terrainTileMap

TerrainTileMap osgTerrain::Terrain::_terrainTileMap

protected

## _terrainTileSet

TerrainTileSet osgTerrain::Terrain::_terrainTileSet

protected

## _updateTerrainTileSet

TerrainTileSet osgTerrain::Terrain::_updateTerrainTileSet

protected

## _verticalScale

float osgTerrain::Terrain::_verticalScale

protected

Referenced by getVerticalScale().

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

- Terrain