00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 #ifndef _ROBOT_SIMULATEDROBOTDESCRIPTION_
00026 #define _ROBOT_SIMULATEDROBOTDESCRIPTION_
00027 
00028 #include <robot/robot>
00029 
00030 #include <base/array>
00031 
00032 #include <robot/RobotDescription>
00033 #include <robot/sim/SimulatedManipulatorDescription>
00034 
00035 
00036 namespace robot {
00037 namespace sim {
00038   
00039 
00040 
00041 
00042 
00043 
00044 class SimulatedRobotDescription : public RobotDescription
00045 {
00046 public:
00047   SimulatedRobotDescription() {}
00048   SimulatedRobotDescription(String name, ref<const PlatformDescription> platformDescription, 
00049                    array<ref<const ManipulatorDescription> > manipulatorDescriptions, 
00050                    array<Vector3> manipulatorOffsets)
00051       : RobotDescription(name, platformDescription, manipulatorDescriptions, manipulatorOffsets)
00052     {}
00053 
00054   SimulatedRobotDescription(const RobotDescription& r) 
00055       : RobotDescription(r)
00056     {}
00057 
00058   SimulatedRobotDescription(const SimulatedRobotDescription& r) 
00059       : RobotDescription(r)
00060     {}
00061 
00062   virtual String className() const { return String("SimulatedRobotDescription"); }
00063 
00064   
00065   
00066   virtual ref<PlatformDescription>    newPlatformDescription() const { return ref<PlatformDescription>(NewObj PlatformDescription()); }
00067   virtual ref<ManipulatorDescription> newManipulatorDescription() const { return ref<SimulatedManipulatorDescription>(NewObj SimulatedManipulatorDescription()); }
00068 
00069 
00070   SimulatedRobotDescription& operator=(const SimulatedRobotDescription& r)
00071     {
00072       RobotDescription::operator=(r);
00073       return *this;
00074     }
00075 
00076   
00077   
00078   virtual bool formatSupported(const String format, Real version = 1.0, ExternalizationType type = IO) const
00079     { return ( (format=="xml") && (version==1.0) ); }
00080   virtual void externalize(base::Externalizer& e, String format = "", Real version = 1.0)
00081     { RobotDescription::externalize(e,format,version); }
00082   void externalize(base::Externalizer& e, String format = "", Real version = 1.0) const
00083     { Externalizable::externalize(e,format,version); }
00084 
00085 
00086 protected:
00087   SimulatedRobotDescription(const String& name) : RobotDescription(name) {}
00088   
00089 private:
00090   
00091 
00092   friend class SimulatedRobot;
00093 };
00094 
00095 
00096 }
00097 } 
00098 
00099 #endif