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