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(),
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  delete m_display;
115 }
116 
118 {
119  return m_display;
120 }
121 
123 {
124  m_zoomInDisplay = display;
125 }
126 
128 {
129  m_eyeBirdDisplay = display;
130 }
131 
132 bool te::qt::af::MapDisplay::eventFilter(QObject* /*watched*/, QEvent* e)
133 {
134  switch(e->type())
135  {
136  case QEvent::ContextMenu:
137  if(m_menu)
138  m_menu->exec(static_cast<QContextMenuEvent*>(e)->globalPos());
139  break;
140 
141  default:
142  break;
143  }
144 
145  return false;
146 }
147 
148 void te::qt::af::MapDisplay::draw(const std::list<te::map::AbstractLayerPtr>& layers)
149 {
150  if(layers.empty())
151  {
152  clear();
153  return;
154  }
155 
156  std::list<te::map::AbstractLayerPtr> visibleLayers;
157  te::map::GetVisibleLayers(layers, visibleLayers);
158 
159  configSRS(visibleLayers);
160 
161  if(!m_display->getExtent().isValid())
162  {
163  te::gm::Envelope displayExtent = te::map::GetExtent(layers, m_display->getSRID(), true);
164  m_display->setExtent(displayExtent, false);
165  }
166 
167  m_display->setLayerList(layers);
168 
169  m_display->refresh();
170 
171  if(m_zoomInDisplay)
172  m_zoomInDisplay->setList(visibleLayers, m_display->getSRID());
173 
174  if(m_eyeBirdDisplay)
175  m_eyeBirdDisplay->setList(visibleLayers, m_display->getSRID());
176 
177 }
178 
180 {
181  std::list<te::map::AbstractLayerPtr> empty;
182  m_display->setLayerList(empty);
183  m_display->refresh();
184 }
185 
187 {
188  delete m_tool;
189  m_tool = tool;
190 
191  m_display->installEventFilter(m_tool);
192 }
193 
195 {
196  if(m_extentStack.empty())
197  return;
198 
199  if(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1))
200  {
201  m_currentExtentIndex += 1;
202  m_display->setExtent(m_extentStack[m_currentExtentIndex]);
203  }
204 
205  emit hasNextExtent(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1));
206  emit hasPreviousExtent(m_currentExtentIndex > 0);
207 }
208 
210 {
211  if(m_extentStack.empty())
212  return;
213 
214  if(m_currentExtentIndex > 0)
215  {
216  m_currentExtentIndex -= 1;
217  m_display->setExtent(m_extentStack[m_currentExtentIndex]);
218  }
219 
220  emit hasNextExtent(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1));
221  emit hasPreviousExtent(m_currentExtentIndex > 0);
222 }
223 
224 void te::qt::af::MapDisplay::fit(const std::list<te::map::AbstractLayerPtr>& layers)
225 {
226  std::list<te::map::AbstractLayerPtr> visibleLayers;
227  te::map::GetVisibleLayers(layers, visibleLayers);
228 
229  configSRS(visibleLayers);
230 
231  te::gm::Envelope displayExtent = te::map::GetExtent(layers, m_display->getSRID(), true);
232 
233  m_display->setExtent(displayExtent, false);
234 
235  m_display->setLayerList(layers);
236 
237  m_display->refresh();
238 
239  if(m_zoomInDisplay)
240  m_zoomInDisplay->setList(visibleLayers, m_display->getSRID());
241 
242  if(m_eyeBirdDisplay)
243  m_eyeBirdDisplay->setList(visibleLayers, m_display->getSRID());
244 }
245 
246 void te::qt::af::MapDisplay::onCoordTracked(QPointF& coordinate)
247 {
248  te::qt::af::evt::CoordinateTracked e(coordinate.x(), coordinate.y());
250 
251  if(m_zoomInDisplay)
252  m_zoomInDisplay->drawCursorPosition(static_cast<double>(coordinate.x()), static_cast<double>(coordinate.ry()));
253 }
254 
255 void te::qt::af::MapDisplay::onDrawLayersFinished(const QMap<QString, QString>& /*errors*/)
256 {
257  // Stores the clean pixmap!
258  m_lastDisplayContent = QPixmap(*m_display->getDisplayPixmap());
259 
260  // Draw the layers selection
261  drawLayersSelection(ApplicationController::getInstance().getProject()->getSingleLayers(false));
262 
263  // Informs the end of drawing
264  te::qt::af::evt::DrawingFinished drawingFinished(this);
265  ApplicationController::getInstance().broadcast(&drawingFinished);
266 }
267 
269 {
270  switch(e->m_id)
271  {
273  clear();
274  break;
275 
277  {
279 
280  if(m_pantoSelectedAction->isChecked() && evt->m_envelope != 0)
281  {
282  te::gm::Envelope* env = evt->m_envelope;
283  te::gm::Envelope map_env = m_display->getExtent();
284 
285  if(evt->m_layer->getSRID() != m_display->getSRID())
286  env->transform(evt->m_layer->getSRID(), m_display->getSRID());
287 
288  if(!env->intersects(map_env))
289  {
290  env->m_llx = env->getCenter().x - map_env.getWidth()/2;
291  env->m_urx = env->m_llx + map_env.getWidth();
292  env->m_lly = env->getCenter().y - map_env.getHeight()/2;
293  env->m_ury = env->m_lly + map_env.getHeight();
294 
295  m_display->setExtent(*env);
296  }
297  }
298 
299  QPixmap* content = m_display->getDisplayPixmap();
300  content->fill(Qt::transparent);
301 
302  QPainter painter(content);
303  painter.drawPixmap(0, 0, m_lastDisplayContent);
304  painter.end();
305 
306  drawLayersSelection(ApplicationController::getInstance().getProject()->getSingleLayers());
307  }
308  break;
309 
311  {
313  drawDataSet(highlightEvent->m_dataset, highlightEvent->m_layer->getGeomPropertyName(), highlightEvent->m_layer->getSRID(), highlightEvent->m_color);
314  m_display->repaint();
315  }
316  break;
317 
319  {
320  // TODO
321  }
322  break;
323 
326  {
327  draw(ApplicationController::getInstance().getProject()->getVisibleSingleLayers());
328  }
329  break;
330 
332  {
333  te::qt::af::evt::MapColorChanged* mapColorChanged = static_cast<te::qt::af::evt::MapColorChanged*>(e);
334  m_display->setBackgroundColor(mapColorChanged->m_color);
335  m_display->refresh();
336  }
337  break;
338 
340  {
341  te::qt::af::evt::GetMapDisplay* getDisplay = static_cast<te::qt::af::evt::GetMapDisplay*>(e);
342  getDisplay->m_display = this;
343  }
344  break;
345 
346  default:
347  return;
348  }
349 }
350 
352 {
353  return m_pantoSelectedAction->isChecked();
354 }
355 
356 void te::qt::af::MapDisplay::drawLayersSelection(const std::list<te::map::AbstractLayerPtr>& layers)
357 {
358  if(layers.empty())
359  return;
360 
361  std::list<te::map::AbstractLayerPtr>::const_iterator it;
362  for(it = layers.begin(); it != layers.end(); ++it)
363  drawLayerSelection(*it);
364 
365  m_display->repaint();
366 }
367 
369 {
370  assert(layer.get());
371 
372  if(layer->getVisibility() != te::map::VISIBLE)
373  return;
374 
375  std::auto_ptr<te::da::DataSetType> dsType = layer->getSchema();
376 
377  if(!dsType->hasGeom())
378  return;
379 
380  const te::da::ObjectIdSet* oids = layer->getSelected();
381 
382  if(oids == 0 || oids->size() == 0)
383  return;
384 
385  try
386  {
387  std::size_t maxOids = 4000;
388 
389  if(oids->size() > maxOids)
390  {
391  std::auto_ptr<te::da::ObjectIdSet> oidsBatch(new te::da::ObjectIdSet(*oids, false));
392 
393  // Count the all oids
394  std::size_t nOids = 0;
395 
396  // Count the processed oids
397  std::size_t nProcessedOids = 0;
398 
399  std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator it;
400  for(it = oids->begin(); it != oids->end(); ++it)
401  {
402 
403  oidsBatch->add((*it)->clone());
404 
405  ++nOids;
406  ++nProcessedOids;
407 
408  if(nProcessedOids == maxOids || nOids == oids->size())
409  {
410  // Try to retrieve the layer selection batch
411  std::auto_ptr<te::da::DataSet> selected(layer->getData(oidsBatch.get()));
412 
413  drawDataSet(selected.get(), layer->getGeomPropertyName(), layer->getSRID(), ApplicationController::getInstance().getSelectionColor(), te::da::HasLinkedTable(layer->getSchema().get()));
414 
415  // Prepares to next batch
416  oidsBatch->clear();
417  nProcessedOids = 0;
418  }
419  }
420  }
421  else
422  {
423  std::auto_ptr<te::da::DataSet> selected(layer->getData(oids->getExpression()));
424 
425  drawDataSet(selected.get(), layer->getGeomPropertyName(), layer->getSRID(), ApplicationController::getInstance().getSelectionColor(), te::da::HasLinkedTable(layer->getSchema().get()));
426  }
427  }
428  catch(std::exception& e)
429  {
430  QMessageBox::critical(m_display, tr("Error"), QString(tr("The layer selection cannot be drawn. Details:") + " %1.").arg(e.what()));
431  return;
432  }
433 
434  return;
435 }
436 
437 void te::qt::af::MapDisplay::drawDataSet(te::da::DataSet* dataset, const std::string& geomPropertyName, int srid, const QColor& color, bool isLinked)
438 {
439  assert(dataset);
440  assert(color.isValid());
441 
442  if(srid == TE_UNKNOWN_SRS && m_display->getSRID() != TE_UNKNOWN_SRS)
443  return;
444 
445  bool needRemap = false;
446 
447  if((srid != TE_UNKNOWN_SRS) && (m_display->getSRID() != TE_UNKNOWN_SRS) && (srid != m_display->getSRID()))
448  needRemap = true;
449 
450  std::size_t gpos = std::string::npos;
451  geomPropertyName.empty() ? gpos = te::da::GetFirstPropertyPos(dataset, te::dt::GEOMETRY_TYPE): gpos = te::da::GetPropertyPos(dataset, geomPropertyName);
452 
453  assert(gpos != std::string::npos);
454 
455  QPixmap* content = m_display->getDisplayPixmap();
456 
457  const te::gm::Envelope& displayExtent = m_display->getExtent();
458 
459  te::qt::widgets::Canvas canvas(content);
460  canvas.setWindow(displayExtent.m_llx, displayExtent.m_lly, displayExtent.m_urx, displayExtent.m_ury);
461 
463 
464  dataset->moveBeforeFirst();
465 
466  std::set<std::string> highlightedGeoms;
467 
468  while(dataset->moveNext())
469  {
470  std::auto_ptr<te::gm::Geometry> g(dataset->getGeometry(gpos));
471  if(needRemap)
472  {
473  g->setSRID(srid);
474  g->transform(m_display->getSRID());
475  }
476 
477  if(currentGeomType != g->getGeomTypeId())
478  {
479  currentGeomType = g->getGeomTypeId();
480  te::qt::widgets::Config2DrawLayerSelection(&canvas, color, currentGeomType);
481  }
482 
483  if(isLinked)
484  {
485  if(highlightedGeoms.insert(g->asText()).second)
486  {
487  canvas.draw(g.get());
488  }
489  }
490  else
491  canvas.draw(g.get());
492  }
493 }
494 
496 {
497  if(!m_extentStack.empty() && m_display->getExtent().equals(m_extentStack[m_currentExtentIndex]))
498  return;
499 
500  if(m_currentExtentIndex != m_extentStackMaxSize)
501  {
502  m_extentStack.push_back(m_display->getExtent());
503  m_currentExtentIndex += 1;
504  }
505  else
506  {
507  m_extentStack.erase(m_extentStack.begin());
508  m_extentStack.push_back(m_display->getExtent());
509  m_currentExtentIndex = m_extentStackMaxSize;
510  }
511 
512  emit hasNextExtent(m_currentExtentIndex < static_cast<int>(m_extentStack.size() - 1));
513  emit hasPreviousExtent(m_currentExtentIndex > 0);
514 }
515 
516 void te::qt::af::MapDisplay::configSRS(const std::list<te::map::AbstractLayerPtr>& layers)
517 {
518  if(layers.size() == 1 && (*layers.begin())->getSRID() == TE_UNKNOWN_SRS && m_display->getSRID() != TE_UNKNOWN_SRS)
519  {
520  const te::map::AbstractLayerPtr& layer = *layers.begin();
521 
522  m_display->setSRID(TE_UNKNOWN_SRS, false);
523 
524  std::pair<int, std::string> srid(layer->getSRID(), "EPSG");
525  te::qt::af::evt::MapSRIDChanged mapSRIDChanged(srid);
527  }
528  else if(m_display->getSRID() == TE_UNKNOWN_SRS)
529  {
530  std::list<te::map::AbstractLayerPtr>::const_iterator it;
531 
532  for(it = layers.begin(); it != layers.end(); ++it)
533  {
534  const te::map::AbstractLayerPtr& layer = *it;
535 
536  if(layer->getSRID() == TE_UNKNOWN_SRS)
537  continue;
538 
539  m_display->setSRID(layer->getSRID(), false);
540 
541  std::pair<int, std::string> srid(layer->getSRID(), "EPSG");
542  te::qt::af::evt::MapSRIDChanged mapSRIDChanged(srid);
544 
545  break;
546  }
547  }
548 }
bool eventFilter(QObject *watched, QEvent *e)
Definition: MapDisplay.cpp:132
TEQTAFEXPORT QColor GetDefaultDisplayColorFromSettings()
Definition: Utils.cpp:719
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:356
bool isPanToSelectedEnabled()
Returns the pan selected flag;.
Definition: MapDisplay.cpp:351
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:122
void fit(const std::list< te::map::AbstractLayerPtr > &layers)
Definition: MapDisplay.cpp:224
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:1213
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:246
A base class for application events.
Definition: Event.h:59
te::qt::widgets::MapDisplay * getDisplay()
Definition: MapDisplay.cpp:117
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:268
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:255
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:437
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:179
void setCurrentTool(te::qt::widgets::AbstractTool *tool)
Updates the current tool being used on te::qt::widgets::MapDisplay.
Definition: MapDisplay.cpp:186
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:41
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:148
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:368
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:516
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:127
MapDisplay(te::qt::widgets::MapDisplay *display)
Constructor.
Definition: MapDisplay.cpp:64