X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=mapobj.cpp;fp=mapobj.cpp;h=0000000000000000000000000000000000000000;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=3ec8c953545a3da1afe681d708767d98aa88b030;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/mapobj.cpp b/mapobj.cpp deleted file mode 100644 index 3ec8c95..0000000 --- a/mapobj.cpp +++ /dev/null @@ -1,170 +0,0 @@ -#include - -#include "geometry.h" -#include "mapobj.h" -#include "misc.h" - -///////////////////////////////////////////////////////////////// -// MapObj -///////////////////////////////////////////////////////////////// -MapObj::MapObj (QGraphicsItem *parent, TreeItem *ti):QGraphicsItem (parent) -{ - //qDebug() << "Const MapObj (this,ti)=("<setParentItem (NULL); -} - -void MapObj::init () -{ - absPos=QPointF(0,0); - visible=true; - boundingPolygon=NULL; -} - -void MapObj::copy(MapObj* other) -{ - absPos=other->absPos; - bbox.setX (other->bbox.x() ); - bbox.setY (other->bbox.y() ); - bbox.setSize (QSizeF(other->bbox.width(), other->bbox.height() ) ); -} - -void MapObj::setTreeItem (TreeItem *ti) -{ - treeItem=ti; -} - -TreeItem* MapObj::getTreeItem () const -{ - return treeItem; -} - -qreal MapObj::x() -{ - return getAbsPos().x(); -} - -qreal MapObj::y() -{ - return getAbsPos().y(); -} - -qreal MapObj::width() -{ - return bbox.width(); -} - -qreal MapObj::height() -{ - return bbox.height(); -} - -QPointF MapObj::getAbsPos() -{ - return absPos; -} - -QString MapObj::getPos() -{ - return qpointFToString(absPos); -} - -void MapObj::move (double x, double y) -{ - MapObj::move (QPointF(x,y)); -} - -void MapObj::move (QPointF p) -{ - absPos=p; - bbox.moveTo (p); - clickPoly=QPolygonF (bbox); -} - -void MapObj::moveBy (double x, double y) -{ - QPointF v(x,y); - MapObj::move (absPos + v ); - bbox.moveTo (bbox.topLeft() + v); - clickPoly.translate (v); -} - -QRectF MapObj::boundingRect () const -{ - return QRectF(); -} - -void MapObj::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) -{ -} - -QRectF MapObj::getBBox() -{ - return bbox; -} - -ConvexPolygon MapObj::getBoundingPolygon() -{ - QPolygonF p; - p<