Thread: [Opal-commits] opal/src BlueprintInstance.cpp,NONE,1.1 BlueprintInstance.h,NONE,1.1 Logger.cpp,NONE,
Status: Inactive
Brought to you by:
tylerstreeter
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5241/src Modified Files: AttractorMotor.cpp AttractorMotor.h AttractorMotorData.h Blueprint.cpp Blueprint.h BlueprintManager.cpp BlueprintManager.h Defines.h GearedMotor.cpp GearedMotor.h GearedMotorData.h Joint.cpp Joint.h JointData.h Motor.cpp Motor.h MotorData.h SConscript Sensor.cpp Sensor.h SensorData.h ServoMotor.cpp ServoMotor.h ServoMotorData.h Simulator.cpp Simulator.h Solid.cpp Solid.h SolidData.h SpringMotor.cpp SpringMotor.h SpringMotorData.h ThrusterMotor.cpp ThrusterMotor.h ThrusterMotorData.h opal.h Added Files: BlueprintInstance.cpp BlueprintInstance.h Logger.cpp Logger.h SolidData.cpp Log Message: updated XML parsing to reflect new object creation method Index: Sensor.h =================================================================== RCS file: /cvsroot/opal/opal/src/Sensor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Sensor.h 21 Feb 2005 15:54:39 -0000 1.6 --- Sensor.h 25 Feb 2005 06:40:26 -0000 1.7 *************** *** 45,54 **** virtual ~Sensor(); - /// Returns true if the Sensor is enabled. - virtual bool OPAL_CALL isEnabled()const; - /// Sets whether the Sensor can update its measurements. If the /// Sensor has not yet been initialized, this will have no effect. ! virtual void OPAL_CALL setEnabled(bool e); /// Set the user data pointer to some external data. The user data --- 45,54 ---- virtual ~Sensor(); /// Sets whether the Sensor can update its measurements. If the /// Sensor has not yet been initialized, this will have no effect. ! virtual void OPAL_CALL setEnabled(bool e) = 0; ! ! /// Returns true if the Sensor is enabled. ! virtual bool OPAL_CALL isEnabled()const = 0; /// Set the user data pointer to some external data. The user data *************** *** 60,63 **** --- 60,69 ---- virtual void* OPAL_CALL getUserData(); + /// Sets the Sensor's name. + virtual void OPAL_CALL setName(const std::string& name) = 0; + + /// Returns the Sensor's name. + virtual const std::string& OPAL_CALL getName()const = 0; + /// Called regularly to update the Sensor. This does nothing if the /// Sensor is disabled. *************** *** 69,73 **** protected: /// True if the Sensor is enabled. ! bool mEnabled; /// Pointer to user data. This is totally user-managed (i.e. OPAL --- 75,79 ---- protected: /// True if the Sensor is enabled. ! //bool mEnabled; /// Pointer to user data. This is totally user-managed (i.e. OPAL Index: BlueprintManager.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintManager.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** BlueprintManager.cpp 23 Feb 2005 03:58:23 -0000 1.25 --- BlueprintManager.cpp 25 Feb 2005 06:40:26 -0000 1.26 *************** *** 27,30 **** --- 27,37 ---- #include "BlueprintManager.h" + #include "BoxShapeData.h" + #include "SphereShapeData.h" + #include "CapsuleShapeData.h" + #include "PlaneShapeData.h" + #include "RayShapeData.h" + #include "MotorData.h" + #include "SensorData.h" [...1616 lines suppressed...] #endif } - - Blueprint* BlueprintManager::getBlueprint(const std::string& name) - { - if (!blueprintExists(name)) - { - std::cout << "Error in opal::BlueprintManager::getBlueprint: \ - Invalid blueprint requested" - << std::endl; - return NULL; - } - else - { - return mBlueprintMap[name]; - } - } } } --- 944,947 ---- Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** opal.h 23 Feb 2005 03:58:23 -0000 1.16 --- opal.h 25 Feb 2005 06:40:26 -0000 1.17 *************** *** 59,62 **** --- 59,73 ---- /// Creates a Simulator. OPAL_EXPORT Simulator* OPAL_CALL createSimulator(); + + /// Loads a Blueprint from an OPAL XML file. + OPAL_EXPORT void OPAL_CALL loadFile(Blueprint& bp, + const std::string& filename); + { + BlueprintManager::instance().loadFile(bp, filename); + } + + /// Saves a Blueprint in an OPAL XML file. + //OPAL_EXPORT void OPAL_CALL saveFile(const Blueprint& bp, + // const std::string& filename); } Index: Joint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Joint.h,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Joint.h 23 Feb 2005 04:56:49 -0000 1.55 --- Joint.h 25 Feb 2005 06:40:26 -0000 1.56 *************** *** 76,80 **** /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getJointData(); /// Returns the Joint type. --- 76,86 ---- /// Returns all data describing the Joint. ! virtual const JointData& OPAL_CALL getJointData()const; ! ! /// Sets the Joint's name. ! virtual void OPAL_CALL setName(const std::string& name); ! ! /// Returns the Joint's name. ! virtual const std::string& OPAL_CALL getName()const; /// Returns the Joint type. *************** *** 103,107 **** ///// Returns the limits for the given axis. ! //virtual const JointLimits& OPAL_CALL getLimits(int axisNum); /// Sets the Joint's limit angles in degrees. No limits are applied --- 109,113 ---- ///// Returns the limits for the given axis. ! //virtual const JointLimits& OPAL_CALL getLimits(int axisNum)const; /// Sets the Joint's limit angles in degrees. No limits are applied *************** *** 113,121 **** /// Returns the low limit for a given axis (angle in degrees for /// rotational Joints, distance for linear Joints). ! virtual real OPAL_CALL getLowLimit(int axisNum); /// Returns the high limit for a given axis (angle in degrees for /// rotational Joints, distance for linear Joints). ! virtual real OPAL_CALL getHighLimit(int axisNum); /// Sets the hardness for the given axis' limits. Hardness --- 119,127 ---- /// Returns the low limit for a given axis (angle in degrees for /// rotational Joints, distance for linear Joints). ! virtual real OPAL_CALL getLowLimit(int axisNum)const; /// Returns the high limit for a given axis (angle in degrees for /// rotational Joints, distance for linear Joints). ! virtual real OPAL_CALL getHighLimit(int axisNum)const; /// Sets the hardness for the given axis' limits. Hardness *************** *** 126,130 **** /// Returns the hardness for the given axis' limits. ! virtual real OPAL_CALL getLimitHardness(int axisNum); /// Sets the bounciness for the given axis' limits. Bounciness --- 132,136 ---- /// Returns the hardness for the given axis' limits. ! virtual real OPAL_CALL getLimitHardness(int axisNum)const; /// Sets the bounciness for the given axis' limits. Bounciness *************** *** 135,139 **** /// Returns the bounciness for the given axis' limits. ! virtual real OPAL_CALL getLimitBounciness(int axisNum); /// Returns the current state (angle in degrees for rotational --- 141,145 ---- /// Returns the bounciness for the given axis' limits. ! virtual real OPAL_CALL getLimitBounciness(int axisNum)const; /// Returns the current state (angle in degrees for rotational *************** *** 168,172 **** /// Returns the anchor point. ! virtual const Point3r& OPAL_CALL getAnchor(); /// Returns the number of axes used by this Joint. --- 174,178 ---- /// Returns the anchor point. ! virtual const Point3r& OPAL_CALL getAnchor()const; /// Returns the number of axes used by this Joint. Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SConscript 22 Feb 2005 04:28:11 -0000 1.9 --- SConscript 25 Feb 2005 06:40:26 -0000 1.10 *************** *** 5,8 **** --- 5,9 ---- headers = Split(""" AttractorMotor.h + AttractorMotorData.h Blueprint.h BlueprintManager.h *************** *** 12,19 **** --- 13,24 ---- EventHandler.h GearedMotor.h + GearedMotorData.h Joint.h + JointData.h + Logger.h Matrix44r.h MeshShapeData.h Motor.h + MotorData.h opal.h OpalMath.h *************** *** 25,29 **** --- 30,36 ---- RayShapeData.h Sensor.h + SensorData.h ServoMotor.h + ServoMotorData.h ShapeData.h Simulator.h *************** *** 34,38 **** --- 41,47 ---- SphereShapeData.h SpringMotor.h + SpringMotorData.h ThrusterMotor.h + ThrusterMotorData.h Vec3r.h """) *************** *** 45,48 **** --- 54,58 ---- GearedMotor.cpp Joint.cpp + Logger.cpp Motor.cpp Sensor.cpp *************** *** 50,53 **** --- 60,64 ---- Simulator.cpp Solid.cpp + SolidData.cpp SpringMotor.cpp ThrusterMotor.cpp --- NEW FILE: SolidData.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #include "SolidData.h" #include "BoxShapeData.h" #include "SphereShapeData.h" #include "CapsuleShapeData.h" #include "PlaneShapeData.h" #include "RayShapeData.h" #include "MeshShapeData.h" namespace opal { SolidData::SolidData() { enabled = defaults::solid::enabled; name = ""; sleeping = defaults::solid::sleeping; sleepiness = defaults::solid::sleepiness; isStatic = defaults::solid::isStatic; // Leave the transform as an identity matrix. // "globalLinearVel" is already initialized in its constructor. // "globalAngularVel" is already initialized in its constructor. linearDamping = defaults::linearDamping; angularDamping = defaults::angularDamping; // The Shape list doesn't need to be initialized. } SolidData::SolidData(const SolidData& data) { (*this) = data; } SolidData::~SolidData() { destroyShapes(); } void SolidData::addShape(const ShapeData& data) { ShapeData* newShape = NULL; switch(data.getType()) { case BOX_SHAPE: { newShape = new BoxShapeData((BoxShapeData&)data); break; } case SPHERE_SHAPE: { newShape = new SphereShapeData((SphereShapeData&)data); break; } case CAPSULE_SHAPE: { newShape = new CapsuleShapeData((CapsuleShapeData&)data); break; } case PLANE_SHAPE: { newShape = new PlaneShapeData((PlaneShapeData&)data); break; } case RAY_SHAPE: { newShape = new RayShapeData((RayShapeData&)data); break; } case MESH_SHAPE: { newShape = new MeshShapeData((MeshShapeData&)data); break; } default: assert(false); } mShapes.push_back(newShape); } int SolidData::getNumShapes()const { return (int)(mShapes.size()); } ShapeData* SolidData::getShapeData(unsigned int i)const { return mShapes.at(i); } void SolidData::destroyShapes() { while (!mShapes.empty()) { delete mShapes.back(); mShapes.pop_back(); } } void SolidData::operator=(const SolidData& data) { enabled = data.enabled; name = data.name; sleeping = data.sleeping; sleepiness = data.sleepiness; isStatic = data.isStatic; transform = data.transform; globalLinearVel = data.globalLinearVel; globalAngularVel = data.globalAngularVel; linearDamping = data.linearDamping; angularDamping = data.angularDamping; // First remove the old Shapes. destroyShapes(); // Allocate copies of the new Shapes. for (unsigned int i=0; i<data.mShapes.size(); ++i) { addShape(*(data.mShapes[i])); } } } --- NEW FILE: Logger.h --- #ifndef OPAL_LOGGER_H #define OPAL_LOGGER_H #include <iomanip> #include <stdlib.h> #include <string> #include <ostream> #include <iostream> #include <map> #include <iosfwd> #include <stdexcept> namespace opal { /// This class is used to log any events, errors, or warnings that may /// come up. Calls to this class should replace all cout << statements /// in the form: Logger::stream("myStreamName") << ... /// where myStreamName was registered as a cout stream or file stream /// using the setStream function. class Logger { public: Logger(); ~Logger(); /// Register a new stream for later use. static void setStream(const std::string& name, std::ostream *stream, const std::string& prefix="", char mark='\0'); //static void silenceStream(const std::string& name); //static void unsilenceStream(const std::string& name); static std::ostream &stream(const std::string& name); private: struct Stream { std::ostream *nullStream; std::ostream *stream; bool silent; char mark; std::string prefix; }; static void init(); //static bool mInitCalled; static std::map<std::string, Stream> mStreams; }; } #endif Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Simulator.h 23 Feb 2005 06:35:46 -0000 1.74 --- Simulator.h 25 Feb 2005 06:40:26 -0000 1.75 *************** *** 44,47 **** --- 44,49 ---- namespace opal { + class BlueprintInstance; + /// A data structure containing information about a specific /// intersection from a ray cast. *************** *** 62,107 **** }; - /// Contains maps of string names to object pointers for Solids, Joints, - /// Motors, and Sensors. - struct BlueprintInstance - { - ~BlueprintInstance() - { - solidMap.clear(); - jointMap.clear(); - } - - /// Convenience function for finding a Solid pointer by name. - /// Returns NULL if the pointer is not found. - Solid* getSolid(const std::string& name) - { - if (solidMap.end() == solidMap.find(name)) - { - return NULL; - } - else - { - return solidMap[name]; - } - } - - /// Convenience function for finding a Joint pointer by name. - /// Returns NULL if the pointer is not found. - Joint* getJoint(const std::string& name) - { - if (jointMap.end() == jointMap.find(name)) - { - return NULL; - } - else - { - return jointMap[name]; - } - } - - std::map<std::string, Solid*> solidMap; - std::map<std::string, Joint*> jointMap; - }; - /// A Simulator is an environment that contains simulated objects. /// It performs collision detection and physical simulation. It is --- 64,67 ---- *************** *** 128,140 **** virtual void OPAL_CALL setStepSize(real stepSize); ! //virtual NamedObjectCollection OPAL_CALL instantiateBlueprint( ! // const Blueprint& bp); /// A convenient volume collision check function. TODO: replace /// with a Sensor. TODO: the vector pointer here is bad because /// memory is allocated within the DLL and deallocated on the ! /// user's side ! virtual void OPAL_CALL collide(const Solid* solid, ! std::vector<Solid*>* solids) = 0; /// A convenient ray casting function. TODO: replace with a --- 88,103 ---- virtual void OPAL_CALL setStepSize(real stepSize); ! /// Creates instances of all objects in a Blueprint and fills the ! /// given BlueprintInstance with pointers of the named objects. ! virtual void OPAL_CALL instantiateBlueprint( ! BlueprintInstance& instance, const Blueprint& bp); /// A convenient volume collision check function. TODO: replace /// with a Sensor. TODO: the vector pointer here is bad because /// memory is allocated within the DLL and deallocated on the ! /// user's side; make a VolumeCollisionReport object with an ! /// add function ! //virtual void OPAL_CALL collide(const Solid* solid, ! // std::vector<Solid*>* solids) = 0; /// A convenient ray casting function. TODO: replace with a *************** *** 149,155 **** virtual Vec3r OPAL_CALL getGravity()const = 0; ! virtual void OPAL_CALL setSleepiness(real value); ! virtual real OPAL_CALL getSleepiness()const; /// Sets the accuracy level used by the physics engine's constraint --- 112,118 ---- virtual Vec3r OPAL_CALL getGravity()const = 0; ! //virtual void OPAL_CALL setDefaultSleepiness(real value); ! //virtual real OPAL_CALL getDefaultSleepiness()const; /// Sets the accuracy level used by the physics engine's constraint *************** *** 204,208 **** /// Returns all Solids in the Simulator. ! virtual const std::vector<Solid*>& OPAL_CALL getSolids()const; // JOINTS --- 167,171 ---- /// Returns all Solids in the Simulator. ! //virtual const std::vector<Solid*>& OPAL_CALL getSolids()const; // JOINTS *************** *** 309,313 **** // ranges from 0.0 to 1.0; TODO: make this per-Solid ! real mSleepiness; /// The accuracy level used internally by the physics engine's --- 272,276 ---- // ranges from 0.0 to 1.0; TODO: make this per-Solid ! //real mSleepiness; /// The accuracy level used internally by the physics engine's Index: Sensor.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Sensor.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sensor.cpp 21 Feb 2005 15:54:38 -0000 1.3 --- Sensor.cpp 25 Feb 2005 06:40:26 -0000 1.4 *************** *** 32,36 **** Sensor::Sensor() { ! mEnabled = false; mInitCalled = false; setUserData(NULL); --- 32,37 ---- Sensor::Sensor() { ! // "mData" is initialized in its own constructor. ! //mEnabled = false; mInitCalled = false; setUserData(NULL); *************** *** 41,59 **** } - bool Sensor::isEnabled()const - { - return mEnabled; - } - - void Sensor::setEnabled(bool e) - { - if (!mInitCalled) - { - return; - } - - mEnabled = e; - } - void Sensor::setUserData(void* data) { --- 42,45 ---- Index: GearedMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GearedMotor.h 23 Feb 2005 03:58:23 -0000 1.6 --- GearedMotor.h 25 Feb 2005 06:40:26 -0000 1.7 *************** *** 62,66 **** /// Returns all data describing the Motor. ! virtual const GearedMotorData& OPAL_CALL getMotorData(); virtual bool OPAL_CALL isEnabled()const; --- 62,70 ---- /// Returns all data describing the Motor. ! virtual const GearedMotorData& OPAL_CALL getMotorData()const; ! ! virtual void OPAL_CALL setName(const std::string& name); ! ! virtual const std::string& OPAL_CALL getName()const; virtual bool OPAL_CALL isEnabled()const; Index: GearedMotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/GearedMotorData.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GearedMotorData.h 23 Feb 2005 03:58:23 -0000 1.1 --- GearedMotorData.h 25 Feb 2005 06:40:26 -0000 1.2 *************** *** 64,67 **** --- 64,68 ---- mType = data.mType; enabled = data.enabled; + name = data.name; joint = data.joint; jointAxisNum = data.jointAxisNum; Index: BlueprintManager.h =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintManager.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** BlueprintManager.h 22 Feb 2005 01:25:55 -0000 1.14 --- BlueprintManager.h 25 Feb 2005 06:40:26 -0000 1.15 *************** *** 46,80 **** virtual ~BlueprintManager(); ! //virtual void OPAL_CALL loadFile(const std::string& filename); ! virtual void OPAL_CALL addBlueprint(Blueprint* bp); ! virtual Blueprint* OPAL_CALL getBlueprint( const std::string& filename); ! virtual bool OPAL_CALL blueprintExists(const std::string& name); ! private: ! //SolidData loadSolid(const TiXmlNode* nodePtr, ! // const std::string& filename); ! JointData loadJoint(const TiXmlNode* nodePtr, ! const std::string& filename); ! Matrix44r loadOffset(const TiXmlNode* nodePtr, const std::string& filename); ! //ShapeData loadShape(const TiXmlNode* nodePtr, ! // const std::string& filename); ! // helper function; returns false if the attribute doesn't exist real getAttributeReal(const TiXmlNode* nodePtr, ! const std::string& name); ! // helper function; returns false if the attribute doesn't exist std::string getAttributeString(const TiXmlNode* nodePtr, ! const std::string& name); ! ! std::map<std::string, Blueprint*> mBlueprintMap; }; } --- 46,111 ---- virtual ~BlueprintManager(); ! /// Loads a Blueprint from an OPAL XML file. The file should ! /// contain a single OpalBlueprint element (additional ones ! /// will be ignored). The Blueprint can contain any number ! /// of Solids, Joints, Motors, and Sensors. Most of the ! /// object parameters are optional, in which case the usual, ! /// default values will be used. The only required ! /// parameters are references to other objects (i.e. the ! /// "References" elements in an XML file. For example, ! /// a Joint refers to two Solids; if either of those Solids ! /// are not in the file, the Joint will be ignored. For a ! /// particular element, all attributes are always required. ! virtual void OPAL_CALL loadFile(Blueprint& bp, ! const std::string& filename); ! /// Saves a Blueprint to an OPAL XML file. ! //virtual void OPAL_CALL saveFile(const Blueprint& bp, ! // const std::string& filename); ! private: ! /// Helper function for parsing Solid XML elements. Allocates ! /// and returns a pointer to a new SolidData object. Returns ! /// NULL if the element could not be loaded. ! SolidData* loadSolid(const TiXmlNode* nodePtr, const std::string& filename); ! /// Helper function for parsing Joint XML elements. Allocates ! /// and returns a pointer to a new JointData object. Returns ! /// NULL if the element could not be loaded. ! JointData* loadJoint(const TiXmlNode* nodePtr, ! const Blueprint& bp, const std::string& filename); ! /// Helper function for parsing Motor XML elements. Allocates ! /// and returns a pointer to a new MotorData object. Returns ! /// NULL if the element could not be loaded. ! MotorData* loadMotor(const TiXmlNode* nodePtr, ! const Blueprint& bp, const std::string& filename); ! /// Helper function for parsing Sensor XML elements. Allocates ! /// and returns a pointer to a new SensorData object. Returns ! /// NULL if the element could not be loaded. ! SensorData* loadSensor(const TiXmlNode* nodePtr, ! const Blueprint& bp, const std::string& filename); ! /// Helper function for parsing Shape XML elements. Allocates ! /// and returns a pointer to a new ShapeData object. Returns ! /// NULL if the element could not be loaded. ! ShapeData* loadShape(const TiXmlNode* nodePtr, const std::string& filename); ! /// Helper function for parsing offset XML elements. ! void loadOffset(Matrix44r& offset, const TiXmlNode* nodePtr, ! const std::string& filename); ! /// Helper function; returns 0 if the attribute doesn't ! /// exist. real getAttributeReal(const TiXmlNode* nodePtr, ! const std::string& name)const; ! /// Helper function; returns false if the attribute doesn't ! /// exist. std::string getAttributeString(const TiXmlNode* nodePtr, ! const std::string& name)const; }; } Index: SpringMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/SpringMotor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SpringMotor.h 23 Feb 2005 03:58:23 -0000 1.6 --- SpringMotor.h 25 Feb 2005 06:40:26 -0000 1.7 *************** *** 56,60 **** /// Returns all data describing the Motor. ! virtual const SpringMotorData& OPAL_CALL getMotorData(); virtual bool OPAL_CALL isEnabled()const; --- 56,64 ---- /// Returns all data describing the Motor. ! virtual const SpringMotorData& OPAL_CALL getMotorData()const; ! ! virtual void OPAL_CALL setName(const std::string& name); ! ! virtual const std::string& OPAL_CALL getName()const; virtual bool OPAL_CALL isEnabled()const; *************** *** 79,86 **** /// Returns the damping constant for linear mode. ! virtual real OPAL_CALL getLinearKd(); /// Returns the spring constant for linear mode. ! virtual real OPAL_CALL getLinearKs(); /// Sets the damping constant for angular mode. --- 83,90 ---- /// Returns the damping constant for linear mode. ! virtual real OPAL_CALL getLinearKd()const; /// Returns the spring constant for linear mode. ! virtual real OPAL_CALL getLinearKs()const; /// Sets the damping constant for angular mode. *************** *** 91,98 **** /// Returns the damping constant for angular mode. ! virtual real OPAL_CALL getAngularKd(); /// Returns the spring constant for angular mode. ! virtual real OPAL_CALL getAngularKs(); virtual void OPAL_CALL internal_update(); --- 95,102 ---- /// Returns the damping constant for angular mode. ! virtual real OPAL_CALL getAngularKd()const; /// Returns the spring constant for angular mode. ! virtual real OPAL_CALL getAngularKs()const; virtual void OPAL_CALL internal_update(); Index: ServoMotorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/ServoMotorData.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServoMotorData.h 23 Feb 2005 03:58:23 -0000 1.1 --- ServoMotorData.h 25 Feb 2005 06:40:26 -0000 1.2 *************** *** 78,81 **** --- 78,82 ---- mType = data.mType; enabled = data.enabled; + name = data.name; joint = data.joint; mode = data.mode; Index: SensorData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SensorData.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SensorData.h 23 Feb 2005 04:56:49 -0000 1.2 --- SensorData.h 25 Feb 2005 06:40:26 -0000 1.3 *************** *** 49,52 **** --- 49,54 ---- // class will never be instantiated. mType = VELOCITY_SENSOR; + enabled = defaults::sensor::enabled; + name = ""; } *************** *** 61,64 **** --- 63,72 ---- } + /// True if the Motor is enabled. + bool enabled; + + /// An identifier for the Sensor. + std::string name; + protected: /// The Sensor type. Index: ThrusterMotor.h =================================================================== RCS file: /cvsroot/opal/opal/src/ThrusterMotor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ThrusterMotor.h 23 Feb 2005 03:58:23 -0000 1.6 --- ThrusterMotor.h 25 Feb 2005 06:40:26 -0000 1.7 *************** *** 55,59 **** /// Returns all data describing the Motor. ! virtual const ThrusterMotorData& OPAL_CALL getMotorData(); virtual bool OPAL_CALL isEnabled()const; --- 55,63 ---- /// Returns all data describing the Motor. ! virtual const ThrusterMotorData& OPAL_CALL getMotorData()const; ! ! virtual void OPAL_CALL setName(const std::string& name); ! ! virtual const std::string& OPAL_CALL getName()const; virtual bool OPAL_CALL isEnabled()const; --- NEW FILE: BlueprintInstance.cpp --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net ... [truncated message content] |