Utils.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/Utils.h
22 
23  \brief This file contains utility functions for dealing with Symbology Enconding and Qt concepts.
24  */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_SE_INTERNAL_UTILS_H
27 #define __TERRALIB_QT_WIDGETS_SE_INTERNAL_UTILS_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // STL
33 #include <string>
34 
35 // Forward declarations
36 class QBrush;
37 class QPen;
38 
39 namespace te
40 {
41 // Forward declarations
42  namespace se
43  {
44  class Fill;
45  class Stroke;
46  }
47 
48  namespace xml
49  {
50  class Reader;
51  }
52 
53  namespace qt
54  {
55  namespace widgets
56  {
57 // Forward declaration
58  class Symbol;
59 
60  /*!
61  \brief It configs the given pen based on Symbology Enconding Stroke element.
62 
63  \param pen The pen that will be configured.
64  \param stroke The Symbology Enconding Stroke element that will be used. If NULL, Qt::transparent color will be setted on pen.
65 
66  \note Warning: It consider that the parameters of Stroke element is enconded using a Literal OGC Filter expression.
67  */
68  TEQTWIDGETSEXPORT void Config(QPen& pen, const te::se::Stroke* stroke);
69 
70  /*!
71  \brief It configs the given brush based on Symbology Enconding Fill element.
72 
73  \param brush The brush that will be configured.
74  \param fill The Symbology Enconding Fill element that will be used. If NULL, Qt::transparent color will be setted on brush.
75 
76  \note Warning: It consider that the parameters of Fill element is enconded using a Literal OGC Filter expression.
77  */
78  TEQTWIDGETSEXPORT void Config(QBrush& brush, const te::se::Fill* fill);
79 
80  /*!
81  \brief It reads a symbol library file and put the result on SymbolLibraryManager.
82 
83  \param path The path of the symbol library file.
84  */
85  TEQTWIDGETSEXPORT void ReadSymbolLibrary(const std::string& path);
86 
87  /*!
88  \brief It reads a symbol using the given reader.
89 
90  \return The symbol read.
91  */
93 
94  } // end namespace widgets
95  } // end namespace qt
96 } // end namespace te
97 
98 #endif // __TERRALIB_QT_WIDGETS_SE_INTERNAL_UTILS_H
TEQTWIDGETSEXPORT void Config(QPen &pen, const te::se::Stroke *stroke)
It configs the given pen based on Symbology Enconding Stroke element.
This class models a XML reader object.
Definition: Reader.h:55
TEQTWIDGETSEXPORT Symbol * ReadSymbol(te::xml::Reader &reader)
It reads a symbol using the given reader.
TEQTWIDGETSEXPORT void ReadSymbolLibrary(const std::string &path)
It reads a symbol library file and put the result on SymbolLibraryManager.
URI C++ Library.
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63