CubicFunction.h 1.71 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
* \file ExactCubic.h
* \brief Definition of a cubic spline.
* \author Steve T.
* \version 0.1
* \date 06/17/2013
*
* This file contains definitions for the CubicFunction class.
* It allows the creation and evaluation of natural 3D
* smooth cubic splines
*/


#ifndef _CLASS_CUBICFUNCTIONIMP
#define _CLASS_CUBICFUNCTIONIMP

#include "Exports.h"
#include "MathDefs.h"
19
#include "Curve_ABC.h"
20
21
22
23
24
25
26
27
28
29

namespace spline
{
	class SplineVisitor;

	/// \class CubicFunction
	/// \brief Represents a cubic spline defined on the interval 
	/// [tBegin, tEnd]. It follows the equation
	/// x(t) = a + b(t - tBegin) + c(t - tBegin)^2 + d(t - tBegin)^3 
	///
30
	class CubicFunction : public Curve_ABC
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
	{
/* Constructors - destructors */
	public:
		///\brief Constructor
		SPLINE_API CubicFunction(const Vector3& /*a*/, const Vector3& /*b*/, const Vector3& /*c*/, const Vector3& /*d*/, const Real /*tBegin*/, const Real /*tEnd*/);

		///\brief Destructor
		SPLINE_API ~CubicFunction();

	private:
		CubicFunction(const CubicFunction&);
		CubicFunction& operator=(const CubicFunction&);
/* Constructors - destructors */

/*Operations*/
	public:
		///  \brief Evaluation of the cubic spline at time t.
		///  \param t : the time when to evaluate the spine
		///  \param result : a reference to the Point set to the x(t)
50
		SPLINE_API virtual bool Evaluate(const Real /*t*/, Vector3& /*result*/) const;
51
/*Operations*/
52
		
53
54
/*Helpers*/
	public:
55
56
		SPLINE_API Real virtual MinBound() const;
		SPLINE_API Real virtual MaxBound() const;
57
58
59
60
61
62
63
64
65
/*Helpers*/

/*Attributes*/
	private:
		const Vector3 a_, b_, c_ ,d_;
		const Real tBegin_, tEnd_;
/*Attributes*/
	}; //class CubicFunction
}
66
67
#endif //_CLASS_CUBICFUNCTIONIMP