linkablemapobj.cpp
changeset 773 340bc29da9a0
parent 760 59614eaf5fbb
child 775 6e4b586aa88a
     1.1 --- a/linkablemapobj.cpp	Wed May 20 15:40:14 2009 +0000
     1.2 +++ b/linkablemapobj.cpp	Tue May 26 11:23:44 2009 +0000
     1.3 @@ -57,9 +57,6 @@
     1.4  
     1.5  void LinkableMapObj::init ()
     1.6  {
     1.7 -	model=NULL;
     1.8 -
     1.9 -    childObj=NULL;
    1.10      parObj=NULL;
    1.11      parObjTmpBuf=NULL;
    1.12      parPos=QPointF(0,0);
    1.13 @@ -103,7 +100,6 @@
    1.14  void LinkableMapObj::copy (LinkableMapObj* other)
    1.15  {
    1.16      MapObj::copy(other);
    1.17 -	model=other->model;
    1.18  	bboxTotal=other->bboxTotal;
    1.19      setLinkStyle(other->style);
    1.20      setLinkColor (other->linkcolor);
    1.21 @@ -122,25 +118,9 @@
    1.22  	return treeItem;
    1.23  }
    1.24  
    1.25 -void LinkableMapObj::setModel (VymModel *vm)
    1.26 -{
    1.27 -	model=vm;
    1.28 -}
    1.29 -
    1.30 -VymModel* LinkableMapObj::getModel()
    1.31 -{
    1.32 -	return model;
    1.33 -}
    1.34 -
    1.35 -void LinkableMapObj::setChildObj(LinkableMapObj* o)
    1.36 -{
    1.37 -    childObj=o;
    1.38 -}
    1.39 -
    1.40  void LinkableMapObj::setParObj(LinkableMapObj* o)
    1.41  {
    1.42      parObj=o;
    1.43 -	if (parObj) model=parObj->getModel();
    1.44  }
    1.45  
    1.46  void LinkableMapObj::setParObjTmp(LinkableMapObj*,QPointF,int)	// FIXME-3 make pure virtual
    1.47 @@ -205,6 +185,7 @@
    1.48  
    1.49  LinkableMapObj::Style LinkableMapObj::getDefLinkStyle ()
    1.50  {
    1.51 +	VymModel *model=treeItem->getModel();
    1.52  	if (!model)
    1.53  	{
    1.54  		qWarning ("LMO::getDefLinkStyle   model=NULL");
    1.55 @@ -246,7 +227,7 @@
    1.56  		
    1.57  	style=newstyle;
    1.58  
    1.59 -    if (childObj!=NULL && parObj != NULL)
    1.60 +    if (parObj != NULL)
    1.61      {
    1.62  		QGraphicsLineItem *cl;
    1.63  		switch (style)
    1.64 @@ -332,6 +313,7 @@
    1.65  {
    1.66  	// Overloaded in BranchObj and children
    1.67  	// here only set default color
    1.68 +	VymModel *model=treeItem->getModel();
    1.69  	if (model)
    1.70  		setLinkColor (model->getMapDefLinkColor());
    1.71  }
    1.72 @@ -554,11 +536,6 @@
    1.73  	} // switch (style)	
    1.74  }
    1.75  	
    1.76 -LinkableMapObj* LinkableMapObj::getChildObj()
    1.77 -{
    1.78 -    return childObj;
    1.79 -}
    1.80 -
    1.81  LinkableMapObj* LinkableMapObj::getParObj()
    1.82  {
    1.83      return parObj;
    1.84 @@ -621,6 +598,7 @@
    1.85  	// we want to block expensive repositioning, but just do it once at
    1.86  	// the end, thus check first:
    1.87  
    1.88 +	VymModel *model=treeItem->getModel();
    1.89  	if (model->isRepositionBlocked()) return;	
    1.90  	
    1.91  	// Pass on the request to parent objects, if this hasn't been done yet