TerrainTechnique
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_TERRAINTECHNIQUE
#define OSGTERRAIN_TERRAINTECHNIQUE 1
#include <osg/Object>
#include <osgUtil/UpdateVisitor>
#include <osgUtil/CullVisitor>
#include <osgTerrain/Export>
namespace osgTerrain {
class TerrainTile;
class OSGTERRAIN_EXPORT TerrainNeighbours
{
public:
TerrainNeighbours();
~TerrainNeighbours();
void clear();
void addNeighbour(TerrainTile* tile);
void removeNeighbour(TerrainTile* tile);
bool containsNeighbour(TerrainTile* tile) const;
protected:
TerrainNeighbours(const TerrainNeighbours& /*tn*/) {}
TerrainNeighbours& operator = (const TerrainNeighbours& /*rhs*/) { return *this; }
typedef std::set<TerrainTile*> Neighbours;
mutable OpenThreads::Mutex _neighboursMutex;
Neighbours _neighbours;
};
class OSGTERRAIN_EXPORT TerrainTechnique : public osg::Object, public osg::Observer
{
public:
TerrainTechnique();
TerrainTechnique(const TerrainTechnique&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgTerrain, TerrainTechnique);
virtual void setTerrainTile(TerrainTile* tile);
TerrainTile* getTerrainTile() { return _terrainTile; }
const TerrainTile* getTerrainTile() const { return _terrainTile; }
virtual void init(int dirtyMask, bool assumeMultiThreaded);
virtual void update(osgUtil::UpdateVisitor* nv);
virtual void cull(osgUtil::CullVisitor* nv);
virtual void cleanSceneGraph();
virtual void traverse(osg::NodeVisitor& nv);
virtual void releaseGLObjects(osg::State* = 0) const {}
virtual void addNeighbour(TerrainTile* tile) { _neighbours.addNeighbour(tile); }
virtual void removeNeighbour(TerrainTile* tile) { _neighbours.removeNeighbour(tile); }
virtual bool containsNeighbour(TerrainTile* tile) { return _neighbours.containsNeighbour(tile); }
protected:
virtual ~TerrainTechnique();
friend class osgTerrain::TerrainTile;
TerrainTile* _terrainTile;
TerrainNeighbours _neighbours;
};
}
#endif
CullVisitor
Object
UpdateVisitor
OpenThreads::Mutex
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
osgTerrain::TerrainNeighbours
Definition TerrainTechnique:29
osgTerrain::TerrainNeighbours::TerrainNeighbours
TerrainNeighbours()
osgTerrain::TerrainNeighbours::Neighbours
std::set< TerrainTile * > Neighbours
Definition TerrainTechnique:45
osgTerrain::TerrainNeighbours::_neighboursMutex
OpenThreads::Mutex _neighboursMutex
Definition TerrainTechnique:47
osgTerrain::TerrainNeighbours::clear
void clear()
osgTerrain::TerrainNeighbours::~TerrainNeighbours
~TerrainNeighbours()
osgTerrain::TerrainNeighbours::TerrainNeighbours
TerrainNeighbours(const TerrainNeighbours &)
Definition TerrainTechnique:42
osgTerrain::TerrainNeighbours::addNeighbour
void addNeighbour(TerrainTile *tile)
osgTerrain::TerrainNeighbours::removeNeighbour
void removeNeighbour(TerrainTile *tile)
osgTerrain::TerrainNeighbours::containsNeighbour
bool containsNeighbour(TerrainTile *tile) const
osgTerrain::TerrainNeighbours::_neighbours
Neighbours _neighbours
Definition TerrainTechnique:48
osgTerrain::TerrainTechnique::cull
virtual void cull(osgUtil::CullVisitor *nv)
osgTerrain::TerrainTechnique::getTerrainTile
TerrainTile * getTerrainTile()
Definition TerrainTechnique:64
osgTerrain::TerrainTechnique::TerrainTechnique
TerrainTechnique(const TerrainTechnique &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgTerrain::TerrainTechnique::TerrainTechnique
TerrainTechnique()
osgTerrain::TerrainTechnique::cleanSceneGraph
virtual void cleanSceneGraph()
osgTerrain::TerrainTechnique::~TerrainTechnique
virtual ~TerrainTechnique()
osgTerrain::TerrainTechnique::update
virtual void update(osgUtil::UpdateVisitor *nv)
osgTerrain::TerrainTechnique::getTerrainTile
const TerrainTile * getTerrainTile() const
Definition TerrainTechnique:65
osgTerrain::TerrainTechnique::_neighbours
TerrainNeighbours _neighbours
Definition TerrainTechnique:98
osgTerrain::TerrainTechnique::META_Object
META_Object(osgTerrain, TerrainTechnique)
osgTerrain::TerrainTechnique::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgTerrain::TerrainTechnique::setTerrainTile
virtual void setTerrainTile(TerrainTile *tile)
osgTerrain::TerrainTechnique::releaseGLObjects
virtual void releaseGLObjects(osg::State *=0) const
Definition TerrainTechnique:82
osgTerrain::TerrainTechnique::containsNeighbour
virtual bool containsNeighbour(TerrainTile *tile)
Definition TerrainTechnique:86
osgTerrain::TerrainTechnique::init
virtual void init(int dirtyMask, bool assumeMultiThreaded)
osgTerrain::TerrainTechnique::removeNeighbour
virtual void removeNeighbour(TerrainTile *tile)
Definition TerrainTechnique:85
osgTerrain::TerrainTechnique::TerrainTile
friend class osgTerrain::TerrainTile
Definition TerrainTechnique:93
osgTerrain::TerrainTechnique::_terrainTile
TerrainTile * _terrainTile
Definition TerrainTechnique:95
osgTerrain::TerrainTechnique::addNeighbour
virtual void addNeighbour(TerrainTile *tile)
Definition TerrainTechnique:84
osgTerrain::TerrainTile
Definition TerrainTile:68
osgUtil::CullVisitor
Definition CullVisitor:49
osgUtil::UpdateVisitor
Definition UpdateVisitor:38
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeVisitor
Definition NodeVisitor:82
osg::Object
Definition Object:61
osg::Observer
Definition Observer:25
osg::State
Definition State:80
osgTerrain
Definition Node:29
Export
OSGTERRAIN_EXPORT
#define OSGTERRAIN_EXPORT
Definition osgTerrain/Export:39