RuleProperty.cpp
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/RuleProperty.cpp
22 
23 \brief A widget used to define the rule properties, such as:
24 - scale
25 - description
26 */
27 
28 // Terralib
29 #include "../../../se/Rule.h"
30 #include "RuleProperty.h"
31 #include "ScalePropertyItem.h"
32 
33 // Qt
34 #include <QGridLayout>
35 #include <QToolBox>
36 
37 // QtPropertyBrowser
38 #include <QtPropertyBrowser/QtTreePropertyBrowser>
39 #include <QtPropertyBrowser/QtVariantPropertyManager>
40 
41 // STL
42 #include <cassert>
43 
45  : m_rule(nullptr)
46 {
47  QGridLayout* layout = new QGridLayout(this);
48  this->setLayout(layout);
49 
50  QToolBox* tb = new QToolBox(this);
51  layout->addWidget(tb);
52 
53  QtTreePropertyBrowser* propBrowser = new QtTreePropertyBrowser(this);
54  propBrowser->setIndentation(10);
55  propBrowser->setPropertiesWithoutValueMarked(true);
56  propBrowser->setRootIsDecorated(false);
57  propBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
58 
59  layout->addWidget(propBrowser);
60 
61  m_sp = new te::qt::widgets::ScalePropertyItem(propBrowser);
62 
63  tb->addItem(propBrowser, "Rule Properties");
64 
65  connect(m_sp, SIGNAL(scaleMinChanged()), this, SLOT(onScaleMinChanged()));
66  connect(m_sp, SIGNAL(scaleMaxChanged()), this, SLOT(onScaleMaxChanged()));
67 }
68 
70 
72 {
73  m_rule = rule;
74 
76 
78 }
79 
81 {
82  return m_rule;
83 }
84 
86 {
87  if (m_rule)
88  {
90  }
91 }
92 
94 {
95  if (m_rule)
96  {
98  }
99 }
void setRule(te::se::Rule *rule)
Sets a polygon symbolizer element to this widget.
te::qt::widgets::ScalePropertyItem * m_sp
Definition: RuleProperty.h:112
A widget used to define the rule properties, such as:
const double & getMinScaleDenominator() const
Definition: Rule.cpp:123
void setMaxScaleDenominator(const double &maxScaleDenominator)
Definition: Rule.cpp:128
te::se::Rule * m_rule
Rule element that will be configured by this widget.
Definition: RuleProperty.h:114
void setMaxScaleDenominator(const double &value)
A widget used to define the scale values.
te::se::Rule * getRule() const
Gets the configured polygon symbolizer element.
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
Definition: Rule.h:76
void setMinScaleDenominator(const double &value)
RuleProperty(QWidget *parent)
Constructor.
void setMinScaleDenominator(const double &minScaleDenominator)
Definition: Rule.cpp:118
const double & getMaxScaleDenominator() const
Definition: Rule.cpp:133
A widget used to define the scale values.