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