[Opal-commits] opal/src Blueprint.cpp,1.21,1.22 Blueprint.h,1.24,1.25 BlueprintInstance.cpp,1.3,1.4
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-03-31 08:47:58
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17811/src Modified Files: Blueprint.cpp Blueprint.h BlueprintInstance.cpp BlueprintInstance.h CapsuleShapeData.h Defines.h Simulator.cpp Simulator.h SolidData.cpp SolidData.h Log Message: added some helper functions to Simulator; added data for ogre sample apps Index: SolidData.h =================================================================== RCS file: /cvsroot/opal/opal/src/SolidData.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SolidData.h 11 Mar 2005 05:31:56 -0000 1.7 --- SolidData.h 31 Mar 2005 08:47:02 -0000 1.8 *************** *** 50,54 **** /// Returns the number of Shapes in this SolidData. ! OPAL_DECL virtual int OPAL_CALL getNumShapes()const; /// Returns a pointer to the ShapeData at the given index. --- 50,54 ---- /// Returns the number of Shapes in this SolidData. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumShapes()const; /// Returns a pointer to the ShapeData at the given index. Index: CapsuleShapeData.h =================================================================== RCS file: /cvsroot/opal/opal/src/CapsuleShapeData.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CapsuleShapeData.h 11 Mar 2005 05:31:56 -0000 1.5 --- CapsuleShapeData.h 31 Mar 2005 08:47:02 -0000 1.6 *************** *** 34,38 **** namespace opal { ! /// A data structure describing a capsule Shape. class CapsuleShapeData : public ShapeData { --- 34,39 ---- namespace opal { ! /// A data structure describing a capsule Shape. Capsules start out ! /// aligned along their local Z axis. class CapsuleShapeData : public ShapeData { *************** *** 71,75 **** real radius; ! /// The capsule's length. real length; --- 72,76 ---- real radius; ! /// The capsule's length, not including the round caps. real length; Index: Defines.h =================================================================== RCS file: /cvsroot/opal/opal/src/Defines.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Defines.h 30 Mar 2005 23:26:22 -0000 1.70 --- Defines.h 31 Mar 2005 08:47:02 -0000 1.71 *************** *** 299,303 **** namespace shape { ! const Material material = opal::globals::woodMaterial; const unsigned int contactGroup = 0; const Vec3r boxDimensions = Vec3r(1, 1, 1); --- 299,303 ---- namespace shape { ! const Material material = globals::woodMaterial; const unsigned int contactGroup = 0; const Vec3r boxDimensions = Vec3r(1, 1, 1); Index: Blueprint.h =================================================================== RCS file: /cvsroot/opal/opal/src/Blueprint.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Blueprint.h 26 Feb 2005 10:22:23 -0000 1.24 --- Blueprint.h 31 Mar 2005 08:47:02 -0000 1.25 *************** *** 80,93 **** /// Returns the number of SolidData objects. ! OPAL_DECL virtual int OPAL_CALL getNumSolids()const; /// Returns the number of JointData objects. ! OPAL_DECL virtual int OPAL_CALL getNumJoints()const; /// Returns the number of MotorData objects. ! OPAL_DECL virtual int OPAL_CALL getNumMotors()const; /// Returns the number of SensorData objects. ! OPAL_DECL virtual int OPAL_CALL getNumSensors()const; /// Returns a pointer to the SolidData at the given index. --- 80,93 ---- /// Returns the number of SolidData objects. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumSolids()const; /// Returns the number of JointData objects. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumJoints()const; /// Returns the number of MotorData objects. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumMotors()const; /// Returns the number of SensorData objects. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumSensors()const; /// Returns a pointer to the SolidData at the given index. Index: Blueprint.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Blueprint.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Blueprint.cpp 29 Mar 2005 03:05:46 -0000 1.21 --- Blueprint.cpp 31 Mar 2005 08:47:02 -0000 1.22 *************** *** 377,396 **** } ! int Blueprint::getNumSolids()const { return (int)(mSolidList.size()); } ! int Blueprint::getNumJoints()const { return (int)(mJointList.size()); } ! int Blueprint::getNumMotors()const { return (int)(mMotorList.size()); } ! int Blueprint::getNumSensors()const { return (int)(mSensorList.size()); --- 377,396 ---- } ! unsigned int Blueprint::getNumSolids()const { return (int)(mSolidList.size()); } ! unsigned int Blueprint::getNumJoints()const { return (int)(mJointList.size()); } ! unsigned int Blueprint::getNumMotors()const { return (int)(mMotorList.size()); } ! unsigned int Blueprint::getNumSensors()const { return (int)(mSensorList.size()); Index: BlueprintInstance.h =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintInstance.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BlueprintInstance.h 3 Mar 2005 04:39:55 -0000 1.3 --- BlueprintInstance.h 31 Mar 2005 08:47:02 -0000 1.4 *************** *** 71,84 **** /// Returns the number of Solids in this BlueprintInstance. ! OPAL_DECL virtual int OPAL_CALL getNumSolids()const; /// Returns the number of Joints in this BlueprintInstance. ! OPAL_DECL virtual int OPAL_CALL getNumJoints()const; /// Returns the number of Motors in this BlueprintInstance. ! OPAL_DECL virtual int OPAL_CALL getNumMotors()const; /// Returns the number of Sensors in this BlueprintInstance. ! OPAL_DECL virtual int OPAL_CALL getNumSensors()const; /// Finds a Solid by index and returns its pointer. --- 71,84 ---- /// Returns the number of Solids in this BlueprintInstance. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumSolids()const; /// Returns the number of Joints in this BlueprintInstance. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumJoints()const; /// Returns the number of Motors in this BlueprintInstance. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumMotors()const; /// Returns the number of Sensors in this BlueprintInstance. ! OPAL_DECL virtual unsigned int OPAL_CALL getNumSensors()const; /// Finds a Solid by index and returns its pointer. Index: Simulator.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Simulator.cpp 30 Mar 2005 23:26:22 -0000 1.54 --- Simulator.cpp 31 Mar 2005 08:47:02 -0000 1.55 *************** *** 306,310 **** std::vector<Solid*> solidList; std::vector<Joint*> jointList; ! int i; // Create all Solids in the Blueprint. --- 306,310 ---- std::vector<Solid*> solidList; std::vector<Joint*> jointList; ! unsigned int i; // Create all Solids in the Blueprint. *************** *** 331,335 **** // Scale the Solid's Shape's offsets and dimensions. ! int i=0; for (i=0; i<sd.getNumShapes(); ++i) { --- 331,335 ---- // Scale the Solid's Shape's offsets and dimensions. ! unsigned int i=0; for (i=0; i<sd.getNumShapes(); ++i) { *************** *** 737,740 **** --- 737,771 ---- } + Solid* Simulator::createPlane(real a, real b, real c, real d, + const Material& m) + { + // Create the plane's Solid and make it static. + Solid* plane = createSolid(); + plane->setStatic(true); + + // Setup the plane's Shape data. + opal::PlaneShapeData planeData; + planeData.material = m; + planeData.abcd[0] = a; + planeData.abcd[1] = b; + planeData.abcd[2] = c; + planeData.abcd[3] = d; + + // Add the Shape to the Solid. + plane->addShape(planeData); + + return plane; + } + + unsigned int Simulator::getNumSolids()const + { + return (unsigned int)(mSolidList.size()); + } + + Solid* Simulator::getSolid(unsigned int i)const + { + return mSolidList.at(i); + } + void Simulator::destroySolid(Solid* s) { *************** *** 752,760 **** } - //const std::vector<Solid*>& Simulator::getSolids()const - //{ - // return mSolidList; - //} - void Simulator::destroyJoint(Joint* j) { --- 783,786 ---- Index: BlueprintInstance.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/BlueprintInstance.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BlueprintInstance.cpp 3 Mar 2005 04:39:55 -0000 1.3 --- BlueprintInstance.cpp 31 Mar 2005 08:47:02 -0000 1.4 *************** *** 107,126 **** } ! int BlueprintInstance::getNumSolids()const { return (int)(mSolidList.size()); } ! int BlueprintInstance::getNumJoints()const { return (int)(mJointList.size()); } ! int BlueprintInstance::getNumMotors()const { return (int)(mMotorList.size()); } ! int BlueprintInstance::getNumSensors()const { return (int)(mSensorList.size()); --- 107,126 ---- } ! unsigned int BlueprintInstance::getNumSolids()const { return (int)(mSolidList.size()); } ! unsigned int BlueprintInstance::getNumJoints()const { return (int)(mJointList.size()); } ! unsigned int BlueprintInstance::getNumMotors()const { return (int)(mMotorList.size()); } ! unsigned int BlueprintInstance::getNumSensors()const { return (int)(mSensorList.size()); Index: SolidData.cpp =================================================================== RCS file: /cvsroot/opal/opal/src/SolidData.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SolidData.cpp 5 Mar 2005 21:26:24 -0000 1.3 --- SolidData.cpp 31 Mar 2005 08:47:02 -0000 1.4 *************** *** 103,109 **** } ! int SolidData::getNumShapes()const { ! return (int)(mShapes.size()); } --- 103,109 ---- } ! unsigned int SolidData::getNumShapes()const { ! return (unsigned int)(mShapes.size()); } Index: Simulator.h =================================================================== RCS file: /cvsroot/opal/opal/src/Simulator.h,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Simulator.h 30 Mar 2005 23:26:22 -0000 1.92 --- Simulator.h 31 Mar 2005 08:47:02 -0000 1.93 *************** *** 168,171 **** --- 168,181 ---- virtual Solid* OPAL_CALL createSolid() = 0; + /// Helper function for creating a static Solid with a Plane Shape. + virtual Solid* OPAL_CALL createPlane(real a, real b, real c, real d, + const Material& m = defaults::shape::material); + + /// Returns the number of Solids in the Simulator. + virtual unsigned int OPAL_CALL getNumSolids()const; + + /// Returns a pointer to the Solid at the given index. + virtual Solid* OPAL_CALL getSolid(unsigned int i)const; + /// Immediately destroys the given Solid. All Joints, Motors, and /// Sensors that depend on this Solid will be automatically *************** *** 176,182 **** virtual void OPAL_CALL destroyAllSolids(); - /// Returns all Solids in the Simulator. - //virtual const std::vector<Solid*>& OPAL_CALL getSolids()const; - // JOINTS --- 186,189 ---- |