diff -r ac4be290c750 -r 84ae10f6e3a3 selection.cpp --- a/selection.cpp Thu Jan 15 00:52:35 2009 +0000 +++ b/selection.cpp Tue Jan 20 15:23:16 2009 +0000 @@ -1,4 +1,6 @@ #include +#include +using namespace std; #include "selection.h" @@ -12,6 +14,7 @@ Selection::Selection() { blocked=false; + model=NULL; } Selection::~Selection() @@ -23,20 +26,7 @@ model=m; } -void Selection::copy(const Selection &other) -{ - selectList=other.selectList; - lastSelectList=other.lastSelectList; -} - -void Selection::clear() -{ - unselect(); - lastSelectList.clear(); -} - - -void Selection::update() // FIXME VM emit signal in VM instead +void Selection::update() // FIXME VM emit signal in VM instead and get rid of this { /* QRectF bbox; @@ -54,25 +44,23 @@ } bool Selection::select(LinkableMapObj *lmo) // TODO no multiselections yet { + return model->select (lmo); + /* if (!selectList.isEmpty()) unselect(); selectList.append (lmo); - /* FIXME VM move to ME - QGraphicsRectItem *sb = scene->addRect( - QRectF(0,0,0,0), - QPen(color), - color); - sb->setZValue(Z_SELBOX); - sb->show(); - selboxList.append (sb); - */ lmo->select(); update(); mainWindow->updateSatellites (model); + cout << "Sel::select lmo e\n"; return true; + */ } bool Selection::select (const QString &s) // TODO no multiselections yet { + return model->select (s); + /* + cout << "Sel::select s=\n"; LinkableMapObj *lmo=model->findObjBySelect(s); // Finally select the found object @@ -83,7 +71,7 @@ return true; } return false; - + */ } bool Selection::reselect () // TODO no multiselections yet @@ -99,18 +87,20 @@ void Selection::unselect() { + model->unselect(); + /* + cout << "Sel::unselect\n"; if (!selectList.isEmpty() ) { for (int i=0; i< selectList.count(); ++i) selectList.at(i)->unselect(); lastSelectList=selectList; selectList.clear(); - /* FIXME VM move to ME - while (!selboxList.isEmpty() ) - delete selboxList.takeFirst(); + // FIXME VM move to ME + //while (!selboxList.isEmpty() ) + // delete selboxList.takeFirst(); + } */ - - } } bool Selection::isBlocked() @@ -133,11 +123,14 @@ return selectList.isEmpty(); } +/* uint Selection::count() { return selectList.count(); } +*/ +/* Selection::Type Selection::type() // TODO no multiselections yet { if (!selectList.isEmpty()) @@ -149,7 +142,9 @@ } return Undefined; } +*/ +/* LinkableMapObj* Selection::first() { if (!selectList.isEmpty()) @@ -166,18 +161,6 @@ return NULL; } -BranchObj* Selection::getBranch() -{ - if (!selectList.isEmpty()) - { - LinkableMapObj *sel=selectList.first(); - if (typeid (*sel)==typeid (BranchObj) || - typeid (*sel)==typeid (MapCenterObj)) - return (BranchObj*)sel; - } - return NULL; -} - TreeItem* Selection::getBranchItem() { BranchObj* bo=getBranch(); @@ -190,6 +173,7 @@ return model->getSelectionModel()->selectedIndexes().first(); // TODO no multiselections yet } +*/ FloatImageObj* Selection::getFloatImage() {