Changeset 4626 in ntrip for trunk/BNC/src/bncmap_svg.cpp


Ignore:
Timestamp:
Sep 1, 2012, 2:02:13 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmap_svg.cpp

    r4622 r4626  
    1616// Constructor
    1717/////////////////////////////////////////////////////////////////////////////
    18 bncMap::bncMap(QWidget* parent) : QDialog(parent) {
     18t_bncMap::t_bncMap(QWidget* parent) : QDialog(parent) {
    1919
    20   QwtPlot* plot = new QwtPlot();
     20  _mapPlot = new QwtPlot();
    2121
    22   (void)new QwtPlotPanner(plot->canvas());
    23   (void)new QwtPlotMagnifier(plot->canvas());
     22  (void)new QwtPlotPanner(_mapPlot->canvas());
     23  (void)new QwtPlotMagnifier(_mapPlot->canvas());
    2424
    25   plot->canvas()->setFocusPolicy(Qt::WheelFocus);
     25  _mapPlot->canvas()->setFocusPolicy(Qt::WheelFocus);
    2626
    27   QRectF rect(-180.0, -90.0, 360.0, 180.0);
    28 
    29   QwtPlotSvgItem* map = new QwtPlotSvgItem();
    30   map->loadFile(rect, ":world.svg");
    31   map->attach(plot);
    32 
    33   //// beg test
    34   for (int ii = -180; ii <= 180; ii += 60) {
    35     for (int jj = -80; jj <= 80;   jj += 40) {
    36       QwtPlotMarker* marker = new QwtPlotMarker();
    37       marker->setValue(ii,jj);
    38       marker->setLabel(QwtText("TXT"));
    39       marker->setItemAttribute(QwtPlotItem::AutoScale, false);
    40       marker->attach(plot);
    41     }
    42   }
    43   //// end test
     27  QwtPlotSvgItem* mapItem = new QwtPlotSvgItem();
     28  mapItem->loadFile(QRectF(-180.0, -90.0, 360.0, 180.0), ":world.svg");
     29  mapItem->attach(_mapPlot);
    4430
    4531  QVBoxLayout* mainLayout = new QVBoxLayout(this);
    46   mainLayout->addWidget(plot);
     32  mainLayout->addWidget(_mapPlot);
    4733
    48   plot->replot();
     34  _mapPlot->replot();
    4935}
    5036
    5137// Destructor
    5238/////////////////////////////////////////////////////////////////////////////
    53 bncMap::~bncMap(){
     39t_bncMap::~t_bncMap() {
     40  delete _mapPlot;
    5441}
     42
     43//
     44/////////////////////////////////////////////////////////////////////////////
     45void t_bncMap::slotNewPoint(QPointF point, QString name, QPen, double) {
     46  QwtPlotMarker* marker = new QwtPlotMarker();
     47  marker->setValue(point.x(), point.y());
     48  marker->setLabel(QwtText(name));
     49  marker->attach(_mapPlot);
     50}
     51
     52
     53
Note: See TracChangeset for help on using the changeset viewer.