Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tiling configuration to vector layer 3d renderer + widget
- Loading branch information
Showing
14 changed files
with
205 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*************************************************************************** | ||
qgsvectorlayer3dpropertieswidget.cpp | ||
-------------------------------------- | ||
Date : January 2020 | ||
Copyright : (C) 2020 by Martin Dobias | ||
Email : wonder dot sk at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsvectorlayer3dpropertieswidget.h" | ||
|
||
#include "qgsabstractvectorlayer3drenderer.h" | ||
|
||
QgsVectorLayer3DPropertiesWidget::QgsVectorLayer3DPropertiesWidget( QWidget *parent ) | ||
: QWidget( parent ) | ||
{ | ||
setupUi( this ); | ||
|
||
connect( spinZoomLevelsCount, qgis::overload<int>::of( &QSpinBox::valueChanged ), this, &QgsVectorLayer3DPropertiesWidget::changed ); | ||
} | ||
|
||
void QgsVectorLayer3DPropertiesWidget::load( QgsAbstractVectorLayer3DRenderer *renderer ) | ||
{ | ||
whileBlocking( spinZoomLevelsCount )->setValue( renderer->tilingSettings().zoomLevelsCount() ); | ||
} | ||
|
||
void QgsVectorLayer3DPropertiesWidget::apply( QgsAbstractVectorLayer3DRenderer *renderer ) | ||
{ | ||
QgsVectorLayer3DTilingSettings tilingSettings; | ||
tilingSettings.setZoomLevelsCount( spinZoomLevelsCount->value() ); | ||
renderer->setTilingSettings( tilingSettings ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/*************************************************************************** | ||
qgsvectorlayer3dpropertieswidget.h | ||
-------------------------------------- | ||
Date : January 2020 | ||
Copyright : (C) 2020 by Martin Dobias | ||
Email : wonder dot sk at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSVECTORLAYER3DPROPERTIESWIDGET_H | ||
#define QGSVECTORLAYER3DPROPERTIESWIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
#include "ui_qgsvectorlayer3dpropertieswidget.h" | ||
|
||
class QgsAbstractVectorLayer3DRenderer; | ||
|
||
|
||
class QgsVectorLayer3DPropertiesWidget : public QWidget, private Ui::QgsVectorLayer3DPropertiesWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
QgsVectorLayer3DPropertiesWidget( QWidget *parent = nullptr ); | ||
|
||
//! Initializes GUI from the given renderer | ||
void load( QgsAbstractVectorLayer3DRenderer *renderer ); | ||
//! Applies configuration from GUI to the given renderer | ||
void apply( QgsAbstractVectorLayer3DRenderer *renderer ); | ||
|
||
signals: | ||
//! Emitted whenever any paramater gets changed | ||
void changed(); | ||
}; | ||
|
||
#endif // QGSVECTORLAYER3DPROPERTIESWIDGET_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>QgsVectorLayer3DPropertiesWidget</class> | ||
<widget class="QWidget" name="QgsVectorLayer3DPropertiesWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>539</width> | ||
<height>90</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>Zoom levels count</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QSpinBox" name="spinZoomLevelsCount"> | ||
<property name="minimum"> | ||
<number>1</number> | ||
</property> | ||
<property name="maximum"> | ||
<number>8</number> | ||
</property> | ||
<property name="value"> | ||
<number>3</number> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |