branchobj.cpp
changeset 819 8f987e376035
parent 817 b486ffd0fa11
child 822 c2ce9944148c
     1.1 --- a/branchobj.cpp	Tue Dec 15 09:14:59 2009 +0000
     1.2 +++ b/branchobj.cpp	Mon Jan 04 20:36:06 2010 +0000
     1.3 @@ -26,22 +26,6 @@
     1.4  	init();
     1.5  }
     1.6  
     1.7 -/*
     1.8 -BranchObj::BranchObj (QGraphicsScene* s, LinkableMapObj* p):OrnamentedObj (s)// FIXME-3 needed at all?
     1.9 -{
    1.10 -//    cout << "Const BranchObj (s,p)\n";
    1.11 -    scene=s;
    1.12 -    setParObj (p);	
    1.13 -	if (treeItem->depth()==1)	// FIXME-3 needed to recursively calc depth?
    1.14 -		// Calc angle to mapCenter if I am a mainbranch
    1.15 -		// needed for reordering the mainbranches clockwise 
    1.16 -		// around mapcenter 
    1.17 -		angle=getAngle (QPointF (x() - parObj->getChildPos().x() , 
    1.18 -								(y() - parObj->getChildPos().y() ) ) );
    1.19 -    init();
    1.20 -}
    1.21 -*/
    1.22 -
    1.23  BranchObj::~BranchObj ()
    1.24  {
    1.25  //	cout << "Destr BranchObj of "<<this<<" ("<<treeItem->getHeading().toStdString()<<")"<<endl;
    1.26 @@ -95,7 +79,7 @@
    1.27  		delete xlink.takeFirst();
    1.28  }
    1.29  
    1.30 -void BranchObj::setParObjTmp(LinkableMapObj* dst, QPointF m, int off)	//FIXME-1 when moving a mainbranch to a branch it still has relPos, not moved as child
    1.31 +void BranchObj::setParObjTmp(LinkableMapObj* dst, QPointF m, int off)	
    1.32  {
    1.33  	// Temporary link to dst
    1.34  	// m is position of mouse pointer 
    1.35 @@ -452,7 +436,7 @@
    1.36  			changed=true;
    1.37  		}	
    1.38  	}
    1.39 -	updateContentSize();
    1.40 +	if (changed) updateContentSize(); 
    1.41  }
    1.42  
    1.43  void BranchObj::setDefAttr (BranchModification mod)
    1.44 @@ -628,12 +612,13 @@
    1.45  }
    1.46  
    1.47  
    1.48 -QRectF BranchObj::getTotalBBox()
    1.49 +QRectF BranchObj::getTotalBBox() // FIXME-2 not really needed, get rid of this
    1.50  {
    1.51  	QRectF r=bbox;
    1.52  
    1.53  	if ( ((BranchItem*)treeItem)->isScrolled() ) return r;
    1.54  
    1.55 +/* FIXME-2 really include children _here_ ?  likely not needed anymore, but done in TreeItem */
    1.56  	for (int i=0; i<treeItem->branchCount(); ++i)
    1.57  		if (!treeItem->getBranchNum(i)->isHidden())
    1.58  			r=addBBox(treeItem->getBranchObjNum(i)->getTotalBBox(),r);
    1.59 @@ -643,9 +628,11 @@
    1.60  			(have been NULL at least in calcBBoxSizeWithChilds...)
    1.61  */			
    1.62  
    1.63 -	for (int i=0; i<treeItem->imageCount(); ++i)
    1.64 +/* FIXME-2 in
    1.65 +	for (int i=0; i<treeItem->imageCount(); ++i
    1.66  		if (!treeItem->isHidden())
    1.67  			r=addBBox(treeItem->getImageObjNum(i)->getTotalBBox(),r);
    1.68 +*/			
    1.69  	return r;
    1.70  }
    1.71  
    1.72 @@ -672,7 +659,7 @@
    1.73  		return MapObj::getBoundingPolygon();
    1.74  	}
    1.75  
    1.76 -	calcBBoxSizeWithChildren();	//FIXME-3 really needed?
    1.77 +	calcBBoxSizeWithChildren();	//FIXME-2 really needed?
    1.78  	QPolygonF p;
    1.79  	p<<bboxTotal.topLeft();
    1.80  	p<<bboxTotal.topRight();
    1.81 @@ -749,15 +736,6 @@
    1.82  	bboxTotal.setHeight(max (r.height(),  bbox.height()));
    1.83  }
    1.84  
    1.85 -QString BranchObj::getSelectString()
    1.86 -{
    1.87 -	VymModel *model=treeItem->getModel();
    1.88 -	if (model)
    1.89 -		return model->getSelectString (this);
    1.90 -	else
    1.91 -		return QString();
    1.92 -}
    1.93 -
    1.94  void BranchObj::setAnimation(const AnimPoint &ap)
    1.95  {
    1.96  	anim=ap;