Skip to content

Commit 2c00524

Browse files
committedOct 26, 2013
Feature #8725: Show configuration option
Shows a new rendering tab in the layer options form for configure the drawing simplification.
1 parent 6e24fe7 commit 2c00524

File tree

4 files changed

+185
-0
lines changed

4 files changed

+185
-0
lines changed
 

‎i18n/qgis_es.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49496,6 +49496,10 @@ Should the existing classes be deleted before classification?</source>
4949649496
<source>General</source>
4949749497
<translation>General</translation>
4949849498
</message>
49499+
<message>
49500+
<source>Rendering</source>
49501+
<translation>Representación</translation>
49502+
</message>
4949949503
<message>
4950049504
<source>Display name</source>
4950149505
<translation type="obsolete">Mostrar el nombre</translation>
@@ -49944,6 +49948,22 @@ Should the existing classes be deleted before classification?</source>
4994449948
<source>Type</source>
4994549949
<translation>Tipo</translation>
4994649950
</message>
49951+
<message>
49952+
<source>Fast drawing</source>
49953+
<translation>Pintado rápido</translation>
49954+
</message>
49955+
<message>
49956+
<source>&lt;b&gt;Note:&lt;/b&gt; This option enables geometry simplification drawing for fast rendering of the layer.</source>
49957+
<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>
49958+
</message>
49959+
<message>
49960+
<source>Simplification factor (Higher value draws more simplified geometries): </source>
49961+
<translation>Factor de simplificación (Cuanto mayor es el valor más se simplifica la geometría): </translation>
49962+
</message>
49963+
<message>
49964+
<source>Higher value draws more simplified geometries</source>
49965+
<translation>Cuanto mayor es el valor más se simplifica la geometría</translation>
49966+
</message>
4994749967
</context>
4994849968
<context>
4994949969
<name>QgsVectorLayerSaveAsDialog</name>

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ void QgsVectorLayerProperties::syncToLayer( void )
392392
cbMinimumScale->setScale( 1.0 / layer->minimumScale() );
393393
cbMaximumScale->setScale( 1.0 / layer->maximumScale() );
394394

395+
// get simplify drawing configuration
396+
mSimplifyDrawingGroupBox->setChecked( layer->simplifyDrawing() );
397+
mSimplifyDrawingSlider->setValue( (int)(10.0f * (layer->simplifyDrawingTol()-1)) );
398+
395399
// load appropriate symbology page (V1 or V2)
396400
updateSymbologyPage();
397401

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

536+
//layer simplify drawing configuration
537+
layer->setSimplifyDrawing( mSimplifyDrawingGroupBox->isChecked() );
538+
layer->setSimplifyDrawingTol( 1.0f + 0.1f*mSimplifyDrawingSlider->value() );
539+
532540
// update symbology
533541
emit refreshLegend( layer->id(), QgsLegendItem::DontChange );
534542

‎src/core/qgsvectorlayer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,10 @@ bool QgsVectorLayer::readSymbology( const QDomNode& node, QString& errorMessage
18301830
mLabel->setMinScale( e.attribute( "minLabelScale", "1" ).toFloat() );
18311831
mLabel->setMaxScale( e.attribute( "maxLabelScale", "100000000" ).toFloat() );
18321832

1833+
// get the simplification drawing configuration
1834+
setSimplifyDrawing( e.attribute( "simplifyDrawingFlag", "1" ) == "1" );
1835+
setSimplifyDrawingTol( e.attribute( "simplifyDrawingTol", "1" ).toFloat() );
1836+
18331837
//also restore custom properties (for labeling-ng)
18341838
readCustomProperties( node, "labeling" );
18351839

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

2170+
// save the simplification drawing configuration
2171+
mapLayerNode.setAttribute( "simplifyDrawingFlag", mSimplifyDrawing ? 1 : 0 );
2172+
mapLayerNode.setAttribute( "simplifyDrawingTol", QString::number( mSimplifyDrawingTol ) );
2173+
21662174
//save customproperties (for labeling ng)
21672175
writeCustomProperties( node, doc );
21682176

‎src/ui/qgsvectorlayerpropertiesbase.ui

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@
144144
<normaloff>:/images/themes/default/propertyicons/attributes.png</normaloff>:/images/themes/default/propertyicons/attributes.png</iconset>
145145
</property>
146146
</item>
147+
<item>
148+
<property name="text">
149+
<string>Rendering</string>
150+
</property>
151+
<property name="toolTip">
152+
<string>Rendering</string>
153+
</property>
154+
<property name="icon">
155+
<iconset resource="../../images/images.qrc">
156+
<normaloff>:/images/themes/default/propertyicons/rendering.png</normaloff>:/images/themes/default/propertyicons/rendering.png</iconset>
157+
</property>
158+
</item>
147159
<item>
148160
<property name="text">
149161
<string>Display</string>
@@ -895,6 +907,143 @@
895907
</item>
896908
</layout>
897909
</widget>
910+
<widget class="QWidget" name="mOptsPage_Rendering">
911+
<layout class="QVBoxLayout" name="verticalLayout_19">
912+
<property name="margin">
913+
<number>0</number>
914+
</property>
915+
<item>
916+
<widget class="QLabel" name="label_15">
917+
<property name="styleSheet">
918+
<string notr="true">font-weight:bold;</string>
919+
</property>
920+
<property name="text">
921+
<string>Rendering</string>
922+
</property>
923+
</widget>
924+
</item>
925+
<item>
926+
<widget class="QScrollArea" name="scrollArea_19">
927+
<property name="frameShape">
928+
<enum>QFrame::NoFrame</enum>
929+
</property>
930+
<property name="widgetResizable">
931+
<bool>true</bool>
932+
</property>
933+
<widget class="QWidget" name="scrollAreaWidgetContents_19">
934+
<property name="geometry">
935+
<rect>
936+
<x>0</x>
937+
<y>0</y>
938+
<width>794</width>
939+
<height>780</height>
940+
</rect>
941+
</property>
942+
<layout class="QVBoxLayout" name="verticalLayout_32">
943+
<item>
944+
<widget class="QGroupBox" name="mSimplifyDrawingGroupBox">
945+
<property name="title">
946+
<string>Fast drawing</string>
947+
</property>
948+
<property name="checkable">
949+
<bool>true</bool>
950+
</property>
951+
<layout class="QGridLayout" name="_12">
952+
<item row="0" column="1" colspan="5">
953+
<widget class="QLabel" name="label_16">
954+
<property name="sizePolicy">
955+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
956+
<horstretch>0</horstretch>
957+
<verstretch>0</verstretch>
958+
</sizepolicy>
959+
</property>
960+
<property name="text">
961+
<string>&lt;b&gt;Note:&lt;/b&gt; This option enables geometry simplification drawing for fast rendering of the layer.</string>
962+
</property>
963+
<property name="margin">
964+
<number>2</number>
965+
</property>
966+
</widget>
967+
</item>
968+
<item row="7" column="1">
969+
<widget class="QLabel" name="label_17">
970+
<property name="text">
971+
<string>Simplification factor (Higher value draws more simplified geometries): </string>
972+
</property>
973+
<property name="margin">
974+
<number>2</number>
975+
</property>
976+
</widget>
977+
</item>
978+
<item row="7" column="2">
979+
<widget class="QSlider" name="mSimplifyDrawingSlider">
980+
<property name="maximumSize">
981+
<size>
982+
<width>100</width>
983+
<height>16777215</height>
984+
</size>
985+
</property>
986+
<property name="toolTip">
987+
<string>Higher value draws more simplified geometries</string>
988+
</property>
989+
<property name="maximum">
990+
<number>20</number>
991+
</property>
992+
<property name="minimum">
993+
<number>0</number>
994+
</property>
995+
<property name="value">
996+
<number>0</number>
997+
</property>
998+
<property name="tracking">
999+
<bool>true</bool>
1000+
</property>
1001+
<property name="orientation">
1002+
<enum>Qt::Horizontal</enum>
1003+
</property>
1004+
<property name="invertedAppearance">
1005+
<bool>false</bool>
1006+
</property>
1007+
<property name="invertedControls">
1008+
<bool>false</bool>
1009+
</property>
1010+
</widget>
1011+
</item>
1012+
<item row="7" column="3">
1013+
<spacer name="horizontalSpacer_6">
1014+
<property name="orientation">
1015+
<enum>Qt::Horizontal</enum>
1016+
</property>
1017+
<property name="sizeHint" stdset="0">
1018+
<size>
1019+
<width>40</width>
1020+
<height>20</height>
1021+
</size>
1022+
</property>
1023+
</spacer>
1024+
</item>
1025+
</layout>
1026+
</widget>
1027+
</item>
1028+
<item>
1029+
<spacer name="verticalSpacer_6">
1030+
<property name="orientation">
1031+
<enum>Qt::Vertical</enum>
1032+
</property>
1033+
<property name="sizeHint" stdset="0">
1034+
<size>
1035+
<width>20</width>
1036+
<height>40</height>
1037+
</size>
1038+
</property>
1039+
</spacer>
1040+
</item>
1041+
</layout>
1042+
</widget>
1043+
</widget>
1044+
</item>
1045+
</layout>
1046+
</widget>
8981047
<widget class="QWidget" name="mOptsPage_Display">
8991048
<layout class="QVBoxLayout" name="verticalLayout_25">
9001049
<property name="margin">

0 commit comments

Comments
 (0)
Please sign in to comment.