Moved osgTerrain::GeometryPool from osgTerrain::DisplacementMappingTechnique to the osgTerrain::Terrain

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14703 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-02-18 10:52:52 +00:00
parent e5d51da1b3
commit 5c023d1f76
4 changed files with 29 additions and 18 deletions

View File

@@ -18,7 +18,6 @@
#include <osg/MatrixTransform>
#include <osg/Program>
#include <osgTerrain/GeometryTechnique>
#include <osgTerrain/GeometryPool>
namespace osgTerrain
{
@@ -44,8 +43,6 @@ class OSGTERRAIN_EXPORT DisplacementMappingTechnique : public osgTerrain::Terrai
virtual ~DisplacementMappingTechnique();
osg::ref_ptr<GeometryPool> _geometryPool;
mutable OpenThreads::Mutex _traversalMutex;
mutable OpenThreads::Mutex _transformMutex;

View File

@@ -18,6 +18,7 @@
#include <OpenThreads/ReentrantMutex>
#include <osgTerrain/TerrainTile>
#include <osgTerrain/GeometryPool>
namespace osgTerrain {
@@ -54,14 +55,6 @@ class OSGTERRAIN_EXPORT Terrain : public osg::CoordinateSystemNode
/** Get the vertical scale hint.*/
float getVerticalScale() const { return _verticalScale; }
/** If set to true the boundaries between adjacent tiles should be equalized.
* Note, it is only possible to equalizae boundaries when the TerrainTile's contain properly assigned TileID's,
* databases built with VirtualPlanetBuilder-0.9.11 and older do not set the TileID, so databases must be
* built with later versions of VirtualPlanetBuilder to take advantage of boundary equalization. */
void setEqualizeBoundaries(bool equalizeBoundaries);
/** If true the boundaries between adjacent tiles will be equalized. */
bool getEqualizeBoundaries() const { return _equalizeBoundaries; }
/** Set the default policy to use when deciding whether to enable/disable blending and use of transparent bin.
* Note, the Terrain::BlendingPolicy value only sets the value for the TerrainTiles it encloses for the
@@ -72,6 +65,26 @@ class OSGTERRAIN_EXPORT Terrain : public osg::CoordinateSystemNode
/** Get the default policy to use when deciding whether to enable/disable blending and use of transparent bin.*/
TerrainTile::BlendingPolicy getBlendingPolicy() const { return _blendingPolicy; }
/** If set to true the boundaries between adjacent tiles should be equalized.
* Note, it is only possible to equalizae boundaries when the TerrainTile's contain properly assigned TileID's,
* databases built with VirtualPlanetBuilder-0.9.11 and older do not set the TileID, so databases must be
* built with later versions of VirtualPlanetBuilder to take advantage of boundary equalization. */
void setEqualizeBoundaries(bool equalizeBoundaries);
/** If true the boundaries between adjacent tiles will be equalized. */
bool getEqualizeBoundaries() const { return _equalizeBoundaries; }
/** Set a custom GeometryPool to be used by TerrainTechniques that share geometry.*/
void setGeometryPool(GeometryPool* gp) { _geometryPool = gp; }
/** Get the GeometryPool.*/
GeometryPool* getGeometryPool() { return _geometryPool.get(); }
/** Get the const GeometryPool.*/
const GeometryPool* getGeometryPool() const { return _geometryPool.get(); }
/** Get the TerrainTile for a given TileID.*/
TerrainTile* getTile(const TileID& tileID);
@@ -109,6 +122,7 @@ class OSGTERRAIN_EXPORT Terrain : public osg::CoordinateSystemNode
float _verticalScale;
TerrainTile::BlendingPolicy _blendingPolicy;
bool _equalizeBoundaries;
osg::ref_ptr<GeometryPool> _geometryPool;
mutable OpenThreads::ReentrantMutex _mutex;
TerrainTileSet _terrainTileSet;