#ifndef __fpa__Base__Events__h__ #define __fpa__Base__Events__h__ // ------------------------------------------------------------------------- #define fpa_Base_NewEvent( name ) \ class name \ : public BaseEvent \ { \ public: \ name( ) : BaseEvent( ) { } \ virtual ~name( ) { } \ const char* GetEventName( ) const \ { return( "fpa::Base::##name" ); } \ bool CheckEvent( const itk::EventObject* e ) const \ { return( dynamic_cast< const name* >( e ) != NULL ); } \ itk::EventObject* MakeObject( ) const \ { return( new name( ) ); } \ }; // ------------------------------------------------------------------------- #define fpa_Base_NewEventWithVertex( name, type ) \ class name \ : public BaseEventWithVertex< type > \ { \ public: \ name( ) : BaseEventWithVertex< type >( ) { } \ name( const type& v, long fid ) \ : BaseEventWithVertex< type >( v, fid ) { } \ virtual ~name( ) { } \ const char* GetEventName( ) const \ { return( "fpa::Base::##name" ); } \ bool CheckEvent( const itk::EventObject* e ) const \ { return( dynamic_cast< const name* >( e ) != NULL ); } \ itk::EventObject* MakeObject( ) const \ { return( new name( ) ); } \ }; namespace fpa { namespace Base { /** */ class BaseEvent : public itk::AnyEvent { public: BaseEvent( ) : itk::AnyEvent( ) { } virtual ~BaseEvent( ) { } const char* GetEventName( ) const { return( "fpa::Base::BaseEvent" ); } bool CheckEvent( const itk::EventObject* e ) const { return( dynamic_cast< const BaseEvent* >( e ) != NULL ); } itk::EventObject* MakeObject( ) const { return( new BaseEvent( ) ); } }; /** */ template< class _TVertex > class BaseEventWithVertex : public BaseEvent { public: BaseEventWithVertex( ) : BaseEvent( ) { } BaseEventWithVertex( const _TVertex& v, long fid ) : BaseEvent( ), Vertex( v ), FrontId( fid ) { } virtual ~BaseEventWithVertex( ) { } const char* GetEventName( ) const { return( "fpa::Base::BaseEventWithVertex" ); } bool CheckEvent( const itk::EventObject* e ) const { return( dynamic_cast< const BaseEventWithVertex< _TVertex >* >( e ) != NULL ); } itk::EventObject* MakeObject( ) const { return( new BaseEventWithVertex< _TVertex >( ) ); } public: _TVertex Vertex; long FrontId; }; } // ecapseman } // ecapseman #endif // __fpa__Base__Events__h__ // eof - $RCSfile$