3 #include "floatimageobj.h"
5 #include "mapcenterobj.h"
7 /////////////////////////////////////////////////////////////////
9 /////////////////////////////////////////////////////////////////
10 MapCenterObj::MapCenterObj() : BranchObj ()
12 // cout << "Const MapCenterObj\n";
16 MapCenterObj::MapCenterObj(QGraphicsScene* s) : BranchObj (s)
18 // cout << "Const MapCenterObj canvas="<<s<<"\n";
22 MapCenterObj::~MapCenterObj()
24 // cout << "Destr MapCenterObj\n";
28 void MapCenterObj::clear()
33 void MapCenterObj::init ()
36 orientation=LinkableMapObj::UndefinedOrientation;
38 // TODO this should be done in TextObj later...
39 //QFont font ("Sans Serif,16,-1,5,50,0,0,0,0,0");
40 //heading->setFont(font);
41 //FIXME-2 no treeitem yet: setDefAttr(MovedBranch); and already in BI::createMapObj ?!?
43 frame->setFrameType (FrameObj::Rectangle);
47 void MapCenterObj::updateLink()
49 // set childPos to middle of MapCenterObj
50 childPos.setX( clickBox.topLeft().x() + (int)(clickBox.width())/2 );
51 childPos.setY( clickBox.topLeft().y() + (int)(clickBox.height())/2 );
53 for (int i=0; i<treeItem->branchCount(); ++i)
54 treeItem->getBranchObjNum(i)->updateLink();
57 void MapCenterObj::updateRelPositions()
59 if (repositionRequest) unsetAllRepositionRequests();
61 // update relative Positions of branches and floats
62 for (int i=0; i<treeItem->branchCount(); ++i)
64 treeItem->getBranchObjNum(i)->setRelPos();
65 treeItem->getBranchObjNum(i)->setOrientation();
68 for (int i=0; i<floatimage.size(); ++i)
69 floatimage.at(i)->setRelPos();
71 if (repositionRequest) reposition();