QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgssymbollayerv2widget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbollayerv2widget.h - symbol layer widgets
3 
4  ---------------------
5  begin : November 2009
6  copyright : (C) 2009 by Martin Dobias
7  email : wonder dot sk at gmail dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSSYMBOLLAYERV2WIDGET_H
18 #define QGSSYMBOLLAYERV2WIDGET_H
19 
20 #include <QWidget>
21 
22 class QgsSymbolLayerV2;
23 class QgsVectorLayer;
24 
25 
26 class GUI_EXPORT QgsSymbolLayerV2Widget : public QWidget
27 {
28  Q_OBJECT
29 
30  public:
31  QgsSymbolLayerV2Widget( QWidget* parent, const QgsVectorLayer* vl = 0 ) : QWidget( parent ), mVectorLayer( vl ) {}
33 
34  virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0;
35  virtual QgsSymbolLayerV2* symbolLayer() = 0;
36 
37  protected:
43  virtual QString dataDefinedPropertyLabel( const QString &entryName );
44 
45  signals:
46  void changed();
47 };
48 
50 
51 #include "ui_widget_simpleline.h"
52 
54 
55 class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleLine
56 {
57  Q_OBJECT
58 
59  public:
60  QgsSimpleLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
61 
63 
64  // from base class
65  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
66  virtual QgsSymbolLayerV2* symbolLayer();
67 
68  public slots:
69  void penWidthChanged();
70  void colorChanged( const QColor& color );
71  void penStyleChanged();
72  void offsetChanged();
73  void on_mCustomCheckBox_stateChanged( int state );
74  void on_mChangePatternButton_clicked();
75  void on_mPenWidthUnitWidget_changed();
76  void on_mOffsetUnitWidget_changed();
77  void on_mDashPatternUnitWidget_changed();
78  void on_mDataDefinedPropertiesButton_clicked();
79  void on_mDrawInsideCheckBox_stateChanged( int state );
80 
81  protected:
83 
84  //creates a new icon for the 'change pattern' button
85  void updatePatternIcon();
86 };
87 
89 
90 #include "ui_widget_simplemarker.h"
91 
93 
94 class GUI_EXPORT QgsSimpleMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleMarker
95 {
96  Q_OBJECT
97 
98  public:
99  QgsSimpleMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
100 
102 
103  // from base class
104  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
105  virtual QgsSymbolLayerV2* symbolLayer();
106 
107  public slots:
108  void setName();
109  void setColorBorder( const QColor& color );
110  void setColorFill( const QColor& color );
111  void setSize();
112  void setAngle();
113  void setOffset();
114  void on_mSizeUnitWidget_changed();
115  void on_mOffsetUnitWidget_changed();
116  void on_mOutlineWidthUnitWidget_changed();
117  void on_mDataDefinedPropertiesButton_clicked();
118  void on_mOutlineStyleComboBox_currentIndexChanged( int index );
119  void on_mOutlineWidthSpinBox_valueChanged( double d );
120  void on_mHorizontalAnchorComboBox_currentIndexChanged( int index );
121  void on_mVerticalAnchorComboBox_currentIndexChanged( int index );
122 
123  protected:
125 };
126 
128 
129 #include "ui_widget_simplefill.h"
130 
132 
133 class GUI_EXPORT QgsSimpleFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleFill
134 {
135  Q_OBJECT
136 
137  public:
138  QgsSimpleFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
139 
141 
142  // from base class
143  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
144  virtual QgsSymbolLayerV2* symbolLayer();
145 
146  public slots:
147  void setColor( const QColor& color );
148  void setBorderColor( const QColor& color );
149  void setBrushStyle();
150  void borderWidthChanged();
151  void borderStyleChanged();
152  void offsetChanged();
153  void on_mBorderWidthUnitWidget_changed();
154  void on_mOffsetUnitWidget_changed();
155  void on_mDataDefinedPropertiesButton_clicked();
156 
157  protected:
159 };
160 
161 
163 
164 #include "ui_widget_gradientfill.h"
165 
167 
168 class GUI_EXPORT QgsGradientFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetGradientFill
169 {
170  Q_OBJECT
171 
172  public:
173  QgsGradientFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
174 
176 
177  // from base class
178  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
179  virtual QgsSymbolLayerV2* symbolLayer();
180 
181  public slots:
182  void setColor( const QColor& color );
183  void setColor2( const QColor& color );
184  void applyColorRamp();
185  void on_mButtonEditRamp_clicked();
186  void setGradientType( int index );
187  void setCoordinateMode( int index );
188  void setGradientSpread( int index );
189  void offsetChanged();
190  void referencePointChanged();
191  void on_mOffsetUnitWidget_changed();
192  void on_mDataDefinedPropertiesButton_clicked();
193  void colorModeChanged();
194  void on_mSpinAngle_valueChanged( double value );
195 
196  protected:
198 };
199 
201 
202 #include "ui_widget_shapeburstfill.h"
203 
205 
206 class GUI_EXPORT QgsShapeburstFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetShapeburstFill
207 {
208  Q_OBJECT
209 
210  public:
211  QgsShapeburstFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
212 
214 
215  // from base class
216  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
217  virtual QgsSymbolLayerV2* symbolLayer();
218 
219  public slots:
220  void setColor( const QColor& color );
221  void setColor2( const QColor& color );
222  void colorModeChanged();
223  void on_mSpinBlurRadius_valueChanged( int value );
224  void on_mSpinMaxDistance_valueChanged( double value );
225  void on_mDistanceUnitWidget_changed();
226  void on_mRadioUseWholeShape_toggled( bool value );
227  void applyColorRamp();
228  void on_mButtonEditRamp_clicked();
229  void offsetChanged();
230  void on_mOffsetUnitWidget_changed();
231  void on_mDataDefinedPropertiesButton_clicked();
232  void on_mIgnoreRingsCheckBox_stateChanged( int state );
233 
234  protected:
236 };
237 
239 
240 #include "ui_widget_markerline.h"
241 
243 
244 class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetMarkerLine
245 {
246  Q_OBJECT
247 
248  public:
249  QgsMarkerLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
250 
252 
253  // from base class
254  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
255  virtual QgsSymbolLayerV2* symbolLayer();
256 
257  public slots:
258 
259  void setInterval( double val );
260  void setOffsetAlongLine( double val );
261  void setRotate();
262  void setOffset();
263  void setPlacement();
264  void on_mIntervalUnitWidget_changed();
265  void on_mOffsetUnitWidget_changed();
266  void on_mOffsetAlongLineUnitWidget_changed();
267  void on_mDataDefinedPropertiesButton_clicked();
268 
269  protected:
270 
272 };
273 
274 
276 
277 #include "ui_widget_svgmarker.h"
278 
280 
281 class GUI_EXPORT QgsSvgMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSvgMarker
282 {
283  Q_OBJECT
284 
285  public:
286  QgsSvgMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
287 
289 
290  // from base class
291  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
292  virtual QgsSymbolLayerV2* symbolLayer();
293 
294  public slots:
295  void setName( const QModelIndex& idx );
296  void populateIcons( const QModelIndex& idx );
297  void setSize();
298  void setAngle();
299  void setOffset();
300  void on_mFileToolButton_clicked();
301  void on_mFileLineEdit_textEdited( const QString& text );
302  void on_mFileLineEdit_editingFinished();
303  void on_mChangeColorButton_colorChanged( const QColor& color );
304  void on_mChangeBorderColorButton_colorChanged( const QColor& color );
305  void on_mBorderWidthSpinBox_valueChanged( double d );
306  void on_mSizeUnitWidget_changed();
307  void on_mBorderWidthUnitWidget_changed();
308  void on_mOffsetUnitWidget_changed();
309  void on_mDataDefinedPropertiesButton_clicked();
310  void on_mHorizontalAnchorComboBox_currentIndexChanged( int index );
311  void on_mVerticalAnchorComboBox_currentIndexChanged( int index );
312 
313 
314  protected:
315 
316  void populateList();
317  //update gui for svg file (insert new path, update activation of gui elements for svg params)
318  void setGuiForSvg( const QgsSvgMarkerSymbolLayerV2* layer );
319 
321 };
322 
323 
325 
326 #include "ui_widget_svgfill.h"
327 
329 
330 class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetSVGFill
331 {
332  Q_OBJECT
333 
334  public:
335  QgsSVGFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
336 
337  static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsSVGFillSymbolLayerWidget( vl ); }
338 
339  // from base class
340  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
341  virtual QgsSymbolLayerV2* symbolLayer();
342 
343  protected:
345  void insertIcons();
351  void updateParamGui( bool resetValues = true );
352 
353  private slots:
354  void on_mBrowseToolButton_clicked();
355  void on_mTextureWidthSpinBox_valueChanged( double d );
356  void on_mSVGLineEdit_textEdited( const QString & text );
357  void on_mSVGLineEdit_editingFinished();
358  void setFile( const QModelIndex& item );
359  void populateIcons( const QModelIndex& item );
360  void on_mRotationSpinBox_valueChanged( double d );
361  void on_mChangeColorButton_colorChanged( const QColor& color );
362  void on_mChangeBorderColorButton_colorChanged( const QColor& color );
363  void on_mBorderWidthSpinBox_valueChanged( double d );
364  void on_mTextureWidthUnitWidget_changed();
365  void on_mSvgOutlineWidthUnitWidget_changed();
366  void on_mDataDefinedPropertiesButton_clicked();
367 };
368 
370 
371 #include "ui_widget_linepatternfill.h"
372 
374 
375 class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetLinePatternFill
376 {
377  Q_OBJECT
378 
379  public:
380 
381  QgsLinePatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
383 
384  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
385  virtual QgsSymbolLayerV2* symbolLayer();
386 
387  protected:
389 
390  private slots:
391  void on_mAngleSpinBox_valueChanged( double d );
392  void on_mDistanceSpinBox_valueChanged( double d );
393  void on_mOffsetSpinBox_valueChanged( double d );
394  void on_mDistanceUnitWidget_changed();
395  void on_mOffsetUnitWidget_changed();
396  void on_mDataDefinedPropertiesButton_clicked();
397 };
398 
400 
401 #include "ui_widget_pointpatternfill.h"
402 
404 
405 class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerV2Widget, private Ui::WidgetPointPatternFill
406 {
407  Q_OBJECT
408 
409  public:
410  QgsPointPatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
412 
413  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
414  virtual QgsSymbolLayerV2* symbolLayer();
415 
416  protected:
418 
419  private slots:
420  void on_mHorizontalDistanceSpinBox_valueChanged( double d );
421  void on_mVerticalDistanceSpinBox_valueChanged( double d );
422  void on_mHorizontalDisplacementSpinBox_valueChanged( double d );
423  void on_mVerticalDisplacementSpinBox_valueChanged( double d );
424  void on_mHorizontalDistanceUnitWidget_changed();
425  void on_mVerticalDistanceUnitWidget_changed();
426  void on_mHorizontalDisplacementUnitWidget_changed();
427  void on_mVerticalDisplacementUnitWidget_changed();
428  void on_mDataDefinedPropertiesButton_clicked();
429 };
430 
432 
433 #include "ui_widget_fontmarker.h"
434 
436 class CharacterWidget;
437 
438 class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetFontMarker
439 {
440  Q_OBJECT
441 
442  public:
443  QgsFontMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
444 
446 
447  // from base class
448  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
449  virtual QgsSymbolLayerV2* symbolLayer();
450 
451  public slots:
452  void setFontFamily( const QFont& font );
453  void setColor( const QColor& color );
454  void setSize( double size );
455  void setAngle( double angle );
456  void setCharacter( const QChar& chr );
457  void setOffset();
458  void on_mSizeUnitWidget_changed();
459  void on_mOffsetUnitWidget_changed();
460  void on_mHorizontalAnchorComboBox_currentIndexChanged( int index );
461  void on_mVerticalAnchorComboBox_currentIndexChanged( int index );
462 
463  protected:
466 };
467 
469 
470 
471 #include "ui_widget_centroidfill.h"
472 
474 
475 class GUI_EXPORT QgsCentroidFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetCentroidFill
476 {
477  Q_OBJECT
478 
479  public:
480  QgsCentroidFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
481 
483 
484  // from base class
485  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
486  virtual QgsSymbolLayerV2* symbolLayer();
487 
488  public slots:
489  void on_mDrawInsideCheckBox_stateChanged( int state );
490 
491  protected:
493 };
494 
495 
496 #endif
virtual void setSymbolLayer(QgsSymbolLayerV2 *layer)=0
static unsigned index
Definition: mersenne-twister.cpp:36
Definition: qgssymbollayerv2widget.h:244
Definition: qgslinesymbollayerv2.h:33
Definition: qgsfillsymbollayerv2.h:868
CharacterWidget * widgetChar
Definition: qgssymbollayerv2widget.h:465
QgsGradientFillSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:197
QgsSimpleLineSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:82
Definition: qgssymbollayerv2widget.h:375
Definition: qgsfillsymbollayerv2.h:684
QgsLinePatternFillSymbolLayer * mLayer
Definition: qgssymbollayerv2widget.h:388
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:140
QgsFontMarkerSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:464
[0]
Definition: characterwidget.h:62
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:62
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:288
Definition: qgssymbollayerv2widget.h:55
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:175
Definition: qgssymbollayerv2.h:45
Definition: qgssymbollayerv2widget.h:405
const QgsVectorLayer * mVectorLayer
Definition: qgssymbollayerv2widget.h:38
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:482
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:251
Definition: qgsmarkersymbollayerv2.h:149
Definition: qgsfillsymbollayerv2.h:33
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:337
Definition: qgssymbollayerv2widget.h:475
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:445
Definition: qgsfillsymbollayerv2.h:306
QgsPointPatternFillSymbolLayer * mLayer
Definition: qgssymbollayerv2widget.h:417
Definition: qgssymbollayerv2widget.h:26
QgsMarkerLineSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:271
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:101
Definition: qgssymbollayerv2widget.h:206
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QgsCentroidFillSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:492
Definition: qgslinesymbollayerv2.h:147
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:213
QgsSimpleMarkerSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:124
QgsSymbolLayerV2Widget(QWidget *parent, const QgsVectorLayer *vl=0)
Definition: qgssymbollayerv2widget.h:31
Definition: qgssymbollayerv2widget.h:438
Definition: qgssymbollayerv2widget.h:94
A class for svg fill patterns.
Definition: qgsfillsymbollayerv2.h:595
Definition: qgssymbollayerv2widget.h:168
QgsSvgMarkerSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:320
Definition: qgsfillsymbollayerv2.h:149
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:411
Definition: qgssymbollayerv2widget.h:330
virtual QgsSymbolLayerV2 * symbolLayer()=0
Definition: qgsmarkersymbollayerv2.h:229
QgsShapeburstFillSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:235
Definition: qgssymbollayerv2widget.h:281
virtual ~QgsSymbolLayerV2Widget()
Definition: qgssymbollayerv2widget.h:32
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:468
double size
Definition: qgssvgcache.cpp:77
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
Definition: qgssymbollayerv2widget.h:382
Definition: qgsmarkersymbollayerv2.h:34
QgsSVGFillSymbolLayer * mLayer
Definition: qgssymbollayerv2widget.h:344
Definition: qgsfillsymbollayerv2.h:775
QgsSimpleFillSymbolLayerV2 * mLayer
Definition: qgssymbollayerv2widget.h:158
Definition: qgssymbollayerv2widget.h:133