Lines Matching refs:spline
19 * \class Spline
20 * \brief A class representing multi-dimensional spline curves.
23 * point of the B-spline is associated with a basis function
35 class Spline
38 typedef _Scalar Scalar; /*!< The spline curve's scalar type. */
39 enum { Dimension = _Dim /*!< The spline curve's dimension. */ };
40 enum { Degree = _Degree /*!< The spline curve's degree. */ };
42 /** \brief The point type the spline is representing. */
43 typedef typename SplineTraits<Spline>::PointType PointType;
46 typedef typename SplineTraits<Spline>::KnotVectorType KnotVectorType;
49 typedef typename SplineTraits<Spline>::BasisVectorType BasisVectorType;
51 /** \brief The data type representing the spline's control points. */
52 typedef typename SplineTraits<Spline>::ControlPointVectorType ControlPointVectorType;
55 * \brief Creates a (constant) zero spline.
58 Spline()
70 * \brief Creates a spline from a knot vector and control points.
71 * \param knots The spline's knot vector.
72 * \param ctrls The spline's control point vector.
75 Spline(const OtherVectorType& knots, const OtherArrayType& ctrls) : m_knots(knots), m_ctrls(ctrls) {}
79 * \param spline The input spline.
82 Spline(const Spline<Scalar, Dimension, OtherDegree>& spline) :
83 m_knots(spline.knots()), m_ctrls(spline.ctrls()) {}
86 * \brief Returns the knots of the underlying spline.
91 * \brief Returns the knots of the underlying spline.
96 * \brief Returns the spline value at a given site \f$u\f$.
103 * \param u Parameter \f$u \in [0;1]\f$ at which the spline is evaluated.
104 * \return The spline value at the given location \f$u\f$.
109 * \brief Evaluation of spline derivatives of up-to given order.
117 * \param u Parameter \f$u \in [0;1]\f$ at which the spline derivative is evaluated.
120 typename SplineTraits<Spline>::DerivativeType
124 * \copydoc Spline::derivatives
129 typename SplineTraits<Spline,DerivativeOrder>::DerivativeType
137 * spline degree.
148 typename SplineTraits<Spline>::BasisVectorType
152 * \brief Computes the non-zero spline basis function derivatives up to given order.
164 typename SplineTraits<Spline>::BasisDerivativeType
168 * \copydoc Spline::basisFunctionDerivatives
173 typename SplineTraits<Spline,DerivativeOrder>::BasisDerivativeType
177 * \brief Returns the spline degree.
190 static DenseIndex Span(typename SplineTraits<Spline>::Scalar u, DenseIndex degree, const typename SplineTraits<Spline>::KnotVectorType& knots);
193 * \brief Returns the spline's non-zero basis functions.
201 * \param degree The degree of the underlying spline.
202 * \param knots The underlying spline's knot vector.
213 DenseIndex Spline<_Scalar, _Dim, _Degree>::Span(
214 typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::Scalar u,
216 const typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::KnotVectorType& knots)
225 typename Spline<_Scalar, _Dim, _Degree>::BasisVectorType
226 Spline<_Scalar, _Dim, _Degree>::BasisFunctions(
227 typename Spline<_Scalar, _Dim, _Degree>::Scalar u,
229 const typename Spline<_Scalar, _Dim, _Degree>::KnotVectorType& knots)
231 typedef typename Spline<_Scalar, _Dim, _Degree>::BasisVectorType BasisVectorType;
234 const DenseIndex i = Spline::Span(u, degree, knots);
261 DenseIndex Spline<_Scalar, _Dim, _Degree>::degree() const
270 DenseIndex Spline<_Scalar, _Dim, _Degree>::span(Scalar u) const
272 return Spline::Span(u, degree(), knots());
276 typename Spline<_Scalar, _Dim, _Degree>::PointType Spline<_Scalar, _Dim, _Degree>::operator()(Scalar u) const
278 enum { Order = SplineTraits<Spline>::OrderAtCompileTime };
292 void derivativesImpl(const SplineType& spline, typename SplineType::Scalar u, DenseIndex order, DerivativeType& der)
302 const DenseIndex p = spline.degree();
303 const DenseIndex span = spline.span(u);
310 const BasisDerivativeType basis_func_ders = spline.template basisFunctionDerivatives<DerivativeOrder>(u, n+1);
316 const Block<const ControlPointVectorType,Dimension,Order> ctrl_pts(spline.ctrls(),0,span-p,Dimension,p+1);
322 typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::DerivativeType
323 Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
325 typename SplineTraits< Spline >::DerivativeType res;
332 typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::DerivativeType
333 Spline<_Scalar, _Dim, _Degree>::derivatives(Scalar u, DenseIndex order) const
335 typename SplineTraits< Spline, DerivativeOrder >::DerivativeType res;
341 typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisVectorType
342 Spline<_Scalar, _Dim, _Degree>::basisFunctions(Scalar u) const
344 return Spline::BasisFunctions(u, degree(), knots());
350 void basisFunctionDerivativesImpl(const SplineType& spline, typename SplineType::Scalar u, DenseIndex order, DerivativeType& N_)
358 const KnotVectorType& U = spline.knots();
360 const DenseIndex p = spline.degree();
361 const DenseIndex span = spline.span(u);
455 typename SplineTraits< Spline<_Scalar, _Dim, _Degree> >::BasisDerivativeType
456 Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
458 typename SplineTraits< Spline >::BasisDerivativeType der;
465 typename SplineTraits< Spline<_Scalar, _Dim, _Degree>, DerivativeOrder >::BasisDerivativeType
466 Spline<_Scalar, _Dim, _Degree>::basisFunctionDerivatives(Scalar u, DenseIndex order) const
468 typename SplineTraits< Spline, DerivativeOrder >::BasisDerivativeType der;