OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TerrainTechnique.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGTERRAIN_TERRAINTECHNIQUE
15 #define OSGTERRAIN_TERRAINTECHNIQUE 1
16 
17 #include <osg/Object>
18 
19 #include <osgUtil/UpdateVisitor>
20 #include <osgUtil/CullVisitor>
21 
22 #include <osgTerrain/Export>
23 
24 namespace osgTerrain {
25 
26 class TerrainTile;
27 
29 {
30  public:
31 
34 
35  void clear();
36  void addNeighbour(TerrainTile* tile);
37  void removeNeighbour(TerrainTile* tile);
38  bool containsNeighbour(TerrainTile* tile) const;
39 
40  protected:
41 
43  TerrainNeighbours& operator = (const TerrainNeighbours& /*rhs*/) { return *this; }
44 
45  typedef std::set<TerrainTile*> Neighbours;
46 
48  Neighbours _neighbours;
49 };
50 
51 
53 {
54  public:
55 
57 
60 
62 
63  TerrainTile* getTerrainTile() { return _terrainTile; }
64  const TerrainTile* getTerrainTile() const { return _terrainTile; }
65 
66  virtual void init(int dirtyMask, bool assumeMultiThreaded);
67 
68  virtual void update(osgUtil::UpdateVisitor* nv);
69 
70  virtual void cull(osgUtil::CullVisitor* nv);
71 
73  virtual void cleanSceneGraph();
74 
76  virtual void traverse(osg::NodeVisitor& nv);
77 
81  virtual void releaseGLObjects(osg::State* = 0) const {}
82 
83  void addNeighbour(TerrainTile* tile) { _neighbours.addNeighbour(tile); }
84  void removeNeighbour(TerrainTile* tile) { _neighbours.removeNeighbour(tile); }
85  bool containsNeighbour(TerrainTile* tile) { return _neighbours.containsNeighbour(tile); }
86 
87  protected:
88 
89  virtual ~TerrainTechnique();
90 
91  void setTerrainTile(TerrainTile* tile);
92  void setDirty(bool dirty);
93 
95 
97 
98 
100 
101 };
102 
103 }
104 
105 #endif
This class provides an object-oriented thread mutex interface.
Definition: Mutex.h:31
std::set< TerrainTile * > Neighbours
virtual void releaseGLObjects(osg::State *=0) const
#define OSGTERRAIN_EXPORT
Definition: Export.h:39
OpenThreads::Mutex _neighboursMutex
#define META_Object(library, name)
Definition: Object.h:42
const TerrainTile * getTerrainTile() const
TerrainNeighbours(const TerrainNeighbours &)
void addNeighbour(TerrainTile *tile)
void removeNeighbour(TerrainTile *tile)
bool containsNeighbour(TerrainTile *tile)