diff -r d85834ad8c54 -r 133e2ed6b9c5 branchobj.cpp --- a/branchobj.cpp Mon Aug 24 14:39:07 2009 +0000 +++ b/branchobj.cpp Thu Sep 03 08:52:00 2009 +0000 @@ -13,21 +13,16 @@ // BranchObj ///////////////////////////////////////////////////////////////// -BranchObj::BranchObj () :OrnamentedObj() // FIXME-3 needed at all? -{ -// cout << "Const BranchObj ()\n"; - setParObj (this); - init(); -} - -BranchObj::BranchObj (QGraphicsScene* s):OrnamentedObj (s)// FIXME-3 needed at all? +BranchObj::BranchObj (QGraphicsScene* s,TreeItem *ti):OrnamentedObj (s) { // cout << "Const BranchObj (s) \n"; parObj=NULL; scene=s; + treeItem=ti; init(); } +/* BranchObj::BranchObj (QGraphicsScene* s, LinkableMapObj* p):OrnamentedObj (s)// FIXME-3 needed at all? { // cout << "Const BranchObj (s,p)\n"; @@ -41,6 +36,7 @@ (y() - parObj->getChildPos().y() ) ) ); init(); } +*/ BranchObj::~BranchObj () { @@ -210,8 +206,8 @@ int i; for (i=0; iimageCount(); ++i) treeItem->getImageObjNum(i)->setVisibility (v); - for (i=0; isetVisibility (); + for (i=0; ixlinkCount(); ++i) + treeItem->getXLinkObjNum(i)->setVisibility (); // Only change children, if I am not scrolled if (! bi->isScrolled() && (bi->depth() < toDepth)) @@ -299,9 +295,13 @@ // set the frame frame->setRect(QRectF(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) ); - // Update links to other branches - for (int i=0; iupdateXLink(); + //Update links to other branches + XLinkObj *xlo; + for (int i=0; ixlinkCount(); ++i) + { + xlo=treeItem->getXLinkObjNum(i); + if (xlo) xlo->updateXLink(); + } } void BranchObj::calcBBoxSize() @@ -472,105 +472,6 @@ updateContentSize(); } - -void BranchObj::addXLink (XLinkObj *xlo) -{ - xlink.append (xlo); - -} - -void BranchObj::removeXLinkRef (XLinkObj *xlo) -{ - xlink.removeAt (xlink.indexOf(xlo)); -} - -void BranchObj::deleteXLink(XLinkObj *xlo) -{ - xlo->deactivate(); - if (!xlo->isUsed()) delete (xlo); -} - -void BranchObj::deleteXLinkAt (int i) -{ - XLinkObj *xlo=xlink.at(i); - xlo->deactivate(); - if (!xlo->isUsed()) delete(xlo); -} - -XLinkObj* BranchObj::XLinkAt (int i) -{ - return xlink.at(i); -} - -BranchObj* BranchObj::XLinkTargetAt (int i) -{ - if (i>=0 && iotherBranch (this); - } - return NULL; -} - - -// FIXME-3 FloatImageObj* BranchObj::addFloatImage () -/* -{ - FloatImageObj *newfi=new FloatImageObj (scene,this); - floatimage.append (newfi); - if ( ((BranchItem*)treeItem)->hasScrolledParent((BranchItem*)treeItem) ) - newfi->setVisibility (false); - else - newfi->setVisibility(visible); - //calcBBoxSize(); - //positionBBox(); - requestReposition(); - return newfi; -} -*/ - -//FIXME-3 FloatImageObj* BranchObj::addFloatImage (FloatImageObj *fio) -/* -{ - FloatImageObj *newfi=new FloatImageObj (scene,this); - floatimage.append (newfi); - newfi->copy (fio); - if (((BranchItem*)treeItem)->hasScrolledParent((BranchItem*)treeItem) ) - newfi->setVisibility (false); - else - newfi->setVisibility(visible); - //calcBBoxSize(); - //positionBBox(); - requestReposition(); - return newfi; -} -*/ - -/* FIXME-3 FloatImageObj* BranchObj::getFirstFloatImage () -{ - return floatimage.first(); -} - -FloatImageObj* BranchObj::getLastFloatImage () -{ - return floatimage.last(); -} - -FIXME -3 FloatImageObj* BranchObj::getFloatImageNum (const uint &i) -{ - return floatimage.at(i); -} - -void BranchObj::removeFloatImage (FloatImageObj *fio) -{ - int i=floatimage.indexOf (fio); - if (i>-1) delete (floatimage.takeAt (i)); - calcBBoxSize(); - positionBBox(); - requestReposition(); -} -*/ - void BranchObj::savePosInAngle () { // Save position in angle