diff -r 9db215a4ad53 -r 5987f9f15bac branchobj.cpp --- a/branchobj.cpp Mon Jul 27 12:53:17 2009 +0000 +++ b/branchobj.cpp Mon Aug 03 10:42:12 2009 +0000 @@ -86,18 +86,12 @@ absPos=getRandPos(); absPos+=parObj->getChildPos(); } - - includeImagesVer=false; - includeImagesHor=false; } void BranchObj::copy (BranchObj* other) { OrnamentedObj::copy(other); - for (int i=0; ifloatimage.size(); ++i) - addFloatImage (other->floatimage.at(i)); - setVisibility (other->visible); angle=other->angle; @@ -109,9 +103,6 @@ { //setVisibility (true); //FIXME-4 needed? - while (!floatimage.isEmpty()) - delete floatimage.takeFirst(); - while (!xlink.isEmpty()) delete xlink.takeFirst(); } @@ -218,15 +209,15 @@ standardFlags->setVisibility(v); LinkableMapObj::setVisibility (v); int i; - for (i=0; isetVisibility (v); + for (i=0; iimageCount(); ++i) + treeItem->getImageObjNum(i)->setVisibility (v); for (i=0; isetVisibility (); // Only change children, if I am not scrolled if (! bi->isScrolled() && (bi->depth() < toDepth)) { - // Now go recursivly through all children + // Now go recursivly through all children //FIXME-3 are there multiple calls for lower level items??? for (i=0; ibranchCount(); ++i) treeItem->getBranchObjNum(i)->setVisibility (v,toDepth); } @@ -264,8 +255,8 @@ void BranchObj::positionContents() { - for (int i=0; ireposition(); + for (int i=0; iimageCount(); ++i) + treeItem->getImageObjNum(i)->reposition(); OrnamentedObj::positionContents(); } @@ -344,37 +335,38 @@ QPointF rp; topPad=botPad=leftPad=rightPad=0; - if (includeImagesVer || includeImagesHor) + bool incV=((BranchItem*)treeItem)->getIncludeImagesVer(); + bool incH=((BranchItem*)treeItem)->getIncludeImagesHor(); + if (incH || incV) { - if (treeItem->imageCount()>0) + FloatImageObj *fio; + for (int i=0; iimageCount(); ++i ) { - for (int i=0; igetImageObjNum(i); + rp=fio->getRelPos(); + if (incV) { - rp=floatimage.at(i)->getRelPos(); - if (includeImagesVer) + if (rp.y() < 0) + topPad=max (topPad,-rp.y()-h); + if (rp.y()+fio->height() > 0) + botPad=max (botPad,rp.y()+fio->height()); + } + if (incH) + { + if (orientation==LinkableMapObj::RightOfCenter) { - if (rp.y() < 0) - topPad=max (topPad,-rp.y()-h); - if (rp.y()+floatimage.at(i)->height() > 0) - botPad=max (botPad,rp.y()+floatimage.at(i)->height()); - } - if (includeImagesHor) + if (-rp.x()-w > 0) + leftPad=max (leftPad,-rp.x()-w); + if (rp.x()+fio->width() > 0) + rightPad=max (rightPad,rp.x()+fio->width()); + } else { - if (orientation==LinkableMapObj::RightOfCenter) - { - if (-rp.x()-w > 0) - leftPad=max (leftPad,-rp.x()-w); - if (rp.x()+floatimage.at(i)->width() > 0) - rightPad=max (rightPad,rp.x()+floatimage.at(i)->width()); - } else - { - if (rp.x()< 0) - leftPad=max (leftPad,-rp.x()); - if (rp.x()+floatimage.at(i)->width() > w) - rightPad=max (rightPad,rp.x()+floatimage.at(i)->width()-w); - } - } - } + if (rp.x()< 0) + leftPad=max (leftPad,-rp.x()); + if (rp.x()+fio->width() > w) + rightPad=max (rightPad,rp.x()+fio->width()-w); + } + } } h+=topPad+botPad; w+=leftPad+rightPad; @@ -478,9 +470,7 @@ changed=true; } } - - if (changed) - updateContentSize(); + updateContentSize(); } @@ -523,47 +513,9 @@ return NULL; } -void BranchObj::setIncludeImagesVer(bool b) -{ - includeImagesVer=b; - calcBBoxSize(); - positionBBox(); - requestReposition(); -} - -bool BranchObj::getIncludeImagesVer() -{ - return includeImagesVer; -} - -void BranchObj::setIncludeImagesHor(bool b) -{ - includeImagesHor=b; - calcBBoxSize(); - positionBBox(); - requestReposition(); -} - -bool BranchObj::getIncludeImagesHor() -{ - return includeImagesHor; -} - -QString BranchObj::getIncludeImageAttr() -{ - QString a; - if (includeImagesVer) - a=attribut ("incImgV","true"); - else - a=attribut ("incImgV","false"); - if (includeImagesHor) - a+=attribut ("incImgH","true"); - else - a+=attribut ("incImgH","false"); - return a; -} - -FloatImageObj* BranchObj::addFloatImage () + +// FIXME-3 FloatImageObj* BranchObj::addFloatImage () +/* { FloatImageObj *newfi=new FloatImageObj (scene,this); floatimage.append (newfi); @@ -571,15 +523,15 @@ newfi->setVisibility (false); else newfi->setVisibility(visible); - /* - calcBBoxSize(); - positionBBox(); - */ + //calcBBoxSize(); + //positionBBox(); requestReposition(); return newfi; } +*/ -FloatImageObj* BranchObj::addFloatImage (FloatImageObj *fio) +//FIXME-3 FloatImageObj* BranchObj::addFloatImage (FloatImageObj *fio) +/* { FloatImageObj *newfi=new FloatImageObj (scene,this); floatimage.append (newfi); @@ -588,15 +540,14 @@ newfi->setVisibility (false); else newfi->setVisibility(visible); - /* - calcBBoxSize(); - positionBBox(); - */ + //calcBBoxSize(); + //positionBBox(); requestReposition(); return newfi; } +*/ -FloatImageObj* BranchObj::getFirstFloatImage () +/* FIXME-3 FloatImageObj* BranchObj::getFirstFloatImage () { return floatimage.first(); } @@ -606,7 +557,7 @@ return floatimage.last(); } -FloatImageObj* BranchObj::getFloatImageNum (const uint &i) +FIXME -3 FloatImageObj* BranchObj::getFloatImageNum (const uint &i) { return floatimage.at(i); } @@ -619,6 +570,7 @@ positionBBox(); requestReposition(); } +*/ void BranchObj::savePosInAngle () { @@ -849,11 +801,9 @@ (have been NULL at least in calcBBoxSizeWithChilds...) */ -/* - FIXME-3 for (int i=0; iisHidden()) - r=addBBox(floatimage.at(i)->getTotalBBox(),r); - */ + for (int i=0; iimageCount(); ++i) + if (!treeItem->isHidden()) + r=addBBox(treeItem->getImageObjNum(i)->getTotalBBox(),r); return r; }