5 /////////////////////////////////////////////////////////////////
7 /////////////////////////////////////////////////////////////////
10 //qWarning ( "Const MapObj (): Please set scene somehow!!!");
15 MapObj::MapObj (QGraphicsScene *s, TreeItem *ti)
17 // cout << "Const MapObj\n";
24 MapObj::MapObj (MapObj* mo)
26 // cout << "CopyConst MapObj\n";
32 // cout << "Destr MapObj\n";
41 void MapObj::copy(MapObj* other)
43 // scene=other->scene; // already set in constr. of child, use that one...
45 bbox.setX (other->bbox.x() );
46 bbox.setY (other->bbox.y() );
47 bbox.setSize (QSizeF(other->bbox.width(), other->bbox.height() ) );
50 void MapObj::setTreeItem (TreeItem *ti)
55 TreeItem* MapObj::getTreeItem () const
61 QGraphicsScene* MapObj::getScene()
81 qreal MapObj::height()
86 QPointF MapObj::getAbsPos()
91 QString MapObj::getPos()
93 return qpointfToString(absPos);
96 void MapObj::move (double x, double y)
100 bbox.moveTo(QPointF(x,y));
101 clickBox.moveTo(QPointF(x,y));
104 void MapObj::move (QPointF p)
111 void MapObj::moveBy (double x, double y)
113 MapObj::move (x+absPos.x(),y+absPos.y() );
114 bbox.moveTo (bbox.x()+x,bbox.y()+y);
115 clickBox.moveTo (clickBox.x()+x,clickBox.y()+y);
118 QRectF MapObj::getBBox()
123 QRectF MapObj::getClickBox()
128 bool MapObj::isInClickBox (const QPointF &p)
130 return isInBox (p,clickBox);
133 QSizeF MapObj::getSize()
139 bool MapObj::isVisibleObj()
144 void MapObj::setVisibility(bool v)