From: Oliver O. <fr...@us...> - 2007-06-22 13:59:08
|
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv2484 Modified Files: Tag: projectx recorderhandler.h Log Message: update from rcssserver3D Index: recorderhandler.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/recorderhandler.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** recorderhandler.h 5 Dec 2005 21:16:49 -0000 1.1 --- recorderhandler.h 22 Jun 2007 13:59:05 -0000 1.1.4.1 *************** *** 24,27 **** --- 24,28 ---- #include "collisionhandler.h" + #include "collider.h" #include <set> *************** *** 66,69 **** --- 67,104 ---- */ void GetParentsSupportingClass(const std::string &name, TParentList &list); + + /** same functionality as GetParentsSupportingClass, but using the + C++ type system instead of string comparisons for improved + performance + + \param CLASS is the template parameter for the name of the class + the parent nodes must support + + \param list is the list that receives the parent nodes + */ + template <class CLASS> + void FindParentsSupportingClass(TParentList &list) + { + for ( + RecorderHandler::TCollisionSet::const_iterator iter = mCollisionSet.begin(); + iter != mCollisionSet.end(); + ++iter + ) + { + boost::shared_ptr<oxygen::Collider> collidee = (*iter).lock(); + if (collidee.get() == 0) + { + continue; + } + + boost::weak_ptr<zeitgeist::Node> parent = + collidee->FindParentSupportingClass<CLASS>(); + + if (! parent.expired()) + { + list.push_back(parent); + } + } + } protected: |