5 /////////////////////////////////////////////////////////////////
7 /////////////////////////////////////////////////////////////////
10 //qWarning ( "Const MapObj (): Please set scene somehow!!!");
15 MapObj::MapObj (QGraphicsScene *s)
17 // cout << "Const MapObj\n";
23 MapObj::MapObj (MapObj* mo)
25 // cout << "CopyConst MapObj\n";
31 // cout << "Destr MapObj\n";
40 void MapObj::copy(MapObj* other)
42 // scene=other->scene; // already set in constr. of child, use that one...
44 bbox.setX (other->bbox.x() );
45 bbox.setY (other->bbox.y() );
46 bbox.setSize (QSizeF(other->bbox.width(), other->bbox.height() ) );
49 QGraphicsScene* MapObj::getScene()
69 qreal MapObj::height()
74 QPointF MapObj::getAbsPos()
79 QString MapObj::getPos()
81 return qpointfToString(absPos);
84 void MapObj::move (double x, double y)
88 bbox.moveTo(QPointF(x,y));
89 clickBox.moveTo(QPointF(x,y));
92 void MapObj::move (QPointF p)
99 void MapObj::moveBy (double x, double y)
101 MapObj::move (x+absPos.x(),y+absPos.y() );
102 bbox.moveTo (bbox.x()+x,bbox.y()+y);
103 clickBox.moveTo (clickBox.x()+x,clickBox.y()+y);
106 QRectF MapObj::getBBox()
111 QRectF MapObj::getClickBox()
116 bool MapObj::isInClickBox (const QPointF &p)
118 return isInBox (p,clickBox);
121 QSizeF MapObj::getSize()
127 bool MapObj::isVisibleObj()
132 void MapObj::setVisibility(bool v)