All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Plugin.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 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/vp/Plugin.cpp
22 
23  \brief Plugin implementation for the VP 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 "AggregationAction.h"
32 //#include "BasicGeographicOperationAction.h"
33 #include "BufferAction.h"
34 #include "IntersectionAction.h"
35 #include "Plugin.h"
36 //#include "PolygonToLineAction.h"
37 //#include "SummarizationAction.h"
38 //#include "TransformationAction.h"
39 
40 // QT
41 #include <QtGui/QMenu>
42 #include <QtGui/QMenuBar>
43 
45  : te::plugin::Plugin(pluginInfo), m_vpMenu(0)
46 {
47 }
48 
50 {
51 }
52 
54 {
55  if(m_initialized)
56  return;
57 
58 // it initializes the Translator support for the TerraLib VP Qt Plugin
60 
61  TE_LOG_TRACE(TE_QT_PLUGIN_VP("TerraLib Qt VP Plugin startup!"));
62 
63 // add plugin menu
65 
66  m_vpMenu->setTitle(TE_QT_PLUGIN_VP("Vector Processing"));
67 
68 // register actions
69  registerActions();
70 
71  m_initialized = true;
72 }
73 
75 {
76  if(!m_initialized)
77  return;
78 
79 // remove menu
80  delete m_vpMenu;
81 
82 // unregister actions
83  unRegisterActions();
84 
85  TE_LOG_TRACE(TE_QT_PLUGIN_VP("TerraLib Qt VP Plugin shutdown!"));
86 
87  m_initialized = false;
88 }
89 
91 {
92  m_aggregation = new te::qt::plugins::vp::AggregationAction(m_vpMenu);
93  //m_basicGeographicOperation = new te::qt::plugins::vp::BasicGeographicOperationAction(m_vpMenu);
94  m_buffer = new te::qt::plugins::vp::BufferAction(m_vpMenu);
95  m_intersection = new te::qt::plugins::vp::IntersectionAction(m_vpMenu);
96  //m_polygonToLine = new te::qt::plugins::vp::PolygonToLineAction(m_vpMenu);
97  //m_summarization = new te::qt::plugins::vp::SummarizationAction(m_vpMenu);
98  //m_transformation = new te::qt::plugins::vp::TransformationAction(m_vpMenu);
99 }
100 
102 {
103  delete m_aggregation;
104  //delete m_basicGeographicOperation;
105  delete m_buffer;
106  delete m_intersection;
107  //delete m_polygonToLine;
108  //delete m_summarization;
109  //delete m_transformation;
110 }
111 
#define TE_QT_PLUGIN_VP_TEXT_DOMAIN
It contains the name of the text domain used in the translation of messages in TerraLib VP Qt Plugin ...
Definition: Config.h:44
The basic information about a plugin.
Definition: PluginInfo.h:61
This file defines the Intersection class.
This class register the contrast action into VP Plugin.
This file defines the Aggregation class.
Plugin(const te::plugin::PluginInfo &pluginInfo)
Definition: Plugin.cpp:44
This class register the contrast action into VP Plugin.
static ApplicationController & getInstance()
It gives access to the controller singleton.
void startup()
Do nothing! Just set plugin as started.
Definition: Plugin.cpp:53
void unRegisterActions()
Function used to unregister all raster processing actions.
Definition: Plugin.cpp:101
#define TE_LOG_TRACE(msg)
Use this tag in order to log a message to a specified logger with the TRACE level.
Definition: Config.h:418
#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
#define TE_QT_PLUGIN_VP_TEXT_DOMAIN_DIR
It contains the translation catalog directory.
Definition: Config.h:51
~Plugin()
Virtual destructor.
Definition: Plugin.cpp:49
#define TE_ADD_TEXT_DOMAIN(domain, domaindir, codeset)
It adds the given text domain located at domain-dir with the given codeset to the multilingual system...
Definition: Config.h:118
This file defines the Buffer class.
Plugin implementation for the VP Qt Plugin widget.
void shutdown()
Do nothing! Just set plugin as stopped.
Definition: Plugin.cpp:74
#define TE_QT_PLUGIN_VP(message)
It marks a string in order to get translated. This is a special mark used in the VP QtPlugin of Terra...
Definition: Config.h:58
void registerActions()
Function used to register all raster processing actions.
Definition: Plugin.cpp:90
This class register the contrast action into VP Plugin.
Definition: BufferAction.h:47
QMenu * getMenu(const QString &id)
Returns a menu registered with key id.