Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

robot/sim/SimulatedRobotDescription

Go to the documentation of this file.
00001 /* **-*-c++-*-**************************************************************
00002   Copyright (C)2004 David Jung <opensim@pobox.com>
00003 
00004   This program/file is free software; you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation; either version 2 of the License, or
00007   (at your option) any later version.
00008         
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU General Public License for more details. (http://www.gnu.org)
00013         
00014   You should have received a copy of the GNU General Public License
00015   along with this program; if not, write to the Free Software
00016   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018   $Id: SimulatedRobotDescription 1033 2004-02-11 20:47:52Z jungd $
00019   $Revision: 1.1 $
00020   $Date: 2004-02-11 15:47:52 -0500 (Wed, 11 Feb 2004) $
00021   $Author: jungd $
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  * An description of a Robot specific to simulations
00041  * (includes information relevant to a simulation, such as the visual appearance,
00042  *  geometry etc. of the robot)
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   // factory
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   // Externalizable
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 } // robot::sim
00098 
00099 #endif

Generated on Thu Jul 29 15:56:41 2004 for OpenSim by doxygen 1.3.6