-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdmz.diff
More file actions
executable file
·1057 lines (983 loc) · 30.8 KB
/
dmz.diff
File metadata and controls
executable file
·1057 lines (983 loc) · 30.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/QMapControl/qmapcontrol.h b/QMapControl/qmapcontrol.h
old mode 100644
new mode 100755
index 7b88efe..7c62364
--- a/QMapControl/qmapcontrol.h
+++ b/QMapControl/qmapcontrol.h
@@ -1,17 +1,17 @@
-#include "src/mapcontrol.h"
-#include "src/gps_position.h"
-#include "src/wmsmapadapter.h"
-#include "src/geometry.h"
-#include "src/point.h"
-#include "src/imagepoint.h"
-#include "src/circlepoint.h"
-#include "src/linestring.h"
-#include "src/gps_position.h"
-#include "src/osmmapadapter.h"
-#include "src/maplayer.h"
-#include "src/geometrylayer.h"
-#include "src/yahoomapadapter.h"
-#include "src/googlemapadapter.h"
-#include "src/googlesatmapadapter.h"
-#include "src/openaerialmapadapter.h"
-#include "src/fixedimageoverlay.h"
+#include "mapcontrol.h"
+#include "gps_position.h"
+#include "wmsmapadapter.h"
+#include "geometry.h"
+#include "point.h"
+#include "imagepoint.h"
+#include "circlepoint.h"
+#include "linestring.h"
+#include "gps_position.h"
+#include "osmmapadapter.h"
+#include "maplayer.h"
+#include "geometrylayer.h"
+#include "yahoomapadapter.h"
+#include "googlemapadapter.h"
+#include "googlesatmapadapter.h"
+#include "openaerialmapadapter.h"
+#include "fixedimageoverlay.h"
\ No newline at end of file
diff --git a/QMapControl/src/circlepoint.h b/QMapControl/src/circlepoint.h
old mode 100644
new mode 100755
index 9c90be2..ac96e88
--- a/QMapControl/src/circlepoint.h
+++ b/QMapControl/src/circlepoint.h
@@ -25,7 +25,7 @@
#ifndef CIRCLEPOINT_H
#define CIRCLEPOINT_H
-
+#include <qmapcontrolexport.h>
#include "point.h"
namespace qmapcontrol
@@ -37,7 +37,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class CirclePoint : public Point
+ class QMAPCONTROL_LINK_SYMBOL CirclePoint : public Point
{
public:
//!
diff --git a/QMapControl/src/curve.h b/QMapControl/src/curve.h
old mode 100644
new mode 100755
index 5a71c01..33b6e25
--- a/QMapControl/src/curve.h
+++ b/QMapControl/src/curve.h
@@ -25,7 +25,7 @@
#ifndef CURVE_H
#define CURVE_H
-
+#include <qmapcontrolexport.h>
#include "geometry.h"
#include "point.h"
@@ -42,7 +42,7 @@ namespace qmapcontrol
* LineString, which uses a linear interpolation between Points."
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class Curve : public Geometry
+ class QMAPCONTROL_LINK_SYMBOL Curve : public Geometry
{
Q_OBJECT
public:
diff --git a/QMapControl/src/fixedimageoverlay.h b/QMapControl/src/fixedimageoverlay.h
old mode 100644
new mode 100755
index 6d154af..2be46a6
--- a/QMapControl/src/fixedimageoverlay.h
+++ b/QMapControl/src/fixedimageoverlay.h
@@ -25,7 +25,7 @@
#ifndef FIXEDIMAGEOVERLAY_H
#define FIXEDIMAGEOVERLAY_H
-
+#include <qmapcontrolexport.h>
#include "imagepoint.h"
namespace qmapcontrol
@@ -39,7 +39,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class FixedImageOverlay : public ImagePoint
+ class QMAPCONTROL_LINK_SYMBOL FixedImageOverlay : public ImagePoint
{
public:
//! Creates an image overlay which loads and displays the given image file
diff --git a/QMapControl/src/geometry.h b/QMapControl/src/geometry.h
old mode 100644
new mode 100755
index dca4780..46550a2
--- a/QMapControl/src/geometry.h
+++ b/QMapControl/src/geometry.h
@@ -25,9 +25,10 @@
#ifndef GEOMETRY_H
#define GEOMETRY_H
-#include <QObject>
-#include <QPainter>
-#include <QDebug>
+#include <qmapcontrolexport.h>
+#include <QtCore/QObject>
+#include <QtGui/QPainter>
+#include <QtCore/QDebug>
#include "mapadapter.h"
namespace qmapcontrol
@@ -43,7 +44,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class Geometry : public QObject
+ class QMAPCONTROL_LINK_SYMBOL Geometry : public QObject
{
friend class LineString;
Q_OBJECT
diff --git a/QMapControl/src/geometrylayer.h b/QMapControl/src/geometrylayer.h
old mode 100644
new mode 100755
index 93bda47..21fb52d
--- a/QMapControl/src/geometrylayer.h
+++ b/QMapControl/src/geometrylayer.h
@@ -25,7 +25,7 @@
#ifndef GEOMETRYLAYER_H
#define GEOMETRYLAYER_H
-
+#include <qmapcontrolexport.h>
#include "layer.h"
namespace qmapcontrol
@@ -44,7 +44,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class GeometryLayer : public Layer
+ class QMAPCONTROL_LINK_SYMBOL GeometryLayer : public Layer
{
Q_OBJECT
diff --git a/QMapControl/src/googlemapadapter.h b/QMapControl/src/googlemapadapter.h
old mode 100644
new mode 100755
index 46ceea7..4ec950f
--- a/QMapControl/src/googlemapadapter.h
+++ b/QMapControl/src/googlemapadapter.h
@@ -25,7 +25,7 @@
#ifndef GOOGLEMAPADAPTER_H
#define GOOGLEMAPADAPTER_H
-
+#include <qmapcontrolexport.h>
#include "tilemapadapter.h"
namespace qmapcontrol
@@ -35,7 +35,7 @@ namespace qmapcontrol
* This is a conveniece class, which extends and configures a TileMapAdapter
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class GoogleMapAdapter : public TileMapAdapter
+ class QMAPCONTROL_LINK_SYMBOL GoogleMapAdapter : public TileMapAdapter
{
Q_OBJECT
diff --git a/QMapControl/src/googlesatmapadapter.cpp b/QMapControl/src/googlesatmapadapter.cpp
index 602b818..61451b0 100755
--- a/QMapControl/src/googlesatmapadapter.cpp
+++ b/QMapControl/src/googlesatmapadapter.cpp
@@ -25,6 +25,10 @@
#include "googlesatmapadapter.h"
+#ifndef _USE_MATH_DEFINES
+#define _USE_MATH_DEFINES 1
+#endif
+
#include <math.h>
namespace qmapcontrol
{
diff --git a/QMapControl/src/googlesatmapadapter.h b/QMapControl/src/googlesatmapadapter.h
index c6b0395..4056898 100755
--- a/QMapControl/src/googlesatmapadapter.h
+++ b/QMapControl/src/googlesatmapadapter.h
@@ -25,7 +25,7 @@
#ifndef GOOGLESATMAPADAPTER_H
#define GOOGLESATMAPADAPTER_H
-
+#include <qmapcontrolexport.h>
#include "mapadapter.h"
namespace qmapcontrol
{
@@ -34,7 +34,7 @@ namespace qmapcontrol
* This is a conveniece class, which extends and configures a TileMapAdapter
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class GoogleSatMapAdapter : public MapAdapter
+ class QMAPCONTROL_LINK_SYMBOL GoogleSatMapAdapter : public MapAdapter
{
Q_OBJECT
public:
diff --git a/QMapControl/src/gps_position.h b/QMapControl/src/gps_position.h
old mode 100644
new mode 100755
index 46aeb2e..b22c73d
--- a/QMapControl/src/gps_position.h
+++ b/QMapControl/src/gps_position.h
@@ -25,8 +25,8 @@
#ifndef GPS_POSITION_H
#define GPS_POSITION_H
-
-#include <QString>
+#include <qmapcontrolexport.h>
+#include <QtCore/QString>
namespace qmapcontrol
{
@@ -36,7 +36,7 @@ namespace qmapcontrol
* This is not fully integrated in the API. An example which uses this data type can be found under Samples.
* @author Kai Winter
*/
- class GPS_Position
+ class QMAPCONTROL_LINK_SYMBOL GPS_Position
{
public:
GPS_Position(float time, float longitude, QString longitude_dir, float latitude, QString latitude_dir);
diff --git a/QMapControl/src/imagemanager.h b/QMapControl/src/imagemanager.h
old mode 100644
new mode 100755
index d4b36f1..a7aecd0
--- a/QMapControl/src/imagemanager.h
+++ b/QMapControl/src/imagemanager.h
@@ -25,14 +25,14 @@
#ifndef IMAGEMANAGER_H
#define IMAGEMANAGER_H
-
-#include <QObject>
-#include <QPixmapCache>
-#include <QDebug>
-#include <QMutex>
-#include <QFile>
-#include <QBuffer>
-#include <QDir>
+#include <qmapcontrolexport.h>
+#include <QtCore/QObject>
+#include <QtGui/QPixmapCache>
+#include <QtCore/QDebug>
+#include <QtCore/QMutex>
+#include <QtCore/QFile>
+#include <QtCore/QBuffer>
+#include <QtCore/QDir>
#include "mapnetwork.h"
namespace qmapcontrol
@@ -41,7 +41,7 @@ namespace qmapcontrol
/**
@author Kai Winter <kaiwinter@gmx.de>
*/
- class ImageManager : public QObject
+ class QMAPCONTROL_LINK_SYMBOL ImageManager : public QObject
{
Q_OBJECT;
diff --git a/QMapControl/src/imagepoint.h b/QMapControl/src/imagepoint.h
old mode 100644
new mode 100755
index dde2b9b..a4db1c9
--- a/QMapControl/src/imagepoint.h
+++ b/QMapControl/src/imagepoint.h
@@ -25,7 +25,7 @@
#ifndef IMAGEPOINT_H
#define IMAGEPOINT_H
-
+#include <qmapcontrolexport.h>
#include "point.h"
namespace qmapcontrol
@@ -38,7 +38,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class ImagePoint : public Point
+ class QMAPCONTROL_LINK_SYMBOL ImagePoint : public Point
{
public:
//! Creates a point which loads and displays the given image file
diff --git a/QMapControl/src/layer.cpp b/QMapControl/src/layer.cpp
old mode 100644
new mode 100755
index ee4f841..3c1ba95
--- a/QMapControl/src/layer.cpp
+++ b/QMapControl/src/layer.cpp
@@ -217,9 +217,12 @@ namespace qmapcontrol
ImageManager::instance()->getImage(mapAdapter->host(), mapAdapter->query(mapmiddle_tile_x, mapmiddle_tile_y, mapAdapter->currentZoom())));
}
- for (int i=-tiles_left+mapmiddle_tile_x; i<=tiles_right+mapmiddle_tile_x; i++)
+ int i = 0;
+ int j = 0;
+
+ for (i=-tiles_left+mapmiddle_tile_x; i<=tiles_right+mapmiddle_tile_x; i++)
{
- for (int j=-tiles_above+mapmiddle_tile_y; j<=tiles_bottom+mapmiddle_tile_y; j++)
+ for (j=-tiles_above+mapmiddle_tile_y; j<=tiles_bottom+mapmiddle_tile_y; j++)
{
// check if image is valid
if (!(i==mapmiddle_tile_x && j==mapmiddle_tile_y))
@@ -242,26 +245,26 @@ namespace qmapcontrol
int left = mapmiddle_tile_x-tiles_right-1;
int lower = mapmiddle_tile_y+tiles_bottom+1;
- int j = upper;
- for (int i=left; i<=right; i++)
+ j = upper;
+ for (i=left; i<=right; i++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
}
j = lower;
- for (int i=left; i<=right; i++)
+ for (i=left; i<=right; i++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
}
- int i = left;
- for (int j=upper+1; j<=lower-1; j++)
+ i = left;
+ for (j=upper+1; j<=lower-1; j++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
}
i = right;
- for (int j=upper+1; j<=lower-1; j++)
+ for (j=upper+1; j<=lower-1; j++)
{
if (mapAdapter->isValid(i, j, mapAdapter->currentZoom()))
ImageManager::instance()->prefetchImage(mapAdapter->host(), mapAdapter->query(i, j, mapAdapter->currentZoom()));
diff --git a/QMapControl/src/layer.h b/QMapControl/src/layer.h
old mode 100644
new mode 100755
index 14debea..e4d63cb
--- a/QMapControl/src/layer.h
+++ b/QMapControl/src/layer.h
@@ -25,11 +25,11 @@
#ifndef LAYER_H
#define LAYER_H
-
-#include <QObject>
-#include <QDebug>
-#include <QPainter>
-#include <QMouseEvent>
+#include <qmapcontrolexport.h>
+#include <QtCore/QObject>
+#include <QtCore/QDebug>
+#include <QtGui/QPainter>
+#include <QtGui/QMouseEvent>
#include "mapadapter.h"
#include "layermanager.h"
@@ -56,7 +56,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class Layer : public QObject
+ class QMAPCONTROL_LINK_SYMBOL Layer : public QObject
{
Q_OBJECT
@@ -131,9 +131,19 @@ namespace qmapcontrol
void setMapAdapter(MapAdapter* mapadapter);
- Layer& operator=(const Layer& rhs);
- Layer(const Layer& old);
+ signals:
+ //! This signal is emitted when a Geometry is clicked
+ /*!
+ * A Geometry is clickable, if the containing layer is clickable.
+ * The layer emits a signal for every clicked geometry
+ * @param geometry The clicked Geometry
+ * @param point The coordinate (in widget coordinates) of the click
+ */
+ void geometryClicked(Geometry* geometry, QPoint point);
+ void updateRequest(QRectF rect);
+ void updateRequest();
+
private:
void moveWidgets(const QPoint mapmiddle_px) const;
void drawYourImage(QPainter* painter, const QPoint mapmiddle_px) const;
@@ -157,18 +167,8 @@ namespace qmapcontrol
bool takeevents;
mutable QRect myoffscreenViewport;
- signals:
- //! This signal is emitted when a Geometry is clicked
- /*!
- * A Geometry is clickable, if the containing layer is clickable.
- * The layer emits a signal for every clicked geometry
- * @param geometry The clicked Geometry
- * @param point The coordinate (in widget coordinates) of the click
- */
- void geometryClicked(Geometry* geometry, QPoint point);
-
- void updateRequest(QRectF rect);
- void updateRequest();
+ Layer& operator=(const Layer& rhs);
+ Layer(const Layer& old);
public slots:
//! if visible is true, the layer is made visible
diff --git a/QMapControl/src/layermanager.cpp b/QMapControl/src/layermanager.cpp
index 9b9d9ae..5a1be4e 100644
--- a/QMapControl/src/layermanager.cpp
+++ b/QMapControl/src/layermanager.cpp
@@ -23,7 +23,9 @@
*
*/
+#include <QtCore/QCoreApplication>
#include "layermanager.h"
+
namespace qmapcontrol
{
LayerManager::LayerManager(MapControl* mapcontrol, QSize size)
diff --git a/QMapControl/src/layermanager.h b/QMapControl/src/layermanager.h
old mode 100644
new mode 100755
index 4757557..6298d7d
--- a/QMapControl/src/layermanager.h
+++ b/QMapControl/src/layermanager.h
@@ -25,10 +25,11 @@
#ifndef LAYERMANAGER_H
#define LAYERMANAGER_H
-
-#include <QObject>
-#include <QMap>
-#include <QListIterator>
+#include <qmapcontrolexport.h>
+#include <QtCore/QObject>
+#include <QtCore/QMap>
+#include <QtCore/QMutex>
+#include <QtCore/QListIterator>
#include "layer.h"
#include "mapadapter.h"
#include "mapcontrol.h"
@@ -48,7 +49,7 @@ namespace qmapcontrol
* It initiates the creation of a new offscreen image and on zooming the zoom images gets here created.
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class LayerManager : public QObject
+ class QMAPCONTROL_LINK_SYMBOL LayerManager : public QObject
{
Q_OBJECT
diff --git a/QMapControl/src/linestring.h b/QMapControl/src/linestring.h
old mode 100644
new mode 100755
index f00a585..e000ce6
--- a/QMapControl/src/linestring.h
+++ b/QMapControl/src/linestring.h
@@ -25,7 +25,7 @@
#ifndef LINESTRING_H
#define LINESTRING_H
-
+#include <qmapcontrolexport.h>
#include "curve.h"
namespace qmapcontrol
@@ -35,7 +35,7 @@ namespace qmapcontrol
* A LineString is a Curve with linear interpolation between Points. Each consecutive pair of Points defines a Line segment.
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class LineString : public Curve
+ class QMAPCONTROL_LINK_SYMBOL LineString : public Curve
{
Q_OBJECT
diff --git a/QMapControl/src/mapadapter.h b/QMapControl/src/mapadapter.h
old mode 100644
new mode 100755
index be52c71..44c2cef
--- a/QMapControl/src/mapadapter.h
+++ b/QMapControl/src/mapadapter.h
@@ -25,13 +25,13 @@
#ifndef MAPADAPTER_H
#define MAPADAPTER_H
-
-#include <QObject>
-#include <QSize>
-#include <QPoint>
-#include <QPointF>
-#include <QLocale>
-#include <QDebug>
+#include <qmapcontrolexport.h>
+#include <QtCore/QObject>
+#include <QtCore/QSize>
+#include <QtCore/QPoint>
+#include <QtCore/QPointF>
+#include <QtCore/QLocale>
+#include <QtCore/QDebug>
#include <cmath>
namespace qmapcontrol
@@ -51,7 +51,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class MapAdapter : public QObject
+ class QMAPCONTROL_LINK_SYMBOL MapAdapter : public QObject
{
friend class Layer;
diff --git a/QMapControl/src/mapcontrol.cpp b/QMapControl/src/mapcontrol.cpp
old mode 100644
new mode 100755
index 8090c74..b723a11
--- a/QMapControl/src/mapcontrol.cpp
+++ b/QMapControl/src/mapcontrol.cpp
@@ -23,7 +23,9 @@
*
*/
+#include <QtCore/QTimer>
#include "mapcontrol.h"
+
namespace qmapcontrol
{
MapControl::MapControl(QSize size, MouseMode mousemode)
@@ -155,7 +157,7 @@ namespace qmapcontrol
if (currentZoom() >= 0 && distanceList.size() > currentZoom())
{
double line;
- line = distanceList.at( currentZoom() ) / pow(2, 18-currentZoom() ) / 0.597164;
+ line = distanceList.at( currentZoom() ) / pow(2.0, 18-currentZoom() ) / 0.597164;
// draw the scale
painter.setPen(Qt::black);
@@ -303,16 +305,19 @@ namespace qmapcontrol
{
layermanager->zoomIn();
update();
+ emit zoomChanged (currentZoom ());
}
void MapControl::zoomOut()
{
layermanager->zoomOut();
update();
+ emit zoomChanged (currentZoom ());
}
void MapControl::setZoom(int zoomlevel)
{
layermanager->setZoom(zoomlevel);
update();
+ emit zoomChanged (currentZoom ());
}
int MapControl::currentZoom() const
{
@@ -402,6 +407,18 @@ namespace qmapcontrol
{
scaleVisible = show;
}
+
+ QPointF MapControl::screenToWorldCoordinate (const QPoint &Screen)
+ {
+ return clickToWorldCoordinate (Screen);
+ }
+
+ QPoint MapControl::worldCoordinateToScreen (const QPointF &Coordinate)
+ {
+ QPoint displayToImage = layermanager->layer ()->mapadapter ()->coordinateToDisplay (Coordinate);
+
+ return (displayToImage + screen_middle - layermanager->getMapmiddle_px ());
+ }
void MapControl::resize(const QSize newSize)
{
diff --git a/QMapControl/src/mapcontrol.h b/QMapControl/src/mapcontrol.h
old mode 100644
new mode 100755
index a730770..a910c7a
--- a/QMapControl/src/mapcontrol.h
+++ b/QMapControl/src/mapcontrol.h
@@ -25,8 +25,8 @@
#ifndef MAPCONTROL_H
#define MAPCONTROL_H
-
-#include <QtGui>
+#include <qmapcontrolexport.h>
+#include <QtGui/QWidget>
#include "layermanager.h"
#include "layer.h"
@@ -50,7 +50,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class MapControl : public QWidget
+ class QMAPCONTROL_LINK_SYMBOL MapControl : public QWidget
{
Q_OBJECT
@@ -213,36 +213,11 @@ namespace qmapcontrol
* @param show true if the scale should be displayed
*/
void showScale ( bool show );
-
- private:
- LayerManager* layermanager;
- QPoint screen_middle; // middle of the widget (half size)
-
- QPoint pre_click_px; // used for scrolling (MouseMode Panning)
- QPoint current_mouse_pos; // used for scrolling and dragging (MouseMode Panning/Dragging)
-
- QSize size; // size of the widget
-
- bool mousepressed;
- MouseMode mymousemode;
- bool scaleVisible;
-
- bool m_loadingFlag;
-
- QMutex moveMutex; // used for method moveTo()
- QPointF target; // used for method moveTo()
- int steps; // used for method moveTo()
-
- QPointF clickToWorldCoordinate ( QPoint click );
- MapControl& operator= ( const MapControl& rhs );
- MapControl ( const MapControl& old );
-
- protected:
- void paintEvent ( QPaintEvent* evnt );
- void mousePressEvent ( QMouseEvent* evnt );
- void mouseReleaseEvent ( QMouseEvent* evnt );
- void mouseMoveEvent ( QMouseEvent* evnt );
-
+
+ //DMZ
+ QPointF screenToWorldCoordinate (const QPoint &Screen);
+ QPoint worldCoordinateToScreen (const QPointF &Coordinate);
+
signals:
// void mouseEvent(const QMouseEvent* evnt);
@@ -277,6 +252,42 @@ namespace qmapcontrol
* @param zoom The current zoom
*/
void viewChanged ( const QPointF &coordinate, int zoom );
+
+ //DMZ
+ //! This signal is emitted, after the zoom have changes
+ /*!
+ * @param zoom The current zoom
+ */
+ void zoomChanged ( int zoom );
+
+ private:
+ LayerManager* layermanager;
+ QPoint screen_middle; // middle of the widget (half size)
+
+ QPoint pre_click_px; // used for scrolling (MouseMode Panning)
+ QPoint current_mouse_pos; // used for scrolling and dragging (MouseMode Panning/Dragging)
+
+ QSize size; // size of the widget
+
+ bool mousepressed;
+ MouseMode mymousemode;
+ bool scaleVisible;
+
+ bool m_loadingFlag;
+
+ QMutex moveMutex; // used for method moveTo()
+ QPointF target; // used for method moveTo()
+ int steps; // used for method moveTo()
+
+ QPointF clickToWorldCoordinate ( QPoint click );
+ MapControl& operator= ( const MapControl& rhs );
+ MapControl ( const MapControl& old );
+
+ protected:
+ void paintEvent ( QPaintEvent* evnt );
+ void mousePressEvent ( QMouseEvent* evnt );
+ void mouseReleaseEvent ( QMouseEvent* evnt );
+ void mouseMoveEvent ( QMouseEvent* evnt );
public slots:
//! zooms in one step
diff --git a/QMapControl/src/maplayer.h b/QMapControl/src/maplayer.h
old mode 100644
new mode 100755
index 97b1701..0f35791
--- a/QMapControl/src/maplayer.h
+++ b/QMapControl/src/maplayer.h
@@ -25,7 +25,7 @@
#ifndef MAPLAYER_H
#define MAPLAYER_H
-
+#include <qmapcontrolexport.h>
#include "layer.h"
namespace qmapcontrol
@@ -44,7 +44,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class MapLayer : public Layer
+ class QMAPCONTROL_LINK_SYMBOL MapLayer : public Layer
{
Q_OBJECT
diff --git a/QMapControl/src/mapnetwork.cpp b/QMapControl/src/mapnetwork.cpp
index 28fc02c..48f3454 100644
--- a/QMapControl/src/mapnetwork.cpp
+++ b/QMapControl/src/mapnetwork.cpp
@@ -24,7 +24,8 @@
*/
#include "mapnetwork.h"
-#include <QWaitCondition>
+#include <QtCore/QWaitCondition>
+
namespace qmapcontrol
{
MapNetwork::MapNetwork(ImageManager* parent)
diff --git a/QMapControl/src/mapnetwork.h b/QMapControl/src/mapnetwork.h
old mode 100644
new mode 100755
index ec41841..5b63061
--- a/QMapControl/src/mapnetwork.h
+++ b/QMapControl/src/mapnetwork.h
@@ -25,12 +25,12 @@
#ifndef MAPNETWORK_H
#define MAPNETWORK_H
-
-#include <QObject>
-#include <QDebug>
-#include <QHttp>
-#include <QVector>
-#include <QPixmap>
+#include <qmapcontrolexport.h>
+#include <QtCore/QObject>
+#include <QtCore/QDebug>
+#include <QtNetwork/QHttp>
+#include <QtCore/QVector>
+#include <QtGui/QPixmap>
#include "imagemanager.h"
/**
@author Kai Winter <kaiwinter@gmx.de>
@@ -38,7 +38,7 @@
namespace qmapcontrol
{
class ImageManager;
- class MapNetwork : QObject
+ class QMAPCONTROL_LINK_SYMBOL MapNetwork : QObject
{
Q_OBJECT
diff --git a/QMapControl/src/openaerialmapadapter.h b/QMapControl/src/openaerialmapadapter.h
old mode 100644
new mode 100755
index d49029c..ca5d086
--- a/QMapControl/src/openaerialmapadapter.h
+++ b/QMapControl/src/openaerialmapadapter.h
@@ -25,7 +25,7 @@
#ifndef OPENAERIALMAPADAPTER_H
#define OPENAERIALMAPADAPTER_H
-
+#include <qmapcontrolexport.h>
#include "tilemapadapter.h"
namespace qmapcontrol
{
@@ -34,7 +34,7 @@ namespace qmapcontrol
* This is a conveniece class, which extends and configures a TileMapAdapter. Source of maps is http://www.openaerialmap.org/
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class OpenAerialMapAdapter : public TileMapAdapter
+ class QMAPCONTROL_LINK_SYMBOL OpenAerialMapAdapter : public TileMapAdapter
{
Q_OBJECT
public:
diff --git a/QMapControl/src/osmmapadapter.h b/QMapControl/src/osmmapadapter.h
old mode 100644
new mode 100755
index a139880..c0b0fee
--- a/QMapControl/src/osmmapadapter.h
+++ b/QMapControl/src/osmmapadapter.h
@@ -25,7 +25,7 @@
#ifndef OSMMAPADAPTER_H
#define OSMMAPADAPTER_H
-
+#include <qmapcontrolexport.h>
#include "tilemapadapter.h"
namespace qmapcontrol
{
@@ -34,7 +34,7 @@ namespace qmapcontrol
* This is a conveniece class, which extends and configures a TileMapAdapter
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class OSMMapAdapter : public TileMapAdapter
+ class QMAPCONTROL_LINK_SYMBOL OSMMapAdapter : public TileMapAdapter
{
Q_OBJECT
public:
diff --git a/QMapControl/src/point.cpp b/QMapControl/src/point.cpp
old mode 100644
new mode 100755
index e1831be..45793a6
--- a/QMapControl/src/point.cpp
+++ b/QMapControl/src/point.cpp
@@ -144,8 +144,8 @@ namespace qmapcontrol
int diffzoom = homelevel-currentzoom;
int viewheight = size.height();
int viewwidth = size.width();
- viewheight = int(viewheight / pow(2, diffzoom));
- viewwidth = int(viewwidth / pow(2, diffzoom));
+ viewheight = int(viewheight / pow(2.0, diffzoom));
+ viewwidth = int(viewwidth / pow(2.0, diffzoom));
if (minsize.height()!= -1 && viewheight < minsize.height())
viewheight = minsize.height();
diff --git a/QMapControl/src/point.h b/QMapControl/src/point.h
old mode 100644
new mode 100755
index 426748a..ec863a6
--- a/QMapControl/src/point.h
+++ b/QMapControl/src/point.h
@@ -25,8 +25,8 @@
#ifndef POINT_H
#define POINT_H
-#include <QWidget>
-
+#include <QtGui/QWidget>
+#include <qmapcontrolexport.h>
#include "geometry.h"
namespace qmapcontrol
@@ -54,7 +54,7 @@ namespace qmapcontrol
*
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class Point : public Geometry
+ class QMAPCONTROL_LINK_SYMBOL Point : public Geometry
{
Q_OBJECT
diff --git a/QMapControl/src/tilemapadapter.cpp b/QMapControl/src/tilemapadapter.cpp
old mode 100644
new mode 100755
index e61cbc9..17d0e3b
--- a/QMapControl/src/tilemapadapter.cpp
+++ b/QMapControl/src/tilemapadapter.cpp
@@ -162,8 +162,8 @@ namespace qmapcontrol
z= min_zoom - z;
}
- if (x<0 || x>pow(2,z)-1 ||
- y<0 || y>pow(2,z)-1)
+ if (x<0 || x>pow(2.0,z)-1 ||
+ y<0 || y>pow(2.0,z)-1)
{
return false;
}
@@ -172,7 +172,7 @@ namespace qmapcontrol
}
int TileMapAdapter::tilesonzoomlevel(int zoomlevel) const
{
- return int(pow(2, zoomlevel));
+ return int(pow(2.0, zoomlevel));
}
int TileMapAdapter::xoffset(int x) const
{
diff --git a/QMapControl/src/tilemapadapter.h b/QMapControl/src/tilemapadapter.h
old mode 100644
new mode 100755
index 15c44d3..b3ed304
--- a/QMapControl/src/tilemapadapter.h
+++ b/QMapControl/src/tilemapadapter.h
@@ -25,7 +25,7 @@
#ifndef TILEMAPADAPTER_H
#define TILEMAPADAPTER_H
-
+#include <qmapcontrolexport.h>
#include "mapadapter.h"
namespace qmapcontrol
@@ -35,7 +35,7 @@ namespace qmapcontrol
* Use this derived MapAdapter to display maps from OpenStreetMap
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class TileMapAdapter : public MapAdapter
+ class QMAPCONTROL_LINK_SYMBOL TileMapAdapter : public MapAdapter
{
Q_OBJECT
public:
diff --git a/QMapControl/src/wmsmapadapter.cpp b/QMapControl/src/wmsmapadapter.cpp
old mode 100644
new mode 100755
index 96fa4fe..c6441a9
--- a/QMapControl/src/wmsmapadapter.cpp
+++ b/QMapControl/src/wmsmapadapter.cpp
@@ -47,7 +47,7 @@ namespace qmapcontrol
this->serverPath.append("&WIDTH=").append(loc.toString(tilesize))
.append("&HEIGHT=").append(loc.toString(tilesize))
.append("&BBOX=");
- numberOfTiles = pow(2, current_zoom);
+ numberOfTiles = pow(2.0, current_zoom);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
@@ -72,14 +72,14 @@ namespace qmapcontrol
void WMSMapAdapter::zoom_in()
{
current_zoom+=1;
- numberOfTiles = pow(2, current_zoom);
+ numberOfTiles = pow(2.0, current_zoom);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
void WMSMapAdapter::zoom_out()
{
current_zoom-=1;
- numberOfTiles = pow(2, current_zoom);
+ numberOfTiles = pow(2.0, current_zoom);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
diff --git a/QMapControl/src/wmsmapadapter.h b/QMapControl/src/wmsmapadapter.h
old mode 100644
new mode 100755
index 42fd5fb..b7041bd
--- a/QMapControl/src/wmsmapadapter.h
+++ b/QMapControl/src/wmsmapadapter.h
@@ -25,7 +25,7 @@
#ifndef WMSMAPADAPTER_H
#define WMSMAPADAPTER_H
-
+#include <qmapcontrolexport.h>
#include "mapadapter.h"
namespace qmapcontrol
@@ -35,7 +35,7 @@ namespace qmapcontrol
* Use this derived MapAdapter to display maps from WMS servers
* @author Kai Winter <kaiwinter@gmx.de>
*/
- class WMSMapAdapter : public MapAdapter
+ class QMAPCONTROL_LINK_SYMBOL WMSMapAdapter : public MapAdapter
{
public:
//! constructor
diff --git a/QMapControl/src/yahoomapadapter.cpp b/QMapControl/src/yahoomapadapter.cpp
old mode 100644
new mode 100755
index 863d7c2..b264080
--- a/QMapControl/src/yahoomapadapter.cpp
+++ b/QMapControl/src/yahoomapadapter.cpp