// SimInteractorRegistry.h // Class used to add an interaction to the tracks internally // generated by gtr. The tracks can be defined at any surface. #ifndef SimInteractorRegistry_H #define SimInteractorRegistry_H #include #include "SimInteractor.h" #include "ptr/Ptr.h" #include "ptr/SharedDeletePolicy.h" #include "trfbase/SurfacePtr.h" #include "trfbase/CrossStat.h" namespace trf { class SimInteractorRegistry : public SimInteractor { public: // typedefs typedef Ptr< SimInteractor, SharedDeletePolicy > SimInteractorPtr; typedef std::map< SurfacePtr, SimInteractorPtr > interMap; private: // map of Surfaces and SimInteractors interMap _imap; public: // methods // associate this surface with some kind of interaction void register_interactor( SurfacePtr, SimInteractorPtr ); // modify VTrack with the appropriate interaction void interact( VTrack& ); // return the bounded surface of the VTrack. This is needed because // VTracks typically have pure surfaces const SurfacePtr get_bsurf( const VTrack& ); SimInteractor* new_copy() const { return new SimInteractorRegistry(*this); } SimInteractorRegistry& operator=(const SimInteractorRegistry& rhs ){ _imap = rhs._imap; return *this; } }; } // end namespace trf #endif