| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,224 @@ | ||
| /*************************************************************************** | ||
| qgsvectorfieldsymbollayer.cpp | ||
| ----------------------------- | ||
| begin : Octorer 25, 2011 | ||
| copyright : (C) 2011 by Marco Hugentobler | ||
| email : marco dot hugentobler at sourcepole dot ch | ||
| ***************************************************************************/ | ||
|
|
||
| /*************************************************************************** | ||
| * * | ||
| * 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 "qgsvectorfieldsymbollayer.h" | ||
| #include "qgsvectorlayer.h" | ||
|
|
||
| QgsVectorFieldSymbolLayer::QgsVectorFieldSymbolLayer(): mXAttribute( "" ), mYAttribute( "" ), mScale( 1.0 ), | ||
| mVectorFieldType( Cartesian ), mAngleOrientation( ClockwiseFromNorth ), mAngleUnits( Degrees ), mXIndex( -1 ), mYIndex( -1 ) | ||
| { | ||
| setSubSymbol( new QgsLineSymbolV2() ); | ||
| } | ||
|
|
||
| QgsVectorFieldSymbolLayer::~QgsVectorFieldSymbolLayer() | ||
| { | ||
| } | ||
|
|
||
| QgsSymbolLayerV2* QgsVectorFieldSymbolLayer::create( const QgsStringMap& properties ) | ||
| { | ||
| QgsVectorFieldSymbolLayer* symbolLayer = new QgsVectorFieldSymbolLayer(); | ||
| if ( properties.contains( "x_attribute" ) ) | ||
| { | ||
| symbolLayer->setXAttribute( properties["x_attribute"] ); | ||
| } | ||
| if ( properties.contains( "y_attribute" ) ) | ||
| { | ||
| symbolLayer->setYAttribute( properties["y_attribute"] ); | ||
| } | ||
| if ( properties.contains( "scale" ) ) | ||
| { | ||
| symbolLayer->setScale( properties["scale"].toDouble() ); | ||
| } | ||
| if ( properties.contains( "vector_field_type" ) ) | ||
| { | ||
| symbolLayer->setVectorFieldType(( VectorFieldType )( properties["vector_field_type"].toInt() ) ); | ||
| } | ||
| if ( properties.contains( "angle_orientation" ) ) | ||
| { | ||
| symbolLayer->setAngleOrientation(( AngleOrientation )( properties["angle_orientation"].toInt() ) ); | ||
| } | ||
| if ( properties.contains( "angle_units" ) ) | ||
| { | ||
| symbolLayer->setAngleUnits(( AngleUnits )( properties["angle_units"].toInt() ) ); | ||
| } | ||
| return symbolLayer; | ||
| } | ||
|
|
||
| bool QgsVectorFieldSymbolLayer::setSubSymbol( QgsSymbolV2* symbol ) | ||
| { | ||
| if ( symbol->type() == QgsSymbolV2::Line ) | ||
| { | ||
| mLineSymbol = static_cast<QgsLineSymbolV2*>( symbol ); | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayer::renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ) | ||
| { | ||
| if ( !mLineSymbol ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| const QgsFeature* f = context.feature(); | ||
| if ( !f ) | ||
| { | ||
| //preview | ||
| QPolygonF line; | ||
| line << QPointF( 0, 50 ); | ||
| line << QPointF( 100, 50 ); | ||
| mLineSymbol->renderPolyline( line, 0, context.renderContext() ); | ||
| } | ||
|
|
||
| double xComponent = 0; | ||
| double yComponent = 0; | ||
|
|
||
| double xVal = 0; | ||
| if ( mXIndex != -1 ) | ||
| { | ||
| xVal = f->attributeMap()[mXIndex].toDouble(); | ||
| } | ||
| double yVal = 0; | ||
| if ( mYIndex != -1 ) | ||
| { | ||
| yVal = f->attributeMap()[mYIndex].toDouble(); | ||
| } | ||
|
|
||
| switch ( mVectorFieldType ) | ||
| { | ||
| case Cartesian: | ||
| xComponent = context.outputLineWidth( xVal ); | ||
| yComponent = context.outputLineWidth( yVal ); | ||
| break; | ||
| case Polar: | ||
| convertPolarToCartesian( xVal, yVal, xComponent, yComponent ); | ||
| xComponent = context.outputLineWidth( xComponent ); | ||
| yComponent = context.outputLineWidth( yComponent ); | ||
| break; | ||
| case Height: | ||
| xComponent = 0; | ||
| yComponent = context.outputLineWidth( yVal ); | ||
| break; | ||
| default: | ||
| break; | ||
| } | ||
|
|
||
| xComponent *= mScale; | ||
| yComponent *= mScale; | ||
|
|
||
| QPolygonF line; | ||
| line << point; | ||
| line << QPointF( point.x() + xComponent, point.y() - yComponent ); | ||
| mLineSymbol->renderPolyline( line, f, context.renderContext() ); | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayer::startRender( QgsSymbolV2RenderContext& context ) | ||
| { | ||
| if ( mLineSymbol ) | ||
| { | ||
| mLineSymbol->startRender( context.renderContext() ); | ||
| } | ||
|
|
||
| const QgsVectorLayer* layer = context.layer(); | ||
| if ( layer ) | ||
| { | ||
| mXIndex = layer->fieldNameIndex( mXAttribute ); | ||
| mYIndex = layer->fieldNameIndex( mYAttribute ); | ||
| } | ||
| else | ||
| { | ||
| mXIndex = -1; | ||
| mYIndex = -1; | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayer::stopRender( QgsSymbolV2RenderContext& context ) | ||
| { | ||
| if ( mLineSymbol ) | ||
| { | ||
| mLineSymbol->stopRender( context.renderContext() ); | ||
| } | ||
| } | ||
|
|
||
| QgsSymbolLayerV2* QgsVectorFieldSymbolLayer::clone() const | ||
| { | ||
| QgsSymbolLayerV2* clonedLayer = QgsVectorFieldSymbolLayer::create( properties() ); | ||
| if ( mLineSymbol ) | ||
| { | ||
| clonedLayer->setSubSymbol( mLineSymbol->clone() ); | ||
| } | ||
| return clonedLayer; | ||
| } | ||
|
|
||
| QgsStringMap QgsVectorFieldSymbolLayer::properties() const | ||
| { | ||
| QgsStringMap properties; | ||
| properties["x_attribute"] = mXAttribute; | ||
| properties["y_attribute"] = mYAttribute; | ||
| properties["scale"] = QString::number( mScale ); | ||
| properties["vector_field_type"] = QString::number( mVectorFieldType ); | ||
| properties["angle_orientation"] = QString::number( mAngleOrientation ); | ||
| properties["angle_units"] = QString::number( mAngleUnits ); | ||
| return properties; | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayer::drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) | ||
| { | ||
| if ( mLineSymbol ) | ||
| { | ||
| mLineSymbol->drawPreviewIcon( context.renderContext().painter(), size ); | ||
| } | ||
| } | ||
|
|
||
| QSet<QString> QgsVectorFieldSymbolLayer::usedAttributes() const | ||
| { | ||
| QSet<QString> attributes; | ||
| if ( !mXAttribute.isEmpty() ) | ||
| { | ||
| attributes.insert( mXAttribute ); | ||
| } | ||
| if ( !mYAttribute.isEmpty() ) | ||
| { | ||
| attributes.insert( mYAttribute ); | ||
| } | ||
| return attributes; | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayer::convertPolarToCartesian( double length, double angle, double& x, double& y ) const | ||
| { | ||
| //convert angle to degree and to north orientation | ||
| if ( mAngleOrientation == CounterclockwiseFromEast ) | ||
| { | ||
| if ( angle <= 90 ) | ||
| { | ||
| angle = 90 - angle; | ||
| } | ||
| else | ||
| { | ||
| angle = 360 - angle + 90; | ||
| } | ||
| } | ||
|
|
||
| if ( mAngleUnits == Degrees ) | ||
| { | ||
| angle = angle * M_PI / 180.0; | ||
| } | ||
|
|
||
| x = length * sin( angle ); | ||
| y = length * cos( angle ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| /*************************************************************************** | ||
| qgsvectorfieldsymbollayer.h | ||
| ------------------------- | ||
| begin : Octorer 25, 2011 | ||
| copyright : (C) 2011 by Marco Hugentobler | ||
| email : marco dot hugentobler at sourcepole dot ch | ||
| ***************************************************************************/ | ||
|
|
||
| /*************************************************************************** | ||
| * * | ||
| * 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 QGSVECTORFIELDSYMBOLLAYER_H | ||
| #define QGSVECTORFIELDSYMBOLLAYER_H | ||
|
|
||
| #include "qgssymbollayerv2.h" | ||
|
|
||
| /**A symbol layer class for displaying displacement arrows based on point layer attributes*/ | ||
| class CORE_EXPORT QgsVectorFieldSymbolLayer: public QgsMarkerSymbolLayerV2 | ||
| { | ||
| public: | ||
| enum VectorFieldType | ||
| { | ||
| Cartesian = 0, | ||
| Polar, | ||
| Height | ||
| }; | ||
|
|
||
| enum AngleOrientation | ||
| { | ||
| ClockwiseFromNorth = 0, | ||
| CounterclockwiseFromEast | ||
| }; | ||
|
|
||
| enum AngleUnits | ||
| { | ||
| Degrees = 0, | ||
| Radians | ||
| }; | ||
|
|
||
| QgsVectorFieldSymbolLayer(); | ||
| ~QgsVectorFieldSymbolLayer(); | ||
|
|
||
| static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() ); | ||
|
|
||
| QString layerType() const { return "VectorField"; } | ||
|
|
||
| bool setSubSymbol( QgsSymbolV2* symbol ); | ||
| QgsSymbolV2* subSymbol() { return mLineSymbol; } | ||
|
|
||
| void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ); | ||
| void startRender( QgsSymbolV2RenderContext& context ); | ||
| void stopRender( QgsSymbolV2RenderContext& context ); | ||
|
|
||
| QgsSymbolLayerV2* clone() const; | ||
| QgsStringMap properties() const; | ||
|
|
||
| void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ); | ||
|
|
||
| QSet<QString> usedAttributes() const; | ||
|
|
||
| //setters and getters | ||
| void setXAttribute( const QString& attribute ) { mXAttribute = attribute; } | ||
| QString xAttribute() const { return mXAttribute; } | ||
| void setYAttribute( const QString& attribute ) { mYAttribute = attribute; } | ||
| QString yAttribute() const { return mYAttribute; } | ||
| void setScale( double s ) { mScale = s; } | ||
| double scale() const { return mScale; } | ||
| void setVectorFieldType( VectorFieldType type ) { mVectorFieldType = type; } | ||
| VectorFieldType vectorFieldType() const { return mVectorFieldType; } | ||
| void setAngleOrientation( AngleOrientation orientation ) { mAngleOrientation = orientation; } | ||
| AngleOrientation angleOrientation() const { return mAngleOrientation; } | ||
| void setAngleUnits( AngleUnits units ) { mAngleUnits = units; } | ||
| AngleUnits angleUnits() const { return mAngleUnits; } | ||
|
|
||
| private: | ||
| QString mXAttribute; | ||
| QString mYAttribute; | ||
| double mScale; | ||
| VectorFieldType mVectorFieldType; | ||
| AngleOrientation mAngleOrientation; | ||
| AngleUnits mAngleUnits; | ||
|
|
||
| QgsLineSymbolV2* mLineSymbol; | ||
|
|
||
| //Attribute indices are resolved in startRender method | ||
| int mXIndex; | ||
| int mYIndex; | ||
|
|
||
| //Converts length/angle to cartesian x/y | ||
| void convertPolarToCartesian( double length, double angle, double& x, double& y ) const; | ||
| }; | ||
|
|
||
| #endif // QGSVECTORFIELDSYMBOLLAYER_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| #include "qgsvectorfieldsymbollayerwidget.h" | ||
| #include "qgssymbolv2propertiesdialog.h" | ||
| #include "qgsvectorfieldsymbollayer.h" | ||
| #include "qgsvectorlayer.h" | ||
|
|
||
| QgsVectorFieldSymbolLayerWidget::QgsVectorFieldSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent ): QgsSymbolLayerV2Widget( parent, vl ), mLayer( 0 ) | ||
| { | ||
| setupUi( this ); | ||
| if ( mVectorLayer ) | ||
| { | ||
| const QgsFieldMap& fm = mVectorLayer->pendingFields(); | ||
| QgsFieldMap::const_iterator fieldIt = fm.constBegin(); | ||
| mXAttributeComboBox->addItem( "" ); | ||
| mYAttributeComboBox->addItem( "" ); | ||
| for ( ; fieldIt != fm.constEnd(); ++fieldIt ) | ||
| { | ||
| QString fieldName = fieldIt.value().name(); | ||
| mXAttributeComboBox->addItem( fieldName ); | ||
| mYAttributeComboBox->addItem( fieldName ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| QgsVectorFieldSymbolLayerWidget::~QgsVectorFieldSymbolLayerWidget() | ||
| { | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* layer ) | ||
| { | ||
| if ( layer->layerType() != "VectorField" ) | ||
| { | ||
| return; | ||
| } | ||
| mLayer = static_cast<QgsVectorFieldSymbolLayer*>( layer ); | ||
| if ( !mLayer ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| mXAttributeComboBox->setCurrentIndex( mXAttributeComboBox->findText( mLayer->xAttribute() ) ); | ||
| mYAttributeComboBox->setCurrentIndex( mYAttributeComboBox->findText( mLayer->yAttribute() ) ); | ||
| mScaleSpinBox->setValue( mLayer->scale() ); | ||
|
|
||
| QgsVectorFieldSymbolLayer::VectorFieldType type = mLayer->vectorFieldType(); | ||
| if ( type == QgsVectorFieldSymbolLayer::Cartesian ) | ||
| { | ||
| mCartesianRadioButton->setChecked( true ); | ||
| } | ||
| else if ( type == QgsVectorFieldSymbolLayer::Polar ) | ||
| { | ||
| mPolarRadioButton->setChecked( true ); | ||
| } | ||
| else if ( type == QgsVectorFieldSymbolLayer::Height ) | ||
| { | ||
| mHeightRadioButton->setChecked( true ); | ||
| } | ||
|
|
||
| QgsVectorFieldSymbolLayer::AngleOrientation orientation = mLayer->angleOrientation(); | ||
| if ( orientation == QgsVectorFieldSymbolLayer::ClockwiseFromNorth ) | ||
| { | ||
| mClockwiseFromNorthRadioButton->setChecked( true ); | ||
| } | ||
| else if ( orientation == QgsVectorFieldSymbolLayer::CounterclockwiseFromEast ) | ||
| { | ||
| mCounterclockwiseFromEastRadioButton->setChecked( true ); | ||
| } | ||
|
|
||
| QgsVectorFieldSymbolLayer::AngleUnits angleUnits = mLayer->angleUnits(); | ||
| if ( angleUnits == QgsVectorFieldSymbolLayer::Degrees ) | ||
| { | ||
| mDegreesRadioButton->setChecked( true ); | ||
| } | ||
| else if ( angleUnits == QgsVectorFieldSymbolLayer::Radians ) | ||
| { | ||
| mRadiansRadioButton->setChecked( true ); | ||
| } | ||
| updateMarkerIcon(); | ||
| } | ||
|
|
||
| QgsSymbolLayerV2* QgsVectorFieldSymbolLayerWidget::symbolLayer() | ||
| { | ||
| return mLayer; | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mScaleSpinBox_valueChanged( double d ) | ||
| { | ||
| if ( mLayer ) | ||
| { | ||
| mLayer->setScale( d ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mXAttributeComboBox_currentIndexChanged( int index ) | ||
| { | ||
| if ( mLayer ) | ||
| { | ||
| mLayer->setXAttribute( mXAttributeComboBox->itemText( index ) ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mYAttributeComboBox_currentIndexChanged( int index ) | ||
| { | ||
| if ( mLayer ) | ||
| { | ||
| mLayer->setYAttribute( mYAttributeComboBox->itemText( index ) ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mLineStylePushButton_clicked() | ||
| { | ||
| if ( !mLayer ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| QgsSymbolV2PropertiesDialog dlg( mLayer->subSymbol(), mVectorLayer, this ); | ||
| if ( dlg.exec() == QDialog::Rejected ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| updateMarkerIcon(); | ||
| emit changed(); | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::updateMarkerIcon() | ||
| { | ||
| if ( mLayer ) | ||
| { | ||
| QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( mLayer->subSymbol(), mLineStylePushButton->iconSize() ); | ||
| mLineStylePushButton->setIcon( icon ); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mCartesianRadioButton_toggled( bool checked ) | ||
| { | ||
| if ( mLayer && checked ) | ||
| { | ||
| mLayer->setVectorFieldType( QgsVectorFieldSymbolLayer::Cartesian ); | ||
| mXAttributeComboBox->setEnabled( true ); | ||
| mYAttributeComboBox->setEnabled( true ); | ||
| mXAttributeLabel->setText( tr( "X attribute" ) ); | ||
| mYAttributeLabel->setText( tr( "Y attribute" ) ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mPolarRadioButton_toggled( bool checked ) | ||
| { | ||
| if ( mLayer && checked ) | ||
| { | ||
| mLayer->setVectorFieldType( QgsVectorFieldSymbolLayer::Polar ); | ||
| mXAttributeComboBox->setEnabled( true ); | ||
| mYAttributeComboBox->setEnabled( true ); | ||
| mXAttributeLabel->setText( tr( "Length attribute" ) ); | ||
| mYAttributeLabel->setText( tr( "Angle attribute" ) ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mHeightRadioButton_toggled( bool checked ) | ||
| { | ||
| if ( mLayer && checked ) | ||
| { | ||
| mLayer->setVectorFieldType( QgsVectorFieldSymbolLayer::Height ); | ||
| mXAttributeLabel->setText( "" ); | ||
| mXAttributeComboBox->setEnabled( false ); | ||
| mYAttributeLabel->setText( tr( "Height attribute" ) ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mDegreesRadioButton_toggled( bool checked ) | ||
| { | ||
| if ( mLayer && checked ) | ||
| { | ||
| mLayer->setAngleUnits( QgsVectorFieldSymbolLayer::Degrees ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mRadiansRadioButton_toggled( bool checked ) | ||
| { | ||
| if ( mLayer && checked ) | ||
| { | ||
| mLayer->setAngleUnits( QgsVectorFieldSymbolLayer::Radians ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mClockwiseFromNorthRadioButton_toggled( bool checked ) | ||
| { | ||
| if ( mLayer && checked ) | ||
| { | ||
| mLayer->setAngleOrientation( QgsVectorFieldSymbolLayer::ClockwiseFromNorth ); | ||
| emit changed(); | ||
| } | ||
| } | ||
|
|
||
| void QgsVectorFieldSymbolLayerWidget::on_mCounterclockwiseFromEastRadioButton_toggled( bool checked ) | ||
| { | ||
| if ( mLayer && checked ) | ||
| { | ||
| mLayer->setAngleOrientation( QgsVectorFieldSymbolLayer::CounterclockwiseFromEast ); | ||
| emit changed(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #ifndef QGSVECTORFIELDSYMBOLLAYERWIDGET_H | ||
| #define QGSVECTORFIELDSYMBOLLAYERWIDGET_H | ||
|
|
||
| #include "qgssymbollayerv2widget.h" | ||
| #include "ui_widget_vectorfield.h" | ||
|
|
||
| class QgsVectorFieldSymbolLayer; | ||
|
|
||
| class GUI_EXPORT QgsVectorFieldSymbolLayerWidget: public QgsSymbolLayerV2Widget, private Ui::WidgetVectorFieldBase | ||
| { | ||
| Q_OBJECT | ||
| public: | ||
| QgsVectorFieldSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = 0 ); | ||
| ~QgsVectorFieldSymbolLayerWidget(); | ||
|
|
||
| static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsVectorFieldSymbolLayerWidget( vl ); } | ||
|
|
||
| // from base class | ||
| virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | ||
| virtual QgsSymbolLayerV2* symbolLayer(); | ||
|
|
||
| protected: | ||
| QgsVectorFieldSymbolLayer* mLayer; | ||
| void updateMarkerIcon(); | ||
|
|
||
| private slots: | ||
| void on_mScaleSpinBox_valueChanged( double d ); | ||
| void on_mXAttributeComboBox_currentIndexChanged( int index ); | ||
| void on_mYAttributeComboBox_currentIndexChanged( int index ); | ||
| void on_mLineStylePushButton_clicked(); | ||
| void on_mCartesianRadioButton_toggled( bool checked ); | ||
| void on_mPolarRadioButton_toggled( bool checked ); | ||
| void on_mHeightRadioButton_toggled( bool checked ); | ||
| void on_mDegreesRadioButton_toggled( bool checked ); | ||
| void on_mRadiansRadioButton_toggled( bool checked ); | ||
| void on_mClockwiseFromNorthRadioButton_toggled( bool checked ); | ||
| void on_mCounterclockwiseFromEastRadioButton_toggled( bool checked ); | ||
| }; | ||
|
|
||
| #endif // QGSVECTORFIELDSYMBOLLAYERWIDGET_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #ifndef QGSVECTORFIELDWIDGET_H | ||
| #define QGSVECTORFIELDWIDGET_H | ||
|
|
||
| #endif // QGSVECTORFIELDWIDGET_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <ui version="4.0"> | ||
| <class>WidgetVectorFieldBase</class> | ||
| <widget class="QWidget" name="WidgetVectorFieldBase"> | ||
| <property name="geometry"> | ||
| <rect> | ||
| <x>0</x> | ||
| <y>0</y> | ||
| <width>400</width> | ||
| <height>291</height> | ||
| </rect> | ||
| </property> | ||
| <property name="windowTitle"> | ||
| <string>Form</string> | ||
| </property> | ||
| <layout class="QGridLayout" name="gridLayout_4"> | ||
| <item row="0" column="0"> | ||
| <widget class="QLabel" name="mXAttributeLabel"> | ||
| <property name="text"> | ||
| <string>X attribute</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="0" column="1" colspan="2"> | ||
| <widget class="QComboBox" name="mXAttributeComboBox"/> | ||
| </item> | ||
| <item row="1" column="0"> | ||
| <widget class="QLabel" name="mYAttributeLabel"> | ||
| <property name="text"> | ||
| <string>Y attribute</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="1" column="1" colspan="2"> | ||
| <widget class="QComboBox" name="mYAttributeComboBox"/> | ||
| </item> | ||
| <item row="2" column="0"> | ||
| <widget class="QLabel" name="mScaleLabel"> | ||
| <property name="text"> | ||
| <string>Scale</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="2" column="1" colspan="2"> | ||
| <widget class="QDoubleSpinBox" name="mScaleSpinBox"/> | ||
| </item> | ||
| <item row="4" column="0" rowspan="2" colspan="2"> | ||
| <widget class="QGroupBox" name="mFieldTypeGroupBox"> | ||
| <property name="title"> | ||
| <string>Vector field type</string> | ||
| </property> | ||
| <layout class="QGridLayout" name="gridLayout"> | ||
| <item row="0" column="0"> | ||
| <widget class="QRadioButton" name="mCartesianRadioButton"> | ||
| <property name="text"> | ||
| <string>Cartesian</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="1" column="0"> | ||
| <widget class="QRadioButton" name="mPolarRadioButton"> | ||
| <property name="text"> | ||
| <string>Polar</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="2" column="0"> | ||
| <widget class="QRadioButton" name="mHeightRadioButton"> | ||
| <property name="text"> | ||
| <string>Height only</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| </layout> | ||
| </widget> | ||
| </item> | ||
| <item row="4" column="2" colspan="2"> | ||
| <widget class="QGroupBox" name="mAngleUnitsGroupBox"> | ||
| <property name="title"> | ||
| <string>Angle units</string> | ||
| </property> | ||
| <layout class="QGridLayout" name="gridLayout_3"> | ||
| <item row="0" column="0"> | ||
| <widget class="QRadioButton" name="mDegreesRadioButton"> | ||
| <property name="text"> | ||
| <string>Degrees</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="1" column="0"> | ||
| <widget class="QRadioButton" name="mRadiansRadioButton"> | ||
| <property name="text"> | ||
| <string>Radians</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| </layout> | ||
| </widget> | ||
| </item> | ||
| <item row="5" column="2" colspan="2"> | ||
| <widget class="QGroupBox" name="mAngleOrientationGroupBox"> | ||
| <property name="title"> | ||
| <string>Angle orientation</string> | ||
| </property> | ||
| <layout class="QGridLayout" name="gridLayout_2"> | ||
| <item row="1" column="0"> | ||
| <widget class="QRadioButton" name="mCounterclockwiseFromEastRadioButton"> | ||
| <property name="text"> | ||
| <string>Counterclockwise from east</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="0" column="0"> | ||
| <widget class="QRadioButton" name="mClockwiseFromNorthRadioButton"> | ||
| <property name="text"> | ||
| <string>Clockwise from north</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| </layout> | ||
| </widget> | ||
| </item> | ||
| <item row="3" column="0"> | ||
| <widget class="QLabel" name="mLineStyleLabel"> | ||
| <property name="text"> | ||
| <string>LineStyle</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="3" column="1" colspan="2"> | ||
| <widget class="QPushButton" name="mLineStylePushButton"> | ||
| <property name="text"> | ||
| <string>change</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| </layout> | ||
| </widget> | ||
| <resources/> | ||
| <connections/> | ||
| </ui> |