All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PointSymbolizerProperty.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 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 "../../../../../third-party/qt/propertybrowser/qtpropertybrowser.h"
39 #include <QtGui/QGridLayout>
40 
41 // STL
42 #include <cassert>
43 
44 te::qt::widgets::PointSymbolizerProperty::PointSymbolizerProperty(QWidget* parent) : m_setLocalSymbol(false), m_symb(new te::se::PointSymbolizer)
45 {
46  QGridLayout* layout = new QGridLayout(this);
47 
48  this->setLayout(layout);
49 
51 
52  layout->addWidget(m_graphProp);
53  layout->setContentsMargins(0,0,0,0);
54 
55  connect(m_graphProp, SIGNAL(graphicChanged()), this, SLOT(onGraphicChanged()));
56 
57  // Setups initial point symbolizer
59 }
60 
62 {
63 }
64 
66 {
67  m_symb = symb;
68 
69  m_setLocalSymbol = true;
70 
71  m_graphProp->setGraphic(m_symb->getGraphic());
72 
73  m_setLocalSymbol = false;
74 }
75 
77 {
78  return m_symb;
79 }
80 
82 {
83  m_symb->setGraphic(m_graphProp->getGraphic());
84 
85  if(!m_setLocalSymbol)
86  emit symbolizerChanged();
87 }
A widget used to define the point symbolizer properties, such as:
PointSymbolizerProperty(QWidget *parent)
Constructor.
te::se::PointSymbolizer * m_symb
Point symbolizer element that will be configured by this widget.
te::se::Graphic * getGraphic() const
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
void setGraphic(Graphic *graphic)
A widget used to define the general properties of a se object.
void setSymbolizer(te::se::PointSymbolizer *symb)
Sets a point symbolizer element to this widget.
te::qt::widgets::GraphicProperty * m_graphProp
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
te::se::Symbolizer * getSymbolizer() const
Gets the configured point symbolizer element.