All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StyleExplorer.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 // TerraLib
21 #include "../../../maptools/AbstractLayer.h"
22 #include "../../../maptools/DataSetLayer.h"
23 #include "../../../maptools/RasterLayer.h"
24 #include "../../../qt/widgets/se/StyleDockWidget.h"
25 #include "../events/Event.h"
26 #include "../events/LayerEvents.h"
27 #include "../ApplicationController.h"
28 #include "StyleExplorer.h"
29 
30 // STL
31 #include <cassert>
32 
34  : QObject(parent),
35  m_explorer(explorer)
36 {
37  assert(explorer);
38 }
39 
41 {
42 }
43 
45 {
46  return m_explorer;
47 }
48 
50 {
51  switch(evt->m_id)
52  {
54  {
56 
58  assert(layer);
59 
60  if(layer->isValid() && layer->getStyle())
61  m_explorer->setStyle(layer->getStyle(), layer.get());
62  }
63  break;
64 
66  {
68 
70  assert(layer);
71 
72  m_explorer->setStyle(layer->getStyle(), layer.get());
73 
74  m_explorer->setVisible(true);
75  }
76  break;
77 
78  default:
79  return;
80  }
81 }
A base class for application events.
Definition: Event.h:59
te::map::AbstractLayerPtr m_layer
Pointer to the selected layer.
Definition: LayerEvents.h:170
A connector for the te::qt::widgets::StyleDockWidget class to the Application Framework.
te::qt::widgets::StyleDockWidget * getExplorer() const
This event indicates that the layer style was selected on the layer explorer.
Definition: LayerEvents.h:228
This event indicates that the layer has been selected.
Definition: LayerEvents.h:157
int m_id
Identifier.
Definition: Event.h:70
StyleExplorer(te::qt::widgets::StyleDockWidget *explorer, QObject *parent=0)
Constructor.
void onApplicationTriggered(te::qt::af::evt::Event *evt)
Listener to the application framewrork events.
A dock widget used control the geographic data style using SE elements and a property browser to show...
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
te::map::AbstractLayerPtr m_layer
Layer whose style was selected.
Definition: LayerEvents.h:241