3 extern QAction* actionEditToggleFloatExport;
5 /////////////////////////////////////////////////////////////////
7 /////////////////////////////////////////////////////////////////
9 FloatObj::FloatObj ():LinkableMapObj()
11 // cout << "Const FloatObj ()\n";
17 FloatObj::FloatObj (QCanvas* c):LinkableMapObj(c)
19 // cout << "Const FloatObj (c) called from MapCenterObj (c)\n";
25 FloatObj::FloatObj (QCanvas* c, LinkableMapObj* p):LinkableMapObj (c)
27 // cout << "Const FloatObj (c,p)\n";
29 depth=p->getDepth()+1;
33 FloatObj::~FloatObj ()
35 // cout << "Destr FloatObj\n";
38 void FloatObj::init ()
47 void FloatObj::copy (FloatObj* other)
49 LinkableMapObj::copy (other);
51 useOrientation=other->useOrientation;
52 setVisibility (other->visible);
55 void FloatObj::setRelPos()
59 if (parObj->getOrientation()==OrientLeftOfCenter)
60 relPos.setX ( parObj->x() +parObj->width() - bbox.width() -absPos.x());
62 relPos.setX (absPos.x() - parObj->x() );
65 relPos.setX (absPos.x() - parObj->x() );
66 relPos.setY (absPos.y() - parObj->y() );
69 void FloatObj::setRelPos(const QPoint &p)
74 void FloatObj::setZ(const int &i)
85 void FloatObj::setUseOrientation (const bool &b)
87 if (useOrientation!=b)
94 void FloatObj::setFloatExport(const bool& b)
99 bool FloatObj::getFloatExport()
104 void FloatObj::move (double x, double y)
110 void FloatObj::move (QPoint p)
115 void FloatObj::reposition()
119 if (parObj->getOrientation()==OrientLeftOfCenter)
120 move (parObj->x() - relPos.x() + parObj->width() - bbox.width(), parObj->y()+relPos.y());
122 move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
125 move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
129 QRect FloatObj::getTotalBBox()
134 QRect FloatObj::getBBoxSizeWithChilds()
139 void FloatObj::select()
141 LinkableMapObj::select();
142 // Temporary draw the link while FO is selected
143 if (style==StyleUndef)
145 setLinkStyle(getDefLinkStyle());
146 setLinkColor(parObj->getLinkColor());
149 // Update FloatExport switch in context menu
151 actionEditToggleFloatExport->setEnabled (true);
153 actionEditToggleFloatExport->setEnabled (true);
158 void FloatObj::unselect()
160 LinkableMapObj::unselect();
161 setLinkStyle (StyleUndef);