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

#include <TerrainTile.h>

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

Classes

struct  TileLoadedCallback
 

Public Types

enum  BlendingPolicy { INHERIT, DO_NOT_SET_BLENDING, ENABLE_BLENDING, ENABLE_BLENDING_WHEN_ALPHA_PRESENT }
 
enum  DirtyMask {
  NOT_DIRTY = 0, IMAGERY_DIRTY = 1<<0, ELEVATION_DIRTY = 1<<1, LEFT_EDGE_DIRTY = 1<<2,
  RIGHT_EDGE_DIRTY = 1<<3, TOP_EDGE_DIRTY = 1<<4, TOP_LEFT_CORNER_DIRTY = 1<<5, TOP_RIGHT_CORNER_DIRTY = 1<<6,
  BOTTOM_EDGE_DIRTY = 1<<7, BOTTOM_LEFT_CORNER_DIRTY = 1<<8, BOTTOM_RIGHT_CORNER_DIRTY = 1<<9, EDGES_DIRTY,
  ALL_DIRTY = IMAGERY_DIRTY | ELEVATION_DIRTY | EDGES_DIRTY
}
 
- 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 }
 

Public Member Functions

 TerrainTile ()
 
 TerrainTile (const TerrainTile &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 
 META_Node (osgTerrain, TerrainTile)
 
virtual void traverse (osg::NodeVisitor &nv)
 
void init (int dirtyMask, bool assumeMultiThreaded)
 
void setTerrain (Terrain *ts)
 
TerraingetTerrain ()
 
const TerraingetTerrain () const
 
void setTileID (const TileID &tileID)
 
const TileIDgetTileID () const
 
void setTerrainTechnique (TerrainTechnique *terrainTechnique)
 
TerrainTechniquegetTerrainTechnique ()
 
const TerrainTechniquegetTerrainTechnique () const
 
void setLocator (Locator *locator)
 
LocatorgetLocator ()
 
const LocatorgetLocator () const
 
void setElevationLayer (Layer *layer)
 
LayergetElevationLayer ()
 
const LayergetElevationLayer () const
 
void setColorLayer (unsigned int i, Layer *layer)
 
LayergetColorLayer (unsigned int i)
 
const LayergetColorLayer (unsigned int i) const
 
unsigned int getNumColorLayers () const
 
void setRequiresNormals (bool flag)
 
bool getRequiresNormals () const
 
void setTreatBoundariesToValidDataAsDefaultValue (bool flag)
 
bool getTreatBoundariesToValidDataAsDefaultValue () const
 
void setBlendingPolicy (BlendingPolicy policy)
 
BlendingPolicy getBlendingPolicy () const
 
void setDirty (bool dirty)
 
int getDirty () const
 
void setDirtyMask (int dirtyMask)
 
int getDirtyMask () const
 
virtual osg::BoundingSphere computeBound () const
 
virtual void releaseGLObjects (osg::State *=0) 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)
 
- 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 osgTerrain::TerrainasTerrain ()
 
virtual const osgTerrain::TerrainasTerrain () 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
 

Static Public Member Functions

static void setTileLoadedCallback (TileLoadedCallback *lc)
 
static osg::ref_ptr
< TileLoadedCallback > & 
getTileLoadedCallback ()
 
- 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 ()
 

Protected Types

typedef std::vector
< osg::ref_ptr< Layer > > 
Layers
 

Protected Member Functions

virtual ~TerrainTile ()
 
- 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

Terrain_terrain
 
int _dirtyMask
 
bool _hasBeenTraversal
 
TileID _tileID
 
osg::ref_ptr< TerrainTechnique_terrainTechnique
 
osg::ref_ptr< Locator_locator
 
osg::ref_ptr< Layer_elevationLayer
 
Layers _colorLayers
 
bool _requiresNormals
 
bool _treatBoundariesToValidDataAsDefaultValue
 
BlendingPolicy _blendingPolicy
 
- 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 Terrain
 

Detailed Description

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

Definition at line 67 of file TerrainTile.h.

Member Typedef Documentation

typedef std::vector< osg::ref_ptr<Layer> > osgTerrain::TerrainTile::Layers
protected

Definition at line 229 of file TerrainTile.h.

Member Enumeration Documentation

Enumerator
INHERIT 
DO_NOT_SET_BLENDING 

Default - check for the any BlendingPolicy set on the enclosing osgTerrain::Terrain node, and if it's also INHERIT then assume ENABLE_BLENDING_WHEN_ALPHA_PRESENT.

ENABLE_BLENDING 
ENABLE_BLENDING_WHEN_ALPHA_PRESENT 

check colour layers for alpha value and if present enable blending.

Definition at line 159 of file TerrainTile.h.

Enumerator
NOT_DIRTY 
IMAGERY_DIRTY 
ELEVATION_DIRTY 
LEFT_EDGE_DIRTY 
RIGHT_EDGE_DIRTY 
TOP_EDGE_DIRTY 
TOP_LEFT_CORNER_DIRTY 
TOP_RIGHT_CORNER_DIRTY 
BOTTOM_EDGE_DIRTY 
BOTTOM_LEFT_CORNER_DIRTY 
BOTTOM_RIGHT_CORNER_DIRTY 
EDGES_DIRTY 
ALL_DIRTY 

Definition at line 174 of file TerrainTile.h.

Constructor & Destructor Documentation

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

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osgTerrain::TerrainTile::~TerrainTile ( )
protectedvirtual

Member Function Documentation

virtual osg::BoundingSphere osgTerrain::TerrainTile::computeBound ( ) const
virtual

Compute the bounding volume of the terrain by computing the union of the bounding volumes of all layers.

Reimplemented from osg::Group.

BlendingPolicy osgTerrain::TerrainTile::getBlendingPolicy ( ) const
inline

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

Definition at line 171 of file TerrainTile.h.

Layer* osgTerrain::TerrainTile::getColorLayer ( unsigned int  i)
inline

Get color layer with specified layer number.

Definition at line 136 of file TerrainTile.h.

const Layer* osgTerrain::TerrainTile::getColorLayer ( unsigned int  i) const
inline

Set const color layer with specified layer number.

Definition at line 139 of file TerrainTile.h.

int osgTerrain::TerrainTile::getDirty ( ) const
inline

return true if the any of the DirtyMask are set.

Definition at line 196 of file TerrainTile.h.

int osgTerrain::TerrainTile::getDirtyMask ( ) const
inline

return true if the tile is dirty and needs to be updated,

Definition at line 203 of file TerrainTile.h.

Layer* osgTerrain::TerrainTile::getElevationLayer ( )
inline

Get the layer to use to define the elevations of the terrain.

Definition at line 126 of file TerrainTile.h.

const Layer* osgTerrain::TerrainTile::getElevationLayer ( ) const
inline

Get the const layer to use to define the elevations of the terrain.

Definition at line 129 of file TerrainTile.h.

Locator* osgTerrain::TerrainTile::getLocator ( )
inline

Get the coordinate frame locator of the terrain node.

Definition at line 117 of file TerrainTile.h.

const Locator* osgTerrain::TerrainTile::getLocator ( ) const
inline

Get the const coordinate frame locator of the terrain node.

Definition at line 120 of file TerrainTile.h.

unsigned int osgTerrain::TerrainTile::getNumColorLayers ( ) const
inline

Get the number of colour layers.

Definition at line 142 of file TerrainTile.h.

bool osgTerrain::TerrainTile::getRequiresNormals ( ) const
inline

Get whether the TerrainTechnique should create per vertex normals for lighting purposes.

Definition at line 149 of file TerrainTile.h.

Terrain* osgTerrain::TerrainTile::getTerrain ( )
inline

Get the Terrain that this Terrain tile is a member of.

Definition at line 87 of file TerrainTile.h.

const Terrain* osgTerrain::TerrainTile::getTerrain ( ) const
inline

Get the const Terrain that this Terrain tile is a member of.

Definition at line 90 of file TerrainTile.h.

TerrainTechnique* osgTerrain::TerrainTile::getTerrainTechnique ( )
inline

Get the TerrainTechnique

Definition at line 106 of file TerrainTile.h.

const TerrainTechnique* osgTerrain::TerrainTile::getTerrainTechnique ( ) const
inline

Get the const TerrainTechnique

Definition at line 109 of file TerrainTile.h.

const TileID& osgTerrain::TerrainTile::getTileID ( ) const
inline

Get the TileID (layer, x,y) of the TerrainTile.

Definition at line 99 of file TerrainTile.h.

static osg::ref_ptr<TileLoadedCallback>& osgTerrain::TerrainTile::getTileLoadedCallback ( )
static
bool osgTerrain::TerrainTile::getTreatBoundariesToValidDataAsDefaultValue ( ) const
inline

Get whether the TeatBoundariesToValidDataAsDefaultValue hint.

Definition at line 156 of file TerrainTile.h.

void osgTerrain::TerrainTile::init ( int  dirtyMask,
bool  assumeMultiThreaded 
)

Call init on any attached TerrainTechnique.

osgTerrain::TerrainTile::META_Node ( osgTerrain  ,
TerrainTile   
)
virtual void osgTerrain::TerrainTile::releaseGLObjects ( osg::State = 0) const
virtual

If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.

Reimplemented from osg::Group.

void osgTerrain::TerrainTile::setBlendingPolicy ( BlendingPolicy  policy)
inline

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

Definition at line 168 of file TerrainTile.h.

void osgTerrain::TerrainTile::setColorLayer ( unsigned int  i,
Layer layer 
)

Set a color layer with specified layer number.

void osgTerrain::TerrainTile::setDirty ( bool  dirty)
inline

Set the dirty flag on/off.

Definition at line 193 of file TerrainTile.h.

void osgTerrain::TerrainTile::setDirtyMask ( int  dirtyMask)

Set the dirty flag on/off.

void osgTerrain::TerrainTile::setElevationLayer ( Layer layer)

Set the layer to use to define the elevations of the terrain.

void osgTerrain::TerrainTile::setLocator ( Locator locator)
inline

Set the coordinate frame locator of the terrain node. The locator takes non-dimensional s,t coordinates into the X,Y,Z world coords and back.

Definition at line 114 of file TerrainTile.h.

void osgTerrain::TerrainTile::setRequiresNormals ( bool  flag)
inline

Set hint to whether the TerrainTechnique should create per vertex normals for lighting purposes.

Definition at line 146 of file TerrainTile.h.

void osgTerrain::TerrainTile::setTerrain ( Terrain ts)

Set the Terrain that this Terrain tile is a member of.

void osgTerrain::TerrainTile::setTerrainTechnique ( TerrainTechnique terrainTechnique)
void osgTerrain::TerrainTile::setTileID ( const TileID tileID)

Set the TileID (layer, x,y) of the TerrainTile. The TileID is used so it can be located by its neighbours via the enclosing Terrain node that manages a map of TileID to TerraiTiles.

static void osgTerrain::TerrainTile::setTileLoadedCallback ( TileLoadedCallback lc)
static
void osgTerrain::TerrainTile::setTreatBoundariesToValidDataAsDefaultValue ( bool  flag)
inline

Set the hint to whether the TerrainTechnique should treat the invalid Layer entries that at are neighbours to valid entries with the default value.

Definition at line 153 of file TerrainTile.h.

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

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

Reimplemented from osg::Group.

Friends And Related Function Documentation

friend class Terrain
friend

Definition at line 231 of file TerrainTile.h.

Member Data Documentation

BlendingPolicy osgTerrain::TerrainTile::_blendingPolicy
protected

Definition at line 249 of file TerrainTile.h.

Layers osgTerrain::TerrainTile::_colorLayers
protected

Definition at line 245 of file TerrainTile.h.

int osgTerrain::TerrainTile::_dirtyMask
protected

Definition at line 235 of file TerrainTile.h.

osg::ref_ptr<Layer> osgTerrain::TerrainTile::_elevationLayer
protected

Definition at line 243 of file TerrainTile.h.

bool osgTerrain::TerrainTile::_hasBeenTraversal
protected

Definition at line 236 of file TerrainTile.h.

osg::ref_ptr<Locator> osgTerrain::TerrainTile::_locator
protected

Definition at line 241 of file TerrainTile.h.

bool osgTerrain::TerrainTile::_requiresNormals
protected

Definition at line 247 of file TerrainTile.h.

Terrain* osgTerrain::TerrainTile::_terrain
protected

Definition at line 233 of file TerrainTile.h.

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

Definition at line 240 of file TerrainTile.h.

TileID osgTerrain::TerrainTile::_tileID
protected

Definition at line 238 of file TerrainTile.h.

bool osgTerrain::TerrainTile::_treatBoundariesToValidDataAsDefaultValue
protected

Definition at line 248 of file TerrainTile.h.


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