Go to the documentation of this file.00001 #ifndef GRASP_PLANNING_GRASPIT_GRASPITDATABASEMANAGER_H
00002 #define GRASP_PLANNING_GRASPIT_GRASPITDATABASEMANAGER_H
00003
00025 #include <grasp_planning_graspit/GraspItAccessor.h>
00026 #include <string>
00027 #include <vector>
00028
00029 namespace GraspIt
00030 {
00031
00032 class GraspItSceneManager;
00033
00063 class GraspItDatabaseManager: public GraspItAccessor
00064 {
00065 public:
00069 GraspItDatabaseManager(const std::string& name, const SHARED_PTR<GraspItSceneManager>& interface):
00070 GraspItAccessor(name, interface)
00071 {
00072 }
00073 virtual ~GraspItDatabaseManager()
00074 {
00075 }
00076
00094 virtual int loadRobotToDatabase(const std::string& filename, const std::string& robotName,
00095 const std::vector<std::string>& jointNames) = 0;
00096
00111 virtual int loadObjectToDatabase(const std::string& filename, const std::string& objectName,
00112 const bool asGraspable) = 0;
00113
00120 int loadRobotToWorld(const std::string& robotName, const EigenTransform& transform);
00121
00122
00129 int loadObjectToWorld(const std::string& objectName, const EigenTransform& transform);
00130
00131
00139 int loadToWorld(const int modelID, const EigenTransform& transform);
00140
00148 int unloadRobotFromWorld(const std::string& robotName);
00149
00157 int unloadObjectFromWorld(const std::string& objectName);
00158
00166 int unloadFromWorld(const int modelID);
00167
00168
00169
00176 bool saveLoadedWorld(const std::string& filename, const bool asInventor, const bool createDir = false);
00177
00182 virtual void getAllLoadedRobotNames(std::vector<std::string>& names) const = 0;
00183
00188 virtual void getAllLoadedRobotIDs(std::vector<int>& ids) const = 0;
00189
00194 virtual void getAllLoadedObjectNames(std::vector<std::string>& names) const = 0;
00195
00200 virtual void getAllLoadedObjectIDs(std::vector<int>& ids) const = 0;
00201
00206 virtual bool getRobotModelID(const std::string& robotName, int& id) const = 0;
00207
00212 virtual bool getObjectModelID(const std::string& objectName, int& id) const = 0;
00213
00220 int isModelLoaded(const int modelID) const;
00221
00227 virtual bool getModelNameAndType(const int modelID, std::string& name, bool& isRobot) const = 0;
00228
00229
00236 virtual bool getRobotJointNames(const std::string& robotName,
00237 std::vector<std::string>& jointNames) const = 0;
00238
00239 protected:
00246 virtual int getModelType(const int modelID) const = 0;
00247
00251 virtual Robot * getRobotFromDatabase(const std::string& robotName) = 0;
00252
00257 virtual Robot * getRobotFromDatabase(const int modelID) = 0;
00258
00262 virtual Body * getObjectFromDatabase(const std::string& objectName) = 0;
00263
00268 virtual Body * getObjectFromDatabase(const int modelID) = 0;
00269
00274 virtual void idleEventFromSceneManager() = 0;
00275
00280 virtual void onSceneManagerShutdown() = 0;
00281 };
00282 }
00283 #endif // GRASP_PLANNING_GRASPIT_GRASPITDATABASEMANAGER_H