Terrain
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGTerrain
#define OSGTerrain 1
#include <osg/CoordinateSystemNode>
#include <OpenThreads/ReentrantMutex>
#include <osgTerrain/TerrainTile>
#include <osgTerrain/GeometryPool>
namespace osgTerrain {
class OSGTERRAIN_EXPORT Terrain : public osg::CoordinateSystemNode
{
public:
Terrain();
Terrain(const Terrain&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Node(osgTerrain, Terrain);
virtual void traverse(osg::NodeVisitor& nv);
virtual osgTerrain::Terrain* asTerrain() { return this; }
virtual const osgTerrain::Terrain* asTerrain() const { return this; }
void setSampleRatio(float ratio);
float getSampleRatio() const { return _sampleRatio; }
void setVerticalScale(float scale);
float getVerticalScale() const { return _verticalScale; }
void setBlendingPolicy(TerrainTile::BlendingPolicy policy);
TerrainTile::BlendingPolicy getBlendingPolicy() const { return _blendingPolicy; }
void setEqualizeBoundaries(bool equalizeBoundaries);
bool getEqualizeBoundaries() const { return _equalizeBoundaries; }
void setGeometryPool(GeometryPool* gp) { _geometryPool = gp; }
GeometryPool* getGeometryPool() { return _geometryPool.get(); }
const GeometryPool* getGeometryPool() const { return _geometryPool.get(); }
TerrainTile* getTile(const TileID& tileID);
const TerrainTile* getTile(const TileID& tileID) const;
void setTerrainTechniquePrototype(TerrainTechnique* technique) { _terrainTechnique = technique; }
TerrainTechnique* getTerrainTechniquePrototype() { return _terrainTechnique.get(); }
const TerrainTechnique* getTerrainTechniquePrototype() const { return _terrainTechnique.get(); }
void updateTerrainTileOnNextFrame(TerrainTile* terrainTile);
protected:
virtual ~Terrain();
friend class TerrainTile;
void dirtyRegisteredTiles(int dirtyMask = TerrainTile::ALL_DIRTY);
void registerTerrainTile(TerrainTile* tile);
void unregisterTerrainTile(TerrainTile* tile);
typedef std::map< TileID, TerrainTile* > TerrainTileMap;
typedef std::set< TerrainTile* > TerrainTileSet;
float _sampleRatio;
float _verticalScale;
TerrainTile::BlendingPolicy _blendingPolicy;
bool _equalizeBoundaries;
osg::ref_ptr<GeometryPool> _geometryPool;
mutable OpenThreads::ReentrantMutex _mutex;
TerrainTileSet _terrainTileSet;
TerrainTileMap _terrainTileMap;
TerrainTileSet _updateTerrainTileSet;
osg::ref_ptr<TerrainTechnique> _terrainTechnique;
};
}
#endif
CoordinateSystemNode
GeometryPool
ReentrantMutex
TerrainTile
OpenThreads::ReentrantMutex
Definition ReentrantMutex:24
osgTerrain::GeometryPool
Definition GeometryPool:104
osgTerrain::TerrainTechnique
Definition TerrainTechnique:53
osgTerrain::TerrainTile::ALL_DIRTY
@ ALL_DIRTY
Definition TerrainTile:197
osgTerrain::TerrainTile::BlendingPolicy
BlendingPolicy
Definition TerrainTile:168
osgTerrain::Terrain
Definition Terrain:28
osgTerrain::Terrain::getTerrainTechniquePrototype
TerrainTechnique * getTerrainTechniquePrototype()
Definition Terrain:99
osgTerrain::Terrain::_sampleRatio
float _sampleRatio
Definition Terrain:121
osgTerrain::Terrain::getSampleRatio
float getSampleRatio() const
Definition Terrain:49
osgTerrain::Terrain::setSampleRatio
void setSampleRatio(float ratio)
osgTerrain::Terrain::_mutex
OpenThreads::ReentrantMutex _mutex
Definition Terrain:127
osgTerrain::Terrain::Terrain
Terrain()
osgTerrain::Terrain::_equalizeBoundaries
bool _equalizeBoundaries
Definition Terrain:124
osgTerrain::Terrain::registerTerrainTile
void registerTerrainTile(TerrainTile *tile)
osgTerrain::Terrain::_terrainTechnique
osg::ref_ptr< TerrainTechnique > _terrainTechnique
Definition Terrain:132
osgTerrain::Terrain::getEqualizeBoundaries
bool getEqualizeBoundaries() const
Definition Terrain:75
osgTerrain::Terrain::_verticalScale
float _verticalScale
Definition Terrain:122
osgTerrain::Terrain::_blendingPolicy
TerrainTile::BlendingPolicy _blendingPolicy
Definition Terrain:123
osgTerrain::Terrain::getTile
TerrainTile * getTile(const TileID &tileID)
osgTerrain::Terrain::TerrainTile
friend class TerrainTile
Definition Terrain:111
osgTerrain::Terrain::getGeometryPool
GeometryPool * getGeometryPool()
Definition Terrain:82
osgTerrain::Terrain::setGeometryPool
void setGeometryPool(GeometryPool *gp)
Definition Terrain:79
osgTerrain::Terrain::setBlendingPolicy
void setBlendingPolicy(TerrainTile::BlendingPolicy policy)
osgTerrain::Terrain::_updateTerrainTileSet
TerrainTileSet _updateTerrainTileSet
Definition Terrain:130
osgTerrain::Terrain::dirtyRegisteredTiles
void dirtyRegisteredTiles(int dirtyMask=TerrainTile::ALL_DIRTY)
osgTerrain::Terrain::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgTerrain::Terrain::~Terrain
virtual ~Terrain()
osgTerrain::Terrain::getTerrainTechniquePrototype
const TerrainTechnique * getTerrainTechniquePrototype() const
Definition Terrain:102
osgTerrain::Terrain::updateTerrainTileOnNextFrame
void updateTerrainTileOnNextFrame(TerrainTile *terrainTile)
osgTerrain::Terrain::TerrainTileSet
std::set< TerrainTile * > TerrainTileSet
Definition Terrain:119
osgTerrain::Terrain::META_Node
META_Node(osgTerrain, Terrain)
osgTerrain::Terrain::unregisterTerrainTile
void unregisterTerrainTile(TerrainTile *tile)
osgTerrain::Terrain::getGeometryPool
const GeometryPool * getGeometryPool() const
Definition Terrain:85
osgTerrain::Terrain::setVerticalScale
void setVerticalScale(float scale)
osgTerrain::Terrain::_terrainTileSet
TerrainTileSet _terrainTileSet
Definition Terrain:128
osgTerrain::Terrain::TerrainTileMap
std::map< TileID, TerrainTile * > TerrainTileMap
Definition Terrain:118
osgTerrain::Terrain::setTerrainTechniquePrototype
void setTerrainTechniquePrototype(TerrainTechnique *technique)
Definition Terrain:96
osgTerrain::Terrain::getVerticalScale
float getVerticalScale() const
Definition Terrain:56
osgTerrain::Terrain::Terrain
Terrain(const Terrain &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::Terrain::asTerrain
virtual const osgTerrain::Terrain * asTerrain() const
Definition Terrain:41
osgTerrain::Terrain::asTerrain
virtual osgTerrain::Terrain * asTerrain()
Definition Terrain:40
osgTerrain::Terrain::getBlendingPolicy
TerrainTile::BlendingPolicy getBlendingPolicy() const
Definition Terrain:66
osgTerrain::Terrain::setEqualizeBoundaries
void setEqualizeBoundaries(bool equalizeBoundaries)
osgTerrain::Terrain::getTile
const TerrainTile * getTile(const TileID &tileID) const
osgTerrain::Terrain::_geometryPool
osg::ref_ptr< GeometryPool > _geometryPool
Definition Terrain:125
osgTerrain::Terrain::_terrainTileMap
TerrainTileMap _terrainTileMap
Definition Terrain:129
osgTerrain::TileID
Definition TerrainTile:31
osg::CoordinateSystemNode
Definition CoordinateSystemNode:96
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeVisitor
Definition NodeVisitor:82
osg::ref_ptr
Definition ref_ptr:32
osgTerrain
Definition Node:29
OSGTERRAIN_EXPORT
#define OSGTERRAIN_EXPORT
Definition osgTerrain/Export:39