From: Markus R. <rol...@us...> - 2007-02-18 12:51:06
|
Update of /cvsroot/simspark/simspark/spark/plugin/sparkagent In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29117 Modified Files: Tag: WIN32 hinge2perceptor.cpp hinge2perceptor.h hingeperceptor.cpp hingeperceptor.h universaljointperceptor.cpp universaljointperceptor.h Log Message: - use JointPerceptor template Index: hingeperceptor.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hingeperceptor.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** hingeperceptor.h 2 Jan 2006 18:11:33 -0000 1.1 --- hingeperceptor.h 18 Feb 2007 12:50:58 -0000 1.1.2.1 *************** *** 21,28 **** #define HINGEPERCEPTOR_H ! #include <oxygen/agentaspect/perceptor.h> #include <oxygen/physicsserver/hingejoint.h> ! class HingePerceptor : public oxygen::Perceptor { public: --- 21,28 ---- #define HINGEPERCEPTOR_H ! #include <oxygen/agentaspect/jointperceptor.h> #include <oxygen/physicsserver/hingejoint.h> ! class HingePerceptor : public oxygen::JointPerceptor<oxygen::HingeJoint> { public: *************** *** 34,46 **** protected: - virtual void OnLink(); - virtual void OnUnlink(); - void InsertAxisAngle(oxygen::Predicate& predicate); void InsertAxisRate(oxygen::Predicate& predicate); - - protected: - /** cached reference to the monitor joint */ - boost::shared_ptr<oxygen::HingeJoint> mJoint; }; --- 34,39 ---- Index: universaljointperceptor.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/universaljointperceptor.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** universaljointperceptor.h 6 Jan 2006 13:57:36 -0000 1.1 --- universaljointperceptor.h 18 Feb 2007 12:50:58 -0000 1.1.2.1 *************** *** 21,28 **** #define UNIVERSALJOINTPERCEPTOR_H ! #include <oxygen/agentaspect/perceptor.h> #include <oxygen/physicsserver/universaljoint.h> ! class UniversalJointPerceptor : public oxygen::Perceptor { public: --- 21,28 ---- #define UNIVERSALJOINTPERCEPTOR_H ! #include <oxygen/agentaspect/jointperceptor.h> #include <oxygen/physicsserver/universaljoint.h> ! class UniversalJointPerceptor : public oxygen::JointPerceptor<oxygen::UniversalJoint> { public: *************** *** 34,46 **** protected: - virtual void OnLink(); - virtual void OnUnlink(); - void InsertAxisAngle(oxygen::Predicate& predicate, oxygen::Joint::EAxisIndex idx); void InsertAxisRate(oxygen::Predicate& predicate, oxygen::Joint::EAxisIndex idx); - - protected: - /** cached reference to the monitor joint */ - boost::shared_ptr<oxygen::UniversalJoint> mJoint; }; --- 34,39 ---- Index: hinge2perceptor.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hinge2perceptor.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** hinge2perceptor.h 2 Jan 2006 18:11:33 -0000 1.2 --- hinge2perceptor.h 18 Feb 2007 12:50:58 -0000 1.2.2.1 *************** *** 23,30 **** #define HINGE2PERCEPTOR_H ! #include <oxygen/agentaspect/perceptor.h> #include <oxygen/physicsserver/hinge2joint.h> ! class Hinge2Perceptor : public oxygen::Perceptor { public: --- 23,30 ---- #define HINGE2PERCEPTOR_H ! #include <oxygen/agentaspect/jointperceptor.h> #include <oxygen/physicsserver/hinge2joint.h> ! class Hinge2Perceptor : public oxygen::JointPerceptor<oxygen::Hinge2Joint> { public: *************** *** 36,49 **** protected: - virtual void OnLink(); - virtual void OnUnlink(); - void InsertAxisAngle(oxygen::Predicate& predicate, oxygen::Joint::EAxisIndex idx); void InsertAxisRate(oxygen::Predicate& predicate, oxygen::Joint::EAxisIndex idx); - - - protected: - /** cached reference to the monitor joint */ - boost::shared_ptr<oxygen::Hinge2Joint> mJoint; }; --- 36,41 ---- Index: universaljointperceptor.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/universaljointperceptor.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** universaljointperceptor.cpp 22 Jan 2006 11:57:40 -0000 1.2 --- universaljointperceptor.cpp 18 Feb 2007 12:50:58 -0000 1.2.2.1 *************** *** 26,30 **** using namespace std; ! UniversalJointPerceptor::UniversalJointPerceptor() : Perceptor() { } --- 26,31 ---- using namespace std; ! UniversalJointPerceptor::UniversalJointPerceptor() ! : JointPerceptor<UniversalJoint>::JointPerceptor() { } *************** *** 34,54 **** } - void UniversalJointPerceptor::OnLink() - { - mJoint = make_shared(FindParentSupportingClass<UniversalJoint>()); - - if (mJoint.get() == 0) - { - GetLog()->Error() - << "(UniversalJointPerceptor) ERROR: found no UniversalJoint parent\n"; - } - - } - - void UniversalJointPerceptor::OnUnlink() - { - mJoint.reset(); - } - void UniversalJointPerceptor::InsertAxisAngle(Predicate& predicate, Joint::EAxisIndex idx) { --- 35,38 ---- *************** *** 103,106 **** return true; } - - --- 87,88 ---- Index: hingeperceptor.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hingeperceptor.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** hingeperceptor.cpp 2 Jan 2006 18:11:33 -0000 1.1 --- hingeperceptor.cpp 18 Feb 2007 12:50:58 -0000 1.1.2.1 *************** *** 26,30 **** using namespace std; ! HingePerceptor::HingePerceptor() : Perceptor() { } --- 26,31 ---- using namespace std; ! HingePerceptor::HingePerceptor() ! : JointPerceptor<HingeJoint>::JointPerceptor() { } *************** *** 34,54 **** } - void HingePerceptor::OnLink() - { - mJoint = make_shared(FindParentSupportingClass<HingeJoint>()); - - if (mJoint.get() == 0) - { - GetLog()->Error() - << "(HingePerceptor) ERROR: found no HingeJoint parent\n"; - } - - } - - void HingePerceptor::OnUnlink() - { - mJoint.reset(); - } - void HingePerceptor::InsertAxisAngle(Predicate& predicate) { --- 35,38 ---- Index: hinge2perceptor.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/sparkagent/hinge2perceptor.cpp,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** hinge2perceptor.cpp 2 Jan 2006 18:11:33 -0000 1.2 --- hinge2perceptor.cpp 18 Feb 2007 12:50:58 -0000 1.2.2.1 *************** *** 28,32 **** using namespace std; ! Hinge2Perceptor::Hinge2Perceptor() : Perceptor() { } --- 28,33 ---- using namespace std; ! Hinge2Perceptor::Hinge2Perceptor() ! : JointPerceptor<Hinge2Joint>::JointPerceptor() { } *************** *** 36,56 **** } - void Hinge2Perceptor::OnLink() - { - mJoint = make_shared(FindParentSupportingClass<Hinge2Joint>()); - - if (mJoint.get() == 0) - { - GetLog()->Error() - << "(Hinge2Perceptor) ERROR: found no Hinge2Joint parent\n"; - } - - } - - void Hinge2Perceptor::OnUnlink() - { - mJoint.reset(); - } - void Hinge2Perceptor::InsertAxisAngle(Predicate& predicate, Joint::EAxisIndex idx) { --- 37,40 ---- |