Loading...
Searching...
No Matches
RuleItem.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/RuleItem.h
22 *
23 * \brief Defines a rule item.
24 */
25#ifndef __TERRALIB_QT_WIDGETS_LAYER_INTERNAL_RULEITEM_H
26#define __TERRALIB_QT_WIDGETS_LAYER_INTERNAL_RULEITEM_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 RuleItem
48 *
49 * \brief Represents a lengend in the tree structure.
50 *
51 * \note The type of the item is "RULE".
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 Destructor.
72 */
74 //@}
75
76 /*!
77 * \name Reimplementation of TreeItem
78 *
79 * Methods reimplemented of the TreeItem class.
80 */
81 //@{
82 std::string getAsString() const;
83
84 Qt::ItemFlags flags();
85
87
88 void setVisible(const VISIBLE& visible, const bool& updateAncestors = false, const bool& updateDescendents = false);
89
90 std::string getToolTip() const;
91
93 //@}
94
95 /*!
96 * \brief Returns the image of the style as an icon.
97 *
98 * \return The style as an icon.
99 */
100 QIcon getIcon() const;
101
102 /*!
103 * \brief updateSymbol
104 * \param symbolizers
105 */
106 void updateSymbol(const te::se::Rule* rule);
107
108 void updateSymbol(const std::vector<te::se::Symbolizer*>& symbolizers);
109
110 protected:
111
112 std::string m_label; //!< Label for presenting in the Qt view.
113 QIcon m_icon; //!< Item icon.
114 te::se::Rule* m_rule; //!< Rule being used.
115 };
116 }
117 }
118}
119
120#endif //__TERRALIB_QT_WIDGETS_LAYER_INTERNAL_RULEITEM_H
Represents a lengend in the tree structure.
Definition: RuleItem.h:54
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.
void setVisible(const VISIBLE &visible, const bool &updateAncestors=false, const bool &updateDescendents=false)
Updates the visibilty state of the item.
Qt::ItemFlags flags()
Returns the flags to be used by the model.
std::string getToolTip() const
Returns the item tooltip (for information purposes).
te::se::Rule * m_rule
Rule being used.
Definition: RuleItem.h:114
te::se::Rule * getRule()
void updateSymbol(const te::se::Rule *rule)
updateSymbol
void updateSymbol(const std::vector< te::se::Symbolizer * > &symbolizers)
std::string m_label
Label for presenting in the Qt view.
Definition: RuleItem.h:112
RuleItem(te::se::Rule *rule)
Constructor.
QIcon m_icon
Item icon.
Definition: RuleItem.h:113
VISIBLE isVisible() const
Returns the visibilty state of the item.
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
VISIBLE
Defines the visibility of an item.
Definition: TreeItem.h:59
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