Initial import.
3 /////////////////////////////////////////////////////////////////
5 /////////////////////////////////////////////////////////////////
8 // TODO not used any longer...
9 cout << "Const MapObj (): Please set canvas somehow!!!\n";
10 // canvas=actMapEditor->getCanvas();
14 MapObj::MapObj (QCanvas* c)
16 // cout << "Const MapObj\n";
22 MapObj::MapObj (MapObj* mo)
24 // cout << "CopyConst MapObj\n";
30 // cout << "Destr MapObj\n";
39 void MapObj::copy(MapObj* other)
41 // canvas=other->canvas; // already set in constr. of child, use that one...
43 bbox.setX (other->bbox.x() );
44 bbox.setY (other->bbox.y() );
45 bbox.setSize (QSize(other->bbox.width(), other->bbox.height() ) );
48 QCanvas* MapObj::getCanvas()
73 void MapObj::move (double x, double y)
75 int xi=static_cast <int> (x);
76 int yi=static_cast <int> (y);
79 bbox.moveTopLeft(QPoint(xi,yi));
82 void MapObj::moveBy (double x, double y)
84 move (x+absPos.x(),y+absPos.y() );
87 bool MapObj::inBBox(QPoint p)
89 if (p.x() >= bbox.left() && p.x() <= bbox.right()
90 && p.y() <= bbox.bottom() && p.y() >= bbox.top() )
95 QRect MapObj::getBBox()
100 QRect MapObj::addBBox(QRect r1, QRect r2)
104 if (r1.left() <= r2.left() )
105 n.setLeft(r1.left() );
107 n.setLeft(r2.left() );
110 if (r1.top() <= r2.top() )
116 if (r1.right() <= r2.right() )
117 n.setRight(r2.right() );
119 n.setRight(r1.right() );
122 if (r1.bottom() <= r2.bottom() )
123 n.setBottom(r2.bottom() );
125 n.setBottom(r1.bottom() );
129 QSize MapObj::getSize()
135 bool MapObj::isVisibleObj()
140 void MapObj::setVisibility(bool v)