X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FBezierCurveFunction.h;fp=lib%2FcpExtensions%2FAlgorithms%2FBezierCurveFunction.h;h=ee512da6a240b91eac6d7634687ee3d51224ef3d;hb=506b27e2ea07cb34ba230b02eb6857b20cbf78b1;hp=d15f3286fe8374f21a8a0d138b619131e63dfab3;hpb=2361f4f97631e09d88d8a5510a369817dcaa19db;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/BezierCurveFunction.h b/lib/cpExtensions/Algorithms/BezierCurveFunction.h index d15f328..ee512da 100644 --- a/lib/cpExtensions/Algorithms/BezierCurveFunction.h +++ b/lib/cpExtensions/Algorithms/BezierCurveFunction.h @@ -10,60 +10,60 @@ #include namespace cpExtensions +{ + namespace Algorithms { - namespace Algorithms + /** + * Uses the De Casteljau's algorithm. + */ + template< class V > + class BezierCurveFunction + : public itk::FunctionBase< typename V::ValueType, V > { - /** - * Uses the De Casteljau's algorithm. - */ - template< class V > - class BezierCurveFunction - : public itk::FunctionBase< typename V::ValueType, V > - { - public: - typedef BezierCurveFunction Self; - typedef itk::FunctionBase< typename V::ValueType, V > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef V TVector; - typedef typename V::ValueType TScalar; - - typedef - itk::Matrix< TScalar, TVector::Dimension, TVector::Dimension > - TFrame; - typedef std::vector< TVector > TVectorsContainer; - - public: - itkNewMacro( Self ); - itkTypeMacro( BezierCurveFunction, itkFunctionBase ); - - public: - virtual void AddPoint( const TVector& v ); - virtual unsigned int GetNumberOfPoints( ) const; - - virtual TVector Evaluate( const TScalar& u ) const; - virtual TFrame EvaluateFrenetFrame( const TScalar& u ) const; - virtual TScalar EvaluateLength( ) const; - - protected: - BezierCurveFunction( ); - virtual ~BezierCurveFunction( ) { } - - void _UpdateDerivative( ) const; - - private: - // Purposely not implemented - BezierCurveFunction( const Self& other ); - Self& operator=( const Self& other ); - - protected: - TVectorsContainer m_Vectors; - mutable Pointer m_Derivative; - mutable bool m_DerivativeUpdated; - }; - - } // ecapseman + public: + typedef BezierCurveFunction Self; + typedef itk::FunctionBase< typename V::ValueType, V > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + typedef V TVector; + typedef typename V::ValueType TScalar; + + typedef + itk::Matrix< TScalar, TVector::Dimension, TVector::Dimension > + TFrame; + typedef std::vector< TVector > TVectorsContainer; + + public: + itkNewMacro( Self ); + itkTypeMacro( BezierCurveFunction, itkFunctionBase ); + + public: + virtual void AddPoint( const TVector& v ); + virtual unsigned int GetNumberOfPoints( ) const; + + virtual TVector Evaluate( const TScalar& u ) const; + virtual TFrame EvaluateFrenetFrame( const TScalar& u ) const; + virtual TScalar EvaluateLength( ) const; + + protected: + BezierCurveFunction( ); + virtual ~BezierCurveFunction( ) { } + + void _UpdateDerivative( ) const; + + private: + // Purposely not implemented + BezierCurveFunction( const Self& other ); + Self& operator=( const Self& other ); + + protected: + TVectorsContainer m_Vectors; + mutable Pointer m_Derivative; + mutable bool m_DerivativeUpdated; + }; + + } // ecapseman } // ecapseman