linkablemapobj.cpp
changeset 95 f688a9913724
parent 93 31c6ce8efbc7
child 97 0b048b6bb6f4
     1.1 --- a/linkablemapobj.cpp	Sat Apr 09 22:50:08 2005 +0000
     1.2 +++ b/linkablemapobj.cpp	Mon Apr 18 06:17:00 2005 +0000
     1.3 @@ -1,4 +1,4 @@
     1.4 -//#include <math.h>
     1.5 +#include <cmath>
     1.6  
     1.7  #include "linkablemapobj.h"
     1.8  #include "branchobj.h"
     1.9 @@ -535,6 +535,40 @@
    1.10      return parObj;
    1.11  }
    1.12  
    1.13 +LinkableMapObj* LinkableMapObj::findObj (QString s)
    1.14 +{
    1.15 +	LinkableMapObj *lmo=this;
    1.16 +	QString part;
    1.17 +	QString typ;
    1.18 +	QString num;
    1.19 +	while (!s.isEmpty() )
    1.20 +	{
    1.21 +		part=s.section(",",0,0);
    1.22 +		typ=part.left (3);
    1.23 +		num=part.right(part.length() - 3);
    1.24 +		
    1.25 +		if (typ=="mc:")
    1.26 +		{
    1.27 +			if (depth>0)
    1.28 +				return false;	// in a subtree there is no center
    1.29 +			else
    1.30 +				break;
    1.31 +		} else
    1.32 +			if (typ=="bo:")
    1.33 +				lmo=((BranchObj*)(lmo))->getBranchNum (num.toUInt());
    1.34 +			else
    1.35 +				if (typ=="fi:")
    1.36 +					lmo=((BranchObj*)(lmo))->getFloatImageNum (num.toUInt());
    1.37 +		if (!lmo) break;
    1.38 +		
    1.39 +		if (s.contains(","))
    1.40 +			s=s.right(s.length() - part.length() -1 );
    1.41 +		else	
    1.42 +			break;
    1.43 +	}
    1.44 +	return lmo;
    1.45 +}
    1.46 +
    1.47  QPoint LinkableMapObj::getChildPos()
    1.48  {
    1.49      return childPos;
    1.50 @@ -584,6 +618,8 @@
    1.51  
    1.52  void LinkableMapObj::alignRelativeTo (QPoint ref)
    1.53  {
    1.54 +	cout << "LMO::alignRelTo   ref="<<ref<<endl;
    1.55 +	//FIXME 
    1.56  }
    1.57  
    1.58  void LinkableMapObj::reposition()