Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GUI for configuration of 3D line symbols for vector layers
- Loading branch information
Showing
10 changed files
with
274 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "qgsline3dsymbolwidget.h" | ||
|
||
#include "abstract3dsymbol.h" | ||
|
||
|
||
QgsLine3DSymbolWidget::QgsLine3DSymbolWidget( QWidget *parent ) | ||
: QWidget( parent ) | ||
{ | ||
setupUi( this ); | ||
|
||
setSymbol( Line3DSymbol() ); | ||
|
||
connect( spinWidth, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsLine3DSymbolWidget::changed ); | ||
connect( spinHeight, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsLine3DSymbolWidget::changed ); | ||
connect( spinExtrusion, static_cast<void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsLine3DSymbolWidget::changed ); | ||
connect( cboAltClamping, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLine3DSymbolWidget::changed ); | ||
connect( cboAltBinding, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLine3DSymbolWidget::changed ); | ||
connect( widgetMaterial, &QgsPhongMaterialWidget::changed, this, &QgsLine3DSymbolWidget::changed ); | ||
} | ||
|
||
void QgsLine3DSymbolWidget::setSymbol( const Line3DSymbol &symbol ) | ||
{ | ||
spinWidth->setValue( symbol.width ); | ||
spinHeight->setValue( symbol.height ); | ||
spinExtrusion->setValue( symbol.extrusionHeight ); | ||
cboAltClamping->setCurrentIndex( ( int ) symbol.altClamping ); | ||
cboAltBinding->setCurrentIndex( ( int ) symbol.altBinding ); | ||
widgetMaterial->setMaterial( symbol.material ); | ||
} | ||
|
||
Line3DSymbol QgsLine3DSymbolWidget::symbol() const | ||
{ | ||
Line3DSymbol sym; | ||
sym.width = spinWidth->value(); | ||
sym.height = spinHeight->value(); | ||
sym.extrusionHeight = spinExtrusion->value(); | ||
sym.altClamping = ( AltitudeClamping ) cboAltClamping->currentIndex(); | ||
sym.altBinding = ( AltitudeBinding ) cboAltBinding->currentIndex(); | ||
sym.material = widgetMaterial->material(); | ||
return sym; | ||
} |
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,26 @@ | ||
#ifndef QGSLINE3DSYMBOLWIDGET_H | ||
#define QGSLINE3DSYMBOLWIDGET_H | ||
|
||
#include <QWidget> | ||
|
||
#include "ui_line3dsymbolwidget.h" | ||
|
||
class Line3DSymbol; | ||
|
||
//! A widget for configuration of 3D symbol for polygons | ||
class QgsLine3DSymbolWidget : public QWidget, private Ui::Line3DSymbolWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit QgsLine3DSymbolWidget( QWidget *parent = nullptr ); | ||
|
||
void setSymbol( const Line3DSymbol &symbol ); | ||
Line3DSymbol symbol() const; | ||
|
||
signals: | ||
void changed(); | ||
|
||
public slots: | ||
}; | ||
|
||
#endif // QGSLINE3DSYMBOLWIDGET_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
Oops, something went wrong.