SymbolPreviewWidget.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/SymbolPreviewWidget.h
22 
23  \brief A widget used to preview symbol elements.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLPREVIEWWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLPREVIEWWIDGET_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QWidget>
34 
35 // STL
36 #include <vector>
37 
38 // Forward declarations
39 class QLabel;
40 
41 namespace te
42 {
43 // Forward declaration
44  namespace gm
45  {
46  class Geometry;
47  }
48 
49  namespace qt
50  {
51  namespace widgets
52  {
53 // Forward declaration
54  class Symbol;
55 
56  /*!
57  \class SymbolPreviewWidget
58 
59  \brief A widget used to preview symbol elements.
60  */
61  class TEQTWIDGETSEXPORT SymbolPreviewWidget : public QWidget
62  {
63  public:
64 
65  /** @name Initializer Methods
66  * Methods related to instantiation and destruction.
67  */
68  //@{
69 
70  /*!
71  \brief Constructs a symbol preview widget with fixed size, which is a child of parent, with widget flags set to f.
72 
73  \param size The preview size.
74  \param parent The widget's parent.
75  */
76  SymbolPreviewWidget(const QSize& size, QWidget* parent = 0);
77 
78  /*! \brief Destructor. */
80 
81  //@}
82 
83  public:
84 
85  /*!
86  \brief Preview a symbol element.
87 
88  \param symb A valid symbol element.
89 
90  \note The widget will NOT take the ownership of the given symbol.
91  */
92  void updatePreview(Symbol* symbol);
93 
94  /*!
95  \brief Preview a set of symbolizer elements.
96 
97  \param symbolizers The set of symbolizer elements.
98 
99  \note The widget will NOT take the ownership of the given symbolizers.
100  */
101  void updatePreview(const std::vector<te::se::Symbolizer*>& symbolizers);
102 
103  /*!
104  \brief Preview a symbolizer element.
105 
106  \param symb A valid symbolizer element.
107 
108  \note The widget will NOT take the ownership of the given symbolizer.
109  */
110  void updatePreview(te::se::Symbolizer* symbolizer);
111 
112  /*!
113  \brief Clear the preview symbolizer.
114  */
115  void clear();
116 
117  private:
118 
119  QLabel* m_previewLabel; //!< Qt element that will be used to visualize preview result.
120  te::gm::Geometry* m_geom; //!< Geometry used to draw the preview.
121  QSize m_size; //!< Preview size.
122  };
123 
124  } // end namespace widgets
125  } // end namespace qt
126 } // end namespace te
127 
128 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLPREVIEWWIDGET_H
te::gm::Geometry * m_geom
Geometry used to draw the preview.
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
URI C++ Library.
This class represents a symbol. TODO: More description!
Definition: Symbol.h:54
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
QLabel * m_previewLabel
Qt element that will be used to visualize preview result.
A widget used to preview symbol elements.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63