All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ApplicationListener.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 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/plugins/ApplicationListener.cpp
22 
23  \brief A listener of application framework. It is used to listen events sent by the application framework.
24 */
25 
26 // TerraLib
27 #include "../../../edit/SnapManager.h"
28 #include "../../../qt/widgets/canvas/MapDisplay.h"
29 #include "../../af/events/LayerEvents.h"
30 #include "../../af/events/MapEvents.h"
31 #include "ApplicationListener.h"
32 
34 {
35 }
36 
38 {
39 }
40 
42 {
43  switch(e->m_id)
44  {
46  {
48 
50 
51  const te::gm::Envelope& env = display->getExtent();
52 
53  te::edit::SnapManager::getInstance().setWorld(env.m_llx, env.m_lly, env.m_urx, env.m_ury, display->getWidth(), display->getHeight());
54  }
55  break;
56 
57  default:
58  return;
59  }
60 }
unsigned int getWidth() const
It returns the MapDisplay current width in pixels.
Definition: MapDisplay.cpp:191
te::qt::af::MapDisplay * m_display
Definition: MapEvents.h:126
A base class for application events.
Definition: Event.h:59
te::qt::widgets::MapDisplay * getDisplay()
Definition: MapDisplay.cpp:116
double m_urx
Upper right corner x-coordinate.
Definition: Envelope.h:346
A widget to control the display of a set of layers.
Definition: MapDisplay.h:66
double m_llx
Lower left corner x-coordinate.
Definition: Envelope.h:344
static T & getInstance()
It returns a reference to the singleton instance.
Definition: Singleton.h:120
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
int m_id
Identifier.
Definition: Event.h:70
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
Definition: MapDisplay.cpp:63
ApplicationListener()
It initializes the singleton instance of the application framework listener.
void onApplicationTriggered(te::qt::af::evt::Event *e)
double m_lly
Lower left corner y-coordinate.
Definition: Envelope.h:345
This event is used to inform that drawing is finished.
Definition: MapEvents.h:115
unsigned int getHeight() const
It returns the MapDisplay current height in pixels.
Definition: MapDisplay.cpp:196
double m_ury
Upper right corner y-coordinate.
Definition: Envelope.h:347