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 parObj->calcBBoxSize();
72 parObj->requestReposition();
76 void FloatObj::setRelPos(const QPoint &p)
80 { parObj->calcBBoxSize();
81 parObj->requestReposition();
85 QPoint FloatObj::getRelPos ()
90 void FloatObj::setZ(const int &i)
101 void FloatObj::setUseOrientation (const bool &b)
103 if (useOrientation!=b)
110 void FloatObj::setFloatExport(const bool& b)
115 bool FloatObj::getFloatExport()
120 void FloatObj::move (double x, double y)
126 void FloatObj::move (QPoint p)
131 void FloatObj::reposition()
135 if (parObj->getOrientation()==OrientLeftOfCenter)
136 move (parObj->x() - relPos.x() + parObj->width() - bbox.width(), parObj->y()+relPos.y());
138 move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
141 move (parObj->x()+relPos.x(), parObj->y()+relPos.y());
145 QRect FloatObj::getTotalBBox()
150 QRect FloatObj::getBBoxSizeWithChilds()
155 void FloatObj::select()
157 LinkableMapObj::select();
158 setLinkColor(parObj->getLinkColor());
160 // Update FloatExport switch in context menu
162 actionEditToggleFloatExport->setEnabled (true);
164 actionEditToggleFloatExport->setEnabled (true);
169 void FloatObj::unselect()
171 LinkableMapObj::unselect();