1 #ifndef __CPM__ALGORITHMS__SIMPLEX__DEFORMATIONFILTER__H__
2 #define __CPM__ALGORITHMS__SIMPLEX__DEFORMATIONFILTER__H__
6 #include <itkEventObject.h>
7 #include <cpm/Algorithms/Base/InPlaceMeshFilter.h>
8 #include <cpm/Algorithms/Base/ForceFunction.h>
19 class DeformationFilter
20 : public cpm::Algorithms::Base::InPlaceMeshFilter< M >
23 typedef DeformationFilter Self;
24 typedef cpm::Algorithms::Base::InPlaceMeshFilter< M > Superclass;
25 typedef itk::SmartPointer< Self > Pointer;
26 typedef itk::SmartPointer< const Self > ConstPointer;
29 typedef typename M::PointIdentifier TPointId;
30 typedef typename M::ValueType TScalar;
32 typedef cpm::Algorithms::Base::ForceFunction< M > TForceFunction;
33 typedef typename TForceFunction::Pointer PtrFunction;
34 typedef std::pair< PtrFunction, TScalar > TFunctionPair;
35 typedef std::vector< TFunctionPair > TFunctionContainer;
39 class AllMeshUpdatedEvent
40 : public itk::EventObject
43 AllMeshUpdatedEvent( ) { }
44 AllMeshUpdatedEvent( const AllMeshUpdatedEvent& b ) { }
45 virtual ~AllMeshUpdatedEvent( ) { }
46 itk::EventObject* MakeObject( ) const
47 { return( new AllMeshUpdatedEvent( ) ); }
48 virtual const char* GetEventName( ) const
51 "cpm::Algoritms::Simplex::DeformationFilter::AllMeshUpdatedEvent"
54 virtual bool CheckEvent( const itk::EventObject* e ) const
57 dynamic_cast< const AllMeshUpdatedEvent* >( e ) != NULL
61 AllMeshUpdatedEvent& operator=( const AllMeshUpdatedEvent& b );
66 class PointUpdatedEvent
67 : public itk::EventObject
71 : PointId( TPointId( 0 ) )
73 PointUpdatedEvent( const TPointId& pId )
76 PointUpdatedEvent( const PointUpdatedEvent& b )
77 : PointId( b.PointId )
79 virtual ~PointUpdatedEvent( ) { }
80 itk::EventObject* MakeObject( ) const
81 { return( new PointUpdatedEvent( ) ); }
82 virtual const char* GetEventName( ) const
85 "cpm::Algoritms::Simplex::DeformationFilter::PointUpdatedEvent"
88 virtual bool CheckEvent( const itk::EventObject* e ) const
91 dynamic_cast< const PointUpdatedEvent* >( e ) != NULL
95 PointUpdatedEvent& operator=( const PointUpdatedEvent& b );
102 itkTypeMacro( DeformationFilter, InPlaceMeshFilter );
104 itkGetConstMacro( Damping, TScalar );
105 itkSetMacro( Damping, TScalar );
108 void AddForce( TForceFunction* f, const TScalar& w );
111 DeformationFilter( );
112 virtual ~DeformationFilter( );
114 virtual void GenerateData( );
117 DeformationFilter( const Self& );
118 Self& operator=( const Self& );
121 TFunctionContainer m_Forces;
131 #include <cpm/Algorithms/Simplex/DeformationFilter.hxx>
133 #endif // __CPM__ALGORITHMS__SIMPLEX__DEFORMATIONFILTER__H__