All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ScatterStyleWidget.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2010-2013 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 "ui_ScatterStyleWidgetForm.h"
28 #include "ScatterStyle.h"
29 #include "ScatterStyleWidget.h"
30 #include "../../../se/Graphic.h"
31 #include "GraphicDialog.h"
32 
33 //QT
34 #include <qdialog.h>
35 
36 #include <memory>
37 
39  : QWidget(parent, f),
40  m_ui(new Ui::ScatterStyleWidgetForm),
41  m_scatterStyle(initial)
42 {
43  m_ui->setupUi(this);
44 
45  if(!m_scatterStyle)
47 
48 // connect signal and slots
49  connect(m_ui->m_plotStylePushButton, SIGNAL(clicked()), this, SLOT(onPlotStylePushButtonClicked()));
50 }
51 
53 {
54  delete m_scatterStyle;
55 }
56 
58 {
59  return m_scatterStyle->clone();
60 }
61 
63 {
64  std::auto_ptr<te::se::Graphic> graphic(te::qt::widgets::GraphicDialog::getGraphic(m_scatterStyle->getGraphic(), 0, "Scatter Style"));
65  if(graphic.get())
66  m_scatterStyle->setGraphic(graphic->clone());
67 }
ScatterStyleWidget(te::qt::widgets::ScatterStyle *initial=0, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
te::qt::widgets::ScatterStyle * getScatterStyle()
Returns a pointer to the ScatterStyle being configured.
ScatterStyle * clone()
Returns a pointer to a clone of this ScatterStyle.
te::se::Graphic * getGraphic() const
Gets the configured graphic element.
std::auto_ptr< Ui::ScatterStyleWidgetForm > m_ui
The iwdget form.
ScatterStyle * m_scatterStyle
The scatter&#39;s chart style that will be configured by this widget.
A dialog used to build a graphic element.