1.1 --- a/linkablemapobj.cpp Mon Sep 05 11:56:31 2005 +0000
1.2 +++ b/linkablemapobj.cpp Thu Sep 22 12:56:05 2005 +0000
1.3 @@ -62,6 +62,7 @@
1.4 void LinkableMapObj::init ()
1.5 {
1.6 depth=-1;
1.7 + mapEditor=NULL;
1.8 childObj=NULL;
1.9 parObj=NULL;
1.10 parObjTmpBuf=NULL;
1.11 @@ -126,8 +127,16 @@
1.12 {
1.13 }
1.14
1.15 +bool LinkableMapObj::hasParObjTmp()
1.16 +{
1.17 + if (parObjTmpBuf) return true;
1.18 + return false;
1.19 +}
1.20 +
1.21 LinkStyle LinkableMapObj::getDefLinkStyle ()
1.22 {
1.23 + if (!mapEditor) return StyleUndef;
1.24 +
1.25 LinkStyle ls=mapEditor->getLinkStyle();
1.26 switch (ls)
1.27 {
1.28 @@ -204,8 +213,7 @@
1.29 else
1.30 p->hide();
1.31 pa0.resize (3);
1.32 - // TODO
1.33 - // a bit awkward: draw the lines additionally to polygon, to avoid
1.34 + // TODO a bit awkward: draw the lines additionally to polygon, to avoid
1.35 // missing pixels, when polygon is extremly flat
1.36 l = new QCanvasLine(canvas);
1.37 l->setPen( QPen(linkcolor, 1) );
1.38 @@ -227,8 +235,7 @@
1.39 pa1.resize (arcsegs+1);
1.40 pa2.resize (arcsegs+1);
1.41
1.42 - // TODO
1.43 - // a bit awkward: draw the lines additionally
1.44 + // TODO a bit awkward: draw the lines additionally
1.45 // to polygon, to avoid missing pixels,
1.46 // if polygon is extremly flat
1.47 for (i=0;i<arcsegs;i++)
1.48 @@ -247,12 +254,7 @@
1.49 default:
1.50 break;
1.51 }
1.52 - // FIXME updateLink is usually called (multiple times) later:
1.53 - //updateLink();
1.54 - } else
1.55 - {
1.56 - qWarning ("Error: ChildObj or parObj == NULL in LinkableMapObj::setLinkStyle\n");
1.57 - }
1.58 + }
1.59 }
1.60
1.61 LinkStyle LinkableMapObj::getLinkStyle()
1.62 @@ -287,7 +289,8 @@
1.63 {
1.64 // Overloaded in BranchObj and childs
1.65 // here only set default color
1.66 - setLinkColor (mapEditor->getDefLinkColor());
1.67 + if (mapEditor)
1.68 + setLinkColor (mapEditor->getDefLinkColor());
1.69 }
1.70
1.71 void LinkableMapObj::setLinkColor(QColor col)
1.72 @@ -650,8 +653,8 @@
1.73
1.74 void LinkableMapObj::alignRelativeTo (QPoint ref)
1.75 {
1.76 + // TODO testing, seems not to be used right now...
1.77 cout << "LMO::alignRelTo ref="<<ref<<endl;
1.78 - //FIXME
1.79 }
1.80
1.81 void LinkableMapObj::reposition()