All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TimeSliderWidget.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of TerraView - A GIS Application.
4 
5  TerraView is free software: you can redistribute it and/or modify
6  it under the terms of the GNU 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  TerraView 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 General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with TerraLib Code Editor. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@dpi.inpe.br>.
18  */
19 
20 /*!
21  \file terralib/qt/af/connectors/TimeSliderWidget.cpp
22 
23  \brief A connector of the te::qt::widgets::TimeSliderWidget used in the Application Framework.
24 */
25 
26 // TerraLib
27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/ObjectIdSet.h"
29 #include "../../../dataaccess/utils/Utils.h"
30 #include "../../../geometry/Geometry.h"
31 #include "../../../geometry/Envelope.h"
32 #include "../../../geometry/Utils.h"
33 #include "../../../maptools/Utils.h"
34 #include "../../../srs/Config.h"
35 #include "../../widgets/st/TimeSliderWidget.h"
36 #include "../../widgets/Utils.h"
37 #include "../events/LayerEvents.h"
38 #include "../events/MapEvents.h"
39 #include "../events/ProjectEvents.h"
40 #include "../events/ToolEvents.h"
41 #include "../ApplicationController.h"
42 #include "../Project.h"
43 #include "../Utils.h"
44 #include "TimeSliderWidget.h"
45 
46 // Qt
47 #include <QContextMenuEvent>
48 #include <QMessageBox>
49 
50 // STL
51 #include <cassert>
52 #include <utility>
53 
55  : QObject(),
56  m_timeSliderWidget(t)
57 {
58  ApplicationController::getInstance().addListener(this);
59 }
60 
62 {
64  delete m_timeSliderWidget;
65 }
66 
68 {
69  return m_timeSliderWidget;
70 }
71 
73 {
74  switch(e->m_id)
75  {
77  {
78  if(m_timeSliderWidget)
79  m_timeSliderWidget->deleteMe();
80  }
81  break;
82 
83  default:
84  return;
85  }
86 }
87 
A base class for application events.
Definition: Event.h:59
te::qt::widgets::TimeSliderWidget * getTimeSliderWidget()
virtual ~TimeSliderWidget()
destructor.
void onApplicationTriggered(te::qt::af::evt::Event *e)
Listener to the application framewrork events.
static ApplicationController & getInstance()
It returns a reference to the singleton instance.
int m_id
Identifier.
Definition: Event.h:70
TimeSliderWidget(te::qt::widgets::TimeSliderWidget *w)
Constructor.
void removeListener(QObject *obj)
Remove the obj from the list of event listeners.
A connector of the te::qt::widgets::TimeSliderWidget class to the Application Framework.
A wdiget used to control the visualization of temporal data.