Loading...
Searching...
No Matches
LegendItem.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5TerraLib is free software: you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation, either version 3 of the License,
8or (at your option) any later version.
9
10TerraLib is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License
16along with TerraLib. See COPYING. If not, write to
17TerraLib Team at <terralib-team@terralib.org>.
18*/
19
20/*!
21 * \file layer/explorer/LegendItem.h
22 *
23 * \brief Defines a legend item.
24 */
25#ifndef __TERRALIB_QT_WIDGETS_LAYER_INTERNAL_LEGENDITEM_H
26#define __TERRALIB_QT_WIDGETS_LAYER_INTERNAL_LEGENDITEM_H
27
28#include "TreeItem.h"
29
30// Qt
31#include <QIcon>
32
33// Forward declarations
34namespace te
35{
36 namespace se
37 {
38 class Rule;
39 class Symbolizer;
40 }
41
42 namespace qt
43 {
44 namespace widgets
45 {
46 /*!
47 * \class LegendItem
48 *
49 * \brief Represents a lengend in the tree structure.
50 *
51 * \note The type of the item is "LEGEND".
52 */
54 {
55 public:
56 /*!
57 * \name Instantiation Methods
58 *
59 * Methods related to creation and destruction of the object.
60 */
61 //@{
62
63 /*!
64 * \brief Constructor.
65 *
66 * \param rule The Rule that defines the legend item.
67 */
69
70 /*!
71 * \brief Constructor.
72 *
73 * \param label The label to be presented.
74 *
75 * \param symbolizers List of symbolizers used to create the icon.
76 */
77 LegendItem(const std::string& label, const std::vector<te::se::Symbolizer*>& symbolizers);
78
79 /*!
80 * \brief Destructor.
81 */
83 //@}
84
85 /*!
86 * \name Reimplementation of TreeItem
87 *
88 * Methods reimplemented of the TreeItem class.
89 */
90 //@{
91 std::string getAsString() const;
92
93 Qt::ItemFlags flags();
94 //@}
95
96 /*!
97 * \brief Returns the image of the style as an icon.
98 *
99 * \return The style as an icon.
100 */
101 QIcon getIcon() const;
102
103 /*!
104 * \brief updateSymbol
105 * \param symbolizers
106 */
107 void updateSymbol(const te::se::Rule* rule);
108
109 void updateSymbol(const std::vector<te::se::Symbolizer*>& symbolizers);
110
111 protected:
112
113 std::string m_label; //!< Label for presenting in the Qt view.
114 QIcon m_icon; //!< Item icon.
115 };
116 }
117 }
118}
119
120#endif //__TERRALIB_QT_WIDGETS_LAYER_INTERNAL_LEGENDITEM_H
Represents a lengend in the tree structure.
Definition: LegendItem.h:54
Qt::ItemFlags flags()
Returns the flags to be used by the model.
LegendItem(const std::string &label, const std::vector< te::se::Symbolizer * > &symbolizers)
Constructor.
void updateSymbol(const te::se::Rule *rule)
updateSymbol
std::string getAsString() const
Returns the label of the item to be presented in a Qt view.
QIcon getIcon() const
Returns the image of the style as an icon.
LegendItem(const te::se::Rule *rule)
Constructor.
void updateSymbol(const std::vector< te::se::Symbolizer * > &symbolizers)
QIcon m_icon
Item icon.
Definition: LegendItem.h:114
std::string m_label
Label for presenting in the Qt view.
Definition: LegendItem.h:113
Defines a hierarchical structure.
Definition: TreeItem.h:73
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
Definition: Rule.h:77
TerraLib.
Defines an hierarquical structure.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63