All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Plugin.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/Plugin.cpp
22 
23  \brief Plugin implementation for the st Qt Plugin widget.
24 */
25 
26 // TerraLib
27 #include "../../../common/Config.h"
28 #include "../../../common/Translator.h"
29 #include "../../../common/Logger.h"
30 #include "../../af/ApplicationController.h"
31 #include "Plugin.h"
32 
33 #ifdef TE_QT_PLUGIN_ST_HAVE_SLIDER
34  #include "TimeSliderWidgetAction.h"
35 #endif
36 
37 #ifdef TE_QT_PLUGIN_ST_HAVE_OBSERVATION
38  #include "ObservationAction.h"
39 #endif
40 
41 #ifdef TE_QT_PLUGIN_ST_HAVE_TIMESERIES
42  #include "TimeSeriesAction.h"
43 #endif
44 
45 #ifdef TE_QT_PLUGIN_ST_HAVE_TRAJECTORY
46  #include "TrajectoryAction.h"
47 #endif
48 
49 // QT
50 #include <QMenu>
51 #include <QMenuBar>
52 
54  : te::plugin::Plugin(pluginInfo), m_stMenu(0)
55 {
56 }
57 
59 {
60 }
61 
63 {
64  if(m_initialized)
65  return;
66 
67 // it initializes the Translator support for the TerraLib st Qt Plugin
68  //TE_ADD_TEXT_DOMAIN(TE_QT_PLUGIN_ST_TEXT_DOMAIN, TE_QT_PLUGIN_ST_TEXT_DOMAIN_DIR, "UTF-8");
69 
70  TE_LOG_TRACE(TE_TR("TerraLib Qt ST Plugin startup!"));
71 
72 // add plugin menu
73  m_stMenu = te::qt::af::ApplicationController::getInstance().getMenu("Project.Add Layer.Add Temporal Layer");
74 
75  m_stMenu->setTitle(TE_TR("Add Temporal Layer"));
76 
77 // register actions
78  registerActions();
79 
80  m_initialized = true;
81 }
82 
84 {
85  if(!m_initialized)
86  return;
87 
88 // unregister actions
89  unRegisterActions();
90 
91 // remove menu
92  delete m_stMenu;
93 
94  TE_LOG_TRACE(TE_TR("TerraLib Qt ST Plugin shutdown!"));
95 
96  m_initialized = false;
97 }
98 
100 {
101 #ifdef TE_QT_PLUGIN_ST_HAVE_SLIDER
103 #endif
104 
105 #ifdef TE_QT_PLUGIN_ST_HAVE_OBSERVATION
106  m_observactionAction = new te::qt::plugins::st::ObservationAction(m_stMenu);
107 #endif
108 
109 #ifdef TE_QT_PLUGIN_ST_HAVE_TIMESERIES
110  m_timeSeriesAction = new te::qt::plugins::st::TimeSeriesAction(m_stMenu);
111 #endif
112 
113 #ifdef TE_QT_PLUGIN_ST_HAVE_TRAJECTORY
114  m_trajectoryAction = new te::qt::plugins::st::TrajectoryAction(m_stMenu);
115 #endif
116 }
117 
119 {
120 #ifdef TE_QT_PLUGIN_ST_HAVE_SLIDER
121  delete m_sliderAction;
122 #endif
123 
124 #ifdef TE_QT_PLUGIN_ST_HAVE_OBSERVATION
125  delete m_observactionAction;
126 #endif
127 
128 #ifdef TE_QT_PLUGIN_ST_HAVE_TIMESERIES
129  delete m_timeSeriesAction;
130 #endif
131 
132 #ifdef TE_QT_PLUGIN_ST_HAVE_TRAJECTORY
133  delete m_trajectoryAction;
134 #endif
135 }
136 
#define TE_LOG_TRACE(msg)
Use this tag in order to log a message to a specified logger with the TRACE level.
Definition: Logger.h:137
void unRegisterActions()
Function used to unregister all raster processing actions.
Definition: Plugin.cpp:118
This file defines the TimeSeriers Action class.
This class register the time series action into the St plugin.
Plugin(const te::plugin::PluginInfo &pluginInfo)
Definition: Plugin.cpp:53
#define TE_TR(message)
It marks a string in order to get translated.
Definition: Translator.h:347
void registerActions()
Function used to register all raster processing actions.
Definition: Plugin.cpp:99
Plugin implementation for the ST Qt Plugin widget.
#define PLUGIN_CALL_BACK_IMPL(PLUGIN_CLASS_NAME)
This macro should be used by C++ plugins in order to declare the exportable/callable DLL function...
Definition: Config.h:57
static ApplicationController & getInstance()
It returns a reference to the singleton instance.
This class register the contrast action into TIMESLIDERWIDGET Plugin.
void startup()
Do nothing! Just set plugin as started.
Definition: Plugin.cpp:62
void shutdown()
Do nothing! Just set plugin as stopped.
Definition: Plugin.cpp:83
This class register the observation action into the St plugin.
~Plugin()
Virtual destructor.
Definition: Plugin.cpp:58
This file defines the Trajectory Action class.
The basic information about a plugin.
Definition: PluginInfo.h:61