]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/BezierCurveFunction.h
...
[cpPlugins.git] / lib / cpExtensions / Algorithms / BezierCurveFunction.h
index d15f3286fe8374f21a8a0d138b619131e63dfab3..65c3af8be41a7537554423efe6bb878075422c6e 100644 (file)
@@ -5,69 +5,72 @@
 #ifndef __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__
 #define __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__
 
+#include <cpExtensions/Config.h>
 #include <vector>
 #include <itkFunctionBase.h>
 #include <itkMatrix.h>
 
 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 cpExtensions_OVERRIDE;
+      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
 
-#include <cpExtensions/Algorithms/BezierCurveFunction.hxx>
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <cpExtensions/Algorithms/BezierCurveFunction.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
 
 #endif // __CPEXTENSIONS__ALGORITHMS__BEZIERCURVEFUNCTION__H__