All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MapDisplay.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/af/connectors/MapDisplay.cpp
22 
23  \brief A connector of the te::qt::widgets::MapDisplay class to the Application Framework.
24 */
25 
26 // TerraLib
27 #include "../../../dataaccess/dataset/DataSet.h"
28 #include "../../../dataaccess/dataset/ObjectId.h"
29 #include "../../../dataaccess/dataset/ObjectIdSet.h"
30 #include "../../../dataaccess/utils/Utils.h"
31 #include "../../../geometry/Coord2D.h"
32 #include "../../../geometry/Envelope.h"
33 #include "../../../geometry/Geometry.h"
34 #include "../../../geometry/Utils.h"
35 #include "../../../maptools/Utils.h"
36 #include "../../../srs/Config.h"
37 #include "../../widgets/canvas/Canvas.h"
38 #include "../../widgets/canvas/EyeBirdMapDisplayWidget.h"
39 #include "../../widgets/canvas/MapDisplay.h"
40 #include "../../widgets/canvas/ZoomInMapDisplayWidget.h"
41 #include "../../widgets/tools/AbstractTool.h"
42 #include "../../widgets/tools/ZoomWheel.h"
43 #include "../../widgets/tools/CoordTracking.h"
44 #include "../../widgets/Utils.h"
45 #include "../events/LayerEvents.h"
46 #include "../events/MapEvents.h"
47 #include "../events/ProjectEvents.h"
48 #include "../events/ToolEvents.h"
49 #include "../ApplicationController.h"
50 #include "../Project.h"
51 #include "../Utils.h"
52 #include "MapDisplay.h"
53 
54 // Qt
55 #include <QAction>
56 #include <QContextMenuEvent>
57 #include <QMessageBox>
58 
59 // STL
60 #include <cassert>
61 #include <memory>
62 #include <utility>
63 
65  : QObject(display),
66  m_display(display),
67  m_tool(0),
68  m_menu(0),
69  m_currentExtentIndex(-1),
70  m_extentStackMaxSize(5),
71  m_zoomInDisplay(0),
72  m_eyeBirdDisplay(0)
73 {
74  // CoordTracking tool
76  connect(coordTracking, SIGNAL(coordTracked(QPointF&)), SLOT(onCoordTracked(QPointF&)));
77  m_display->installEventFilter(coordTracking);
78 
79  // Zoom Wheel tool
80  m_display->installEventFilter(new te::qt::widgets::ZoomWheel(m_display, 2.0, this));
81 
82  // Signals & slots
83  connect(m_display, SIGNAL(drawLayersFinished(const QMap<QString, QString>&)), SLOT(onDrawLayersFinished(const QMap<QString, QString>&)));
84  connect(m_display, SIGNAL(extentChanged()), SLOT(onExtentChanged()));
85 
86  // Gets the popup menu
87  m_menu = ApplicationController::getInstance().findMenu("Map");
88 
89  // To show popup menu
90  m_display->installEventFilter(this);
91 
92  // Config the default SRS
93  m_display->setSRID(ApplicationController::getInstance().getDefaultSRID(), false);
94 
95  // Getting default display color
97 
98  m_pantoSelectedAction = new QAction(this);
99  m_pantoSelectedAction->setCheckable(true);
100  m_pantoSelectedAction->setChecked(false);
101  m_pantoSelectedAction->setText(tr("Enable pan to selected"));
102  m_pantoSelectedAction->setToolTip(tr("Enable / disable pan to selected operation"));
103 
104  // Inserting action
105  QList<QAction*> acts = m_menu->findChildren<QAction*>();
106 
107  if(!acts.isEmpty())
108  m_menu->insertAction(acts.at(3), m_pantoSelectedAction);
109 }
110 
112 {
113  delete m_tool;
114 }
115 
117 {
118  return m_display;
119 }
120 
122 {
123  m_zoomInDisplay = display;
124 }
125 
127 {
128  m_eyeBirdDisplay = display;
129 }
130 
131 bool te::qt::af::MapDisplay::eventFilter(QObject* /*watched*/, QEvent* e)
132 {
133  switch(e->type())
134  {
135  case QEvent::ContextMenu:
136  if(m_menu)
137  m_menu->exec(static_cast<QContextMenuEvent*>(e)->globalPos());
138  break;
139 
140  default:
141  break;
142  }
143 
144  return false;
145 }
146 
147 void te::qt::af::MapDisplay::draw(const std::list<te::map::AbstractLayerPtr>& layers)
148 {
149  if(layers.empty())
150  {
151  clear();
152  return;
153  }
154 
155  std::list<te::map::AbstractLayerPtr> visibleLayers;
156  te::map::GetVisibleLayers(layers, visibleLayers);
157 
158  configSRS(visibleLayers);
159 
160  if(!m_display->getExtent().isValid())
161  {
162  te::gm::Envelope displayExtent = te::map::GetExtent(layers, m_display->getSRID(), true);
163  m_display->setExtent(displayExtent, false);
164  }
165 
166  m_display->setLayerList(layers);
167 
168  m_display->refresh();
169 
170  if(m_zoomInDisplay)
171  m_zoomInDisplay->setList(visibleLayers, m_display->getSRID());
172 
173  if(m_eyeBirdDisplay)
174  m_eyeBirdDisplay->setList(visibleLayers, m_display->getSRID());
175 
176 }
177 
179 {
180  std::list<te::map::AbstractLayerPtr> empty;
181  m_display->setLayerList(empty);
182  m_display->refresh();
183 }
184 
186 {
187  delete m_tool;
188  m_tool = tool;
189 
190  m_display->installEventFilter(m_tool);
191 }
192 
194 {
195  if(m_extentStack.empty())
196  return;
197 
198  if(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1))
199  {
200  m_currentExtentIndex += 1;
201  m_display->setExtent(m_extentStack[m_currentExtentIndex]);
202  }
203 
204  emit hasNextExtent(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1));
205  emit hasPreviousExtent(m_currentExtentIndex > 0);
206 }
207 
209 {
210  if(m_extentStack.empty())
211  return;
212 
213  if(m_currentExtentIndex > 0)
214  {
215  m_currentExtentIndex -= 1;
216  m_display->setExtent(m_extentStack[m_currentExtentIndex]);
217  }
218 
219  emit hasNextExtent(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1));
220  emit hasPreviousExtent(m_currentExtentIndex > 0);
221 }
222 
223 void te::qt::af::MapDisplay::fit(const std::list<te::map::AbstractLayerPtr>& layers)
224 {
225  std::list<te::map::AbstractLayerPtr> visibleLayers;
226  te::map::GetVisibleLayers(layers, visibleLayers);
227 
228  configSRS(visibleLayers);
229 
230  te::gm::Envelope displayExtent = te::map::GetExtent(layers, m_display->getSRID(), true);
231 
232  m_display->setExtent(displayExtent, false);
233 
234  m_display->setLayerList(layers);
235 
236  m_display->refresh();
237 
238  if(m_zoomInDisplay)
239  m_zoomInDisplay->setList(visibleLayers, m_display->getSRID());
240 
241  if(m_eyeBirdDisplay)
242  m_eyeBirdDisplay->setList(visibleLayers, m_display->getSRID());
243 }
244 
245 void te::qt::af::MapDisplay::onCoordTracked(QPointF& coordinate)
246 {
247  te::qt::af::evt::CoordinateTracked e(coordinate.x(), coordinate.y());
249 
250  if(m_zoomInDisplay)
251  m_zoomInDisplay->drawCursorPosition(static_cast<double>(coordinate.x()), static_cast<double>(coordinate.ry()));
252 }
253 
254 void te::qt::af::MapDisplay::onDrawLayersFinished(const QMap<QString, QString>& /*errors*/)
255 {
256  // Stores the clean pixmap!
257  m_lastDisplayContent = QPixmap(*m_display->getDisplayPixmap());
258 
259  // Draw the layers selection
260  drawLayersSelection(ApplicationController::getInstance().getProject()->getSingleLayers(false));
261 
262  // Informs the end of drawing
263  te::qt::af::evt::DrawingFinished drawingFinished(this);
264  ApplicationController::getInstance().broadcast(&drawingFinished);
265 }
266 
268 {
269  switch(e->m_id)
270  {
272  clear();
273  break;
274 
276  {
278 
279  if(m_pantoSelectedAction->isChecked() && evt->m_envelope != 0)
280  {
281  te::gm::Envelope* env = evt->m_envelope;
282  te::gm::Envelope map_env = m_display->getExtent();
283 
284  if(evt->m_layer->getSRID() != m_display->getSRID())
285  env->transform(evt->m_layer->getSRID(), m_display->getSRID());
286 
287  if(!env->intersects(map_env))
288  {
289  env->m_llx = env->getCenter().x - map_env.getWidth()/2;
290  env->m_urx = env->m_llx + map_env.getWidth();
291  env->m_lly = env->getCenter().y - map_env.getHeight()/2;
292  env->m_ury = env->m_lly + map_env.getHeight();
293 
294  m_display->setExtent(*env);
295  }
296  }
297 
298  QPixmap* content = m_display->getDisplayPixmap();
299  content->fill(Qt::transparent);
300 
301  QPainter painter(content);
302  painter.drawPixmap(0, 0, m_lastDisplayContent);
303  painter.end();
304 
305  drawLayersSelection(ApplicationController::getInstance().getProject()->getSingleLayers());
306  }
307  break;
308 
310  {
312  drawDataSet(highlightEvent->m_dataset, highlightEvent->m_layer->getGeomPropertyName(), highlightEvent->m_layer->getSRID(), highlightEvent->m_color);
313  m_display->repaint();
314  }
315  break;
316 
318  {
319  // TODO
320  }
321  break;
322 
325  {
326  draw(ApplicationController::getInstance().getProject()->getVisibleSingleLayers());
327  }
328  break;
329 
331  {
332  te::qt::af::evt::MapColorChanged* mapColorChanged = static_cast<te::qt::af::evt::MapColorChanged*>(e);
333  m_display->setBackgroundColor(mapColorChanged->m_color);
334  m_display->refresh();
335  }
336  break;
337 
339  {
340  te::qt::af::evt::GetMapDisplay* getDisplay = static_cast<te::qt::af::evt::GetMapDisplay*>(e);
341  getDisplay->m_display = this;
342  }
343  break;
344 
345  default:
346  return;
347  }
348 }
349 
351 {
352  return m_pantoSelectedAction->isChecked();
353 }
354 
355 void te::qt::af::MapDisplay::drawLayersSelection(const std::list<te::map::AbstractLayerPtr>& layers)
356 {
357  if(layers.empty())
358  return;
359 
360  std::list<te::map::AbstractLayerPtr>::const_iterator it;
361  for(it = layers.begin(); it != layers.end(); ++it)
362  drawLayerSelection(*it);
363 
364  m_display->repaint();
365 }
366 
368 {
369  assert(layer.get());
370 
371  if(layer->getVisibility() != te::map::VISIBLE)
372  return;
373 
374  std::auto_ptr<te::da::DataSetType> dsType = layer->getSchema();
375 
376  if(!dsType->hasGeom())
377  return;
378 
379  const te::da::ObjectIdSet* oids = layer->getSelected();
380 
381  if(oids == 0 || oids->size() == 0)
382  return;
383 
384  try
385  {
386  std::size_t maxOids = 4000;
387 
388  if(oids->size() > maxOids)
389  {
390  std::auto_ptr<te::da::ObjectIdSet> oidsBatch(new te::da::ObjectIdSet(*oids, false));
391 
392  // Count the all oids
393  std::size_t nOids = 0;
394 
395  // Count the processed oids
396  std::size_t nProcessedOids = 0;
397 
398  std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator it;
399  for(it = oids->begin(); it != oids->end(); ++it)
400  {
401 
402  oidsBatch->add((*it)->clone());
403 
404  ++nOids;
405  ++nProcessedOids;
406 
407  if(nProcessedOids == maxOids || nOids == oids->size())
408  {
409  // Try to retrieve the layer selection batch
410  std::auto_ptr<te::da::DataSet> selected(layer->getData(oidsBatch.get()));
411 
412  drawDataSet(selected.get(), layer->getGeomPropertyName(), layer->getSRID(), ApplicationController::getInstance().getSelectionColor(), te::da::HasLinkedTable(layer->getSchema().get()));
413 
414  // Prepares to next batch
415  oidsBatch->clear();
416  nProcessedOids = 0;
417  }
418  }
419  }
420  else
421  {
422  std::auto_ptr<te::da::DataSet> selected(layer->getData(oids->getExpression()));
423 
424  drawDataSet(selected.get(), layer->getGeomPropertyName(), layer->getSRID(), ApplicationController::getInstance().getSelectionColor(), te::da::HasLinkedTable(layer->getSchema().get()));
425  }
426  }
427  catch(std::exception& e)
428  {
429  QMessageBox::critical(m_display, tr("Error"), QString(tr("The layer selection cannot be drawn. Details:") + " %1.").arg(e.what()));
430  return;
431  }
432 
433  return;
434 }
435 
436 void te::qt::af::MapDisplay::drawDataSet(te::da::DataSet* dataset, const std::string& geomPropertyName, int srid, const QColor& color, bool isLinked)
437 {
438  assert(dataset);
439  assert(color.isValid());
440 
441  if(srid == TE_UNKNOWN_SRS && m_display->getSRID() != TE_UNKNOWN_SRS)
442  return;
443 
444  bool needRemap = false;
445 
446  if((srid != TE_UNKNOWN_SRS) && (m_display->getSRID() != TE_UNKNOWN_SRS) && (srid != m_display->getSRID()))
447  needRemap = true;
448 
449  std::size_t gpos = std::string::npos;
450  geomPropertyName.empty() ? gpos = te::da::GetFirstPropertyPos(dataset, te::dt::GEOMETRY_TYPE): gpos = te::da::GetPropertyPos(dataset, geomPropertyName);
451 
452  assert(gpos != std::string::npos);
453 
454  QPixmap* content = m_display->getDisplayPixmap();
455 
456  const te::gm::Envelope& displayExtent = m_display->getExtent();
457 
458  te::qt::widgets::Canvas canvas(content);
459  canvas.setWindow(displayExtent.m_llx, displayExtent.m_lly, displayExtent.m_urx, displayExtent.m_ury);
460 
462 
463  dataset->moveBeforeFirst();
464 
465  std::set<std::string> highlightedGeoms;
466 
467  while(dataset->moveNext())
468  {
469  std::auto_ptr<te::gm::Geometry> g(dataset->getGeometry(gpos));
470  if(needRemap)
471  {
472  g->setSRID(srid);
473  g->transform(m_display->getSRID());
474  }
475 
476  if(currentGeomType != g->getGeomTypeId())
477  {
478  currentGeomType = g->getGeomTypeId();
479  te::qt::widgets::Config2DrawLayerSelection(&canvas, color, currentGeomType);
480  }
481 
482  if(isLinked)
483  {
484  if(highlightedGeoms.insert(g->asText()).second)
485  {
486  canvas.draw(g.get());
487  }
488  }
489  else
490  canvas.draw(g.get());
491  }
492 }
493 
495 {
496  if(!m_extentStack.empty() && m_display->getExtent().equals(m_extentStack[m_currentExtentIndex]))
497  return;
498 
499  if(m_currentExtentIndex != m_extentStackMaxSize)
500  {
501  m_extentStack.push_back(m_display->getExtent());
502  m_currentExtentIndex += 1;
503  }
504  else
505  {
506  m_extentStack.erase(m_extentStack.begin());
507  m_extentStack.push_back(m_display->getExtent());
508  m_currentExtentIndex = m_extentStackMaxSize;
509  }
510 
511  emit hasNextExtent(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1));
512  emit hasPreviousExtent(m_currentExtentIndex > 0);
513 }
514 
515 void te::qt::af::MapDisplay::configSRS(const std::list<te::map::AbstractLayerPtr>& layers)
516 {
517  if(layers.size() == 1 && (*layers.begin())->getSRID() == TE_UNKNOWN_SRS && m_display->getSRID() != TE_UNKNOWN_SRS)
518  {
519  const te::map::AbstractLayerPtr& layer = *layers.begin();
520 
521  m_display->setSRID(TE_UNKNOWN_SRS, false);
522 
523  std::pair<int, std::string> srid(layer->getSRID(), "EPSG");
524  te::qt::af::evt::MapSRIDChanged mapSRIDChanged(srid);
526  }
527  else if(m_display->getSRID() == TE_UNKNOWN_SRS)
528  {
529  std::list<te::map::AbstractLayerPtr>::const_iterator it;
530 
531  for(it = layers.begin(); it != layers.end(); ++it)
532  {
533  const te::map::AbstractLayerPtr& layer = *it;
534 
535  if(layer->getSRID() == TE_UNKNOWN_SRS)
536  continue;
537 
538  m_display->setSRID(layer->getSRID(), false);
539 
540  std::pair<int, std::string> srid(layer->getSRID(), "EPSG");
541  te::qt::af::evt::MapSRIDChanged mapSRIDChanged(srid);
543 
544  break;
545  }
546  }
547 }
bool eventFilter(QObject *watched, QEvent *e)
Definition: MapDisplay.cpp:131
TEQTAFEXPORT QColor GetDefaultDisplayColorFromSettings()
Definition: Utils.cpp:715
This class defines the map display EyeBird, this component is only a specific map that shows the orig...
TEQTWIDGETSEXPORT void Config2DrawLayerSelection(te::map::Canvas *canvas, const QColor &selectionColor, const te::gm::GeomType &type)
It configs (i.e. prepares) the given canvas to draw a layer selection.
Definition: Utils.cpp:280
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
This class defines the map display ZoomIn, this component is only a specific map that shows the curre...
double y
y-coordinate.
Definition: Coord2D.h:114
bool intersects(const Envelope &rhs) const
It returns true if the envelopes "spatially intersects".
Definition: Envelope.h:493
void drawLayersSelection(const std::list< te::map::AbstractLayerPtr > &layers)
Definition: MapDisplay.cpp:355
bool isPanToSelectedEnabled()
Returns the pan selected flag;.
Definition: MapDisplay.cpp:350
te::map::AbstractLayerPtr m_layer
Layer whose selected objects were changed.
Definition: LayerEvents.h:192
void setZoomInDisplay(te::qt::widgets::ZoomInMapDisplayWidget *display)
Definition: MapDisplay.cpp:121
void fit(const std::list< te::map::AbstractLayerPtr > &layers)
Definition: MapDisplay.cpp:223
virtual void setBackgroundColor(const QColor &color)
Sets the map display background color.
Definition: MapDisplay.cpp:338
double x
x-coordinate.
Definition: Coord2D.h:113
TEDATAACCESSEXPORT bool HasLinkedTable(te::da::DataSetType *type)
It checks if the datasettype has a linked table.
Definition: Utils.cpp:1175
TEMAPEXPORT te::gm::Envelope GetExtent(const std::list< te::map::AbstractLayerPtr > &layers, int srid, bool onlyVisibles)
It calculates the extent of the given layers in the given SRID.
Definition: Utils.cpp:254
void onCoordTracked(QPointF &coordinate)
Definition: MapDisplay.cpp:245
A base class for application events.
Definition: Event.h:59
te::qt::widgets::MapDisplay * getDisplay()
Definition: MapDisplay.cpp:116
QMenu * m_menu
The map display popup menu.
Definition: MapDisplay.h:168
This event indicates that the objects of the given layer must be highlighted.
Definition: LayerEvents.h:201
This event signals that the srid of the map display changed.
Definition: MapEvents.h:54
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
Definition: Utils.cpp:500
double m_urx
Upper right corner x-coordinate.
Definition: Envelope.h:346
void onApplicationTriggered(te::qt::af::evt::Event *e)
Listener to the application framewrork events.
Definition: MapDisplay.cpp:267
double getWidth() const
It returns the envelope width.
Definition: Envelope.h:443
A widget to control the display of a set of layers.
Definition: MapDisplay.h:66
void onDrawLayersFinished(const QMap< QString, QString > &errors)
Definition: MapDisplay.cpp:254
This event indicates that the selected objects of the layer were changed.
Definition: LayerEvents.h:178
This class defines an interface for objects that can receive application events and respond to them...
Definition: AbstractTool.h:62
void draw(const te::gm::Geometry *geom)
It draws the geometry on canvas.
Definition: Canvas.cpp:296
void drawDataSet(te::da::DataSet *dataset, const std::string &geomPropertyName, int srid, const QColor &color, bool isLinked=false)
Definition: MapDisplay.cpp:436
QAction * m_pantoSelectedAction
Action to enable / disable pan to selected operation.
Definition: MapDisplay.h:177
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
Coord2D getCenter() const
It returns the rectangle's center coordinate.
Definition: Envelope.cpp:51
void setWindow(const double &llx, const double &lly, const double &urx, const double &ury)
It sets the world (or window) coordinates area (supposing a cartesian reference system).
Definition: Canvas.cpp:147
double m_llx
Lower left corner x-coordinate.
Definition: Envelope.h:344
QColor getSelectionColor() const
Returns the application selection color.
A connector of the te::qt::widgets::MapDisplay class to the Application Framework.
static ApplicationController & getInstance()
It returns a reference to the singleton instance.
void clear()
It clears the map display.
Definition: MapDisplay.cpp:178
void setCurrentTool(te::qt::widgets::AbstractTool *tool)
Updates the current tool being used on te::qt::widgets::MapDisplay.
Definition: MapDisplay.cpp:185
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
Definition: Config.h:44
This event signals that the color of the map display changed.
Definition: MapEvents.h:75
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
int m_id
Identifier.
Definition: Event.h:70
std::size_t size() const
It returns the object id set size.
~MapDisplay()
destructor.
Definition: MapDisplay.cpp:111
This event can be used to retrieve the MapDisplat component.
Definition: MapEvents.h:96
void draw(const std::list< te::map::AbstractLayerPtr > &layers)
It draws the given layer list.
Definition: MapDisplay.cpp:147
This class implements a concrete tool to geographic coordinate tracking on mouse move operation...
Definition: CoordTracking.h:52
virtual std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
double m_lly
Lower left corner y-coordinate.
Definition: Envelope.h:345
Signals a mouse moved over the current display.
Definition: ToolEvents.h:78
A canvas built on top of Qt.
Definition: Canvas.h:54
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition: DataSet.h:112
This event is used to inform that drawing is finished.
Definition: MapEvents.h:115
void broadcast(te::qt::af::evt::Event *evt)
Send events in broadcast for all registered components.
double m_ury
Upper right corner y-coordinate.
Definition: Envelope.h:347
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator end() const
Returns an iterator for the object ids in container.
te::da::DataSet * m_dataset
The dataset that represents the objects that must be highlighted.
Definition: LayerEvents.h:219
virtual bool moveBeforeFirst()=0
It moves the internal pointer to a position before the first item in the collection.
This class implements a concrete tool to geographic zoom operation using the mouse wheel...
Definition: ZoomWheel.h:49
void drawLayerSelection(te::map::AbstractLayerPtr layer)
Definition: MapDisplay.cpp:367
TEDATAACCESSEXPORT std::size_t GetFirstPropertyPos(const te::da::DataSet *dataset, int datatype)
Definition: Utils.cpp:481
QColor m_color
The color used to highlight.
Definition: LayerEvents.h:220
te::qt::af::MapDisplay * m_display
Definition: MapEvents.h:107
te::gm::Envelope * m_envelope
The box of the last selected object.
Definition: LayerEvents.h:193
virtual void setSRID(const int &srid, bool doRefresh=true)
It sets a new Spatial Reference System to be used by the Map Display.
Definition: MapDisplay.cpp:211
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
void transform(int oldsrid, int newsrid)
It will transform the coordinates of the Envelope from the old SRS to the new one.
Definition: Envelope.cpp:92
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator begin() const
Returns an iterator for the object ids in container.
double getHeight() const
It returns the envelope height.
Definition: Envelope.h:448
Expression * getExpression() const
It returns the expression that can be used to retrieve the data set that contains the all indentified...
void configSRS(const std::list< te::map::AbstractLayerPtr > &layers)
Definition: MapDisplay.cpp:515
te::qt::widgets::MapDisplay * m_display
Pointer to a component te::qt::widgets::MapDisplay.
Definition: MapDisplay.h:166
te::map::AbstractLayerPtr m_layer
The layer whose objects must be highlighted.
Definition: LayerEvents.h:218
TEMAPEXPORT void GetVisibleLayers(const std::list< te::map::AbstractLayerPtr > &layers, std::list< te::map::AbstractLayerPtr > &visibleLayers)
It gets the visible layers of the given layer list.
Definition: Utils.cpp:248
void setEyeBirdDisplay(te::qt::widgets::EyeBirdMapDisplayWidget *display)
Definition: MapDisplay.cpp:126
MapDisplay(te::qt::widgets::MapDisplay *display)
Constructor.
Definition: MapDisplay.cpp:64