osgTerrain::Terrain Class Reference

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

Inheritance diagram for osgTerrain::Terrain:

Inheritance graph
[legend]

List of all members.

Public Types

enum  Filter { NEAREST, LINEAR }

Public Member Functions

 Terrain ()
 Terrain (const Terrain &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
 META_Node (osgTerrain, Terrain)
virtual void traverse (osg::NodeVisitor &nv)
 Traverse downwards : calls children's accept method with NodeVisitor.
void init ()
 Call init on any attached TerrainTechnique.
void setTerrainTechnique (osgTerrain::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, osgTerrain::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.
void setColorTransferFunction (unsigned int i, osg::TransferFunction *tf)
 Set a color transfer function with specified layer number.
osg::TransferFunctiongetColorTransferFunction (unsigned int i)
 Get color transfer function with specified layer number.
const
osg::TransferFunction
getColorTransferFunction (unsigned int i) const
 Get const color transfer function with specified layer number.
void setColorFilter (unsigned int i, Filter filter)
 Set a color filter with specified layer number.
Filter getColorFilter (unsigned int i) const
 Set const color filter 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 setOperationQueue (osg::OperationQueue *operations)
 Set an OperationQueue to do an data initialization and update work.
osg::OperationQueuegetOperationQueue ()
 Get the OperationsQueue if one is attached, return NULL otherwise.
const
osg::OperationQueue
getOperationsQueue () const
 Get the const OperationsQueue if one is attached, return NULL otherwise.
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
< LayerData
Layers

Protected Member Functions

virtual ~Terrain ()

Protected Attributes

osg::ref_ptr
< TerrainTechnique
_terrainTechnique
osg::ref_ptr< Locator_locator
osg::ref_ptr< Layer_elevationLayer
Layers _colorLayers
bool _requiresNormals
bool _treatBoundariesToValidDataAsDefaultValue
osg::ref_ptr
< osg::OperationQueue
_operationQueue

Classes

struct  LayerData


Detailed Description

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

This allows TerrainTechnique's to be pluged in at runtime.


Member Typedef Documentation

typedef std::vector<LayerData> osgTerrain::Terrain::Layers [protected]


Member Enumeration Documentation

enum osgTerrain::Terrain::Filter

Enumerator:
NEAREST 
LINEAR 


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


Member Function Documentation

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

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

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

Reimplemented from osg::Group.

void osgTerrain::Terrain::init (  ) 

Call init on any attached TerrainTechnique.

void osgTerrain::Terrain::setTerrainTechnique ( osgTerrain::TerrainTechnique TerrainTechnique  ) 

Set the TerrainTechnique.

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

Get the TerrainTechnique.

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

Get the const TerrainTechnique.

void osgTerrain::Terrain::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::Terrain::getLocator (  )  [inline]

Get the coordinate frame locator of the terrain node.

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

Get the coordinate frame locator of the terrain node.

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

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

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

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

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

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

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

Set a color layer with specified layer number.

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

Get color layer with specified layer number.

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

Set const color layer with specified layer number.

void osgTerrain::Terrain::setColorTransferFunction ( unsigned int  i,
osg::TransferFunction tf 
)

Set a color transfer function with specified layer number.

osg::TransferFunction* osgTerrain::Terrain::getColorTransferFunction ( unsigned int  i  )  [inline]

Get color transfer function with specified layer number.

const osg::TransferFunction* osgTerrain::Terrain::getColorTransferFunction ( unsigned int  i  )  const [inline]

Get const color transfer function with specified layer number.

void osgTerrain::Terrain::setColorFilter ( unsigned int  i,
Filter  filter 
)

Set a color filter with specified layer number.

Filter osgTerrain::Terrain::getColorFilter ( unsigned int  i  )  const [inline]

Set const color filter with specified layer number.

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

Get the number of colour layers.

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

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

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

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

void osgTerrain::Terrain::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::Terrain::getTreatBoundariesToValidDataAsDefaultValue (  )  const [inline]

Get whether the TeatBoundariesToValidDataAsDefaultValue hint.

void osgTerrain::Terrain::setOperationQueue ( osg::OperationQueue operations  )  [inline]

Set an OperationQueue to do an data initialization and update work.

osg::OperationQueue* osgTerrain::Terrain::getOperationQueue (  )  [inline]

Get the OperationsQueue if one is attached, return NULL otherwise.

const osg::OperationQueue* osgTerrain::Terrain::getOperationsQueue (  )  const [inline]

Get the const OperationsQueue if one is attached, return NULL otherwise.

virtual osg::BoundingSphere osgTerrain::Terrain::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.


Member Data Documentation

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

osg::ref_ptr<Locator> osgTerrain::Terrain::_locator [protected]

osg::ref_ptr<Layer> osgTerrain::Terrain::_elevationLayer [protected]

Layers osgTerrain::Terrain::_colorLayers [protected]

bool osgTerrain::Terrain::_requiresNormals [protected]

bool osgTerrain::Terrain::_treatBoundariesToValidDataAsDefaultValue [protected]

osg::ref_ptr<osg::OperationQueue> osgTerrain::Terrain::_operationQueue [protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:48 2007 for the OpenSceneGraph by doxygen 1.5.3.