4 /////////////////////////////////////////////////////////////////
6 /////////////////////////////////////////////////////////////////
9 // TODO not used any longer...
10 cout << "Const MapObj (): Please set canvas somehow!!!\n";
11 // canvas=actMapEditor->getCanvas();
15 MapObj::MapObj (QCanvas* c)
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 // canvas=other->canvas; // already set in constr. of child, use that one...
44 bbox.setX (other->bbox.x() );
45 bbox.setY (other->bbox.y() );
46 bbox.setSize (QSize(other->bbox.width(), other->bbox.height() ) );
49 QCanvas* MapObj::getCanvas()
74 QString MapObj::getPos()
76 return qpointToString(absPos);
79 void MapObj::move (double x, double y)
81 int xi=static_cast <int> (x);
82 int yi=static_cast <int> (y);
85 bbox.moveTopLeft(QPoint(xi,yi));
88 void MapObj::moveBy (double x, double y)
90 move (x+absPos.x(),y+absPos.y() );
93 bool MapObj::inBBox(QPoint p)
95 if (p.x() >= bbox.left() && p.x() <= bbox.right()
96 && p.y() <= bbox.bottom() && p.y() >= bbox.top() )
101 QRect MapObj::getBBox()
106 QRect MapObj::addBBox(QRect r1, QRect r2)
110 if (r1.left() <= r2.left() )
111 n.setLeft(r1.left() );
113 n.setLeft(r2.left() );
116 if (r1.top() <= r2.top() )
122 if (r1.right() <= r2.right() )
123 n.setRight(r2.right() );
125 n.setRight(r1.right() );
128 if (r1.bottom() <= r2.bottom() )
129 n.setBottom(r2.bottom() );
131 n.setBottom(r1.bottom() );
135 QSize MapObj::getSize()
141 bool MapObj::isVisibleObj()
146 void MapObj::setVisibility(bool v)