dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
tlmapwidget.cpp
Go to the documentation of this file.
1 
14 /*
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * for more details.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, see <http://www.gnu.org/licenses/>
27 *
28 * Additional note on redistribution: The copyright and license notices above
29 * must be maintained in each individual source file that is a derivative work
30 * of this source file; otherwise redistribution is prohibited.
31 */
32 
33 #include "tlmapwidget.h"
34 #include <QtGui>
35 #include <QMetaObject>
36 #include "waypointitem.h"
37 
38 namespace mapcontrol
39 {
40 
41  TLMapWidget::TLMapWidget(QWidget *parent, Configuration *config) : QGraphicsView(parent),
42  configuration(config),UAV(nullptr),GPS(nullptr),Home(nullptr),followmouse(true),
43  compassRose(nullptr),windCompass(nullptr),showuav(false),showhome(false),
44  diagTimer(nullptr),diagGraphItem(nullptr),showDiag(false),overlayOpacity(1),
45  windspeedTxt(nullptr)
46  {
47  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
48  this->setScene(new QGraphicsScene(this));
49 
50  core=new internals::Core;
51  map=new MapGraphicItem(core,config);
52 
53  scene()->addItem(map);
54  Home=new HomeItem(map,this);
55  Home->setParentItem(map);
56  Home->setZValue(-1);
57 
58  setStyleSheet("QToolTip {font-size:8pt; color:blue;opacity: 223; padding:2px; border-width:2px; border-style:solid; border-color: rgb(170, 170, 127);border-radius:4px }");
59 
60  connect(map,SIGNAL(zoomChanged(double,double,double)),this,SIGNAL(zoomChanged(double,double,double)));
62  connect(map->core,SIGNAL(OnEmptyTileError(int,core::Point)),this,SIGNAL(OnEmptyTileError(int,core::Point)));
63  connect(map->core,SIGNAL(OnMapDrag()),this,SIGNAL(OnMapDrag()));
64  connect(map->core,SIGNAL(OnMapTypeChanged(MapType::Types)),this,SIGNAL(OnMapTypeChanged(MapType::Types)));
65  connect(map->core,SIGNAL(OnMapZoomChanged()),this,SIGNAL(OnMapZoomChanged()));
66  connect(map->core,SIGNAL(OnTileLoadComplete()),this,SIGNAL(OnTileLoadComplete()));
67  connect(map->core,SIGNAL(OnTileLoadStart()),this,SIGNAL(OnTileLoadStart()));
68  connect(map->core,SIGNAL(OnTilesStillToLoad(int)),this,SIGNAL(OnTilesStillToLoad(int)));
69  connect(map,SIGNAL(wpdoubleclicked(WayPointItem*)),this,SIGNAL(OnWayPointDoubleClicked(WayPointItem*)));
70  connect(scene(),SIGNAL(selectionChanged()),this,SLOT(OnSelectionChanged()));
71  SetShowDiagnostics(showDiag);
72  this->setMouseTracking(followmouse);
73  SetShowCompassRose(true);
74  SetShowWindCompass(false);
75  QPixmapCache::setCacheLimit(64*1024);
76 
77  this->adjustSize();
78  }
79 
80  void TLMapWidget::SetShowDiagnostics(bool const& value)
81  {
82  showDiag=value;
83  if(!showDiag)
84  {
85  if(diagGraphItem!=nullptr)
86  {
87  delete diagGraphItem;
88  diagGraphItem=nullptr;
89  }
90  if(diagTimer!=nullptr)
91  {
92  delete diagTimer;
93  diagTimer=nullptr;
94  }
95 
96  if(GPS!=nullptr)
97  {
98  delete GPS;
99  GPS=nullptr;
100  }
101  }
102  else
103  {
104  diagTimer=new QTimer();
105  connect(diagTimer,SIGNAL(timeout()),this,SLOT(diagRefresh()));
106  diagTimer->start(500);
107  if(GPS==nullptr)
108  {
109  GPS=new GPSItem(map,this);
110  GPS->setParentItem(map);
111  setOverlayOpacity(overlayOpacity);
112  }
113  }
114 
115  }
116 
117  void TLMapWidget::SetUavPic(QString UAVPic)
118  {
119  if(UAV!=nullptr)
120  UAV->SetUavPic(UAVPic);
121  if(GPS!=nullptr)
122  GPS->SetUavPic(UAVPic);
123  }
124 
126  {
127  if(!from|!to)
128  return NULL;
129  MapLine* ret= new MapLine(from,to,map,color);
130  ret->setOpacity(overlayOpacity);
131  return ret;
132  }
133 
135  {
136  if(!from|!to)
137  return NULL;
138  MapLine* ret= new MapLine(from,to,map,color);
139  ret->setOpacity(overlayOpacity);
140  return ret;
141  }
142 
152  WayPointCurve * TLMapWidget::WPCurveCreate(WayPointItem *start, WayPointItem *dest, double radius, bool clockwise, QColor color)
153  {
154  if (!start || !dest)
155  return NULL;
156  WayPointCurve *ret = new WayPointCurve(start, dest, radius, clockwise, map, color);
157  ret->setOpacity(overlayOpacity);
158  return ret;
159  }
160 
161  MapCircle *TLMapWidget::WPCircleCreate(WayPointItem *center, WayPointItem *radius, bool clockwise, QColor color)
162  {
163  if(!center|!radius)
164  return NULL;
165  MapCircle* ret= new MapCircle(center,radius,clockwise,map,color);
166  ret->setOpacity(overlayOpacity);
167  return ret;
168  }
169 
170  MapCircle *TLMapWidget::WPCircleCreate(HomeItem *center, WayPointItem *radius, bool clockwise,QColor color)
171  {
172  if(!center|!radius)
173  return NULL;
174  MapCircle* ret= new MapCircle(center,radius,clockwise,map,color);
175  ret->setOpacity(overlayOpacity);
176  return ret;
177  }
178 
179  void TLMapWidget::SetShowUAV(const bool &value)
180  {
181  if(value && UAV==nullptr)
182  {
183  UAV=new UAVItem(map,this);
184  UAV->setParentItem(map);
186  connect(this,SIGNAL(UAVReachedWayPoint(int,WayPointItem*)),UAV,SIGNAL(UAVReachedWayPoint(int,WayPointItem*)));
187  UAV->setOpacity(overlayOpacity);
188  }
189  else if(!value)
190  {
191  if(UAV!=nullptr)
192  {
193  delete UAV;
194  UAV=NULL;
195  }
196 
197  }
198  }
199 
200  void TLMapWidget::SetShowHome(const bool &value)
201  {
202  Home->setVisible(value);
203  }
204 
205  void TLMapWidget::resizeEvent(QResizeEvent *event)
206  {
207  if (scene())
208  scene()->setSceneRect(
209  QRect(QPoint(0, 0), event->size()));
210  QGraphicsView::resizeEvent(event);
211 
212  if(compassRose)
213  compassRose->setScale(0.1+0.05*(qreal)(event->size().width())/1000*(qreal)(event->size().height())/600);
214  if(windCompass) {
215  windCompass->setPos(70 - windCompass->boundingRect().width()/2, this->size().height() - 70 - windCompass->boundingRect().height()/2);
216  windspeedTxt->setPos(73 - windCompass->boundingRect().width()/2 * windCompass->scale(), this->size().height() - windCompass->boundingRect().height()/2 * windCompass->scale() - 30);
217  }
218 
219  }
220 
221  QSize TLMapWidget::sizeHint() const
222  {
223  return map->sizeHint();
224  }
225 
226  void TLMapWidget::showEvent(QShowEvent *event)
227  {
228  connect(scene(),SIGNAL(sceneRectChanged(QRectF)),map,SLOT(resize(QRectF)));
229  map->start();
230  QGraphicsView::showEvent(event);
231  }
232 
234  {
235  if(UAV)
236  delete UAV;
237  if(Home)
238  delete Home;
239  if(map)
240  delete map;
241  if(core)
242  delete core;
243  if(configuration)
244  delete configuration;
245  foreach(QGraphicsItem* i,this->items())
246  {
247  if(i)
248  delete i;
249  }
250  }
251 
252  void TLMapWidget::closeEvent(QCloseEvent *event)
253  {
254  core->OnMapClose();
255  event->accept();
256  }
257 
259  {
260  return currentmouseposition;
261  }
262 
263  void TLMapWidget::mouseMoveEvent(QMouseEvent *event)
264  {
265  QGraphicsView::mouseMoveEvent(event);
266  QPointF p=event->pos();
267  p=map->mapFromParent(p);
268  currentmouseposition=map->FromLocalToLatLng(p.x(),p.y());
269  }
270 
273  {
274  WayPointItem* item=new WayPointItem(this->CurrentPosition(),0,map);
275  ConnectWP(item);
276  item->setParentItem(map);
277  int position=item->Number();
278  emit WPCreated(position,item);
279  return item;
280  }
281 
283  {
284  WayPointItem* item=new WayPointItem(map,true);
285  item->SetShowNumber(false);
286  item->setParentItem(map);
287  return item;
288  }
289 
291  {
292  ConnectWP(item);
293  item->setParentItem(map);
294  int position=item->Number();
295  emit WPCreated(position,item);
296  setOverlayOpacity(overlayOpacity);
297  }
298 
299  WayPointItem* TLMapWidget::WPCreate(internals::PointLatLng const& coord,int const& altitude)
300  {
301  WayPointItem* item=new WayPointItem(coord,altitude,map);
302  ConnectWP(item);
303  item->setParentItem(map);
304  int position=item->Number();
305  emit WPCreated(position,item);
306  setOverlayOpacity(overlayOpacity);
307  return item;
308  }
309 
310  WayPointItem* TLMapWidget::WPCreate(internals::PointLatLng const& coord,int const& altitude, QString const& description)
311  {
312  WayPointItem* item=new WayPointItem(coord,altitude,description,map);
313  ConnectWP(item);
314  item->setParentItem(map);
315  int position=item->Number();
316  emit WPCreated(position,item);
317  setOverlayOpacity(overlayOpacity);
318  return item;
319  }
320 
321  WayPointItem* TLMapWidget::WPCreate(const distBearingAltitude &relativeCoord, const QString &description)
322  {
323  WayPointItem* item=new WayPointItem(relativeCoord,description,map);
324  ConnectWP(item);
325  item->setParentItem(map);
326  int position=item->Number();
327  emit WPCreated(position,item);
328  setOverlayOpacity(overlayOpacity);
329  return item;
330  }
331 
332  WayPointItem* TLMapWidget::WPInsert(const int &position)
333  {
334  WayPointItem* item=new WayPointItem(this->CurrentPosition(),0,map);
335  item->SetNumber(position);
336  ConnectWP(item);
337  item->setParentItem(map);
338  emit WPInserted(position,item);
339  setOverlayOpacity(overlayOpacity);
340  return item;
341  }
342 
343  void TLMapWidget::WPInsert(WayPointItem* item,const int &position)
344  {
345  item->SetNumber(position);
346  ConnectWP(item);
347  item->setParentItem(map);
348  emit WPInserted(position,item);
349  setOverlayOpacity(overlayOpacity);
350  }
351 
352  WayPointItem* TLMapWidget::WPInsert(internals::PointLatLng const& coord,int const& altitude,const int &position)
353  {
354  WayPointItem* item=new WayPointItem(coord,altitude,map);
355  item->SetNumber(position);
356  ConnectWP(item);
357  item->setParentItem(map);
358  emit WPInserted(position,item);
359  setOverlayOpacity(overlayOpacity);
360  return item;
361  }
362 
363  WayPointItem* TLMapWidget::WPInsert(internals::PointLatLng const& coord,int const& altitude, QString const& description,const int &position)
364  {
365  internals::PointLatLng mcoord;
366  bool reloc=false;
367  if(coord==internals::PointLatLng(0,0))
368  {
369  mcoord=CurrentPosition();
370  reloc=true;
371  }
372  else
373  mcoord=coord;
374  WayPointItem* item=new WayPointItem(mcoord,altitude,description,map);
375  item->SetNumber(position);
376  ConnectWP(item);
377  item->setParentItem(map);
378  emit WPInserted(position,item);
379  if(reloc)
380  emit WPValuesChanged(item);
381  setOverlayOpacity(overlayOpacity);
382  return item;
383  }
384 
385  WayPointItem* TLMapWidget::WPInsert(distBearingAltitude const& relative, QString const& description,const int &position)
386  {
387  WayPointItem* item=new WayPointItem(relative,description,map);
388  item->SetNumber(position);
389  ConnectWP(item);
390  item->setParentItem(map);
391  emit WPInserted(position,item);
392  setOverlayOpacity(overlayOpacity);
393  return item;
394  }
395 
397  {
398  emit WPDeleted(item->Number(),item);
399  delete item;
400  }
401 
402  void TLMapWidget::WPDelete(int number)
403  {
404  foreach(QGraphicsItem* i,map->childItems())
405  {
406  WayPointItem* w=qgraphicsitem_cast<WayPointItem*>(i);
407  if(w)
408  {
409  if(w->Number()==number)
410  {
411  emit WPDeleted(w->Number(),w);
412  delete w;
413  return;
414  }
415  }
416  }
417  }
418 
420  {
421  foreach(QGraphicsItem* i,map->childItems())
422  {
423  WayPointItem* w=qgraphicsitem_cast<WayPointItem*>(i);
424  if(w)
425  {
426  if(w->Number()==number)
427  {
428  return w;
429  }
430  }
431  }
432  return NULL;
433  }
434 
436  {
437  foreach(QGraphicsItem* i,map->childItems())
438  {
439  WayPointItem* w=qgraphicsitem_cast<WayPointItem*>(i);
440  if(w)
441  {
442  if(w->Number()!=-1)
443  w->setVisible(value);
444  }
445  }
446  }
447 
449  {
450  foreach(QGraphicsItem* i,map->childItems())
451  {
452  WayPointItem* w=qgraphicsitem_cast<WayPointItem*>(i);
453  if(w)
454  {
455  if(w->Number()!=-1)
456  {
457  emit WPDeleted(w->Number(),w);
458  delete w;
459  }
460  }
461  }
462  }
463 
465  {
466  foreach(QGraphicsItem* i,map->childItems())
467  {
468  WayPointItem* w=qgraphicsitem_cast<WayPointItem*>(i);
469  if(w)
470  {
471  if(w->Number()!=-1)
472  {
473  return true;
474  }
475  }
476  }
477  return false;
478  }
479 
481  {
482  foreach(QGraphicsItem* i,map->childItems())
483  {
484  MapLine* w=qgraphicsitem_cast<MapLine*>(i);
485  if(w)
486  w->deleteLater();
487  else
488  {
489  MapCircle* ww=qgraphicsitem_cast<MapCircle*>(i);
490  if(ww)
491  ww->deleteLater();
492  }
493  }
494  }
495 
497  {
499  foreach(QGraphicsItem* i,scene()->selectedItems())
500  {
501  WayPointItem* w=qgraphicsitem_cast<WayPointItem*>(i);
502  if(w)
503  list.append(w);
504  }
505  return list;
506  }
507 
508  void TLMapWidget::WPRenumber(WayPointItem *item, const int &newnumber)
509  {
510  item->SetNumber(newnumber);
511  }
512 
513  void TLMapWidget::ConnectWP(WayPointItem *item)
514  {
515  connect(item,SIGNAL(WPNumberChanged(int,int,WayPointItem*)),this,SIGNAL(WPNumberChanged(int,int,WayPointItem*)),Qt::DirectConnection);
516  connect(item,SIGNAL(WPValuesChanged(WayPointItem*)),this,SIGNAL(WPValuesChanged(WayPointItem*)),Qt::DirectConnection);
517  connect(item,SIGNAL(manualCoordChange(WayPointItem*)),this,SIGNAL(WPManualCoordChange(WayPointItem*)),Qt::DirectConnection);
518  connect(this,SIGNAL(WPInserted(int,WayPointItem*)),item,SLOT(WPInserted(int,WayPointItem*)),Qt::DirectConnection);
519  connect(this,SIGNAL(WPNumberChanged(int,int,WayPointItem*)),item,SLOT(WPRenumbered(int,int,WayPointItem*)),Qt::DirectConnection);
520  connect(this,SIGNAL(WPDeleted(int,WayPointItem*)),item,SLOT(WPDeleted(int,WayPointItem*)),Qt::DirectConnection);
521  }
522 
523  void TLMapWidget::diagRefresh()
524  {
525  if(showDiag)
526  {
527  if(diagGraphItem==nullptr)
528  {
529  diagGraphItem=new QGraphicsTextItem();
530  scene()->addItem(diagGraphItem);
531  diagGraphItem->setPos(10,100);
532  diagGraphItem->setZValue(3);
533  diagGraphItem->setFlag(QGraphicsItem::ItemIsMovable,true);
534  diagGraphItem->setDefaultTextColor(Qt::yellow);
535  }
536  diagGraphItem->setPlainText(core->GetDiagnostics().toString());
537  }
538  else
539  if(diagGraphItem!=nullptr)
540  {
541  delete diagGraphItem;
542  diagGraphItem=nullptr;
543  }
544  }
545 
547 
551  void TLMapWidget::SetShowCompassRose(const bool &value)
552  {
553  if(value && !compassRose)
554  {
555  compassRose=new QGraphicsSvgItem(QString::fromUtf8(":/markers/images/compass.svg"));
556  compassRose->setScale(0.1+0.05*(qreal)(this->size().width())/1000*(qreal)(this->size().height())/600);
557  compassRose->setFlag(QGraphicsItem::ItemIsMovable,false);
558  compassRose->setFlag(QGraphicsItem::ItemIsSelectable,false);
559  scene()->addItem(compassRose);
560  compassRose->setTransformOriginPoint(compassRose->boundingRect().width()/2,compassRose->boundingRect().height()/2);
561  compassRose->setPos(55-compassRose->boundingRect().width()/2,55-compassRose->boundingRect().height()/2);
562  compassRose->setZValue(3);
563  compassRose->setOpacity(0.7);
564  }
565  if(!value && compassRose)
566  {
567  delete compassRose;
568  compassRose=nullptr;
569  }
570  }
571 
576  void TLMapWidget::SetShowWindCompass(const bool &value)
577  {
578  if (value && !windCompass) {
579  windCompass=new QGraphicsSvgItem(QString::fromUtf8(":/markers/images/wind_compass.svg"));
580  windCompass->setScale(120/windCompass->boundingRect().width()); // A constant 120 pixels large
581  windCompass->setFlag(QGraphicsItem::ItemIsMovable, false);
582  windCompass->setFlag(QGraphicsItem::ItemIsSelectable, false);
583  windCompass->setTransformOriginPoint(windCompass->boundingRect().width()/2, windCompass->boundingRect().height()/2);
584  windCompass->setZValue(compassRose->zValue() + 1);
585  windCompass->setOpacity(0.70);
586  scene()->addItem(windCompass);
587 
588  // Add text
589  windspeedTxt = new QGraphicsTextItem();
590  windspeedTxt->setDefaultTextColor(QColor("Black"));
591  windspeedTxt->setZValue(compassRose->zValue() + 2);
592 
593  scene()->addItem(windspeedTxt);
594 
595  // Reset and position
596  double dummyWind[3] = {0,0,0};
597  setWindVelocity(dummyWind);
598  windCompass->setPos(70 - windCompass->boundingRect().width()/2, this->size().height() - 70 - windCompass->boundingRect().height()/2);
599  windspeedTxt->setPos(73 - windCompass->boundingRect().width()/2 * windCompass->scale(), this->size().height() - windCompass->boundingRect().height()/2 * windCompass->scale() - 30);
600  }
601 
602  if (!value && windCompass) {
603  delete windspeedTxt;
604  delete windCompass;
605  windCompass=nullptr;
606  }
607  }
608 
609  void TLMapWidget::setWindVelocity(double windVelocity_NED[3])
610  {
611  double windAngle_D = atan2(windVelocity_NED[1], windVelocity_NED[0]) * RAD2DEG;
612  if (windAngle_D < 0) // Wrap to [0,360)
613  windAngle_D = windAngle_D + 360;
614 
615  if (windspeedTxt != NULL)
616  windspeedTxt->setPlainText(QString("%1%2 @ %3m/s\nsink: %4m/s").arg(windAngle_D, 3, 'f', 0, QChar(0x30)).arg(QChar(0x00B0)).arg(sqrt(pow(windVelocity_NED[0], 2) + pow(windVelocity_NED[1], 2)), 3, 'f', 1).arg(windVelocity_NED[2], 0, 'f', 1)); // 0x00B0 is unicode for the degree symbol.
617 
618  if (windCompass != NULL)
619  windCompass->setRotation(windAngle_D);
620  }
621 
622 
624  {
625  map->setOverlayOpacity(value);
626  overlayOpacity=value;
627  }
628 
629  void TLMapWidget::SetRotate(qreal const& value)
630  {
631  map->mapRotate(value);
632  if(compassRose && (compassRose->rotation() != value)) {
633  compassRose->setRotation(value);
634  }
635  if(windCompass && (windCompass->rotation() != value)) {
636  windCompass->setRotation(value);
637  }
638  }
639 
641  {
642  new MapRipper(core,map->SelectedArea());
643  }
644 
646  {
647  this->scene()->clearSelection();
648  foreach(WayPointItem * wp,list)
649  {
650  wp->setSelected(true);
651  }
652  }
653 
655  {
657  QList<WayPointItem*> wplist;
658  list=this->scene()->selectedItems();
659  foreach(QGraphicsItem* item,list)
660  {
661  WayPointItem * wp=qgraphicsitem_cast<WayPointItem*>(item);
662  if(wp)
663  wplist.append(wp);
664  }
665  if(wplist.length()>0)
666  emit selectedWPChanged(wplist);
667  }
668 }
void WPValuesChanged(WayPointItem *waypoint)
Fired when the description, altitude or coordinates of a WayPoint changed.
void OnWayPointDoubleClicked(WayPointItem *waypoint)
void SetShowDiagnostics(bool const &value)
Definition: tlmapwidget.cpp:80
void showEvent(QShowEvent *event)
A graphicsItem representing a WayPoint.
The Map Widget, this is the part exposed to the user.
void SetShowUAV(bool const &value)
Configuration * configuration
Definition: tlmapwidget.h:247
void OnMapDrag()
Fires when the map is dragged.
diagnostics GetDiagnostics()
Definition: core.cpp:226
void selectedWPChanged(QList< WayPointItem * >)
void closeEvent(QCloseEvent *event)
void OnEmptyTileError(int zoom, core::Point pos)
Fires when an error ocurred while loading a tile.
void WPRenumber(WayPointItem *item, int const &newnumber)
Renumbers the WayPoint and all others as needed.
internals::PointLatLng CurrentPosition() const
Definition: tlmapwidget.h:224
MapLine * WPLineCreate(WayPointItem *from, WayPointItem *to, QColor color)
Create a line between two waypoint items.
Q_ENUMS(internals::MouseWheelZoomType::Types) Q_ENUMS(core TLMapWidget(QWidget *parent=nullptr, Configuration *config=new Configuration)
Constructor.
Definition: tlmapwidget.cpp:41
void WPDelete(WayPointItem *item)
Deletes the WayPoint.
for i
Definition: OPPlots.m:140
void SetShowHome(bool const &value)
void zoomChanged(double zoomt, double zoom, double zoomd)
WayPointItem * magicWPCreate()
WayPointItem * WPFind(int number)
void resizeEvent(QResizeEvent *event)
void WPDeleteAll()
deletes all WayPoints
void setWindVelocity(double windVelocity_NED[3])
void SetShowWindCompass(bool const &value)
TLMapWidget::SetShowWindCompass Shows the compass rose on the map.
void OnTileLoadStart()
Fires when tiles loading begins.
void WPCreated(int const &number, WayPointItem *waypoint)
internals::PointLatLng currentMousePosition()
void SetUavPic(QString UAVPic)
QString toString()
Definition: diagnostics.h:40
void OnMapZoomChanged()
Fires when map zoom changes.
A class that centralizes most of the mapcontrol configurations.
Definition: configuration.h:48
The WayPointCurve class draws an arc between two graphics items of a given radius and direction of cu...
Definition: waypointcurve.h:40
void WPDeleted(int const &number, WayPointItem *waypoint)
Fires When a WayPoint is deleted.
void RipMap()
Ripps the current selection to the DB.
The main graphicsItem used on the widget, contains the map and map logic.
MapCircle * WPCircleCreate(WayPointItem *center, WayPointItem *radius, bool clockwise, QColor color)
Create a circle around a waypoint with the radius specified by the distance to another waypoint...
void mouseMoveEvent(QMouseEvent *event)
WayPointCurve * WPCurveCreate(WayPointItem *start, WayPointItem *dest, double radius, bool clockwise, QColor color)
Create a curve from one waypoint item to another with a given radius.
QList< WayPointItem * > WPSelected()
Returns the currently selected WayPoints.
void SetRotate(qreal const &value)
void OnTilesStillToLoad(int number)
Fires when the number of tiles in the load queue changes.
RAD2DEG
Definition: OPPlots.m:106
WayPointItem * WPInsert(int const &position)
Inserts a new WayPoint on the specified position.
A QGraphicsItem representing a WayPoint.
Definition: waypointitem.h:41
WayPointItem * WPCreate()
Creates a new WayPoint on the center of the map.
void WPInserted(int const &number, WayPointItem *waypoint)
Fires when a new WayPoint is inserted.
void WPManualCoordChange(WayPointItem *)
Definition: icore.h:39
void UAVReachedWayPoint(int const &waypointnumber, WayPointItem *waypoint)
Fires When a WayPoint is Reached.
void OnMapClose()
Definition: core.cpp:440
void OnCurrentPositionChanged(internals::PointLatLng point)
Fires when map position changes.
void WPNumberChanged(int const &oldnumber, int const &newnumber, WayPointItem *waypoint)
fires when one of the WayPoints numbers changes (not fired if due to a auto-renumbering) ...
void setSelectedWP(QList< WayPointItem * > list)
A QGraphicsItem representing the UAV.
Definition: uavitem.h:48
void setOverlayOpacity(qreal value)
void OnTileLoadComplete()
Fires when there are no more tiles to load.
void OnMapTypeChanged(MapType::Types type)
Fires when map type changes.
void UAVLeftSafetyBouble(internals::PointLatLng const &position)
Fires When the UAV lives the safety bouble.
void SetShowCompassRose(bool const &value)
TLMapWidget::SetShowCompassRose Shows the compass rose on the map.
void WPSetVisibleAll(bool value)