This is an automated email from the git hooks/post-receive script. sebastic pushed a commit to branch master in repository osgearth.
commit 469256725409788bfb8d4c776655c690418d4c1a Author: Bas Couwenberg <sebas...@xs4all.nl> Date: Wed Feb 7 18:48:59 2018 +0100 New upstream version 2.9.0+dfsg --- CMakeModules/FindRocksDB.cmake | 6 +-- src/applications/osgearth_manip/osgearth_manip.cpp | 5 +++ src/osgEarth/Map.cpp | 4 +- src/osgEarth/MapNode.cpp | 4 ++ src/osgEarth/Registry | 13 ++++-- src/osgEarth/Registry.cpp | 39 +++++++++++++++++- src/osgEarth/ResourceReleaser | 4 ++ src/osgEarth/ResourceReleaser.cpp | 27 +++++++++---- src/osgEarth/SceneGraphCallback | 2 +- src/osgEarth/SceneGraphCallback.cpp | 18 ++++----- src/osgEarth/SpatialReference | 9 +++-- src/osgEarth/SpatialReference.cpp | 46 ++++++---------------- src/osgEarth/StateSetCache.cpp | 1 + src/osgEarth/Version | 2 +- src/osgEarth/VirtualProgram.cpp | 4 ++ src/osgEarthDrivers/engine_rex/GeometryPool.cpp | 4 +- src/osgEarthDrivers/engine_rex/MaskGenerator.cpp | 6 ++- .../engine_rex/RexTerrainEngineNode.cpp | 4 ++ src/osgEarthDrivers/engine_rex/TileNode | 2 + src/osgEarthDrivers/engine_rex/TileNode.cpp | 16 +++++++- src/osgEarthDrivers/wms/ReaderWriterWMS.cpp | 4 +- src/osgEarthTriton/TritonContext | 2 + src/osgEarthTriton/TritonContext.cpp | 8 ++++ src/osgEarthUtil/Controls.cpp | 4 +- src/osgEarthUtil/EarthManipulator.cpp | 15 ++++++- src/osgEarthUtil/TMS.cpp | 2 +- tests/boston.earth | 6 +-- 27 files changed, 172 insertions(+), 85 deletions(-) diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake index 17fb335..868228b 100644 --- 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 diff --git a/src/applications/osgearth_manip/osgearth_manip.cpp b/src/applications/osgearth_manip/osgearth_manip.cpp index 9e89536..e0c874b 100644 --- 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() ); diff --git a/src/osgEarth/Map.cpp b/src/osgEarth/Map.cpp index 03a55bc..c99c452 100644 --- 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(); } } diff --git a/src/osgEarth/MapNode.cpp b/src/osgEarth/MapNode.cpp index 15c36c9..3ab915e 100644 --- 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) diff --git a/src/osgEarth/Registry b/src/osgEarth/Registry index 1dd7ec0..597280f 100644 --- 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; }; } diff --git a/src/osgEarth/Registry.cpp b/src/osgEarth/Registry.cpp index 97e8c8d..38c249a 100644 --- 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 ) { diff --git a/src/osgEarth/ResourceReleaser b/src/osgEarth/ResourceReleaser index b781761..88f2f31 100644 --- 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; diff --git a/src/osgEarth/ResourceReleaser.cpp b/src/osgEarth/ResourceReleaser.cpp index 7b7b7bc..fd304e5 100644 --- 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(); diff --git a/src/osgEarth/SceneGraphCallback b/src/osgEarth/SceneGraphCallback index 51fe3ee..6ea0cac 100644 --- 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; diff --git a/src/osgEarth/SceneGraphCallback.cpp b/src/osgEarth/SceneGraphCallback.cpp index 3884f65..094aa82 100644 --- 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; } diff --git a/src/osgEarth/SpatialReference b/src/osgEarth/SpatialReference index 081c155..0f5c044 100644 --- 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; }; } diff --git a/src/osgEarth/SpatialReference.cpp b/src/osgEarth/SpatialReference.cpp index cf7c719..5260fd8 100644 --- 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) { diff --git a/src/osgEarth/StateSetCache.cpp b/src/osgEarth/StateSetCache.cpp index 26c1d7f..699f990 100644 --- 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(); } diff --git a/src/osgEarth/Version b/src/osgEarth/Version index 31d9cca..04baf8e 100644 --- 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. diff --git a/src/osgEarth/VirtualProgram.cpp b/src/osgEarth/VirtualProgram.cpp index 873f79a..81840cf 100644 --- 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) diff --git a/src/osgEarthDrivers/engine_rex/GeometryPool.cpp b/src/osgEarthDrivers/engine_rex/GeometryPool.cpp index 0e1be98..cf3ee3f 100644 --- 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); diff --git a/src/osgEarthDrivers/engine_rex/MaskGenerator.cpp b/src/osgEarthDrivers/engine_rex/MaskGenerator.cpp index 2c17f74..58dad4d 100644 --- 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++; } diff --git a/src/osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp b/src/osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp index 05b1b5f..7671f97 100644 --- 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); diff --git a/src/osgEarthDrivers/engine_rex/TileNode b/src/osgEarthDrivers/engine_rex/TileNode index 7816c77..85be470 100644 --- 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: diff --git a/src/osgEarthDrivers/engine_rex/TileNode.cpp b/src/osgEarthDrivers/engine_rex/TileNode.cpp index 58585b0..43c7c38 100644 --- 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 diff --git a/src/osgEarthDrivers/wms/ReaderWriterWMS.cpp b/src/osgEarthDrivers/wms/ReaderWriterWMS.cpp index 93e0ebb..d625080 100644 --- 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())) { diff --git a/src/osgEarthTriton/TritonContext b/src/osgEarthTriton/TritonContext index 4b3c534..40f5e23 100644 --- 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. */ diff --git a/src/osgEarthTriton/TritonContext.cpp b/src/osgEarthTriton/TritonContext.cpp index 9a171cb..3bceec9 100644 --- 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) { diff --git a/src/osgEarthUtil/Controls.cpp b/src/osgEarthUtil/Controls.cpp index 39966e4..e6a372e 100755 --- 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() diff --git a/src/osgEarthUtil/EarthManipulator.cpp b/src/osgEarthUtil/EarthManipulator.cpp index 49a2215..3c79d52 100644 --- 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(); diff --git a/src/osgEarthUtil/TMS.cpp b/src/osgEarthUtil/TMS.cpp index 355e675..02a9d51 100644 --- 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"; } diff --git a/tests/boston.earth b/tests/boston.earth index 6ae90bd..9fe0da0 100644 --- 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> -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osgearth.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel