1 #ifndef __FPA__BASE__EVENTS__H__
2 #define __FPA__BASE__EVENTS__H__
5 #include <itkProcessObject.h>
7 // -------------------------------------------------------------------------
8 #define fpa_Base_NewEvent( name ) \
13 name( ) : BaseEvent( ) { } \
14 virtual ~name( ) { } \
15 const char* GetEventName( ) const \
16 { return( "fpa::Base::##name" ); } \
17 bool CheckEvent( const itk::EventObject* e ) const \
18 { return( dynamic_cast< const name* >( e ) != NULL ); } \
19 itk::EventObject* MakeObject( ) const \
20 { return( new name( ) ); } \
23 // -------------------------------------------------------------------------
24 #define fpa_Base_NewEventWithVertex( name, type ) \
26 : public BaseEventWithVertex< type > \
29 name( ) : BaseEventWithVertex< type >( ) { } \
30 name( const type& v, long fid ) \
31 : BaseEventWithVertex< type >( v, fid ) { } \
32 virtual ~name( ) { } \
33 const char* GetEventName( ) const \
34 { return( "fpa::Base::##name" ); } \
35 bool CheckEvent( const itk::EventObject* e ) const \
36 { return( dynamic_cast< const name* >( e ) != NULL ); } \
37 itk::EventObject* MakeObject( ) const \
38 { return( new name( ) ); } \
48 : public itk::AnyEvent
56 const char* GetEventName( ) const
57 { return( "fpa::Base::BaseEvent" ); }
58 bool CheckEvent( const itk::EventObject* e ) const
59 { return( dynamic_cast< const BaseEvent* >( e ) != NULL ); }
60 itk::EventObject* MakeObject( ) const
61 { return( new BaseEvent( ) ); }
67 class BaseEventWithVertex
71 BaseEventWithVertex( )
74 BaseEventWithVertex( const V& v, long fid )
79 virtual ~BaseEventWithVertex( )
81 const char* GetEventName( ) const
82 { return( "fpa::Base::BaseEventWithVertex" ); }
83 bool CheckEvent( const itk::EventObject* e ) const
86 dynamic_cast< const BaseEventWithVertex< V >* >( e ) != NULL
89 itk::EventObject* MakeObject( ) const
90 { return( new BaseEventWithVertex< V >( ) ); }
101 #endif // __FPA__BASE__EVENTS__H__