1 #ifndef __fpa__Base__Events__h__
2 #define __fpa__Base__Events__h__
4 // -------------------------------------------------------------------------
5 #define fpa_Base_NewEvent( name ) \
10 name( ) : BaseEvent( ) { } \
11 virtual ~name( ) { } \
12 const char* GetEventName( ) const \
13 { return( "fpa::Base::##name" ); } \
14 bool CheckEvent( const itk::EventObject* e ) const \
15 { return( dynamic_cast< const name* >( e ) != NULL ); } \
16 itk::EventObject* MakeObject( ) const \
17 { return( new name( ) ); } \
20 // -------------------------------------------------------------------------
21 #define fpa_Base_NewEventWithVertex( name, type ) \
23 : public BaseEventWithVertex< type > \
26 name( ) : BaseEventWithVertex< type >( ) { } \
27 name( const type& v, long fid ) \
28 : BaseEventWithVertex< type >( v, fid ) { } \
29 virtual ~name( ) { } \
30 const char* GetEventName( ) const \
31 { return( "fpa::Base::##name" ); } \
32 bool CheckEvent( const itk::EventObject* e ) const \
33 { return( dynamic_cast< const name* >( e ) != NULL ); } \
34 itk::EventObject* MakeObject( ) const \
35 { return( new name( ) ); } \
45 : public itk::AnyEvent
53 const char* GetEventName( ) const
54 { return( "fpa::Base::BaseEvent" ); }
55 bool CheckEvent( const itk::EventObject* e ) const
56 { return( dynamic_cast< const BaseEvent* >( e ) != NULL ); }
57 itk::EventObject* MakeObject( ) const
58 { return( new BaseEvent( ) ); }
63 template< class _TVertex >
64 class BaseEventWithVertex
68 BaseEventWithVertex( )
71 BaseEventWithVertex( const _TVertex& v, long fid )
76 virtual ~BaseEventWithVertex( )
78 const char* GetEventName( ) const
79 { return( "fpa::Base::BaseEventWithVertex" ); }
80 bool CheckEvent( const itk::EventObject* e ) const
83 dynamic_cast< const BaseEventWithVertex< _TVertex >* >( e ) != NULL
86 itk::EventObject* MakeObject( ) const
87 { return( new BaseEventWithVertex< _TVertex >( ) ); }
98 #endif // __fpa__Base__Events__h__