Skip to content
Permalink
Browse files
add ifdefs
  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Jan 12, 2022
1 parent a6cf3c9 commit b8573c79ed3cd3e4103d87984e57c4f7cf57b958
Showing with 31 additions and 4 deletions.
  1. +21 −3 src/app/qgisapp.cpp
  2. +6 −1 src/app/qgisapp.h
  3. +4 −0 src/app/qgsappwindowmanager.cpp
@@ -9912,8 +9912,10 @@ Qgs3DMapCanvasDockWidget *QgisApp::open3DMapView( const QString &mapName )
m3DMapViewsWidgets[ mapName ] = mapCanvasDock3D;

return mapCanvasDock3D;
#endif
#else
Q_UNUSED( mapName );
return nullptr;
#endif
}

Qgs3DMapCanvasDockWidget *QgisApp::duplicate3DMapView( const QString &existingViewName, const QString &newViewName )
@@ -9951,8 +9953,11 @@ Qgs3DMapCanvasDockWidget *QgisApp::duplicate3DMapView( const QString &existingVi
read3DMapViewSettings( mapCanvasDock3D, elem3DMap );

return mapCanvasDock3D;
#endif
#else
Q_UNUSED( existingViewName )
Q_UNUSED( newViewName )
return nullptr;
#endif
}

void QgisApp::setupDuplicateFeaturesAction()
@@ -10043,6 +10048,7 @@ void QgisApp::populateLayoutsMenu( QMenu *menu )

void QgisApp::populate3DMapviewsMenu( QMenu *menu )
{
#ifdef HAVE_3D
menu->clear();
QList<QAction *> acts;
const QList< QString > views = m3DMapViewsDom.keys();
@@ -10063,6 +10069,9 @@ void QgisApp::populate3DMapviewsMenu( QMenu *menu )
}
acts << mActionNew3DMapCanvas << mActionManage3DMapViews;
menu->addActions( acts );
#else
Q_UNUSED( menu );
#endif
}

void QgisApp::views3DMenuAboutToShow()
@@ -13595,11 +13604,13 @@ void QgisApp::showLayoutManager()

void QgisApp::show3DMapViewsManager()
{
#ifdef HAVE_3D
QWidget *dialog = static_cast< QgsAppWindowManager * >( QgsGui::windowManager() )->openApplicationDialog( QgsAppWindowManager::Dialog3DMapViewsManager );
Qgs3DViewsManager *manager = dynamic_cast< Qgs3DViewsManager *>( dialog );
manager->set3DMapViewsDom( m3DMapViewsDom );
manager->set3DMapViewsWidgets( m3DMapViewsWidgets );
manager->show();
#endif
}

QgsVectorLayer *QgisApp::addVectorLayer( const QString &vectorLayerPath, const QString &name, const QString &providerKey )
@@ -13850,7 +13861,7 @@ void QgisApp::init3D()
Qgs3D::initialize();
Qgs3DAppUtils::initialize();
#else
mActionNew3DMapCanvas->setVisible( false );
m3DMapViewsMenu->menuAction()->setVisible( false );
#endif
}

@@ -13971,6 +13982,7 @@ Qgs3DMapCanvasDockWidget *QgisApp::createNew3DMapCanvasDock( const QString &name

Qgs3DMapCanvasDockWidget *QgisApp::createInitialized3DMapCanvasDock( const QString &name )
{
#ifdef HAVE_3D
Qgs3DMapCanvasDockWidget *dock = createNew3DMapCanvasDock( name );
if ( dock )
{
@@ -14038,6 +14050,10 @@ Qgs3DMapCanvasDockWidget *QgisApp::createInitialized3DMapCanvasDock( const QStri
m3DMapViewsWidgets[ name ] = dock;
}
return dock;
#else
Q_UNUSED( name )
return nullptr;
#endif
}

void QgisApp::setExtent( const QgsRectangle &rect )
@@ -16627,6 +16643,7 @@ void QgisApp::projectChanged( const QDomDocument &doc )
QgsPythonRunner::run( expr );
}

#ifdef HAVE_3D
void QgisApp::write3DMapViewSettings( Qgs3DMapCanvasDockWidget *w, QDomDocument &doc, QDomElement &elem3DMap )
{
QgsReadWriteContext readWriteContext;
@@ -16686,6 +16703,7 @@ void QgisApp::read3DMapViewSettings( Qgs3DMapCanvasDockWidget *w, QDomElement &e
w->animationWidget()->setAnimation( animationSettings );
}
}
#endif

void QgisApp::writeProject( QDomDocument &doc )
{
@@ -1415,7 +1415,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

/**
* Decrease raster gamma
* Valid for nom3DMapViewsDomn wms raster layers only.
* Valid for non wms raster layers only.
* \since QGIS 3.16
*/
void decreaseGamma();
@@ -2330,9 +2330,12 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
*/
void writeDockWidgetSettings( QDockWidget *dockWidget, QDomElement &elem );

#ifdef HAVE_3D

void read3DMapViewSettings( Qgs3DMapCanvasDockWidget *widget, QDomElement &elem3DMap );

void write3DMapViewSettings( Qgs3DMapCanvasDockWidget *widget, QDomDocument &doc, QDomElement &elem3DMap );
#endif

QgsCoordinateReferenceSystem defaultCrsForNewLayers() const;

@@ -2735,8 +2738,10 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QMap< QString, QToolButton * > mAnnotationItemGroupToolButtons;
QAction *mAnnotationsItemInsertBefore = nullptr; // Used to insert annotation items at the appropriate location in the annotations toolbar

#ifdef HAVE_3D
QMap<QString, QDomElement> m3DMapViewsDom;
QMap<QString, Qgs3DMapCanvasDockWidget *> m3DMapViewsWidgets;
#endif

class QgsCanvasRefreshBlocker
{
@@ -20,7 +20,9 @@
#include "qgslayoutmanagerdialog.h"
#include "qgsrasterlayer.h"

#ifdef HAVE_3D
#include "qgs3dviewsmanager.h"
#endif

QgsAppWindowManager::~QgsAppWindowManager()
{
@@ -66,6 +68,7 @@ QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::Applic
}
case Dialog3DMapViewsManager:
{
#ifdef HAVE_3D
if ( !m3DMapViewsManagerDialog )
{
m3DMapViewsManagerDialog = new Qgs3DViewsManager( QgisApp::instance(), Qt::Window );
@@ -74,6 +77,7 @@ QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::Applic
m3DMapViewsManagerDialog->show();
m3DMapViewsManagerDialog->reload();
return m3DMapViewsManagerDialog;
#endif
}
}
return nullptr;

0 comments on commit b8573c7

Please sign in to comment.