QGIS API Documentation  2.7.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 
324 
325 #include "ui_widget_rasterfill.h"
326 
328 
329 class GUI_EXPORT QgsRasterFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetRasterFill
330 {
331  Q_OBJECT
332 
333  public:
334  QgsRasterFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
335 
337 
338  // from base class
339  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
340  virtual QgsSymbolLayerV2* symbolLayer();
341 
342  protected:
344 
345  private slots:
346  void on_mBrowseToolButton_clicked();
347  void on_mImageLineEdit_editingFinished();
348  void setCoordinateMode( int index );
349  void on_mSpinTransparency_valueChanged( int value );
350  void offsetChanged();
351  void on_mOffsetUnitWidget_changed();
352  void on_mRotationSpinBox_valueChanged( double d );
353  void on_mWidthUnitWidget_changed();
354  void on_mWidthSpinBox_valueChanged( double d );
355  void on_mDataDefinedPropertiesButton_clicked();
356 
357  private:
358  void updatePreviewImage();
359 };
360 
362 
363 #include "ui_widget_svgfill.h"
364 
366 
367 class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetSVGFill
368 {
369  Q_OBJECT
370 
371  public:
372  QgsSVGFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
373 
374  static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsSVGFillSymbolLayerWidget( vl ); }
375 
376  // from base class
377  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
378  virtual QgsSymbolLayerV2* symbolLayer();
379 
380  protected:
382  void insertIcons();
388  void updateParamGui( bool resetValues = true );
389 
390  private slots:
391  void on_mBrowseToolButton_clicked();
392  void on_mTextureWidthSpinBox_valueChanged( double d );
393  void on_mSVGLineEdit_textEdited( const QString & text );
394  void on_mSVGLineEdit_editingFinished();
395  void setFile( const QModelIndex& item );
396  void populateIcons( const QModelIndex& item );
397  void on_mRotationSpinBox_valueChanged( double d );
398  void on_mChangeColorButton_colorChanged( const QColor& color );
399  void on_mChangeBorderColorButton_colorChanged( const QColor& color );
400  void on_mBorderWidthSpinBox_valueChanged( double d );
401  void on_mTextureWidthUnitWidget_changed();
402  void on_mSvgOutlineWidthUnitWidget_changed();
403  void on_mDataDefinedPropertiesButton_clicked();
404 };
405 
407 
408 #include "ui_widget_linepatternfill.h"
409 
411 
412 class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetLinePatternFill
413 {
414  Q_OBJECT
415 
416  public:
417 
418  QgsLinePatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
420 
421  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
422  virtual QgsSymbolLayerV2* symbolLayer();
423 
424  protected:
426 
427  private slots:
428  void on_mAngleSpinBox_valueChanged( double d );
429  void on_mDistanceSpinBox_valueChanged( double d );
430  void on_mOffsetSpinBox_valueChanged( double d );
431  void on_mDistanceUnitWidget_changed();
432  void on_mOffsetUnitWidget_changed();
433  void on_mDataDefinedPropertiesButton_clicked();
434 };
435 
437 
438 #include "ui_widget_pointpatternfill.h"
439 
441 
442 class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerV2Widget, private Ui::WidgetPointPatternFill
443 {
444  Q_OBJECT
445 
446  public:
447  QgsPointPatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
449 
450  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
451  virtual QgsSymbolLayerV2* symbolLayer();
452 
453  protected:
455 
456  private slots:
457  void on_mHorizontalDistanceSpinBox_valueChanged( double d );
458  void on_mVerticalDistanceSpinBox_valueChanged( double d );
459  void on_mHorizontalDisplacementSpinBox_valueChanged( double d );
460  void on_mVerticalDisplacementSpinBox_valueChanged( double d );
461  void on_mHorizontalDistanceUnitWidget_changed();
462  void on_mVerticalDistanceUnitWidget_changed();
463  void on_mHorizontalDisplacementUnitWidget_changed();
464  void on_mVerticalDisplacementUnitWidget_changed();
465  void on_mDataDefinedPropertiesButton_clicked();
466 };
467 
469 
470 #include "ui_widget_fontmarker.h"
471 
473 class CharacterWidget;
474 
475 class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetFontMarker
476 {
477  Q_OBJECT
478 
479  public:
480  QgsFontMarkerSymbolLayerV2Widget( 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 setFontFamily( const QFont& font );
490  void setColor( const QColor& color );
491  void setSize( double size );
492  void setAngle( double angle );
493  void setCharacter( const QChar& chr );
494  void setOffset();
495  void on_mSizeUnitWidget_changed();
496  void on_mOffsetUnitWidget_changed();
497  void on_mHorizontalAnchorComboBox_currentIndexChanged( int index );
498  void on_mVerticalAnchorComboBox_currentIndexChanged( int index );
499 
500  protected:
503 };
504 
506 
507 
508 #include "ui_widget_centroidfill.h"
509 
511 
512 class GUI_EXPORT QgsCentroidFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetCentroidFill
513 {
514  Q_OBJECT
515 
516  public:
517  QgsCentroidFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent = NULL );
518 
520 
521  // from base class
522  virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
523  virtual QgsSymbolLayerV2* symbolLayer();
524 
525  public slots:
526  void on_mDrawInsideCheckBox_stateChanged( int state );
527 
528  protected:
530 };
531 
532 
533 #endif
virtual void setSymbolLayer(QgsSymbolLayerV2 *layer)=0
static unsigned index
QgsGradientFillSymbolLayerV2 * mLayer
QgsSimpleLineSymbolLayerV2 * mLayer
QgsLinePatternFillSymbolLayer * mLayer
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
QgsFontMarkerSymbolLayerV2 * mLayer
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
const QgsVectorLayer * mVectorLayer
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
A class for filling symbols with a repeated raster image.
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
QgsPointPatternFillSymbolLayer * mLayer
QgsRasterFillSymbolLayer * mLayer
QgsMarkerLineSymbolLayerV2 * mLayer
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
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
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
QgsSimpleMarkerSymbolLayerV2 * mLayer
QgsSymbolLayerV2Widget(QWidget *parent, const QgsVectorLayer *vl=0)
A class for svg fill patterns.
QgsSvgMarkerSymbolLayerV2 * mLayer
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
virtual QgsSymbolLayerV2 * symbolLayer()=0
QgsShapeburstFillSymbolLayerV2 * mLayer
Represents a vector layer which manages a vector based data sets.
double size
Definition: qgssvgcache.cpp:77
static QgsSymbolLayerV2Widget * create(const QgsVectorLayer *vl)
QgsSVGFillSymbolLayer * mLayer
QgsSimpleFillSymbolLayerV2 * mLayer