#ifndef __CPM__ALGORITHMS__SIMPLEX__DEFORMATIONFILTER__H__ #define __CPM__ALGORITHMS__SIMPLEX__DEFORMATIONFILTER__H__ #include #include #include #include #include namespace cpm { namespace Algorithms { namespace Simplex { /** */ template< class M > class DeformationFilter : public cpm::Algorithms::Base::InPlaceMeshFilter< M > { public: typedef DeformationFilter Self; typedef cpm::Algorithms::Base::InPlaceMeshFilter< M > Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef M TMesh; typedef typename M::PointIdentifier TPointId; typedef typename M::ValueType TScalar; typedef cpm::Algorithms::Base::ForceFunction< M > TForceFunction; typedef typename TForceFunction::Pointer PtrFunction; typedef std::pair< PtrFunction, TScalar > TFunctionPair; typedef std::vector< TFunctionPair > TFunctionContainer; /** */ class AllMeshUpdatedEvent : public itk::EventObject { public: AllMeshUpdatedEvent( ) { } AllMeshUpdatedEvent( const AllMeshUpdatedEvent& b ) { } virtual ~AllMeshUpdatedEvent( ) { } itk::EventObject* MakeObject( ) const { return( new AllMeshUpdatedEvent( ) ); } virtual const char* GetEventName( ) const { return( "cpm::Algoritms::Simplex::DeformationFilter::AllMeshUpdatedEvent" ); } virtual bool CheckEvent( const itk::EventObject* e ) const { return( dynamic_cast< const AllMeshUpdatedEvent* >( e ) != NULL ); } private: AllMeshUpdatedEvent& operator=( const AllMeshUpdatedEvent& b ); }; /** */ class PointUpdatedEvent : public itk::EventObject { public: PointUpdatedEvent( ) : PointId( TPointId( 0 ) ) { } PointUpdatedEvent( const TPointId& pId ) : PointId( pId ) { } PointUpdatedEvent( const PointUpdatedEvent& b ) : PointId( b.PointId ) { } virtual ~PointUpdatedEvent( ) { } itk::EventObject* MakeObject( ) const { return( new PointUpdatedEvent( ) ); } virtual const char* GetEventName( ) const { return( "cpm::Algoritms::Simplex::DeformationFilter::PointUpdatedEvent" ); } virtual bool CheckEvent( const itk::EventObject* e ) const { return( dynamic_cast< const PointUpdatedEvent* >( e ) != NULL ); } private: PointUpdatedEvent& operator=( const PointUpdatedEvent& b ); public: TPointId PointId; }; public: itkNewMacro( Self ); itkTypeMacro( DeformationFilter, InPlaceMeshFilter ); itkGetConstMacro( Damping, TScalar ); itkSetMacro( Damping, TScalar ); public: void AddForce( TForceFunction* f, const TScalar& w ); protected: DeformationFilter( ); virtual ~DeformationFilter( ); virtual void GenerateData( ); private: DeformationFilter( const Self& ); Self& operator=( const Self& ); protected: TFunctionContainer m_Forces; TScalar m_Damping; }; } // ecapseman } // ecapseman } // ecapseman #include #endif // __CPM__ALGORITHMS__SIMPLEX__DEFORMATIONFILTER__H__ // eof - $RCSfile$