8 Selection::~Selection()
12 void Selection::setMapCenter(MapCenterObj *mco)
17 void Selection::copy(const Selection &other)
19 mapCenter=other.mapCenter;
20 selectList=other.selectList;
21 lastSelectList=other.lastSelectList;
24 void Selection::clear()
27 lastSelectList.clear();
30 bool Selection::select(LinkableMapObj *lmo) // TODO no multiselections yet
33 selectList.append (lmo);
37 bool Selection::select (const QString &s) // TODO no multiselections yet
39 LinkableMapObj *lmo=mapCenter->findObjBySelect(s);
41 // Finally select the found object
52 bool Selection::reselect () // TODO no multiselections yet
54 if (!lastSelectList.isEmpty())
56 select (lastSelectList.first());
63 void Selection::unselect()
65 lastSelectList=selectList;
69 bool Selection::isEmpty()
71 return selectList.isEmpty();
74 uint Selection::count()
76 return selectList.count();
79 SelectionType Selection::type() // TODO no multiselections yet
81 if (!selectList.isEmpty())
83 LinkableMapObj *sel=selectList.first();
84 if (typeid (*sel)==typeid (BranchObj)) return Branch;
85 if (typeid (*sel)==typeid (MapCenterObj)) return MapCenter;
86 if (typeid (*sel)==typeid (FloatImageObj)) return FloatImage;
91 QString Selection::getSelectString()// TODO no multiselections yet
93 if (selectList.count()==1)
94 return selectList.first()->getSelectString();