diff -r bfacef6f29c1 -r 0fad394bc330 mapeditor.cpp --- a/mapeditor.cpp Tue Mar 09 13:09:05 2010 +0000 +++ b/mapeditor.cpp Wed Mar 10 15:36:19 2010 +0000 @@ -1,7 +1,5 @@ #include "mapeditor.h" -#include - #include #include "branchitem.h" @@ -31,7 +29,7 @@ /////////////////////////////////////////////////////////////////////// MapEditor::MapEditor( VymModel *vm) { - //cout << "Constructor ME "<setBackgroundBrush (QBrush(Qt::white, Qt::SolidPattern)); @@ -162,7 +160,7 @@ MapEditor::~MapEditor() { - //cout <<"Destructor MapEditor for "<getMapName().toStdString()<getMapName(); model->unregisterEditor(this); } @@ -425,8 +423,8 @@ if (rt.isNull()) rt=r1; rt=addBBox (r1, rt); - //FIXME-2 cout <<"ME: r1="<getHeadingStd()<getHeadingStd(); + //qDebug() <<" rt="<nextBranch(cur,prev); @@ -472,7 +470,7 @@ mapCenter->calcBBoxSizeWithChilds(); QRectF totalBBox=mapCenter->getTotalBBox(); //QRectF mapRect=totalBBox; - cout << " map has =("<setDuration(5000); - //animation->setEasingCurve ( QtEasingCurve::OutElastic); - animation->setEasingCurve ( QtEasingCurve::OutQuint); - animation->setStartValue(sceneRect() ); - animation->setEndValue(QRectF(50, 50, 1000, 1000)); - - animation->start(); -*/ -/* - QDialog *dia= new QDialog (this); - dia->setGeometry (50,50,10,10); - - dia->show(); - dia ->raise(); - - QtPropertyAnimation *animation=new QtPropertyAnimation(dia, "geometry"); - animation->setDuration(1000); - //animation->setEasingCurve ( QtEasingCurve::OutElastic); - animation->setEasingCurve ( QtEasingCurve::OutQuint); - animation->setStartValue(QRect(50, 50, 10, 10)); - animation->setEndValue(QRect(250, 250, 100, 100)); - - animation->start(); - */ - -} - -void MapEditor::testFunction2() -{ - model->setExportMode (false); - return; - // Create list with all bounding polygons QList mapobjects; QList polys; @@ -659,19 +559,19 @@ if (polygonCollision (polys.at(i),polys.at(j), QPointF(0,0)).intersect ) { collisions++; - //cout << "Collision: "<getOrientation()); - mapobjects[i]->moveBy(v.x(),v.y() ); - mapobjects[i]->setRelPos(); + // mapobjects[i]->moveBy(v.x(),v.y() ); + // mapobjects[i]->setRelPos(); + model->startAnimation ((BranchObj*)mapobjects[i], mapobjects[i]->getAbsPos(), mapobjects[i]->getAbsPos() + v); } + /* model->reposition(); orientationChanged=false; for (int i=0;isetDuration(5000); + //animation->setEasingCurve ( QtEasingCurve::OutElastic); + animation->setEasingCurve ( QtEasingCurve::OutQuint); + animation->setStartValue(sceneRect() ); + animation->setEndValue(QRectF(50, 50, 1000, 1000)); + + animation->start(); +*/ +/* + QDialog *dia= new QDialog (this); + dia->setGeometry (50,50,10,10); + + dia->show(); + dia ->raise(); + + QtPropertyAnimation *animation=new QtPropertyAnimation(dia, "geometry"); + animation->setDuration(1000); + //animation->setEasingCurve ( QtEasingCurve::OutElastic); + animation->setEasingCurve ( QtEasingCurve::OutQuint); + animation->setStartValue(QRect(50, 50, 10, 10)); + animation->setEndValue(QRect(250, 250, 100, 100)); + + animation->start(); + */ + +} + +void MapEditor::testFunction2() +{ + autoLayout(); +} + BranchItem* MapEditor::getBranchDirectAbove (BranchItem *bi) { if (bi) @@ -1021,11 +1025,11 @@ void MapEditor::mousePressEvent(QMouseEvent* e) { -//cout << "ME::mousePressed\n"; //FIXME-3 +//qDebug() << "ME::mousePressed\n"; //FIXME-3 // Ignore right clicks, these will go to context menus if (e->button() == Qt::RightButton ) { - //cout << " ME::ignoring right mouse event...\n"; + //qDebug() << " ME::ignoring right mouse event...\n"; e->ignore(); return; } @@ -1033,7 +1037,7 @@ //Ignore clicks while editing heading if (model->isSelectionBlocked() ) { - //cout << " ME::ignoring other mouse event...\n"; + //qDebug() << " ME::ignoring other mouse event...\n"; e->ignore(); return; } @@ -1136,9 +1140,9 @@ if (lmo) { /* - cout << "ME::mouse pressed\n"; - cout << " lmo="<mimeData()->urls()) - cout << " URL:"<mimeData()->text()) - // cout << " PLAIN:"<mimeData()->data("STRING"); QString s; s=ba; - cout << " STRING:" <mimeData()->data("TEXT"); s=ba; - cout << " TEXT:" <mimeData()->data("COMPOUND_TEXT"); s=ba; - cout << " CTEXT:" <mimeData()->data("text/x-moz-url"); s=ba; - cout << " x-moz-url:" <updating...\n"; + // qDebug() << " ->updating...\n"; BranchObj *bo=(BranchObj*) ( ((MapItem*)ti)->getLMO()); bo->updateData(); }