Model.hh
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
00026
00027 #ifndef MODEL_HH
00028 #define MODEL_HH
00029
00030
00031 #include <map>
00032 #include <string>
00033 #include <vector>
00034 #include <map>
00035
00036 #include "MovableText.hh"
00037 #include "UpdateParams.hh"
00038 #include "Pose3d.hh"
00039 #include "Joint.hh"
00040 #include "Entity.hh"
00041 #include "gazebo.h"
00042
00043
00044 namespace Ogre
00045 {
00046 class SceneNode;
00047 }
00048
00049 namespace gazebo
00050 {
00051
00052 class XMLConfigNode;
00053 class Body;
00054 class Controller;
00055 class HingeJoint;
00056
00060
00062 class Model : public Entity
00063 {
00065 public: Model();
00066
00068 public: virtual ~Model();
00069
00071 public: int Load(XMLConfigNode *node);
00072
00074 public: int Init();
00075
00078 public: int Update(UpdateParams ¶ms);
00079
00081 public: int Fini();
00082
00084 public: void Reset();
00085
00087 protected: virtual int LoadChild(XMLConfigNode * ) {return 0;}
00088
00090 protected: virtual int InitChild() {return 0;}
00091
00093 protected: virtual int UpdateChild() {return 0;}
00094
00096 protected: virtual int FiniChild() {return 0;}
00097
00099 public: void SetType(const std::string &type);
00100
00102 public: const std::string &GetType() const;
00103
00105 public: void SetXMLConfigNode( XMLConfigNode *node );
00106
00108 public: XMLConfigNode *GetXMLConfigNode() const;
00109
00111 public: void SetInitPose(const Pose3d &pose);
00112
00114 public: const Pose3d &GetInitPose() const;
00115
00117 public: void SetPose(const Pose3d &pose);
00118
00120 public: const Pose3d &GetPose() const;
00121
00124 public: Body *CreateBody();
00125
00129 public: Joint *CreateJoint(Joint::Type type);
00130
00134 public: Joint *GetJoint(std::string name);
00135
00138 public: Body *GetBody();
00139
00141 public: void Attach();
00142
00145 public: Body *GetCanonicalBody();
00146
00150 private: int LoadBody(XMLConfigNode *node);
00151
00155 private: int LoadJoint(XMLConfigNode *node);
00156
00159 private: void LoadController(XMLConfigNode *node);
00160
00162 private: void LoadPhysical(XMLConfigNode *node);
00163
00165 private: void LoadRenderable(XMLConfigNode *node);
00166
00168 private: std::string type;
00169
00171 private: XMLConfigNode *node;
00172
00174 private: Pose3d initPose;
00175
00177 private: Pose3d pose;
00178
00180 protected: std::map<std::string, Body* > bodies;
00181
00183 protected: std::map<std::string, Joint* > joints;
00184
00186 protected: std::map<std::string, Controller* > controllers;
00187
00189 private: std::string canonicalBodyName;
00190
00192 private: HingeJoint *joint;
00193
00195 private: Model *parentModel;
00196
00197
00198
00199
00200
00201
00202
00203 };
00205 }
00206
00207 #endif