Skip to content
Permalink
Browse files

Feature #8725: Show configuration option

Shows a new rendering tab in the layer options form for configure the
drawing simplification.
  • Loading branch information
ahuarte47 committed Oct 26, 2013
1 parent 6e24fe7 commit 2c00524332783c069b95d15f3595133dffb68452
Showing with 185 additions and 0 deletions.
  1. +20 −0 i18n/qgis_es.ts
  2. +8 −0 src/app/qgsvectorlayerproperties.cpp
  3. +8 −0 src/core/qgsvectorlayer.cpp
  4. +149 −0 src/ui/qgsvectorlayerpropertiesbase.ui
<source>General</source>
<translation>General</translation>
</message>
<message>
<source>Rendering</source>
<translation>Representación</translation>
</message>
<message>
<source>Display name</source>
<translation type="obsolete">Mostrar el nombre</translation>
<source>Type</source>
<translation>Tipo</translation>
</message>
<message>
<source>Fast drawing</source>
<translation>Pintado rápido</translation>
</message>
<message>
<source>&lt;b&gt;Note:&lt;/b&gt; This option enables geometry simplification drawing for fast rendering of the layer.</source>
<translation>&lt;b&gt;Nota:&lt;/b&gt; Esta opción activa el pintado simplificado de las geometrías para acelerar la representación de la capa.</translation>
</message>
<message>
<source>Simplification factor (Higher value draws more simplified geometries): </source>
<translation>Factor de simplificación (Cuanto mayor es el valor más se simplifica la geometría): </translation>
</message>
<message>
<source>Higher value draws more simplified geometries</source>
<translation>Cuanto mayor es el valor más se simplifica la geometría</translation>
</message>
</context>
<context>
<name>QgsVectorLayerSaveAsDialog</name>
@@ -392,6 +392,10 @@ void QgsVectorLayerProperties::syncToLayer( void )
cbMinimumScale->setScale( 1.0 / layer->minimumScale() );
cbMaximumScale->setScale( 1.0 / layer->maximumScale() );

// get simplify drawing configuration
mSimplifyDrawingGroupBox->setChecked( layer->simplifyDrawing() );
mSimplifyDrawingSlider->setValue( (int)(10.0f * (layer->simplifyDrawingTol()-1)) );

// load appropriate symbology page (V1 or V2)
updateSymbologyPage();

@@ -529,6 +533,10 @@ void QgsVectorLayerProperties::apply()
layer->setMetadataUrlType( mLayerMetadataUrlTypeComboBox->currentText() );
layer->setMetadataUrlFormat( mLayerMetadataUrlFormatComboBox->currentText() );

//layer simplify drawing configuration
layer->setSimplifyDrawing( mSimplifyDrawingGroupBox->isChecked() );
layer->setSimplifyDrawingTol( 1.0f + 0.1f*mSimplifyDrawingSlider->value() );

// update symbology
emit refreshLegend( layer->id(), QgsLegendItem::DontChange );

@@ -1830,6 +1830,10 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage
mLabel->setMinScale( e.attribute( "minLabelScale", "1" ).toFloat() );
mLabel->setMaxScale( e.attribute( "maxLabelScale", "100000000" ).toFloat() );

// get the simplification drawing configuration
setSimplifyDrawing( e.attribute( "simplifyDrawingFlag", "1" ) == "1" );
setSimplifyDrawingTol( e.attribute( "simplifyDrawingTol", "1" ).toFloat() );

//also restore custom properties (for labeling-ng)
readCustomProperties( node, "labeling" );

@@ -2163,6 +2167,10 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
mapLayerNode.setAttribute( "minLabelScale", QString::number( mLabel->minScale() ) );
mapLayerNode.setAttribute( "maxLabelScale", QString::number( mLabel->maxScale() ) );

// save the simplification drawing configuration
mapLayerNode.setAttribute( "simplifyDrawingFlag", mSimplifyDrawing ? 1 : 0 );
mapLayerNode.setAttribute( "simplifyDrawingTol", QString::number( mSimplifyDrawingTol ) );

//save customproperties (for labeling ng)
writeCustomProperties( node, doc );

@@ -144,6 +144,18 @@
<normaloff>:/images/themes/default/propertyicons/attributes.png</normaloff>:/images/themes/default/propertyicons/attributes.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Rendering</string>
</property>
<property name="toolTip">
<string>Rendering</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/propertyicons/rendering.png</normaloff>:/images/themes/default/propertyicons/rendering.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Display</string>
@@ -895,6 +907,143 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="mOptsPage_Rendering">
<layout class="QVBoxLayout" name="verticalLayout_19">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_15">
<property name="styleSheet">
<string notr="true">font-weight:bold;</string>
</property>
<property name="text">
<string>Rendering</string>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="scrollArea_19">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_19">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>794</width>
<height>780</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_32">
<item>
<widget class="QGroupBox" name="mSimplifyDrawingGroupBox">
<property name="title">
<string>Fast drawing</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="_12">
<item row="0" column="1" colspan="5">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;b&gt;Note:&lt;/b&gt; This option enables geometry simplification drawing for fast rendering of the layer.</string>
</property>
<property name="margin">
<number>2</number>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Simplification factor (Higher value draws more simplified geometries): </string>
</property>
<property name="margin">
<number>2</number>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QSlider" name="mSimplifyDrawingSlider">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Higher value draws more simplified geometries</string>
</property>
<property name="maximum">
<number>20</number>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="tracking">
<bool>true</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="3">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="mOptsPage_Display">
<layout class="QVBoxLayout" name="verticalLayout_25">
<property name="margin">

0 comments on commit 2c00524

Please sign in to comment.
You can’t perform that action at this time.