All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PointSymbolizerProperty.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/PolygonSymbolizerProperty.cpp
22 
23  \brief A widget used to define the point symbolizer
24  properties, such as:
25  - general
26  - mark
27  - basic fill
28  - basic stroke
29 */
30 
31 
32 #include "../../../se/PointSymbolizer.h"
33 #include "../../../se/Graphic.h"
34 #include "GraphicProperty.h"
36 
37 // Qt
38 #include <QGridLayout>
39 
40 // QtPropertyBrowser
41 #include <QtPropertyBrowser/QtTreePropertyBrowser>
42 #include <QtPropertyBrowser/QtVariantPropertyManager>
43 
44 // STL
45 #include <cassert>
46 
47 te::qt::widgets::PointSymbolizerProperty::PointSymbolizerProperty(QWidget* parent) : m_setLocalSymbol(false), m_symb(new te::se::PointSymbolizer)
48 {
49  QGridLayout* layout = new QGridLayout(this);
50 
51  this->setLayout(layout);
52 
54 
55  layout->addWidget(m_graphProp);
56  layout->setContentsMargins(0,0,0,0);
57 
58  connect(m_graphProp, SIGNAL(graphicChanged()), this, SLOT(onGraphicChanged()));
59 
60  // Setups initial point symbolizer
62 }
63 
65 {
66 }
67 
69 {
70  m_symb = symb;
71 
72  m_setLocalSymbol = true;
73 
74  m_graphProp->setGraphic(m_symb->getGraphic());
75 
76  m_setLocalSymbol = false;
77 }
78 
80 {
81  return m_symb;
82 }
83 
85 {
86  m_symb->setGraphic(m_graphProp->getGraphic());
87 
88  if(!m_setLocalSymbol)
89  emit symbolizerChanged();
90 }
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
te::qt::widgets::GraphicProperty * m_graphProp
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
A widget used to define the general properties of a se object.
te::se::Symbolizer * getSymbolizer() const
Gets the configured point symbolizer element.
void setSymbolizer(te::se::PointSymbolizer *symb)
Sets a point symbolizer element to this widget.
A widget used to define the point symbolizer properties, such as:
PointSymbolizerProperty(QWidget *parent)
Constructor.
te::se::Graphic * getGraphic() const
te::se::PointSymbolizer * m_symb
Point symbolizer element that will be configured by this widget.
void setGraphic(Graphic *graphic)