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
00028 #ifndef OPAL_BLUEPRINT_MANAGER_H
00029 #define OPAL_BLUEPRINT_MANAGER_H
00030
00031 #include "Defines.h"
00032 #include "Singleton.h"
00033 #include "Blueprint.h"
00034
00035 class TiXmlNode;
00036
00037 namespace opal
00038 {
00039 class AttractorMotorData;
00040 class GearedMotorData;
00041 class ServoMotorData;
00042 class SpringMotorData;
00043 class ThrusterMotorData;
00044 class AccelerationSensorData;
00045 class InclineSensorData;
00046 class RaycastSensorData;
00047 class VolumeSensorData;
00048
00050 namespace blueprintManagerImpl
00051 {
00052 class BlueprintManager
00053 {
00054 public:
00055 BlueprintManager();
00056
00057 virtual ~BlueprintManager();
00058
00074 virtual void OPAL_CALL loadFile(Blueprint& bp,
00075 const std::string& filename);
00076
00078
00079
00080
00081 private:
00085 SolidData* loadSolid(const TiXmlNode* nodePtr,
00086 const std::string& filename);
00087
00091 JointData* loadJoint(const TiXmlNode* nodePtr,
00092 const Blueprint& bp, const std::string& filename);
00093
00097 MotorData* loadMotor(const TiXmlNode* nodePtr,
00098 const Blueprint& bp, const std::string& filename);
00099
00103 AttractorMotorData* loadAttractorMotor(const TiXmlNode* nodePtr,
00104 const Blueprint& bp, const std::string& filename);
00105
00109 GearedMotorData* loadGearedMotor(const TiXmlNode* nodePtr,
00110 const Blueprint& bp, const std::string& filename);
00111
00115 ServoMotorData* loadServoMotor(const TiXmlNode* nodePtr,
00116 const Blueprint& bp, const std::string& filename);
00117
00121 SpringMotorData* loadSpringMotor(const TiXmlNode* nodePtr,
00122 const Blueprint& bp, const std::string& filename);
00123
00127 ThrusterMotorData* loadThrusterMotor(const TiXmlNode* nodePtr,
00128 const Blueprint& bp, const std::string& filename);
00129
00133 SensorData* loadSensor(const TiXmlNode* nodePtr,
00134 const Blueprint& bp, const std::string& filename);
00135
00140 AccelerationSensorData* loadAccelerationSensor(
00141 const TiXmlNode* nodePtr, const Blueprint& bp,
00142 const std::string& filename);
00143
00147 InclineSensorData* loadInclineSensor(const TiXmlNode* nodePtr,
00148 const Blueprint& bp, const std::string& filename);
00149
00153 RaycastSensorData* loadRaycastSensor(const TiXmlNode* nodePtr,
00154 const Blueprint& bp, const std::string& filename);
00155
00159 VolumeSensorData* loadVolumeSensor(const TiXmlNode* nodePtr,
00160 const Blueprint& bp, const std::string& filename);
00161
00165 ShapeData* loadShape(const TiXmlNode* nodePtr,
00166 const std::string& filename);
00167
00169 void loadOffset(Matrix44r& offset, const TiXmlNode* nodePtr,
00170 const std::string& filename);
00171
00174 real getAttributeReal(const TiXmlNode* nodePtr,
00175 const std::string& name)const;
00176
00179 std::string getAttributeString(const TiXmlNode* nodePtr,
00180 const std::string& name)const;
00181 };
00182 }
00183 typedef Singleton<blueprintManagerImpl::BlueprintManager> BlueprintManager;
00184 }
00185
00186 #endif