00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef EIGEN_SPLINES_FWD_H
00026 #define EIGEN_SPLINES_FWD_H
00027
00028 #include <Eigen/Core>
00029
00030 namespace Eigen
00031 {
00032 template <typename Scalar, int Dim, int Degree = Dynamic> class Spline;
00033
00034 template < typename SplineType, int DerivativeOrder = Dynamic > struct SplineTraits {};
00035
00040 template <typename _Scalar, int _Dim, int _Degree>
00041 struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, Dynamic >
00042 {
00043 typedef _Scalar Scalar;
00044 enum { Dimension = _Dim };
00045 enum { Degree = _Degree };
00046
00047 enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 };
00048 enum { NumOfDerivativesAtCompileTime = OrderAtCompileTime };
00049
00051 typedef Array<Scalar,1,OrderAtCompileTime> BasisVectorType;
00052
00054 typedef Array<Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
00055
00057 typedef Array<Scalar,Dimension,Dynamic,ColMajor,Dimension,NumOfDerivativesAtCompileTime> DerivativeType;
00058
00060 typedef Array<Scalar,Dimension,1> PointType;
00061
00063 typedef Array<Scalar,1,Dynamic> KnotVectorType;
00064
00066 typedef Array<Scalar,Dimension,Dynamic> ControlPointVectorType;
00067 };
00068
00075 template < typename _Scalar, int _Dim, int _Degree, int _DerivativeOrder >
00076 struct SplineTraits< Spline<_Scalar, _Dim, _Degree>, _DerivativeOrder > : public SplineTraits< Spline<_Scalar, _Dim, _Degree> >
00077 {
00078 enum { OrderAtCompileTime = _Degree==Dynamic ? Dynamic : _Degree+1 };
00079 enum { NumOfDerivativesAtCompileTime = _DerivativeOrder==Dynamic ? Dynamic : _DerivativeOrder+1 };
00080
00082 typedef Array<_Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime> BasisDerivativeType;
00083
00085 typedef Array<_Scalar,_Dim,Dynamic,ColMajor,_Dim,NumOfDerivativesAtCompileTime> DerivativeType;
00086 };
00087
00089 typedef Spline<float,2> Spline2f;
00090
00092 typedef Spline<float,3> Spline3f;
00093
00095 typedef Spline<double,2> Spline2d;
00096
00098 typedef Spline<double,3> Spline3d;
00099 }
00100
00101 #endif // EIGEN_SPLINES_FWD_H