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 
36 // Qt
37 #include <QMessageBox>
38 
39 //STL
40 #include <memory>
41 
42 // Boost
43 #include <boost/functional/factory.hpp>
44 #include <boost/bind.hpp>
45 
47 : te::qt::plugins::st::AbstractAction(menu)
48 {
49  createAction(tr("Time Series...").toUtf8().data(), "timeseries-layer");
50 // te::qt::widgets::AbstractTreeItemFactory::reg("TIMESERIESDATASETLAYER", boost::bind(boost::factory<TimeSeriesLayerItem*>(),_1, _2));
51 }
52 
54 
56 {
57  QWidget* parent = te::qt::af::AppCtrlSingleton::getInstance().getMainWindow();
58 
59  std::auto_ptr<te::qt::widgets::TimeSeriesWizard> timeWiz;
60  timeWiz.reset( new te::qt::widgets::TimeSeriesWizard(parent));
61 
62  int res = timeWiz->exec();
63  if (res == QDialog::Accepted)
64  {
65  //Initialize STDataLoader support
67 
68  te::qt::af::evt::LayerAdded evt(timeWiz->getTimeSeriesLayer(), 0);
69  emit triggered(&evt);
70  }
71 }
This event signals that a new layer was created.
Definition: LayerEvents.h:71
This file defines the TimeSeriers Action class.
This is an abstract class used to register actions into st pluging.
void triggered(te::qt::af::evt::Event *e)
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.
URI C++ Library.
Definition: Attributes.h:37
void createAction(std::string name, std::string pixmap="")
Create and set the actions parameters.