OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
osgTerrain::Terrain Class Reference

#include <Terrain.h>

Inheritance diagram for osgTerrain::Terrain:
Inheritance graph
[legend]
Collaboration diagram for osgTerrain::Terrain:
Collaboration graph
[legend]

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::TerrainasTerrain ()
 
virtual const osgTerrain::TerrainasTerrain () 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)
 
GeometryPoolgetGeometryPool ()
 
const GeometryPoolgetGeometryPool () const
 
TerrainTilegetTile (const TileID &tileID)
 
const TerrainTilegetTile (const TileID &tileID) const
 
void setTerrainTechniquePrototype (TerrainTechnique *technique)
 
TerrainTechniquegetTerrainTechniquePrototype ()
 
const TerrainTechniquegetTerrainTechniquePrototype () 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)
 
EllipsoidModelgetEllipsoidModel ()
 
const EllipsoidModelgetEllipsoidModel () 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 GroupasGroup ()
 
virtual const GroupasGroup () const
 
virtual bool addChild (Node *child)
 
virtual bool insertChild (unsigned int index, Node *child)
 
virtual bool removeChild (Node *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)
 
virtual unsigned int getNumChildren () const
 
virtual bool setChild (unsigned int i, Node *node)
 
NodegetChild (unsigned int i)
 
const NodegetChild (unsigned int i) const
 
bool containsNode (const Node *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 ObjectcloneType () const
 
virtual Objectclone (const CopyOp &copyop) const
 
virtual bool isSameKindAs (const Object *obj) const
 
virtual const char * libraryName () const
 
virtual const char * className () const
 
virtual NodeasNode ()
 
virtual const NodeasNode () const
 
virtual DrawableasDrawable ()
 
virtual const DrawableasDrawable () const
 
virtual GeometryasGeometry ()
 
virtual const GeometryasGeometry () const
 
virtual TransformasTransform ()
 
virtual const TransformasTransform () const
 
virtual CameraasCamera ()
 
virtual const CameraasCamera () const
 
virtual SwitchasSwitch ()
 
virtual const SwitchasSwitch () const
 
virtual GeodeasGeode ()
 
virtual const GeodeasGeode () const
 
virtual void accept (NodeVisitor &nv)
 
virtual void ascend (NodeVisitor &nv)
 
const ParentListgetParents () const
 
ParentList getParents ()
 
GroupgetParent (unsigned int i)
 
const GroupgetParent (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)
 
CallbackgetUpdateCallback ()
 
const CallbackgetUpdateCallback () const
 
void addUpdateCallback (Callback *nc)
 
void removeUpdateCallback (Callback *nc)
 
unsigned int getNumChildrenRequiringUpdateTraversal () const
 
void setEventCallback (Callback *nc)
 
CallbackgetEventCallback ()
 
const CallbackgetEventCallback () const
 
void addEventCallback (Callback *nc)
 
void removeEventCallback (Callback *nc)
 
unsigned int getNumChildrenRequiringEventTraversal () const
 
void setCullCallback (Callback *nc)
 
CallbackgetCullCallback ()
 
const CallbackgetCullCallback () const
 
void addCullCallback (Callback *nc)
 
void removeCullCallback (Callback *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)
 
osg::StateSetgetOrCreateStateSet ()
 
osg::StateSetgetStateSet ()
 
const osg::StateSetgetStateSet () const
 
void setDescriptions (const DescriptionList &descriptions)
 
DescriptionListgetDescriptions ()
 
const DescriptionListgetDescriptions () 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 BoundingSpheregetInitialBound () const
 
void dirtyBound ()
 
const BoundingSpheregetBound () const
 
void setComputeBoundingSphereCallback (ComputeBoundingSphereCallback *callback)
 
ComputeBoundingSphereCallbackgetComputeBoundingSphereCallback ()
 
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 NodeVisitorasNodeVisitor ()
 
virtual const NodeVisitorasNodeVisitor () const
 
virtual StateAttributeasStateAttribute ()
 
virtual const StateAttributeasStateAttribute () const
 
virtual UniformasUniform ()
 
virtual const UniformasUniform () 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)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
virtual ReferencedgetUserData ()
 
virtual const ReferencedgetUserData () 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 &)
 
Referencedoperator= (const Referenced &)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () 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::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

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.

Definition at line 27 of file Terrain.h.

Member Typedef Documentation

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

Definition at line 118 of file Terrain.h.

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

Definition at line 119 of file Terrain.h.

Constructor & Destructor Documentation

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

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osgTerrain::Terrain::~Terrain ( )
protectedvirtual

Member Function Documentation

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

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

Reimplemented from osg::Node.

Definition at line 40 of file Terrain.h.

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

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.

Definition at line 41 of file Terrain.h.

void osgTerrain::Terrain::dirtyRegisteredTiles ( int  dirtyMask = TerrainTile::ALL_DIRTY)
protected
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.

Definition at line 66 of file Terrain.h.

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

If true the boundaries between adjacent tiles will be equalized.

Definition at line 75 of file Terrain.h.

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

Get the GeometryPool.

Definition at line 82 of file Terrain.h.

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

Get the const GeometryPool.

Definition at line 85 of file Terrain.h.

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

Get the sample ratio hint.

Definition at line 49 of file Terrain.h.

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

Get the TerrainTechnique prototype

Definition at line 99 of file Terrain.h.

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

Get the const TerrainTechnique protype

Definition at line 102 of file Terrain.h.

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

Get the TerrainTile for a given TileID.

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

Get the const TerrainTile for a given TileID.

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

Get the vertical scale hint.

Definition at line 56 of file Terrain.h.

osgTerrain::Terrain::META_Node ( osgTerrain  ,
Terrain   
)
void osgTerrain::Terrain::registerTerrainTile ( TerrainTile tile)
protected
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.

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.

void osgTerrain::Terrain::setGeometryPool ( GeometryPool gp)
inline

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

Definition at line 79 of file Terrain.h.

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.

void osgTerrain::Terrain::setTerrainTechniquePrototype ( TerrainTechnique technique)
inline

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

Definition at line 96 of file Terrain.h.

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

Set the vertical scale hint.

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

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

Reimplemented from osg::Group.

void osgTerrain::Terrain::unregisterTerrainTile ( TerrainTile tile)
protected
void osgTerrain::Terrain::updateTerrainTileOnNextFrame ( TerrainTile terrainTile)

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

Friends And Related Function Documentation

friend class TerrainTile
friend

Definition at line 111 of file Terrain.h.

Member Data Documentation

TerrainTile::BlendingPolicy osgTerrain::Terrain::_blendingPolicy
protected

Definition at line 123 of file Terrain.h.

bool osgTerrain::Terrain::_equalizeBoundaries
protected

Definition at line 124 of file Terrain.h.

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

Definition at line 125 of file Terrain.h.

OpenThreads::ReentrantMutex osgTerrain::Terrain::_mutex
mutableprotected

Definition at line 127 of file Terrain.h.

float osgTerrain::Terrain::_sampleRatio
protected

Definition at line 121 of file Terrain.h.

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

Definition at line 132 of file Terrain.h.

TerrainTileMap osgTerrain::Terrain::_terrainTileMap
protected

Definition at line 129 of file Terrain.h.

TerrainTileSet osgTerrain::Terrain::_terrainTileSet
protected

Definition at line 128 of file Terrain.h.

TerrainTileSet osgTerrain::Terrain::_updateTerrainTileSet
protected

Definition at line 130 of file Terrain.h.

float osgTerrain::Terrain::_verticalScale
protected

Definition at line 122 of file Terrain.h.


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