00001 #ifndef __SELECTIONSET_H 00002 #define __SELECTIONSET_H 00003 00004 #include <qobject.h> 00005 #include <vector> 00006 00020 class SelectionSet : public QObject { 00021 Q_OBJECT 00022 public: 00026 typedef struct { 00027 std::vector<int> nodes; 00028 int obj; 00029 } SelObj; 00030 00036 typedef struct { 00037 double x; 00038 double y; 00039 double w; 00040 double h; 00041 } SelBox; 00042 00043 protected: 00044 std::vector<SelObj> mSelObj; 00045 SelBox mBox; 00046 bool mSelecting; 00047 00048 public: 00049 00050 SelectionSet() ; 00051 00052 SelectionSet(const SelectionSet& copyMe) 00053 : QObject () { 00054 mBox = copyMe.mBox ; 00055 mSelecting = copyMe.mSelecting ; 00056 mSelObj = copyMe.mSelObj ; 00057 } 00058 00062 void operator=( const SelectionSet& copyMe ) { 00063 mBox = copyMe.mBox ; 00064 mSelecting = copyMe.mSelecting ; 00065 mSelObj = copyMe.mSelObj ; 00066 } 00067 00068 ~SelectionSet() ; 00069 00083 SelectionSet::SelObj& operator[]( int iobj ) ; 00084 00088 void clear() ; 00089 00095 int size() ; 00096 00103 void add( SelObj &obj ) ; 00104 00112 SelectionSet::SelBox& selBox() ; 00113 00124 void setSelecting( bool sel ) ; 00125 00132 bool isSelecting( ) ; 00133 00139 void resetBox() ; 00140 00147 void erase( int i ) ; 00148 00157 bool isSelObj( int iobj ) ; 00158 00167 bool isSelNode( int iobj, int inode ) ; 00168 00169 signals: 00170 00171 // announce that the selection set has somehow changed 00172 void selectionChanged () ; 00173 00174 }; 00175 00176 #endif 00177 00178 00179 00180
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |