SymbologyPreview.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/SymbologyPreview.h
22 
23  \brief Static class used to generate preview of Symbology elements.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLOGYPREVIEW_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLOGYPREVIEW_H
28 
29 // TerraLib
30 #include "../../../common/Static.h"
31 #include "../Config.h"
32 
33 // Qt
34 #include <QPixmap>
35 
36 // STL
37 #include <vector>
38 
39 namespace te
40 {
41 // Forward declarations
42  namespace gm
43  {
44  class Geometry;
45  }
46 
47  namespace se
48  {
49  class Rule;
50  class Symbolizer;
51  }
52 
53  namespace qt
54  {
55  namespace widgets
56  {
57 // Forward declaration
58  class Symbol;
59 
61  {
62  public:
63 
64  /*!
65  \brief Generates the preview of given symbolizer element.
66 
67  \param symb A valid symbolizer element.
68  \param size The preview size.
69 
70  \return A pixmap that represents the result of symbolizer preview.
71 
72  \note A default geometry will be created based on symbolizer type and will be used to draw the preview.
73  */
74  static QPixmap build(const te::se::Symbolizer* symb, const QSize& size);
75 
76  /*!
77  \brief Generates the preview of a set of symbolizers elements.
78 
79  \param symbs A set of symbolizers elements.
80  \param size The preview size.
81 
82  \return A pixmap that represents the composite result of symbolizers preview.
83 
84  \note Default geometry will be created based on symbolizers type and will be used to draw the preview.
85  */
86  static QPixmap build(const std::vector<te::se::Symbolizer*>& symbs, const QSize& size);
87 
88  /*!
89  \brief Generates the preview of a set of symbolizers elements included in the given rule.
90 
91  \param rule A valid rule element that will be used to get the set of symbolizers.
92  \param size The preview size.
93 
94  \return A pixmap that represents the composite result of rule's symbolizers preview.
95 
96  \note Default geometries will be created based on symbolizers type and will be used to draw the preview.
97  */
98  static QPixmap build(const te::se::Rule* rule, const QSize& size);
99 
100  /*!
101  \brief Generates the preview of given symbolizer element.
102 
103  \param symb A valid symbolizer element.
104  \param geom The geometry that will be used to draw the preview.
105  \param size The preview size.
106 
107  \return A pixmap that represents the result of symbolizer preview.
108  */
109  static QPixmap build(const te::se::Symbolizer* symb, const te::gm::Geometry* geom, const QSize& size);
110 
111  /*!
112  \brief Generates the preview of a set of symbolizers elements.
113 
114  \param symbs A set of symbolizers elements.
115  \param geom The geometry that will be used to draw the preview.
116  \param size The preview size.
117 
118  \return A pixmap that represents the composite result of symbolizers preview.
119  */
120  static QPixmap build(const std::vector<te::se::Symbolizer*>& symbs, const te::gm::Geometry* geom, const QSize& size);
121 
122  /*!
123  \brief Generates the preview of a set of symbolizers elements included in the given rule.
124 
125  \param rule A valid rule element that will be used to get the set of symbolizers.
126  \param geom The geometry that will be used to draw the preview.
127  \param size The preview size.
128 
129  \return A pixmap that represents the composite result of rule's symbolizers preview.
130  */
131  static QPixmap build(const te::se::Rule* rule, const te::gm::Geometry* geom, const QSize& size);
132 
133  /*!
134  \brief Generates the preview of a symbol.
135 
136  \param symbol A valid symbol.
137  \param geom The geometry that will be used to draw the preview.
138  \param size The preview size.
139 
140  \return A pixmap that represents the symbol preview.
141  */
142  static QPixmap build(const Symbol* symbol, const te::gm::Geometry* geom, const QSize& size);
143  };
144 
145  } // end namespace widgets
146  } // end namespace qt
147 } // end namespace te
148 
149 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_SYMBOLOGYPREVIEW_H
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:73
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
Definition: Rule.h:78
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63
A base type for static classes.
Definition: Static.h:43