61e443475c70e36cbe327078b661dd17068313c3
[speedfreak] / Client / routedialog.cpp
1 /*
2  * RouteDialog class
3  *
4  * @author     Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
5  * @copyright  (c) 2010 Speed Freak team
6  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
7  */
8
9 #include "routedialog.h"
10 #include "ui_routedialog.h"
11 #include <cmath>
12 #include <QPainter>
13 #include <QList>
14 #include <QMessageBox>
15 #include <QFile>
16 #include <QFileDialog>
17 #include <QPolygon>
18
19 /*
20   * Vector class.
21   * In starting Qt 4.6 there is QVector3D.
22   * Later (updating Qt version) this class can be removed.
23   */
24 class Vector
25 {
26     qreal x, y, z;      // Location
27     qreal v;            // Velocity
28 public:
29     Vector() { x=0.; y=0. ; z=0.; };
30     Vector( qreal initX, qreal initY, qreal initZ) { x = initX, y = initY; z = initZ; };
31     void setX( qreal newX) { x = newX; };
32     void setY( qreal newY) { y = newY; };
33     void setZ( qreal newZ) { z = newZ; };
34     void setV( qreal newV) { v = newV; };
35     qreal getX() { return x; };
36     qreal getY() { return y; };
37     qreal getZ() { return z; };
38     qreal getV() { return v; };
39     qreal length() { return sqrt(x*x+y*y+z*z); };
40     Vector operator+(Vector v)
41     {
42         x = x + v.x; y = y + v.y; z = z + v.z;
43         return *this;
44     };
45     Vector operator-(Vector v)
46     {
47         x = x - v.x; y = y - v.y; z = z - v.z;
48         return *this;
49     };
50     Vector operator/(qreal c)
51     {
52         x = x/c; y = y/c; z = z/c;
53         return *this;
54     };
55     Vector crossProduct( Vector a, Vector b)
56     {
57         x = a.y*b.z - a.z*b.y;
58         y = a.z*b.x - a.x*b.z;
59         z = a.x*b.y - a.y*b.x;
60         return *this;
61     };
62 };
63
64
65 class Viewing
66 {
67     Vector atPoint, fromPoint, up, a1, a2, a3;
68     qreal offsx, offsy, offsz;
69     qreal dval;
70     qreal angle;
71 public:
72     qreal getOffsx() { return offsx; };
73     qreal getOffsy() { return offsy; };
74     qreal getOffsz() { return offsz; };
75     qreal getDval() { return dval; };
76     void setAngle( qreal newA) { angle = newA; };
77     void setUp( qreal newUpX, qreal newUpY, qreal newUpZ)
78     {
79         up.setX(newUpX); up.setY(newUpY); up.setZ(newUpZ);
80     };
81     void setAtPoint( qreal newX, qreal newY, qreal newZ)
82     {
83         atPoint.setX(newX); atPoint.setY(newY); atPoint.setZ(newZ);
84     };
85     void setFromPoint(qreal newX, qreal newY, qreal newZ)
86     {
87         fromPoint.setX(newX); fromPoint.setY(newY); fromPoint.setZ(newZ);
88     }
89     void setEye()
90     {
91         double amarkmag, tempmag;
92         Vector temp, dist;
93
94         dval = cos(angle/2.0)/sin(angle/2.0);
95         dist = atPoint-fromPoint;
96         amarkmag = dist.length();
97         a3 = dist/amarkmag;
98
99         temp.crossProduct( dist, up);
100         tempmag = temp.length();
101         a1 = temp/tempmag;
102
103         temp.crossProduct( a1, a3);
104         tempmag = temp.length();
105         a2 = temp/tempmag;
106
107         offsx = -a1.getX()*fromPoint.getX() - a1.getY()*fromPoint.getY() - a1.getZ()*fromPoint.getZ();
108         offsy = -a2.getX()*fromPoint.getX() - a2.getY()*fromPoint.getY() - a2.getZ()*fromPoint.getZ();
109         offsz = -a3.getX()*fromPoint.getX() - a3.getY()*fromPoint.getY() - a3.getZ()*fromPoint.getZ();
110         //QString jono2 = QString("offsx %1 offsy %2 offsz %3").arg(offsx).arg(offsy).arg(offsz);
111         //QMessageBox::about(0,"offs x y z", jono2);
112     } ;
113     Vector getAtPoint() { return atPoint; };
114     Vector getFromPoint() { return fromPoint; };
115     Vector getA1() { return a1; };
116     Vector getA2() { return a2; };
117     Vector getA3() { return a3; };
118     Viewing () {};
119 };
120
121 qreal xmax, xmin, ymin, ymax;       // Limits in world coordinates
122
123 QList<Vector> vertexList;           // Vertecies of route
124
125 qreal objxmin, objxmax, objymin, objymax, objzmin, objzmax; // data ranges
126
127 #define maxof(val1,val2)  ((val1>val2)?val1:val2)
128 #define toradians( degrees) (degrees*0.017453293)
129
130 #define WIDTH 1.8   // For 3d viewing only
131 qreal a, b,c,d; // Used for 3d viewing to calculate screen coordinates
132
133 Viewing view3d;   // Viewing settings for 3d
134
135 // Function prototypes
136 void dataMinMax( void);
137 void setAtPoint( Viewing *v);
138 void setFromPoint( Viewing *v);
139 void transformseg( Viewing *v, Vector *v1, Vector *v2, int *xscreen1, int *yscreen1, int *xscreen2, int *yscreen2 );
140
141 #define R 6378.140 // The radius of the earth by kilometers
142 /*
143   * count distance of two points (defined by longitude & latitude)
144   * on the surface of the earth.
145   */
146 qreal countDistance(Vector *p1, Vector *p2)
147 {
148     qreal dLon, dLat;   // delta of longitude & latitude
149     qreal a, c;
150
151     dLon = p2->getX() - p1->getX();     // longitude difference
152     dLat = p2->getY() - p1->getY();     // latitude difference
153     if (dLon <0) dLon = -dLon;
154     if (dLat <0) dLat = -dLat;
155
156     dLon = dLon*3.14/180;
157     dLat = dLat*3.14/180;
158     a = (sin(dLat/2.))*(sin(dLat/2.)) +
159         (cos(p1->getY())*3.14/180)*(cos(p2->getY())*3.14/180)*(sin(dLon/2.))*(sin(dLon/2.));
160     c = 2.*atan(sqrt(a)/sqrt(1-a));     // c is angle between points p1 & p2 with circel by radius 1.
161
162     return R*c;   // Return distance in kilometers
163 }
164
165 RouteDialog::RouteDialog(QWidget *parent) :
166     QDialog(parent),
167     ui(new Ui::RouteDialog)
168 {
169     ui->setupUi(this);
170     left = 5; top = 5; right = 495; bottom = 295; // Limits in screen coordinates
171 }
172
173 RouteDialog::~RouteDialog()
174 {
175     delete ui;
176 }
177
178 void RouteDialog::changeEvent(QEvent *e)
179 {
180     QDialog::changeEvent(e);
181     switch (e->type()) {
182     case QEvent::LanguageChange:
183         ui->retranslateUi(this);
184         break;
185     default:
186         break;
187     }
188 }
189 int RouteDialog::getLeft()
190 {
191     return left;
192 }
193 int RouteDialog::getRight()
194 {
195     return right;
196 }
197 int RouteDialog::getTop()
198 {
199     return top;
200 }
201 int RouteDialog::getBottom()
202 {
203     return bottom;
204 }
205
206 void drawFlag( RouteDialog *rD, QPainter *p, int x, int y)
207 {
208     /*QPolygon pg;
209
210     pg.setPoint(0,x, y-25);
211     pg.setPoint(1,x+10,y-20);
212     pg.setPoint(2,x, y-15);
213     pg.setPoint(3,x,y-20);*/
214     if (y> (rD->getTop() + 25))
215     {
216         // Upside
217         p->drawLine(x,y,x,y-15);
218         if (x <= (rD->getRight()-20))
219         {
220             // flag right
221             p->drawLine( x,    y-25, x+10, y-20);
222             p->drawLine( x+10, y-20, x,    y-15);
223             p->drawLine( x,    y-15, x,    y-25);
224         }
225         else
226         {
227             // Flag left
228             p->drawLine( x,    y-25, x-10, y-20);
229             p->drawLine( x-10, y-20, x,    y-15);
230             p->drawLine( x,    y-15, x,    y-25);
231         }
232
233     }
234     else if (y <= (rD->getTop() + 25))
235     {
236         // downside
237         p->drawLine(x,y,x,y+15);
238         if (x <= (rD->getRight()-20))
239         {
240             // flag right
241             p->drawLine( x,    y+25, x+10, y+20);
242             p->drawLine( x+10, y+20, x,    y+15);
243             p->drawLine( x,    y+15, x,    y+25);
244         }
245         else
246         {
247             // Flag left
248             p->drawLine( x,    y+25, x-10, y+20);
249             p->drawLine( x-10, y+20, x,    y+15);
250             p->drawLine( x,    y+15, x,    y+25);
251         }
252     }
253     //p->drawPolygon();
254    // p->drawPolygon( pg,Qt::OddEvenFill);
255     //p->drawPolyline( &pg);
256     //p->drawPoints( pg);
257 }
258
259 /**
260   * Draws route to the route dialog.
261   * Type 0 is 2d viewing and type 1 is for 3d viewing
262   * @param QPaintEvent
263  */
264 /* */
265 void RouteDialog::paintEvent(QPaintEvent *)
266 {
267     int type = 0; //  0 for 2d, 1 for 3d
268     int startx, starty; // Starting point of the route
269     int i, maxi;
270     qreal x1, y1, x2, y2;
271     int x1Screen, y1Screen, x2Screen, y2Screen;
272     Vector v1, v2;
273     QPainter painter(this);
274
275     painter.setRenderHint(QPainter::Antialiasing, true);
276     painter.setPen(QPen((Qt::white),2));
277     painter.setBrush(QBrush((Qt::yellow), Qt::SolidPattern));
278
279     // Draw route window frame
280     /*painter.drawLine(left,top,right,top);
281     painter.drawLine(right,top,right,bottom);
282     painter.drawLine(left,top,left,bottom);
283     painter.drawLine(left,bottom,right,bottom);*/
284
285     maxi = vertexList.size();
286
287     for (i=0; i<maxi-1; i++)
288     {
289        v1 = vertexList.at(i);
290        v2 = vertexList.at(i+1);
291
292        if (type == 0)
293        {    // 2d
294             x1 = v1.getX(); y1 = v1.getY();
295             x2 = v2.getX(); y2 = v2.getY();
296             //QString jono = QString("x: %1 y: %2").arg(x1).arg(y1);
297             //QMessageBox::about(0,"Tark",jono);
298
299             x1Screen = left + (x1-xmin)/(xmax-xmin)*(right-left);
300             y1Screen = top + (ymax-y1)/(ymax-ymin)*(bottom-top);
301             x2Screen = left + (x2-xmin)/(xmax-xmin)*(right-left);
302             y2Screen = top + (ymax-y2)/(ymax-ymin)*(bottom-top);
303         }
304         else if (type == 1)
305         {   // 3d
306             transformseg( &view3d, &v1,&v2, &x1Screen, &y1Screen, &x2Screen, &y2Screen);
307         }
308
309         // Show with circle if starting point
310         if (i==0)
311         {
312             // Starting point
313             startx = x1Screen; starty = y1Screen;
314            // painter.drawEllipse( x1Screen-5, y1Screen-5, 10, 10);
315            drawFlag( this, &painter,  x1Screen ,  y1Screen);
316         }
317         painter.drawLine( x1Screen, y1Screen, x2Screen, y2Screen);
318     }
319     // Show the endig point if different than the starting point
320     if (x2Screen != startx || y2Screen != starty)
321     {
322         //painter.drawEllipse( x2Screen-5, y2Screen-5, 10, 10);
323         drawFlag( this, &painter,x2Screen, y2Screen );
324     }
325
326     {
327         qreal maxvx, maxvy; // max speed point coordinates
328         qreal maxv;         // max speed
329         Vector v;
330
331         maxv = 0.0;
332         for (i=0; i<maxi-1; i++)
333         {
334             v = vertexList.at(i);
335             if (v.getV() > maxv)
336             {
337                 maxv = v.getV();
338                 maxvx = v.getX();
339                 maxvy = v.getY();
340             }
341         }
342         // Translate world coordinates to screen coordinates
343         x1Screen = left + (maxvx-xmin)/(xmax-xmin)*(right-left);
344         y1Screen = top + (ymax-maxvy)/(ymax-ymin)*(bottom-top);
345
346         // Show max velocity point by yellow circle
347         painter.drawEllipse( x1Screen-5, y1Screen-5, 10, 10);
348
349         QString jono;
350         jono = QString("%1 m/s").arg(maxv);
351         ui->maxSpeedLabel->setText(jono);
352     }
353 }
354
355 bool RouteDialog::readRouteFromFile( QString &routeFile)
356  {
357     Vector temp;
358     QString rivi;
359     QFile file;
360
361     QString fileName = QFileDialog::getOpenFileName(this,
362          tr("Read Route"), "./", tr("Route Files (*.txt)"));
363
364     file.setFileName( fileName);
365     if (!file.open(QIODevice::ReadOnly))
366     {
367         QMessageBox::about(0, "Error", "File not found");
368         return false;
369     }
370
371     vertexList.clear();
372     while(!file.atEnd())
373     {
374         QString str1, str2, str3, str4;
375         rivi = file.readLine();
376
377         str1 = rivi.section(" ", 0, 0);
378         if (str1.compare("Start:") != 0 && str1.compare("Stop:") != 0)
379         {
380             str1 = rivi.section(" ", 2, 2); // latitude y-value
381             str2 = rivi.section(" ", 4, 4); // longitude x-value
382             str3 = rivi.section(" ", 6, 6); // altitude z-value
383             str4 = rivi.section(" ", 8, 8); // speed m/s
384             //QString str = QString("la: %1 lo: %2 al: %3").arg(str1).arg(str2).arg(str3);
385             //QMessageBox::about(0, "LUKEE", str);
386
387             if (str1.length() > 0)
388             {
389                 double x, y, z, v;
390                 x = str2.toDouble();
391                 y = str1.toDouble();
392                 z = str3.toDouble();
393                 v = str4.toDouble();
394                 temp.setX( x); // Longitude
395                 temp.setY( y); // Latitude
396                 temp.setZ( z); // altitude
397                 temp.setV( v);
398
399                 vertexList.append(temp);
400             }
401         }
402     }
403
404     file.close();
405
406      /********  in 3d use only */
407      a = 400/2.;
408      b = 1 - a*(-1);
409      c = -300/2.;
410      d = 300 - c*(-1);
411      //angle = toradians(60);
412
413      view3d.setUp( 1.0, 0.0, 0.0);
414      view3d.setAngle(toradians(60));
415      setAtPoint( &view3d);
416      xmin = objxmin; xmax = objxmax; ymin = objymin; ymax = objymax; // 2d viewing needs this !!!!
417      setFromPoint( &view3d);
418      view3d.setEye();
419      /****** end of 3d *****/
420
421      /*
422      //Testing distance counting
423      Vector a1, a2;
424      qreal dist;
425      //a1.setX( xmin); a1.setY( ymin);
426      //a2.setX( xmax); a2.setY( ymax);
427      a1.setX( 25.483); a1.setY( 65.017); // Oulu
428      a2.setX( 27.767); a2.setY( 64.283); // Kajaani
429      dist = countDistance( &a1, &a2);
430      QString str = QString("Min & Max datan välimatka %1").arg(dist);
431      QMessageBox::about( 0, "Testi", str);
432      */
433
434      return true;
435  }
436
437 /*
438   * Find out data range for x-, y- and z-coordinates
439   */
440 void dataMinMax( void)
441 {
442     int i, maxi;
443     qreal x,y,z;
444     Vector temp;
445
446     temp = vertexList.at(0);
447     objxmax = objxmin = temp.getX();
448     objymax = objymin = temp.getY();
449     objzmax = objzmin = temp.getZ();
450
451     maxi = vertexList.size();
452     for (i=1; i<maxi; i++)
453     {
454         temp = vertexList.at(i);
455         x = temp.getX();
456         y = temp.getY();
457         z = temp.getZ();
458
459         if (x < objxmin)
460         {
461                 objxmin = x;
462         }
463         else if (x > objxmax)
464         {
465                objxmax = x;
466         }
467
468         if (y < objymin)
469         {
470                 objymin = y;
471         }
472         else if (y > objymax)
473         {
474                objymax = y;
475         }
476
477         if (z < objzmin)
478         {
479                 objzmin = z;
480         }
481         else if (z > objzmax)
482         {
483                objzmax = z;
484         }
485     }
486     //QString jono = QString("ojxmin %1 objxmax %2").arg(objxmin).arg(objxmax);
487     //QString jono = QString("ojymin %1 objymax %2").arg(objymin).arg(objymax);
488     //QString jono = QString("ojzmin %1 objzmax %2").arg(objzmin).arg(objzmax);
489     //QMessageBox::about(0,"Tark", jono);
490 }
491
492 /*
493   * Setting the point where the viewed object is. In the middle of datapoints.
494   */
495 void setAtPoint( Viewing *v)
496 {
497     qreal x, y, z;
498     dataMinMax();
499     //Vector test;
500
501     x = (objxmax+objxmin)/2.0;
502     y= (objymax+objymin)/2.0;
503     z= (objzmax+objzmin)/2.0;
504
505     v->setAtPoint( x, y, z);
506     //QString jono = QString("AtX %1 Aty %2 AtZ %3").arg(atPoint.x()).arg(atPoint.y()).arg(atPoint.z());
507     //QString jono = QString("AtX %1 Aty %2 AtZ %3").arg(atPoint.x).arg(atPoint.y).arg(atPoint.z);
508
509     /* *
510     test = v->getAtPoint();
511     QString jono = QString("AtX %1 Aty %2 AtZ %3").arg(test.getX()).arg(test.getY()).arg(test.getZ());
512     QMessageBox::about(0,"At point", jono);
513     * */
514 }
515
516 /*
517   * Setting the point where the object is viewed by eye.
518   */
519 void setFromPoint( Viewing *v)
520 {
521     qreal x, y, z;
522     Vector point;
523     point = v->getAtPoint();
524     //Vector test;
525     //fromPoint.setX( atPoint.getX() + (objxmax-objxmin)/2.0 + WIDTH*maxof((objzmax-objzmin)/2.0,(objymax-objymin)/2.0));
526     //x = 3.0;
527     //x = point.getX() + (objxmax-objxmin)/2.0 + WIDTH*maxof((objzmax-objzmin)/2.0,(objymax-objymin)/2.0);
528     x = point.getX();
529     //y = point.getY();
530     y = point.getY() + 40; // + (objymax-objymin)/2.0 + WIDTH*maxof((objzmax-objzmin)/2.0,(objxmax-objxmin)/2.0);
531     z = point.getZ();
532
533     v->setFromPoint(x,y,z);
534     //QString jono = QString("FromX %1 FromY %2 FromZ %3").arg(fromPoint.x()).arg(fromPoint.y()).arg(fromPoint.z());
535     //QString jono = QString("FromX %1 FromY %2 FromZ %3").arg(fromPoint.x).arg(fromPoint.y).arg(fromPoint.z);
536     /* *
537     test = v->getFromPoint();
538     QString jono = QString("FromX %1 FromY %2 FromZ %3").arg(test.getX()).arg(test.getY()).arg(test.getZ());
539     QMessageBox::about(0,"From point", jono); // (1.9, 0.5, 0.5)
540     * */
541 }
542
543
544 #define NOEDGE     0x00
545 #define LEFTEDGE   0x01
546 #define RIGHTEDGE  0x02
547 #define BOTTOMEDGE 0x04
548 #define TOPEDGE    0x08
549 /*
550   * Returns a code specifying which edge in the viewing pyramid was crossed.
551   * There may be more than one.
552   */
553 int code( qreal x, qreal y, qreal z)
554 {
555     int c;
556
557     c = NOEDGE;
558     if (x<-z) c |= LEFTEDGE;
559     if (x>z) c |= RIGHTEDGE;
560     if (y<-z) c |= BOTTOMEDGE;
561     if (y>z) c |= TOPEDGE;
562
563     return c;
564 }
565
566 /*
567   * Converts clipped world coordinates to screen coordinates.
568   */
569 void WORLDtoSCREEN( qreal xWorld, qreal yWorld, int *xScreen, int *yScreen)
570 {
571    *xScreen = (int) (a*xWorld+b);
572    *yScreen = (int) (c*yWorld+d);
573 }
574
575 /*
576   * Clips the line segment in three-dimensional coordinates to the
577   * viewing pyramid.
578   */
579 void clip3d( qreal x1, qreal y1, qreal z1, qreal x2, qreal y2, qreal z2, int *xscreen1, int *yscreen1, int *xscreen2, int *yscreen2)
580 {
581     int c,c1,c2;
582     qreal x,y,z,t;
583
584     c1 = code(x1,y1,z1);
585     c2 = code(x2,y2,z2);
586
587     while (c1!= NOEDGE || c2 != NOEDGE)
588     {
589         if ((c1 & c2 ) != NOEDGE) return;
590         c = c1;
591         if (c == NOEDGE) c = c2;
592         if ((c&LEFTEDGE) == LEFTEDGE)
593         {
594                 // Crosses left edge
595                 t = (z1+x1)/((x1-x2)-(z2-z1));
596                 z = t*(z2-z1)+z1;
597                 x = -z;
598                 y = t*(y2-y1)+y1;
599         }
600         else if ((c&RIGHTEDGE) == RIGHTEDGE)
601         {
602                 // Crosses right edge
603                 t = (z1-x1)/((x2-x1)-(z2-z1));
604                 z = t*(z2-z1)+z1;
605                 x = z;
606                 y = t*(y2-y1)+y1;
607         }
608         else if ((c&BOTTOMEDGE) == BOTTOMEDGE)
609         {
610                 // Crosses bottom edge
611                 t = (z1+y1)/((y1-y2)-(z2-z1));
612                 z = t*(z2-z1)+z1;
613                 x = t*(x2-x1)+x1;
614                 y = -z;
615         }
616         else if ((c&TOPEDGE) == TOPEDGE)
617         {
618                 // Crosses top edge
619                 t = (z1-y1)/((y2-y1)-(z2-z1));
620                 z = t*(z2-z1)+z1;
621                 x = t*(x2-x1)+x1;
622                 y = z;
623         }
624
625         if (c == c1)
626         {
627             x1=x; y1=y; z1=z;
628             c1 = code(x,y,z);
629         }
630         else
631         {
632             x2=x; y2=y; z2=z;
633             c2 = code(x,y,z);
634         }
635     }
636
637     if (z1 != 0)
638     {
639         WORLDtoSCREEN(x1/z1,y1/z1,xscreen1, yscreen1);
640         WORLDtoSCREEN(x2/z2,y2/z2,xscreen2, yscreen2);
641     }
642     else
643     {
644         WORLDtoSCREEN(x1,y1,xscreen1, yscreen1);
645         WORLDtoSCREEN(x2,y2,xscreen2, yscreen2);
646     }
647     //Now ready to draw line( xscreen1, yscreen1, xscreen2, yscreen2);
648 }
649
650 /*
651   * Transform the segment connecting the two vectors into the viewing plane.
652   * clip3d() clips the line if needed.
653   */
654 void transformseg( Viewing *v, Vector *v1, Vector *v2, int *xscreen1, int *yscreen1, int *xscreen2, int *yscreen2)
655
656 {
657     qreal x1, y1, z1, x2, y2, z2;
658     Vector a1, a2, a3;
659
660     a1 = v->getA1();
661     a2 = v->getA2();
662     a3 = v->getA3();
663
664     x1 = (a1.getX()*v1->getX() + a1.getY()*v1->getY() + a1.getZ()*v1->getZ() + v->getOffsx())*v->getDval();
665     y1 = (a2.getX()*v1->getX() + a2.getY()*v1->getY() + a2.getZ()*v1->getZ() + v->getOffsy())*v->getDval();
666     z1 = a3.getX()*v1->getX() + a3.getY()*v1->getY() + a3.getZ()*v1->getZ() + v->getOffsz();
667
668     x2 = (a1.getX()*v2->getX() + a1.getY()*v2->getY() + a1.getZ()*v2->getZ() + v->getOffsx())*v->getDval();
669     y2 = (a2.getX()*v2->getX() + a2.getY()*v2->getY() + a2.getZ()*v2->getZ() + v->getOffsy())*v->getDval();
670     z2 = a3.getX()*v2->getX() + a3.getY()*v2->getY() + a3.getZ()*v2->getZ() + v->getOffsz();
671
672     clip3d(x1,y1,z1,x2,y2,z2, xscreen1, yscreen1, xscreen2, yscreen2 );
673 }
674
675 void RouteDialog::on_newPushButton_clicked()
676 {
677     close();    // go back to previous dialog
678 }
679
680 void RouteDialog::on_sendPushButton_clicked()
681 {
682     // Send route points file to server
683 }