Skip to content
Permalink
Browse files
[3d] Have 3D View tab in vector layer properties (fixes #17595)
(only when 3D support is enabled)
  • Loading branch information
wonder-sk committed Dec 6, 2017
1 parent 8ecae4f commit 7064704
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
@@ -79,6 +79,11 @@
#include "qgsrendererpropertiesdialog.h"
#include "qgsstyle.h"

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


QgsVectorLayerProperties::QgsVectorLayerProperties(
QgsVectorLayer *lyr,
QWidget *parent,
@@ -213,6 +218,15 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mAttributesFormFrame->layout()->setMargin( 0 );
mAttributesFormFrame->layout()->addWidget( mAttributesFormPropertiesDialog );

#ifdef HAVE_3D
mVector3DWidget = new QgsVectorLayer3DRendererWidget( mLayer, 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

syncToLayer();

if ( mLayer->dataProvider() )//enable spatial index button group if supported by provider
@@ -527,6 +541,10 @@ void QgsVectorLayerProperties::syncToLayer()
// set initial state for variable editor
updateVariableEditor();

#ifdef HAVE_3D
mVector3DWidget->setLayer( mLayer );
#endif

} // syncToLayer()

void QgsVectorLayerProperties::apply()
@@ -712,6 +730,10 @@ void QgsVectorLayerProperties::apply()
QMessageBox::warning( nullptr, tr( "Dependency cycle" ), tr( "This configuration introduces a cycle in data dependencies and will be ignored" ) );
}

#ifdef HAVE_3D
mVector3DWidget->apply();
#endif

// update symbology
emit refreshLegend( mLayer->id() );

@@ -45,6 +45,7 @@ class QgsMapLayerConfigWidgetFactory;
class QgsMapLayerConfigWidget;
class QgsMetadataWidget;
class QgsPanelWidget;
class QgsVectorLayer3DRendererWidget;

class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private Ui::QgsVectorLayerPropertiesBase, private QgsExpressionContextGenerator
{
@@ -237,6 +238,8 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
QAction *mAuxiliaryLayerActionDeleteField = nullptr;
QAction *mAuxiliaryLayerActionAddField = nullptr;

QgsVectorLayer3DRendererWidget *mVector3DWidget = nullptr;

private slots:
void openPanel( QgsPanelWidget *panel );
};
@@ -153,6 +153,18 @@
<normaloff>:/images/themes/default/propertyicons/labels.svg</normaloff>:/images/themes/default/propertyicons/labels.svg</iconset>
</property>
</item>
<item>
<property name="text">
<string>3D View</string>
</property>
<property name="toolTip">
<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>
<item>
<property name="text">
<string>Source Fields</string>
@@ -784,6 +796,7 @@ border-radius: 2px;</string>
</item>
</layout>
</widget>
<widget class="QWidget" name="mOptsPage_3DView"/>
<widget class="QWidget" name="mOptsPage_SourceFields">
<layout class="QVBoxLayout" name="verticalLayout_29">
<property name="leftMargin">

0 comments on commit 7064704

Please sign in to comment.