1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
5 #ifndef __CPPLUGINS__EXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__
6 #define __CPPLUGINS__EXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__
9 #include <itkFunctionBase.h>
10 #include <itkMatrix.h>
19 * Uses the De Casteljau's algorithm.
22 class BezierCurveFunction
23 : public itk::FunctionBase< typename V::ValueType, V >
26 typedef BezierCurveFunction Self;
27 typedef itk::FunctionBase< typename V::ValueType, V > Superclass;
28 typedef itk::SmartPointer< Self > Pointer;
29 typedef itk::SmartPointer< const Self > ConstPointer;
32 typedef typename V::ValueType TScalar;
35 itk::Matrix< TScalar, TVector::Dimension, TVector::Dimension >
37 typedef std::vector< TVector > TVectorsContainer;
41 itkTypeMacro( BezierCurveFunction, itkFunctionBase );
44 virtual void AddPoint( const TVector& v );
45 virtual unsigned int GetNumberOfPoints( ) const;
47 virtual TVector Evaluate( const TScalar& u ) const;
48 virtual TFrame EvaluateFrenetFrame( const TScalar& u ) const;
49 virtual TScalar EvaluateLength( ) const;
52 BezierCurveFunction( );
53 virtual ~BezierCurveFunction( ) { }
55 void _UpdateDerivative( ) const;
58 // Purposely not implemented
59 BezierCurveFunction( const Self& other );
60 Self& operator=( const Self& other );
63 TVectorsContainer m_Vectors;
64 mutable Pointer m_Derivative;
65 mutable bool m_DerivativeUpdated;
74 #include <cpPlugins/Extensions/Algorithms/BezierCurveFunction.hxx>
76 #endif // __CPPLUGINS__EXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__