Klamp't  0.8.1
XmlWorld.h
1 #ifndef XML_WORLD_H
2 #define XML_WORLD_H
3 
4 #include <tinyxml.h>
6 
12 class XmlRobot
13 {
14  public:
15  XmlRobot(TiXmlElement* element,string path=string());
16  bool GetRobot(Robot& robot);
17 
18  TiXmlElement* e;
19  string path;
20 };
21 
22 
24 {
25  public:
26  XmlRigidObject(TiXmlElement* element,string path=string());
27  bool GetRigidObject(RigidObject& object);
28 
29  TiXmlElement* e;
30  string path;
31 };
32 
34 {
35  public:
36  XmlTerrain(TiXmlElement* element,string path=string());
37  bool GetTerrain(Terrain& env);
38 
39  TiXmlElement* e;
40  string path;
41 };
42 
43 class XmlWorld
44 {
45  public:
46  XmlWorld();
47  bool Load(const string& fn);
48  bool Load(TiXmlElement* e,string path=string());
49  bool GetWorld(RobotWorld& world);
50  TiXmlElement* GetElement(const string& name);
51  TiXmlElement* GetElement(const string& name,int index);
52  TiXmlElement* GetRobot(int index) { return GetElement("robot",index); }
53  TiXmlElement* GetRigidObject(int index) { return GetElement("rigidObject",index); }
54  TiXmlElement* GetTerrain(int index) { return GetElement("terrain",index); }
55 
59  bool Save(RobotWorld& world,const string& fn,string itempath=string());
60 
61  TiXmlDocument doc;
62  TiXmlElement* elem;
63  string path;
64  Vector3 goals[10];
65  int goalCount;
66 };
67 
68 #endif
69 
The main robot type used in RobotSim.
Definition: Robot.h:79
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
Definition: XmlWorld.h:43
Definition: XmlWorld.h:33
A model of a static terrain with known friction.
Definition: Terrain.h:13
Definition: XmlWorld.h:12
Definition: XmlWorld.h:23
A (static) rigid object that may be manipulated.
Definition: RigidObject.h:13