StyleDockWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/se/StyleDockWidget.h
22 
23  \brief A dock widget used control the geographic data style using SE elements and a property browser to show its properties.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_STYLEDOCKWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_STYLEDOCKWIDGET_H
28 
29 // TerraLib
30 #ifndef Q_MOC_RUN
31 #include "../../../se.h"
32 #include "../InterfaceController.h"
33 #endif
34 #include "../Config.h"
35 
36 // Qt
37 #include <QDockWidget>
38 #include <QTabWidget>
39 
40 namespace te
41 {
42  namespace map {class AbstractLayer; }
43 
44  namespace se { class Symbolizer; }
45 
46  namespace qt
47  {
48  namespace widgets
49  {
50  // Forward declarations
51  class MapDisplay;
52  class RuleProperty;
53  class PolygonSymbolizerProperty;
54  class LineSymbolizerProperty;
55  class PointSymbolizerProperty;
56  class TextSymbolizerProperty;
57  class RasterSymbolizerWidget;
58  class StyleControllerWidget;
59 
60  /*!
61  \class StyleDockWidget
62 
63  \brief A dock widget used control the geographic data style using SE elements and a property browser to show its properties.
64  */
65  class TEQTWIDGETSEXPORT StyleDockWidget : public QDockWidget, public InterfaceController
66  {
67  Q_OBJECT
68 
69  public:
70 
71  /** @name Initializer Methods
72  * Methods related to instantiation and destruction.
73  */
74  //@{
75 
76  /*! \brief Constructs a StyleDockWidget. */
77  StyleDockWidget(QWidget* parent = 0, Qt::WindowFlags flags = 0);
78 
79  /*! \brief Destructor. */
81 
82  //@}
83 
84  public:
85 
86  /*!
87  \brief Sets a style element to this widget.
88 
89  \param style A valid style element.
90  \param layer A valid layer element.
91 
92  \note The widget will NOT take the ownership of the given pointers.
93  */
94  void setLayer(te::map::AbstractLayer* layer, te::se::Style* style, bool isSelectionStyle);
95 
96  void updateRule(te::se::Rule* rule);
97 
99 
100  void setTabStatus(bool status);
101 
102  public:
103 
104  /*!
105  \brief This method is used to set current layer
106 
107  */
109 
110  /*!
111  \brief This method is used to add a new layer
112 
113  */
115 
116  /*!
117  \brief This method is used to remove a layer
118 
119  */
121 
123 
124  void clear();
125 
126 
127  protected:
128 
129  void updateUi();
130 
131  QWidget* buildUi();
132 
133  protected slots:
134 
136 
138 
139  void onStyleImported(te::se::Style* style, bool isVisual);
140 
145  void onRasterContrastChanged(bool remove);
147  void onMapRefresh();
149 
150  void onChangeVisibleState(bool visible);
151 
152  signals:
153 
155 
157 
159 
160  private:
161 
162  QTabWidget* m_tabWidget;
163 
171 
172  te::map::AbstractLayer* m_currentLayer; //!< Current Layer pointer (used for raster symbolizer information)
173  };
174 
175  } // end namespace widgets
176  } // end namespace qt
177 } // end namespace te
178 
179 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_STYLEDOCKWIDGET_H
This is the base class for layers.
Definition: AbstractLayer.h:78
A virtual class for non modal interfaces.
A widget used to define the polygon symbolizer properties, such as:
A widget to control the display of a set of layers.
Definition: MapDisplay.h:72
A widget used to define the point symbolizer properties, such as:
A widget used to define the polygon symbolizer properties, such as:
A widget used to configure a Raster Symbolizer SE element.
A widget used to define the rule properties, such as:
Definition: RuleProperty.h:62
A widget used to controll the style se element.
A dock widget used control the geographic data style using SE elements and a property browser to show...
void onChangeVisibleState(bool visible)
void onStyleImported(te::se::Style *style, bool isVisual)
void setLayer(te::map::AbstractLayer *layer, te::se::Style *style, bool isSelectionStyle)
Sets a style element to this widget.
virtual void layerSelected(te::map::AbstractLayerPtr layer)
This method is used to set current layer.
void symbolChanged(te::map::AbstractLayer *l)
void symbolizerChanged(te::se::Symbolizer *s)
virtual void layerRemoved(te::map::AbstractLayerPtr layer)
This method is used to remove a layer.
void onSymbolizerSelected(te::se::Symbolizer *s)
StyleDockWidget(QWidget *parent=0, Qt::WindowFlags flags=0)
Constructs a StyleDockWidget.
te::map::AbstractLayer * getLayer()
void onRasterContrastChanged(bool remove)
te::qt::widgets::StyleControllerWidget * m_styleController
te::qt::widgets::TextSymbolizerProperty * m_textWidget
void updateRule(te::se::Rule *rule)
te::qt::widgets::PolygonSymbolizerProperty * m_polyWidget
te::qt::widgets::RuleProperty * m_ruleWidget
void onRuleSelected(te::se::Rule *r)
te::qt::widgets::LineSymbolizerProperty * m_lineWidget
te::qt::widgets::PointSymbolizerProperty * m_pointWidget
te::qt::widgets::RasterSymbolizerWidget * m_rasterWidget
virtual void layerAdded(te::map::AbstractLayerPtr layer)
This method is used to add a new layer.
te::map::AbstractLayer * m_currentLayer
Current Layer pointer (used for raster symbolizer information)
void setMapDisplay(te::qt::widgets::MapDisplay *display)
A widget used to define the text symbolizer properties, such as:
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
Definition: Rule.h:77
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:66
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:81
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
TerraLib.
#define slots
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63