osgTerrain::TerrainTile Class Reference

Terrain provides a framework for loosely coupling height field data with height rendering algorithms. More...

Inheritance diagram for osgTerrain::TerrainTile:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 TerrainTile ()
 TerrainTile (const TerrainTile &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
 META_Node (osgTerrain, TerrainTile)
virtual void traverse (osg::NodeVisitor &nv)
 Traverse downwards : calls children's accept method with NodeVisitor.
void init ()
 Call init on any attached TerrainTechnique.
void setTerrain (Terrain *ts)
 Set the Terrain that this Terrain tile is a member of.
TerraingetTerrain ()
 Get the Terrain that this Terrain tile is a member of.
const TerraingetTerrain () const
 Get the const Terrain that this Terrain tile is a member of.
void setTileID (const TileID &tileID)
 Set the TileID (layer, x,y) of the TerrainTile.
const TileIDgetTileID () const
 Get the TileID (layer, x,y) of the TerrainTile.
void setTerrainTechnique (TerrainTechnique *TerrainTechnique)
 Set the TerrainTechnique.
TerrainTechniquegetTerrainTechnique ()
 Get the TerrainTechnique.
const TerrainTechniquegetTerrainTechnique () const
 Get the const TerrainTechnique.
void setLocator (Locator *locator)
 Set the coordinate frame locator of the terrain node.
LocatorgetLocator ()
 Get the coordinate frame locator of the terrain node.
const LocatorgetLocator () const
 Get the coordinate frame locator of the terrain node.
void setElevationLayer (Layer *layer)
 Set the layer to use to define the elevations of the terrain.
LayergetElevationLayer ()
 Get the layer to use to define the elevations of the terrain.
const LayergetElevationLayer () const
 Get the const layer to use to define the elevations of the terrain.
void setColorLayer (unsigned int i, Layer *layer)
 Set a color layer with specified layer number.
LayergetColorLayer (unsigned int i)
 Get color layer with specified layer number.
const LayergetColorLayer (unsigned int i) const
 Set const color layer with specified layer number.
unsigned int getNumColorLayers () const
 Get the number of colour layers.
void setRequiresNormals (bool flag)
 Set hint to whether the TerrainTechnique should create per vertex normals for lighting purposes.
bool getRequiresNormals () const
 Get whether the TerrainTechnique should create per vertex normals for lighting purposes.
void setTreatBoundariesToValidDataAsDefaultValue (bool flag)
 Set the hint to whether the TerrainTechnique should treat the invalid Layer entries that at are neigbours to valid entries with the default value.
bool getTreatBoundariesToValidDataAsDefaultValue () const
 Get whether the TeatBoundariesToValidDataAsDefaultValue hint.
void setDirty (bool dirty)
 Set the dirty flag on/off.
bool getDirty () const
 return true if the tile is dirty and needs to be updated,
virtual osg::BoundingSphere computeBound () const
 Compute the bounding volume of the terrain by computing the union of the bounding volumes of all layers.

Protected Types

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

Protected Member Functions

virtual ~TerrainTile ()

Protected Attributes

Terrain_terrain
bool _dirty
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

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.


Member Typedef Documentation

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


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 (  )  [protected, virtual]


Member Function Documentation

osgTerrain::TerrainTile::META_Node ( osgTerrain  ,
TerrainTile   
)

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

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

Reimplemented from osg::Group.

void osgTerrain::TerrainTile::init (  ) 

Call init on any attached TerrainTechnique.

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

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

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

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

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

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

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.

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

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

void osgTerrain::TerrainTile::setTerrainTechnique ( TerrainTechnique TerrainTechnique  ) 

Set the TerrainTechnique.

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

Get the TerrainTechnique.

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

Get the const TerrainTechnique.

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.

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

Get the coordinate frame locator of the terrain node.

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

Get the coordinate frame locator of the terrain node.

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

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

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

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

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

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

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

Set a color layer with specified layer number.

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

Get color layer with specified layer number.

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

Set const color layer with specified layer number.

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

Get the number of colour layers.

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

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

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

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

void osgTerrain::TerrainTile::setTreatBoundariesToValidDataAsDefaultValue ( bool  flag  )  [inline]

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

bool osgTerrain::TerrainTile::getTreatBoundariesToValidDataAsDefaultValue (  )  const [inline]

Get whether the TeatBoundariesToValidDataAsDefaultValue hint.

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

Set the dirty flag on/off.

bool osgTerrain::TerrainTile::getDirty (  )  const [inline]

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

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.


Friends And Related Function Documentation

friend class Terrain [friend]


Member Data Documentation


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

Generated at Thu Aug 14 04:13:09 2008 for the OpenSceneGraph by doxygen 1.5.6.