Added support for decoration of the osgTerrain::DataSet generated databases
with a CoordinateSystemNode which reflect the coordinate system of the database. Added support for reading and writing CoordianteSystemNode into the .osg and .ive formats.
This commit is contained in:
@@ -93,7 +93,7 @@ class SG_EXPORT CoordinateSystemNode : public Group
|
||||
|
||||
|
||||
/** Set the CoordinateSystem reference string, should be stored in OpenGIS Well Know Text form.*/
|
||||
void setCoordnateSystem(const std::string& WKT) { _WKT = WKT; }
|
||||
void setCoordinateSystem(const std::string& WKT) { _WKT = WKT; }
|
||||
|
||||
/** Get the CoordinateSystem reference string.*/
|
||||
const std::string& getCoordinateSystem() const { return _WKT; }
|
||||
|
||||
@@ -36,6 +36,7 @@ class Impostor;
|
||||
class ClearNode;
|
||||
class OccluderNode;
|
||||
class Sequence;
|
||||
class CoordinateSystemNode;
|
||||
|
||||
/** Visitor for type safe operations on osg::Node's.
|
||||
Based on GOF's Visitor pattern. The NodeVisitor
|
||||
@@ -221,6 +222,8 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
|
||||
|
||||
virtual void apply(Projection& node) { apply((Group&)node); }
|
||||
|
||||
virtual void apply(CoordinateSystemNode& node) { apply((Group&)node); }
|
||||
|
||||
virtual void apply(ClipNode& node) { apply((Group&)node); }
|
||||
virtual void apply(LightSource& node) { apply((Group&)node); }
|
||||
|
||||
|
||||
@@ -91,13 +91,16 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
||||
struct DestinationData : public osg::Referenced, SpatialProperties
|
||||
{
|
||||
|
||||
DestinationData():
|
||||
DestinationData(DataSet* dataSet):
|
||||
_dataSet(dataSet),
|
||||
_minDistance(0.0),
|
||||
_maxDistance(FLT_MAX) {}
|
||||
|
||||
|
||||
typedef std::vector< osg::ref_ptr<osg::Node> > ModelList;
|
||||
|
||||
DataSet* _dataSet;
|
||||
|
||||
float _minDistance;
|
||||
float _maxDistance;
|
||||
|
||||
@@ -903,6 +906,9 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
||||
void setUseLocalTileTransform(bool flag) { _useLocalTileTransform = flag; }
|
||||
bool getUseLocalTileTransform() const { return _useLocalTileTransform; }
|
||||
|
||||
void setDecorateGeneratedSceneGraphWithCoordinateSystemNode(bool flag) { _decorateWithCoordinateSystemNode = flag; }
|
||||
bool getDecorateGeneratedSceneGraphWithCoordinateSystemNode() const { return _decorateWithCoordinateSystemNode; }
|
||||
|
||||
|
||||
|
||||
CompositeDestination* createDestinationGraph(CompositeDestination* parent,
|
||||
@@ -937,6 +943,8 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
||||
void _equalizeRow(Row& row);
|
||||
void _writeRow(Row& row);
|
||||
|
||||
osg::CoordinateSystemNode* decorateWithCoordinateSystemNode(osg::Node* subgraph);
|
||||
|
||||
void init();
|
||||
|
||||
osg::ref_ptr<CompositeSource> _sourceGraph;
|
||||
@@ -949,8 +957,8 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
||||
float _radiusToMaxVisibleDistanceRatio;
|
||||
float _verticalScale;
|
||||
|
||||
osg::ref_ptr<osg::CoordinateSystemNode> _destinationCoordinateSystem;
|
||||
osg::ref_ptr<osg::CoordinateSystemNode> _intermediateCoordinateSystem;
|
||||
osg::ref_ptr<osg::CoordinateSystemNode> _destinationCoordinateSystem;
|
||||
osg::ref_ptr<osg::CoordinateSystemNode> _intermediateCoordinateSystem;
|
||||
|
||||
bool _convertFromGeographicToGeocentric;
|
||||
osg::ref_ptr<osg::EllipsoidModel> _ellipsoidModel;
|
||||
@@ -964,6 +972,8 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
||||
GeometryType _geometryType;
|
||||
TextureType _textureType;
|
||||
bool _useLocalTileTransform;
|
||||
|
||||
bool _decorateWithCoordinateSystemNode;
|
||||
|
||||
osg::ref_ptr<osg::Node> _rootNode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user