From: Markus R. <rol...@us...> - 2007-02-18 12:32:31
|
Update of /cvsroot/simspark/simspark/spark/plugin/sparkagent In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22134 Modified Files: Tag: WIN32 hinge2effector.cpp hinge2effector.h hingeeffector.cpp hingeeffector.h universaljointeffector.cpp universaljointeffector.h Log Message: - converted to use JointEffector base class Index: universaljointeffector.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/universaljointeffector.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** universaljointeffector.h 6 Jan 2006 13:57:36 -0000 1.1 --- universaljointeffector.h 18 Feb 2007 12:32:25 -0000 1.1.2.1 *************** *** 21,28 **** #define UNIVERSALJOINTEFFECTOR_H ! #include <oxygen/agentaspect/effector.h> #include <oxygen/physicsserver/universaljoint.h> ! class UniversalJointEffector : public oxygen::Effector { public: --- 21,28 ---- #define UNIVERSALJOINTEFFECTOR_H ! #include <oxygen/agentaspect/jointeffector.h> #include <oxygen/physicsserver/universaljoint.h> ! class UniversalJointEffector : public oxygen::JointEffector<oxygen::UniversalJoint> { public: *************** *** 39,54 **** virtual boost::shared_ptr<oxygen::ActionObject> GetActionObject(const oxygen::Predicate& predicate); - - protected: - /** setup the reference to the HingeJoint parent node */ - virtual void OnLink(); - - /** remove the reference to the HingeJoint parent node */ - virtual void OnUnlink(); - - protected: - /** cached reference to the monitor joint */ - boost::shared_ptr<oxygen::UniversalJoint> mJoint; - }; --- 39,42 ---- Index: hingeeffector.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hingeeffector.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** hingeeffector.h 2 Jan 2006 18:11:33 -0000 1.1 --- hingeeffector.h 18 Feb 2007 12:32:25 -0000 1.1.2.1 *************** *** 21,28 **** #define HINGEEFFECTOR_H ! #include <oxygen/agentaspect/effector.h> #include <oxygen/physicsserver/hingejoint.h> ! class HingeEffector : public oxygen::Effector { public: --- 21,28 ---- #define HINGEEFFECTOR_H ! #include <oxygen/agentaspect/jointeffector.h> #include <oxygen/physicsserver/hingejoint.h> ! class HingeEffector : public oxygen::JointEffector<oxygen::HingeJoint> { public: *************** *** 39,54 **** virtual boost::shared_ptr<oxygen::ActionObject> GetActionObject(const oxygen::Predicate& predicate); - - protected: - /** setup the reference to the HingeJoint parent node */ - virtual void OnLink(); - - /** remove the reference to the HingeJoint parent node */ - virtual void OnUnlink(); - - protected: - /** cached reference to the monitor joint */ - boost::shared_ptr<oxygen::HingeJoint> mJoint; - }; --- 39,42 ---- Index: universaljointeffector.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/universaljointeffector.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** universaljointeffector.cpp 24 Jan 2006 19:16:32 -0000 1.2 --- universaljointeffector.cpp 18 Feb 2007 12:32:25 -0000 1.2.2.1 *************** *** 27,33 **** using namespace std; ! UniversalJointEffector::UniversalJointEffector() : Effector() { - SetName("universaljoint"); } --- 27,33 ---- using namespace std; ! UniversalJointEffector::UniversalJointEffector() ! : JointEffector<UniversalJoint>::JointEffector("universaljoint") { } *************** *** 100,117 **** return shared_ptr<ActionObject>(); } - - void UniversalJointEffector::OnLink() - { - mJoint = make_shared(FindParentSupportingClass<UniversalJoint>()); - - if (mJoint.get() == 0) - { - GetLog()->Error() - << "(UniversalJointEffector) ERROR: found no UniversalJoint parent\n"; - } - } - - void UniversalJointEffector::OnUnlink() - { - mJoint.reset(); - } --- 100,101 ---- Index: hinge2effector.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hinge2effector.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** hinge2effector.cpp 2 Jan 2006 18:11:33 -0000 1.2 --- hinge2effector.cpp 18 Feb 2007 12:32:24 -0000 1.2.2.1 *************** *** 28,34 **** using namespace std; ! Hinge2Effector::Hinge2Effector() : Effector() { - SetName("hinge2"); } --- 28,34 ---- using namespace std; ! Hinge2Effector::Hinge2Effector() ! : JointEffector<Hinge2Joint>::JointEffector("hinge2") { } *************** *** 93,111 **** return shared_ptr<ActionObject>(); } - - void Hinge2Effector::OnLink() - { - mJoint = make_shared(FindParentSupportingClass<Hinge2Joint>()); - - if (mJoint.get() == 0) - { - GetLog()->Error() - << "(Hinge2Effector) ERROR: found no Hinge2Joint parent\n"; - } - - } - - void Hinge2Effector::OnUnlink() - { - mJoint.reset(); - } --- 93,94 ---- Index: hingeeffector.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hingeeffector.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** hingeeffector.cpp 6 Jan 2006 13:57:36 -0000 1.2 --- hingeeffector.cpp 18 Feb 2007 12:32:24 -0000 1.2.2.1 *************** *** 27,33 **** using namespace std; ! HingeEffector::HingeEffector() : Effector() { - SetName("hinge"); } --- 27,33 ---- using namespace std; ! HingeEffector::HingeEffector() ! : JointEffector<HingeJoint>::JointEffector("hinge") { } *************** *** 91,109 **** return shared_ptr<ActionObject>(); } - - void HingeEffector::OnLink() - { - mJoint = make_shared(FindParentSupportingClass<HingeJoint>()); - - if (mJoint.get() == 0) - { - GetLog()->Error() - << "(HingeEffector) ERROR: found no HingeJoint parent\n"; - } - - } - - void HingeEffector::OnUnlink() - { - mJoint.reset(); - } --- 91,92 ---- Index: hinge2effector.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hinge2effector.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** hinge2effector.h 2 Jan 2006 18:11:33 -0000 1.2 --- hinge2effector.h 18 Feb 2007 12:32:24 -0000 1.2.2.1 *************** *** 23,30 **** #define HINGE2EFFECTOR_H ! #include <oxygen/agentaspect/effector.h> #include <oxygen/physicsserver/hinge2joint.h> ! class Hinge2Effector : public oxygen::Effector { public: --- 23,30 ---- #define HINGE2EFFECTOR_H ! #include <oxygen/agentaspect/jointeffector.h> #include <oxygen/physicsserver/hinge2joint.h> ! class Hinge2Effector : public oxygen::JointEffector<oxygen::Hinge2Joint> { public: *************** *** 41,56 **** virtual boost::shared_ptr<oxygen::ActionObject> GetActionObject(const oxygen::Predicate& predicate); - - protected: - /** setup the reference to the Hinge2Joint parent node */ - virtual void OnLink(); - - /** remove the reference to the Hinge2Joint parent node */ - virtual void OnUnlink(); - - protected: - /** cached reference to the monitor joint */ - boost::shared_ptr<oxygen::Hinge2Joint> mJoint; - }; --- 41,44 ---- |