All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TimeSeriesAction.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/plugins/st/TimeSeriesAction.cpp
22 
23  \brief This file defines the TimeSeriers Action class
24 */
25 
26 //Terralib
27 #include "../../../qt/af/events/LayerEvents.h"
28 #include "../../../qt/widgets/dataset/selector/DataSetSelectorWizardPage.h"
29 #include "../../../qt/widgets/datasource/selector/DataSourceSelectorWizardPage.h"
30 #include "../../../qt/widgets/layer/explorer/AbstractTreeItemFactory.h"
31 #include "../../../qt/widgets/st/TimeSeriesWizard.h"
32 #include "../../../st/loader/STDataLoader.h"
33 #include "../../af/ApplicationController.h"
34 #include "TimeSeriesAction.h"
35 #include "TimeSeriesLayerItem.h"
36 
37 // Qt
38 #include <QMessageBox>
39 
40 //STL
41 #include <memory>
42 
43 // Boost
44 #include <boost/functional/factory.hpp>
45 #include <boost/bind.hpp>
46 
48 : te::qt::plugins::st::AbstractAction(menu)
49 {
50  createAction(tr("Time Series...").toStdString(), "timeseries-layer");
51  te::qt::widgets::AbstractTreeItemFactory::reg("TIMESERIESDATASETLAYER", boost::bind(boost::factory<TimeSeriesLayerItem*>(),_1, _2));
52 }
53 
55 {
56 }
57 
59 {
60  QWidget* parent = te::qt::af::ApplicationController::getInstance().getMainWindow();
61 
62  std::auto_ptr<te::qt::widgets::TimeSeriesWizard> timeWiz;
63  timeWiz.reset( new te::qt::widgets::TimeSeriesWizard(parent));
64 
65  int res = timeWiz->exec();
66  if (res == QDialog::Accepted)
67  {
68  //Initialize STDataLoader support
70 
71  te::qt::af::evt::LayerAdded evt(timeWiz->getTimeSeriesLayer(), 0);
73  }
74 }
This event signals that a new layer was created.
Definition: LayerEvents.h:66
This file defines the TimeSeriers Action class.
static void reg(const std::string &key, const FactoryFnctType &f)
This is an abstract class used to register actions into st pluging.
static void initialize()
It returns the spatial extent of the observations of a coverage series.
virtual void onActionActivated(bool checked)
static ApplicationController & getInstance()
It returns a reference to the singleton instance.
void createAction(std::string name, std::string pixmap="")
Create and set the actions parameters.