diff -r cac93797c580 -r d922fb6ea482 branchobj.cpp --- a/branchobj.cpp Wed Sep 09 12:57:06 2009 +0000 +++ b/branchobj.cpp Fri Sep 11 12:56:15 2009 +0000 @@ -3,7 +3,7 @@ #include "branchitem.h" #include "geometry.h" #include "mapeditor.h" -#include "mainwindow.h" +#include "mainwindow.h" #include "misc.h" extern FlagRow *standardFlagsMaster; @@ -16,9 +16,13 @@ BranchObj::BranchObj (QGraphicsScene* s,TreeItem *ti):OrnamentedObj (s) { // cout << "Const BranchObj (s) \n"; - parObj=NULL; scene=s; treeItem=ti; + BranchItem *pi=(BranchItem*)(ti->parent()); + if (pi && pi!=ti->getModel()->getRootItem() ) + parObj=pi->getLMO(); + else + parObj=NULL; init(); } @@ -715,14 +719,28 @@ ConvexPolygon BranchObj::getBoundingPolygon() { - if (treeItem->branchCount()==0) +/* + if (!pi) //FIXME-3 Testing only + { + pi=scene->addPolygon(MapObj::getBoundingPolygon() ); + pi->setPen(Qt::NoPen); + pi->setBrush( QColor(qrand()%32*8,qrand()%32*8,qrand()%32*8) ); + pi->setZValue(Z_BBOX); + } + */ + if (treeItem->branchCount()==0 || treeItem->depth()==0) + { + if (pi) pi->setPolygon (MapObj::getBoundingPolygon() ); return MapObj::getBoundingPolygon(); + } + calcBBoxSizeWithChildren(); //FIXME-3 really needed? QPolygonF p; p<setPolygon (p ); return p; }