GraphicsPropertyItem.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/process/qt/property/GraphicsPropertyItem.h
22 
23  \brief A base item to represent the graphical task item properties items in property tree.
24  */
25 
26 #ifndef __TERRALIB_PROCESS_QT_INTERNAL_GRAPHICSPROPERTYITEM_H
27 #define __TERRALIB_PROCESS_QT_INTERNAL_GRAPHICSPROPERTYITEM_H
28 
29 #include "../../Config.h"
30 #include "../graphics/AbstractGraphicsItem.h"
31 
32  // TerraLib
33 #include "../../../qt/widgets/propertybrowser/AbstractPropertyItem.h"
34 
35 // Qt
36 #include <QColor>
37 #include <QIcon>
38 #include <QVariant>
39 
40 // QtPropertyBrowser
41 #include <QtPropertyBrowser/QtProperty>
42 
43 
44 
45 namespace te
46 {
47  namespace process
48  {
49  namespace qt
50  {
51  /*!
52  \class GraphicsPropertyItem
53 
54  \brief A base item to represent the graphical task item properties items in property tree.
55  */
56 
58  {
59  Q_OBJECT
60 
61  public:
62 
63  /*! \brief Constructor */
64  GraphicsPropertyItem(QtTreePropertyBrowser* pb, QColor c = QColor());
65 
66  /*! \brief Destructor. */
68 
69  /*! \brief Function used to set the Task. */
71 
72  void addListenerToProperty(QtProperty* p);
73 
74  bool propertyHasListener(QtProperty* p);
75 
76  protected:
77 
78  /*! \brief Function used build toplevel task params properties . */
80 
81  /*! \brief Function used clear task params properties . */
83 
84  QStringList getStylePenNames();
85 
86  QMap<int, QIcon> getStylePenIcons();
87 
88  QStringList getStyleBrushNames();
89 
90  QMap<int, QIcon> getStyleBrushIcons();
91 
92  public slots:
93 
94  virtual void valueChanged(QtProperty* p, const QVariant& qVariant) override;
95 
97 
98  protected:
99 
100  AbstractGraphicsItem* m_item; //!< Terralib process graphical item object.
101 
102  QtProperty* m_penItemProperty; //!< A qt main item for graphical pen properties
103  QtProperty* m_widthPenProperty;
104  QtProperty* m_colorPenProperty;
105  QtProperty* m_stylePenProperty;
106 
107  QtProperty* m_brushItemProperty; //!< A qt main item for graphical brush properties
108  QtProperty* m_colorBrushProperty;
109  QtProperty* m_styleBrushProperty;
110 
111  QtProperty* m_textItemProperty; //!< A qt main item for graphical text properties
112  QtProperty* m_fontProperty;
113 
114 
115  std::map<Qt::PenStyle, std::string> m_penStyleMap;
116  std::map<Qt::BrushStyle, std::string> m_brushStyleMap;
117  };
118  }
119  }
120 }
121 
122 #endif //__TERRALIB_PROCESS_QT_INTERNAL_GRAPHICSPROPERTYITEM_H
An Abstract graphicItem to represents a process Builder item.
A base item to represent the graphical task item properties items in property tree.
void clearProperties()
Function used clear task params properties .
QMap< int, QIcon > getStyleBrushIcons()
std::map< Qt::BrushStyle, std::string > m_brushStyleMap
GraphicsPropertyItem(QtTreePropertyBrowser *pb, QColor c=QColor())
Constructor.
QtProperty * m_brushItemProperty
A qt main item for graphical brush properties.
void setItem(AbstractGraphicsItem *item)
Function used to set the Task.
virtual ~GraphicsPropertyItem()
Destructor.
void buildProperties()
Function used build toplevel task params properties .
bool propertyHasListener(QtProperty *p)
QMap< int, QIcon > getStylePenIcons()
AbstractGraphicsItem * m_item
Terralib process graphical item object.
virtual void valueChanged(QtProperty *p, const QVariant &qVariant) override
std::map< Qt::PenStyle, std::string > m_penStyleMap
QtProperty * m_penItemProperty
A qt main item for graphical pen properties.
QtProperty * m_textItemProperty
A qt main item for graphical text properties.
void onRemovedItem(AbstractGraphicsItem *item)
void addListenerToProperty(QtProperty *p)
A widget used to define the main property items that can be used to describe a se object.
TerraLib.
#define slots
#define TEPROCESSEXPORT
Definition: Config.h:47