Skip to content
Permalink
Browse files

add 3d renderer icon to mesh properties panel too

  • Loading branch information
PeterPetrik committed Jan 28, 2019
1 parent 1f8708f commit e78e0be5702ae4f5ccc617a5f2afb34d9f560f1e
@@ -32,6 +32,9 @@
#include "qgsrenderermeshpropertieswidget.h"
#include "qgssettings.h"
#include "qgsproviderregistry.h"
#ifdef HAVE_3D
#include "qgsmeshlayer3drendererwidget.h"
#endif

#include <QFileDialog>
#include <QMessageBox>
@@ -62,6 +65,15 @@ QgsMeshLayerProperties::QgsMeshLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *

connect( mMeshLayer, &QgsMeshLayer::dataChanged, this, &QgsMeshLayerProperties::syncAndRepaint );

#ifdef HAVE_3D
mVector3DWidget = new QgsMeshLayer3DRendererWidget( mMeshLayer, QgisApp::instance()->mapCanvas(), mOptsPage_3DView );

mOptsPage_3DView->setLayout( new QVBoxLayout( mOptsPage_3DView ) );
mOptsPage_3DView->layout()->addWidget( mVector3DWidget );
#else
delete mOptsPage_3DView; // removes both the "3d view" list item and its page
#endif

// update based on lyr's current state
syncToLayer();

@@ -127,6 +139,13 @@ void QgsMeshLayerProperties::syncToLayer()
* Styling Tab
*/
mRendererMeshPropertiesWidget->syncToLayer();

/*
* 3D View Tab
*/
#ifdef HAVE_3D
mVector3DWidget->setLayer( mMeshLayer );
#endif
}

void QgsMeshLayerProperties::addDataset()
@@ -178,6 +197,13 @@ void QgsMeshLayerProperties::apply()
*/
mRendererMeshPropertiesWidget->apply();

/*
* 3D View Tab
*/
#ifdef HAVE_3D
mVector3DWidget->apply();
#endif

//make sure the layer is redrawn
mMeshLayer->triggerRepaint();

@@ -27,6 +27,7 @@ class QgsMapLayer;
class QgsMapCanvas;
class QgsMeshLayer;
class QgsRendererMeshPropertiesWidget;
class QgsMeshLayer3DRendererWidget;

/**
* Property sheet for a mesh map layer.
@@ -63,9 +64,12 @@ class APP_EXPORT QgsMeshLayerProperties : public QgsOptionsDialogBase, private U
//! Pointer to the mesh styling widget
QgsRendererMeshPropertiesWidget *mRendererMeshPropertiesWidget = nullptr;

//! \brief Pointer to the mesh layer that this property dilog changes the behavior of.
//! Pointer to the mesh layer that this property dilog changes the behavior of.
QgsMeshLayer *mMeshLayer = nullptr;

//! Pointer to mesh 3d styling widget
QgsMeshLayer3DRendererWidget *mVector3DWidget = nullptr;

friend class TestQgsMeshLayerPropertiesDialog;
};

@@ -122,6 +122,15 @@
<normaloff>:/images/themes/default/propertyicons/symbology.svg</normaloff>:/images/themes/default/propertyicons/symbology.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>3D View</string>
</property>
<property name="icon">
<iconset resource="../../../images/images.qrc">
<normaloff>:/images/themes/default/3d.svg</normaloff>:/images/themes/default/3d.svg</iconset>
</property>
</item>
</widget>
</item>
</layout>
@@ -161,7 +170,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="mOptsPage_Information">
<layout class="QVBoxLayout" name="verticalLayout_20">
@@ -197,8 +206,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>261</width>
<height>144</height>
<width>270</width>
<height>175</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
@@ -328,8 +337,8 @@ border-radius: 2px;</string>
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>634</width>
<height>711</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10"/>
@@ -338,6 +347,7 @@ border-radius: 2px;</string>
</item>
</layout>
</widget>
<widget class="QWidget" name="mOptsPage_3DView"/>
</widget>
</item>
</layout>
@@ -417,34 +427,6 @@ border-radius: 2px;</string>
</tabstops>
<resources>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
</resources>
<connections>
<connection>

0 comments on commit e78e0be

Please sign in to comment.
You can’t perform that action at this time.