dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
mapgraphicitem.cpp
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #include "uavitem.h"
28 #include "gpsitem.h"
29 #include "homeitem.h"
30 #include "mapgraphicitem.h"
31 #include <QGraphicsSceneMouseEvent>
32 #include <QGraphicsScene>
33 
34 namespace mapcontrol
35 {
36  MapGraphicItem::MapGraphicItem(internals::Core *core, Configuration *configuration) :
37  core(core), config(configuration), MapRenderTransform(1), maxZoom(17),
38  minZoom(2), zoomReal(0), zoomDigi(0), isSelected(false), rotation(0)
39  {
40  dragons.load(QString::fromUtf8(":/markers/images/grid.jpg"));
41  showTileGridLines=false;
42  isMouseOverMarker=false;
43  maprect=QRectF(0,0,1022,680);
44  core->SetCurrentRegion(internals::Rectangle(0, 0, maprect.width(), maprect.height()));
45  core->SetMapType(MapType::GoogleHybrid);
46  this->SetZoom(2);
47  this->setFlag(ItemIsFocusable);
48  connect(core,SIGNAL(OnNeedInvalidation()),this,SLOT(Core_OnNeedInvalidation()));
49  connect(core,SIGNAL(OnMapDrag()),this,SLOT(childPosRefresh()));
50  connect(core,SIGNAL(OnMapZoomChanged()),this,SLOT(childPosRefresh()));
51  setCacheMode(QGraphicsItem::ItemCoordinateCache);
52  }
53 
54  void MapGraphicItem::start()
55  {
56  core->StartSystem();
57  }
58 
59  void MapGraphicItem::resize(const QRectF &rect)
60  {
61  Q_UNUSED(rect);
62  {
63  this->prepareGeometryChange();
64  maprect=boundingBox(scene()->sceneRect(),rotation);
65  this->setTransform(QTransform().translate(-(maprect.width()-scene()->width())/2,-(maprect.height()-scene()->height())/2));
66  this->setTransformOriginPoint(maprect.center().x(),maprect.center().y());
67  this->setRotation(rotation);
68  }
69 
70  if ((maprect.width() > 1024) || (maprect.height() > 1024)) {
71  minZoom = 3;
72  } else {
73  minZoom = 2;
74  }
75 
76  if (Zoom() < minZoom) {
77  SetZoom(minZoom);
78  }
79 
80  core->OnMapSizeChanged(maprect.width(),maprect.height());
81  core->SetCurrentRegion(internals::Rectangle(0, 0, maprect.width(), maprect.height()));
82  if(isVisible())
83  {
84  core->GoToCurrentPosition();
85  }
86  }
87 
88  QRectF MapGraphicItem::boundingRect() const
89  {
90  const int Margin = 1;
91  return maprect.adjusted(-Margin, -Margin, +Margin, +Margin);
92  }
93  void MapGraphicItem::Core_OnNeedInvalidation()
94  {
95  this->update();
96  emit childRefreshPosition();
97  }
98  void MapGraphicItem::childPosRefresh()
99  {
100  emit childRefreshPosition();
101  }
102  void MapGraphicItem::setOverlayOpacity(qreal value)
103  {
104  emit childSetOpacity(value);
105  }
110  void MapGraphicItem::ConstructLastImage(int const& zoomdiff)
111  {
112  QImage temp;
113  QSize size=boundingRect().size().toSize();
114  size.setWidth(size.width()*2*zoomdiff);
115  size.setHeight(size.height()*2*zoomdiff);
116  temp=QImage(size,QImage::Format_ARGB32_Premultiplied);
117  temp.fill(0);
118  QPainter imagePainter(&temp);
119  imagePainter.translate(-boundingRect().topLeft());
120  imagePainter.scale(2*zoomdiff,2*zoomdiff);
121  paintImage(&imagePainter);
122  imagePainter.end();
123  lastimagepoint=Point(core->GetrenderOffset().X()*2*zoomdiff,core->GetrenderOffset().Y()*2*zoomdiff);
124  lastimage=temp;
125  }
126  void MapGraphicItem::paintImage(QPainter *painter)
127  {
128 
129  if(MapRenderTransform!=1)
130  {
131  QTransform transform;
132  transform.translate(-((boundingRect().width()*MapRenderTransform)-(boundingRect().width()))/2,-((boundingRect().height()*MapRenderTransform)-(boundingRect().height()))/2);
133  transform.scale(MapRenderTransform,MapRenderTransform);
134  painter->setWorldTransform(transform);
135  {
136  DrawMap2D(painter);
137  }
138  painter->resetTransform();
139  }
140  else
141  {
142  DrawMap2D(painter);
143  }
144  //painter->drawRect(maprect);
145  }
146  void MapGraphicItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
147  {
148  Q_UNUSED(option);
149  Q_UNUSED(widget);
150 
151  if(MapRenderTransform!=1)
152  {
153  QTransform transform;
154  transform.translate(-((boundingRect().width()*MapRenderTransform)-(boundingRect().width()))/2,-((boundingRect().height()*MapRenderTransform)-(boundingRect().height()))/2);
155  transform.scale(MapRenderTransform,MapRenderTransform);
156 
157  painter->setWorldTransform(transform);
158  painter->setRenderHint(QPainter::SmoothPixmapTransform,true);
159  painter->setRenderHint(QPainter::HighQualityAntialiasing,true);
160 
161  {
162  DrawMap2D(painter);
163  }
164  painter->resetTransform();
165  }
166  else
167  {
168  DrawMap2D(painter);
169  }
170  }
171  void MapGraphicItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
172  {
173  if(core->IsDragging())
174  {
175  if(MapRenderTransform!=1)
176  {
177  qreal dx= (event->pos().x()-core->mouseDown.X())/(MapRenderTransform);
178  qreal dy= (event->pos().y()-core->mouseDown.Y())/(MapRenderTransform);
179  qreal nx=core->mouseDown.X()+dx;
180  qreal ny=core->mouseDown.Y()+dy;
181  core->mouseCurrent.SetX(nx);
182  core->mouseCurrent.SetY(ny);
183  }
184  else
185  {
186  core->mouseCurrent.SetX(event->pos().x());
187  core->mouseCurrent.SetY(event->pos().y());
188  }
189  {
190  core->Drag(core->mouseCurrent);
191  }
192 
193  }
194  else if(isSelected && !selectionStart.IsEmpty() && (event->modifiers() == Qt::ControlModifier || event->modifiers() == Qt::ShiftModifier))
195  {
196  selectionEnd = FromLocalToLatLng(event->pos().x(), event->pos().y());
197  {
198  internals::PointLatLng p1 = selectionStart;
199  internals::PointLatLng p2 = selectionEnd;
200 
201  double x1 = qMin(p1.Lng(), p2.Lng());
202  double y1 = qMax(p1.Lat(), p2.Lat());
203  double x2 = qMax(p1.Lng(), p2.Lng());
204  double y2 = qMin(p1.Lat(), p2.Lat());
205 
206  SetSelectedArea(internals::RectLatLng(y1, x1, x2 - x1, y1 - y2));
207  }
208  }
209  QGraphicsItem::mouseMoveEvent(event);
210  }
211  void MapGraphicItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
212  {
213  if(!IsMouseOverMarker())
214  {
215  if(event->button() == config->DragButton && CanDragMap()&& !((event->modifiers()==Qt::ShiftModifier)||(event->modifiers()==Qt::ControlModifier)))
216  {
217  core->mouseDown.SetX(event->pos().x());
218  core->mouseDown.SetY(event->pos().y());
219 
220 
221  this->setCursor(Qt::SizeAllCursor);
222 
223  core->BeginDrag(core->mouseDown);
224  this->update();
225 
226  }
227  else if(!isSelected && ((event->modifiers()==Qt::ControlModifier)||(event->modifiers()==Qt::ShiftModifier)))
228  {
229  isSelected = true;
230  SetSelectedArea (internals::RectLatLng::Empty);
231  selectionEnd = internals::PointLatLng::Empty;
232  selectionStart = FromLocalToLatLng(event->pos().x(), event->pos().y());
233  }
234  }
235  }
236  void MapGraphicItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
237  {
238  if(isSelected)
239  {
240  isSelected = false;
241  }
242 
243  if(core->IsDragging())
244  {
245  core->EndDrag();
246 
247  this->setCursor(Qt::ArrowCursor);
248  if(!BoundsOfMap.IsEmpty() && !BoundsOfMap.Contains(core->CurrentPosition()))
249  {
250  if(!core->LastLocationInBounds.IsEmpty())
251  {
252  core->SetCurrentPosition(core->LastLocationInBounds);
253  }
254  }
255  }
256  else
257  {
258  if(!selectionEnd.IsEmpty() && !selectionStart.IsEmpty())
259  {
260  if(!selectedArea.IsEmpty() && event->modifiers() == Qt::ShiftModifier)
261  {
262  SetZoomToFitRect(SelectedArea());
263  selectedArea=internals::RectLatLng::Empty;
264  }
265  }
266 
267  }
268  }
269  void MapGraphicItem::keyPressEvent(QKeyEvent *event)
270  {
271  if(event->modifiers()&(Qt::ShiftModifier|Qt::ControlModifier))
272  this->setCursor(Qt::CrossCursor);
273  if(event->key()==Qt::Key_Escape)
274  selectedArea=internals::RectLatLng::Empty;
275  QGraphicsItem::keyPressEvent(event);
276  }
277  void MapGraphicItem::keyReleaseEvent(QKeyEvent *event)
278  {
279  if((event->modifiers()&(Qt::ShiftModifier|Qt::ControlModifier))==0)
280  this->setCursor(Qt::ArrowCursor);
281  }
282  bool MapGraphicItem::SetZoomToFitRect(internals::RectLatLng const& rect)
283  {
284  int maxZoom = core->GetMaxZoomToFitRect(rect);
285  if(maxZoom > 0)
286  {
287  internals::PointLatLng center=internals::PointLatLng(rect.Lat()-(rect.HeightLat()/2), rect.Lng()+(rect.WidthLng()/2));
288  core->SetCurrentPosition(center);
289 //
290  if(maxZoom > MaxZoom())
291  {
292  maxZoom = MaxZoom();
293  }
294 
295  if((int) Zoom() != maxZoom)
296  {
297  SetZoom(maxZoom);
298  }
299 
300  return true;
301  }
302  return false;
303  }
304 
305  void MapGraphicItem::wheelEvent(QGraphicsSceneWheelEvent *event)
306  {
307 
308  if(!IsMouseOverMarker() && !IsDragging())
309  {
310  if(core->GetmouseLastZoom().X() != event->pos().x() && core->mouseLastZoom.Y() != event->pos().y())
311  {
312  if(GetMouseWheelZoomType() == internals::MouseWheelZoomType::MousePositionAndCenter)
313  {
314  core->SetCurrentPosition(FromLocalToLatLng(event->pos().x(), event->pos().y()));
315  }
316  else if(GetMouseWheelZoomType() == internals::MouseWheelZoomType::ViewCenter)
317  {
318  core->SetCurrentPosition(FromLocalToLatLng((qint64) maprect.width()/2, (qint64) maprect.height()/2));
319  }
320  else if(GetMouseWheelZoomType() == internals::MouseWheelZoomType::MousePositionWithoutCenter)
321  {
322  core->SetCurrentPosition(FromLocalToLatLng(event->pos().x(), event->pos().y()));
323 
324  }
325 
326  core->mouseLastZoom.SetX((event->pos().x()));
327  core->mouseLastZoom.SetY((event->pos().y()));
328  }
329 
330  // set mouse position to map center
331  if(GetMouseWheelZoomType() != internals::MouseWheelZoomType::MousePositionWithoutCenter)
332  {
333  {
334  // System.Drawing.Point p = PointToScreen(new System.Drawing.Point(Width/2, Height/2));
335  // Stuff.SetCursorPos((int) p.X, (int) p.Y);
336  }
337  }
338 
339  core->MouseWheelZooming = true;
340 
341  if(event->delta() > 0)
342  {
343  SetZoom(ZoomTotal()+1);
344  }
345  else if(event->delta() < 0)
346  {
347  SetZoom(ZoomTotal()-1);
348  }
349 
350  core->MouseWheelZooming = false;
351  }
352  }
353  void MapGraphicItem::DrawMap2D(QPainter *painter)
354  {
355  painter->drawImage(this->boundingRect(),dragons.toImage());
356  if(!lastimage.isNull())
357  painter->drawImage(core->GetrenderOffset().X()-lastimagepoint.X(),core->GetrenderOffset().Y()-lastimagepoint.Y(),lastimage);
358 
359  for(int i = -core->GetsizeOfMapArea().Width(); i <= core->GetsizeOfMapArea().Width(); i++)
360  {
361  for(int j = -core->GetsizeOfMapArea().Height(); j <= core->GetsizeOfMapArea().Height(); j++)
362  {
363  core->SettilePoint (core->GetcenterTileXYLocation());
364  core->SettilePoint(Point(core->GettilePoint().X()+ i,core->GettilePoint().Y()+j));
365  {
366  internals::Tile* t = core->Matrix.TileAt(core->GettilePoint());
367  if(true)
368  {
369  core->tileRect.SetX(core->GettilePoint().X()*core->tileRect.Width());
370  core->tileRect.SetY(core->GettilePoint().Y()*core->tileRect.Height());
371  core->tileRect.Offset(core->GetrenderOffset());
372  if(core->GetCurrentRegion().IntersectsWith(core->tileRect))
373  {
374  bool found = false;
375 
376  // render tile
377  //lock(t.Overlays)
378  if(t!=nullptr)
379  {
380  foreach(QByteArray img,t->Overlays)
381  {
382  if(img.count()!=0)
383  {
384  if(!found)
385  found = true;
386  {
387  painter->drawPixmap(core->tileRect.X(),core->tileRect.Y(), core->tileRect.Width(), core->tileRect.Height(),PureImageProxy::FromStream(img));
388  }
389  }
390  }
391  }
392 
393  if(showTileGridLines)
394  {
395  painter->setPen(config->EmptyTileBorders);
396  painter->drawRect(core->tileRect.X(), core->tileRect.Y(), core->tileRect.Width(), core->tileRect.Height());
397  {
398  painter->setFont(config->MissingDataFont);
399  painter->setPen(Qt::red);
400  painter->drawText(QRectF(core->tileRect.X(), core->tileRect.Y(), core->tileRect.Width(), core->tileRect.Height()),Qt::AlignCenter,(core->GettilePoint() == core->GetcenterTileXYLocation()? "CENTER: " :"TILE: ")+core->GettilePoint().ToString());
401  }
402  }
403 
404  // add text if tile is missing
405  if(false)
406  {
407 
408  painter->fillRect(QRectF(core->tileRect.X(), core->tileRect.Y(), core->tileRect.Width(), core->tileRect.Height()),config->EmptytileBrush);
409  painter->setFont(config->MissingDataFont);
410  painter->drawText(QRectF(core->tileRect.X(), core->tileRect.Y(), core->tileRect.Width(), core->tileRect.Height()),config->EmptyTileText);
411 
412 
413 
414  painter->setPen(config->EmptyTileBorders);
415  painter->drawRect(core->tileRect.X(), core->tileRect.Y(), core->tileRect.Width(), core->tileRect.Height());
416 
417  // raise error
418 
419  }
420  if(!SelectedArea().IsEmpty())
421  {
422  core::Point p1 = FromLatLngToLocal(SelectedArea().LocationTopLeft());
423  core::Point p2 = FromLatLngToLocal(SelectedArea().LocationRightBottom());
424  int x1 = p1.X();
425  int y1 = p1.Y();
426  int x2 = p2.X();
427  int y2 = p2.Y();
428  painter->setPen(Qt::black);
429  painter->setBrush(QBrush(QColor(50,50,100,20)));
430  painter->drawRect(x1,y1,x2-x1,y2-y1);
431  }
432  }
433  }
434  }
435  }
436  }
437  }
438 
439  //TODO: Document this function
440  core::Point MapGraphicItem::FromLatLngToLocal(internals::PointLatLng const& point)
441  {
442  core::Point ret = core->FromLatLngToLocal(point);
443 
444  //TODO: Document this if statment
445  if(MapRenderTransform!=1)
446  {
447  ret.SetX((qint64) round(ret.X() * MapRenderTransform));
448  ret.SetY((qint64) round(ret.Y() * MapRenderTransform));
449  ret.SetX(round(ret.X()-((boundingRect().width()*MapRenderTransform)-(boundingRect().width()))/2));
450  ret.SetY(round(ret.Y()-((boundingRect().height()*MapRenderTransform)-(boundingRect().height()))/2));
451 
452 
453  }
454  return ret;
455  }
462  internals::PointLatLng MapGraphicItem::FromLocalToLatLng(qint64 x, qint64 y)
463  {
464  if(MapRenderTransform!=1)
465  {
466  x=x+((boundingRect().width()*MapRenderTransform)-(boundingRect().width()))/2;
467  y=y+((boundingRect().height()*MapRenderTransform)-(boundingRect().height()))/2;
468 
469  x = (qint64) round(x / MapRenderTransform);
470  y = (qint64) round(y / MapRenderTransform);
471  }
472 
473  return core->FromLocalToLatLng(x, y);
474  }
475 
476  double MapGraphicItem::Zoom()
477  {
478  return zoomReal;
479  }
480  double MapGraphicItem::ZoomDigi()
481  {
482  return zoomDigi;
483  }
484  double MapGraphicItem::ZoomTotal()
485  {
486  return zoomDigi+zoomReal;
487  }
488 
489  void MapGraphicItem::SetZoom(double const& value)
490  {
491  if(ZoomTotal() != value)
492  {
493  //Saturate zoom, including digital zoom
494  if(value > MaxZoom())
495  {
496  zoomReal = MaxZoom();
497  zoomDigi = value-MaxZoom();
498  }
499  else if(value < MinZoom())
500  {
501  zoomDigi=0;
502  zoomReal = MinZoom();
503  }
504  else
505  {
506  zoomDigi=0;
507  zoomReal = value;
508  }
509 
510  //Handle digital zoom and non-integer zoom values
511  double integer;
512  double remainder = modf (value , &integer);
513  if(zoomDigi !=0 || remainder != 0)
514  {
515  float scaleValue = zoomDigi+remainder + 1;
516  MapRenderTransform = scaleValue;
517  if(integer>MaxZoom()){
518  integer=MaxZoom();
519  }
520  SetZoomStep((qint32)(integer));
521  // core->GoToCurrentPositionOnZoom();
522  this->update();
523  }
524  else
525  {
526  MapRenderTransform = 1;
527 
528  SetZoomStep ((qint32)(value));
529  zoomReal = ZoomStep();
530  this->update();
531  }
532  }
533  }
535  {
536  return core->Zoom();
537  }
538  void MapGraphicItem::SetZoomStep(qint32 const& value)
539  {
540  if((value - core->Zoom()) > 0 && value<= MaxZoom())
541  ConstructLastImage(value - core->Zoom());
542  else if(value!=MaxZoom())
543  lastimage=QImage();
544 
545  if(value > MaxZoom())
546  {
547  core->SetZoom(MaxZoom());
548  emit zoomChanged(MaxZoom()+ZoomDigi(),Zoom(),ZoomDigi());
549  }
550  else if(value < MinZoom())
551  {
552  core->SetZoom(MinZoom());
553  emit zoomChanged(MinZoom()+ZoomDigi(),Zoom(),ZoomDigi());
554  }
555  else
556  {
557  core->SetZoom(value);
558  emit zoomChanged(value+ZoomDigi(), Zoom(), ZoomDigi());;
559  }
560 
561  }
562 
563  void MapGraphicItem::Offset(qint64 const& x, qint64 const& y)
564  {
565  core->DragOffset(Point(x, y));
566  }
567  void MapGraphicItem::mapRotate(qreal angle)
568  {
569  if (rotation != angle) {
570  rotation=angle;
571  resize(scene()->sceneRect());
572  }
573  }
574  QRectF MapGraphicItem::boundingBox(const QRectF &rect, const qreal &angle)
575  {
576  QRectF ret(rect);
577  float c=cos(angle*2*M_PI/360);
578  float s=sin(angle*2*M_PI/360);
579  ret.setHeight(rect.height()*fabs(c)+rect.width()*fabs(s));
580  ret.setWidth(rect.width()*fabs(c)+rect.height()*fabs(s));
581  return ret;
582  }
583  QSize MapGraphicItem::sizeHint()const
584  {
585  core::Size size=core->projection->GetTileMatrixMaxXY(MinZoom());
586  core::Size tilesize=core->projection->TileSize();
587  QSize rsize((size.Width()+1)*tilesize.Width(),(size.Height()+1)*tilesize.Height());
588  return rsize;
589  }
590 }
double HeightLat() const
Definition: rectlatlng.h:130
A graphicsItem representing a WayPoint.
qint64 X() const
Definition: point.h:51
Qt::MouseButton DragButton
Button used for dragging.
Definition: configuration.h:94
virtual Size TileSize() const =0
qint64 Height() const
Definition: size.h:55
void resize(QRectF const &rect=QRectF())
To be called when the scene size changes.
void childSetOpacity(qreal value)
void zoomChanged(double zoomtotal, double zoomreal, double zoomdigi)
void SetZoomStep(qint32 const &value)
Sets map zoom.
const char t[]
Definition: coreconstants.h:40
PointLatLng CurrentPosition() const
Definition: core.h:79
void SetY(const qint32 &value)
Definition: rectangle.h:68
void SetX(const qint64 &value)
Definition: point.h:53
PointLatLng FromLocalToLatLng(qint64 const &x, qint64 const &y)
Definition: core.cpp:480
core::Point GetcenterTileXYLocation()
Definition: core.h:89
int ZoomStep() const
Returns current map zoom.
void keyPressEvent(QKeyEvent *event)
void SettilePoint(const core::Point &value)
Definition: core.h:126
void SetZoom(int const &value)
Definition: core.cpp:235
void SetY(const qint64 &value)
Definition: point.h:54
for i
Definition: OPPlots.m:140
bool Contains(double const &lat, double const &lng)
Definition: rectlatlng.h:162
Rectangle GetCurrentRegion()
Definition: core.h:128
bool IsDragging() const
Definition: core.h:142
core::Point GetrenderOffset()
Definition: core.h:86
QList< QByteArray > Overlays
Definition: tile.h:56
void SetCurrentPosition(const PointLatLng &value)
Definition: core.cpp:263
double Lat() const
Definition: rectlatlng.h:111
void mousePressEvent(QGraphicsSceneMouseEvent *event)
void Drag(core::Point const &pt)
Definition: core.cpp:612
void keyReleaseEvent(QKeyEvent *event)
void OnMapSizeChanged(int const &width, int const &height)
Definition: core.cpp:423
The main graphicsItem used on the widget, contains the map and map logic.
Point FromLatLngToLocal(PointLatLng const &latlng)
Definition: core.cpp:486
void DragOffset(core::Point const &offset)
Definition: core.cpp:592
double Lng() const
Definition: pointlatlng.h:76
double Lat() const
Definition: pointlatlng.h:64
QBrush EmptytileBrush
Used to draw empty map tiles.
Definition: configuration.h:57
A graphicsItem representing a Home Location.
void StartSystem()
Definition: core.cpp:405
int Zoom() const
Definition: core.h:144
Size GetsizeOfMapArea()
Definition: core.h:113
void Offset(const core::Point &pos)
Definition: rectangle.h:134
void wheelEvent(QGraphicsSceneWheelEvent *event)
static PointLatLng Empty
Definition: pointlatlng.h:50
qint64 Width() const
Definition: size.h:54
double WidthLng() const
Definition: rectlatlng.h:121
void BeginDrag(core::Point const &pt)
Definition: core.cpp:513
core::Point GettilePoint()
Definition: core.h:125
QString EmptyTileText
Used for empty tiles text.
Definition: configuration.h:63
bool IsEmpty() const
Definition: rectlatlng.h:158
Tile * TileAt(const core::Point &p)
Definition: tilematrix.cpp:127
A graphicsItem representing a WayPoint.
QString ToString() const
Definition: point.h:55
core::Point GetmouseLastZoom()
Definition: core.h:104
virtual Size GetTileMatrixMaxXY(const int &zoom)=0
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
QPen EmptyTileBorders
Used to draw empty tile borders.
Definition: configuration.h:69
int GetMaxZoomToFitRect(RectLatLng const &rect)
Definition: core.cpp:492
static RectLatLng Empty
Definition: rectlatlng.h:40
void GoToCurrentPosition()
Definition: core.cpp:547
void SetMapType(MapType::Types const &value)
Definition: core.cpp:301
TileMatrix Matrix
Definition: core.h:194
x
Definition: OPPlots.m:100
bool IntersectsWith(const Rectangle &rect)
Definition: rectangle.h:126
void SetX(const qint32 &value)
Definition: rectangle.h:67
double Lng() const
Definition: rectlatlng.h:100
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
qint64 Y() const
Definition: point.h:52
void EndDrag()
Definition: core.cpp:519
void SetCurrentRegion(const Rectangle &value)
Definition: core.h:129
y
Definition: OPPlots.m:101