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 ()
45 setLinkStyle (StyleParabel);
46 setHideLinkUnselected(true);
49 void FloatObj::copy (FloatObj* other)
51 LinkableMapObj::copy (other);
53 useOrientation=other->useOrientation;
54 setVisibility (other->visible);
57 void FloatObj::setRelPos()
61 if (parObj->getOrientation()==OrientLeftOfCenter)
62 relPos.setX ( parObj->x() +parObj->width() - bbox.width() -absPos.x());
64 relPos.setX (absPos.x() - parObj->x() );
67 relPos.setX (absPos.x() - parObj->x() );
68 relPos.setY (absPos.y() - parObj->y() );
71 void FloatObj::setRelPos(const QPoint &p)
76 void FloatObj::setZ(const int &i)
87 void FloatObj::setUseOrientation (const bool &b)
89 if (useOrientation!=b)
96 void FloatObj::setFloatExport(const bool& b)
101 bool FloatObj::getFloatExport()
106 void FloatObj::move (double x, double y)
112 void FloatObj::move (QPoint p)
117 void FloatObj::reposition()
121 if (parObj->getOrientation()==OrientLeftOfCenter)
122 move (parObj->x() - relPos.x() + parObj->width() - bbox.width(), parObj->y()+relPos.y());
124 move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
127 move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
131 QRect FloatObj::getTotalBBox()
136 QRect FloatObj::getBBoxSizeWithChilds()
141 void FloatObj::select()
143 LinkableMapObj::select();
144 // Temporary draw the link while FO is selected
145 if (style==StyleUndef)
147 setLinkStyle(getDefLinkStyle());
148 setLinkColor(parObj->getLinkColor());
151 // Update FloatExport switch in context menu
153 actionEditToggleFloatExport->setEnabled (true);
155 actionEditToggleFloatExport->setEnabled (true);
160 void FloatObj::unselect()
162 LinkableMapObj::unselect();
163 setLinkStyle (StyleUndef);