BlueprintManager.h

Go to the documentation of this file.
00001 /*************************************************************************
00002  *                                                                       *
00003  * Open Physics Abstraction Layer                                        *
00004  * Copyright (C) 2004-2005                                               *
00005  * Alan Fischer  alan.fischer@gmail.com                                  *
00006  * Andres Reinot  andres@reinot.com                                      *
00007  * Tyler Streeter  tylerstreeter@gmail.com                               *
00008  * All rights reserved.                                                  *
00009  * Web: opal.sourceforge.net                                             *
00010  *                                                                       *
00011  * This library is free software; you can redistribute it and/or         *
00012  * modify it under the terms of EITHER:                                  *
00013  *   (1) The GNU Lesser General Public License as published by the Free  *
00014  *       Software Foundation; either version 2.1 of the License, or (at  *
00015  *       your option) any later version. The text of the GNU Lesser      *
00016  *       General Public License is included with this library in the     *
00017  *       file license-LGPL.txt.                                          *
00018  *   (2) The BSD-style license that is included with this library in     *
00019  *       the file license-BSD.txt.                                       *
00020  *                                                                       *
00021  * This library is distributed in the hope that it will be useful,       *
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00024  * license-LGPL.txt and license-BSD.txt for more details.                *
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                         //virtual void OPAL_CALL saveFile(const Blueprint& bp, 
00079                         //      const std::string& filename);
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

Generated on Tue May 16 17:49:50 2006 for OPAL by  doxygen 1.4.6-NO