All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ScatterStyleWidget.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/charts/scatterStyleWidget.cpp
22 
23  \brief A widget used to adjust a scatter's style.
24 */
25 
26 //Terralib
27 #include "../../../se/Graphic.h"
28 #include "../se/GraphicDialog.h"
29 #include "ScatterStyle.h"
30 #include "ScatterStyleWidget.h"
31 #include "ui_ScatterStyleWidgetForm.h"
32 
33 // STL
34 #include <memory>
35 
36 //QT
37 #include <QDialog>
38 
40  : QWidget(parent, f),
41  m_ui(new Ui::ScatterStyleWidgetForm),
42  m_scatterStyle(initial)
43 {
44  m_ui->setupUi(this);
45 
46  if(!m_scatterStyle)
48 
49 // connect signal and slots
50  connect(m_ui->m_plotStylePushButton, SIGNAL(clicked()), this, SLOT(onPlotStylePushButtonClicked()));
51 }
52 
54 {
55  delete m_scatterStyle;
56 }
57 
59 {
60  return m_scatterStyle->clone();
61 }
62 
64 {
65  std::auto_ptr<te::se::Graphic> graphic(te::qt::widgets::GraphicDialog::getGraphic(m_scatterStyle->getGraphic(), 0, "Scatter Style"));
66  if(graphic.get())
67  m_scatterStyle->setGraphic(graphic->clone());
68 }
ScatterStyleWidget(te::qt::widgets::ScatterStyle *initial=0, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
A class used to define the style of a scatter's chart.
te::qt::widgets::ScatterStyle * getScatterStyle()
Returns a pointer to the ScatterStyle being configured.
te::se::Graphic * getGraphic() const
Gets the configured graphic element.
ScatterStyle * clone()
Returns a pointer to a clone of this ScatterStyle.
A widget used to adjust a scatter's style.
std::auto_ptr< Ui::ScatterStyleWidgetForm > m_ui
The iwdget form.
ScatterStyle * m_scatterStyle
The scatter's chart style that will be configured by this widget.