#include <GUISelectedStorage.h>
Definition at line 247 of file GUISelectedStorage.h.
Public Member Functions | |
| void | clear () throw () |
| Clears the list of selected objects. | |
| void | deselect (GLuint id) throw () |
| Deselects the object with the given id from the list of selected objects. | |
| const std::vector< GLuint > & | getSelected () const throw () |
| Returns the list of selected ids. | |
| bool | isSelected (GLuint id) throw () |
| Returns the information whether the object with the given id is qithin the selection. | |
| void | load (const std::string &filename) throw (IOError) |
| Loads the list of selected objects to a file named as given. | |
| void | save (const std::string &filename) throw (IOError) |
| Saves the list of selected objects to a file named as given. | |
| void | select (GLuint id) throw () |
| Adds the object with the given id to the list of selected objects. | |
| SingleTypeSelections () throw () | |
| Constructor. | |
| ~SingleTypeSelections () throw () | |
| Destructor. | |
Private Attributes | |
| std::vector< GLuint > | mySelected |
| The list of selected ids. | |
| GUISelectedStorage::SingleTypeSelections::SingleTypeSelections | ( | ) | throw () |
| GUISelectedStorage::SingleTypeSelections::~SingleTypeSelections | ( | ) | throw () |
| void GUISelectedStorage::SingleTypeSelections::clear | ( | ) | throw () |
Clears the list of selected objects.
Definition at line 82 of file GUISelectedStorage.cpp.
References mySelected.
Referenced by GUISelectedStorage::clear().
00082 { 00083 mySelected.clear(); 00084 }
| void GUISelectedStorage::SingleTypeSelections::deselect | ( | GLuint | id | ) | throw () |
Deselects the object with the given id from the list of selected objects.
| [in] | id | The id of the object |
Definition at line 73 of file GUISelectedStorage.cpp.
References mySelected.
Referenced by GUISelectedStorage::deselect().
00073 { 00074 std::vector<GLuint>::iterator i = find(mySelected.begin(), mySelected.end(), id); 00075 if (i!=mySelected.end()) { 00076 mySelected.erase(i); 00077 } 00078 }
| const std::vector< GLuint > & GUISelectedStorage::SingleTypeSelections::getSelected | ( | ) | const throw () |
Returns the list of selected ids.
Definition at line 113 of file GUISelectedStorage.cpp.
References mySelected.
Referenced by GUISelectedStorage::getSelected().
00113 { 00114 return mySelected; 00115 }
| bool GUISelectedStorage::SingleTypeSelections::isSelected | ( | GLuint | id | ) | throw () |
Returns the information whether the object with the given id is qithin the selection.
| [in] | id | The id of the object |
Definition at line 57 of file GUISelectedStorage.cpp.
References mySelected.
Referenced by GUISelectedStorage::isSelected().
00057 { 00058 std::vector<GLuint>::iterator i = find(mySelected.begin(), mySelected.end(), id); 00059 return i!=mySelected.end(); 00060 }
| void GUISelectedStorage::SingleTypeSelections::load | ( | const std::string & | filename | ) | throw (IOError) |
Loads the list of selected objects to a file named as given.
| [in] | filename | The name of the file to read the list from |
| IOError | recheck!!! |
Definition at line 88 of file GUISelectedStorage.cpp.
Referenced by GUISelectedStorage::load().
00088 { 00089 std::ifstream strm(filename.c_str()); 00090 while (strm.good()) { 00091 std::string name; 00092 strm >> name; 00093 } 00094 }
| void GUISelectedStorage::SingleTypeSelections::save | ( | const std::string & | filename | ) | throw (IOError) |
Saves the list of selected objects to a file named as given.
| [in] | filename | The name of the file to save the list into |
| IOError | recheck!!! |
Definition at line 98 of file GUISelectedStorage.cpp.
References OutputDevice::close(), OutputDevice::getDevice(), GUIGlObject::getFullName(), GUIGlObjectStorage::getObjectBlocking(), GUIGlObjectStorage::gIDStorage, mySelected, and GUIGlObjectStorage::unblockObject().
Referenced by GUISelectedStorage::save().
00098 { 00099 OutputDevice &dev = OutputDevice::getDevice(filename); 00100 for (std::vector<GLuint>::iterator i=mySelected.begin(); i!=mySelected.end(); ++i) { 00101 GUIGlObject *object = GUIGlObjectStorage::gIDStorage.getObjectBlocking(*i); 00102 if (object!=0) { 00103 std::string name = object->getFullName(); 00104 dev << name << "\n"; 00105 GUIGlObjectStorage::gIDStorage.unblockObject(*i); 00106 } 00107 } 00108 dev.close(); 00109 }
| void GUISelectedStorage::SingleTypeSelections::select | ( | GLuint | id | ) | throw () |
Adds the object with the given id to the list of selected objects.
| [in] | id | The id of the object |
Definition at line 64 of file GUISelectedStorage.cpp.
References mySelected.
Referenced by GUISelectedStorage::select().
00064 { 00065 std::vector<GLuint>::iterator i = find(mySelected.begin(), mySelected.end(), id); 00066 if (i==mySelected.end()) { 00067 mySelected.push_back(id); 00068 } 00069 }
std::vector<GLuint> GUISelectedStorage::SingleTypeSelections::mySelected [private] |
The list of selected ids.
Definition at line 304 of file GUISelectedStorage.h.
Referenced by clear(), deselect(), getSelected(), isSelected(), save(), and select().
1.5.6