All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObservationDialog.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/ObservationDialog.cpp
22 
23  \brief A dialog used to define the basic parameters of a new ObservationLayer.
24 */
25 
26 //Terralib
27 #include "../../../dataaccess.h"
28 #include "../../../datatype/Property.h"
29 #include "DoubleListWidget.h"
30 #include "ObservationDialog.h"
32 #include "ui_DoubleListWidgetForm.h"
33 #include "ui_ObservationDialogForm.h"
34 #include "ui_TemporalPropertiesWidgetForm.h"
35 
37  : QDialog(parent, f),
38  m_ui(new Ui::ObservationDialogForm)
39 {
40  m_ui->setupUi(this);
41 
42  // Time Properties Widget
43  te::da::DataSet* dataset = layer->getData().release();
45 
46  //Observed Properties
47  std::vector<std::string> properties;
48 
49  // Creating the properties list. DATETIME_TYPE properties can not be included.
50  for (std::size_t i = 0; i < dataset->getNumProperties(); i++)
51  {
53  {
54  properties.push_back(dataset->getPropertyName(i));
55  }
56  }
57 
58  m_observedPropWidget.reset(new DoubleListWidget(this));
59  m_observedPropWidget->getForm()->m_leftItemsLabel->setText(tr(""));
60  m_observedPropWidget->getForm()->m_rightItemsLabel->setText(tr(""));
61  m_observedPropWidget->setInputValues(properties);
62 
63  // Adjusting the properties' widgets
64  QGridLayout* propLayout = new QGridLayout(m_ui->m_propertiesWidgetFrame);
65  QVBoxLayout *vboxLayout = new QVBoxLayout;
66 
67  propLayout->addWidget(m_propertiesWidget.get());
68  vboxLayout->addWidget(m_observedPropWidget.get());
69  m_ui->m_uniquePropertiesGroupBox->setLayout(vboxLayout);
70  this->layout()->setSizeConstraint(QLayout::SetFixedSize);
71 
72  //connect signal and slots
73  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
74  connect(m_ui->m_helpPushButton, SIGNAL(clicked()), this, SLOT(onHelpPushButtonClicked()));
75 }
76 
78 {
79 }
80 
82 
84 {
85 
86 }
virtual std::string getPropertyName(std::size_t i) const =0
It returns the property name at position pos.
virtual std::size_t getNumProperties() const =0
It returns the number of properties that composes an item of the dataset.
A widget used to adjust a temporal layer&#39;s properties.
std::auto_ptr< DoubleListWidget > m_observedPropWidget
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos.
std::auto_ptr< Ui::ObservationDialogForm > m_ui
The dialog form.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::auto_ptr< TemporalPropertiesWidget > m_propertiesWidget
The widget used to configure the ObservationLayer&#39;s properties.
ObservationDialog(te::map::AbstractLayerPtr layer, QWidget *parent=0, Qt::WindowFlags f=0)
Constructor.
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:111