Skip to content

Commit

Permalink
Improve vector field widget
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Nov 1, 2011
1 parent 59545f1 commit 68f7d57
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgsvectorfieldsymbollayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ void QgsVectorFieldSymbolLayer::renderPoint( const QPointF& point, QgsSymbolV2Re
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;
}
Expand Down
11 changes: 11 additions & 0 deletions src/gui/symbology-ng/qgsvectorfieldsymbollayerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ void QgsVectorFieldSymbolLayerWidget::on_mCartesianRadioButton_toggled( bool che
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();
}
}
Expand All @@ -149,6 +153,10 @@ 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();
}
}
Expand All @@ -158,6 +166,9 @@ void QgsVectorFieldSymbolLayerWidget::on_mHeightRadioButton_toggled( bool checke
if ( mLayer && checked )
{
mLayer->setVectorFieldType( QgsVectorFieldSymbolLayer::Height );
mXAttributeLabel->setText( "" );
mXAttributeComboBox->setEnabled( false );
mYAttributeLabel->setText( tr( "Height attribute" ) );
emit changed();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/symbollayer/widget_vectorfield.ui
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<item row="1" column="0">
<widget class="QLabel" name="mYAttributeLabel">
<property name="text">
<string>Y Attribute</string>
<string>Y attribute</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit 68f7d57

Please sign in to comment.