OpenSceneGraph
3.0.1
|
Terrain provides a framework for loosely coupling height field data with height rendering algorithms. More...
Classes | |
struct | TileLoadedCallback |
Callback for post processing loaded TerrainTile, and for filling in missing elements such as external external imagery. More... | |
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 Member Functions | |
TerrainTile () | |
TerrainTile (const TerrainTile &, const osg::CopyOp ©op=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 (int dirtyMask, bool assumeMultiThreaded) |
Call init on any attached TerrainTechnique. | |
void | setTerrain (Terrain *ts) |
Set the Terrain that this Terrain tile is a member of. | |
Terrain * | getTerrain () |
Get the Terrain that this Terrain tile is a member of. | |
const Terrain * | getTerrain () 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 TileID & | getTileID () const |
Get the TileID (layer, x,y) of the TerrainTile. | |
void | setTerrainTechnique (TerrainTechnique *terrainTechnique) |
Set the TerrainTechnique. | |
TerrainTechnique * | getTerrainTechnique () |
Get the TerrainTechnique. | |
const TerrainTechnique * | getTerrainTechnique () const |
Get the const TerrainTechnique. | |
void | setLocator (Locator *locator) |
Set the coordinate frame locator of the terrain node. | |
Locator * | getLocator () |
Get the coordinate frame locator of the terrain node. | |
const Locator * | getLocator () const |
Get the const coordinate frame locator of the terrain node. | |
void | setElevationLayer (Layer *layer) |
Set the layer to use to define the elevations of the terrain. | |
Layer * | getElevationLayer () |
Get the layer to use to define the elevations of the terrain. | |
const Layer * | getElevationLayer () 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. | |
Layer * | getColorLayer (unsigned int i) |
Get color layer with specified layer number. | |
const Layer * | getColorLayer (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 | setBlendingPolicy (BlendingPolicy policy) |
Set the policy to use when deciding whether to enable/disable blending and use of transparent bin. | |
BlendingPolicy | getBlendingPolicy () const |
Get the policy to use when deciding whether to enable/disable blending and use of transparent bin. | |
void | setDirty (bool dirty) |
Set the dirty flag on/off. | |
int | getDirty () const |
return true if the any of the DirtyMask are set. | |
void | setDirtyMask (int dirtyMask) |
Set the dirty flag on/off. | |
int | getDirtyMask () 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. | |
virtual void | releaseGLObjects (osg::State *=0) const |
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. | |
Static Public Member Functions | |
static void | setTileLoadedCallback (TileLoadedCallback *lc) |
static osg::ref_ptr < TileLoadedCallback > & | getTileLoadedCallback () |
Protected Types | |
typedef std::vector < osg::ref_ptr< Layer > > | Layers |
Protected Member Functions | |
virtual | ~TerrainTile () |
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 |
Friends | |
class | Terrain |
Terrain provides a framework for loosely coupling height field data with height rendering algorithms.
This allows TerrainTechnique's to be plugged in at runtime.
typedef std::vector< osg::ref_ptr<Layer> > osgTerrain::TerrainTile::Layers [protected] |
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. |
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] |
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.
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.
int osgTerrain::TerrainTile::getDirty | ( | ) | const [inline] |
return true if the any of the DirtyMask are set.
int osgTerrain::TerrainTile::getDirtyMask | ( | ) | const [inline] |
return true if the tile is dirty and needs to be updated,
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.
Locator* osgTerrain::TerrainTile::getLocator | ( | ) | [inline] |
Get the coordinate frame locator of the terrain node.
const Locator* osgTerrain::TerrainTile::getLocator | ( | ) | const [inline] |
Get the const coordinate frame locator of the terrain node.
unsigned int osgTerrain::TerrainTile::getNumColorLayers | ( | ) | const [inline] |
Get the number of colour layers.
bool osgTerrain::TerrainTile::getRequiresNormals | ( | ) | const [inline] |
Get whether the TerrainTechnique should create per vertex normals for lighting purposes.
Terrain* osgTerrain::TerrainTile::getTerrain | ( | ) | [inline] |
const Terrain* osgTerrain::TerrainTile::getTerrain | ( | ) | const [inline] |
TerrainTechnique* osgTerrain::TerrainTile::getTerrainTechnique | ( | ) | [inline] |
Get the TerrainTechnique.
const TerrainTechnique* osgTerrain::TerrainTile::getTerrainTechnique | ( | ) | const [inline] |
Get the const TerrainTechnique.
const TileID& osgTerrain::TerrainTile::getTileID | ( | ) | const [inline] |
Get the TileID (layer, x,y) of the TerrainTile.
static osg::ref_ptr<TileLoadedCallback>& osgTerrain::TerrainTile::getTileLoadedCallback | ( | ) | [static] |
bool osgTerrain::TerrainTile::getTreatBoundariesToValidDataAsDefaultValue | ( | ) | const [inline] |
Get whether the TeatBoundariesToValidDataAsDefaultValue hint.
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.
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.
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.
void osgTerrain::TerrainTile::setRequiresNormals | ( | bool | flag | ) | [inline] |
Set hint to whether the TerrainTechnique should create per vertex normals for lighting purposes.
void osgTerrain::TerrainTile::setTerrain | ( | Terrain * | ts | ) |
void osgTerrain::TerrainTile::setTerrainTechnique | ( | TerrainTechnique * | terrainTechnique | ) |
Set the 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 neigbours to valid entries with the default value.
virtual void osgTerrain::TerrainTile::traverse | ( | osg::NodeVisitor & | ) | [virtual] |
Traverse downwards : calls children's accept method with NodeVisitor.
Reimplemented from osg::Group.
friend class Terrain [friend] |
Layers osgTerrain::TerrainTile::_colorLayers [protected] |
int osgTerrain::TerrainTile::_dirtyMask [protected] |
osg::ref_ptr<Layer> osgTerrain::TerrainTile::_elevationLayer [protected] |
bool osgTerrain::TerrainTile::_hasBeenTraversal [protected] |
osg::ref_ptr<Locator> osgTerrain::TerrainTile::_locator [protected] |
bool osgTerrain::TerrainTile::_requiresNormals [protected] |
Terrain* osgTerrain::TerrainTile::_terrain [protected] |
TileID osgTerrain::TerrainTile::_tileID [protected] |
bool osgTerrain::TerrainTile::_treatBoundariesToValidDataAsDefaultValue [protected] |
![]() | Generated at Mon Oct 3 2011 12:39:49 for the OpenSceneGraph by doxygen 1.7.5. |