+#include "DGtal/curves/parametric/C3DParametricCurve.h"
+//////////////////////////////////////////////////////////////////////////////
+
+namespace DGtal
+{
+
+/////////////////////////////////////////////////////////////////////////////
+// class CurveDigitizer
+/**
+ * Description of class 'CurveDigitizer'
+ * \brief Aim:
+ */
+template
+class ParametricCurveDigitizer3D
+{
+ BOOST_CONCEPT_ASSERT(( concepts::C3DParametricCurve < TParametricCurve > ));
+ // ----------------------- Standard services ------------------------------
+public:
+ typedef std::vector DigitalCurve;
+ typedef typename TParametricCurve::Space::Point Point;
+ typedef typename TParametricCurve::Space::RealPoint RealPoint;
+ typedef typename TParametricCurve::Space::RealVector RealVector;
+
+ ParametricCurveDigitizer3D();
+ /**
+ * Destructor.
+ */
+ ~ParametricCurveDigitizer3D() {}
+
+ // ----------------------- Interface --------------------------------------
+public:
+ void attach ( const TParametricCurve & t_curve );
+ void init ( DigitalCurve & digiCurve );
+
+ void digitize ( const double & tmin, double & tmax, const double & step );
+
+ /**
+ * Writes/Displays the object on an output stream.
+ * @param out the output stream where the object is written.
+ */
+ void selfDisplay ( std::ostream & out ) const;
+
+ /**
+ * Checks the validity/consistency of the object.
+ * @return 'true' if the object is valid, 'false' otherwise.
+ */
+ bool isValid() const;
+
+ // ------------------------- Private Datas --------------------------------
+private:
+ // ------------------------- Protected Datas ------------------------------
+protected:
+
+ DigitalCurve * digitalCurve;
+ const TParametricCurve * curve;
+ bool adaptive;
+ unsigned int attemptNumber;
+ bool is26Connected ( const Point &x, const Point &y );
+ // ------------------------- Hidden services ------------------------------
+protected:
+ virtual unsigned char findMainAxis ( const double & i );
+ virtual Point CurvePoint ( const char & mainAxis, const double & t, double & t_time );
+private:
+
+ /**
+ * Copy constructor.
+ * @param other the object to clone.
+ * Forbidden by default.
+ */
+ ParametricCurveDigitizer3D ( const ParametricCurveDigitizer3D & other );
+
+ /**
+ * Assignment.
+ * @param other the object to copy.
+ * @return a reference on 'this'.
+ * Forbidden by default.
+ */
+ ParametricCurveDigitizer3D & operator= ( const ParametricCurveDigitizer3D & other );
+
+ // ------------------------- Internals ------------------------------------
+
+}; // end of class CurveDigitizer
+
+
+/**
+ * Overloads 'operator<<' for displaying objects of class 'CurveDigitizer'.
+ * @param out the output stream where the object is written.
+ * @param object the object of class 'CurveDigitizer' to write.
+ * @return the output stream after the writing.
+ */
+template
+std::ostream&
+operator<< ( std::ostream & out, const ParametricCurveDigitizer3D & object );
+
+
+} // namespace DGtal
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Includes inline functions.
+#if !defined(BUILD_INLINE)
+#include "DGtal/curves/ParametricCurveDigitizer3D.ih"
+#endif
+
+
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#endif // !defined CurveDigitizer_h
+
+#undef CurveDigitizer_RECURSES
+#endif // else defined(CurveDigitizer_RECURSES)
diff --git a/src/DGtal/curves/ParametricCurveDigitizer3D.ih b/src/DGtal/curves/ParametricCurveDigitizer3D.ih
new file mode 100755
index 0000000000..4ea1d6b0c7
--- /dev/null
+++ b/src/DGtal/curves/ParametricCurveDigitizer3D.ih
@@ -0,0 +1,263 @@
+/**
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **/
+
+/**
+ * @file ParametricCurveDigitizer3D.ih
+ * @author Kacper Pluta (\c kacper.pluta@esiee.fr )
+ * Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France
+ *
+ * @date 2014/09/26
+ *
+ * Implementation of inline methods defined in ParametricCurveDigitizer3D.h
+ *
+ * This file is part of the DGtal library.
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+// IMPLEMENTATION of inline methods.
+///////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+#include
+#include
+#include
+#include
+#include "DGtal/kernel/BasicPointFunctors.h"
+//////////////////////////////////////////////////////////////////////////////
+
+namespace DGtal
+{
+ ///////////////////////////////////////////////////////////////////////////////
+ // Implementation of inline methods //
+ template
+ inline
+ ParametricCurveDigitizer3D::ParametricCurveDigitizer3D() : curve ( 0 )
+ {
+ attemptNumber = 2;
+ }
+
+ template
+ inline
+ void ParametricCurveDigitizer3D::attach ( const T & p_curve )
+ {
+ curve = &p_curve;
+ }
+
+ template
+ inline
+ bool ParametricCurveDigitizer3D::isValid ( ) const
+ {
+ if ( digitalCurve != 0 )
+ return true;
+ else
+ return false;
+ }
+
+
+ template
+ inline
+ unsigned char ParametricCurveDigitizer3D::findMainAxis ( const double & i )
+ {
+ ParametricCurveDigitizer3D::RealVector value;
+ value[0] = std::fabs ( curve->xp ( i )[0] );
+ value[1] = std::fabs ( curve->xp ( i )[1] );
+ value[2] = std::fabs ( curve->xp ( i )[2] );
+
+ if ( value[0] > value[1] && value[0] > value[2] )
+ return 0;
+ else if ( value[1] > value[0] && value[1] > value[2] )
+ return 1;
+ else
+ return 2;
+ }
+
+ template
+ inline
+ void ParametricCurveDigitizer3D::digitize ( const double & tmin, double & tmax, const double & step )
+ {
+ assert ( isValid() );
+ Point curvePoint;
+ double pStep = step;
+ unsigned int errC = 0;
+ double time = 0., pTime = 0.;
+ for ( double i = tmin; i < tmax; i += pStep )
+ {
+ pTime = time;
+ if ( errC > attemptNumber )
+ {
+ tmax = i;
+ throw std::runtime_error ( "Too many errors. Probably curvature or sampling step is too high." );
+ }
+ unsigned char mainAxis = findMainAxis ( i );
+ curvePoint = CurvePoint ( mainAxis, i, time );
+ if (time == pTime)
+ continue;
+ if ( digitalCurve->size() == 0 )
+ digitalCurve->push_back ( curvePoint );
+ else if ( std::find ( digitalCurve->begin(), digitalCurve->end(), curvePoint ) == digitalCurve->end() )
+ {
+ // In 26-connected curve a new point cannot be 26-connected to another points which already are a part of the curve
+ if ( digitalCurve->size() == 2 && is26Connected ( digitalCurve->back(), curvePoint ) && is26Connected ( digitalCurve->at(digitalCurve->size() - 2), curvePoint ) )
+ {
+ if ( time > pTime )
+ {
+ digitalCurve->pop_back();
+ digitalCurve->push_back ( curvePoint );
+ }
+ }
+ else if ( digitalCurve->size() >= 3 && is26Connected ( digitalCurve->back(), curvePoint ) && is26Connected ( digitalCurve->at(digitalCurve->size() - 2), curvePoint ) && !is26Connected ( digitalCurve->at(digitalCurve->size() - 3), curvePoint ) )
+ {
+ if ( time > pTime )
+ {
+ digitalCurve->pop_back();
+ digitalCurve->push_back ( curvePoint );
+ }
+ }
+ else if ( digitalCurve->size() >= 3 && is26Connected ( digitalCurve->back(), curvePoint ) && is26Connected ( digitalCurve->at(digitalCurve->size() - 2), curvePoint ) && is26Connected ( digitalCurve->at(digitalCurve->size() - 3), curvePoint ) )
+ {
+ if ( time > pTime )
+ {
+ digitalCurve->pop_back();
+ digitalCurve->pop_back();
+ digitalCurve->push_back ( curvePoint );
+ }
+ }
+ // if is disconnected try to fix the problem
+ else if ( (!is26Connected ( digitalCurve->back(), curvePoint )) )
+ {
+ if ( digitalCurve->size() >= 2 && is26Connected ( digitalCurve->at(digitalCurve->size() - 2), curvePoint ) )
+ {
+ if ( time > pTime )
+ {
+ digitalCurve->pop_back();
+ digitalCurve->push_back ( curvePoint );
+ }
+ }
+ else
+ {
+ pStep /= 10.;
+ errC++;
+ }
+ }
+ else
+ {
+ pStep = step;
+ errC = 0;
+ digitalCurve->push_back ( curvePoint );
+ }
+ }
+ }
+ if ( digitalCurve->size() >= 2 && is26Connected ( digitalCurve->at ( digitalCurve->size() - 2), digitalCurve->front() ) )
+ digitalCurve->pop_back();
+ }
+
+ template
+ inline
+ typename ParametricCurveDigitizer3D::Point ParametricCurveDigitizer3D::CurvePoint ( const char & mainAxis, const double & t, double & t_time )
+ {
+ Point curvePoint;
+ functors::VectorRounding < RealPoint, Point > pRound;
+ RealPoint pp = pRound ( curve->x ( t ) );
+ if ( mainAxis == 0 )
+ {
+ try {
+ t_time = curve->f ( pp );
+ } catch ( ... ) {
+ t_time = t;
+ }
+ RealPoint p = curve->x ( t_time );
+ curvePoint[0] = pp[0];
+ curvePoint[1] = std::round ( p[1] );
+ curvePoint[2] = std::round ( p[2] );
+ std::cout << "f^-1 " << t_time << std::endl;
+ }
+ else if ( mainAxis == 1 )
+ {
+ try {
+ t_time = curve->g ( pp );
+ } catch ( ... ) {
+ t_time = t;
+ }
+ RealPoint p = curve->x ( t_time );
+ curvePoint[0] = std::round ( p[0] );
+ curvePoint[1] = pp[1];
+ curvePoint[2] = std::round ( p[2] );
+ std::cout << "g^-1 " << t_time << std::endl;
+ }
+ else if ( mainAxis == 2 )
+ {
+ try {
+ t_time = curve->h ( pp );
+ } catch ( ... ) {
+ t_time = t;
+ }
+ RealPoint p = curve->x ( t_time );
+ curvePoint[0] = std::round ( p[0] );
+ curvePoint[1] = std::round ( p[1] );
+ curvePoint[2] = pp[2];
+ std::cout << "h^-1 " << t_time << std::endl;
+ }
+ return curvePoint;
+ }
+
+ template
+ inline
+ bool ParametricCurveDigitizer3D::is26Connected ( const Point &x, const Point &y )
+ {
+ if ( std::abs ( x[0] - y[0] ) < 2 && std::abs ( x[1] - y[1] ) < 2 && std::abs ( x[2] - y[2] ) < 2 )
+ return true;
+ return false;
+ }
+
+ template
+ inline
+ void ParametricCurveDigitizer3D::init ( typename ParametricCurveDigitizer3D::DigitalCurve & digitCurve )
+ {
+ digitalCurve = &digitCurve;
+ }
+
+ template
+ inline
+ void ParametricCurveDigitizer3D::selfDisplay ( std::ostream & out ) const
+ {
+ out << "[ParametricCurveDigitizer3D]";
+ }
+
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Implementation of inline functions and external operators //
+
+/**
+ * Overloads 'operator<<' for displaying objects of class 'ParametricCurveDigitizer3D'.
+ * @param out the output stream where the object is written.
+ * @param object the object of class 'ParametricCurveDigitizer3D' to write.
+ * @return the output stream after the writing.
+ */
+template
+inline
+std::ostream&
+operator<< ( std::ostream & out,
+ const DGtal::ParametricCurveDigitizer3D & object )
+{
+ object.selfDisplay ( out );
+ return out;
+}
+
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/DGtal/curves/parametric/C3DParametricCurve.h b/src/DGtal/curves/parametric/C3DParametricCurve.h
new file mode 100755
index 0000000000..ed5760e1e9
--- /dev/null
+++ b/src/DGtal/curves/parametric/C3DParametricCurve.h
@@ -0,0 +1,155 @@
+/**
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **/
+
+#pragma once
+
+/**
+ * @file C3DParametricCurve.h
+ * @author Kacper Pluta (\c kacper.pluta@esiee.fr )
+ * Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France
+ *
+ * @date 2014/10/01
+ *
+ * Header file for concept ParametricCurve.cpp
+ *
+ * This file is part of the DGtal library.
+ */
+
+#if defined(C3DParametricCurve_RECURSES)
+#error Recursive header files inclusion detected in ParametricCurve.h
+#else // defined(C3DParametricCurve_RECURSES)
+/** Prevents recursive inclusion of headers. */
+#define C3DParametricCurve_RECURSES
+
+#if !defined C3DParametricCurve_h
+/** Prevents repeated inclusion of headers. */
+#define C3DParametricCurve_h
+
+//////////////////////////////////////////////////////////////////////////////
+// Inclusions
+#include
+#include "DGtal/base/Common.h"
+#include "DGtal/kernel/CSpace.h"
+//////////////////////////////////////////////////////////////////////////////
+
+namespace DGtal
+{
+namespace concepts
+{
+
+/////////////////////////////////////////////////////////////////////////////
+// class ParametricCurve
+/**
+Description of \b concept '\b ParametricCurve'
+@ingroup Concepts
+@brief Aim:
+
+### Refinement of
+
+### Associated types :
+
+### Notation
+ - \e X : A type that is a model of ParametricCurve
+ - \e x, \e y : object of type X
+
+### Definitions
+
+### Valid expressions and semantics
+
+| Name | Expression | Type requirements | Return type | Precondition | Semantics | Post condition | Complexity |
+|-------|------------|-------------------|---------------|--------------|-----------|----------------|------------|
+| | | | | | | | |
+
+### Invariants
+
+### Models
+
+ A dummy model (for concept checking) is CParametricCurveArchetype.
+
+### Notes
+
+@tparam T the type that should be a model of ParametricCurve.
+ */
+template
+struct C3DParametricCurve
+{
+ // ----------------------- Concept checks ------------------------------
+public:
+ typedef typename T::Space Space;
+ typedef typename T::RealPoint RealPoint;
+ typedef typename T::Point Point;
+ BOOST_CONCEPT_ASSERT(( concepts::CSpace ));
+ BOOST_STATIC_ASSERT(( Space::dimension == 3 ));
+ // check the presence of data members, operators and methods with
+ BOOST_CONCEPT_USAGE( C3DParametricCurve )
+ {
+ // check const methods.
+ checkConstConstraints();
+ }
+ void checkConstConstraints() const
+ {
+ ConceptUtils::sameType( x , self.xp ( 0.1f ) );
+ ConceptUtils::sameType( x , self.x ( 0.1f ) );
+ ConceptUtils::sameType( c , self.f ( x ) );
+ ConceptUtils::sameType( c , self.g ( x ) );
+ ConceptUtils::sameType( c , self.h ( x ) );
+ }
+ // ------------------------- Private Datas --------------------------------
+protected:
+ T self;
+ RealPoint x;
+ Point y;
+ double c;
+
+ // ------------------------- Internals ------------------------------------
+private:
+
+}; // end of concept ParametricCurve
+
+
+template
+struct C3DParametricCurveDecorator : public C3DParametricCurve< T >
+{
+ // ----------------------- Concept checks ------------------------------
+public:
+ // check the presence of data members, operators and methods with
+ BOOST_CONCEPT_USAGE( C3DParametricCurveDecorator )
+ {
+ // check const methods.
+ checkConstConstraints();
+ }
+ void checkConstConstraints() const
+ {
+ ConceptUtils::sameType( curve, self.curve );
+ }
+ // ------------------------- Private Datas --------------------------------
+protected:
+ T self;
+ typename T::TypeCurve curve;
+ // ------------------------- Private Datas --------------------------------
+ // ------------------------- Internals ------------------------------------
+}; // end of concept ParametricCurve
+
+ } // namespace concepts
+} // namespace DGtal
+
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#endif // !defined ParametricCurve_h
+
+#undef C3DParametricCurve_RECURSES
+#endif // else defined(ParametricCurve_RECURSES)
diff --git a/src/DGtal/curves/parametric/DecoratorCurveTransformation.h b/src/DGtal/curves/parametric/DecoratorCurveTransformation.h
new file mode 100755
index 0000000000..4353703d59
--- /dev/null
+++ b/src/DGtal/curves/parametric/DecoratorCurveTransformation.h
@@ -0,0 +1,204 @@
+/**
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **/
+
+#pragma once
+
+/**
+ * @file DecoratorCurveTransformation.h
+ * @author Kacper Pluta (\c kacper.pluta@esiee.fr )
+ * Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France
+ *
+ * @date 2014/10/10
+ *
+ * Header file for module DecoratorCurveTransformation.cpp
+ *
+ * This file is part of the DGtal library.
+ */
+
+#if defined(DecoratorCurveTransformation_RECURSES)
+#error Recursive header files inclusion detected in DecoratorCurveTransformation.h
+#else // defined(DecoratorCurveTransformation_RECURSES)
+/** Prevents recursive inclusion of headers. */
+#define DecoratorCurveTransformation_RECURSES
+
+#if !defined DecoratorCurveTransformation_h
+/** Prevents repeated inclusion of headers. */
+#define DecoratorCurveTransformation_h
+
+//////////////////////////////////////////////////////////////////////////////
+// Inclusions
+#include
+#include "DGtal/base/Common.h"
+#include "DGtal/curves/parametric/C3DParametricCurve.h"
+#include "DGtal/curves/ParametricCurveDigitizer3D.h"
+//////////////////////////////////////////////////////////////////////////////
+
+namespace DGtal
+{
+
+/////////////////////////////////////////////////////////////////////////////
+// class DecoratorCurveTransformation
+/**
+ * Description of class 'DecoratorCurveTransformation'
+ * \brief Aim:
+ */
+template
+class DecoratorCurveTransformation
+{
+ BOOST_CONCEPT_ASSERT(( concepts::C3DParametricCurve < TCurve > ));
+ // ----------------------- Standard services ------------------------------
+public:
+
+ typedef TCurve TypeCurve;
+ typedef typename TCurve::Space Space;
+ typedef typename Space::RealPoint RealPoint;
+ typedef typename Space::Point Point;
+
+ DecoratorCurveTransformation ( const TCurve &, const TTransfromation &, const TInverseTransformation & );
+ /**
+ * Destructor.
+ */
+ ~DecoratorCurveTransformation() {}
+
+ // ----------------------- Interface --------------------------------------
+public:
+
+ const TCurve & curve;
+
+ /**
+ * @param t any angle between 0 and k*Pi.
+ *
+ * @return the vector (x(t),y(t), z(t))
+ */
+ RealPoint x ( double t ) const;
+
+ /**
+ * @param t any angle between 0 and k*Pi.
+ *
+ * @return the vector (x(t)',y(t)', z(t)')
+ */
+ RealPoint xp ( double t ) const;
+
+ /**
+ * @brief inverse function of x
+ * @param p = x(t)
+ * @return t
+ */
+ double f ( const RealPoint & p ) const;
+
+ /**
+ * @brief inverse function of y
+ * @param p = x(t)[
+ * @return t
+ */
+ double g ( const RealPoint & p ) const;
+
+ /**
+ * @brief inverse function of z
+ * @param p = x(t)
+ * @return t
+ */
+ double h ( const RealPoint & ) const;
+
+ /**
+ * Writes/Displays the object on an output stream.
+ * @param out the output stream where the object is written.
+ */
+ void selfDisplay ( std::ostream & out ) const;
+
+ /**
+ * Checks the validity/consistency of the object.
+ * @return 'true' if the object is valid, 'false' otherwise.
+ */
+ bool isValid() const;
+
+ // ------------------------- Protected Datas ------------------------------
+private:
+ // ------------------------- Private Datas --------------------------------
+private:
+
+ // ------------------------- Hidden services ------------------------------
+protected:
+
+ /**
+ * Constructor.
+ * Forbidden by default (protected to avoid g++ warnings).
+ */
+ DecoratorCurveTransformation();
+
+private:
+
+ /**
+ * Copy constructor.
+ * @param other the object to clone.
+ * Forbidden by default.
+ */
+ DecoratorCurveTransformation ( const DecoratorCurveTransformation & other );
+
+ /**
+ * Assignment.
+ * @param other the object to copy.
+ * @return a reference on 'this'.
+ * Forbidden by default.
+ */
+ DecoratorCurveTransformation & operator= ( const DecoratorCurveTransformation & other );
+
+ // ------------------------- Internals ------------------------------------
+private:
+ const TTransfromation & trans;
+ const TInverseTransformation & inverse;
+
+}; // end of class DecoratorCurveTransformation
+
+
+/**
+ * Overloads 'operator<<' for displaying objects of class 'DecoratorCurveTransformation'.
+ * @param out the output stream where the object is written.
+ * @param object the object of class 'DecoratorCurveTransformation' to write.
+ * @return the output stream after the writing.
+ */
+template
+inline
+std::ostream&
+operator<< ( std::ostream & out, const DecoratorCurveTransformation< TCurve, TTransfromation, TInverseTransformation > & object );
+
+
+template
+class ParametricCurveDigitizer3DDecorator : public ParametricCurveDigitizer3D
+{
+ BOOST_CONCEPT_ASSERT(( concepts::C3DParametricCurveDecorator< TParametricCurve > ));
+
+private:
+ virtual unsigned char findMainAxis ( const char & blockAxis, const double & i );
+};
+
+} // namespace DGtal
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Includes inline functions.
+#if !defined(BUILD_INLINE)
+#include "DGtal/curves/parametric/DecoratorCurveTransformation.ih"
+#endif
+
+
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#endif // !defined DecoratorCurveTransformation_h
+
+#undef DecoratorCurveTransformation_RECURSES
+#endif // else defined(DecoratorCurveTransformation_RECURSES)
diff --git a/src/DGtal/curves/parametric/DecoratorCurveTransformation.ih b/src/DGtal/curves/parametric/DecoratorCurveTransformation.ih
new file mode 100755
index 0000000000..3f9f47a05e
--- /dev/null
+++ b/src/DGtal/curves/parametric/DecoratorCurveTransformation.ih
@@ -0,0 +1,123 @@
+/**
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **/
+
+/**
+ * @file DecoratorCurveTransformation.ih
+ * @author Kacper Pluta (\c kacper.pluta@esiee.fr )
+ * Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France
+ *
+ * @date 2014/10/10
+ *
+ * Implementation of inline methods defined in DecoratorCurveTransformation.h
+ *
+ * This file is part of the DGtal library.
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+// IMPLEMENTATION of inline methods.
+///////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+template
+inline
+DGtal::DecoratorCurveTransformation::DecoratorCurveTransformation
+( const TCurve & c, const TTransfromation & t, const TInverseTransformation & i ) : curve(c), trans(t), inverse(i) {}
+
+///////////////////////////////////////////////////////////////////////////////
+// Implementation of inline methods //
+template
+inline
+typename DGtal::DecoratorCurveTransformation::RealPoint
+DGtal::DecoratorCurveTransformation::x ( const double t ) const
+{
+ return trans ( curve.x ( t ) );
+}
+
+template
+inline
+typename DGtal::DecoratorCurveTransformation::RealPoint
+DGtal::DecoratorCurveTransformation::xp ( const double t ) const
+{
+ return trans ( curve.xp ( t ) );
+}
+
+template
+inline
+double DGtal::DecoratorCurveTransformation::f
+( const typename DGtal::DecoratorCurveTransformation::RealPoint & point ) const
+{
+ return curve.f ( inverse ( point ) );
+}
+
+template
+inline
+double DGtal::DecoratorCurveTransformation::g
+( const typename DGtal::DecoratorCurveTransformation::RealPoint & point ) const
+{
+ return curve.g ( inverse ( point ) );
+}
+
+template
+inline
+double DGtal::DecoratorCurveTransformation::h
+( const typename DGtal::DecoratorCurveTransformation::RealPoint & point ) const
+{
+ return curve.h ( inverse ( point ) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Implementation of inline functions and external operators //
+
+/**
+ * Overloads 'operator<<' for displaying objects of class 'DecoratorCurveTransformation'.
+ * @param out the output stream where the object is written.
+ * @param object the object of class 'DecoratorCurveTransformation' to write.
+ * @return the output stream after the writing.
+ */
+template
+inline
+std::ostream&
+DGtal::operator<< ( std::ostream & out,
+ const DecoratorCurveTransformation < TCurve, TTransfromation, TInverseTransformation > & object )
+{
+ object.selfDisplay ( out );
+ return out;
+}
+
+template
+inline
+unsigned char DGtal::ParametricCurveDigitizer3DDecorator::findMainAxis ( const char & blockAxis, const double & i )
+{
+ typename ParametricCurveDigitizer3D::RealVector value;
+ value[0] = std::fabs ( ParametricCurveDigitizer3D::curve->curve.xp ( i )[0] );
+ value[1] = std::fabs ( ParametricCurveDigitizer3D::curve->curve.xp ( i )[1] );
+ value[2] = std::fabs ( ParametricCurveDigitizer3D::curve->curve.xp ( i )[2] );
+
+ if ( blockAxis != -1 )
+ value[blockAxis] = FLT_MIN;
+
+ if ( value[0] > value[1] && value[0] > value[2] )
+ return 0;
+ else if ( value[1] > value[0] && value[1] > value[2] )
+ return 1;
+ else
+ return 2;
+}
+
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/DGtal/curves/parametric/EllipticHelix.h b/src/DGtal/curves/parametric/EllipticHelix.h
new file mode 100755
index 0000000000..17b690ec7a
--- /dev/null
+++ b/src/DGtal/curves/parametric/EllipticHelix.h
@@ -0,0 +1,192 @@
+/**
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **/
+
+#pragma once
+
+/**
+ * @file EllipticHelix.h
+ * @author Kacper Pluta (\c kacper.pluta@esiee.fr )
+ * Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France
+ *
+ * @date 2014/10/01
+ *
+ * Header file for module EllipticHelix.cpp
+ *
+ * This file is part of the DGtal library.
+ */
+
+#if defined(EllipticHelix_RECURSES)
+#error Recursive header files inclusion detected in EllipticHelix.h
+#else // defined(EllipticHelix_RECURSES)
+/** Prevents recursive inclusion of headers. */
+#define EllipticHelix_RECURSES
+
+#if !defined EllipticHelix_h
+/** Prevents repeated inclusion of headers. */
+#define EllipticHelix_h
+
+//////////////////////////////////////////////////////////////////////////////
+// Inclusions
+#include
+#include
+#include "DGtal/base/Common.h"
+//////////////////////////////////////////////////////////////////////////////
+
+namespace DGtal
+{
+
+/////////////////////////////////////////////////////////////////////////////
+// class EllipticHelix
+/**
+ * Description of class 'EllipticHelix'
+ * \brief Aim:
+ */
+template
+class EllipticHelix
+{
+ // ----------------------- Standard services ------------------------------
+public:
+ typedef TSpace Space;
+ typedef typename TSpace::RealPoint RealPoint;
+ typedef typename TSpace::Point Point;
+
+ /**
+ * Destructor.
+ */
+ ~EllipticHelix() {}
+ /**
+ * Constructor.
+ * @param rr small radius of the helix
+ * @param rl big radius of the helix
+ * @param bb distance between each turn.
+ */
+ EllipticHelix ( double rr, double rl, double bb );
+
+ // ----------------------- Interface --------------------------------------
+public:
+
+ /**
+ * @param t any angle between 0 and k*Pi.
+ *
+ * @return the vector (x(t),y(t), z(t))
+ */
+ RealPoint x ( double t ) const;
+
+ /**
+ * @param t any angle between 0 and k*Pi.
+ *
+ * @return the vector (x(t)',y(t)', z(t)')
+ */
+ RealPoint xp ( double t ) const;
+
+ /**
+ * @brief inverse function of x
+ * @param p = x(t)
+ * @return t
+ */
+ double f ( const RealPoint & p ) const;
+
+ /**
+ * @brief inverse function of y
+ * @param p = x(t)[
+ * @return t
+ */
+ double g ( const RealPoint & p ) const;
+
+ /**
+ * @brief inverse function of z
+ * @param p = x(t)
+ * @return t
+ */
+ double h ( const RealPoint & p ) const;
+
+ /**
+ * Writes/Displays the object on an output stream.
+ * @param out the output stream where the object is written.
+ */
+ void selfDisplay ( std::ostream & out ) const;
+
+ /**
+ * Checks the validity/consistency of the object.
+ * @return 'true' if the object is valid, 'false' otherwise.
+ */
+ bool isValid() const;
+
+ // ------------------------- Protected Datas ------------------------------
+private:
+ // ------------------------- Private Datas --------------------------------
+private:
+ double r1, r2, b;
+ // ------------------------- Hidden services ------------------------------
+protected:
+
+ /**
+ * Constructor.
+ * Forbidden by default (protected to avoid g++ warnings).
+ */
+ EllipticHelix();
+
+private:
+
+ /**
+ * Copy constructor.
+ * @param other the object to clone.
+ * Forbidden by default.
+ */
+ EllipticHelix ( const EllipticHelix & other );
+
+ /**
+ * Assignment.
+ * @param other the object to copy.
+ * @return a reference on 'this'.
+ * Forbidden by default.
+ */
+ EllipticHelix & operator= ( const EllipticHelix & other );
+
+ // ------------------------- Internals ------------------------------------
+private:
+
+}; // end of class EllipticHelix
+
+
+/**
+ * Overloads 'operator<<' for displaying objects of class 'EllipticHelix'.
+ * @param out the output stream where the object is written.
+ * @param object the object of class 'EllipticHelix' to write.
+ * @return the output stream after the writing.
+ */
+template
+std::ostream&
+operator<< ( std::ostream & out, const EllipticHelix & object );
+
+
+} // namespace DGtal
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Includes inline functions.
+#if !defined(BUILD_INLINE)
+#include "DGtal/curves/parametric/EllipticHelix.ih"
+#endif
+
+
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#endif // !defined EllipticHelix_h
+
+#undef EllipticHelix_RECURSES
+#endif // else defined(EllipticHelix_RECURSES)
diff --git a/src/DGtal/curves/parametric/EllipticHelix.ih b/src/DGtal/curves/parametric/EllipticHelix.ih
new file mode 100755
index 0000000000..0cdb358761
--- /dev/null
+++ b/src/DGtal/curves/parametric/EllipticHelix.ih
@@ -0,0 +1,149 @@
+/**
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **/
+
+/**
+ * @file EllipticHelix.ih
+ * @author Kacper Pluta (\c kacper.pluta@esiee.fr )
+ * Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France
+ *
+ * @date 2014/10/01
+ *
+ * Implementation of inline methods defined in EllipticHelix.h
+ *
+ * This file is part of the DGtal library.
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+// IMPLEMENTATION of inline methods.
+///////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Implementation of inline methods //
+template
+inline
+DGtal::EllipticHelix::EllipticHelix ( double rr, double rl, double bb ) : r1 ( rr ), r2 ( rl ) , b ( bb ) {}
+
+template < typename T>
+inline
+typename DGtal::EllipticHelix::RealPoint DGtal::EllipticHelix::x ( const double t ) const
+{
+ return DGtal::EllipticHelix::RealPoint ( r1 * std::cos ( t ), r2 * std::sin ( t ), b * t );
+}
+
+template < typename T>
+inline
+typename DGtal::EllipticHelix::RealPoint DGtal::EllipticHelix