[Git][debian-gis-team/osgearth][upstream] New upstream version 2.9.0+dfsg

Sebastiaan Couwenberg gitlab at salsa.debian.org
Wed Feb 7 19:46:51 UTC 2018


Sebastiaan Couwenberg pushed to branch upstream at Debian GIS Project / osgearth


Commits:
46925672 by Bas Couwenberg at 2018-02-07T18:48:59+01:00
New upstream version 2.9.0+dfsg
- - - - -


27 changed files:

- CMakeModules/FindRocksDB.cmake
- src/applications/osgearth_manip/osgearth_manip.cpp
- src/osgEarth/Map.cpp
- src/osgEarth/MapNode.cpp
- src/osgEarth/Registry
- src/osgEarth/Registry.cpp
- src/osgEarth/ResourceReleaser
- src/osgEarth/ResourceReleaser.cpp
- src/osgEarth/SceneGraphCallback
- src/osgEarth/SceneGraphCallback.cpp
- src/osgEarth/SpatialReference
- src/osgEarth/SpatialReference.cpp
- src/osgEarth/StateSetCache.cpp
- src/osgEarth/Version
- src/osgEarth/VirtualProgram.cpp
- src/osgEarthDrivers/engine_rex/GeometryPool.cpp
- src/osgEarthDrivers/engine_rex/MaskGenerator.cpp
- src/osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp
- src/osgEarthDrivers/engine_rex/TileNode
- src/osgEarthDrivers/engine_rex/TileNode.cpp
- src/osgEarthDrivers/wms/ReaderWriterWMS.cpp
- src/osgEarthTriton/TritonContext
- src/osgEarthTriton/TritonContext.cpp
- src/osgEarthUtil/Controls.cpp
- src/osgEarthUtil/EarthManipulator.cpp
- src/osgEarthUtil/TMS.cpp
- tests/boston.earth


Changes:

=====================================
CMakeModules/FindRocksDB.cmake
=====================================
--- a/CMakeModules/FindRocksDB.cmake
+++ b/CMakeModules/FindRocksDB.cmake
@@ -5,11 +5,9 @@ SET(ROCKSDB_DIR "" CACHE PATH "Root directory of RocksDB distribution")
 FIND_PATH(ROCKSDB_INCLUDE_DIR rocksdb/db.h
   PATHS
   ${ROCKSDB_DIR}
-  NO_DEFAULT_PATH
-  PATH_SUFFIXES include
 )
 
-find_library(ROCKSDB_LIBRARY NAMES ROCKSDBLIB
+find_library(ROCKSDB_LIBRARY NAMES ROCKSDBLIB rocksdb
              PATHS
                ${ROCKSDB_DIR}
                ${ROCKSDB_DIR}/bin/Release
@@ -18,7 +16,7 @@ find_library(ROCKSDB_LIBRARY NAMES ROCKSDBLIB
 	    )
 
 
-find_library(ROCKSDB_LIBRARY_DEBUG NAMES ROCKSDBLIB
+find_library(ROCKSDB_LIBRARY_DEBUG NAMES ROCKSDBLIB rocksdb
              PATHS
                ${ROCKSDB_DIR}
                ${ROCKSDB_DIR}/bin/Debug


=====================================
src/applications/osgearth_manip/osgearth_manip.cpp
=====================================
--- a/src/applications/osgearth_manip/osgearth_manip.cpp
+++ b/src/applications/osgearth_manip/osgearth_manip.cpp
@@ -724,6 +724,11 @@ int main(int argc, char** argv)
         osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON,
         osgGA::GUIEventAdapter::MODKEY_SHIFT );
 
+    manip->getSettings()->bindMouseClick(
+        EarthManipulator::ACTION_GOTO,
+        osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON,
+        osgGA::GUIEventAdapter::MODKEY_SHIFT);
+
     manip->getSettings()->setArcViewpointTransitions( true );    
 
     manip->setTetherCallback( new TetherCB() );


=====================================
src/osgEarth/Map.cpp
=====================================
--- a/src/osgEarth/Map.cpp
+++ b/src/osgEarth/Map.cpp
@@ -640,8 +640,8 @@ Map::calculateProfile()
 
             if (!profile.valid())
             {
-                OE_WARN << LC << "No profile information available; defaulting to Mercator projection\n";
-                profile = Registry::instance()->getGlobalMercatorProfile();
+                OE_WARN << LC << "No profile information available; defaulting to Spherical Mercator projection\n";
+                profile = Registry::instance()->getSphericalMercatorProfile();
             }
         }
 


=====================================
src/osgEarth/MapNode.cpp
=====================================
--- a/src/osgEarth/MapNode.cpp
+++ b/src/osgEarth/MapNode.cpp
@@ -806,6 +806,8 @@ MapNode::traverse( osg::NodeVisitor& nv )
 void
 MapNode::resizeGLObjectBuffers(unsigned maxSize)
 {
+    osg::Group::resizeGLObjectBuffers(maxSize);
+
     LayerVector layers;
     getMap()->getLayers(layers);
     for (LayerVector::const_iterator i = layers.begin(); i != layers.end(); ++i)
@@ -819,6 +821,8 @@ MapNode::resizeGLObjectBuffers(unsigned maxSize)
 void
 MapNode::releaseGLObjects(osg::State* state) const
 {
+    osg::Group::releaseGLObjects(state);
+
     LayerVector layers;
     getMap()->getLayers(layers);
     for (LayerVector::const_iterator i = layers.begin(); i != layers.end(); ++i)


=====================================
src/osgEarth/Registry
=====================================
--- a/src/osgEarth/Registry
+++ b/src/osgEarth/Registry
@@ -29,6 +29,7 @@
 #include <OpenThreads/ReentrantMutex>
 #include <OpenThreads/ScopedLock>
 #include <osgEarth/ThreadingUtils>
+#include <osgEarth/SpatialReference>
 #include <osg/Referenced>
 #include <osg/OperationThread>
 #include <set>
@@ -68,22 +69,24 @@ namespace osgEarth
         static Registry* instance(bool erase = false);
 
 
-
         /** Gets a well-known named profile instance. */
         const Profile* getNamedProfile( const std::string& name ) const;
 
         /** Gets the global-geodetic builtin profile */
         const Profile* getGlobalGeodeticProfile() const;
 
-        /** Gets the global-meractor builtin profile (mercator/WGS84 datum) */
+        /** @deprecated Gets the global-meractor builtin profile (mercator/WGS84 datum) */
         const Profile* getGlobalMercatorProfile() const;
 
         /** Gets the spherical-mercator builtin profile (mercator/sphere) */
         const Profile* getSphericalMercatorProfile() const;
 
-        /** Gets the unified cube builtin profile */
+        /** @deprecated Gets the unified cube builtin profile */
         const Profile* getCubeProfile() const;
 
+        /** Gets a spatial reference object */
+        SpatialReference* getOrCreateSRS(const SpatialReference::Key& key);
+
         /** Access to the application-wide GDAL serialization mutex. GDAL is not thread-safe. */
         OpenThreads::ReentrantMutex& getGDALMutex();
 
@@ -372,6 +375,10 @@ namespace osgEarth
         unsigned _threadPoolSize;
 
         float _devicePixelRatio;
+        
+        typedef std::map<SpatialReference::Key, osg::ref_ptr<SpatialReference> > SRSCache;
+        mutable SRSCache _srsCache;
+        mutable Threading::Mutex _srsMutex;
     };
 }
 


=====================================
src/osgEarth/Registry.cpp
=====================================
--- a/src/osgEarth/Registry.cpp
+++ b/src/osgEarth/Registry.cpp
@@ -173,6 +173,15 @@ _devicePixelRatio(1.0f)
 
 Registry::~Registry()
 {
+    OE_DEBUG << LC << "Registry shutting down...\n";
+    _srsMutex.lock();
+    _srsCache.clear();
+    _srsMutex.unlock();
+    _global_geodetic_profile = 0L;
+    _spherical_mercator_profile = 0L;
+    _cube_profile = 0L;
+    OE_DEBUG << LC << "Registry shutdown complete.\n";
+
     // pop the custom error handler
     CPLPopErrorHandler();
 }
@@ -180,6 +189,10 @@ Registry::~Registry()
 Registry*
 Registry::instance(bool erase)
 {
+    // Make sure the gdal mutex is created before the Registry so it will still be around when the registry is destroyed statically.
+    // This is to prevent crash on exit where the gdal mutex is deleted before the registry is.
+    osgEarth::getGDALMutex();
+
     static osg::ref_ptr<Registry> s_registry = new Registry;
 
     if (erase)
@@ -194,7 +207,7 @@ Registry::instance(bool erase)
 void
 Registry::destruct()
 {
-    //nop
+    //NOP
 }
 
 OpenThreads::ReentrantMutex& osgEarth::getGDALMutex()
@@ -283,6 +296,30 @@ Registry::getNamedProfile( const std::string& name ) const
         return NULL;
 }
 
+SpatialReference*
+Registry::getOrCreateSRS(const SpatialReference::Key& key)
+{
+    Threading::ScopedMutexLock exclusiveLock(_srsMutex);
+    
+    SpatialReference* srs;
+
+    SRSCache::iterator i = _srsCache.find(key);
+    if (i != _srsCache.end())
+    {
+        srs = i->second.get();
+    }
+    else
+    {
+        srs = SpatialReference::create(key);
+        if (srs)
+        {
+            _srsCache[key] = srs;
+        }
+    }
+
+    return srs;
+}
+
 void
 Registry::setDefaultCachePolicy( const CachePolicy& value )
 {


=====================================
src/osgEarth/ResourceReleaser
=====================================
--- a/src/osgEarth/ResourceReleaser
+++ b/src/osgEarth/ResourceReleaser
@@ -49,6 +49,10 @@ namespace osgEarth
         /** Calls releaseGLObjects() on all objects in the list, then clears the list. */
         void drawImplementation(osg::RenderInfo& ri) const;
 
+    public: // osg::Node
+
+        void releaseGLObjects(osg::State* state) const;
+
     private:
         mutable ObjectList _toRelease;
         mutable Threading::Mutex _mutex;


=====================================
src/osgEarth/ResourceReleaser.cpp
=====================================
--- a/src/osgEarth/ResourceReleaser.cpp
+++ b/src/osgEarth/ResourceReleaser.cpp
@@ -19,6 +19,9 @@
 #include <osgEarth/ResourceReleaser>
 #include <osgEarth/Metrics>
 #include <osg/Version>
+#if OSG_VERSION_GREATER_OR_EQUAL(3,5,0)
+#include <osg/ContextData>
+#endif
 
 using namespace osgEarth;
 
@@ -38,24 +41,34 @@ ResourceReleaser::ResourceReleaser()
 }
 
 void
-ResourceReleaser::push(osg::Object* node)
+ResourceReleaser::push(osg::Object* object)
 {
     Threading::ScopedMutexLock lock(_mutex);
-    _toRelease.push_back(node);
+
+    _toRelease.push_back(object);
 }
 
 void
-ResourceReleaser::push(const ObjectList& nodes)
+ResourceReleaser::push(const ObjectList& objects)
 {
     Threading::ScopedMutexLock lock(_mutex);
-    _toRelease.reserve(_toRelease.size() + nodes.size());
-    for (unsigned i = 0; i<nodes.size(); ++i)
-        _toRelease.push_back(nodes[i].get());
+
+    _toRelease.reserve(_toRelease.size() + objects.size());
+    for (unsigned i = 0; i<objects.size(); ++i)
+        _toRelease.push_back(objects[i].get());
 }
 
 void
 ResourceReleaser::drawImplementation(osg::RenderInfo& ri) const
 {
+    releaseGLObjects(ri.getState());
+}
+
+void
+ResourceReleaser::releaseGLObjects(osg::State* state) const
+{
+    osg::Drawable::releaseGLObjects(state);
+
     if (!_toRelease.empty())
     {
         Threading::ScopedMutexLock lock(_mutex);
@@ -65,7 +78,7 @@ ResourceReleaser::drawImplementation(osg::RenderInfo& ri) const
             for (ObjectList::const_iterator i = _toRelease.begin(); i != _toRelease.end(); ++i)
             {
                 osg::Object* object = i->get();
-                object->releaseGLObjects(ri.getState());
+                object->releaseGLObjects(state);
             }
             OE_DEBUG << LC << "Released " << _toRelease.size() << " objects\n";
             _toRelease.clear();


=====================================
src/osgEarth/SceneGraphCallback
=====================================
--- a/src/osgEarth/SceneGraphCallback
+++ b/src/osgEarth/SceneGraphCallback
@@ -105,7 +105,7 @@ namespace osgEarth
         virtual bool addChild(osg::Node* child);
         virtual bool insertChild(unsigned index, osg::Node* child);
         virtual bool replaceChild(osg::Node* origChild, osg::Node* newChild);
-        virtual bool removeChild(osg::Node* child);
+        virtual void childRemoved(unsigned pos, unsigned num);
 
     private:
         osg::observer_ptr<SceneGraphCallbacks> _host;


=====================================
src/osgEarth/SceneGraphCallback.cpp
=====================================
--- a/src/osgEarth/SceneGraphCallback.cpp
+++ b/src/osgEarth/SceneGraphCallback.cpp
@@ -133,17 +133,15 @@ PagedLODWithSceneGraphCallbacks::replaceChild(osg::Node* oldChild, osg::Node* ne
     return ok;
 }
 
-bool
-PagedLODWithSceneGraphCallbacks::removeChild(osg::Node* child)
+void
+PagedLODWithSceneGraphCallbacks::childRemoved(unsigned pos, unsigned num)
 {
-    bool ok = false;
-    if (child)
+    osg::ref_ptr<SceneGraphCallbacks> host;
+    if (_host.lock(host))
     {
-        osg::ref_ptr<osg::Node> node = child;
-        ok = osg::PagedLOD::removeChild(child);
-        osg::ref_ptr<SceneGraphCallbacks> host;
-        if (_host.lock(host))
-            host->fireRemoveNode(node.get());
+        for (unsigned i = pos; i < pos + num; ++i)
+        {
+            host->fireRemoveNode(getChild(i));
+        }
     }
-    return ok;
 }


=====================================
src/osgEarth/SpatialReference
=====================================
--- a/src/osgEarth/SpatialReference
+++ b/src/osgEarth/SpatialReference
@@ -395,13 +395,12 @@ namespace osgEarth
             const SpatialReference*  outputSRS,
             bool                     pointsAreGeodetic) const;
 
-        typedef std::map<Key, osg::ref_ptr<SpatialReference> > SRSCache;
-        static SRSCache& getSRSCache();
-
 
     private:
 
-        static SpatialReference* create( const Key& key, bool useCache );
+        static SpatialReference* create(const Key& key);
+
+        static SpatialReference* create(const Key& key, bool useCache);
 
         static SpatialReference* createFromWKT(
             const std::string& wkt,
@@ -419,6 +418,8 @@ namespace osgEarth
 
 
         SpatialReference* fixWKT();
+
+        friend class Registry;
     };
 }
 


=====================================
src/osgEarth/SpatialReference.cpp
=====================================
--- a/src/osgEarth/SpatialReference.cpp
+++ b/src/osgEarth/SpatialReference.cpp
@@ -75,14 +75,6 @@ namespace
 
 //------------------------------------------------------------------------
 
-SpatialReference::SRSCache& SpatialReference::getSRSCache()
-{
-    //Make sure the registry is created before the cache
-    osgEarth::Registry::instance();
-    static SRSCache s_cache;
-    return s_cache;
-}
-
 SpatialReference*
 SpatialReference::createFromPROJ4( const std::string& proj4, const std::string& name )
 {
@@ -174,32 +166,15 @@ SpatialReference::createFromUserInput( const std::string& input, const std::stri
 SpatialReference*
 SpatialReference::create( const std::string& horiz, const std::string& vert )
 {
-    return create( Key(horiz, vert), true );
+    return Registry::instance()->getOrCreateSRS( Key(horiz, vert) );
 }
 
 SpatialReference*
-SpatialReference::create( const Key& key, bool useCache )
+SpatialReference::create(const Key& key)
 {
-    // serialized access to SRS creation.
-    static Threading::Mutex s_mutex;
-    Threading::ScopedMutexLock exclusive(s_mutex);
-
-    // first, check the SRS cache to see if it already exists:
-    if ( useCache )
-    {
-        SRSCache::iterator itr = getSRSCache().find(key);
-        if (itr != getSRSCache().end())
-        {
-            return itr->second.get();
-        }
-    }
-
     // now try to resolve the horizontal SRS:
     osg::ref_ptr<SpatialReference> srs;
 
-    //const std::string& horiz = key.first;
-    //const std::string& vert  = key.second;
-
     // shortcut for spherical-mercator:
     if (key.horizLower == "spherical-mercator" || 
         key.horizLower == "epsg:900913"        || 
@@ -295,13 +270,7 @@ SpatialReference::create( const Key& key, bool useCache )
 
     srs->_key = key;
 
-    if ( useCache )
-    {
-        // cache it - each unique SRS only exists once.
-        getSRSCache()[key] = srs;
-    }
-
-    return useCache ? srs.get() : srs.release();
+    return srs.release();
 }
 
 SpatialReference*
@@ -424,7 +393,14 @@ SpatialReference::~SpatialReference()
 {
     if ( _handle )
     {
-        GDAL_SCOPED_LOCK;
+        if (_initialized)
+        {
+            OE_DEBUG << LC << "Destroying " << getName() << std::endl;
+        }
+        else
+        {
+            OE_DEBUG << LC << "Destroying [unitialized SRS]" << std::endl;
+        }
 
         for (TransformHandleCache::iterator itr = _transformHandleCache.begin(); itr != _transformHandleCache.end(); ++itr)
         {


=====================================
src/osgEarth/StateSetCache.cpp
=====================================
--- a/src/osgEarth/StateSetCache.cpp
+++ b/src/osgEarth/StateSetCache.cpp
@@ -459,6 +459,7 @@ StateSetCache::clear()
 {
     Threading::ScopedMutexLock lock( _mutex );
 
+    prune();
     _stateAttributeCache.clear();
     _stateSetCache.clear();
 }


=====================================
src/osgEarth/Version
=====================================
--- a/src/osgEarth/Version
+++ b/src/osgEarth/Version
@@ -31,7 +31,7 @@ extern "C" {
 #define OSGEARTH_MINOR_VERSION    9
 #define OSGEARTH_PATCH_VERSION    0
 #define OSGEARTH_SOVERSION        0
-#define OSGEARTH_RC_VERSION       3
+#define OSGEARTH_RC_VERSION       0
 #define OSGEARTH_DEVEL_VERSION    0     // 0 = release; >0 = interim devel version
 
 /* Convenience macro that can be used to decide whether a feature is present or not i.e.


=====================================
src/osgEarth/VirtualProgram.cpp
=====================================
--- a/src/osgEarth/VirtualProgram.cpp
+++ b/src/osgEarth/VirtualProgram.cpp
@@ -910,6 +910,8 @@ VirtualProgram::compileGLObjects(osg::State& state) const
 void
 VirtualProgram::resizeGLObjectBuffers(unsigned maxSize)
 {
+    osg::StateAttribute::resizeGLObjectBuffers(maxSize);
+
     _programCacheMutex.lock();
 
     for (ProgramMap::iterator i = _programCache.begin(); i != _programCache.end(); ++i)
@@ -932,6 +934,8 @@ VirtualProgram::resizeGLObjectBuffers(unsigned maxSize)
 void
 VirtualProgram::releaseGLObjects(osg::State* state) const
 {
+    osg::StateAttribute::releaseGLObjects(state);
+
     _programCacheMutex.lock();
 
     for (ProgramMap::const_iterator i = _programCache.begin(); i != _programCache.end(); ++i)


=====================================
src/osgEarthDrivers/engine_rex/GeometryPool.cpp
=====================================
--- a/src/osgEarthDrivers/engine_rex/GeometryPool.cpp
+++ b/src/osgEarthDrivers/engine_rex/GeometryPool.cpp
@@ -717,7 +717,7 @@ void SharedGeometry::compileGLObjects(osg::RenderInfo& renderInfo) const
 
 void SharedGeometry::resizeGLObjectBuffers(unsigned int maxSize)
 {
-    Drawable::resizeGLObjectBuffers(maxSize);
+    osg::Drawable::resizeGLObjectBuffers(maxSize);
 
     osg::BufferObject* vbo = _vertexArray->getVertexBufferObject();
     if (vbo) vbo->resizeGLObjectBuffers(maxSize);
@@ -728,7 +728,7 @@ void SharedGeometry::resizeGLObjectBuffers(unsigned int maxSize)
 
 void SharedGeometry::releaseGLObjects(osg::State* state) const
 {
-    Drawable::releaseGLObjects(state);
+    osg::Drawable::releaseGLObjects(state);
 
     osg::BufferObject* vbo = _vertexArray->getVertexBufferObject();
     if (vbo) vbo->releaseGLObjects(state);


=====================================
src/osgEarthDrivers/engine_rex/MaskGenerator.cpp
=====================================
--- a/src/osgEarthDrivers/engine_rex/MaskGenerator.cpp
+++ b/src/osgEarthDrivers/engine_rex/MaskGenerator.cpp
@@ -547,8 +547,10 @@ MaskGenerator::createMaskPrimitives(const MapInfo& mapInfo,
                 }
             }
 
-            if (!isZSet[count])
-                OE_WARN << LC << "Z-value not set for mask constraint vertex" << std::endl;
+            if (isZSet[count] == 0)
+            {
+                OE_INFO << LC << "Z-value not set for mask constraint vertex" << std::endl;
+            }
 
             count++;
         }


=====================================
src/osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp
=====================================
--- a/src/osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp
+++ b/src/osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp
@@ -193,6 +193,8 @@ RexTerrainEngineNode::~RexTerrainEngineNode()
 void 
 RexTerrainEngineNode::resizeGLObjectBuffers(unsigned maxSize)
 {
+    TerrainEngineNode::resizeGLObjectBuffers(maxSize);
+
     getStateSet()->resizeGLObjectBuffers(maxSize);
 
     _terrain->getStateSet()->resizeGLObjectBuffers(maxSize);
@@ -213,6 +215,8 @@ RexTerrainEngineNode::resizeGLObjectBuffers(unsigned maxSize)
 void
 RexTerrainEngineNode::releaseGLObjects(osg::State* state) const
 {
+    TerrainEngineNode::releaseGLObjects(state);
+
     getStateSet()->releaseGLObjects(state);
 
     _terrain->getStateSet()->releaseGLObjects(state);


=====================================
src/osgEarthDrivers/engine_rex/TileNode
=====================================
--- a/src/osgEarthDrivers/engine_rex/TileNode
+++ b/src/osgEarthDrivers/engine_rex/TileNode
@@ -126,6 +126,8 @@ namespace osgEarth { namespace Drivers { namespace RexTerrainEngine
 
         void traverse(osg::NodeVisitor& nv);
 
+        void resizeGLObjectBuffers(unsigned maxSize);
+
         void releaseGLObjects(osg::State* state) const;
 
     protected:


=====================================
src/osgEarthDrivers/engine_rex/TileNode.cpp
=====================================
--- a/src/osgEarthDrivers/engine_rex/TileNode.cpp
+++ b/src/osgEarthDrivers/engine_rex/TileNode.cpp
@@ -304,7 +304,7 @@ TileNode::setDirty(bool value)
 void
 TileNode::releaseGLObjects(osg::State* state) const
 {
-    //OE_WARN << LC << "Tile " << _key.str() << " : Release GL objects\n";
+    osg::Group::releaseGLObjects(state);
 
     if ( _surface.valid() )
         _surface->releaseGLObjects(state);
@@ -313,8 +313,20 @@ TileNode::releaseGLObjects(osg::State* state) const
         _patch->releaseGLObjects(state);
 
     _renderModel.releaseGLObjects(state);
+}
 
-    osg::Group::releaseGLObjects(state);
+void
+TileNode::resizeGLObjectBuffers(unsigned maxSize)
+{
+    osg::Group::resizeGLObjectBuffers(maxSize);
+
+    if ( _surface.valid() )
+        _surface->resizeGLObjectBuffers(maxSize);
+
+    if ( _patch.valid() )
+        _patch->resizeGLObjectBuffers(maxSize);
+
+    _renderModel.resizeGLObjectBuffers(maxSize);
 }
 
 bool


=====================================
src/osgEarthDrivers/wms/ReaderWriterWMS.cpp
=====================================
--- a/src/osgEarthDrivers/wms/ReaderWriterWMS.cpp
+++ b/src/osgEarthDrivers/wms/ReaderWriterWMS.cpp
@@ -168,9 +168,9 @@ public:
         osg::ref_ptr<SpatialReference> wms_srs = SpatialReference::create( _srsToUse );
 
         // check for spherical mercator:
-        if ( wms_srs.valid() && wms_srs->isEquivalentTo( osgEarth::Registry::instance()->getGlobalMercatorProfile()->getSRS() ) )
+        if ( wms_srs.valid() && wms_srs->isEquivalentTo( osgEarth::Registry::instance()->getSphericalMercatorProfile()->getSRS() ) )
         {
-            result = osgEarth::Registry::instance()->getGlobalMercatorProfile();
+            result = osgEarth::Registry::instance()->getSphericalMercatorProfile();
         }
         else if (wms_srs.valid() && wms_srs->isEquivalentTo( osgEarth::Registry::instance()->getGlobalGeodeticProfile()->getSRS()))
         {


=====================================
src/osgEarthTriton/TritonContext
=====================================
--- a/src/osgEarthTriton/TritonContext
+++ b/src/osgEarthTriton/TritonContext
@@ -76,6 +76,8 @@ namespace osgEarth { namespace Triton
 
     public: // osg::Object
 
+        void resizeGLObjectBuffers(unsigned maxSize);
+
         /** If State is non-zero, this function releases any associated OpenGL objects for
            * the specified graphics context. Otherwise, releases OpenGL objects
            * for all graphics contexts. */


=====================================
src/osgEarthTriton/TritonContext.cpp
=====================================
--- a/src/osgEarthTriton/TritonContext.cpp
+++ b/src/osgEarthTriton/TritonContext.cpp
@@ -181,8 +181,16 @@ TritonContext::update(double simTime)
 }
 
 void
+TritonContext::resizeGLObjectBuffers(unsigned maxSize)
+{
+    osg::Object::resizeGLObjectBuffers(maxSize);
+}
+
+void
 TritonContext::releaseGLObjects(osg::State* state) const
 {
+    osg::Object::releaseGLObjects(state);
+
     OE_INFO << LC << "Triton shutting down - releasing GL resources\n";
     if (state)
     {


=====================================
src/osgEarthUtil/Controls.cpp
=====================================
--- a/src/osgEarthUtil/Controls.cpp
+++ b/src/osgEarthUtil/Controls.cpp
@@ -2741,14 +2741,12 @@ ControlCanvas::init()
     _controlNodeBin = new ControlNodeBin();
     this->addChild( _controlNodeBin->getControlGroup() );
    
-#if 0
-#if defined(OSG_GL_FIXED_FUNCTION_AVAILABLE)
+#if OSG_VERSION_LESS_THAN(3,5,8) && defined(OSG_GL_FIXED_FUNCTION_AVAILABLE)
     // don't use shaders unless we have to.
     this->getOrCreateStateSet()->setAttributeAndModes(
         new osg::Program(), 
         osg::StateAttribute::OFF|osg::StateAttribute::OVERRIDE);
 #endif
-#endif
 }
 
 ControlCanvas::~ControlCanvas()


=====================================
src/osgEarthUtil/EarthManipulator.cpp
=====================================
--- a/src/osgEarthUtil/EarthManipulator.cpp
+++ b/src/osgEarthUtil/EarthManipulator.cpp
@@ -1715,12 +1715,23 @@ EarthManipulator::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapt
 
     // if tethering is active, check to see whether the incoming event
     // will break the tether.
-    if ( isTethering() )
+    if (isTethering() && ea.getEventType() != ea.FRAME)
     {
         const ActionTypeVector& atv = _settings->getBreakTetherActions();
         if ( atv.size() > 0 )
         {
-            const Action& action = _settings->getAction( ea.getEventType(), ea.getButtonMask(), ea.getModKeyMask() );
+            EventType eventType = (EventType)ea.getEventType();
+            int buttonMask = ea.getButtonMask();
+            int modKeyMask = ea.getModKeyMask();
+
+            if (eventType == osgGA::GUIEventAdapter::RELEASE && isMouseClick(&ea))
+            {
+                eventType = EVENT_MOUSE_CLICK;
+                buttonMask = _mouse_down_event->getButtonMask();
+                modKeyMask = _mouse_down_event->getModKeyMask();
+            }
+
+            const Action& action = _settings->getAction( eventType, buttonMask, modKeyMask );
             if ( std::find(atv.begin(), atv.end(), action._type) != atv.end() )
             {
                 clearViewpoint();


=====================================
src/osgEarthUtil/TMS.cpp
=====================================
--- a/src/osgEarthUtil/TMS.cpp
+++ b/src/osgEarthUtil/TMS.cpp
@@ -650,7 +650,7 @@ tileMapToXmlDocument(const TileMap* tileMap)
     {
         profileString = "global-geodetic";
     }
-    else if (profile->isEquivalentTo(osgEarth::Registry::instance()->getGlobalMercatorProfile()))
+    else if (profile->isEquivalentTo(osgEarth::Registry::instance()->getSphericalMercatorProfile()))
     {
         profileString = "global-mercator";
     }


=====================================
tests/boston.earth
=====================================
--- a/tests/boston.earth
+++ b/tests/boston.earth
@@ -74,7 +74,7 @@ to extruded buildings.
     
     
     <feature_model name="Streets" feature_source="streets-data">        
-        <layout crop_features="true" tile_size_factor="7.5">
+        <layout crop_features="true" tile_size="1000">
             <level max_range="5000"/>
         </layout>        
         <styles>
@@ -92,7 +92,7 @@ to extruded buildings.
 	
 	
 	<feature_model name="streetlamps" feature_source="streets-data">
-        <layout tile_size_factor="5" crop_features="true">
+        <layout tile_size="1000" crop_features="true">
             <level max_range="1000" style="default"/>
         </layout>
         
@@ -120,7 +120,7 @@ to extruded buildings.
             <url>../data/boston-parks.shp</url>
         </features>        
         
-        <layout tile_size_factor="3">
+        <layout tile_size="1000">
             <level max_range="2000"/>
         </layout>
         



View it on GitLab: https://salsa.debian.org/debian-gis-team/osgearth/commit/469256725409788bfb8d4c776655c690418d4c1a

---
View it on GitLab: https://salsa.debian.org/debian-gis-team/osgearth/commit/469256725409788bfb8d4c776655c690418d4c1a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-grass-devel/attachments/20180207/b3b9223f/attachment-0001.html>


More information about the Pkg-grass-devel mailing list