diff --git a/cmake/FindOSGEARTH.cmake b/cmake/FindOSGEARTH.cmake index 1a92aac41b8..bb33be0fb68 100644 --- a/cmake/FindOSGEARTH.cmake +++ b/cmake/FindOSGEARTH.cmake @@ -92,6 +92,9 @@ FIND_OSGEARTH_LIBRARY( OSGEARTHFEATURES_LIBRARY_DEBUG osgEarthFeaturesd ) FIND_OSGEARTH_LIBRARY( OSGEARTHSYMBOLOGY_LIBRARY osgEarthSymbology ) FIND_OSGEARTH_LIBRARY( OSGEARTHSYMBOLOGY_LIBRARY_DEBUG osgEarthSymbologyd ) +FIND_OSGEARTH_LIBRARY( OSGEARTHQT_LIBRARY osgEarthQt ) +FIND_OSGEARTH_LIBRARY( OSGEARTHQT_LIBRARY_DEBUG osgEarthQtd ) + SET( OSGEARTH_FOUND "NO" ) IF( OSGEARTH_LIBRARY AND OSGEARTH_INCLUDE_DIR ) diff --git a/src/plugins/globe/CMakeLists.txt b/src/plugins/globe/CMakeLists.txt index 71c7d27c791..4aaff2d9c10 100644 --- a/src/plugins/globe/CMakeLists.txt +++ b/src/plugins/globe/CMakeLists.txt @@ -16,8 +16,6 @@ SET (globe_plugin_SRCS globe_plugin.cpp qgsosgearthtilesource.cpp globe_plugin_dialog.cpp - osgEarthQt/ViewerWidget.cpp - osgEarthUtil/Controls.cpp ) SET (globe_plugin_UIS @@ -64,6 +62,7 @@ TARGET_LINK_LIBRARIES(globeplugin ${OSGEARTH_LIBRARY} ${OSGEARTHFEATURES_LIBRARY} ${OSGEARTHUTIL_LIBRARY} + ${OSGEARTHQT_LIBRARY} ${OPENTHREADS_LIBRARY} ) diff --git a/src/plugins/globe/globe_plugin.cpp b/src/plugins/globe/globe_plugin.cpp index 75db0f0e08c..7cc492ed204 100644 --- a/src/plugins/globe/globe_plugin.cpp +++ b/src/plugins/globe/globe_plugin.cpp @@ -19,7 +19,8 @@ #include "globe_plugin.h" #include "globe_plugin_dialog.h" #include "qgsosgearthtilesource.h" -#include "osgEarthQt/ViewerWidget" +#include +//#include "osgEarthQt/ViewerWidget" #include @@ -58,8 +59,9 @@ #include using namespace osgEarth::Drivers; -using namespace osgEarth::Util::Controls21; using namespace osgEarth::Util; +using namespace osgEarth::Util::Controls; +//using namespace osgEarth::Util::Controls21; #define MOVE_OFFSET 0.05 @@ -322,12 +324,14 @@ void GlobePlugin::settings() void GlobePlugin::setupMap() { QSettings settings; + /* QString cacheDirectory = settings.value( "cache/directory", QgsApplication::qgisSettingsDirPath() + "cache" ).toString(); TMSCacheOptions cacheOptions; cacheOptions.setPath( cacheDirectory.toStdString() ); + */ MapOptions mapOptions; - mapOptions.cache() = cacheOptions; + //mapOptions.cache() = cacheOptions; osgEarth::Map *map = new osgEarth::Map( mapOptions ); //Default image layer @@ -745,7 +749,7 @@ void GlobePlugin::imageLayersChanged() ImageLayerOptions options( "QGIS" ); mQgisMapLayer = new ImageLayer( options, mTileSource ); map->addImageLayer( mQgisMapLayer ); - mQgisMapLayer->setCache( 0 ); //disable caching + //[layer->setCache is private in 1.3.0] mQgisMapLayer->setCache( 0 ); //disable caching } else { @@ -782,7 +786,7 @@ void GlobePlugin::elevationLayersChanged() for ( int i = 0; i < table->rowCount(); ++i ) { QString type = table->item( i, 0 )->text(); - bool cache = table->item( i, 1 )->checkState(); + //bool cache = table->item( i, 1 )->checkState(); QString uri = table->item( i, 2 )->text(); ElevationLayer* layer = 0; @@ -800,7 +804,7 @@ void GlobePlugin::elevationLayersChanged() } map->addElevationLayer( layer ); - if ( !cache || type == "Worldwind" ) layer->setCache( 0 ); //no tms cache for worldwind (use worldwind_cache) + //if ( !cache || type == "Worldwind" ) layer->setCache( 0 ); //no tms cache for worldwind (use worldwind_cache) } } else diff --git a/src/plugins/globe/globe_plugin.h b/src/plugins/globe/globe_plugin.h index 0ba1c13af4b..25778ec57d7 100644 --- a/src/plugins/globe/globe_plugin.h +++ b/src/plugins/globe/globe_plugin.h @@ -27,8 +27,8 @@ #include #include #include -//#include -#include "osgEarthUtil/Controls" +#include +//#include "osgEarthUtil/Controls" #include #include @@ -125,7 +125,7 @@ class GlobePlugin : public QObject, public QgisPlugin //! Tile source osgEarth::Drivers::QgsOsgEarthTileSource* mTileSource; //! Control Canvas - osgEarth::Util::Controls21::ControlCanvas* mControlCanvas; + osgEarth::Util::Controls::ControlCanvas* mControlCanvas; //! Elevation manager osgEarth::Util::ElevationManager* mElevationManager; //! Object placer @@ -192,7 +192,7 @@ namespace osgEarth { namespace Util { - namespace Controls21 + namespace Controls { class NavigationControlHandler : public ControlEventHandler { diff --git a/src/plugins/globe/globe_plugin_dialog.cpp b/src/plugins/globe/globe_plugin_dialog.cpp index f60437f674f..f80bed0d913 100644 --- a/src/plugins/globe/globe_plugin_dialog.cpp +++ b/src/plugins/globe/globe_plugin_dialog.cpp @@ -186,7 +186,7 @@ void QgsGlobePluginDialog::on_elevationAdd_clicked() QTableWidgetItem *type = new QTableWidgetItem( elevationCombo->currentText() ); QTableWidgetItem *uri = new QTableWidgetItem( elevationPath->text() ); QTableWidgetItem* cache = new QTableWidgetItem(); - cache->setCheckState(( elevationCombo->currentText() == "Worldwind" ) ? Qt::Checked : Qt::Unchecked ); //worldwind_cache will be active + //cache->setCheckState(( elevationCombo->currentText() == "Worldwind" ) ? Qt::Checked : Qt::Unchecked ); //worldwind_cache will be active elevationDatasourcesWidget->setRowCount( 1 + i ); elevationDatasourcesWidget->setItem( i, 0, type ); elevationDatasourcesWidget->setItem( i, 1, cache ); @@ -257,7 +257,7 @@ void QgsGlobePluginDialog::resetElevationDatasources() elevationDatasourcesWidget->setRowCount( 1 ); elevationDatasourcesWidget->setItem( 0, 0, new QTableWidgetItem("TMS") ); elevationDatasourcesWidget->setItem( 0, 1, new QTableWidgetItem() ); - elevationDatasourcesWidget->item( 0, 1 )->setCheckState( Qt::Unchecked ); + //elevationDatasourcesWidget->item( 0, 1 )->setCheckState( Qt::Unchecked ); elevationDatasourcesWidget->setItem( 0, 2, new QTableWidgetItem("http://readymap.org/readymap/tiles/1.0.0/9/") ); } @@ -281,7 +281,7 @@ void QgsGlobePluginDialog::readElevationDatasources() elevationDatasourcesWidget->setRowCount( 1 + i ); elevationDatasourcesWidget->setItem( i, 0, type ); QTableWidgetItem* chkBoxItem = new QTableWidgetItem(); - chkBoxItem->setCheckState( cache ? Qt::Checked : Qt::Unchecked ); + //chkBoxItem->setCheckState( cache ? Qt::Checked : Qt::Unchecked ); elevationDatasourcesWidget->setItem( i, 1, chkBoxItem ); elevationDatasourcesWidget->setItem( i, 2, uri ); }