All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LineSymbolizerProperty.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/LineSymbolizerProperty.cpp
22 
23  \brief A widget used to define the line symbolizer
24  properties, such as:
25  - basic stroke
26 */
27 
28 // TerraLib
29 #include "../../../se/LineSymbolizer.h"
31 #include "LineSymbolizerProperty.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 
44 te::qt::widgets::LineSymbolizerProperty::LineSymbolizerProperty(QWidget* parent) : m_symb(new te::se::LineSymbolizer)
45 {
46  QGridLayout* layout = new QGridLayout(this);
47  this->setLayout(layout);
48 
49  QToolBox* tb = new QToolBox(this);
50  layout->addWidget(tb);
51 
52  QtTreePropertyBrowser* basicPropBrowser = new QtTreePropertyBrowser(this);
53  basicPropBrowser->setIndentation(10);
54  basicPropBrowser->setPropertiesWithoutValueMarked(true);
55  basicPropBrowser->setRootIsDecorated(false);
56  basicPropBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
57 
58  layout->addWidget(basicPropBrowser);
59 
60  m_bs = new te::qt::widgets::BasicStrokePropertyItem(basicPropBrowser);
61 
62  tb->addItem(basicPropBrowser, "Basic Symbology");
63 
64  connect(m_bs, SIGNAL(strokeChanged()), this, SLOT(onStrokeChanged()));
65 }
66 
68 {
69 }
70 
72 {
73  m_symb = symb;
74 
75  if(m_symb->getStroke())
76  m_bs->setStroke(m_symb->getStroke());
77 }
78 
80 {
81  return m_symb;
82 }
83 
85 {
86  m_symb->setStroke(m_bs->getStroke());
87 
88  emit symbolizerChanged();
89 }
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
te::qt::widgets::BasicStrokePropertyItem * m_bs
A widget used to define the line symbolizer properties, such as:
A widget used to define the basic fill se object.
void setStroke(Stroke *stroke)
A Stroke specifies the appearance of a linear geometry. The Stroke element is optional inside of Line...
void setSymbolizer(te::se::LineSymbolizer *symb)
Sets a line symbolizer element to this widget.
te::se::Symbolizer * getSymbolizer() const
Gets the configured line symbolizer element.
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
LineSymbolizerProperty(QWidget *parent)
Constructor.