Пример #1
0
 WayPointItem::WayPointItem(const internals::PointLatLng &coord,double const& altitude, const QString &description, MapGraphicItem *map) :
     map(map),
     autoreachedEnabled(true),
     text(NULL),
     textBG(NULL),
     numberI(NULL),
     numberIBG(NULL),
     coord(coord),
     reached(false),
     description(description),
     shownumber(true),
     isDragging(false),
     altitude(altitude), // sets a 10m default just in case
     heading(0),
     number(0)
 {
     picture.load(QString::fromUtf8(":/markers/images/marker.png"));
     number=WayPointItem::snumber;
     ++WayPointItem::snumber;
     this->setFlag(QGraphicsItem::ItemIsMovable,true);
     this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
     this->setFlag(QGraphicsItem::ItemIsSelectable,true);
    //transf.translate(picture.width()/2,picture.height());
    // this->setTransform(transf);
     SetShowNumber(shownumber);
     RefreshToolTip();
     RefreshPos();
 }
Пример #2
0
 WayPointItem::WayPointItem(const internals::PointLatLng &coord,double const& altitude, MapGraphicItem *map) :
     AbstractBaseItem(map),
     map(map),
     autoreachedEnabled(true),
     coord(coord),
     reached(false),
     description(""),
     shownumber(true),
     isDragging(false),
     altitude(altitude),
     heading(0)
 {
     text=0;
     numberI=0;
     picture.load(QString::fromUtf8(":/markers/images/marker.png"));
     number=WayPointItem::snumber;
     ++WayPointItem::snumber;
     this->setFlag(QGraphicsItem::ItemIsMovable,true);
     this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
     this->setFlag(QGraphicsItem::ItemIsSelectable,true);
     this->setZValue(4);
    // transf.translate(picture.width()/2,picture.height());
    // this->setTransform(transf);
     SetShowNumber(shownumber);
     RefreshToolTip();
     RefreshPos();
 }
Пример #3
0
WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint):reached(false),description(""),shownumber(true),isDragging(false),altitude(0),map(map)
{
    relativeCoord.bearing=0;
    relativeCoord.distance=0;
    relativeCoord.altitudeRelative=0;
    myType=relative;
    if(magicwaypoint)
    {
        isMagic=true;
        picture.load(QString::fromUtf8(":/opmap/images/waypoint_marker3.png"));
        number=-1;
    }
    else
    {
        isMagic=false;
        number=WayPointItem::snumber;
        ++WayPointItem::snumber;
    }
    text=0;
    numberI=0;
    this->setFlag(QGraphicsItem::ItemIsMovable,true);
    this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
    this->setFlag(QGraphicsItem::ItemIsSelectable,true);
    SetShowNumber(shownumber);
    RefreshToolTip();
    RefreshPos();
    myHome=NULL;
    QList<QGraphicsItem *> list=map->childItems();
    foreach(QGraphicsItem * obj,list)
    {
        HomeItem* h=qgraphicsitem_cast <HomeItem*>(obj);
        if(h)
            myHome=h;
    }