- Timestamp:
- Sep 6, 2012, 2:16:38 PM (12 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncmap.h
r4636 r4651 29 29 30 30 class QwtPlot; 31 class QwtPlotZoomer; 31 32 32 33 class t_bncMap : public QDialog { … … 46 47 protected: 47 48 virtual void closeEvent(QCloseEvent *); 49 virtual void showEvent(QShowEvent *); 48 50 49 51 private: 50 QwtPlot* _mapPlot; 51 QPushButton* _buttonClose; 52 QPushButton* _buttonPrint; 52 QwtPlot* _mapPlot; 53 QwtPlotZoomer* _mapPlotZoomer; 54 QPushButton* _buttonClose; 55 QPushButton* _buttonPrint; 56 double _minPointLat; 57 double _maxPointLat; 58 double _minPointLon; 59 double _maxPointLon; 53 60 }; 54 61 -
trunk/BNC/src/bncmap_svg.cpp
r4636 r4651 47 47 #include <qwt_plot_marker.h> 48 48 #include <qwt_plot_canvas.h> 49 #include <qwt_plot_panner.h>50 49 #include <qwt_plot_zoomer.h> 51 #include <qwt_plot_magnifier.h>52 50 #include <qwt_plot_renderer.h> 53 51 … … 65 63 _mapPlot->setAxisScale(QwtPlot::yLeft, -90.0, 90.0); 66 64 67 // (void)new QwtPlotPanner(_mapPlot->canvas()); 68 // (void)new QwtPlotMagnifier(_mapPlot->canvas()); 69 (void)new QwtPlotZoomer(_mapPlot->canvas()); 65 _mapPlotZoomer = new QwtPlotZoomer(_mapPlot->canvas()); 70 66 71 67 _mapPlot->canvas()->setFocusPolicy(Qt::WheelFocus); … … 97 93 mainLayout->addLayout(buttonLayout); 98 94 95 // Minimal and Maximal Coordinates 96 // ------------------------------- 97 _minPointLat = 0.0; 98 _maxPointLat = 0.0; 99 _minPointLon = 0.0; 100 _maxPointLon = 0.0; 101 99 102 // Important 100 103 // --------- … … 123 126 marker->setSymbol(symbol); 124 127 marker->attach(_mapPlot); 128 129 // Remeber minimal and maximal coordinates 130 // --------------------------------------- 131 if (_minPointLat == 0.0 && _maxPointLat == 0.0 && 132 _minPointLon == 0.0 && _maxPointLon == 0.0) { 133 _minPointLat = latDeg; 134 _maxPointLat = latDeg; 135 _minPointLon = lonDeg; 136 _maxPointLon = lonDeg; 137 } 138 else { 139 if (_maxPointLat < latDeg) { 140 _maxPointLat = latDeg; 141 } 142 else if (_minPointLat > latDeg) { 143 _minPointLat = latDeg; 144 } 145 if (_maxPointLon < lonDeg) { 146 _maxPointLon = lonDeg; 147 } 148 else if (_minPointLon > lonDeg) { 149 _minPointLon = lonDeg; 150 } 151 } 125 152 } 126 153 … … 135 162 void t_bncMap::closeEvent(QCloseEvent* event) { 136 163 QDialog::closeEvent(event); 164 } 165 166 // 167 //////////////////////////////////////////////////////////////////////////// 168 void t_bncMap::showEvent(QShowEvent* event) { 169 double width = _maxPointLon - _minPointLon; 170 double height = _maxPointLat - _minPointLat; 171 if (width > 0 && height > 0) { 172 QRectF rect(_minPointLon, _minPointLat, width, height); 173 qDebug() << rect; 174 _mapPlotZoomer->zoom(rect); 175 } 176 QDialog::showEvent(event); 137 177 } 138 178 -
trunk/BNC/src/src.pro
r4625 r4651 6 6 # Switch to debug configuration 7 7 # ----------------------------- 8 CONFIG -= debug9 CONFIG += release8 CONFIG -= release 9 CONFIG += debug 10 10 11 11 DEFINES += NO_RTCM3_MAIN
Note:
See TracChangeset
for help on using the changeset viewer.