Klamp't  0.9.0
ResourceGUI.h
1 #ifndef RESOURCE_GUI_H
2 #define RESOURCE_GUI_H
3 
4 #include "WorldGUI.h"
6 #include <Klampt/View/ViewResource.h>
7 //#include "resourcemanager.h"
8 #include "Main/RobotPoseQt/resourcemanager.h"
9 #include <sstream>
10 
11 namespace Klampt {
12  using namespace Math3D;
13 
44 {
45 public:
46  ResourceGUIBackend(WorldModel* world,ResourceManager* library);
47  bool LoadCommandLine(int argc,const char** argv);
48 
49  ResourceNodePtr Add(ResourcePtr r);
50  ResourceNodePtr Add(const string& name,const string& type);
51  template <class T>
52  ResourceNodePtr Add(const string& name,const T& val) {
53  ResourcePtr r=MakeResource(name,val);
54  return Add(r);
55  }
56  ResourceNodePtr Add(const string& name,const vector<Real>& ts,const vector<Config>& qs) {
57  ResourcePtr r=MakeResource(name,ts,qs);
58  return Add(r);
59  }
60  //save current resource to disk
61  void SaveCur(const string& file);
62  //load a new resource from the given file
63  bool LoadNew(const string& file);
64  //save all resources to a given path / XML file
65  void SaveAll(const string& path);
66  //load all resources in a given path / XML file
67  bool LoadAll(const string& path);
68  //sets the active item to the last added item
69  void SetLastActive();
70  //sets the active item to the one of the given identifier
71  void SetActive(const string& identifier);
72  virtual void SetPathTime(double time);
73 
74  //subclasses should call this so that the GLUI controls will work
75  virtual bool OnCommand(const string& cmd,const string& args);
76 
77  ResourcePtr CurrentResource();
78  void RenderCurResource();
79 
80  //stores all resources
81  ResourceManager* resources;
82 
83  //stores the last added resource
84  ResourceNodePtr last_added;
85 
86  //view
87  ViewResource viewResource;
88 };
89 
90 } // namespace Klampt
91 
92 #endif
Definition: ViewResource.h:11
Defines all Klampt Resource types, and packing / unpacking utilities.
A backend for resource browsing. Natively supports configs, paths, transforms, ik goals...
Definition: ResourceGUI.h:43
A generic gui with a WorldModel which allows clicking on entities and loading files.
Definition: WorldGUI.h:23
Definition: ContactDistance.h:6
The main world class containing multiple robots, objects, and static geometries (terrains). Lights and other viewport information may also be stored here.
Definition: World.h:24