TimeSeriesStyleWidget.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/timeSeriesStyleWidget.cpp
22 
23  \brief A widget used to adjust a timeSeries's style.
24 */
25 
26 //Terralib
27 #include "../../../se/Stroke.h"
28 #include "../se/BasicStrokeDialog.h"
29 #include "TimeSeriesStyle.h"
30 #include "TimeSeriesStyleWidget.h"
31 #include "ui_TimeSeriesStyleWidgetForm.h"
32 
33 // STL
34 #include <memory>
35 
36 //QT
37 #include <QDialog>
38 
40  : QWidget(parent, f),
41  m_ui(new Ui::TimeSeriesStyleWidgetForm),
42  m_timeSeriesStyle(initial)
43 {
44  m_ui->setupUi(this);
45 
48 
49 // connect signal and slots
50  connect(m_ui->m_strokePushButton, SIGNAL(clicked()), this, SLOT(onStrokePushButtonClicked()));
51 }
52 
54 {
55  delete m_timeSeriesStyle;
56 }
57 
59 {
60  return m_timeSeriesStyle->clone();
61 }
62 
64 {
65  std::unique_ptr<te::se::Stroke> stroke (te::qt::widgets::BasicStrokeDialog::getStroke(m_timeSeriesStyle->getStroke(), nullptr, "Stroke"));
66  if(stroke.get())
67  m_timeSeriesStyle->setStroke(stroke->clone());
68 }
TimeSeriesStyleWidget(te::qt::widgets::TimeSeriesStyle *initial=0, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
A class used to define the style of a TimeSeries&#39;s chart.
void setStroke(te::se::Stroke *newStroke)
It sets the line&#39;s stroke.
std::unique_ptr< Ui::TimeSeriesStyleWidgetForm > m_ui
The iwdget form.
TimeSeriesStyle * m_timeSeriesStyle
The timeSeries&#39;s chart style that will be configured by this widget.
TimeSeriesStyle * clone()
Returns a pointer to a clone of this TimeSeriesStyle.
te::se::Stroke * getStroke() const
Gets the configured stroke element.
te::se::Stroke * getStroke()
Returns a pointer to the line&#39;s stroke.
te::qt::widgets::TimeSeriesStyle * getTimeSeriesStyle()
Returns a pointer to the TimeSeriesStyle being configured.