1.1 --- a/vym.pro Fri Feb 01 15:28:35 2008 +0000
1.2 +++ b/vym.pro Fri Feb 01 15:28:35 2008 +0000
1.3 @@ -4,6 +4,14 @@
1.4 CONFIG += qt warn_on release debug
1.5 CONFIG += x86 ppc
1.6
1.7 +TRANSLATIONS += lang/vym_de.ts
1.8 +TRANSLATIONS += lang/vym_en.ts
1.9 +TRANSLATIONS += lang/vym_es.ts
1.10 +TRANSLATIONS += lang/vym_it.ts
1.11 +TRANSLATIONS += lang/vym_fr.ts
1.12 +TRANSLATIONS += lang/vym_zh_CN.ts
1.13 +TRANSLATIONS += lang/vym_pt_BR.ts
1.14 +
1.15 # Manifest embedding was suggested by Qt docs somewhere...
1.16 win32: CONFIG += embed_manifest_exe
1.17
1.18 @@ -142,11 +150,6 @@
1.19
1.20 TARGET = vym
1.21
1.22 -TRANSLATIONS += lang/vym_de.ts
1.23 -TRANSLATIONS += lang/vym_en.ts
1.24 -TRANSLATIONS += lang/vym_es.ts
1.25 -TRANSLATIONS += lang/vym_it.ts
1.26 -TRANSLATIONS += lang/vym_fr.ts
1.27
1.28 isEmpty( PREFIX ) {
1.29 PREFIX = /usr/local
2.1 --- a/vymmodel.cpp Fri Feb 01 15:28:35 2008 +0000
2.2 +++ b/vymmodel.cpp Fri Feb 01 15:28:35 2008 +0000
2.3 @@ -16,9 +16,8 @@
2.4
2.5 void VymModel::clear()
2.6 {
2.7 - for (int i=0; i<mapCenters.count(); i++)
2.8 - mapCenters.at(i)->clear();
2.9 - mapCenters.clear();
2.10 + while (!mapCenters.isEmpty())
2.11 + delete mapCenters.takeFirst();
2.12 }
2.13
2.14 void VymModel::init ()
2.15 @@ -116,6 +115,7 @@
2.16 BranchObj *bo=bo_start;
2.17 if (bo)
2.18 {
2.19 + // Try to find next branch in current MapCenter
2.20 rbo=bo->next();
2.21 if (rbo) return rbo;
2.22
2.23 @@ -216,6 +216,70 @@
2.24 mapCenters.at(i)->reposition(); // for positioning heading
2.25 }
2.26
2.27 +QPolygonF VymModel::shape(BranchObj *bo)
2.28 +{
2.29 + // Creating (arbitrary) shapes
2.30 +
2.31 + QPolygonF p;
2.32 + QRectF rb=bo->getBBox();
2.33 + if (bo->getDepth()==0)
2.34 + {
2.35 + // Just take BBox of this mapCenter
2.36 + p<<rb.topLeft()<<rb.topRight()<<rb.bottomRight()<<rb.bottomLeft();
2.37 + return p;
2.38 + }
2.39 +
2.40 + // Take union of BBox and TotalBBox
2.41 +
2.42 + QRectF ra=bo->getTotalBBox();
2.43 + if (bo->getOrientation()==LinkableMapObj::LeftOfCenter)
2.44 + p <<ra.bottomLeft()
2.45 + <<ra.topLeft()
2.46 + <<QPointF (rb.topLeft().x(), ra.topLeft().y() )
2.47 + <<rb.topRight()
2.48 + <<rb.bottomRight()
2.49 + <<QPointF (rb.bottomLeft().x(), ra.bottomLeft().y() ) ;
2.50 + else
2.51 + p <<ra.bottomRight()
2.52 + <<ra.topRight()
2.53 + <<QPointF (rb.topRight().x(), ra.topRight().y() )
2.54 + <<rb.topLeft()
2.55 + <<rb.bottomLeft()
2.56 + <<QPointF (rb.bottomRight().x(), ra.bottomRight().y() ) ;
2.57 + return p;
2.58 +
2.59 +}
2.60 +
2.61 +void VymModel::moveAway(LinkableMapObj *lmo)
2.62 +{
2.63 + // Autolayout:
2.64 + //
2.65 + // Move all branches and MapCenters away from lmo
2.66 + // to avoid collisions
2.67 +
2.68 + //
2.69 +
2.70 +
2.71 + QPolygonF pA;
2.72 + QPolygonF pB;
2.73 +
2.74 + BranchObj *boA=(BranchObj*)lmo;
2.75 + BranchObj *boB;
2.76 + for (int i=0; i<mapCenters.count(); i++)
2.77 + {
2.78 + boB=mapCenters.at(i);
2.79 + pA=shape (boA);
2.80 + pB=shape (boB);
2.81 + PolygonCollisionResult r = PolygonCollision(pA, pB, QPoint(0,0));
2.82 + cout <<"------->"
2.83 + <<"="<<r.intersect
2.84 + <<" ("<<qPrintable(boA->getHeading() )<<")"
2.85 + <<" with ("<< qPrintable (boB->getHeading() )
2.86 + <<") willIntersect"
2.87 + <<r.willIntersect
2.88 + <<" minT="<<r.minTranslation<<endl<<endl;
2.89 + }
2.90 +}
2.91
2.92
2.93 //////////////////////////////////////////////
3.1 --- a/vymmodel.h Fri Feb 01 15:28:35 2008 +0000
3.2 +++ b/vymmodel.h Fri Feb 01 15:28:35 2008 +0000
3.3 @@ -45,6 +45,8 @@
3.4 QRectF getTotalBBox();
3.5 void reposition(); //!< Call reposition for all MCOs
3.6 void setHideTmp (HideTmpMode mode);
3.7 + QPolygonF shape(BranchObj *bo); //!< Returns arbitrary shape of subtree
3.8 + void moveAway (LinkableMapObj *lmo);//!< Autolayout: Move all out of the way
3.9
3.10 ////////////////////////////////////////// Selection related
3.11 LinkableMapObj* getSelection();