Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gunu Namespace Reference


Compounds

class  gunu::bezier_ninfo
class  gunu::IntersectInfo
class  gunu::IntersectionLineInfo
class  gunu::is_uv_point
struct  gunu::LinearizeCallbackData
class  gunu::minbbox_rec
 utility class for finding a rotation, so that the volume of the bounding box of a set of points gets minimal volume. More...

struct  gunu::patch_ninfo
class  gunu::point_ninfo
struct  gunu::pts_point
struct  gunu::SurfaceInfo
struct  gunu::TessCbData
class  gunu::TessInfo
struct  gunu::vertex_convert_cache

Functions

template<class T> int FindSpan (const T u, const int n, const int p, const Ptr< T > &U)
template int FindSpan (const float u, const int n, const int p, const Ptr< float > &U)
template int FindSpan (const double u, const int n, const int p, const Ptr< double > &U)
template<class T> int FindSpanMultip (const T u, const int n, const int p, const Ptr< T > &U, int *s)
template int FindSpanMultip (const float u, const int n, const int p, const Ptr< float > &U, int *s)
template int FindSpanMultip (const double u, const int n, const int p, const Ptr< double > &U, int *s)
template<class T> GULAPI bool ValidateKnotVec (const int n, const int p, const Ptr< T > &knt, bool &is_clamped, bool &is_normalized)
template GULAPI bool ValidateKnotVec (const int n, const int p, const Ptr< float > &knt, bool &is_clamped, bool &is_normalized)
template GULAPI bool ValidateKnotVec (const int n, const int p, const Ptr< double > &knt, bool &is_clamped, bool &is_normalized)
template<class T> GULAPI T CalcBasisFunction (int p, int i, T u, int n, const Ptr< T > &U)
template GULAPI float CalcBasisFunction (int p, int i, float u, int n, const Ptr< float > &U)
template GULAPI double CalcBasisFunction (int p, int i, double u, int n, const Ptr< double > &U)
template<class T> void CalcBasisFunctions (const T u, const int i, const int p, const Ptr< T > &U, Ptr< T > &N)
template void CalcBasisFunctions (const float u, const int i, const int p, const Ptr< float > &U, Ptr< float > &N)
template void CalcBasisFunctions (const double u, const int i, const int p, const Ptr< double > &U, Ptr< double > &N)
template<class T> GULAPI void UniformKnotVector (const int n, const int p, Ptr< T > &U)
template GULAPI void UniformKnotVector (const int n, const int p, Ptr< float > &U)
template GULAPI void UniformKnotVector (const int n, const int p, Ptr< double > &U)
template<class T, class HP, class EP> GULAPI void CurvePoint (const T u, const int n, const int p, const Ptr< T > &U, const Ptr< HP > &Pw, EP *C)
template GULAPI void CurvePoint (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< hpoint< float > > &Pw, point< float > *C)
template GULAPI void CurvePoint (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< hpoint< double > > &Pw, point< double > *C)
template GULAPI void CurvePoint (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< hpoint2< float > > &Pw, point2< float > *C)
template GULAPI void CurvePoint (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< hpoint2< double > > &Pw, point2< double > *C)
template GULAPI void CurvePoint (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< point< float > > &Pw, point< float > *C)
template GULAPI void CurvePoint (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< point< double > > &Pw, point< double > *C)
template GULAPI void CurvePoint (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< point2< float > > &Pw, point2< float > *C)
template GULAPI void CurvePoint (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< point2< double > > &Pw, point2< double > *C)
template<class T, class HP, class EP> GULAPI void SurfacePoint (const T u, const T v, const int nu, const int pu, const Ptr< T > &U, const int nv, const int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, EP *retS)
template GULAPI void SurfacePoint (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, point< float > *retS)
template GULAPI void SurfacePoint (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, point< double > *retS)
template GULAPI void SurfacePoint (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, point1< float > *retS)
template GULAPI void SurfacePoint (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, point1< double > *retS)
template GULAPI void SurfacePoint (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, point< float > *retS)
template GULAPI void SurfacePoint (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, point< double > *retS)
template GULAPI void SurfacePoint (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, point1< float > *retS)
template GULAPI void SurfacePoint (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, point1< double > *retS)
template<class T, class HP, class EP> GULAPI void BezierSurfacePoint (const T u, const T v, const int pu, const Ptr< T > &U, const int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, EP *retS)
template GULAPI void BezierSurfacePoint (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, point< float > *retS)
template GULAPI void BezierSurfacePoint (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, point< double > *retS)
template GULAPI void BezierSurfacePoint (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, point1< float > *retS)
template GULAPI void BezierSurfacePoint (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, point1< double > *retS)
template GULAPI void BezierSurfacePoint (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, point< float > *retS)
template GULAPI void BezierSurfacePoint (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, point< double > *retS)
template GULAPI void BezierSurfacePoint (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, point1< float > *retS)
template GULAPI void BezierSurfacePoint (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, point1< double > *retS)
template<class T> int GetKnotMultiplicity (const T u, const Ptr< T > &U, const int span)
template<class T> void NormalizeKnotVector (const int n, const int p, Ptr< T > &U)
template<class T> void NormalizeKnotVector (const int n, const int p, const Ptr< T > &U, T &offsetU, T &scaleU, Ptr< T > &retU)
template<class T> void BezierKnotVector (const int p, Ptr< T > &U)
template<class T> void MirrorKnotVector (int nU, Ptr< T > &U)
template<class EP> void MirrorVector (int nP, Ptr< EP > &P)
template<class EP> void MirrorColumns (int nRows, int nCols, Ptr< Ptr< EP > > &P)
template<class T, class HP> void EvaluateCurve (const curve< T, HP > *Curv, const T u, point< T > *C)
template<class T, class EP> void BezierBSPCurveDerivatives (const T u, const int p, const Ptr< T > &U, const Ptr< EP > &Pw, const int d, Ptr< EP > &CK)
template void BezierBSPCurveDerivatives (const float u, const int p, const Ptr< float > &U, const Ptr< point< float > > &Pw, const int d, Ptr< point< float > > &CK)
template void BezierBSPCurveDerivatives (const double u, const int p, const Ptr< double > &U, const Ptr< point< double > > &Pw, const int d, Ptr< point< double > > &CK)
template void BezierBSPCurveDerivatives (const float u, const int p, const Ptr< float > &U, const Ptr< point2< float > > &Pw, const int d, Ptr< point2< float > > &CK)
template void BezierBSPCurveDerivatives (const double u, const int p, const Ptr< double > &U, const Ptr< point2< double > > &Pw, const int d, Ptr< point2< double > > &CK)
template<class T, class EP> void BezierBSPSurfaceDerivatives (const T u, const T v, const int pu, const Ptr< T > &U, const int pv, const Ptr< T > &V, const Ptr< Ptr< EP > > &Pw, const int d, Ptr< Ptr< EP > > &SKL)
template void BezierBSPSurfaceDerivatives (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, const int d, Ptr< Ptr< point< float > > > &SKL)
template void BezierBSPSurfaceDerivatives (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, const int d, Ptr< Ptr< point< double > > > &SKL)
template void BezierBSPSurfaceDerivatives (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, const int d, Ptr< Ptr< hpoint< float > > > &SKL)
template void BezierBSPSurfaceDerivatives (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, const int d, Ptr< Ptr< hpoint< double > > > &SKL)
template<class T, class HP, class EP> void BezierCurveDerivatives (const T u, const int p, const Ptr< T > &U, const Ptr< HP > &Pw, const int d, Ptr< EP > &CK)
template void BezierCurveDerivatives (const float u, const int p, const Ptr< float > &U, const Ptr< hpoint< float > > &Pw, const int d, Ptr< point< float > > &CK)
template void BezierCurveDerivatives (const double u, const int p, const Ptr< double > &U, const Ptr< hpoint< double > > &Pw, const int d, Ptr< point< double > > &CK)
template void BezierCurveDerivatives (const float u, const int p, const Ptr< float > &U, const Ptr< hpoint2< float > > &Pw, const int d, Ptr< point2< float > > &CK)
template void BezierCurveDerivatives (const double u, const int p, const Ptr< double > &U, const Ptr< hpoint2< double > > &Pw, const int d, Ptr< point2< double > > &CK)
template<class T, class HP, class EP> void BezierSurfaceDerivatives (const T u, const T v, const int pu, const Ptr< T > &U, const int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, const int d, Ptr< Ptr< EP > > &SKL)
template void BezierSurfaceDerivatives (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, const int d, Ptr< Ptr< point< float > > > &SKL)
template void BezierSurfaceDerivatives (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, const int d, Ptr< Ptr< point< double > > > &SKL)
template void BezierSurfaceDerivatives (const float u, const float v, const int pu, const Ptr< float > &U, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, const int d, Ptr< Ptr< point1< float > > > &SKL)
template void BezierSurfaceDerivatives (const double u, const double v, const int pu, const Ptr< double > &U, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, const int d, Ptr< Ptr< point1< double > > > &SKL)
template<class T, class EP> void BezierBSPCurveDerivatives (const T u, const int p, const Ptr< T > &U, const Ptr< EP > &Pw, const int d, EP *CK)
template<class T, class HP, class EP> void BezierCurveDerivatives (const T u, const int p, const Ptr< T > &U, const Ptr< HP > &Pw, const int d, EP *CK)
template<class T, class EP> void BezierSurfaceDerivatives (const T u, const T v, const int pu, const Ptr< T > &U, const int pv, const Ptr< T > &V, const Ptr< Ptr< EP > > &Pw, const int d, Ptr< Ptr< EP > > &SKL)
template<class T> void CalcDersBasisFuns (const T u, const int i, const int p, const int n, const Ptr< T > &U, Ptr< Ptr< T > > &ders)
template void CalcDersBasisFuns (const float u, const int i, const int p, const int n, const Ptr< float > &U, Ptr< Ptr< float > > &ders)
template void CalcDersBasisFuns (const double u, const int i, const int p, const int n, const Ptr< double > &U, Ptr< Ptr< double > > &ders)
template<class T, class EP> GULAPI void BSPCurveDerivatives (const T u, const int n, const int p, const gul::Ptr< T > &U, const gul::Ptr< EP > &Pw, const int d, gul::Ptr< EP > &CK)
template GULAPI void BSPCurveDerivatives (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< point< float > > &Pw, const int d, Ptr< point< float > > &CK)
template GULAPI void BSPCurveDerivatives (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< point< double > > &Pw, const int d, Ptr< point< double > > &CK)
template GULAPI void BSPCurveDerivatives (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< point2< float > > &Pw, const int d, Ptr< point2< float > > &CK)
template GULAPI void BSPCurveDerivatives (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< point2< double > > &Pw, const int d, Ptr< point2< double > > &CK)
template<class T, class EP> void BSPSurfaceDerivatives (const T u, const T v, const int nu, const int pu, const Ptr< T > &U, const int nv, const int pv, const Ptr< T > &V, const Ptr< Ptr< EP > > &Pw, const int d, Ptr< Ptr< EP > > &SKL)
template void BSPSurfaceDerivatives (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, const int d, Ptr< Ptr< point< float > > > &SKL)
template void BSPSurfaceDerivatives (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, const int d, Ptr< Ptr< point< double > > > &SKL)
template void BSPSurfaceDerivatives (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, const int d, Ptr< Ptr< hpoint< float > > > &SKL)
template void BSPSurfaceDerivatives (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, const int d, Ptr< Ptr< hpoint< double > > > &SKL)
template<class T, class HP, class EP> GULAPI void CurveDerivatives (const T u, const int n, const int p, const Ptr< T > &U, const Ptr< HP > &Pw, const int d, Ptr< EP > &CK)
template GULAPI void CurveDerivatives (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< hpoint< float > > &Pw, const int d, Ptr< point< float > > &CK)
template GULAPI void CurveDerivatives (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< hpoint< double > > &Pw, const int d, Ptr< point< double > > &CK)
template GULAPI void CurveDerivatives (const float u, const int n, const int p, const Ptr< float > &U, const Ptr< hpoint2< float > > &Pw, const int d, Ptr< point2< float > > &CK)
template GULAPI void CurveDerivatives (const double u, const int n, const int p, const Ptr< double > &U, const Ptr< hpoint2< double > > &Pw, const int d, Ptr< point2< double > > &CK)
template<class T, class HP, class EP> void SurfaceDerivatives (const T u, const T v, const int nu, const int pu, const Ptr< T > &U, const int nv, const int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, const int d, Ptr< Ptr< EP > > &SKL)
template void SurfaceDerivatives (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, const int d, Ptr< Ptr< point< float > > > &SKL)
template void SurfaceDerivatives (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, const int d, Ptr< Ptr< point< double > > > &SKL)
template void SurfaceDerivatives (const float u, const float v, const int nu, const int pu, const Ptr< float > &U, const int nv, const int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, const int d, Ptr< Ptr< point1< float > > > &SKL)
template void SurfaceDerivatives (const double u, const double v, const int nu, const int pu, const Ptr< double > &U, const int nv, const int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, const int d, Ptr< Ptr< point1< double > > > &SKL)
template<class T, class HP> void CalcNormal_U0V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< HP > > &Pw, point< T > *Normal)
template void CalcNormal_U0V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U0V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U0V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< double > > > &Pw, point< double > *Normal)
template void CalcNormal_U0V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< double > > > &Pw, point< double > *Normal)
template<class T, class HP> void CalcNormal_U1V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< HP > > &Pw, point< T > *Normal)
template void CalcNormal_U1V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U1V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U1V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< double > > > &Pw, point< double > *Normal)
template void CalcNormal_U1V0 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< double > > > &Pw, point< double > *Normal)
template<class T, class HP> void CalcNormal_U0V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< HP > > &Pw, point< T > *Normal)
template void CalcNormal_U0V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U0V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U0V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< double > > > &Pw, point< double > *Normal)
template void CalcNormal_U0V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< double > > > &Pw, point< double > *Normal)
template<class T, class HP> void CalcNormal_U1V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< HP > > &Pw, point< T > *Normal)
template void CalcNormal_U1V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U1V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< float > > > &Pw, point< float > *Normal)
template void CalcNormal_U1V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< hpoint< double > > > &Pw, point< double > *Normal)
template void CalcNormal_U1V1 (const int nu, const int pu, const int nv, const int pv, const Ptr< Ptr< point< double > > > &Pw, point< double > *Normal)
template<class T, class EP> GULAPI void CurveDerivatives (const T u, const int n, const int p, const Ptr< T > &U, const Ptr< EP > &Pw, const int d, Ptr< EP > &CK)
template<class T, class HP> void SplitCurve (const curve< T, HP > *Curve, const T u, curve< T, HP > *C1, curve< T, HP > *C2)
template void SplitCurve (const curve< float, hpoint< float > > *Curve, const float u, curve< float, hpoint< float > > *C1, curve< float, hpoint< float > > *C2)
template void SplitCurve (const curve< double, hpoint< double > > *Curve, const double u, curve< double, hpoint< double > > *C1, curve< double, hpoint< double > > *C2)
template void SplitCurve (const curve< float, hpoint2< float > > *Curve, const float u, curve< float, hpoint2< float > > *C1, curve< float, hpoint2< float > > *C2)
template void SplitCurve (const curve< double, hpoint2< double > > *Curve, const double u, curve< double, hpoint2< double > > *C1, curve< double, hpoint2< double > > *C2)
template void SplitCurve (const curve< float, point< float > > *Curve, const float u, curve< float, point< float > > *C1, curve< float, point< float > > *C2)
template void SplitCurve (const curve< double, point< double > > *Curve, const double u, curve< double, point< double > > *C1, curve< double, point< double > > *C2)
template void SplitCurve (const curve< float, point2< float > > *Curve, const float u, curve< float, point2< float > > *C1, curve< float, point2< float > > *C2)
template void SplitCurve (const curve< double, point2< double > > *Curve, const double u, curve< double, point2< double > > *C1, curve< double, point2< double > > *C2)
template<class T, class HP> void SplitSurface (const surface< T, HP > *Surf, const T u, const T v, surface< T, HP > *S11, surface< T, HP > *S12, surface< T, HP > *S21, surface< T, HP > *S22)
template void SplitSurface (const surface< float, hpoint< float > > *Surf, const float u, const float v, surface< float, hpoint< float > > *S11, surface< float, hpoint< float > > *S12, surface< float, hpoint< float > > *S21, surface< float, hpoint< float > > *S22)
template void SplitSurface (const surface< double, hpoint< double > > *Surf, const double u, const double v, surface< double, hpoint< double > > *S11, surface< double, hpoint< double > > *S12, surface< double, hpoint< double > > *S21, surface< double, hpoint< double > > *S22)
template void SplitSurface (const surface< float, point< float > > *Surf, const float u, const float v, surface< float, point< float > > *S11, surface< float, point< float > > *S12, surface< float, point< float > > *S21, surface< float, point< float > > *S22)
template void SplitSurface (const surface< double, point< double > > *Surf, const double u, const double v, surface< double, point< double > > *S11, surface< double, point< double > > *S12, surface< double, point< double > > *S21, surface< double, point< double > > *S22)
template<class T, class HP> GULAPI void ExtractCurve (const T u1, const T u2, const int n, const int p, Ptr< T > U, Ptr< HP > Pw, int *retn, Ptr< T > *retU, Ptr< HP > *retPw)
template GULAPI void ExtractCurve (const float u1, const float u2, const int n, const int p, Ptr< float > U, Ptr< hpoint< float > > Pw, int *retn, Ptr< float > *retU, Ptr< hpoint< float > > *retPw)
template GULAPI void ExtractCurve (const double u1, const double u2, const int n, const int p, Ptr< double > U, Ptr< hpoint< double > > Pw, int *retn, Ptr< double > *retU, Ptr< hpoint< double > > *retPw)
template GULAPI void ExtractCurve (const float u1, const float u2, const int n, const int p, Ptr< float > U, Ptr< hpoint2< float > > Pw, int *retn, Ptr< float > *retU, Ptr< hpoint2< float > > *retPw)
template GULAPI void ExtractCurve (const double u1, const double u2, const int n, const int p, Ptr< double > U, Ptr< hpoint2< double > > Pw, int *retn, Ptr< double > *retU, Ptr< hpoint2< double > > *retPw)
template GULAPI void ExtractCurve (const float u1, const float u2, const int n, const int p, Ptr< float > U, Ptr< point< float > > Pw, int *retn, Ptr< float > *retU, Ptr< point< float > > *retPw)
template GULAPI void ExtractCurve (const double u1, const double u2, const int n, const int p, Ptr< double > U, Ptr< point< double > > Pw, int *retn, Ptr< double > *retU, Ptr< point< double > > *retPw)
template GULAPI void ExtractCurve (const float u1, const float u2, const int n, const int p, Ptr< float > U, Ptr< point2< float > > Pw, int *retn, Ptr< float > *retU, Ptr< point2< float > > *retPw)
template GULAPI void ExtractCurve (const double u1, const double u2, const int n, const int p, Ptr< double > U, Ptr< point2< double > > Pw, int *retn, Ptr< double > *retU, Ptr< point2< double > > *retPw)
template<class T, class HP> GULAPI void ExtractSurface (const T u1, const T u2, const T v1, const T v2, const int nu, const int pu, Ptr< T > U, const int nv, const int pv, Ptr< T > V, Ptr< Ptr< HP > > Pw, int *ret_nu, Ptr< T > *retU, int *ret_nv, Ptr< T > *retV, Ptr< Ptr< HP > > *retPw)
template GULAPI void ExtractSurface (const float u1, const float u2, const float v1, const float v2, const int nu, const int pu, Ptr< float > U, const int nv, const int pv, Ptr< float > V, Ptr< Ptr< hpoint< float > > > Pw, int *ret_nu, Ptr< float > *retU, int *ret_nv, Ptr< float > *retV, Ptr< Ptr< hpoint< float > > > *retPw)
template GULAPI void ExtractSurface (const double u1, const double u2, const double v1, const double v2, const int nu, const int pu, Ptr< double > U, const int nv, const int pv, Ptr< double > V, Ptr< Ptr< hpoint< double > > > Pw, int *ret_nu, Ptr< double > *retU, int *ret_nv, Ptr< double > *retV, Ptr< Ptr< hpoint< double > > > *retPw)
template GULAPI void ExtractSurface (const float u1, const float u2, const float v1, const float v2, const int nu, const int pu, Ptr< float > U, const int nv, const int pv, Ptr< float > V, Ptr< Ptr< point< float > > > Pw, int *ret_nu, Ptr< float > *retU, int *ret_nv, Ptr< float > *retV, Ptr< Ptr< point< float > > > *retPw)
template GULAPI void ExtractSurface (const double u1, const double u2, const double v1, const double v2, const int nu, const int pu, Ptr< double > U, const int nv, const int pv, Ptr< double > V, Ptr< Ptr< point< double > > > Pw, int *ret_nu, Ptr< double > *retU, int *ret_nv, Ptr< double > *retV, Ptr< Ptr< point< double > > > *retPw)
template GULAPI void ExtractSurface (const float u1, const float u2, const float v1, const float v2, const int nu, const int pu, Ptr< float > U, const int nv, const int pv, Ptr< float > V, Ptr< Ptr< point1< float > > > Pw, int *ret_nu, Ptr< float > *retU, int *ret_nv, Ptr< float > *retV, Ptr< Ptr< point1< float > > > *retPw)
template GULAPI void ExtractSurface (const double u1, const double u2, const double v1, const double v2, const int nu, const int pu, Ptr< double > U, const int nv, const int pv, Ptr< double > V, Ptr< Ptr< point1< double > > > Pw, int *ret_nu, Ptr< double > *retU, int *ret_nv, Ptr< double > *retV, Ptr< Ptr< point1< double > > > *retPw)
template GULAPI void ExtractSurface (const float u1, const float u2, const float v1, const float v2, const int nu, const int pu, Ptr< float > U, const int nv, const int pv, Ptr< float > V, Ptr< Ptr< hpoint1< float > > > Pw, int *ret_nu, Ptr< float > *retU, int *ret_nv, Ptr< float > *retV, Ptr< Ptr< hpoint1< float > > > *retPw)
template GULAPI void ExtractSurface (const double u1, const double u2, const double v1, const double v2, const int nu, const int pu, Ptr< double > U, const int nv, const int pv, Ptr< double > V, Ptr< Ptr< hpoint1< double > > > Pw, int *ret_nu, Ptr< double > *retU, int *ret_nv, Ptr< double > *retV, Ptr< Ptr< hpoint1< double > > > *retPw)
template<class T, class HP> void ExtractCurveN (const T u1, const T u2, const int n, const int p, Ptr< T > U, Ptr< HP > Pw, int *retn, Ptr< T > *retU, Ptr< HP > *retPw)
template<class T, class HP> void ExtractSurfaceN (const T u1, const T u2, const T v1, const T v2, const int nu, const int pu, Ptr< T > U, const int nv, const int pv, Ptr< T > V, Ptr< Ptr< HP > > Pw, int *ret_nu, Ptr< T > *retU, int *ret_nv, Ptr< T > *retV, Ptr< Ptr< HP > > *retPw)
template<class T> void CASolve (int nQ, const Ptr< point< T > > &Q, const Ptr< T > &Uq, int n, int p, const Ptr< T > &U, Ptr< int > &M, Ptr< Ptr< Ptr< T > > > &N, Ptr< Ptr< T > > &A, Ptr< point< T > > &P)
template<class T> void CASolve (int nQ, const Ptr< point2< T > > &Q, const Ptr< T > &Uq, int n, int p, const Ptr< T > &U, Ptr< int > &M, Ptr< Ptr< Ptr< T > > > &N, Ptr< Ptr< T > > &A, Ptr< point2< T > > &P)
template<class T> void CASolveToCol (int nQ, const Ptr< point< T > > &Q, const Ptr< T > &Uq, int n, int p, const Ptr< T > &U, const Ptr< int > &M, const Ptr< Ptr< Ptr< T > > > &N, Ptr< Ptr< T > > &A, Ptr< Ptr< T > > &L, Ptr< int > index, int iCol, Ptr< Ptr< point< T > > > &P)
template<class T> void CACalcNTN (int nQ, const Ptr< T > &Uq, int n, int p, const Ptr< T > &U, Ptr< int > &M, Ptr< Ptr< Ptr< T > > > &N, Ptr< Ptr< T > > &A)
template<class T, class EP> GULAPI bool DoGlobalCurveApproximation (int nQ, const Ptr< EP > &Q, const Ptr< T > &QU, int n, int p, const Ptr< T > &U, int max_pts_span, Ptr< EP > &P)
template GULAPI bool DoGlobalCurveApproximation (int nQ, const Ptr< point< float > > &Q, const Ptr< float > &QU, int n, int p, const Ptr< float > &U, int max_pts_span, Ptr< point< float > > &P)
template GULAPI bool DoGlobalCurveApproximation (int nQ, const Ptr< point< double > > &Q, const Ptr< double > &QU, int n, int p, const Ptr< double > &U, int max_pts_span, Ptr< point< double > > &P)
template GULAPI bool DoGlobalCurveApproximation (int nQ, const Ptr< point2< float > > &Q, const Ptr< float > &QU, int n, int p, const Ptr< float > &U, int max_pts_span, Ptr< point2< float > > &P)
template GULAPI bool DoGlobalCurveApproximation (int nQ, const Ptr< point2< double > > &Q, const Ptr< double > &QU, int n, int p, const Ptr< double > &U, int max_pts_span, Ptr< point2< double > > &P)
template<class T, class EP> GULAPI bool GlobalCurveApproximation (int nQ, const Ptr< EP > &Q, int n, int p, Ptr< T > &U, Ptr< EP > &P)
template GULAPI bool GlobalCurveApproximation (int nQ, const Ptr< point< float > > &Q, int n, int p, Ptr< float > &U, Ptr< point< float > > &P)
template GULAPI bool GlobalCurveApproximation (int nQ, const Ptr< point< double > > &Q, int n, int p, Ptr< double > &U, Ptr< point< double > > &P)
template GULAPI bool GlobalCurveApproximation (int nQ, const Ptr< point2< float > > &Q, int n, int p, Ptr< float > &U, Ptr< point2< float > > &P)
template GULAPI bool GlobalCurveApproximation (int nQ, const Ptr< point2< double > > &Q, int n, int p, Ptr< double > &U, Ptr< point2< double > > &P)
template<class T, class EP> GULAPI bool GlobalSurfaceApproximation (int nRows, int nCols, const Ptr< Ptr< EP > > &Q, int nu, int pu, Ptr< T > &U, int nv, int pv, Ptr< T > &V, Ptr< Ptr< EP > > &P)
template GULAPI bool GlobalSurfaceApproximation< float, point< float > > (int nRows, int nCols, const Ptr< Ptr< point< float > > > &Q, int pu, int nu, Ptr< float > &U, int nv, int pv, Ptr< float > &V, Ptr< Ptr< point< float > > > &P)
template GULAPI bool GlobalSurfaceApproximation< double, point< double > > (int nRows, int nCols, const Ptr< Ptr< point< double > > > &Q, int pu, int nu, Ptr< double > &U, int nv, int pv, Ptr< double > &V, Ptr< Ptr< point< double > > > &P)
template<class T> void CIDecompose (int nQ, const Ptr< T > &Uq, int p, const Ptr< T > &U, Ptr< Ptr< T > > &A, Ptr< Ptr< T > > &L, Ptr< int > &index)
template<class T> void CIBackSubst (int nQ, const Ptr< point< T > > &Q, int p, Ptr< Ptr< T > > &A, const Ptr< Ptr< T > > &L, const Ptr< int > &index, Ptr< point< T > > &P)
template<class T> void CIBackSubst (int nQ, const Ptr< point2< T > > &Q, int p, const Ptr< Ptr< T > > &A, const Ptr< Ptr< T > > &L, const Ptr< int > &index, Ptr< point2< T > > &P)
template<class T> void CIBackSubstToCol (int nQ, const Ptr< point< T > > &Q, int p, const Ptr< Ptr< T > > &A, const Ptr< Ptr< T > > &L, const Ptr< int > &index, int iCol, Ptr< Ptr< point< T > > > &P)
template<class T> void CIBackSubstToCol (int nQ, const Ptr< point1< T > > &Q, int p, const Ptr< Ptr< T > > &A, const Ptr< Ptr< T > > &L, const Ptr< int > &index, int iCol, Ptr< Ptr< point1< T > > > &P)
template<class T, class EP> GULAPI bool GlobalCurveInterpolation (int nQ, const Ptr< EP > &Q, int p, Ptr< T > &U, Ptr< EP > &P)
template GULAPI bool GlobalCurveInterpolation (int nQ, const Ptr< point< float > > &Q, int p, Ptr< float > &U, Ptr< point< float > > &P)
template GULAPI bool GlobalCurveInterpolation (int nQ, const Ptr< point< double > > &Q, int p, Ptr< double > &U, Ptr< point< double > > &P)
template GULAPI bool GlobalCurveInterpolation (int nQ, const Ptr< point2< float > > &Q, int p, Ptr< float > &U, Ptr< point2< float > > &P)
template GULAPI bool GlobalCurveInterpolation (int nQ, const Ptr< point2< double > > &Q, int p, Ptr< double > &U, Ptr< point2< double > > &P)
template<class T, class EP> GULAPI bool GlobalSurfaceInterpolation (int nRows, int nCols, const Ptr< Ptr< EP > > &Q, int pu, int pv, Ptr< T > &U, Ptr< T > &V, Ptr< Ptr< EP > > &P)
template GULAPI bool GlobalSurfaceInterpolation< float, point< float > > (int nRows, int nCols, const Ptr< Ptr< point< float > > > &Q, int pu, int pv, Ptr< float > &U, Ptr< float > &V, Ptr< Ptr< point< float > > > &P)
template GULAPI bool GlobalSurfaceInterpolation< double, point< double > > (int nRows, int nCols, const Ptr< Ptr< point< double > > > &Q, int pu, int pv, Ptr< double > &U, Ptr< double > &V, Ptr< Ptr< point< double > > > &P)
template<class T> GULAPI void CubicCurveInterpolation (int n, Ptr< point< T > > Q, Ptr< T > U, Ptr< point< T > > P)
template GULAPI void CubicCurveInterpolation (int n, Ptr< point< float > > Q, Ptr< float > U, Ptr< point< float > > P)
template GULAPI void CubicCurveInterpolation (int n, Ptr< point< double > > Q, Ptr< double > U, Ptr< point< double > > P)
template<class K> GULAPI void CubicLocalCurveInterpolation (int n, Ptr< point< K > > Q, bool cornerflag, Ptr< K > U, Ptr< point< K > > P)
template GULAPI void CubicLocalCurveInterpolation (int n, Ptr< point< float > > Q, bool cornerflag, Ptr< float > U, Ptr< point< float > > P)
template GULAPI void CubicLocalCurveInterpolation (int n, Ptr< point< double > > Q, bool cornerflag, Ptr< double > U, Ptr< point< double > > P)
template<class T, class HP> GULAPI void CubicLocalSurfaceInterpolation (int n, int m, Ptr< Ptr< point< T > > > Q, bool cornerflag, Ptr< T > U, Ptr< T > V, Ptr< Ptr< HP > > controlPoints)
template GULAPI void CubicLocalSurfaceInterpolation (int n, int m, Ptr< Ptr< point< float > > > Q, bool cornerflag, Ptr< float > U, Ptr< float > V, Ptr< Ptr< point< float > > > controlPoints)
template GULAPI void CubicLocalSurfaceInterpolation (int n, int m, Ptr< Ptr< point< double > > > Q, bool cornerflag, Ptr< double > U, Ptr< double > V, Ptr< Ptr< point< double > > > controlPoints)
template GULAPI void CubicLocalSurfaceInterpolation (int n, int m, Ptr< Ptr< point< float > > > Q, bool cornerflag, Ptr< float > U, Ptr< float > V, Ptr< Ptr< hpoint< float > > > controlPoints)
template GULAPI void CubicLocalSurfaceInterpolation (int n, int m, Ptr< Ptr< point< double > > > Q, bool cornerflag, Ptr< double > U, Ptr< double > V, Ptr< Ptr< hpoint< double > > > controlPoints)
template<class T, class HP> void LinearizeOrDivide (TessInfo< T, HP > *A, const T tol, bool need_bbox)
template void LinearizeOrDivide (TessInfo< float, hpoint< float > > *A, const float tol, bool need_bbox)
template void LinearizeOrDivide (TessInfo< float, point< float > > *A, const float tol, bool need_bbox)
template void LinearizeOrDivide (TessInfo< double, hpoint< double > > *A, const double tol, bool need_bbox)
template void LinearizeOrDivide (TessInfo< double, point< double > > *A, const double tol, bool need_bbox)
template<class T, class HP> void DoLinearizeSurface (int current_iter, int max_iter, TessInfo< T, HP > *A, const T tol, void outfunc(TessInfo< T, HP > *, void *), void *outfunc_data)
template void DoLinearizeSurface (int current_iter, int max_iter, TessInfo< float, hpoint< float > > *A, const float tol, void outfunc(TessInfo< float, hpoint< float > > *, void *), void *outfunc_data)
template void DoLinearizeSurface (int current_iter, int max_iter, TessInfo< double, hpoint< double > > *A, const double tol, void outfunc(TessInfo< double, hpoint< double > > *, void *), void *outfunc_data)
template void DoLinearizeSurface (int current_iter, int max_iter, TessInfo< float, point< float > > *A, const float tol, void outfunc(TessInfo< float, point< float > > *, void *), void *outfunc_data)
template void DoLinearizeSurface (int current_iter, int max_iter, TessInfo< double, point< double > > *A, const double tol, void outfunc(TessInfo< double, point< double > > *, void *), void *outfunc_data)
template<class T> void StoreIntersectionSegmentUV (point2< rational > *Suv, int *Sflag, List< ListNode< IntersectionLineInfo< T > > > &I)
template<class T> void StoreIntersectionSegment (point< rational > *S, IntersectInfo< T > *II)
template<class T, class HP> void DoIntersectSurfaces (TessInfo< T, HP > *A, TessInfo< T, HP > *B, T tol, IntersectInfo< T > *II)
template void DoIntersectSurfaces (TessInfo< float, hpoint< float > > *A, TessInfo< float, hpoint< float > > *B, float tol, IntersectInfo< float > *II)
template<class T, class HP> GULAPI void IntersectSurfaces (int nu1, int pu1, const Ptr< T > &U1, int nv1, int pv1, const Ptr< T > &V1, const Ptr< Ptr< HP > > &Pw1, int nu2, int pu2, const Ptr< T > &U2, int nv2, int pv2, const Ptr< T > &V2, const Ptr< Ptr< HP > > &Pw2, T tol, List< ListNode< IntersectionLineInfo< T > > > &S1, List< ListNode< IntersectionLineInfo< T > > > &S2, List< ListNode< line< T > > > &S)
template GULAPI void IntersectSurfaces (int nu1, int pu1, const Ptr< float > &U1, int nv1, int pv1, const Ptr< float > &V1, const Ptr< Ptr< hpoint< float > > > &Pw1, int nu2, int pu2, const Ptr< float > &U2, int nv2, int pv2, const Ptr< float > &V2, const Ptr< Ptr< hpoint< float > > > &Pw2, float tol, List< ListNode< IntersectionLineInfo< float > > > &S1, List< ListNode< IntersectionLineInfo< float > > > &S2, List< ListNode< line< float > > > &S)
template<class T, class HP> GULAPI void IntersectSurfaces (int nu1, int pu1, const Ptr< T > &U1, int nv1, int pv1, const Ptr< T > &V1, const Ptr< Ptr< HP > > &Pw1, int nu2, int pu2, const Ptr< T > &U2, int nv2, int pv2, const Ptr< T > &V2, const Ptr< Ptr< HP > > &Pw2, T tol, gul::List< gul::ListNode< IntersectionLineInfo< T > > > &S1, gul::List< gul::ListNode< IntersectionLineInfo< T > > > &S2, gul::List< gul::ListNode< gul::line< T > > > &S)
template<class T, class HP> int RemoveCurveKnot (int num, int r, int s, T tol, int n, int p, Ptr< T > &U, Ptr< HP > &Pw)
template int RemoveCurveKnot (int num, int r, int s, float tol, int n, int p, Ptr< float > &U, Ptr< hpoint< float > > &Pw)
template int RemoveCurveKnot (int num, int r, int s, float tol, int n, int p, Ptr< float > &U, Ptr< hpoint2< float > > &Pw)
template int RemoveCurveKnot (int num, int r, int s, double tol, int n, int p, Ptr< double > &U, Ptr< point< double > > &Pw)
template int RemoveCurveKnot (int num, int r, int s, double tol, int n, int p, Ptr< double > &U, Ptr< point2< double > > &Pw)
template<class T, class HP> void RemoveCurveKnot (int num, int r, int s, int n, int p, Ptr< T > &U, Ptr< HP > &Pw)
template void RemoveCurveKnot (int num, int r, int s, int n, int p, Ptr< float > &U, Ptr< hpoint< float > > &Pw)
template void RemoveCurveKnot (int num, int r, int s, int n, int p, Ptr< float > &U, Ptr< hpoint2< float > > &Pw)
template void RemoveCurveKnot (int num, int r, int s, int n, int p, Ptr< double > &U, Ptr< point< double > > &Pw)
template void RemoveCurveKnot (int num, int r, int s, int n, int p, Ptr< double > &U, Ptr< point2< double > > &Pw)
template<class T, class HP> T RemovalError (int r, int s, int n, int p, const Ptr< T > &U, const Ptr< HP > &Pw)
template float RemovalError (int r, int s, int n, int p, const Ptr< float > &U, const Ptr< point< float > > &Pw)
template<class T> int GetMultiplicities (int n, int p, const Ptr< T > &U, Ptr< int > &S, Ptr< int > &R)
template int GetMultiplicities (int n, int p, const Ptr< float > &U, Ptr< int > &S, Ptr< int > &R)
template<class T> GULAPI void CalcParameterRanges (int n, int p, const Ptr< T > &U, int nP, const Ptr< T > &P, Ptr< int > &R, Ptr< int > &S)
template GULAPI void CalcParameterRanges (int n, int p, const Ptr< float > &U, int nP, const Ptr< float > &P, Ptr< int > &R, Ptr< int > &S)
template<class T> GULAPI int CalcMaxPointsPerSpan (int n, int p, const Ptr< T > &U, int nP, const Ptr< T > &P)
template<class T, class EP> GULAPI int RemoveCurveKnots (int n, int p, Ptr< T > &U, Ptr< EP > &Pw, int nQ, const Ptr< T > &QU, T tol, Ptr< T > &QE)
template GULAPI int RemoveCurveKnots (int n, int p, Ptr< float > &U, Ptr< point< float > > &Pw, int nQ, const Ptr< float > &QU, float tol, Ptr< float > &QE)
template<class T, class EP> bool PTCCheck (const EP &P, const Ptr< EP > &D, T eps, T *err)
template<class T, class HP, class EP> bool ProjectToCurve (const EP &P, T u, T eps, int n, int p, const Ptr< T > &U, const Ptr< HP > &Pw, T *ret_u, Ptr< EP > &D)
template<class T> int IncMultiplicities (int n, int p, const Ptr< T > &U, Ptr< T > &Uh)
template<class T, class EP> GULAPI bool GlobalCurveApproximationE (int nQ, const Ptr< EP > &Q, T tol, T eps, int degree, int *ret_n, Ptr< T > *ret_U, Ptr< EP > *ret_Pw, Ptr< T > *ret_QE, Ptr< T > *ret_QU)
template GULAPI bool GlobalCurveApproximationE< float, point< float > > (int nQ, const Ptr< point< float > > &Q, float tol, float eps, int degree, int *ret_n, Ptr< float > *ret_U, Ptr< point< float > > *ret_Pw, Ptr< float > *ret_QE, Ptr< float > *ret_QU)
template<class T> GULAPI void CalcParameterRanges (int n, int p, const gul::Ptr< T > &U, int nP, const gul::Ptr< T > &P, gul::Ptr< int > &R, gul::Ptr< int > &S)
template<class T, class EP> GULAPI int RemoveCurveKnots (int n, int p, gul::Ptr< T > &U, gul::Ptr< EP > &Pw, int nQ, const gul::Ptr< T > &QU, T tol, gul::Ptr< T > &QE)
template<class T, class HP> void LinearizeCallback (TessInfo< T, HP > *A, void *usrdata)
template void LinearizeCallback (TessInfo< float, hpoint< float > > *A, void *usrdata)
template void LinearizeCallback (TessInfo< double, hpoint< double > > *A, void *usrdata)
template void LinearizeCallback (TessInfo< float, point< float > > *A, void *usrdata)
template void LinearizeCallback (TessInfo< double, point< double > > *A, void *usrdata)
template<class T, class HP, class EP> GULAPI void LinearizeSurface (int max_iter, const int nu, const int pu, Ptr< T > U, const int nv, const int pv, Ptr< T > V, Ptr< Ptr< HP > > Pw, const T tol, void(*usrfunc)(void *, EP *, EP *, EP *, EP *, EP *, EP *, EP *, EP *, T *, T *, T *, T *), void *usrdata)
template GULAPI void LinearizeSurface (int max_iter, const int nu, const int pu, Ptr< float > U, const int nv, const int pv, Ptr< float > V, Ptr< Ptr< hpoint< float > > > Pw, const float tol, void(*usrfunc)(void *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, float *, float *, float *, float *), void *usrdata)
template GULAPI void LinearizeSurface (int max_iter, const int nu, const int pu, Ptr< double > U, const int nv, const int pv, Ptr< double > V, Ptr< Ptr< hpoint< double > > > Pw, const double tol, void(*usrfunc)(void *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, double *, double *, double *, double *), void *usrdata)
template GULAPI void LinearizeSurface (int max_iter, const int nu, const int pu, Ptr< float > U, const int nv, const int pv, Ptr< float > V, Ptr< Ptr< point< float > > > Pw, const float tol, void(*usrfunc)(void *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, point< float > *, float *, float *, float *, float *), void *usrdata)
template GULAPI void LinearizeSurface (int max_iter, const int nu, const int pu, Ptr< double > U, const int nv, const int pv, Ptr< double > V, Ptr< Ptr< point< double > > > Pw, const double tol, void(*usrfunc)(void *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, point< double > *, double *, double *, double *, double *), void *usrdata)
template<class T, class HP, class EP> void DoLinearizeCurve (int current_iter, int max_iter, curve< T, HP > *C, const T tol, void(*usrfunc)(void *, EP *, EP *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< float, hpoint< float > > *C, const float tol, void(*usrfunc)(void *, point< float > *, point< float > *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< double, hpoint< double > > *C, const double tol, void(*usrfunc)(void *, point< double > *, point< double > *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< float, hpoint2< float > > *C, const float tol, void(*usrfunc)(void *, point2< float > *, point2< float > *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< double, hpoint2< double > > *C, const double tol, void(*usrfunc)(void *, point2< double > *, point2< double > *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< float, point< float > > *C, const float tol, void(*usrfunc)(void *, point< float > *, point< float > *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< double, point< double > > *C, const double tol, void(*usrfunc)(void *, point< double > *, point< double > *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< float, point2< float > > *C, const float tol, void(*usrfunc)(void *, point2< float > *, point2< float > *), void *usrdata)
template void DoLinearizeCurve (int current_iter, int max_iter, curve< double, point2< double > > *C, const double tol, void(*usrfunc)(void *, point2< double > *, point2< double > *), void *usrdata)
template<class T, class HP, class EP> GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< T > U, Ptr< HP > Pw, const T tol, void(*usrfunc)(void *, EP *, EP *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< hpoint< double > > Pw, const double tol, void(*usrfunc)(void *, point< double > *, point< double > *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< hpoint< float > > Pw, const float tol, void(*usrfunc)(void *, point< float > *, point< float > *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< hpoint2< double > > Pw, const double tol, void(*usrfunc)(void *, point2< double > *, point2< double > *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< hpoint2< float > > Pw, const float tol, void(*usrfunc)(void *, point2< float > *, point2< float > *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< point< double > > Pw, const double tol, void(*usrfunc)(void *, point< double > *, point< double > *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< point< float > > Pw, const float tol, void(*usrfunc)(void *, point< float > *, point< float > *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< point2< double > > Pw, const double tol, void(*usrfunc)(void *, point2< double > *, point2< double > *), void *usrdata)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< point2< float > > Pw, const float tol, void(*usrfunc)(void *, point2< float > *, point2< float > *), void *usrdata)
template<class EP> void LinearizeLineCallback (void *usrdata, EP *p1, EP *p2)
template void LinearizeLineCallback (void *usrdata, point2< float > *p1, point2< float > *p2)
template void LinearizeLineCallback (void *usrdata, point2< double > *p1, point2< double > *p2)
template void LinearizeLineCallback (void *usrdata, point< float > *p1, point< float > *p2)
template void LinearizeLineCallback (void *usrdata, point< double > *p1, point< double > *p2)
template<class T, class HP, class EP> GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< T > U, Ptr< HP > Pw, const T tol, int *ret_nP, Ptr< EP > *retP)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< hpoint< double > > Pw, const double tol, int *nP, Ptr< point< double > > *P)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< hpoint< float > > Pw, const float tol, int *nP, Ptr< point< float > > *P)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< hpoint2< double > > Pw, const double tol, int *nP, Ptr< point2< double > > *P)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< hpoint2< float > > Pw, const float tol, int *nP, Ptr< point2< float > > *P)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< point< double > > Pw, const double tol, int *nP, Ptr< point< double > > *P)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< point< float > > Pw, const float tol, int *nP, Ptr< point< float > > *P)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< double > U, Ptr< point2< double > > Pw, const double tol, int *nP, Ptr< point2< double > > *P)
template GULAPI void LinearizeCurve (int max_iter, const int n, const int p, Ptr< float > U, Ptr< point2< float > > Pw, const float tol, int *nP, Ptr< point2< float > > *P)
template<class T, class HP1, class HP2> void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< T > &U1, int nv1, int pv1, Ptr< T > &V1, Ptr< Ptr< HP1 > > &Pw1, int nu2, int pu2, Ptr< T > &U2, int nv2, int pv2, Ptr< T > &V2, Ptr< Ptr< HP2 > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< T > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< T > *ret_V1, Ptr< Ptr< HP1 > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< T > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< T > *ret_V2, Ptr< Ptr< HP2 > > *ret_Pw2)
 make two surfaces in U- or V- direction compatible, after this both surfaces have the same degree and knot vector in the wanted direction, while remaining geometrically unchanged. More...

template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< point< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< point< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< point< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< point< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< hpoint< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< hpoint< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< hpoint< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< hpoint< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< point1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< point1< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< point1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< point1< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< hpoint1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< hpoint1< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< hpoint1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< hpoint1< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< point< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< point< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< point< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< point< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< hpoint< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< hpoint< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< hpoint< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< hpoint< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< point1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< point1< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< point1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< point1< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< hpoint1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< hpoint1< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< hpoint1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< hpoint1< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< point1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< point< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< point1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< point< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< hpoint1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< hpoint< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< hpoint1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< hpoint< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< point1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< point< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< point1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< point< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleU (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< hpoint1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< hpoint< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< hpoint1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< hpoint< double > > > *ret_Pw2)
template<class T, class HP1, class HP2> void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< T > &U1, int nv1, int pv1, Ptr< T > &V1, Ptr< Ptr< HP1 > > &Pw1, int nu2, int pu2, Ptr< T > &U2, int nv2, int pv2, Ptr< T > &V2, Ptr< Ptr< HP2 > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< T > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< T > *ret_V1, Ptr< Ptr< HP1 > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< T > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< T > *ret_V2, Ptr< Ptr< HP2 > > *ret_Pw2)
 make two surfaces in U- or V- direction compatible, after this both surfaces have the same degree and knot vector in the wanted direction, while remaining geometrically unchanged. More...

template<class T, class HP1, class HP2> void MakeSurfacesCompatible (int nu1, int pu1, Ptr< T > &U1, int nv1, int pv1, Ptr< T > &V1, Ptr< Ptr< HP1 > > &Pw1, int nu2, int pu2, Ptr< T > &U2, int nv2, int pv2, Ptr< T > &V2, Ptr< Ptr< HP2 > > &Pw2, int dir, int *ret_nu1, int *ret_pu1, Ptr< T > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< T > *ret_V1, Ptr< Ptr< HP1 > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< T > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< T > *ret_V2, Ptr< Ptr< HP2 > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< point< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< point< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< point< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< point< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< hpoint< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< hpoint< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< hpoint< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< hpoint< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< point1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< point1< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< point1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< point1< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< hpoint1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< hpoint1< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< hpoint1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< hpoint1< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< point< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< point< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< point< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< point< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< hpoint< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< hpoint< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< hpoint< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< hpoint< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< point1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< point1< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< point1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< point1< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< hpoint1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< hpoint1< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< hpoint1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< hpoint1< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< point1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< point< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< point1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< point< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< float > &U1, int nv1, int pv1, Ptr< float > &V1, Ptr< Ptr< hpoint1< float > > > &Pw1, int nu2, int pu2, Ptr< float > &U2, int nv2, int pv2, Ptr< float > &V2, Ptr< Ptr< hpoint< float > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< float > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< float > *ret_V1, Ptr< Ptr< hpoint1< float > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< float > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< float > *ret_V2, Ptr< Ptr< hpoint< float > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< point1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< point< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< point1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< point< double > > > *ret_Pw2)
template void MakeSurfacesCompatibleV (int nu1, int pu1, Ptr< double > &U1, int nv1, int pv1, Ptr< double > &V1, Ptr< Ptr< hpoint1< double > > > &Pw1, int nu2, int pu2, Ptr< double > &U2, int nv2, int pv2, Ptr< double > &V2, Ptr< Ptr< hpoint< double > > > &Pw2, int *ret_nu1, int *ret_pu1, Ptr< double > *ret_U1, int *ret_nv1, int *ret_pv1, Ptr< double > *ret_V1, Ptr< Ptr< hpoint1< double > > > *ret_Pw1, int *ret_nu2, int *ret_pu2, Ptr< double > *ret_U2, int *ret_nv2, int *ret_pv2, Ptr< double > *ret_V2, Ptr< Ptr< hpoint< double > > > *ret_Pw2)
template<class T> void BAapproximate (int nP, Ptr< point< T > > &P, int nu, int pu, Ptr< T > &U, int nv, int pv, Ptr< T > &V, Ptr< Ptr< point1< T > > > &delta)
 BSpline approximation, calculates the points of a control lattice 'delta', which approximates data points in 'P'. More...

template void BAapproximate (int nP, Ptr< point< float > > &P, int nu, int pu, Ptr< float > &U, int nv, int pv, Ptr< float > &V, Ptr< Ptr< point1< float > > > &delta)
template void BAapproximate (int nP, Ptr< point< double > > &P, int nu, int pu, Ptr< double > &U, int nv, int pv, Ptr< double > &V, Ptr< Ptr< point1< double > > > &delta)
template<class T> void BAapproximate (int nP, Ptr< point< T > > &P, Ptr< T > &Sigma, int nu, int pu, Ptr< T > &U, int nv, int pv, Ptr< T > &V, Ptr< Ptr< point1< T > > > &delta)
 BSpline approximation, calculates the points of a control lattice 'delta', which approximates data points in 'P'. More...

template void BAapproximate (int nP, Ptr< point< float > > &P, Ptr< float > &Sigma, int nu, int pu, Ptr< float > &U, int nv, int pv, Ptr< float > &V, Ptr< Ptr< point1< float > > > &delta)
template void BAapproximate (int nP, Ptr< point< double > > &P, Ptr< double > &Sigma, int nu, int pu, Ptr< double > &U, int nv, int pv, Ptr< double > &V, Ptr< Ptr< point1< double > > > &delta)
template<class T> void MBAapproximate (int nP, Ptr< point< T > > &P, bool useSigma, Ptr< T > &Sigma, int nIter, int pu, int pv, Ptr< T > &U, Ptr< T > &V, Ptr< Ptr< point1< T > > > &Psi)
 Multilevel BSpline approximation, Calculates a NURBS surface (one-dimensional), which approximates data points in 'P', (P[].z contains the function value, P[].x and P[] the location in the domain). More...

template void MBAapproximate (int nP, Ptr< point< float > > &P, bool useSigma, Ptr< float > &Sigma, int nIter, int pu, int pv, Ptr< float > &U, Ptr< float > &V, Ptr< Ptr< point1< float > > > &Psi)
template void MBAapproximate (int nP, Ptr< point< double > > &P, bool useSigma, Ptr< double > &Sigma, int nIter, int pu, int pv, Ptr< double > &U, Ptr< double > &V, Ptr< Ptr< point1< double > > > &Psi)
template<class T> T MinimizeBBoxAboutZ (int nP, Ptr< point< T > > &P, T mintol, int maxits)
 calculate the rotation about the Z-axis, so that the bounding box of the given Points 'P' gets minimal volume. More...

template float MinimizeBBoxAboutZ (int nP, Ptr< point< float > > &P, float mintol, int maxits)
template double MinimizeBBoxAboutZ (int nP, Ptr< point< double > > &P, double mintol, int maxits)
template<class T, class HP> GULAPI void SurfaceOverXYPlane (int nDatPoints, Ptr< point< T > > &datPoints, bool useStdDevs, Ptr< T > &StdDevs, bool minimize, int nIter, int pu, int pv, int *ret_nu, Ptr< T > *retU, int *ret_nv, Ptr< T > *retV, Ptr< Ptr< HP > > *retPw)
 executes the MBA algorithm and constructs a 3-dimensional surface from the results (x(),y() are identity mappings). More...

template GULAPI void SurfaceOverXYPlane (int nDatPoints, Ptr< point< float > > &datPoints, bool useStdDevs, Ptr< float > &StdDevs, bool minimize, int nIterations, int pu, int pv, int *ret_nu, Ptr< float > *retU, int *ret_nv, Ptr< float > *retV, Ptr< Ptr< point< float > > > *retPw)
template GULAPI void SurfaceOverXYPlane (int nDatPoints, Ptr< point< double > > &datPoints, bool useStdDevs, Ptr< double > &StdDevs, bool minimize, int nIterations, int pu, int pv, int *ret_nu, Ptr< double > *retU, int *ret_nv, Ptr< double > *retV, Ptr< Ptr< point< double > > > *retPw)
template<class T> void GULAPI MBASurface (int nDat, Ptr< point< T > > Dat, Ptr< point2< T > > Dom, int nIter, int pu, int pv, int *ret_nu, Ptr< T > *retU, int *ret_nv, Ptr< T > *retV, Ptr< Ptr< point< T > > > *retP)
 creates a surface with the MBA algorithm. More...

template GULAPI void MBASurface (int nDat, const Ptr< point< float > > Dat, const Ptr< point2< float > > Dom, int nIter, int pu, int pv, int *ret_nu, Ptr< float > *retU, int *ret_nv, Ptr< float > *retV, Ptr< Ptr< point< float > > > *retP)
template GULAPI void MBASurface (int nDat, const Ptr< point< double > > Dat, const Ptr< point2< double > > Dom, int nIter, int pu, int pv, int *ret_nu, Ptr< double > *retU, int *ret_nv, Ptr< double > *retV, Ptr< Ptr< point< double > > > *retP)
template<class T, class EP> T ChordLength (int nQ, const gul::Ptr< EP > &Q, gul::Ptr< T > &d)
template<class T, class EP> T ColumnChordLength (int nRows, int nCols, const gul::Ptr< gul::Ptr< EP > > &Q, int iCol, gul::Ptr< T > &d)
template<class T> void ChordLengthParameters (int nQ, const T &dsum, const gul::Ptr< T > &d, gul::Ptr< T > &Uq)
template<class T> void KnotVectorByAveraging (int nQ, const gul::Ptr< T > &Uq, int p, gul::Ptr< T > &U)
template<class T> int KnotVectorByAveraging (int nQ, const gul::Ptr< T > &Uq, int n, int p, gul::Ptr< T > &U)
template<class T, class EP> bool ChordLengthMeshParams (int nRows, int nCols, const gul::Ptr< gul::Ptr< EP > > &Q, gul::Ptr< T > &Uq, gul::Ptr< T > &Vq)
template<class T, class HP, class EP> GULAPI int ProjectToSurface (int nDatPoints, const Ptr< EP > &datPoints, int ref_nu, int ref_pu, const Ptr< T > &refU, int ref_nv, int ref_pv, const Ptr< T > &refV, const Ptr< Ptr< HP > > &refPw, Ptr< pts_point< T, EP > > &retPts)
template GULAPI int ProjectToSurface (int nDatPoints, const Ptr< point< float > > &datPoints, int ref_nu, int ref_pu, const Ptr< float > &refU, int ref_nv, int ref_pv, const Ptr< float > &refV, const Ptr< Ptr< hpoint< float > > > &Pw, Ptr< pts_point< float, point< float > > > &retPts)
template GULAPI int ProjectToSurface (int nDatPoints, const Ptr< point< double > > &datPoints, int ref_nu, int ref_pu, const Ptr< double > &refU, int ref_nv, int ref_pv, const Ptr< double > &refV, const Ptr< Ptr< hpoint< double > > > &Pw, Ptr< pts_point< double, point< double > > > &retPts)
template GULAPI int ProjectToSurface (int nDatPoints, const Ptr< point< float > > &datPoints, int ref_nu, int ref_pu, const Ptr< float > &refU, int ref_nv, int ref_pv, const Ptr< float > &refV, const Ptr< Ptr< point< float > > > &Pw, Ptr< pts_point< float, point< float > > > &retPts)
template GULAPI int ProjectToSurface (int nDatPoints, const Ptr< point< double > > &datPoints, int ref_nu, int ref_pu, const Ptr< double > &refU, int ref_nv, int ref_pv, const Ptr< double > &refV, const Ptr< Ptr< point< double > > > &Pw, Ptr< pts_point< double, point< double > > > &retPts)
template<class T, class HP> int ElevateCurveDegree (int n, int p, const Ptr< T > &U, const Ptr< HP > &Pw, int t, Ptr< T > &Uh, Ptr< HP > &Qw)
 raise the degree 'p' of a curve to 'p+t'. More...

template int ElevateCurveDegree (int n, int p, const Ptr< float > &U, const Ptr< point< float > > &Pw, int t, Ptr< float > &Uh, Ptr< point< float > > &Qw)
template int ElevateCurveDegree (int n, int p, const Ptr< float > &U, const Ptr< hpoint< float > > &Pw, int t, Ptr< float > &Uh, Ptr< hpoint< float > > &Qw)
template int ElevateCurveDegree (int n, int p, const Ptr< float > &U, const Ptr< point2< float > > &Pw, int t, Ptr< float > &Uh, Ptr< point2< float > > &Qw)
template int ElevateCurveDegree (int n, int p, const Ptr< float > &U, const Ptr< hpoint2< float > > &Pw, int t, Ptr< float > &Uh, Ptr< hpoint2< float > > &Qw)
template int ElevateCurveDegree (int n, int p, const Ptr< double > &U, const Ptr< point< double > > &Pw, int t, Ptr< double > &Uh, Ptr< point< double > > &Qw)
template int ElevateCurveDegree (int n, int p, const Ptr< double > &U, const Ptr< hpoint< double > > &Pw, int t, Ptr< double > &Uh, Ptr< hpoint< double > > &Qw)
template int ElevateCurveDegree (int n, int p, const Ptr< double > &U, const Ptr< point2< double > > &Pw, int t, Ptr< double > &Uh, Ptr< point2< double > > &Qw)
template int ElevateCurveDegree (int n, int p, const Ptr< double > &U, const Ptr< hpoint2< double > > &Pw, int t, Ptr< double > &Uh, Ptr< hpoint2< double > > &Qw)
template<class T, class HP> void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, int t, int *nhu, Ptr< T > &Uh, int *nhv, Ptr< T > &Vh, Ptr< Ptr< HP > > &Qw)
 raise the degree 'pu' or 'pv' of a surface by 't'. More...

template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< point< float > > > &Qw)
template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< hpoint< float > > > &Qw)
template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< point1< float > > > &Qw)
template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< hpoint1< float > > > &Qw)
template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< point< double > > > &Qw)
template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< hpoint< double > > > &Qw)
template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< point1< double > > > &Qw)
template void ElevateSurfaceDegreeU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< hpoint1< double > > > &Qw)
template<class T, class HP> int ElevateCurveDegree (int n, int p, Ptr< T > &U, Ptr< HP > &Pw, int t, Ptr< T > &Uh, Ptr< HP > &Qw)
 raise the degree 'p' of a curve to 'p+t'. More...

template<class T, class HP> void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, int t, int *nhu, Ptr< T > &Uh, int *nhv, Ptr< T > &Vh, Ptr< Ptr< HP > > &Qw)
 raise the degree 'pu' or 'pv' of a surface by 't'. More...

template<class T, class HP> void ElevateSurfaceDegree (int nu, int pu, Ptr< T > &U, int nv, int pv, Ptr< T > &V, Ptr< Ptr< HP > > &Pw, int t, int dir, int *nhu, Ptr< T > &Uh, int *nhv, Ptr< T > &Vh, Ptr< Ptr< HP > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< point< float > > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< hpoint< float > > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< point1< float > > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, int t, int *nhu, Ptr< float > &Uh, int *nhv, Ptr< float > &Vh, Ptr< Ptr< hpoint1< float > > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< point< double > > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< hpoint< double > > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< point1< double > > > &Qw)
template void ElevateSurfaceDegreeV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, int t, int *nhu, Ptr< double > &Uh, int *nhv, Ptr< double > &Vh, Ptr< Ptr< hpoint1< double > > > &Qw)
template<class T, class HP> void RefineCurve (int n, int p, const Ptr< T > &U, const Ptr< HP > P, const Ptr< T > X, int r, Ptr< T > &Ubar, Ptr< HP > Q)
 Inserts 'r'+1 knots given by the refinement vector 'X' into the knot vector of a curve (and calculates the changed control points). More...

template void RefineCurve (int n, int p, const Ptr< float > &U, const Ptr< hpoint< float > > P, const Ptr< float > X, int r, Ptr< float > &Ubar, Ptr< hpoint< float > > Q)
template void RefineCurve (int n, int p, const Ptr< float > &U, const Ptr< point< float > > P, const Ptr< float > X, int r, Ptr< float > &Ubar, Ptr< point< float > > Q)
template void RefineCurve (int n, int p, const Ptr< float > &U, const Ptr< hpoint2< float > > P, const Ptr< float > X, int r, Ptr< float > &Ubar, Ptr< hpoint2< float > > Q)
template void RefineCurve (int n, int p, const Ptr< float > &U, const Ptr< point2< float > > P, const Ptr< float > X, int r, Ptr< float > &Ubar, Ptr< point2< float > > Q)
template void RefineCurve (int n, int p, const Ptr< double > &U, const Ptr< hpoint< double > > P, const Ptr< double > X, int r, Ptr< double > &Ubar, Ptr< hpoint< double > > Q)
template void RefineCurve (int n, int p, const Ptr< double > &U, const Ptr< point< double > > P, const Ptr< double > X, int r, Ptr< double > &Ubar, Ptr< point< double > > Q)
template void RefineCurve (int n, int p, const Ptr< double > &U, const Ptr< hpoint2< double > > P, const Ptr< double > X, int r, Ptr< double > &Ubar, Ptr< hpoint2< double > > Q)
template void RefineCurve (int n, int p, const Ptr< double > &U, const Ptr< point2< double > > P, const Ptr< double > X, int r, Ptr< double > &Ubar, Ptr< point2< double > > Q)
template<class T, class HP> void RefineSurfaceU (int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &P, const Ptr< T > &X, int r, Ptr< T > &Ubar, Ptr< T > &Vbar, Ptr< Ptr< HP > > &Q)
 Inserts 'r'+1 knots given by the refinement vector 'X' into the U or V knot vector of a surface (and calculates the changed control points). More...

template void RefineSurfaceU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< point< float > > > &Q)
template void RefineSurfaceU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< hpoint< float > > > &Q)
template void RefineSurfaceU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< point1< float > > > &Q)
template void RefineSurfaceU (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< hpoint1< float > > > &Q)
template void RefineSurfaceU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< point< double > > > &Q)
template void RefineSurfaceU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< hpoint< double > > > &Q)
template void RefineSurfaceU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< point1< double > > > &Q)
template void RefineSurfaceU (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< hpoint1< double > > > &Q)
template<class T> int BezierPositions (int n, int p, const Ptr< T > &U, Ptr< int > &K, Ptr< int > &M)
template int BezierPositions (int n, int p, const Ptr< float > &U, Ptr< int > &K, Ptr< int > &M)
template int BezierPositions (int n, int p, const Ptr< double > &U, Ptr< int > &K, Ptr< int > &M)
template<class T, class HP> void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< T > &U, const Ptr< HP > &Pw, Ptr< Ptr< HP > > *retQw)
 decompose a curve into its Bezier segments. More...

template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< float > &U, const Ptr< point< float > > &Pw, Ptr< Ptr< point< float > > > *retQw)
template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< float > &U, const Ptr< hpoint< float > > &Pw, Ptr< Ptr< hpoint< float > > > *retQw)
template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< float > &U, const Ptr< point2< float > > &Pw, Ptr< Ptr< point2< float > > > *retQw)
template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< float > &U, const Ptr< hpoint2< float > > &Pw, Ptr< Ptr< hpoint2< float > > > *retQw)
template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< double > &U, const Ptr< point< double > > &Pw, Ptr< Ptr< point< double > > > *retQw)
template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< double > &U, const Ptr< hpoint< double > > &Pw, Ptr< Ptr< hpoint< double > > > *retQw)
template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< double > &U, const Ptr< point2< double > > &Pw, Ptr< Ptr< point2< double > > > *retQw)
template void BezierDecomposeCurve (int nK, const Ptr< int > &K, const Ptr< int > &M, int n, int p, const Ptr< double > &U, const Ptr< hpoint2< double > > &Pw, Ptr< Ptr< hpoint2< double > > > *retQw)
template<class T, class HP> void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, Ptr< Ptr< Ptr< HP > > > *retQw)
 decompose a surface in u or v direction into its Bezier segments. More...

template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, Ptr< Ptr< Ptr< point< float > > > > *retQw)
template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, Ptr< Ptr< Ptr< hpoint< float > > > > *retQw)
template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, Ptr< Ptr< Ptr< point1< float > > > > *retQw)
template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, Ptr< Ptr< Ptr< hpoint1< float > > > > *retQw)
template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, Ptr< Ptr< Ptr< point< double > > > > *retQw)
template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, Ptr< Ptr< Ptr< hpoint< double > > > > *retQw)
template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, Ptr< Ptr< Ptr< point1< double > > > > *retQw)
template void BezierDecomposeSurfaceU (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, Ptr< Ptr< Ptr< hpoint1< double > > > > *retQw)
template<class T, class HP> void RefineSurfaceV (int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &P, const Ptr< T > &X, int r, Ptr< T > &Ubar, Ptr< T > &Vbar, Ptr< Ptr< HP > > &Q)
 Inserts 'r'+1 knots given by the refinement vector 'X' into the U or V knot vector of a surface (and calculates the changed control points). More...

template<class T, class HP> void RefineSurface (int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &P, const Ptr< T > &X, int r, int dir, Ptr< T > &Ubar, Ptr< T > &Vbar, Ptr< Ptr< HP > > &Q)
template<class T, class HP> void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, Ptr< Ptr< Ptr< HP > > > *retQw)
 decompose a surface in u or v direction into its Bezier segments. More...

template<class T, class HP> void BezierDecomposeSurface (int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, int dir, Ptr< Ptr< Ptr< HP > > > *retQw)
template void RefineSurfaceV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< point< float > > > &Q)
template void RefineSurfaceV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< hpoint< float > > > &Q)
template void RefineSurfaceV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< point1< float > > > &Q)
template void RefineSurfaceV (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &P, const Ptr< float > &X, int r, Ptr< float > &Ubar, Ptr< float > &Vbar, Ptr< Ptr< hpoint1< float > > > &Q)
template void RefineSurfaceV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< point< double > > > &Q)
template void RefineSurfaceV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< hpoint< double > > > &Q)
template void RefineSurfaceV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< point1< double > > > &Q)
template void RefineSurfaceV (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &P, const Ptr< double > &X, int r, Ptr< double > &Ubar, Ptr< double > &Vbar, Ptr< Ptr< hpoint1< double > > > &Q)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, Ptr< Ptr< Ptr< point< float > > > > *retQw)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, Ptr< Ptr< Ptr< hpoint< float > > > > *retQw)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, Ptr< Ptr< Ptr< point1< float > > > > *retQw)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, Ptr< Ptr< Ptr< hpoint1< float > > > > *retQw)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, Ptr< Ptr< Ptr< point< double > > > > *retQw)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, Ptr< Ptr< Ptr< hpoint< double > > > > *retQw)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, Ptr< Ptr< Ptr< point1< double > > > > *retQw)
template void BezierDecomposeSurfaceV (int nK, const Ptr< int > &K, const Ptr< int > &M, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, Ptr< Ptr< Ptr< hpoint1< double > > > > *retQw)
template<class T> void Circle (point< T > O, point< T > X, point< T > Y, T r, T theta_start, T theta_end, int *ret_n, int *ret_p, Ptr< T > *retU, Ptr< hpoint< T > > *retPw)
 Create a circle as a NURBS curve (see "The NURBS book"). More...

template void Circle (point< float > O, point< float > X, point< float > Y, float r, float theta_start, float theta_end, int *ret_n, int *ret_p, Ptr< float > *retU, Ptr< hpoint< float > > *retPw)
template void Circle (point< double > O, point< double > X, point< double > Y, double r, double theta_start, double theta_end, int *ret_n, int *ret_p, Ptr< double > *retU, Ptr< hpoint< double > > *retPw)
template<class T, class CHP> void GULAPI Revolution (point< T > S, point< T > A, T theta, int m, Ptr< CHP > &Pwj, int *ret_nu, int *ret_pu, Ptr< T > *retU, Ptr< Ptr< hpoint< T > > > *retPw)
 Creates a surface of revolution. More...

template GULAPI void Revolution (point< float > S, point< float > A, float theta, int m, Ptr< hpoint< float > > &Pwj, int *ret_nu, int *ret_pu, Ptr< float > *retU, Ptr< Ptr< hpoint< float > > > *retPw)
template GULAPI void Revolution (point< double > S, point< double > A, double theta, int m, Ptr< hpoint< double > > &Pwj, int *ret_nu, int *ret_pu, Ptr< double > *retU, Ptr< Ptr< hpoint< double > > > *retPw)
template GULAPI void Revolution (point< float > S, point< float > A, float theta, int m, Ptr< point< float > > &Pwj, int *ret_nu, int *ret_pu, Ptr< float > *retU, Ptr< Ptr< hpoint< float > > > *retPw)
template GULAPI void Revolution (point< double > S, point< double > A, double theta, int m, Ptr< point< double > > &Pwj, int *ret_nu, int *ret_pu, Ptr< double > *retU, Ptr< Ptr< hpoint< double > > > *retPw)
template GULAPI void Revolution (point< float > S, point< float > A, float theta, int m, Ptr< hpoint2< float > > &Pwj, int *ret_nu, int *ret_pu, Ptr< float > *retU, Ptr< Ptr< hpoint< float > > > *retPw)
template GULAPI void Revolution (point< double > S, point< double > A, double theta, int m, Ptr< hpoint2< double > > &Pwj, int *ret_nu, int *ret_pu, Ptr< double > *retU, Ptr< Ptr< hpoint< double > > > *retPw)
template GULAPI void Revolution (point< float > S, point< float > A, float theta, int m, Ptr< point2< float > > &Pwj, int *ret_nu, int *ret_pu, Ptr< float > *retU, Ptr< Ptr< hpoint< float > > > *retPw)
template GULAPI void Revolution (point< double > S, point< double > A, double theta, int m, Ptr< point2< double > > &Pwj, int *ret_nu, int *ret_pu, Ptr< double > *retU, Ptr< Ptr< hpoint< double > > > *retPw)
template<class T> GULAPI void UnitSphere (int *ret_nu, int *ret_pu, Ptr< T > *retU, int *ret_nv, int *ret_pv, Ptr< T > *retV, Ptr< Ptr< hpoint< T > > > *retPw)
 Creates a unit sphere (centered at origin). More...

template GULAPI void UnitSphere (int *ret_nu, int *ret_pu, Ptr< float > *retU, int *ret_nv, int *ret_pv, Ptr< float > *retV, Ptr< Ptr< hpoint< float > > > *retPw)
template GULAPI void UnitSphere (int *ret_nu, int *ret_pu, Ptr< double > *retU, int *ret_nv, int *ret_pv, Ptr< double > *retV, Ptr< Ptr< hpoint< double > > > *retPw)
template<class T> void CalcGrevilleAbcissa (int n, int p, const Ptr< T > &U, Ptr< T > &G)
template void CalcGrevilleAbcissa (int n, int p, const Ptr< float > &U, Ptr< float > &G)
template void CalcGrevilleAbcissa (int n, int p, const Ptr< double > &U, Ptr< double > &G)
template<class T> GULAPI void EqualSpacedParameters (int n, T u1, T u2, Ptr< T > &U)
template GULAPI void EqualSpacedParameters (int n, float u1, float u2, Ptr< float > &U)
template GULAPI void EqualSpacedParameters (int n, double u1, double u2, Ptr< double > &U)
template<class T, class HP, class EP> void CalcSurfaceMesh (int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, int nSampU, const Ptr< T > &sampU, int nSampV, const Ptr< T > &sampV, Ptr< Ptr< EP > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, int nSampU, const Ptr< float > &sampU, int nSampV, const Ptr< float > &sampV, Ptr< Ptr< point< float > > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, int nSampU, const Ptr< float > &sampU, int nSampV, const Ptr< float > &sampV, Ptr< Ptr< point1< float > > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, int nSampU, const Ptr< float > &sampU, int nSampV, const Ptr< float > &sampV, Ptr< Ptr< point< float > > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, int nSampU, const Ptr< float > &sampU, int nSampV, const Ptr< float > &sampV, Ptr< Ptr< point1< float > > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, int nSampU, const Ptr< double > &sampU, int nSampV, const Ptr< double > &sampV, Ptr< Ptr< point< double > > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, int nSampU, const Ptr< double > &sampU, int nSampV, const Ptr< double > &sampV, Ptr< Ptr< point1< double > > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, int nSampU, const Ptr< double > &sampU, int nSampV, const Ptr< double > &sampV, Ptr< Ptr< point< double > > > &sampP)
template void CalcSurfaceMesh (int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, int nSampU, const Ptr< double > &sampU, int nSampV, const Ptr< double > &sampV, Ptr< Ptr< point1< double > > > &sampP)
template<class T, class HP> GULAPI void ExtractIsoCurveU (T u, int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, Ptr< HP > &Cw)
template GULAPI void ExtractIsoCurveU (float u, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, Ptr< hpoint< float > > &Cw)
template GULAPI void ExtractIsoCurveU (double u, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, Ptr< hpoint< double > > &Cw)
template GULAPI void ExtractIsoCurveU (float u, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, Ptr< point< float > > &Cw)
template GULAPI void ExtractIsoCurveU (double u, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, Ptr< point< double > > &Cw)
template GULAPI void ExtractIsoCurveU (float u, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, Ptr< hpoint1< float > > &Cw)
template GULAPI void ExtractIsoCurveU (double u, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, Ptr< hpoint1< double > > &Cw)
template GULAPI void ExtractIsoCurveU (float u, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, Ptr< point1< float > > &Cw)
template GULAPI void ExtractIsoCurveU (double u, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, Ptr< point1< double > > &Cw)
template<class T, class HP> GULAPI void ExtractIsoCurveV (T v, int nu, int pu, const Ptr< T > &U, int nv, int pv, const Ptr< T > &V, const Ptr< Ptr< HP > > &Pw, Ptr< HP > &Cw)
template GULAPI void ExtractIsoCurveV (float v, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint< float > > > &Pw, Ptr< hpoint< float > > &Cw)
template GULAPI void ExtractIsoCurveV (double v, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint< double > > > &Pw, Ptr< hpoint< double > > &Cw)
template GULAPI void ExtractIsoCurveV (float v, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point< float > > > &Pw, Ptr< point< float > > &Cw)
template GULAPI void ExtractIsoCurveV (double v, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point< double > > > &Pw, Ptr< point< double > > &Cw)
template GULAPI void ExtractIsoCurveV (float v, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< hpoint1< float > > > &Pw, Ptr< hpoint1< float > > &Cw)
template GULAPI void ExtractIsoCurveV (double v, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< hpoint1< double > > > &Pw, Ptr< hpoint1< double > > &Cw)
template GULAPI void ExtractIsoCurveV (float v, int nu, int pu, const Ptr< float > &U, int nv, int pv, const Ptr< float > &V, const Ptr< Ptr< point1< float > > > &Pw, Ptr< point1< float > > &Cw)
template GULAPI void ExtractIsoCurveV (double v, int nu, int pu, const Ptr< double > &U, int nv, int pv, const Ptr< double > &V, const Ptr< Ptr< point1< double > > > &Pw, Ptr< point1< double > > &Cw)
template<class T, class HP> void _DoLinearizeTrimmedSurface (int current_iter, int max_iter, TessInfo< T, HP > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< T > *Gconv, const T tol, void outfunc1(gunu::TessInfo< T, HP > *, void *), void outfunc2(gunu::TessInfo< T, HP > *, gugr::GraphInfo *, gugr::GraphConvInfo< T > *, void *), void *usrdata)
template void _DoLinearizeTrimmedSurface (int current_iter, int max_iter, TessInfo< float, hpoint< float > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< float > *Gconv, const float tol, void outfunc1(TessInfo< float, hpoint< float > > *, void *), void outfunc2(TessInfo< float, hpoint< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *), void *usrdata)
template void _DoLinearizeTrimmedSurface (int current_iter, int max_iter, TessInfo< double, hpoint< double > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< double > *Gconv, const double tol, void outfunc1(TessInfo< double, hpoint< double > > *, void *), void outfunc2(TessInfo< double, hpoint< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *), void *usrdata)
template void _DoLinearizeTrimmedSurface (int current_iter, int max_iter, TessInfo< float, point< float > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< float > *Gconv, const float tol, void outfunc1(TessInfo< float, point< float > > *, void *), void outfunc2(TessInfo< float, point< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *), void *usrdata)
template void _DoLinearizeTrimmedSurface (int current_iter, int max_iter, TessInfo< double, point< double > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< double > *Gconv, const double tol, void outfunc1(TessInfo< double, point< double > > *, void *), void outfunc2(TessInfo< double, point< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *), void *usrdata)
template<class T, class HP> GULAPI void TessQuadCb (TessInfo< T, HP > *A, void *usrdata)
template GULAPI void TessQuadCb (TessInfo< float, hpoint< float > > *A, void *usrdata)
template GULAPI void TessQuadCb (TessInfo< float, point< float > > *A, void *usrdata)
template GULAPI void TessQuadCb (TessInfo< double, hpoint< double > > *A, void *usrdata)
template GULAPI void TessQuadCb (TessInfo< double, point< double > > *A, void *usrdata)
template<class T> vertex_convert_cache< T > * FillVertexCache (vertex_rep *vert, const int code, bool normals, const T &orgx, const T &orgy, const T &scale, const T &u0, const T &v0, const T &w, const T &h, const T &a, const point< T > &W1, const point< T > &V2, const point< T > &V1, const point< T > &U1, const point< T > &W1n, const point< T > &V2n, const point< T > &V1n, const point< T > &U1n)
template<class T, class HP> GULAPI void TessTriCb (TessInfo< T, HP > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< T > *Gconv, void *data)
template GULAPI void TessTriCb (TessInfo< float, hpoint< float > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< float > *Gconv, void *data)
template GULAPI void TessTriCb (TessInfo< float, point< float > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< float > *Gconv, void *data)
template GULAPI void TessTriCb (TessInfo< double, hpoint< double > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< double > *Gconv, void *data)
template GULAPI void TessTriCb (TessInfo< double, point< double > > *A, gugr::GraphInfo *G, gugr::GraphConvInfo< double > *Gconv, void *data)
template<class T, class HP> GULAPI void DoLinearizeTrimmedSurface (int max_iter, const int nu, const int pu, Ptr< T > &KnotsU, const int nv, const int pv, Ptr< T > &KnotsV, Ptr< Ptr< HP > > &Pw, const T tol, Ptr< Ptr< point2< T > > > &contour, void(*outfunc1)(TessInfo< T, HP > *, void *), void(*outfunc2)(TessInfo< T, HP > *, gugr::GraphInfo *, gugr::GraphConvInfo< T > *, void *), void *usrdata)
template<class T, class HP, class EP, class DP> void LinearizeTrimmedSurface (int max_iter, const int nu, const int pu, Ptr< T > &KnotsU, const int nv, const int pv, Ptr< T > &KnotsV, Ptr< Ptr< HP > > &Pw, const T tol, Ptr< Ptr< DP > > &contour, bool normal_flag, void(*quadfunc)(void *, const EP *, const EP *, const EP *, const EP *, const EP *, const EP *, const EP *, const EP *, const T *, const T *, const T *, const T *), void(*trifunc)(void *, const EP *, const EP *, const EP *, const EP *, const EP *, const EP *, const DP *, const DP *, const DP *), void *usrdata)
template GULAPI void DoLinearizeTrimmedSurface (int max_iter, const int nu, const int pu, Ptr< float > &KnotsU, const int nv, const int pv, Ptr< float > &KnotsV, Ptr< Ptr< hpoint< float > > > &Pw, const float tol, Ptr< Ptr< point2< float > > > &contour, void outfunc1(gunu::TessInfo< float, hpoint< float > > *, void *), void outfunc2(gunu::TessInfo< float, hpoint< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *), void *usrdata)
template GULAPI void DoLinearizeTrimmedSurface (int max_iter, const int nu, const int pu, Ptr< double > &KnotsU, const int nv, const int pv, Ptr< double > &KnotsV, Ptr< Ptr< hpoint< double > > > &Pw, const double tol, Ptr< Ptr< point2< double > > > &contour, void outfunc1(TessInfo< double, hpoint< double > > *, void *), void outfunc2(TessInfo< double, hpoint< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *), void *usrdata)
template GULAPI void DoLinearizeTrimmedSurface (int max_iter, const int nu, const int pu, Ptr< float > &KnotsU, const int nv, const int pv, Ptr< float > &KnotsV, Ptr< Ptr< point< float > > > &Pw, const float tol, Ptr< Ptr< point2< float > > > &contour, void outfunc1(gunu::TessInfo< float, point< float > > *, void *), void outfunc2(gunu::TessInfo< float, point< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *), void *usrdata)
template GULAPI void DoLinearizeTrimmedSurface (int max_iter, const int nu, const int pu, Ptr< double > &KnotsU, const int nv, const int pv, Ptr< double > &KnotsV, Ptr< Ptr< point< double > > > &Pw, const double tol, Ptr< Ptr< point2< double > > > &contour, void outfunc1(TessInfo< double, point< double > > *, void *), void outfunc2(TessInfo< double, point< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *), void *usrdata)

Variables

template class minbbox_rec< float >
template class minbbox_rec< double >


Function Documentation

template void _DoLinearizeTrimmedSurface int    current_iter,
int    max_iter,
TessInfo< double, point< double > > *    A,
gugr::GraphInfo   G,
gugr::GraphConvInfo< double > *    Gconv,
const double    tol,
void outfunc1(TessInfo< double, point< double > > *, void *)   ,
void outfunc2(TessInfo< double, point< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *)   ,
void *    usrdata
 

template void _DoLinearizeTrimmedSurface int    current_iter,
int    max_iter,
TessInfo< float, point< float > > *    A,
gugr::GraphInfo   G,
gugr::GraphConvInfo< float > *    Gconv,
const float    tol,
void outfunc1(TessInfo< float, point< float > > *, void *)   ,
void outfunc2(TessInfo< float, point< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *)   ,
void *    usrdata
 

template void _DoLinearizeTrimmedSurface int    current_iter,
int    max_iter,
TessInfo< double, hpoint< double > > *    A,
gugr::GraphInfo   G,
gugr::GraphConvInfo< double > *    Gconv,
const double    tol,
void outfunc1(TessInfo< double, hpoint< double > > *, void *)   ,
void outfunc2(TessInfo< double, hpoint< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *)   ,
void *    usrdata
 

template void _DoLinearizeTrimmedSurface int    current_iter,
int    max_iter,
TessInfo< float, hpoint< float > > *    A,
gugr::GraphInfo   G,
gugr::GraphConvInfo< float > *    Gconv,
const float    tol,
void outfunc1(TessInfo< float, hpoint< float > > *, void *)   ,
void outfunc2(TessInfo< float, hpoint< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *)   ,
void *    usrdata
 

template<class T, class HP>
void gunu::_DoLinearizeTrimmedSurface int    current_iter,
int    max_iter,
TessInfo< T, HP > *    A,
gugr::GraphInfo   G,
gugr::GraphConvInfo< T > *    Gconv,
const T    tol,
void outfunc1(gunu::TessInfo< T, HP > *, void *)   ,
void outfunc2(gunu::TessInfo< T, HP > *, gugr::GraphInfo *, gugr::GraphConvInfo< T > *, void *)   ,
void *    usrdata
 

Definition at line 80 of file gunu_tesselate.cpp.

00089 {
00090   int nA,i;
00091   TessInfo<T,HP> **pA;  
00092   gugr::GraphInfo *Gsub[4];
00093 
00094   /*
00095   cout << "iter: " << current_iter << "\n";
00096       
00097   cout << gul::dump_surf<T,HP>( 
00098               A->org->nu, A->org->pu, A->org->U,
00099               A->org->nv, A->org->pv, A->org->V,
00100               A->org->Pw ) << "\n";  
00101   */
00102 
00103   if( !A->linearized && !A->divided )
00104   {      
00105     if( current_iter < max_iter )
00106       LinearizeOrDivide<T,HP>( A, tol );
00107     else
00108       A->linearized = 1;
00109   }
00110 
00111   /*
00112   cout << "in LinearizeTrimmedSurface\n";
00113   cout << "**************************\n";
00114   gugr::Dump<T>::dump_vertices( G->V.head );
00115   gugr::Dump<T>::dump_edges( G->E.head );
00116   */
00117 
00118   if( !A->linearized )
00119   {
00120 
00121     for( i = 0; i < 4; i++ ) Gsub[i] = new gugr::GraphInfo();
00122     gugr::SplitGraph( G, (A->u1+A->u2)/(T)2.0, (A->v1+A->v2)/(T)2.0, Gconv, 
00123                       Gsub );
00124     
00125     nA = 4;
00126     pA = A->sub;
00127 
00128     for( i = 0; i < nA; i++ )          /* Rekursion */
00129     {
00130       if( (Gsub[i]->V.nElems==4) && (Gsub[i]->E.nElems==4) )
00131       {
00132         if( Gsub[i]->face > 0 ) 
00133           DoLinearizeSurface( current_iter+1, max_iter, pA[i], tol,
00134                               outfunc1, usrdata );
00135       }
00136       else
00137       {
00138         _DoLinearizeTrimmedSurface( current_iter+1, max_iter, 
00139                   pA[i], Gsub[i], Gconv, tol, outfunc1, outfunc2, usrdata );
00140       }
00141      
00142       delete pA[i];
00143       pA[i] = 0;      
00144       delete Gsub[i];
00145       Gsub[i] = 0;
00146     }
00147   }
00148   else       /* ------- output ------------------ */  
00149   {
00150     if( (G->V.nElems==4) && (G->E.nElems==4) )
00151     {
00152       if( G->face > 0 ) outfunc1( A, usrdata );
00153     }
00154     else
00155     {
00156       outfunc2( A, G, Gconv, usrdata );
00157     }    
00158   }
00159 }

template void BAapproximate int    nP,
Ptr< point< double > > &    P,
Ptr< double > &    Sigma,
int    nu,
int    pu,
Ptr< double > &    U,
int    nv,
int    pv,
Ptr< double > &    V,
Ptr< Ptr< point1< double > > > &    delta
 

template void BAapproximate int    nP,
Ptr< point< float > > &    P,
Ptr< float > &    Sigma,
int    nu,
int    pu,
Ptr< float > &    U,
int    nv,
int    pv,
Ptr< float > &    V,
Ptr< Ptr< point1< float > > > &    delta
 

template<class T>
void gunu::BAapproximate int    nP,
Ptr< point< T > > &    P,
Ptr< T > &    Sigma,
int    nu,
int    pu,
Ptr< T > &    U,
int    nv,
int    pv,
Ptr< T > &    V,
Ptr< Ptr< point1< T > > > &    delta
 

BSpline approximation, calculates the points of a control lattice 'delta', which approximates data points in 'P'.

(P[].z contains the function value, P[].x and P[].y the location in the domain). An individual standard deviation for each data point must be given in 'Sigma'

Definition at line 149 of file gunu_mba_approximate.cpp.

00154 {
00155   Ptr<T> Nu, Nv;
00156   Ptr< Ptr<T> > omega, w, w2;
00157   int i,j,k,l,C,uspan,vspan,uind,vind; 
00158   T factor, sum_w2;
00159 
00160 /* ---- reserve local arrays ------------------- */ 
00161 
00162   omega.reserve_pool(nv+1);
00163   for( i = 0; i < nv+1; i++ )
00164     omega[i].reserve_pool(nu+1);
00165 
00166   w.reserve_pool(pu+1);
00167   w2.reserve_pool(pu+1);
00168   for( i = 0; i < pu+1; i++ )
00169   {
00170     w[i].reserve_pool(pv+1);
00171     w2[i].reserve_pool(pv+1);
00172   }
00173   Nu.reserve_pool(pu+1);
00174   Nv.reserve_pool(pv+1);
00175   
00176   for( j = 0; j <= nv; j++ )
00177   {
00178     for( i = 0; i <= nu; i++ )
00179     {
00180       delta[j][i].x = (T)0;
00181       omega[j][i] = (T)0;
00182     }  
00183   }          
00184   for( C = 0; C < nP; C++ )
00185   {
00186     uspan = FindSpan( P[C].x, nu, pu, U );
00187     CalcBasisFunctions( P[C].x, uspan, pu, U, Nu );
00188 
00189     vspan = FindSpan( P[C].y, nv, pv, V );
00190     CalcBasisFunctions( P[C].y, vspan, pv, V, Nv );
00191 
00192     sum_w2 = (T)0;
00193     for( k = 0; k <= pu; k++ ) 
00194     {
00195       for( l = 0; l <= pv; l++ )
00196       {
00197         w[k][l] = Nu[k] * Nv[l];
00198         w2[k][l] = w[k][l] * w[k][l];
00199         sum_w2 += w2[k][l];      
00200       }
00201     }
00202     factor = (T)1 / (Sigma[C] * Sigma[C]); 
00203       
00204     uind = uspan - pu;
00205     vind = vspan - pv;
00206     for( k = 0; k <= pu; k++ )
00207     {
00208       for( l = 0; l <= pv; l++ )
00209       {
00210         w2[k][l] *= factor;             /* (weight/standard_deviation)^2 */
00211         
00212         delta[vind+l][uind+k].x += w2[k][l] * w[k][l] * P[C].z / sum_w2;
00213         omega[vind+l][uind+k] += w2[k][l];
00214       }
00215     }
00216   }
00217   for( j = 0; j <= nv; j++ )
00218   {
00219     for( i = 0; i <= nu; i++ )
00220     {
00221       if( omega[j][i] != (T)0 )
00222         delta[j][i].x /= omega[j][i];
00223       else
00224         delta[j][i].x = (T)0;
00225     }
00226   }                 
00227 }

template void BAapproximate int    nP,
Ptr< point< double > > &    P,
int    nu,
int    pu,
Ptr< double > &    U,
int    nv,
int    pv,
Ptr< double > &    V,
Ptr< Ptr< point1< double > > > &    delta
 

template void BAapproximate int    nP,
Ptr< point< float > > &    P,
int    nu,
int    pu,
Ptr< float > &    U,
int    nv,
int    pv,
Ptr< float > &    V,
Ptr< Ptr< point1< float > > > &    delta
 

template<class T>
void gunu::BAapproximate int    nP,
Ptr< point< T > > &    P,
int    nu,
int    pu,
Ptr< T > &    U,
int    nv,
int    pv,
Ptr< T > &    V,
Ptr< Ptr< point1< T > > > &    delta
 

BSpline approximation, calculates the points of a control lattice 'delta', which approximates data points in 'P'.

(P[].z contains the function value, P[].x and P[].y the location in the domain)

Definition at line 55 of file gunu_mba_approximate.cpp.

00060 {
00061   Ptr<T> Nu, Nv;
00062   Ptr< Ptr<T> > omega, w, w2;
00063   int i,j,k,l,C,uspan,vspan,uind,vind; 
00064   T sum_w2;
00065 
00066 /* ---- reserve local arrays ------------------- */ 
00067 
00068   omega.reserve_pool(nv+1);
00069   for( i = 0; i < nv+1; i++ )
00070     omega[i].reserve_pool(nu+1);
00071 
00072   w.reserve_pool(pu+1);
00073   w2.reserve_pool(pu+1);
00074   for( i = 0; i < pu+1; i++ )
00075   {
00076     w[i].reserve_pool(pv+1);
00077     w2[i].reserve_pool(pv+1);
00078   }
00079   Nu.reserve_pool(pu+1);
00080   Nv.reserve_pool(pv+1);
00081   
00082   for( j = 0; j <= nv; j++ )
00083   {
00084     for( i = 0; i <= nu; i++ )
00085     {
00086       delta[j][i].x = (T)0;
00087       omega[j][i] = (T)0;
00088     }  
00089   }          
00090   for( C = 0; C < nP; C++ )
00091   {
00092     uspan = FindSpan( P[C].x, nu, pu, U );
00093     CalcBasisFunctions( P[C].x, uspan, pu, U, Nu );
00094 
00095     vspan = FindSpan( P[C].y, nv, pv, V );
00096     CalcBasisFunctions( P[C].y, vspan, pv, V, Nv );
00097 
00098     sum_w2 = (T)0;
00099     for( k = 0; k <= pu; k++ ) 
00100     {
00101       for( l = 0; l <= pv; l++ )
00102       {
00103         w[k][l] = Nu[k] * Nv[l];
00104         w2[k][l] = w[k][l] * w[k][l];
00105         sum_w2 += w2[k][l];      
00106       }
00107     }
00108     uind = uspan - pu;
00109     vind = vspan - pv;
00110     for( k = 0; k <= pu; k++ )
00111     {
00112       for( l = 0; l <= pv; l++ )
00113       {
00114         delta[vind+l][uind+k].x += w2[k][l] * w[k][l] * P[C].z / sum_w2;
00115         omega[vind+l][uind+k] += w2[k][l];
00116       }
00117     }
00118   }
00119   for( j = 0; j <= nv; j++ )
00120   {
00121     for( i = 0; i <= nu; i++ )
00122     {
00123       if( omega[j][i] != (T)0 )
00124         delta[j][i].x /= omega[j][i];
00125       else
00126         delta[j][i].x = (T)0;
00127     }
00128   }                 
00129 }

template<class T, class EP>
void BezierBSPCurveDerivatives const T    u,
const int    p,
const Ptr< T > &    U,
const Ptr< EP > &    Pw,
const int    d,
EP *    CK
 

template void BezierBSPCurveDerivatives const double    u,
const int    p,
const Ptr< double > &    U,
const Ptr< point2< double > > &    Pw,
const int    d,
Ptr< point2< double > > &    CK
 

template void BezierBSPCurveDerivatives const float    u,
const int    p,
const Ptr< float > &    U,
const Ptr< point2< float > > &    Pw,
const int    d,
Ptr< point2< float > > &    CK
 

template void BezierBSPCurveDerivatives const double    u,
const int    p,
const Ptr< double > &    U,
const Ptr< point< double > > &    Pw,
const int    d,
Ptr< point< double > > &    CK
 

template void BezierBSPCurveDerivatives const float    u,
const int    p,
const Ptr< float > &    U,
const Ptr< point< float > > &    Pw,
const int    d,
Ptr< point< float > > &    CK
 

template<class T, class EP>
void BezierBSPCurveDerivatives const T    u,
const int    p,
const Ptr< T > &    U,
const Ptr< EP > &    Pw,
const int    d,
Ptr< EP > &    CK
 

Definition at line 58 of file gunu_bezier_derivatives.cpp.

00061 {
00062   int du,k,j,span;
00063   EP v1;
00064   Ptr< Ptr< T > > ders;
00065     
00066   du = Min( d, p );
00067 
00068   ders.reserve_place( reserve_stack(Ptr< T >,du+1), du+1 );
00069   for( j = 0; j < p+1; j++ )
00070     ders[j].reserve_place( reserve_stack(T,p+1), p+1 );
00071 
00072   for( k = p+1; k <= d; k++ )
00073     set( CK[k], (T)0.0 );   /* Ableitungen > Grad = 0 */
00074 
00075   span = p;
00076   CalcDersBasisFuns( u, span, p, du, U, ders );
00077   
00078   for( k = 0; k <= du; k++ )
00079   {
00080     set( CK[k], (T)0.0 );
00081     for( j = 0; j <= p; j++ )
00082     {
00083       v1 = ders[k][j] * Pw[span-p+j];
00084       CK[k] = CK[k] + v1;
00085     }
00086   }
00087 }  

template void BezierBSPSurfaceDerivatives const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
const int    d,
Ptr< Ptr< hpoint< double > > > &    SKL
 

template void BezierBSPSurfaceDerivatives const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
const int    d,
Ptr< Ptr< hpoint< float > > > &    SKL
 

template void BezierBSPSurfaceDerivatives const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
const int    d,
Ptr< Ptr< point< double > > > &    SKL
 

template void BezierBSPSurfaceDerivatives const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
const int    d,
Ptr< Ptr< point< float > > > &    SKL
 

template<class T, class EP>
void gunu::BezierBSPSurfaceDerivatives const T    u,
const T    v,
const int    pu,
const Ptr< T > &    U,
const int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< EP > > &    Pw,
const int    d,
Ptr< Ptr< EP > > &    SKL
 

Definition at line 112 of file gunu_bezier_derivatives.cpp.

00118 {                
00119   int du,dv,k,l,uspan,vspan,s,r,dd;
00120   EP v1;
00121   Ptr< EP > temp;
00122   Ptr< Ptr< T > > Nu,Nv;
00123 
00124   du = Min( d, pu );
00125   dv = Min( d, pv );
00126 
00127   Nu.reserve_place( reserve_stack(Ptr< T >,du+1), du+1 );
00128   for( k = 0; k < pu+1; k++ )
00129     Nu[k].reserve_place( reserve_stack(T,pu+1), pu+1 );
00130 
00131   Nv.reserve_place( reserve_stack(Ptr< T >,dv+1), dv+1 );
00132   for( k = 0; k < pv+1; k++ )
00133     Nv[k].reserve_place( reserve_stack(T,pv+1), pv+1 );
00134 
00135   temp.reserve_place( reserve_stack(EP,pv+1), pv+1 );
00136 
00137   for( k = pu+1; k <= d; k++ )
00138     for( l = 0; l <= d - k; l++ )
00139       set( SKL[k][l], (T)0.0 );
00140       
00141   for( l = pv+1; l <= d; l++ )
00142     for( k = 0; k <= d - l; k++ )
00143       set( SKL[k][l], (T)0.0 );
00144       
00145   uspan = pu;
00146   CalcDersBasisFuns( u, uspan, pu, du, U, Nu );
00147  
00148   vspan = pv;
00149   CalcDersBasisFuns( v, vspan, pv, dv, V, Nv );
00150   
00151   for( k = 0; k <= du; k++ )
00152   {
00153     for( s = 0; s <= pv; s++ )
00154     {
00155       set( temp[s], (T)0.0 );
00156       for( r = 0; r <= pu; r++ )
00157       {
00158         v1 = Nu[k][r] * Pw[vspan-pv+s][uspan-pu+r];
00159         temp[s] = temp[s] + v1;
00160       }  
00161     }
00162     dd = Min( d - k, dv );
00163     for( l = 0; l <= dd; l++ )
00164     {
00165       set( SKL[k][l], (T)0.0 );
00166       for( s = 0; s <= pv; s++ )
00167       {
00168         v1 = Nv[l][s] * temp[s];
00169         SKL[k][l] = SKL[k][l] + v1;
00170       }
00171     }
00172   }
00173 }  

template<class T, class HP, class EP>
void BezierCurveDerivatives const T    u,
const int    p,
const Ptr< T > &    U,
const Ptr< HP > &    Pw,
const int    d,
EP *    CK
 

template void BezierCurveDerivatives const double    u,
const int    p,
const Ptr< double > &    U,
const Ptr< hpoint2< double > > &    Pw,
const int    d,
Ptr< point2< double > > &    CK
 

template void BezierCurveDerivatives const float    u,
const int    p,
const Ptr< float > &    U,
const Ptr< hpoint2< float > > &    Pw,
const int    d,
Ptr< point2< float > > &    CK
 

template void BezierCurveDerivatives const double    u,
const int    p,
const Ptr< double > &    U,
const Ptr< hpoint< double > > &    Pw,
const int    d,
Ptr< point< double > > &    CK
 

template void BezierCurveDerivatives const float    u,
const int    p,
const Ptr< float > &    U,
const Ptr< hpoint< float > > &    Pw,
const int    d,
Ptr< point< float > > &    CK
 

template<class T, class HP, class EP>
void BezierCurveDerivatives const T    u,
const int    p,
const Ptr< T > &    U,
const Ptr< HP > &    Pw,
const int    d,
Ptr< EP > &    CK
 

Definition at line 208 of file gunu_bezier_derivatives.cpp.

00212 {
00213   Ptr< HP > CKh;
00214   EP v,v1;
00215   T w0;
00216   int k,i;
00217 
00218   CKh.reserve_place( reserve_stack(HP,d+1), d+1 );
00219      
00220   BezierBSPCurveDerivatives<T,HP>( u, p, U, Pw, d, CKh );
00221 
00222   w0 = CKh[0].w;
00223   
00224   for( k = 0; k <= d; k++ )
00225   {
00226     v = ortho( CKh[k] );
00227     
00228     for( i = 1; i <= k; i++ )
00229     {
00230       v1 = (rtr<T>::BinCoeff(k,i) * CKh[i].w) * CK[k-i];
00231       v = v - v1;
00232     }
00233     CK[k] = ((T)1.0 / w0) * v;       
00234   }
00235 }

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< double > &    U,
const Ptr< hpoint2< double > > &    Pw,
Ptr< Ptr< hpoint2< double > > > *    retQw
 

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< double > &    U,
const Ptr< point2< double > > &    Pw,
Ptr< Ptr< point2< double > > > *    retQw
 

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< double > &    U,
const Ptr< hpoint< double > > &    Pw,
Ptr< Ptr< hpoint< double > > > *    retQw
 

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< double > &    U,
const Ptr< point< double > > &    Pw,
Ptr< Ptr< point< double > > > *    retQw
 

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< float > &    U,
const Ptr< hpoint2< float > > &    Pw,
Ptr< Ptr< hpoint2< float > > > *    retQw
 

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< float > &    U,
const Ptr< point2< float > > &    Pw,
Ptr< Ptr< point2< float > > > *    retQw
 

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< float > &    U,
const Ptr< hpoint< float > > &    Pw,
Ptr< Ptr< hpoint< float > > > *    retQw
 

template void BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< float > &    U,
const Ptr< point< float > > &    Pw,
Ptr< Ptr< point< float > > > *    retQw
 

template<class T, class HP>
void gunu::BezierDecomposeCurve int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    n,
int    p,
const Ptr< T > &    U,
const Ptr< HP > &    Pw,
Ptr< Ptr< HP > > *    retQw
 

decompose a curve into its Bezier segments.

returns the number of created segments

Definition at line 287 of file gunu_refine.cpp.

00291 {
00292   int m,a,b,nb,i,j,mult,save,r,s,k;
00293   T numer,alpha;
00294   Ptr<T> alphas;
00295   Ptr< Ptr<HP> > Qw;
00296 
00297   Qw.reserve_pool(nK+1);
00298   for( nb = 0; nb <= nK; nb++ )
00299     Qw[nb].reserve_pool(p+1);
00300 
00301   alphas.reserve_pool(p+1);
00302 
00303   m = n + p + 1;
00304   a = p;
00305   b = p+1;
00306   nb = 0;
00307  
00308   /* initialise first segment */
00309   for( i = 0; i <= p; i++ )
00310     Qw[nb][i] = Pw[i];
00311     
00312   while( nb < nK )
00313   {
00314     b = K[nb];
00315     mult = M[nb];
00316       
00317     if( mult < p )
00318     {
00319       numer = U[b] - U[a];          /* numerator of alpha */
00320 
00321       for( j = p; j > mult; j-- )                      /* j = p,..,p-r */
00322         alphas[j-mult-1] = numer / (U[a+j] - U[a]);
00323 
00324       r = p - mult;                             /* insert knot r-times */
00325       
00326       for( j = 1; j <= r; j++ )
00327       {
00328         save = r - j;
00329         
00330         s = mult + j;
00331         
00332         for( k = p; k >= s; k-- )
00333         {
00334           alpha = alphas[k-s];
00335 
00336           Qw[nb][k] = alpha * Qw[nb][k] + ((T)1 - alpha) * Qw[nb][k-1];
00337         }
00338         if( b < m )                 
00339         {
00340           Qw[nb+1][save] = Qw[nb][p];
00341         }
00342       }
00343     }        
00344     nb = nb + 1;                          /* next Bezier segment */  
00345 
00346     if( nb < nK )
00347     {
00348       for( i = p - mult; i <= p; i++ )
00349         Qw[nb][i] = Pw[b-p+i];
00350       a = b;
00351       b = b+1;
00352     }
00353   }
00354 }

template<class T, class HP>
void BezierDecomposeSurface int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
int    dir,
Ptr< Ptr< Ptr< HP > > > *    retQw
[inline]
 

Definition at line 131 of file gunu_refine.h.

00136 {
00137   int nK;
00138   Ptr<int> K,M;
00139   
00140   if( dir == gul::u_direction )
00141   {
00142     nK = BezierPositions( nu, pu, U, K, M );
00143     BezierDecomposeSurfaceU( nK,K,M,nu,pu,U,nv,pv,V,Pw,retQw );
00144   }
00145   else
00146   {
00147     nK = BezierPositions( nv, pv, V, K, M );
00148     BezierDecomposeSurfaceV( nK,K,M,nu,pu,U,nv,pv,V,Pw,retQw );
00149   }
00150 }

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
Ptr< Ptr< Ptr< hpoint1< double > > > > *    retQw
 

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
Ptr< Ptr< Ptr< point1< double > > > > *    retQw
 

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
Ptr< Ptr< Ptr< hpoint< double > > > > *    retQw
 

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
Ptr< Ptr< Ptr< point< double > > > > *    retQw
 

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
Ptr< Ptr< Ptr< hpoint1< float > > > > *    retQw
 

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
Ptr< Ptr< Ptr< point1< float > > > > *    retQw
 

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
Ptr< Ptr< Ptr< hpoint< float > > > > *    retQw
 

template void BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
Ptr< Ptr< Ptr< point< float > > > > *    retQw
 

template<class T, class HP>
void gunu::BezierDecomposeSurfaceU int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
Ptr< Ptr< Ptr< HP > > > *    retQw
 

decompose a surface in u or v direction into its Bezier segments.

when for example decomposing in U-direction, the function returns a array containing bezier strips with [nv+1]*[pu+1] control point matrices, the function result is the number of created bezier segments

Definition at line 415 of file gunu_refine.cpp.

00421 {
00422   int m,a,b,nb,i,j,mult,save,r,s,k,row;
00423   T numer,alpha;
00424   Ptr<T> alphas;
00425   Ptr< Ptr< Ptr<HP> > > Qw;
00426   
00427   Qw.reserve_pool(nK);
00428   for( nb = 0; nb < nK; nb++ )
00429   {
00430     Qw[nb].reserve_pool(nv+1);
00431     for( i = 0; i <= nv; i++ )
00432       Qw[nb][i].reserve_pool(pu+1);
00433   }
00434  
00435   alphas.reserve_pool(pu+1);
00436  
00437   m = nu + pu + 1;
00438   a = pu;
00439   b = pu+1;
00440   nb = 0;
00441   
00442   // initialize first Bezier segment
00443   for( row = 0; row <= nv; row++ )
00444     for( i = 0; i <= pu; i++ )
00445       Qw[nb][row][i] = Pw[row][i];
00446     
00447   while( nb < nK )
00448   {
00449     b = K[nb];
00450     mult = M[nb];
00451 
00452     if( mult < pu )
00453     {
00454       numer = U[b] - U[a];                           /* numerator of alpha */
00455 
00456       for( j = pu; j > mult; j-- )                   /* j = p,..,p-r */
00457         alphas[j-mult-1] = numer / (U[a+j] - U[a]);
00458 
00459       r = pu - mult;                             /* insert knot r-times */
00460       
00461       for( j = 1; j <= r; j++ )
00462       {
00463         save = r - j;
00464         
00465         s = mult + j;
00466         
00467         for( k = pu; k >= s; k-- )
00468         {
00469           alpha = alphas[k-s];
00470 
00471           for( row = 0; row <= nv; row ++ )
00472           {
00473             Qw[nb][row][k] =
00474                 alpha * Qw[nb][row][k] + ((T)1 - alpha) * Qw[nb][row][k-1];
00475           }
00476         }
00477 
00478         if( b < m )
00479         {
00480           for( row = 0; row <= nv; row ++ )
00481             Qw[nb+1][row][save] = Qw[nb][row][pu];
00482         }
00483       }
00484     }
00485 
00486     nb = nb + 1;                          /* next Bezier segment */  
00487 
00488     if( nb < nK )
00489     {
00490       for( row = 0; row <= nv; row++ )
00491         for( i = pu - mult; i <= pu; i++ )
00492           Qw[nb][row][i] = Pw[row][b-pu+i];
00493       a = b;
00494     }
00495   }
00496 
00497   *retQw = Qw;
00498 }

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
Ptr< Ptr< Ptr< hpoint1< double > > > > *    retQw
 

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
Ptr< Ptr< Ptr< point1< double > > > > *    retQw
 

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
Ptr< Ptr< Ptr< hpoint< double > > > > *    retQw
 

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
Ptr< Ptr< Ptr< point< double > > > > *    retQw
 

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
Ptr< Ptr< Ptr< hpoint1< float > > > > *    retQw
 

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
Ptr< Ptr< Ptr< point1< float > > > > *    retQw
 

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
Ptr< Ptr< Ptr< hpoint< float > > > > *    retQw
 

template void BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
Ptr< Ptr< Ptr< point< float > > > > *    retQw
 

template<class T, class HP>
void gunu::BezierDecomposeSurfaceV int    nK,
const Ptr< int > &    K,
const Ptr< int > &    M,
int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
Ptr< Ptr< Ptr< HP > > > *    retQw
 

decompose a surface in u or v direction into its Bezier segments.

when for example decomposing in U-direction, the function returns a array containing bezier strips with [nv+1]*[pu+1] control point matrices, the function result is the number of created bezier segments

Definition at line 179 of file gunu_refine2.cpp.

00185 {
00186   int m,a,b,nb,i,j,mult,save,r,s,k,col;
00187   T numer,alpha;
00188   Ptr<T> alphas;
00189   Ptr< Ptr< Ptr<HP> > > Qw;
00190 
00191   Qw.reserve_pool(nK);
00192   for( nb = 0; nb < nK; nb++ )
00193   {
00194     Qw[nb].reserve_pool(pv+1);
00195     for( i = 0; i <= pv; i++ )
00196       Qw[nb][i].reserve_pool(nu+1);
00197   }  
00198   
00199   alphas.reserve_pool(pv+1);
00200 
00201   m = nv + pv + 1;
00202   a = pv;
00203   b = pv+1;
00204   nb = 0;
00205   
00206   // initialize first Bezier segment
00207   for( i = 0; i <= pv; i++ )
00208     for( col = 0; col <= nu; col++ )
00209       Qw[nb][i][col] = Pw[i][col];
00210     
00211   while( nb < nK )
00212   {
00213     b = K[nb];
00214     mult = M[nb];
00215 
00216     if( mult < pv )
00217     {
00218       numer = V[b] - V[a];                           /* numerator of alpha */
00219 
00220       for( j = pv; j > mult; j-- )                   /* j = p,..,p-r */
00221       alphas[j-mult-1] = numer / (V[a+j] - V[a]);
00222 
00223       r = pv - mult;                             /* insert knot r-times */
00224       
00225       for( j = 1; j <= r; j++ )
00226       {
00227         save = r - j;
00228         
00229         s = mult + j;
00230         
00231         for( k = pv; k >= s; k-- )
00232         {
00233           alpha = alphas[k-s];
00234 
00235           for( col = 0; col <= nu; col++ )
00236           {
00237             Qw[nb][k][col] = 
00238                    alpha * Qw[nb][k][col] + ((T)1 - alpha) * Qw[nb][k-1][col];
00239           }
00240         }
00241         if( b < m )                 
00242         {
00243           for( col = 0; col <= nu; col ++ )
00244             Qw[nb+1][save][col] = Qw[nb][pv][col];
00245         }      
00246       }        
00247     }        
00248     nb = nb + 1;                          /* next Bezier segment */  
00249 
00250     if( nb < nK )
00251     {
00252       for( i = pv - mult; i <= pv; i++ )
00253         for( col = 0; col <= nu; col++ )
00254           Qw[nb][i][col] = Pw[b-pv+i][col];
00255        a = b;
00256     }
00257   }
00258 
00259   *retQw = Qw;
00260 }

template<class T>
void BezierKnotVector const int    p,
Ptr< T > &    U
 

Definition at line 136 of file gunu_basics.h.

00137 {
00138   int i;
00139   
00140   for( i = 0; i <= p; i++ )
00141   {
00142     U[i] = 0.;
00143     U[p+1+i] = 1.;
00144   }
00145 }

template int BezierPositions int    n,
int    p,
const Ptr< double > &    U,
Ptr< int > &    K,
Ptr< int > &    M
 

template int BezierPositions int    n,
int    p,
const Ptr< float > &    U,
Ptr< int > &    K,
Ptr< int > &    M
 

template<class T>
int gunu::BezierPositions int    n,
int    p,
const Ptr< T > &    U,
Ptr< int > &    K,
Ptr< int > &    M
 

Definition at line 247 of file gunu_refine.cpp.

00249 {
00250   int m,b,nb,i;
00251  
00252   // maximum number number of inner knots
00253   K.reserve_pool(n-p+1);
00254   M.reserve_pool(n-p+1);
00255 
00256   m = n+p+1;
00257   b = p+1;
00258   nb = 0;
00259   
00260   while( b < m )
00261   {
00262     i = b;
00263     while( (b < m) && (U[b+1] == U[b]) )
00264       b++;
00265     
00266     K[nb] = b;
00267     M[nb] = b - i + 1;
00268     nb++;
00269     b++;
00270   }
00271 
00272   return nb;
00273 }

template<class T, class EP>
void BezierSurfaceDerivatives const T    u,
const T    v,
const int    pu,
const Ptr< T > &    U,
const int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< EP > > &    Pw,
const int    d,
Ptr< Ptr< EP > > &    SKL
 

Definition at line 83 of file gunu_bezier_derivatives.h.

00089 {
00090   BezierBSPSurfaceDerivatives<T,EP>( u, v, pu, U, pv, V, Pw, d, SKL );
00091 }

template void BezierSurfaceDerivatives const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
const int    d,
Ptr< Ptr< point1< double > > > &    SKL
 

template void BezierSurfaceDerivatives const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
const int    d,
Ptr< Ptr< point1< float > > > &    SKL
 

template void BezierSurfaceDerivatives const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
const int    d,
Ptr< Ptr< point< double > > > &    SKL
 

template void BezierSurfaceDerivatives const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
const int    d,
Ptr< Ptr< point< float > > > &    SKL
 

template<class T, class HP, class EP>
void gunu::BezierSurfaceDerivatives const T    u,
const T    v,
const int    pu,
const Ptr< T > &    U,
const int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
const int    d,
Ptr< Ptr< EP > > &    SKL
 

Definition at line 262 of file gunu_bezier_derivatives.cpp.

Referenced by gunu::bezier_ninfo::evaluate().

00268 {
00269   int i,j,k,l;
00270   EP v1,v2,vh;
00271   T w00;
00272   Ptr< Ptr < HP > > SKLh;
00273   
00274   SKLh.reserve_place( reserve_stack(Ptr < HP >,d+1), d+1 );
00275   for( i = 0; i < d+1; i++ )
00276     SKLh[i].reserve_place( reserve_stack(HP,d+1), d+1 );
00277     
00278   BezierBSPSurfaceDerivatives<T,HP>( u, v, pu, U, pv, V, Pw, d, SKLh );
00279 
00280   w00 = SKLh[0][0].weight();
00281   
00282   for( k = 0; k <= d; k++ )
00283   {
00284     for( l = 0; l <= d-k; l++ )
00285     {
00286       v1 = ortho( SKLh[k][l] );
00287 
00288       for( j = 1; j <= l; j++ )
00289       {
00290         vh = (rtr<T>::BinCoeff(l,j) * SKLh[0][j].weight()) * SKL[k][l-j]; 
00291         v1 = v1 - vh;
00292       }  
00293       for( i = 1; i <= k; i++ )
00294       {
00295         vh = (rtr<T>::BinCoeff(k,i) * SKLh[i][0].weight()) * SKL[k-i][l];
00296         v1 = v1 - vh;
00297 
00298         set( v2, (T)0.0 );
00299         for( j = 1; j <= l; j++ )
00300         {
00301           vh = (rtr<T>::BinCoeff(l,j) * SKLh[i][j].weight()) * SKL[k-i][l-j];
00302           v2 = v2 + vh;
00303         }
00304         vh =  rtr<T>::BinCoeff(k,i) * v2;
00305         v1 = v1 - vh;
00306       }
00307       SKL[k][l] = ((T)1.0 / w00) * v1;
00308     }    
00309   }
00310 }

template GULAPI void BezierSurfacePoint const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
point1< double > *    retS
 

template GULAPI void BezierSurfacePoint const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
point1< float > *    retS
 

template GULAPI void BezierSurfacePoint const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
point< double > *    retS
 

template GULAPI void BezierSurfacePoint const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
point< float > *    retS
 

template GULAPI void BezierSurfacePoint const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
point1< double > *    retS
 

template GULAPI void BezierSurfacePoint const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
point1< float > *    retS
 

template GULAPI void BezierSurfacePoint const double    u,
const double    v,
const int    pu,
const Ptr< double > &    U,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
point< double > *    retS
 

template GULAPI void BezierSurfacePoint const float    u,
const float    v,
const int    pu,
const Ptr< float > &    U,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
point< float > *    retS
 

template<class T, class HP, class EP>
GULAPI void gunu::BezierSurfacePoint const T    u,
const T    v,
const int    pu,
const Ptr< T > &    U,
const int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
EP *    retS
 

Definition at line 490 of file gunu_basics.cpp.

00495 {                          
00496   Ptr< T > Nu,Nv;
00497   int uspan,vspan,uind,vind,l,k;
00498   HP S,temp,v1;
00499 
00500   Nu.reserve_place( reserve_stack(T,pu+1), pu+1 );
00501   Nv.reserve_place( reserve_stack(T,pv+1), pv+1 );
00502  
00503   uspan = pu;
00504   CalcBasisFunctions( u, uspan, pu, U, Nu );
00505   
00506   vspan = pv;
00507   CalcBasisFunctions( v, vspan, pv, V, Nv );
00508 
00509   uind = uspan-pu;
00510   set( S, (T)0.0 );
00511   for( l = 0; l <= pv; l++ )
00512   {
00513     set( temp, (T)0.0 );
00514     vind = vspan - pv + l;
00515     for( k = 0; k <= pu; k++ )
00516     {
00517       v1 = Nu[k] * Pw[vind][uind+k]; /* meine Kontrollpunktmatrix ist falschrum,
00518                                         muss daher transponiert werden */
00519       temp = temp + v1;
00520     }
00521     v1 = Nv[l] * temp;
00522     S = S + v1;
00523   }   
00524   *retS = euclid( S );
00525 }          

template GULAPI void BSPCurveDerivatives const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< point2< double > > &    Pw,
const int    d,
Ptr< point2< double > > &    CK
 

template GULAPI void BSPCurveDerivatives const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< point2< float > > &    Pw,
const int    d,
Ptr< point2< float > > &    CK
 

template GULAPI void BSPCurveDerivatives const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< point< double > > &    Pw,
const int    d,
Ptr< point< double > > &    CK
 

template GULAPI void BSPCurveDerivatives const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< point< float > > &    Pw,
const int    d,
Ptr< point< float > > &    CK
 

template<class T, class EP>
GULAPI void BSPCurveDerivatives const T    u,
const int    n,
const int    p,
const gul::Ptr< T > &    U,
const gul::Ptr< EP > &    Pw,
const int    d,
gul::Ptr< EP > &    CK
 

Definition at line 162 of file gunu_derivatives.cpp.

00165 {
00166   int du,k,j,span;
00167   EP v1;
00168   Ptr< Ptr< T > > ders;
00169     
00170   du = Min( d, p );
00171 
00172   ders.reserve_place( reserve_stack(Ptr< T >,du+1), du+1 );
00173   for( j = 0; j <du+1; j++ )
00174     ders[j].reserve_place( reserve_stack(T,p+1), p+1 );
00175 
00176   for( k = p+1; k <= d; k++ )
00177     set( CK[k], (T)0.0 );   /* Ableitungen > Grad = 0 */
00178 
00179   span = FindSpan( u, n, p, U );
00180   CalcDersBasisFuns( u, span, p, du, U, ders );
00181   
00182   for( k = 0; k <= du; k++ )
00183   {
00184     set( CK[k], (T)0.0 );
00185     for( j = 0; j <= p; j++ )
00186     {
00187       v1 = ders[k][j] * Pw[span-p+j];
00188       CK[k] = CK[k] + v1;
00189     }
00190   }
00191 }  

template void BSPSurfaceDerivatives const double    u,
const double    v,
const int    nu,
const int    pu,
const Ptr< double > &    U,
const int    nv,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
const int    d,
Ptr< Ptr< hpoint< double > > > &    SKL
 

template void BSPSurfaceDerivatives const float    u,
const float    v,
const int    nu,
const int    pu,
const Ptr< float > &    U,
const int    nv,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
const int    d,
Ptr< Ptr< hpoint< float > > > &    SKL
 

template void BSPSurfaceDerivatives const double    u,
const double    v,
const int    nu,
const int    pu,
const Ptr< double > &    U,
const int    nv,
const int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
const int    d,
Ptr< Ptr< point< double > > > &    SKL
 

template void BSPSurfaceDerivatives const float    u,
const float    v,
const int    nu,
const int    pu,
const Ptr< float > &    U,
const int    nv,
const int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
const int    d,
Ptr< Ptr< point< float > > > &    SKL
 

template<class T, class EP>
void gunu::BSPSurfaceDerivatives const T    u,
const T    v,
const int    nu,
const int    pu,
const Ptr< T > &    U,
const int    nv,
const int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< EP > > &    Pw,
const int    d,
Ptr< Ptr< EP > > &    SKL
 

Definition at line 213 of file gunu_derivatives.cpp.

00219 {                
00220   int du,dv,k,l,uspan,vspan,s,r,dd;
00221   EP v1;
00222   Ptr< EP > temp;
00223   Ptr< Ptr< T > > Nu,Nv;
00224 
00225   du = Min( d, pu );
00226   dv = Min( d, pv );
00227 
00228   Nu.reserve_place( reserve_stack(Ptr< T >,du+1), du+1 );
00229   for( k = 0; k < pu+1; k++ )
00230     Nu[k].reserve_place( reserve_stack(T,pu+1), pu+1 );
00231 
00232   Nv.reserve_place( reserve_stack(Ptr< T >,dv+1), dv+1 );
00233   for( k = 0; k < pv+1; k++ )
00234     Nv[k].reserve_place( reserve_stack(T,pv+1), pv+1 );
00235 
00236   temp.reserve_place( reserve_stack(EP,pv+1), pv+1 );
00237 
00238   for( k = pu+1; k <= d; k++ )
00239     for( l = 0; l <= d - k; l++ )
00240       set( SKL[k][l], (T)0.0 );
00241       
00242   for( l = pv+1; l <= d; l++ )
00243     for( k = 0; k <= d - l; k++ )
00244       set( SKL[k][l], (T)0.0 );
00245       
00246   uspan = FindSpan( u, nu, pu, U );
00247   CalcDersBasisFuns( u, uspan, pu, du, U, Nu );
00248  
00249   vspan = FindSpan( v, nv, pv, V );
00250   CalcDersBasisFuns( v, vspan, pv, dv, V, Nv );
00251   
00252   for( k = 0; k <= du; k++ )
00253   {
00254     for( s = 0; s <= pv; s++ )
00255     {
00256       set( temp[s], (T)0.0 );
00257       for( r = 0; r <= pu; r++ )
00258       {
00259         v1 = Nu[k][r] * Pw[vspan-pv+s][uspan-pu+r];
00260         temp[s] = temp[s] + v1;
00261       }  
00262     }
00263     dd = Min( d - k, dv );
00264     for( l = 0; l <= dd; l++ )
00265     {
00266       set( SKL[k][l], (T)0.0 );
00267       for( s = 0; s <= pv; s++ )
00268       {
00269         v1 = Nv[l][s] * temp[s];
00270         SKL[k][l] = SKL[k][l] + v1;
00271       }
00272     }
00273   }
00274 }  

template<class T>
void CACalcNTN int    nQ,
const Ptr< T > &    Uq,
int    n,
int    p,
const Ptr< T > &    U,
Ptr< int > &    M,
Ptr< Ptr< Ptr< T > > > &    N,
Ptr< Ptr< T > > &    A
 

Definition at line 382 of file gunu_global_approximate.cpp.

00385 {
00386   Ptr<T> B;
00387   T u,sum;
00388   int offset,span,i,j,k,l,m;
00389 
00390   B.reserve_pool(p+1);
00391 
00392   span = p;
00393   offset = 0;
00394 
00395   for( i = 0; i < nQ; i++ )
00396   {
00397     u = Uq[i];
00398 
00399     while( (u >= U[span+1]) && (span != n) )
00400     {
00401       M[span-p] = i - offset;  // number of points in previous knot span 
00402       span++;
00403       offset = i;
00404     }
00405     CalcBasisFunctions( u, span, p, U, B );
00406 
00407     for( j = 0; j <= p; j++ )
00408       N[span-p][j][i-offset] = B[j];
00409   }
00410   M[n-p] = nQ - offset;  // number of points in last knot span
00411   
00412   /* 
00413    * calculate A = N^T * N of the normal equation (as a band matrix),
00414    * but without the first and last row/column. This doesn't affects
00415    * the remaining matrix, since the knot vector is clamped 
00416    */
00417 
00418   for( i = 1; i < n; i++ )
00419   {
00420     m = i-p;
00421 
00422     for( j = Max(0,-m); j <= p; j++ ) // subdiagonals
00423     {
00424       sum = (T)0;
00425       for( k = Min(j,n-i); k >= Max(0,-m); k-- )
00426       {
00427         for( l = 0; l < M[m+k]; l++ )
00428           sum += N[m+k][p-k][l]*N[m+k][j-k][l];
00429       }
00430       A[i-1][j] = sum;
00431     }
00432     for( j = Max(0,i+p-n); j < p; j++ ) // superdiagonals
00433     {
00434       sum = (T)0;
00435       for( k = Max(0,i+p-n); k <= Min(j,i); k++ )
00436       {
00437         for( l = 0; l < M[i-k]; l++ )
00438           sum += N[i-k][k][l]*N[i-k][p-j+k][l];
00439       }
00440       A[i-1][p+p-j] = sum;
00441     }
00442   }
00443 }

template GULAPI double CalcBasisFunction int    p,
int    i,
double    u,
int    n,
const Ptr< double > &    U
 

template GULAPI float CalcBasisFunction int    p,
int    i,
float    u,
int    n,
const Ptr< float > &    U
 

template<class T>
GULAPI T gunu::CalcBasisFunction int    p,
int    i,
  u,
int    n,
const Ptr< T > &    U
 

Definition at line 214 of file gunu_basics.cpp.

00215 {
00216   Ptr<T> N;
00217   int j,k;
00218   T saved,Uleft,Uright,temp;
00219 
00220   N.reserve_pool(p+1);
00221 
00222   if( ((i == 0) && (u == U[0])) ||
00223       ((i == n) && (u == U[n+1])) )  // since clamped knot vector
00224     return (T)1;
00225 
00226   if( (u < U[i]) || (u >= U[i+p+1]) )
00227     return 0;
00228 
00229   // zeroth-degree basis functions
00230   for( j = 0; j <= p; j++ )
00231   {
00232     if( (u >= U[i+j]) && (u < U[i+j+1]) )
00233       N[j] = (T)1; 
00234     else
00235       N[j] = (T)0;
00236   }
00237 
00238   // compute triangular table
00239   for( k = 1; k <= p; k++ )
00240   {
00241     if( N[0] == (T)0 )
00242       saved = (T)0;
00243     else
00244       saved = ((u-U[i])*N[0])/(U[i+k]-U[i]);
00245 
00246     for( j = 0; j < p-k+1; j++ )
00247     {
00248       Uleft = U[i+j+1];
00249       Uright = U[i+j+k+1];
00250 
00251       if( N[j+1] == (T)0 )
00252       {
00253         N[j] = saved;
00254         saved = (T)0;
00255       }
00256       else
00257       {
00258         temp = N[j+1]/(Uright-Uleft);
00259         N[j] = saved + (Uright-u)*temp;
00260         saved = (u-Uleft)*temp;
00261       }
00262     }
00263   }
00264 
00265   return N[0];
00266 }

template void CalcBasisFunctions const double    u,
const int    i,
const int    p,
const Ptr< double > &    U,
Ptr< double > &    N
 

template void CalcBasisFunctions const float    u,
const int    i,
const int    p,
const Ptr< float > &    U,
Ptr< float > &    N
 

template<class T>
void gunu::CalcBasisFunctions const T    u,
const int    i,
const int    p,
const Ptr< T > &    U,
Ptr< T > &    N
 

Definition at line 278 of file gunu_basics.cpp.

00280 {
00281   Ptr< T > left,right;
00282   T saved,temp;
00283   int j,r;
00284   
00285   left.reserve_place( reserve_stack(T,p+1), p+1 );
00286   right.reserve_place( reserve_stack(T,p+1), p+1 );
00287   
00288   N[0] = 1.0;
00289   
00290   for( j = 1; j <= p; j++ )
00291   {
00292     left[j] = u - U[i+1-j];
00293     right[j] = U[i+j] - u;
00294     saved = 0.0;
00295     
00296     for( r = 0; r < j; r++ )
00297     {
00298       temp = N[r] / (right[r+1] + left[j-r]);
00299       N[r] = saved + (right[r+1] * temp);
00300       saved = left[j-r] * temp;
00301     }
00302     
00303     N[j] = saved;
00304   }  
00305 }

template void CalcDersBasisFuns const double    u,
const int    i,
const int    p,
const int    n,
const Ptr< double > &    U,
Ptr< Ptr< double > > &    ders
 

template void CalcDersBasisFuns const float    u,
const int    i,
const int    p,
const int    n,
const Ptr< float > &    U,
Ptr< Ptr< float > > &    ders
 

template<class T>
void gunu::CalcDersBasisFuns const T    u,
const int    i,
const int    p,
const int    n,
const Ptr< T > &    U,
Ptr< Ptr< T > > &    ders
 

Definition at line 56 of file gunu_derivatives.cpp.

00059 {
00060   T saved,temp,d;
00061   int j,k,r,s1,s2,rk,pk,j1,j2;
00062 
00063   Ptr< Ptr< T > > ndu,a;
00064   Ptr< T > left,right;
00065   
00066   ndu.reserve_place( reserve_stack(Ptr< T >,p+1), p+1 );
00067   for( j = 0; j < p+1; j++ )
00068     ndu[j].reserve_place( reserve_stack(T,p+1), p+1 );
00069  
00070   a.reserve_place( reserve_stack(Ptr< T >,2), 2 );
00071   for( j = 0; j < 2; j++ )
00072     a[j].reserve_place( reserve_stack(T,p+1), p+1 );
00073 
00074   left.reserve_place( reserve_stack(T,p+1), p+1 );
00075   right.reserve_place( reserve_stack(T,p+1), p+1 );
00076   
00077   ndu[0][0] = 1.0;
00078   
00079   for( j = 1; j <= p; j++ )
00080   {
00081     left[j] = u - U[i+1-j];
00082     right[j] = U[i+j]-u;
00083     saved = 0.0;
00084     for( r = 0; r < j; r++ )
00085     {
00086       ndu[j][r] = right[r+1] + left[j-r];
00087       temp = ndu[r][j-1]/ndu[j][r];
00088       
00089       ndu[r][j] = saved + right[r+1]*temp;
00090       saved = left[j-r]*temp;
00091     }
00092     ndu[j][j] = saved;
00093   }
00094 
00095   
00096   for( j = 0; j <= p; j++ )
00097   {
00098     ders[0][j] = ndu[j][p];        /* Basis Funktionen = 0.Ableitung */
00099   }
00100 
00101   for( r = 0; r <= p; r++ )
00102   {
00103     s1 = 0;    s2 = 1;
00104     a[0][0] = 1.0;
00105 
00106     for( k = 1; k <= n; k++ )
00107     {
00108       d = 0.0;
00109       rk = r-k;  pk = p-k;
00110       
00111       if( r >= k )
00112       {
00113         a[s2][0] = a[s1][0] / ndu[pk+1][rk];
00114         d = a[s2][0] * ndu[rk][pk];
00115       }  
00116       if( rk >= -1 )
00117         j1 = 1;
00118       else
00119         j1 = -rk;  
00120       if( r-1 <= pk )
00121         j2 = k-1;
00122       else
00123         j2 = p-r;  
00124 
00125       for( j = j1; j <= j2; j++ )
00126       {
00127         a[s2][j] = (a[s1][j] - a[s1][j-1]) / ndu[pk+1][rk+j];
00128         d += a[s2][j] * ndu[rk+j][pk];
00129       }  
00130       if( r <= pk )
00131       {
00132         a[s2][k] = -a[s1][k-1] / ndu[pk+1][r];
00133         d += a[s2][k] * ndu[r][pk];
00134       }  
00135       ders[k][r] = d;
00136       j = s1; s1 = s2; s2 = j;
00137     }        
00138   }
00139   
00140   r = p;
00141   for( k = 1; k <= n; k++ )
00142   {
00143     for( j = 0; j <= p; j++ )
00144       ders[k][j] *= (T)r;
00145     r *= p-k;
00146   }    
00147 }

template void CalcGrevilleAbcissa int    n,
int    p,
const Ptr< double > &    U,
Ptr< double > &    G
 

template void CalcGrevilleAbcissa int    n,
int    p,
const Ptr< float > &    U,
Ptr< float > &    G
 

template<class T>
void gunu::CalcGrevilleAbcissa int    n,
int    p,
const Ptr< T > &    U,
Ptr< T > &    G
 

Definition at line 43 of file gunu_sample.cpp.

00044 {
00045 
00046   T p_1,sum;
00047   int i,j;
00048 
00049   p_1 = (T)1/(T)p;
00050 
00051   for( i = 0; i <= n; i++ )
00052   {
00053     sum = (T)0;
00054     for( j = i+1; j <= i+p; j++ )
00055       sum += U[j];
00056 
00057     G[i] = p_1 * sum;
00058   }
00059 }

template<class T>
GULAPI int CalcMaxPointsPerSpan int    n,
int    p,
const Ptr< T > &    U,
int    nP,
const Ptr< T > &    P
 

Definition at line 473 of file gunu_knot_removal.cpp.

00479 {
00480   int i1,i2,i;
00481   T u1,u2;
00482   int maxpps;
00483 
00484   i = 1;
00485   i1 = 0;
00486   i2 = 0;
00487   maxpps = 0;
00488 
00489   for(;;)
00490   {
00491     // search next knotspan [u1,u2]
00492     while( (i <= n+p+1) && (U[i] == U[i-1]) ) i++;
00493     if( i == n+p+2 ) break; // not found
00494     u1 = U[i-1];
00495     u2 = U[i];
00496     i++;
00497 
00498     // search first parameter >= u1
00499     while( (i1 < nP) && (P[i1] < u1) ) i1++;
00500     if( (i1 == nP) || (P[i1] < u1) ) // not found
00501       break;
00502   
00503     // search last parameter <= u2
00504     while( (i2 < nP) && (P[i2] <= u2) ) i2++;
00505     i2--;
00506     if( (i2 < 0) || (P[i2] > u2) ) // not found
00507       continue;
00508  
00509     if( i2-i1+1 > maxpps )
00510       maxpps = i2-i1+1;
00511 
00512     i1 = i2;
00513   }
00514 
00515   return maxpps;
00516 }

template void CalcNormal_U0V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U0V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U0V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< float > > > &    Pw,
point< float > *    Normal
 

template void CalcNormal_U0V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< float > > > &    Pw,
point< float > *    Normal
 

template<class T, class HP>
void gunu::CalcNormal_U0V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< HP > > &    Pw,
point< T > *    Normal
 

Definition at line 477 of file gunu_derivatives.cpp.

00481 {
00482   int i,j,k,m;
00483   point<T> v1,v2,a,b;
00484 
00485   set(a,(T)0);
00486   set(b,(T)0);
00487 
00488   m = Max(pu,pv);
00489   
00490   for( k=0; k<m; k++ )
00491   {
00492     i=0;
00493     j=k+1;
00494     
00495     while( i <= k )
00496     {
00497       if( (i <= pv) && (j <= pu) )
00498       {
00499         v1 = euclid( Pw[i][j] );
00500         v2 = euclid( Pw[i][0] );
00501         a = v1 - v2;
00502         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00503         {
00504           k = m;     // Vektor in Tangetialebene gefunden, fertig
00505           break;
00506         }
00507       }
00508       i++;
00509       j--;  
00510     }
00511   }
00512 
00513   for( k=0; k<m; k++ )
00514   {
00515     i=0;
00516     j=k+1;
00517     
00518     while( i <= k )
00519     {
00520       if( (j <= pv) && (i <= pu) )
00521       {
00522         v1 = euclid( Pw[j][i] );
00523         v2 = euclid( Pw[0][i] );
00524         b = v1 - v2;
00525         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00526         {
00527           k = m;     // Vektor in Tangetialebene gefunden, fertig
00528           break;
00529         }
00530       }
00531       i++;
00532       j--;  
00533     }
00534   }
00535 
00536   v1 = cross_product( a, b );
00537   normalize( Normal, v1 );
00538 }

template void CalcNormal_U0V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U0V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U0V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< float > > > &    Pw,
point< float > *    Normal
 

template void CalcNormal_U0V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< float > > > &    Pw,
point< float > *    Normal
 

template<class T, class HP>
void gunu::CalcNormal_U0V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< HP > > &    Pw,
point< T > *    Normal
 

Definition at line 648 of file gunu_derivatives.cpp.

00652 {
00653   int i,j,k,m;
00654   point<T> v1,v2,a,b;
00655 
00656   set(a,(T)0);
00657   set(b,(T)0);
00658   
00659   m = Max(pu,pv);
00660   
00661   for( k=0; k<m; k++ )
00662   {
00663     i=0;
00664     j=k+1;
00665     
00666     while( i <= k )
00667     {
00668       if( (i <= pv) && (j <= pu) )
00669       {
00670         v1 = euclid( Pw[nv-i][j] );
00671         v2 = euclid( Pw[nv-i][0] );
00672         a = v1 - v2;
00673         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00674         {
00675           k = m;     /* Vektor in Tangetialebene gefunden, fertig */
00676           break;
00677         }       
00678       }
00679       i++;
00680       j--;  
00681     }
00682   }
00683 
00684   for( k=0; k<m; k++ )
00685   {
00686     i=0;
00687     j=k+1;
00688     
00689     while( i <= k )
00690     {
00691       if( (j <= pv) && (i <= pu) )
00692       {
00693         v1 = euclid( Pw[nv][i] );
00694         v2 = euclid( Pw[nv-j][i] );
00695         b =  v1 - v2;
00696         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00697         {
00698           k = m;     /* Vektor in Tangetialebene gefunden, fertig */
00699           break;
00700         }
00701       }
00702       i++;
00703       j--;  
00704     }
00705   }
00706 
00707   v1 = cross_product( a, b );
00708   normalize( Normal, v1 );
00709 }

template void CalcNormal_U1V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U1V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U1V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< float > > > &    Pw,
point< float > *    Normal
 

template void CalcNormal_U1V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< float > > > &    Pw,
point< float > *    Normal
 

template<class T, class HP>
void gunu::CalcNormal_U1V0 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< HP > > &    Pw,
point< T > *    Normal
 

Definition at line 562 of file gunu_derivatives.cpp.

00566 {
00567   int i,j,k,m;
00568   point<T> v1,v2,a,b;
00569 
00570   set(a,(T)0);
00571   set(b,(T)0);
00572 
00573   m = Max(pu,pv);
00574   
00575   for( k=0; k<m; k++ )
00576   {
00577     i=0;
00578     j=k+1;
00579     
00580     while( i <= k )
00581     {
00582       if( (i <= pv) && (j <= pu) )
00583       {
00584         v1 = euclid( Pw[i][nu] );
00585         v2 = euclid( Pw[i][nu-j] );
00586         a =  v1 - v2;
00587         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00588         {
00589           k = m;     /* Vektor in Tangetialebene gefunden, fertig */
00590           break;
00591         }
00592       }
00593       i++;
00594       j--;  
00595     }
00596   }
00597 
00598   for( k=0; k<m; k++ )
00599   {
00600     i=0;
00601     j=k+1;
00602     
00603     while( i <= k )
00604     {
00605       if( (j <= pv) && (i <= pu) )
00606       {
00607         v1 = euclid( Pw[j][nu-i] );
00608         v2 = euclid( Pw[0][nu-i] );
00609         b = v1 - v2;
00610         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00611         {
00612           k = m;     /* Vektor in Tangetialebene gefunden, fertig */
00613           break;
00614         }
00615       }
00616       i++;
00617       j--;  
00618     }
00619   }
00620 
00621   v1 = cross_product( a, b );
00622   normalize( Normal, v1 );
00623 }

template void CalcNormal_U1V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U1V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< double > > > &    Pw,
point< double > *    Normal
 

template void CalcNormal_U1V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< point< float > > > &    Pw,
point< float > *    Normal
 

template void CalcNormal_U1V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< hpoint< float > > > &    Pw,
point< float > *    Normal
 

template<class T, class HP>
void gunu::CalcNormal_U1V1 const int    nu,
const int    pu,
const int    nv,
const int    pv,
const Ptr< Ptr< HP > > &    Pw,
point< T > *    Normal
 

Definition at line 734 of file gunu_derivatives.cpp.

00738 {
00739   int i,j,k,m;
00740   point<T> v1,v2,a,b;
00741 
00742   set(a,(T)0);
00743   set(b,(T)0);
00744   
00745   m = Max(pu,pv);
00746   
00747   for( k=0; k<m; k++ )
00748   {
00749     i=0;
00750     j=k+1;
00751     
00752     while( i <= k )
00753     {
00754       if( (i <= pv) && (j <= pu) )
00755       {
00756         v1 = euclid( Pw[nv-i][nu] );
00757         v2 = euclid( Pw[nv-i][nu-j] );
00758         a = v1 - v2;
00759         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00760         {
00761           k = m;     /* Vektor in Tangetialebene gefunden, fertig */
00762           break;
00763         }
00764       }
00765       i++;
00766       j--;  
00767     }
00768   }
00769 
00770   for( k=0; k<m; k++ )
00771   {
00772     i=0;
00773     j=k+1;
00774     
00775     while( i <= k )
00776     {
00777       if( (j <= pv) && (i <= pu) )
00778       {
00779         v1 = euclid( Pw[nv][nu-i] );
00780         v2 = euclid( Pw[nv-j][nu-i] );
00781         b = v1 - v2;
00782         if( !rel_equal(v1,v2,rtr<T>::zero_tol()) )
00783         {
00784           k = m;     /* Vektor in Tangetialebene gefunden, fertig */
00785           break;
00786         }
00787       }
00788       i++;
00789       j--;  
00790     }
00791   }
00792 
00793   v1 = cross_product( a, b );
00794   normalize( Normal, v1 );
00795 }

template<class T>
GULAPI void CalcParameterRanges int    n,
int    p,
const gul::Ptr< T > &    U,
int    nP,
const gul::Ptr< T > &    P,
gul::Ptr< int > &    R,
gul::Ptr< int > &    S
 

template GULAPI void CalcParameterRanges int    n,
int    p,
const Ptr< float > &    U,
int    nP,
const Ptr< float > &    P,
Ptr< int > &    R,
Ptr< int > &    S
 

template<class T>
GULAPI void CalcParameterRanges int    n,
int    p,
const Ptr< T > &    U,
int    nP,
const Ptr< T > &    P,
Ptr< int > &    R,
Ptr< int > &    S
 

Definition at line 379 of file gunu_knot_removal.cpp.

00388 {
00389   int   i,ilo,ihi;
00390   bool  finished_early;
00391 
00392   ilo = 0;
00393   ihi = 0;
00394   finished_early = false;
00395 
00396   for( i = 0; i <= n; i++ )
00397   {
00398     while( P[ilo] < U[i] ) // search first param. >= ulo
00399     {
00400       ilo++;
00401 
00402       // if all remaining parameter ranges are empty
00403       if( ilo >= nP )
00404       {
00405         finished_early = true;
00406         break;
00407       }
00408     }
00409 
00410     if( finished_early )
00411       break;
00412 
00413     R[i] = ilo;
00414 
00415     while( U[i+p+1] >= P[ihi] ) // search last param. <= uhi
00416     {
00417       ihi++;
00418       if( ihi == nP )
00419         break;
00420     }
00421     ihi--;                  
00422 
00423     // if parameter range is empty, start next search with 0
00424     // again
00425     if( ihi == -1 )
00426     {
00427       ihi = 0;
00428       S[i] = 0;
00429     }
00430     else
00431     {
00432       S[i] = ihi-ilo+1;
00433 
00434       // if not the last interval, skip last point, if it is on
00435       // the interval end
00436 
00437       if( (i+p+1 <= n) && (P[ihi] == U[i+p+1]) ) 
00438       {  
00439         S[i]--;
00440         ihi--;
00441         if( ihi < 0 )
00442           ihi = 0;
00443       }
00444     }
00445   }
00446 
00447   if( finished_early )
00448   {
00449     for( ; i <= n; i++ )
00450     {
00451       R[i] = nP;
00452       S[i] = 0;
00453     }
00454   }
00455 }

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
int    nSampU,
const Ptr< double > &    sampU,
int    nSampV,
const Ptr< double > &    sampV,
Ptr< Ptr< point1< double > > > &    sampP
 

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
int    nSampU,
const Ptr< double > &    sampU,
int    nSampV,
const Ptr< double > &    sampV,
Ptr< Ptr< point< double > > > &    sampP
 

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
int    nSampU,
const Ptr< double > &    sampU,
int    nSampV,
const Ptr< double > &    sampV,
Ptr< Ptr< point1< double > > > &    sampP
 

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
int    nSampU,
const Ptr< double > &    sampU,
int    nSampV,
const Ptr< double > &    sampV,
Ptr< Ptr< point< double > > > &    sampP
 

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
int    nSampU,
const Ptr< float > &    sampU,
int    nSampV,
const Ptr< float > &    sampV,
Ptr< Ptr< point1< float > > > &    sampP
 

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
int    nSampU,
const Ptr< float > &    sampU,
int    nSampV,
const Ptr< float > &    sampV,
Ptr< Ptr< point< float > > > &    sampP
 

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
int    nSampU,
const Ptr< float > &    sampU,
int    nSampV,
const Ptr< float > &    sampV,
Ptr< Ptr< point1< float > > > &    sampP
 

template void CalcSurfaceMesh int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
int    nSampU,
const Ptr< float > &    sampU,
int    nSampV,
const Ptr< float > &    sampV,
Ptr< Ptr< point< float > > > &    sampP
 

template<class T, class HP, class EP>
void gunu::CalcSurfaceMesh int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
int    nSampU,
const Ptr< T > &    sampU,
int    nSampV,
const Ptr< T > &    sampV,
Ptr< Ptr< EP > > &    sampP
 

Definition at line 98 of file gunu_sample.cpp.

00104 {
00105   Ptr<T> ubase;
00106   Ptr< Ptr<T> > vbase;
00107   T u, v;
00108   int  spanu, spanv, i, j, uind, vind, l, k;
00109   HP S, temp;
00110 
00111   ubase.reserve_pool(pu+1);
00112 
00113   vbase.reserve_pool(nSampV);
00114   for( i = 0; i < nSampV; i++ )
00115     vbase[i].reserve_pool(pv+1);
00116   
00117   spanu = -1;
00118 
00119   for( i = 0; i < nSampU; i++ )
00120   {
00121     u = sampU[i];
00122 
00123     while( (spanu < nu) && (u >= U[spanu+1]) )
00124       spanu++;
00125 
00126     CalcBasisFunctions( u, spanu, pu, U, ubase );
00127   
00128     spanv = -1;
00129 
00130     for( j = 0; j < nSampV; j++ )
00131     {
00132       v = sampV[j];
00133 
00134       while( (spanv < nv) && (v >= V[spanv+1]) )
00135         spanv++;
00136 
00137       if( i == 0 ) /* calc V basis functions the first time */
00138         CalcBasisFunctions( v, spanv, pv, V, vbase[j] );
00139 
00140       // calc surface point
00141 
00142       uind = spanu-pu;
00143       set( S, (T)0 );
00144 
00145       for( l = 0; l <= pv; l++ )
00146       {
00147         set( temp, (T)0 );
00148    
00149         vind = spanv - pv + l;
00150 
00151         for( k = 0; k <= pu; k++ )
00152           temp += ubase[k]*Pw[vind][uind+k];
00153 
00154          S += vbase[j][l]*temp;
00155       }
00156       sampP[j][i] = euclid( S );
00157     }
00158   }
00159 }

template<class T>
void CASolve int    nQ,
const Ptr< point2< T > > &    Q,
const Ptr< T > &    Uq,
int    n,
int    p,
const Ptr< T > &    U,
Ptr< int > &    M,
Ptr< Ptr< Ptr< T > > > &    N,
Ptr< Ptr< T > > &    A,
Ptr< point2< T > > &    P
 

Definition at line 199 of file gunu_global_approximate.cpp.

00203 {
00204   int i,j,k,sign,offset,bw,shift;
00205   Ptr<T> Rx,Ry,Rz;
00206   Ptr< Ptr<T> > L;
00207   Ptr<int> index; 
00208   point2<T> r;
00209 
00210   Rx.reserve_pool(n-1);
00211   Ry.reserve_pool(n-1);
00212   for( i = 0; i < n-1; i++ )
00213   {
00214     Rx[i] = (T)0;
00215     Ry[i] = (T)0;
00216   }
00217   // process points in first knotspan
00218 
00219   for( i = 1; i < M[0]; i++ )    
00220   {
00221     r = N[0][0][i] * Q[0];
00222     if( n-p == 0 )               // Q[i] element of first and last knot span 
00223       r = r + N[0][p][i]*Q[nQ-1];   // (then there is only one span)
00224 
00225     for( j = 1; j <= Min(p,n-1); j++ )
00226     {
00227       Rx[j-1] += N[0][j][i] * (Q[i].x - r.x);
00228       Ry[j-1] += N[0][j][i] * (Q[i].y - r.y);
00229     }
00230   }
00231 
00232   // process points between firts and last knotspan
00233 
00234   offset = i;
00235   for( k = 1; k < n-p; k++ ) 
00236   {
00237     for( i = 0; i < M[k]; i++ )
00238     {
00239       for( j = 0; j <= p; j++ )
00240       {
00241         Rx[k+j-1] += N[k][j][i] * Q[offset+i].x;
00242         Ry[k+j-1] += N[k][j][i] * Q[offset+i].y;
00243       }
00244     }
00245     offset += M[k];
00246   }   
00247 
00248   // process points in last knotspan
00249 
00250   if( n-p > 0 )  // only when more then one knotspan
00251   {
00252     for( i = 0; i < M[k]-1; i++ )
00253     {
00254       r = N[k][p][i] * Q[nQ-1];
00255 
00256       for( j = 0; j < p; j++ )
00257       {
00258         Rx[k+j-1] += N[k][j][i] * (Q[offset+i].x - r.x);
00259         Ry[k+j-1] += N[k][j][i] * (Q[offset+i].y - r.y);
00260       }
00261     }
00262   }
00263   N.reset();  // not needed anymore
00264   M.reset();  // not needed anymore
00265 
00266   L.reserve_pool(n-1);
00267   for( i = 0; i < n-1; i++ )
00268     L[i].reserve_pool(p+p+1);
00269   index.reserve_pool(n-1);
00270 
00271   if( n-1 < p )  // band width adjustment necessary
00272   {
00273     bw = n-1;
00274     shift = p - bw;
00275 
00276     for( i = 0;  i < n-1; i++ )
00277     {
00278       offset = bw-i;
00279       for( j = 0; j < bw+bw+1-offset; j++ ) 
00280         A[i][offset+j] = A[i][offset+j+shift];
00281     }
00282   } 
00283   else
00284     bw = p;
00285 
00286   BandDecomposition( n-1, bw, bw, A, L, &sign, index );
00287 
00288   BandBackSubstitution( n-1, bw, bw, A, L, index, Rx ); 
00289   for( i = 0; i < n-1; i++ ) P[i+1].x = Rx[i];
00290   BandBackSubstitution( n-1, bw, bw, A, L, index, Ry ); 
00291   for( i = 0; i < n-1; i++ ) P[i+1].y = Ry[i];
00292 
00293   P[0] = Q[0];
00294   P[n] = Q[nQ-1];
00295 }

template<class T>
void CASolve int    nQ,
const Ptr< point< T > > &    Q,
const Ptr< T > &    Uq,
int    n,
int    p,
const Ptr< T > &    U,
Ptr< int > &    M,
Ptr< Ptr< Ptr< T > > > &    N,
Ptr< Ptr< T > > &    A,
Ptr< point< T > > &    P
 

Definition at line 56 of file gunu_global_approximate.cpp.

00060 {
00061   int i,j,k,sign,offset,bw,shift;
00062   Ptr<T> Rx,Ry,Rz;
00063   Ptr< Ptr<T> > L;
00064   Ptr<int> index; 
00065   point<T> r;
00066 
00067   Rx.reserve_pool(n-1);
00068   Ry.reserve_pool(n-1);
00069   Rz.reserve_pool(n-1);
00070   for( i = 0; i < n-1; i++ )
00071   {
00072     Rx[i] = (T)0;
00073     Ry[i] = (T)0;
00074     Rz[i] = (T)0;
00075   }
00076 
00077   // process points in first knotspan
00078 
00079   for( i = 1; i < M[0]; i++ )    
00080   {
00081     r = N[0][0][i] * Q[0];
00082     if( n-p == 0 )               // Q[i] element of first and last knot span 
00083       r = r + N[0][p][i]*Q[nQ-1];   // (then there is only one span)
00084 
00085     for( j = 1; j <= Min(p,n-1); j++ )
00086     {
00087       Rx[j-1] += N[0][j][i] * (Q[i].x - r.x);
00088       Ry[j-1] += N[0][j][i] * (Q[i].y - r.y);
00089       Rz[j-1] += N[0][j][i] * (Q[i].z - r.z);
00090 
00091       /*
00092       cout << "Rx[" << j-1 << "] (first span, Q[" << i << "]): " 
00093            << Rx[j-1] << "\n";
00094       */
00095     }
00096   }
00097 
00098   // process points between firts and last knotspan
00099 
00100   offset = i;
00101   for( k = 1; k < n-p; k++ ) 
00102   {
00103     for( i = 0; i < M[k]; i++ )
00104     {
00105       for( j = 0; j <= p; j++ )
00106       {
00107         Rx[k+j-1] += N[k][j][i] * Q[offset+i].x;
00108         Ry[k+j-1] += N[k][j][i] * Q[offset+i].y;
00109         Rz[k+j-1] += N[k][j][i] * Q[offset+i].z;
00110 
00111         /*
00112         cout << "Rx[" << k+j-1 << "] (Q[" << offset+i << "]): " 
00113              << Rx[k+j-1] << "\n";
00114         */
00115       }
00116     }
00117     offset += M[k];
00118   }   
00119 
00120   // process points in last knotspan
00121 
00122   if( n-p > 0 )  // only when more then one knotspan
00123   {
00124     for( i = 0; i < M[k]-1; i++ )
00125     {
00126       r = N[k][p][i] * Q[nQ-1];
00127 
00128       for( j = 0; j < p; j++ )
00129       {
00130         Rx[k+j-1] += N[k][j][i] * (Q[offset+i].x - r.x);
00131         Ry[k+j-1] += N[k][j][i] * (Q[offset+i].y - r.y);
00132         Rz[k+j-1] += N[k][j][i] * (Q[offset+i].z - r.z);
00133 
00134         /*
00135         cout << "Rx[" << k+j-1 << "] (last span, Q[" << offset+i << "]): " 
00136              << Rx[k+j-1] << "\n";
00137         */
00138       }
00139     }
00140   }
00141   N.reset();  // not needed anymore
00142   M.reset();  // not needed anymore
00143 
00144   /*
00145   cout << "Right side for X (version 2):\n";
00146   cout << dump_vector<T>(n-1,Rx);
00147   cout << "Right side for Y (version 2):\n";
00148   cout << dump_vector<T>(n-1,Ry);
00149   cout << "Right side for Z (version 2):\n";
00150   cout << dump_vector<T>(n-1,Rz);
00151   */
00152 
00153   L.reserve_pool(n-1);
00154   for( i = 0; i < n-1; i++ )
00155     L[i].reserve_pool(p);
00156   index.reserve_pool(n-1);
00157 
00158   if( n-1 < p )  // band width adjustment necessary
00159   {
00160     bw = n-1;
00161     shift = p - bw;
00162 
00163     for( i = 0;  i < n-1; i++ )
00164     {
00165       offset = bw-i;
00166       for( j = 0; j < bw+bw+1-offset; j++ ) 
00167         A[i][offset+j] = A[i][offset+j+shift];
00168     }
00169   } 
00170   else
00171     bw = p;
00172 
00173   /*
00174   cout << "MATRIX A (1):\n";
00175   cout << dump_matrix<T>(n-1,p+p+1,A);
00176   */
00177 
00178   BandDecomposition( n-1, bw, bw, A, L, &sign, index );
00179 
00180   /*
00181   cout << "MATRIX A (1):\n";
00182   cout << dump_matrix<T>(n-1,p+p+1,A);
00183   cout << "MATRIX L (1):\n";
00184   cout << dump_matrix<T>(n-1,p,L);
00185   */
00186 
00187   BandBackSubstitution( n-1, bw, bw, A, L, index, Rx ); 
00188   for( i = 0; i < n-1; i++ ) P[i+1].x = Rx[i];
00189   BandBackSubstitution( n-1, bw, bw, A, L, index, Ry ); 
00190   for( i = 0; i < n-1; i++ ) P[i+1].y = Ry[i];
00191   BandBackSubstitution( n-1, bw, bw, A, L, index, Rz ); 
00192   for( i = 0; i < n-1; i++ ) P[i+1].z = Rz[i];
00193 
00194   P[0] = Q[0];
00195   P[n] = Q[nQ-1];
00196 }

template<class T>
void CASolveToCol int    nQ,
const Ptr< point< T > > &    Q,
const Ptr< T > &    Uq,
int    n,
int    p,
const Ptr< T > &    U,
const Ptr< int > &    M,
const Ptr< Ptr< Ptr< T > > > &    N,
Ptr< Ptr< T > > &    A,
Ptr< Ptr< T > > &    L,
Ptr< int >    index,
int    iCol,
Ptr< Ptr< point< T > > > &    P
 

Definition at line 298 of file gunu_global_approximate.cpp.

00304 {
00305   int i,j,k,offset;
00306   Ptr<T> Rx,Ry,Rz;
00307   point<T> r;
00308 
00309   Rx.reserve_pool(n-1);
00310   Ry.reserve_pool(n-1);
00311   Rz.reserve_pool(n-1);
00312   for( i = 0; i < n-1; i++ )
00313   {
00314     Rx[i] = (T)0;
00315     Ry[i] = (T)0;
00316     Rz[i] = (T)0;
00317   }
00318 
00319   // process points in first knotspan
00320 
00321   for( i = 1; i < M[0]; i++ )    
00322   {
00323     r = N[0][0][i] * Q[0];
00324     if( n-p == 0 )               // Q[i] element of first and last knot span 
00325       r = r + N[0][p][i]*Q[nQ-1];   // (then there is only one span)
00326 
00327     for( j = 1; j <= Min(p,n-1); j++ )
00328     {
00329       Rx[j-1] += N[0][j][i] * (Q[i].x - r.x);
00330       Ry[j-1] += N[0][j][i] * (Q[i].y - r.y);
00331       Rz[j-1] += N[0][j][i] * (Q[i].z - r.z);
00332     }
00333   }
00334 
00335   // process points between first and last knotspan
00336 
00337   offset = i;
00338   for( k = 1; k < n-p; k++ ) 
00339   {
00340     for( i = 0; i < M[k]; i++ )
00341     {
00342       for( j = 0; j <= p; j++ )
00343       {
00344         Rx[k+j-1] += N[k][j][i] * Q[offset+i].x;
00345         Ry[k+j-1] += N[k][j][i] * Q[offset+i].y;
00346         Rz[k+j-1] += N[k][j][i] * Q[offset+i].z;
00347       }
00348     }
00349     offset += M[k];
00350   }   
00351 
00352   // process points in last knotspan
00353 
00354   if( n-p > 0 )  // only when more then one knotspan
00355   {
00356     for( i = 0; i < M[k]-1; i++ )
00357     {
00358       r = N[k][p][i] * Q[nQ-1];
00359 
00360       for( j = 0; j < p; j++ )
00361       {
00362         Rx[k+j-1] += N[k][j][i] * (Q[offset+i].x - r.x);
00363         Ry[k+j-1] += N[k][j][i] * (Q[offset+i].y - r.y);
00364         Rz[k+j-1] += N[k][j][i] * (Q[offset+i].z - r.z);
00365       }
00366     }
00367   }
00368 
00369   // calculate the x coordinates of the controlpoints
00370   BandBackSubstitution( n-1, Min(p,n-1), Min(p,n-1), A, L, index, Rx ); 
00371   for( i = 0; i < n-1; i++ ) P[i+1][iCol].x = Rx[i];
00372   BandBackSubstitution( n-1, Min(p,n-1), Min(p,n-1), A, L, index, Ry ); 
00373   for( i = 0; i < n-1; i++ ) P[i+1][iCol].y = Ry[i];
00374   BandBackSubstitution( n-1, Min(p,n-1), Min(p,n-1), A, L, index, Rz ); 
00375   for( i = 0; i < n-1; i++ ) P[i+1][iCol].z = Rz[i];
00376 
00377   P[0][iCol] = Q[0];
00378   P[n][iCol] = Q[nQ-1];
00379 }

template<class T, class EP>
T ChordLength int    nQ,
const gul::Ptr< EP > &    Q,
gul::Ptr< T > &    d
[inline]
 

Definition at line 28 of file gunu_parametrize.h.

00029 {
00030   T sum = (T)0;
00031   d[0] = (T)0;
00032 
00033   for( int i = 1; i < nQ; i++ )
00034   {
00035     d[i] = gul::distance( Q[i], Q[i-1] );
00036     sum += d[i];
00037   }
00038   return sum;
00039 }

template<class T, class EP>
bool ChordLengthMeshParams int    nRows,
int    nCols,
const gul::Ptr< gul::Ptr< EP > > &    Q,
gul::Ptr< T > &    Uq,
gul::Ptr< T > &    Vq
[inline]
 

Definition at line 123 of file gunu_parametrize.h.

00126 {
00127   int nnzero,i,j,nu,nv;
00128   T f,dtotal,dsum;
00129   gul::Ptr<T> d;
00130 
00131   d.reserve_pool( gul::Max(nRows,nCols) );
00132 
00133   nu = nCols-1;
00134   nv = nRows-1;
00135 
00136 /* -------- calc U-parameters ---------------------- */
00137 
00138   nnzero = nv+1;
00139 
00140   for( i = 0; i < nu; i++ ) Uq[i] = (T)0; 
00141   Uq[nu] = (T)1;
00142 
00143   for( i = 0; i <= nv; i++ )
00144   {
00145     dtotal = ChordLength( nu+1, Q[i], d );
00146 
00147     if( dtotal == (T)0 ) 
00148     {
00149       nnzero--;    
00150     }
00151     else
00152     {
00153       dsum = (T)0;
00154       for( j = 1; j < nu; j++ ) 
00155       {
00156         dsum += d[j];
00157         Uq[j] += dsum/dtotal;
00158       }
00159     }
00160   }
00161   if( nnzero == 0 ) return false;
00162 
00163   f = (T)1/(T)nnzero;
00164 
00165   for( i = 1; i < nu; i++ )
00166     Uq[i] *= f; 
00167 
00168 /* -------- calc V-parameters ---------------------- */
00169 
00170   nnzero = nu+1;
00171 
00172   for( i = 0; i < nv; i++ ) Vq[i] = (T)0; 
00173   Vq[nv] = (T)1;
00174 
00175   for( i = 0; i <= nu; i++ )
00176   {
00177     dtotal = ColumnChordLength( nv+1, nu+1, Q, i, d ); // chord length of column
00178 
00179     if( dtotal == (T)0 ) 
00180     {
00181       nnzero--;    
00182     }
00183     else
00184     {
00185       dsum = (T)0;
00186       for( j = 1; j < nv; j++ ) 
00187       {
00188         dsum += d[j];
00189         Vq[j] += dsum/dtotal;
00190       }
00191     }
00192   }
00193   if( nnzero == 0 ) return false;
00194 
00195   f = (T)1/(T)nnzero;
00196 
00197   for( i = 1; i < nv; i++ )
00198     Vq[i] *= f; 
00199 
00200   return true;
00201 }

template<class T>
void ChordLengthParameters int    nQ,
const T &    dsum,
const gul::Ptr< T > &    d,
gul::Ptr< T > &    Uq
[inline]
 

Definition at line 58 of file gunu_parametrize.h.

00060 {
00061   Uq[0] = (T)0;
00062   for( int i = 1; i < nQ-1; i++ ) 
00063     Uq[i] = Uq[i-1] + d[i]/dsum;
00064   Uq[nQ-1] = (T)1;
00065 }

template<class T>
void CIBackSubst int    nQ,
const Ptr< point2< T > > &    Q,
int    p,
const Ptr< Ptr< T > > &    A,
const Ptr< Ptr< T > > &    L,
const Ptr< int > &    index,
Ptr< point2< T > > &    P
 

Definition at line 105 of file gunu_global_interpolate.cpp.

00108 {
00109   Ptr<T> b;
00110   int n = nQ-1, i;
00111 
00112   b.reserve_pool(n+1);
00113 
00114   // calculate the x coordinates of the controlpoints
00115   for( i = 0; i <= n; i++ ) b[i] = Q[i].x;
00116   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00117   for( i = 0; i <= n; i++ ) P[i].x = b[i];
00118 
00119   // calculate the y coordinates of the controlpoints
00120   for( i = 0; i <= n; i++ ) b[i] = Q[i].y;
00121   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00122   for( i = 0; i <= n; i++ ) P[i].y = b[i];
00123 }

template<class T>
void CIBackSubst int    nQ,
const Ptr< point< T > > &    Q,
int    p,
Ptr< Ptr< T > > &    A,
const Ptr< Ptr< T > > &    L,
const Ptr< int > &    index,
Ptr< point< T > > &    P
 

Definition at line 79 of file gunu_global_interpolate.cpp.

00082 {
00083   Ptr<T> b;
00084   int n = nQ-1, i;
00085 
00086   b.reserve_pool(n+1);
00087 
00088   // calculate the x coordinates of the controlpoints
00089   for( i = 0; i <= n; i++ ) b[i] = Q[i].x;
00090   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00091   for( i = 0; i <= n; i++ ) P[i].x = b[i];
00092 
00093   // calculate the y coordinates of the controlpoints
00094   for( i = 0; i <= n; i++ ) b[i] = Q[i].y;
00095   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00096   for( i = 0; i <= n; i++ ) P[i].y = b[i];
00097 
00098   // calculate the z coordinates of the controlpoints
00099   for( i = 0; i <= n; i++ ) b[i] = Q[i].z;
00100   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00101   for( i = 0; i <= n; i++ ) P[i].z = b[i];
00102 }

template<class T>
void CIBackSubstToCol int    nQ,
const Ptr< point1< T > > &    Q,
int    p,
const Ptr< Ptr< T > > &    A,
const Ptr< Ptr< T > > &    L,
const Ptr< int > &    index,
int    iCol,
Ptr< Ptr< point1< T > > > &    P
 

Definition at line 153 of file gunu_global_interpolate.cpp.

00157 {
00158   Ptr<T> b;
00159   int n = nQ-1, i;
00160 
00161   b.reserve_pool(n+1);
00162 
00163   // calculate the x coordinates of the controlpoints
00164   for( i = 0; i <= n; i++ ) b[i] = Q[i].x;
00165   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00166   for( i = 0; i <= n; i++ ) P[i][iCol].x = b[i];
00167 }

template<class T>
void CIBackSubstToCol int    nQ,
const Ptr< point< T > > &    Q,
int    p,
const Ptr< Ptr< T > > &    A,
const Ptr< Ptr< T > > &    L,
const Ptr< int > &    index,
int    iCol,
Ptr< Ptr< point< T > > > &    P
 

Definition at line 126 of file gunu_global_interpolate.cpp.

00130 {
00131   Ptr<T> b;
00132   int n = nQ-1, i;
00133 
00134   b.reserve_pool(n+1);
00135 
00136   // calculate the x coordinates of the controlpoints
00137   for( i = 0; i <= n; i++ ) b[i] = Q[i].x;
00138   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00139   for( i = 0; i <= n; i++ ) P[i][iCol].x = b[i];
00140 
00141   // calculate the y coordinates of the controlpoints
00142   for( i = 0; i <= n; i++ ) b[i] = Q[i].y;
00143   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00144   for( i = 0; i <= n; i++ ) P[i][iCol].y = b[i];
00145 
00146   // calculate the z coordinates of the controlpoints
00147   for( i = 0; i <= n; i++ ) b[i] = Q[i].z;
00148   BandBackSubstitution( n+1, p-1, p-1, A, L, index, b ); 
00149   for( i = 0; i <= n; i++ ) P[i][iCol].z = b[i];
00150 }

template<class T>
void CIDecompose int    nQ,
const Ptr< T > &    Uq,
int    p,
const Ptr< T > &    U,
Ptr< Ptr< T > > &    A,
Ptr< Ptr< T > > &    L,
Ptr< int > &    index
 

Definition at line 42 of file gunu_global_interpolate.cpp.

00044 {
00045   Ptr<T> B;
00046   int i,j,span,offset,n,sign;
00047   T u;
00048 
00049   n = nQ-1;
00050 
00051   A[0][p-1] = (T)1;
00052   for( i = p; i < p+p-1; i++ ) A[0][i] = (T)0; 
00053   A[n][p-1] = (T)1;
00054   for( i = 0; i < p-1; i++ ) A[n][i] = (T)0; 
00055 
00056   span = p;
00057   offset = 0;
00058 
00059   for( i = 1; i < n; i++ )
00060   {
00061     u = Uq[i];
00062 
00063     if( (u >= U[span+1]) && (span != n) )
00064       span++;
00065     else
00066       offset--;  // if in the same knotspan as the last point 
00067 
00068     /* cout << "offset = " << offset << "\n"; */
00069 
00070     for( j = 0; j < p-1+offset; j++ ) A[i][j] = (T)0;
00071     for( j = p+p+offset; j < p+p-1; j++ ) A[i][j] = (T)0;
00072     B.use_pointer( &A[i][p-1+offset], p+1 );
00073     CalcBasisFunctions( u, span, p, U, B );
00074   }
00075   BandDecomposition( n+1, p-1, p-1, A, L, &sign, index );
00076 }

template void Circle point< double >    O,
point< double >    X,
point< double >    Y,
double    r,
double    theta_start,
double    theta_end,
int *    ret_n,
int *    ret_p,
Ptr< double > *    retU,
Ptr< hpoint< double > > *    retPw
 

template void Circle point< float >    O,
point< float >    X,
point< float >    Y,
float    r,
float    theta_start,
float    theta_end,
int *    ret_n,
int *    ret_p,
Ptr< float > *    retU,
Ptr< hpoint< float > > *    retPw
 

template<class T>
void gunu::Circle point< T >    O,
point< T >    X,
point< T >    Y,
  r,
  theta_start,
  theta_end,
int *    ret_n,
int *    ret_p,
Ptr< T > *    retU,
Ptr< hpoint< T > > *    retPw
 

Create a circle as a NURBS curve (see "The NURBS book").

Definition at line 53 of file gunu_revolve.cpp.

00064 {
00065   Ptr< hpoint<T> > Pw;
00066   point<T> P0, T0, P1, P2, T2;
00067   T ths,the,theta,dtheta, w1, angle, dummy;
00068   Ptr<T> U;
00069   int narcs, n, index, i, j;
00070 
00071   ths = theta_start;
00072   the = theta_end;
00073   
00074   if( the < ths ) the += rtr<T>::pi() * (T)2;
00075   
00076   theta = the - ths;
00077   
00078   if( theta <= rtr<T>::pi() / (T)2 ) narcs = 1;
00079   else if( theta <= rtr<T>::pi() ) narcs = 2;
00080   else if( theta <= (T)1.5 * rtr<T>::pi()  ) narcs = 3;
00081   else narcs = 4;
00082   
00083   dtheta = theta / ((T)narcs);
00084   
00085   n = 2 * narcs;      /* n = number of control points - 1 */
00086 
00087   Pw.reserve_pool(n+1); 
00088   U.reserve_pool(n+4);
00089 
00090   w1 = rtr<T>::cos( dtheta/(T)2 );
00091 
00092   P0.x = O.x + r*rtr<T>::cos(ths)*X.x + r*rtr<T>::sin(ths)*Y.x;
00093   P0.y = O.y + r*rtr<T>::cos(ths)*X.y + r*rtr<T>::sin(ths)*Y.y;
00094   P0.z = O.z + r*rtr<T>::cos(ths)*X.z + r*rtr<T>::sin(ths)*Y.z;
00095 
00096   T0.x = -rtr<T>::sin(ths)*X.x + rtr<T>::cos(ths)*Y.x;
00097   T0.y = -rtr<T>::sin(ths)*X.y + rtr<T>::cos(ths)*Y.y;
00098   T0.z = -rtr<T>::sin(ths)*X.z + rtr<T>::cos(ths)*Y.z;
00099 
00100   Pw[0].x = P0.x;
00101   Pw[0].y = P0.y;
00102   Pw[0].z = P0.z;
00103   Pw[0].w = (T)1;
00104   
00105   index = 0;
00106   angle = ths;
00107   
00108   for( i = 1; i <= narcs; i++ )
00109   {
00110     angle += dtheta;
00111 
00112     P2.x = O.x + r*rtr<T>::cos(angle)*X.x + r*rtr<T>::sin(angle)*Y.x;
00113     P2.y = O.y + r*rtr<T>::cos(angle)*X.y + r*rtr<T>::sin(angle)*Y.y;
00114     P2.z = O.z + r*rtr<T>::cos(angle)*X.z + r*rtr<T>::sin(angle)*Y.z;    
00115         
00116     Pw[index+2].x = P2.x;
00117     Pw[index+2].y = P2.y;
00118     Pw[index+2].z = P2.z;
00119     Pw[index+2].w = (T)1;
00120 
00121     T2.x = -rtr<T>::sin(angle)*X.x + rtr<T>::cos(angle)*Y.x;
00122     T2.y = -rtr<T>::sin(angle)*X.y + rtr<T>::cos(angle)*Y.y;
00123     T2.z = -rtr<T>::sin(angle)*X.z + rtr<T>::cos(angle)*Y.z;
00124 
00125     SVDIntersectLines( P0, T0, P2, T2, &dummy, &dummy, &P1 );
00126   
00127     Pw[index+1].x = w1 * P1.x;
00128     Pw[index+1].y = w1 * P1.y;
00129     Pw[index+1].z = w1 * P1.z;
00130     Pw[index+1].w = w1;            
00131 
00132     index += 2;
00133     
00134     if( i < narcs )
00135     {
00136       P0 = P2;
00137       T0 = T2;
00138     }  
00139   }  
00140   j = 2 * narcs + 1;
00141   
00142   for( i = 0; i < 3; i++ )
00143   {
00144     U[i] = (T)0;
00145     U[i+j] = (T)1;
00146   }  
00147   switch( narcs )
00148   {
00149     case 2:
00150       U[3] = U[4] = (T)0.5;
00151       break;
00152     case 3:
00153       U[3] = U[4] = (T)1 / (T)3;
00154       U[5] = U[6] = (T)2 / (T)3;
00155       break;
00156     case 4:
00157       U[3] = U[4] = (T)0.25;  
00158       U[5] = U[6] = (T)0.5;  
00159       U[7] = U[8] = (T)0.75;  
00160       break;
00161   }    
00162   *ret_n = n;
00163   *ret_p = 2;
00164   *retPw = Pw;
00165   *retU = U;
00166 }

template<class T, class EP>
T ColumnChordLength int    nRows,
int    nCols,
const gul::Ptr< gul::Ptr< EP > > &    Q,
int    iCol,
gul::Ptr< T > &    d
[inline]
 

Definition at line 42 of file gunu_parametrize.h.

00045 {
00046   T sum = (T)0;
00047   d[0] = (T)0;
00048 
00049   for( int i = 1; i < nRows; i++ )
00050   {
00051     d[i] = gul::distance( Q[i][iCol], Q[i-1][iCol] );
00052     sum += d[i];
00053   }
00054   return sum;
00055 }

template GULAPI void CubicCurveInterpolation int    n,
Ptr< point< double > >    Q,
Ptr< double >    U,
Ptr< point< double > >    P
 

template GULAPI void CubicCurveInterpolation int    n,
Ptr< point< float > >    Q,
Ptr< float >    U,
Ptr< point< float > >    P
 

template<class T>
GULAPI void gunu::CubicCurveInterpolation int    n,
Ptr< point< T > >    Q,
Ptr< T >    U,
Ptr< point< T > >    P
 

Definition at line 50 of file gunu_interpolate.cpp.

00052 {
00053   Ptr<point<T> > R;
00054   Ptr<T>         dd,abc;
00055   T   deni;
00056   int i;
00057 
00058   R.reserve_pool(n+1);
00059   dd.reserve_pool(n+1);
00060   abc.reserve_pool(4);
00061  
00062   for( i = 3; i < n; i++ )
00063     R[i] = Q[i-1];
00064 
00065   CalcBasisFunctions( U[4], 4, 3, U, abc );
00066 
00067   deni = (T)1/abc[1];
00068   P[2] = deni*(Q[1]-abc[0]*P[1]);
00069  
00070   for( i = 3; i < n; i++ )
00071   {
00072     dd[i] = deni*abc[2];
00073     
00074     CalcBasisFunctions( U[i+2], i+2, 3, U, abc );
00075 
00076     deni = (T)1/(abc[1]-abc[0]*dd[i]);
00077     P[i] = deni*(R[i]-abc[0]*P[i-1]);
00078   }
00079 
00080   dd[n] = deni*abc[2];
00081 
00082   CalcBasisFunctions( U[n+2], n+2, 3, U, abc );
00083 
00084   deni = (T)1/(abc[1]-abc[0]*dd[n]);
00085   P[n] = deni*(Q[n-1]-abc[2]*P[n+1]-abc[0]*P[n-1]);
00086 
00087   for( i = n-1; i >= 2; i-- )
00088   {
00089     P[i] = P[i]-dd[i+1]*P[i+1];
00090   }
00091 }

template GULAPI void CubicLocalCurveInterpolation int    n,
Ptr< point< double > >    Q,
bool    cornerflag,
Ptr< double >    U,
Ptr< point< double > >    P
 

template GULAPI void CubicLocalCurveInterpolation int    n,
Ptr< point< float > >    Q,
bool    cornerflag,
Ptr< float >    U,
Ptr< point< float > >    P
 

template<class K>
GULAPI void gunu::CubicLocalCurveInterpolation int    n,
Ptr< point< K > >    Q,
bool    cornerflag,
Ptr< K >    U,
Ptr< point< K > >    P
 

Definition at line 109 of file gunu_interpolate.cpp.

00112 {
00113   Ptr< point<K> > q,T;
00114   point<K> v1;
00115   K a,b,c,alpha,l1,l2,u,ui;
00116   int upos, cpts_pos,k;
00117   bool no_alpha;
00118   
00119   q.reserve_pool(n+4);
00120   T.reserve_pool(n+1);
00121   
00122  /* ---------- calculate tangent vectors T{k} -----------------------------*/
00123 
00124 // it's a bit confusing, but to be able to have a q[-1], i am using:
00125 // q'[k] = Q{k} - Q{k-1}
00126 // q[k+1] -> q'[k]
00127 
00128   for( k = 1; k <= n; k++ )
00129     q[k+1] = Q[k] - Q[k-1];
00130 
00131   q[1] = (K)2 * q[2] - q[3];        /* q'{0}  =  2 * q'{1} - q'{2} */
00132   q[0] = (K)2 * q[1] - q[2];        /* q'[-1} =  2 * q'{0} - q'{1} */
00133 
00134   q[n+2] = (K)2 * q[n+1] - q[n];    /* q'{n+1} = 2 * q'{n} - q'{n-1}   */
00135   q[n+3] = (K)2 * q[n+2] - q[n+1];  /* q'{n+2} = 2 * q'{n+1} - q'{n}   */
00136   
00137   for( k = 0; k <= n; k++ )
00138   {    
00139     /* alpha{k} = |q'{k-1} x q'{k}| / (|q'{k-1} x q'{k}| + |q'{k+1} x q'{k+2}|)
00140     */
00141     l1 = length(cross_product(q[k], q[k+1]));
00142     l2 = length(cross_product(q[k+2], q[k+3]));
00143 
00144     no_alpha = false;
00145     if( l1 + l2 != 0.0 )
00146       alpha = l1 / (l1 + l2);   
00147     else
00148       if( !cornerflag )
00149         alpha = 0.5;              /* make corners round */
00150       else
00151         no_alpha = true;            /* take 0 as tangent vector */
00152         
00153     if( no_alpha == false )
00154     {
00155                                     /* V{k} = (1-alpha)*q{k} + alpha*q{k+1} */
00156       T[k] = ((K)1-alpha)*q[k+1] + alpha*q[k+2];
00157       l1 = length(T[k]);
00158       if( l1 != 0.0 )
00159         T[k] = ((K)1/l1) * T[k];    /*  T{k} = V{k} / |V{k}| */
00160       else
00161         set( T[k], (K)0 );
00162     }
00163     else
00164      set( T[k], (K)0 );    
00165   }
00166 
00167 /* ----------- calculate Bezier segments ------------------------------- */
00168 
00169   P[0] = Q[0];
00170   cpts_pos = 1;
00171   U[0] = 0;
00172   U[1] = 0;
00173   U[2] = 0;
00174   U[3] = 0;
00175   upos = 4;
00176   
00177   for( k = 0; k < n; k++ )
00178   {
00179     v1 = T[k] + T[k+1];       /* a = 16 - |T{k}{0} + T{k}{3}|^2 */
00180     a = ((K)16) - (v1 * v1);  /* (with T{k}{0} = T{k}, T{k}{3} = T{k+1} */
00181     
00182     l1 = q[k+2] * v1;         /* b = 12 * (P{3}-P{0})*(T{k}{0}+T{k}{3}) */
00183     b = ((K)12) * l1;         /* (with P{0} = Q{k}, P{3} = Q{k+1}) */
00184 
00185     c = ((K)-36) * (q[k+2] * q[k+2]);    /* c = -36 * |P{3} - P{0}|^2 */
00186     
00187     alpha = 
00188       ( -(b/(((K)2)*a)) + rtr<K>::sqrt(((b*b)/(((K)4)*a*a)) - (c/a)) ) / ((K)3);
00189 
00190                                         
00191     P[cpts_pos++] = Q[k] + (alpha * T[k]);     /* P1 = P0 + 1/3 * alpha' * T0 */    
00192     P[cpts_pos++] = Q[k+1] - (alpha * T[k+1]); /* P2 = P3 - 1/3 * alpha' * T3 */
00193 
00194                                 /* u{k+1} = u{k} + 3 * |(P{k}{1} - P{k}{0})| */
00195     v1 = P[cpts_pos-2] - Q[k];
00196     l1 = length(v1);
00197     u = U[upos-1] + ((K)3) * l1;   
00198     U[upos++] = u;
00199     U[upos++] = u;
00200   }
00201  
00202   P[cpts_pos] = Q[n];  
00203   upos -= 2;
00204   ui = ((K)1) / U[upos];
00205   for( k = 4; k < upos; k++ )
00206     U[k] *= ui;
00207 
00208   U[upos++] = (K)1;
00209   U[upos++] = (K)1;
00210   U[upos++] = (K)1;
00211   U[upos] = (K)1;
00212 }

template GULAPI void CubicLocalSurfaceInterpolation int    n,
int    m,
Ptr< Ptr< point< double > > >    Q,
bool    cornerflag,
Ptr< double >    U,
Ptr< double >    V,
Ptr< Ptr< hpoint< double > > >    controlPoints
 

template GULAPI void CubicLocalSurfaceInterpolation int    n,
int    m,
Ptr< Ptr< point< float > > >    Q,
bool    cornerflag,
Ptr< float >    U,
Ptr< float >    V,
Ptr< Ptr< hpoint< float > > >    controlPoints
 

template GULAPI void CubicLocalSurfaceInterpolation int    n,
int    m,
Ptr< Ptr< point< double > > >    Q,
bool    cornerflag,
Ptr< double >    U,
Ptr< double >    V,
Ptr< Ptr< point< double > > >    controlPoints
 

template GULAPI void CubicLocalSurfaceInterpolation int    n,
int    m,
Ptr< Ptr< point< float > > >    Q,
bool    cornerflag,
Ptr< float >    U,
Ptr< float >    V,
Ptr< Ptr< point< float > > >    controlPoints
 

template<class T, class HP>
GULAPI void gunu::CubicLocalSurfaceInterpolation int    n,
int    m,
Ptr< Ptr< point< T > > >    Q,
bool    cornerflag,
Ptr< T >    U,
Ptr< T >    V,
Ptr< Ptr< HP > >    controlPoints
 

Definition at line 233 of file gunu_interpolate.cpp.

00236 {
00237   T gamma, alpha, a, l1, l2, total, d;
00238   int rpos, cpos, k, l, i;
00239   bool no_alpha;
00240   Ptr< Ptr< Ptr< Ptr< point<T> > > > > P;
00241   Ptr<T> r, s, alpha_k, beta_l, delta_uk, delta_vl, ub, vb;
00242   Ptr< Ptr< point<T> > > D_uv_, d_vu_, d_uv_, T_u_, T_v_;
00243   Ptr< point<T> > q, D_v_, d_v_, D_u_, d_u_;
00244   point<T> v1;
00245   
00246 /* ---- reserve memory for local arrays ----------------------------- */
00247 
00248   P.reserve_pool(m+1);
00249   T_u_.reserve_pool(m+1);
00250   T_v_.reserve_pool(m+1);
00251   d_vu_.reserve_pool(m+1);
00252   d_uv_.reserve_pool(m+1);
00253   D_uv_.reserve_pool(m+1);
00254 
00255   for( l = 0; l <= m; l++ )
00256   {
00257     P[l].reserve_pool(n+1);
00258     T_u_[l].reserve_pool(n+1);
00259     T_v_[l].reserve_pool(n+1);
00260     d_vu_[l].reserve_pool(n+1);
00261     d_uv_[l].reserve_pool(n+1);
00262     D_uv_[l].reserve_pool(n+1);
00263 
00264     for( k = 0; k <= n; k++ )
00265     {
00266       P[l][k].reserve_pool(3);
00267 
00268       for( i = 0; i < 3; i++ )
00269         P[l][k][i].reserve_pool(3);
00270     }
00271   }   
00272   ub.reserve_pool(n+1);
00273   vb.reserve_pool(m+1);
00274   k = Max(m,n);
00275   q.reserve_pool(k+4);
00276   r.reserve_pool(m+1);
00277   s.reserve_pool(n+1);
00278   delta_vl.reserve_pool(m+1);
00279   delta_uk.reserve_pool(n+1);
00280   beta_l.reserve_pool(m+1);
00281   alpha_k.reserve_pool(n+1);
00282   D_v_.reserve_pool(n+1);
00283   d_v_.reserve_pool(n+1);
00284   D_u_.reserve_pool(m+1);
00285   d_u_.reserve_pool(m+1);
00286 
00287 /* -------------- calculate T_u_{k,l} ------------------------------------- */  
00288 
00289   total = 0.0;
00290     
00291   for( k = 0; k <= n; k++ )
00292     ub[k] = 0.0;
00293 
00294   for( l = 0; l <= m; l++ )
00295   {
00296     for( k = 1; k <= n; k++ )
00297       q[k+1] = Q[l][k] - Q[l][k-1];
00298 
00299     q[1] = ((T)2) * q[2] - q[3];
00300     q[0] = ((T)2) * q[1] - q[2];
00301     q[n+2] = ((T)2) * q[n+1] - q[n];
00302     q[n+3] = ((T)2) * q[n+2] - q[n+1];
00303   
00304     for( k = 0; k <= n; k++ )
00305     {    
00306       l1 = length(cross_product(q[k], q[k+1]));
00307       l2 = length(cross_product(q[k+2], q[k+3]));
00308 
00309       no_alpha = false;
00310       if( l1 + l2 != 0.0 )
00311         alpha = l1 / (l1 + l2);   
00312       else
00313         if( !cornerflag )
00314           alpha = (T)0.5;
00315         else
00316           no_alpha = true;
00317 
00318       if( no_alpha == false )                
00319       {
00320         T_u_[l][k] = ((T)1-alpha)*q[k+1] + alpha*q[k+2];
00321 
00322         l1 = length(T_u_[l][k]);           
00323         if( l1 != 0.0 )
00324           T_u_[l][k] = ((T)1/l1) * T_u_[l][k];
00325         else
00326           set( T_u_[l][k], (T)0 );
00327       }
00328       else
00329         set( T_u_[l][k], (T)0 );
00330     }
00331 /* ------------------------------------------------------------------------- */
00332 
00333     r[l] = (T)0;
00334 
00335     for( k = 1; k <= n; k++ )
00336     {
00337       d = length(q[k+1]);     /* d = |Q{l,k} - Q{l,k-1}| */
00338       ub[k] += d;
00339       r[l] += d;
00340     }  
00341     total += r[l];    /* add total chord length of this row */
00342   }  
00343   for( k = 1; k < n; k++ )
00344     ub[k] = ub[k-1] + (ub[k]/total);    
00345 
00346   ub[n] = 1.0;
00347 
00348 /* -------------- calculate T_v_{k,l} ------------------------------------- */  
00349 
00350   total = 0.0;
00351     
00352   for( l = 0; l <= m; l++ )
00353     vb[l] = 0.0;
00354 
00355   for( k = 0; k <= n; k++ )
00356   {
00357     for( l = 1; l <= m; l++ )
00358       q[l+1] = Q[l][k] - Q[l-1][k];
00359  
00360     q[1] = ((T)2) * q[2] - q[3];
00361     q[0] = ((T)2) * q[1] - q[2];
00362     q[m+2] = ((T)2) * q[m+1] - q[m];
00363     q[m+3] = ((T)2) * q[m+2] - q[m+1];
00364 
00365     for( l = 0; l <= m; l++ )
00366     {    
00367       l1 = length(cross_product(q[l], q[l+1]));
00368       l2 = length(cross_product(q[l+2], q[l+3]));
00369 
00370       no_alpha = false;
00371       if( l1 + l2 != (T)0 )
00372         alpha = l1 / (l1 + l2);   
00373       else
00374         if( !cornerflag )
00375           alpha = (T)0.5;              /* make sharp corners round */
00376         else
00377           no_alpha = true;            /* else set tangent vector to 0 */
00378         
00379       if( no_alpha == false )
00380       {
00381         T_v_[l][k] = ((T)1-alpha) * q[l+1] + alpha*q[l+2];
00382         l1 = length( T_v_[l][k] );            
00383         if( l1 != (T)0 )
00384           T_v_[l][k] = ((T)1/l1) * T_v_[l][k];
00385         else
00386           set( T_v_[l][k], (T)0 );
00387       }
00388       else
00389         set( T_v_[l][k], (T)0 );
00390     }
00391 /* ------------------------------------------------------------------------- */
00392 
00393     s[k] = 0.0;
00394 
00395     for( l = 1; l <= m; l++ )
00396     {
00397       d = length( q[l+1] );     /* d = |Q{l,k} - Q{l-1,k}| */
00398       vb[l] += d;
00399       s[k] += d;
00400     }  
00401     total += s[k]; /* add total chord length of this column */ 
00402   }  
00403   for( l = 1; l < m; l++ )
00404     vb[l] = vb[l-1] + (vb[l]/total);    
00405 
00406   vb[m] = (T)1;
00407 
00408 /* -------------------------------------------------------------------  
00409    Calculate the control points of the Bezier patches which lie in the rows
00410    and columns containing the data points
00411 
00412   Formula for rows:
00413    P{l,k}{0,0] = Q{l,k}
00414    P{l,k}{0,1} = Q{l,k} + a * T_u_{l,k} 
00415    P{l,k}{0,2} = Q{l,k+1} - a * T_u_{l,k+1} 
00416   with
00417    a = r{l} * (ub{k+1} - ub{k}) / 3
00418 
00419   Formula for columns:
00420    P{l,k}{1,0} = Q{l,k} + a * T_v_{l,k} 
00421    P{l,k}{2,0} = Q{l+1,k} - a * T_v_{l+1,k} 
00422   with
00423    a = s{k} * (vb{l+1} - vb{l}) / 3
00424 ------------------------------------------------------------------------ */
00425   for( l = 0; l <= m; l++ )
00426   {
00427     for( k = 0; k < n; k++ )
00428     { 
00429       P[l][k][0][0] = Q[l][k];
00430       a = (r[l] * (ub[k+1] - ub[k])) / (T)3;
00431       P[l][k][0][1] = Q[l][k] + a * T_u_[l][k];
00432       P[l][k][0][2] = Q[l][k+1] - a * T_u_[l][k+1];
00433     }
00434     P[l][n][0][0] = Q[l][n];
00435   }
00436   
00437   for( k = 0; k <= n; k++ )
00438   {
00439     for( l = 0; l < m; l++ )
00440     {
00441       a = (s[k] * (vb[l+1] - vb[l])) / (T)3;
00442       P[l][k][1][0] = Q[l][k] + a * T_v_[l][k];
00443       P[l][k][2][0] = Q[l+1][k] - a * T_v_[l+1][k];
00444     }
00445   } 
00446 /* ----------------------------------------------------------------------
00447  Calculate the 4 inner control points of the Bezier patches.
00448  For this the mixed partial derivatives D_uv_{k,l} at the 4 corners 
00449  of the patch are needed
00450 ----------------------------------------------------------------------- */
00451   for( k = 1; k <= n; k++ )
00452     delta_uk[k] = ub[k] - ub[k-1];
00453   for( k = 1; k < n; k++ )
00454     alpha_k[k] = delta_uk[k] / (delta_uk[k] + delta_uk[k+1]);
00455   alpha_k[0] = 0.5;
00456   alpha_k[n] = 0.5;  
00457 
00458   for( l = 1; l <= m; l++ )
00459     delta_vl[l] = vb[l] - vb[l-1];
00460   for( l = 1; l < m; l++ )
00461     beta_l[l] = delta_vl[l] / (delta_vl[l] + delta_vl[l+1]);  
00462   beta_l[0] = 0.5;
00463   beta_l[m] = 0.5;
00464    
00465 /* --------- calculate d_vu_{k,l} --------------------------------- */
00466     
00467   for( l = 0; l <= m; l++ )
00468   {
00469     for( k = 0; k <= n; k++ )
00470       D_v_[k] = s[k] * T_v_[l][k];    /* D_v_{l,k} = s{k] * T_v_{l,k} */
00471 
00472     for( k = 1; k <= n; k++ )
00473     {
00474                       /* d_v_{l,k} := (D_v_{l,k} - D_v_{l,k-1}) / delta_u{k} */
00475       d_v_[k] = D_v_[k] - D_v_[k-1];
00476 
00477       if( delta_uk[k] != (T)0 )
00478         d_v_[k] = ((T)1 / delta_uk[k]) * d_v_[k];
00479       else
00480         set( d_v_[k], (T)0 );
00481     }       
00482     for( k = 1; k < n; k++ )
00483     {
00484       d_vu_[l][k] = ((T)1 - alpha_k[k]) * d_v_[k] + alpha * d_v_[k+1];
00485     }
00486 /* special cases at the borders (k=0,k=n): */
00487 
00488     d_vu_[l][0] = (T)2 * d_v_[1] - d_vu_[l][1];
00489     d_vu_[l][n] = (T)2 * d_v_[n] - d_vu_[l][n-1];
00490   }    
00491 /* --------- calculate d_uv_{k,l} --------------------------------- */
00492     
00493   for( k = 0; k <= n; k++ )
00494   {
00495     for( l = 0; l <= m; l++ )
00496       D_u_[l] = r[l] * T_u_[l][k];    /* D_u_{l,k} = r{l] * T_u_{l,k} */
00497 
00498     for( l = 1; l <= m; l++ )
00499     {
00500                       /* d_u_{l,k} := (D_u_{l,k} - D_u_{l-1,k}) / delta_v{l} */
00501       d_u_[l] = D_u_[l] - D_u_[l-1];
00502       if( delta_vl[l] != (T)0 )
00503         d_u_[l] = ((T)1 / delta_vl[l]) * d_u_[l];
00504       else
00505         set( d_u_[l], (T)0 );
00506     }  
00507     for( l = 1; l < m; l++ )
00508     {
00509       d_uv_[l][k] = ((T)1 - beta_l[l]) * d_u_[l] + beta_l[l] * d_u_[l+1];
00510     }
00511 /* special cases at the borders (l=0,l=n): */
00512 
00513     d_uv_[0][k] = (T)2 * d_u_[1] - d_uv_[1][k];
00514     d_uv_[m][k] = (T)2 * d_u_[m] - d_uv_[m-1][k];
00515   }    
00516 /* --- calculate the mixed partial derivatives D_uv_{k,l} ------ */  
00517 
00518   for( l = 0; l <= m; l++ )
00519     for( k = 0; k <= n; k++ )
00520     {
00521       v1 = alpha_k[k] * d_uv_[l][k] + beta_l[l] * d_vu_[l][k];
00522       if( alpha_k[k] + beta_l[l] != (T)0 )
00523         D_uv_[l][k] = ((T)1/(alpha_k[k] + beta_l[l])) * v1; 
00524       else
00525         set( D_uv_[l][k], (T)0 );
00526     }
00527 /*--- calculate the 4 inner control points of the Bezier patches --------- */
00528 /*  used formulas:
00529   P{l,k}{1,1} = (gamma * D_uv_{l,k}) + P{l,k}{1,0} + P{l,k}{0,1} - P{l,k}{0,0}      
00530   ... (see NURBS Book, page 403)
00531 */
00532   for( l = 0; l < m; l++ )
00533     for( k = 0; k < n; k++ )
00534     {
00535       gamma = (delta_uk[k+1] * delta_vl[l+1]) / (T)9;
00536 
00537       P[l][k][1][1] = gamma * D_uv_[l][k] + 
00538                       P[l][k][1][0] + P[l][k][0][1] - P[l][k][0][0];
00539       P[l][k][1][2] = -gamma * D_uv_[l][k+1] + 
00540                       P[l][k+1][1][0] - P[l][k+1][0][0] + P[l][k][0][2];
00541       P[l][k][2][1] = -gamma * D_uv_[l+1][k] + 
00542                       P[l+1][k][0][1] - P[l+1][k][0][0] + P[l][k][2][0];
00543       P[l][k][2][2] = gamma * D_uv_[l+1][k+1] + 
00544                       P[l+1][k][0][2] + P[l][k+1][2][0] - P[l+1][k+1][0][0];
00545     } 
00546 /* ---- construct the knot vectors U,V ---------------------------- */
00547 
00548   U[0] = 0.0;
00549   U[1] = 0.0;
00550   U[2] = 0.0;
00551   U[3] = 0.0;
00552   cpos = 4;
00553   for( k = 1; k < n; k++ )
00554   {
00555     U[cpos++] = ub[k];
00556     U[cpos++] = ub[k];
00557   }   
00558   U[cpos++] = 1.0;
00559   U[cpos++] = 1.0;
00560   U[cpos++] = 1.0;
00561   U[cpos] = 1.0;
00562 
00563   V[0] = 0.0;
00564   V[1] = 0.0;
00565   V[2] = 0.0;
00566   V[3] = 0.0;
00567   cpos = 4;
00568   for( l = 1; l < m; l++ )
00569   {
00570     V[cpos++] = vb[l];
00571     V[cpos++] = vb[l];
00572   }   
00573   V[cpos++] = 1.0;
00574   V[cpos++] = 1.0;
00575   V[cpos++] = 1.0;
00576   V[cpos] = 1.0;
00577 
00578 /* ---------- fill control point array ---------------- */ 
00579 
00580   rpos = 0;
00581   cpos = 0;
00582 
00583 /* ------------- first row ------------------------------------------- */
00584 
00585   controlPoints[rpos][cpos++] = P[0][0][0][0];
00586   for( k = 0; k < n; k++ )
00587   {
00588     controlPoints[rpos][cpos++] = P[0][k][0][1];
00589     controlPoints[rpos][cpos++] = P[0][k][0][2];
00590   }
00591   controlPoints[rpos][cpos++] = P[0][n][0][0];
00592 
00593 /* -------------- inner rows ------------------------------------ */
00594 
00595   for( l = 0; l < m; l++ )
00596   {
00597     rpos++;
00598     cpos = 0;    
00599     controlPoints[rpos][cpos++] = P[l][0][1][0];
00600     for( k = 0; k < n; k++ )
00601     {
00602       controlPoints[rpos][cpos++] = P[l][k][1][1];
00603       controlPoints[rpos][cpos++] = P[l][k][1][2];
00604     }
00605     controlPoints[rpos][cpos++] = P[l][n][1][0];
00606     
00607     rpos++;
00608     cpos = 0;
00609     controlPoints[rpos][cpos++] = P[l][0][2][0];
00610     for( k = 0; k < n; k++ )
00611     {
00612       controlPoints[rpos][cpos++] = P[l][k][2][1];
00613       controlPoints[rpos][cpos++] = P[l][k][2][2];
00614     }
00615     controlPoints[rpos][cpos++] = P[l][n][2][0];
00616   }
00617 /* --------------- last row --------------------------------------- */
00618 
00619   rpos++;
00620   cpos = 0;
00621   controlPoints[rpos][cpos++] = P[m][0][0][0];
00622   for( k = 0; k < n; k++ )
00623   {
00624     controlPoints[rpos][cpos++] = P[m][k][0][1];
00625     controlPoints[rpos][cpos++] = P[m][k][0][2];
00626   }
00627   controlPoints[rpos][cpos++] = P[m][n][0][0];
00628 
00629 /*------------- ready ------------------------------------------------- */
00630 }

template<class T, class EP>
GULAPI void CurveDerivatives const T    u,
const int    n,
const int    p,
const Ptr< T > &    U,
const Ptr< EP > &    Pw,
const int    d,
Ptr< EP > &    CK
 

Definition at line 82 of file gunu_derivatives.h.

00086 {
00087   BSPCurveDerivatives(u,n,p,U,Pw,d,CK);
00088 }

template GULAPI void CurveDerivatives const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< hpoint2< double > > &    Pw,
const int    d,
Ptr< point2< double > > &    CK
 

template GULAPI void CurveDerivatives const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< hpoint2< float > > &    Pw,
const int    d,
Ptr< point2< float > > &    CK
 

template GULAPI void CurveDerivatives const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< hpoint< double > > &    Pw,
const int    d,
Ptr< point< double > > &    CK
 

template GULAPI void CurveDerivatives const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< hpoint< float > > &    Pw,
const int    d,
Ptr< point< float > > &    CK
 

template<class T, class HP, class EP>
GULAPI void gunu::CurveDerivatives const T    u,
const int    n,
const int    p,
const Ptr< T > &    U,
const Ptr< HP > &    Pw,
const int    d,
Ptr< EP > &    CK
 

Definition at line 309 of file gunu_derivatives.cpp.

00313 {
00314   Ptr< HP > CKh;
00315   EP v,v1;
00316   T w0;
00317   int k,i;
00318 
00319   CKh.reserve_place( reserve_stack(HP,d+1), d+1 );
00320      
00321   BSPCurveDerivatives<T,HP>( u, n, p, U, Pw, d, CKh );
00322 
00323   w0 = CKh[0].w;
00324   
00325   for( k = 0; k <= d; k++ )
00326   {
00327     v = ortho( CKh[k] );
00328     
00329     for( i = 1; i <= k; i++ )
00330     {
00331       v1 = (rtr<T>::BinCoeff(k,i) * CKh[i].w) * CK[k-i];
00332       v = v - v1;
00333     }
00334     CK[k] = ((T)1.0 / w0) * v;       
00335   }
00336 }

template GULAPI void CurvePoint const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< point2< double > > &    Pw,
point2< double > *    C
 

template GULAPI void CurvePoint const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< point2< float > > &    Pw,
point2< float > *    C
 

template GULAPI void CurvePoint const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< point< double > > &    Pw,
point< double > *    C
 

template GULAPI void CurvePoint const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< point< float > > &    Pw,
point< float > *    C
 

template GULAPI void CurvePoint const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< hpoint2< double > > &    Pw,
point2< double > *    C
 

template GULAPI void CurvePoint const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< hpoint2< float > > &    Pw,
point2< float > *    C
 

template GULAPI void CurvePoint const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
const Ptr< hpoint< double > > &    Pw,
point< double > *    C
 

template GULAPI void CurvePoint const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
const Ptr< hpoint< float > > &    Pw,
point< float > *    C
 

template<class T, class HP, class EP>
GULAPI void gunu::CurvePoint const T    u,
const int    n,
const int    p,
const Ptr< T > &    U,
const Ptr< HP > &    Pw,
EP *    C
 

Definition at line 347 of file gunu_basics.cpp.

00350 {
00351   Ptr< T > N;
00352   HP v1,h;
00353   int span,i;
00354 
00355   N.reserve_place( reserve_stack(T,p+1), p+1 );
00356   
00357   span = FindSpan( u, n, p, U );
00358   CalcBasisFunctions<T>( u, span, p, U, N );
00359 
00360   set( h, (T)0.0 );
00361   
00362   for( i = 0; i <= p; i++ )
00363   {
00364     v1 = N[i] * Pw[span-p+i];
00365     h = h + v1;
00366   } 
00367   *C = euclid( h );
00368 }

template GULAPI bool DoGlobalCurveApproximation int    nQ,
const Ptr< point2< double > > &    Q,
const Ptr< double > &    QU,
int    n,
int    p,
const Ptr< double > &    U,
int    max_pts_span,
Ptr< point2< double > > &    P
 

template GULAPI bool DoGlobalCurveApproximation int    nQ,
const Ptr< point2< float > > &    Q,
const Ptr< float > &    QU,
int    n,
int    p,
const Ptr< float > &    U,
int    max_pts_span,
Ptr< point2< float > > &    P
 

template GULAPI bool DoGlobalCurveApproximation int    nQ,
const Ptr< point< double > > &    Q,
const Ptr< double > &    QU,
int    n,
int    p,
const Ptr< double > &    U,
int    max_pts_span,
Ptr< point< double > > &    P
 

template GULAPI bool DoGlobalCurveApproximation int    nQ,
const Ptr< point< float > > &    Q,
const Ptr< float > &    QU,
int    n,
int    p,
const Ptr< float > &    U,
int    max_pts_span,
Ptr< point< float > > &    P
 

template<class T, class EP>
GULAPI bool gunu::DoGlobalCurveApproximation int    nQ,
const Ptr< EP > &    Q,
const Ptr< T > &    QU,
int    n,
int    p,
const Ptr< T > &    U,
int    max_pts_span,
Ptr< EP > &    P
 

Definition at line 453 of file gunu_global_approximate.cpp.

00462 {
00463   Ptr< Ptr< Ptr<T> > > N;
00464   int i,j;
00465   Ptr< Ptr<T> > A;
00466   Ptr<int> M;
00467  
00468   if( p < 2 ) return false;
00469   if( n < p ) return false;
00470   if( nQ <= n+1 ) return false; // else no unique minimum
00471 
00472   M.reserve_pool(n-p+1);
00473   N.reserve_pool(n-p+1);
00474   for( i = 0; i <= n-p; i++ ) {
00475     N[i].reserve_pool(p+1);
00476     for( j = 0; j <= p; j++ ) N[i][j].reserve_pool(max_pts_span);
00477   }
00478   A.reserve_pool(n-1);
00479   for( i = 0; i < n-1; i++ )
00480     A[i].reserve_pool(p+p+1);
00481 
00482   CACalcNTN<T>( nQ, QU, n, p, U, M, N, A );
00483 
00484   // cout << "MATRIX NTN (version 2):\n";
00485   // cout << dump_matrix<T>(n-1,p+p+1,A);
00486 
00487   CASolve( nQ, Q, QU, n, p, U, M, N, A, P );
00488   
00489   return true;
00490 }

template void DoIntersectSurfaces TessInfo< float, hpoint< float > > *    A,
TessInfo< float, hpoint< float > > *    B,
float    tol,
IntersectInfo< float > *    II
 

template<class T, class HP>
void gunu::DoIntersectSurfaces TessInfo< T, HP > *    A,
TessInfo< T, HP > *    B,
  tol,
IntersectInfo< T > *    II
 

Definition at line 434 of file gunu_intersect.cpp.

00438 {
00439   int nA, nB, i, j;
00440   TessInfo<T,HP> **pA, **pB;  
00441   // IntersectionLineInfo<T> linfo;
00442 
00443   // do the bounding boxes overlap ?  
00444   if( (A->x1 > B->x2) || (A->x2 < B->x1) ||
00445       (A->y1 > B->y2) || (A->y2 < B->y1) ||
00446       (A->z1 > B->z2) || (A->z2 < B->z1) )
00447   {
00448     return;
00449   }   
00450 
00451   // split A into 4 parts, if A cannot be approximated by 2 triangles    
00452   if( !A->linearized && !A->divided )
00453   {      
00454     LinearizeOrDivide<T,HP>( A, tol, true );
00455   }
00456 
00457   // split B into 4 parts, if B cannot be approximated by 2 triangles    
00458   if( !B->linearized && !B->divided )
00459   {      
00460     LinearizeOrDivide<T,HP>( B, tol, true );
00461   }
00462 
00463   // recursion, if not both surfaces can be approximated by triangles
00464   if( !A->linearized || !B->linearized )
00465   {
00466     if( !A->linearized )
00467     {
00468       nA = 4;
00469       pA = A->sub;
00470     }
00471     else
00472     {
00473       nA = 1;
00474       pA = &A;        
00475     }
00476 
00477     if( !B->linearized )
00478     {
00479       nB = 4;
00480       pB = B->sub;
00481     }
00482     else
00483     {
00484       nB = 1;
00485       pB = &B;        
00486     }
00487 
00488     for( i = 0; i < nA; i++ )          // recursion
00489     {
00490       for( j = 0; j < nB; j++ )
00491       {
00492         DoIntersectSurfaces( pA[i], pB[j], tol, II );
00493       }      
00494     }
00495   }
00496   else  // intersect triangles pairwise
00497   {
00498     point<T>         PA[2][2],PB[2][2];
00499     point<rational>  PRA[2][2],PRB[2][2];
00500     point2<rational> PRA_UV[2][2],PRB_UV[2][2];
00501     T                x,y,z;
00502     unsigned long    *cbuf = 
00503       (unsigned long *)alloca(gul::rtr<T>::mantissa_length());
00504     triangle<rational> TA[2],TB[2];
00505     triangle2<rational> TAuv[2],TBuv[2];
00506     point<rational> S[2];
00507     point2<rational> S1uv[2], S2uv[2];
00508     int S1flag[2], S2flag[2];
00509     bool result;
00510 
00511     // convert A to rational representation
00512     PA[0][0] = A->org->P00;
00513     PA[0][1] = A->org->P01;
00514     PA[1][0] = A->org->P10;
00515     PA[1][1] = A->org->P11;
00516 
00517     for( i = 0; i < 2; i++ )
00518     {
00519       for( j = 0; j < 2; j++ )
00520       {
00521         x = (PA[i][j].x - II->minx)*II->scalei;
00522         y = (PA[i][j].y - II->miny)*II->scalei;
00523         z = (PA[i][j].z - II->minz)*II->scalei;
00524 
00525         PRA[i][j].x = rational(coord2int(x,cbuf),cbuf);
00526         PRA[i][j].y = rational(coord2int(y,cbuf),cbuf);
00527         PRA[i][j].z = rational(coord2int(z,cbuf),cbuf);
00528       }
00529     }
00530     // domain coordinates
00531     PRA_UV[0][0].x = rational(coord2int(A->u1+(T)1,cbuf),cbuf);
00532     PRA_UV[0][0].y = rational(coord2int(A->v1+(T)1,cbuf),cbuf);
00533 
00534     PRA_UV[0][1].x = rational(coord2int(A->u2+(T)1,cbuf),cbuf);
00535     PRA_UV[0][1].y = PRA_UV[0][0].y ;
00536 
00537     PRA_UV[1][0].x = PRA_UV[0][0].x;
00538     PRA_UV[1][0].y = rational(coord2int(A->v2+(T)1,cbuf),cbuf);
00539 
00540     PRA_UV[1][1].x = PRA_UV[0][1].x;
00541     PRA_UV[1][1].y = PRA_UV[1][0].y;
00542 
00543     // convert B to rational representation
00544     PB[0][0] = B->org->P00;
00545     PB[0][1] = B->org->P01;
00546     PB[1][0] = B->org->P10;
00547     PB[1][1] = B->org->P11;
00548 
00549     for( i = 0; i < 2; i++ )
00550     {
00551       for( j = 0; j < 2; j++ )
00552       {
00553         x = (PB[i][j].x - II->minx)*II->scalei;
00554         y = (PB[i][j].y - II->miny)*II->scalei;
00555         z = (PB[i][j].z - II->minz)*II->scalei;
00556 
00557         PRB[i][j].x = rational(coord2int(x,cbuf),cbuf);
00558         PRB[i][j].y = rational(coord2int(y,cbuf),cbuf);
00559         PRB[i][j].z = rational(coord2int(z,cbuf),cbuf);
00560       }
00561     }
00562    // domain coordinates
00563     PRB_UV[0][0].x = rational(coord2int(B->u1+(T)1,cbuf),cbuf);
00564     PRB_UV[0][0].y = rational(coord2int(B->v1+(T)1,cbuf),cbuf);
00565 
00566     PRB_UV[0][1].x = rational(coord2int(B->u2+(T)1,cbuf),cbuf);
00567     PRB_UV[0][1].y = PRB_UV[0][0].y;
00568 
00569     PRB_UV[1][0].x = PRB_UV[0][0].x;
00570     PRB_UV[1][0].y = rational(coord2int(B->v2+(T)1,cbuf),cbuf);
00571 
00572     PRB_UV[1][1].x = PRB_UV[0][1].x;
00573     PRB_UV[1][1].y = PRB_UV[1][0].y;
00574 
00575     // form triangles for A
00576     TA[0].P1 = PRA[0][0];
00577     TA[0].P2 = PRA[0][1];
00578     TA[0].P3 = PRA[1][0];
00579     TAuv[0].P1 = PRA_UV[0][0];
00580     TAuv[0].P2 = PRA_UV[0][1];
00581     TAuv[0].P3 = PRA_UV[1][0];
00582 
00583     TA[1].P1 = PRA[1][1];
00584     TA[1].P2 = PRA[1][0];
00585     TA[1].P3 = PRA[0][1];
00586     TAuv[1].P1 = PRA_UV[1][1];
00587     TAuv[1].P2 = PRA_UV[1][0];
00588     TAuv[1].P3 = PRA_UV[0][1];
00589 
00590     // form triangles for B
00591     TB[0].P1 = PRB[0][0];
00592     TB[0].P2 = PRB[0][1];
00593     TB[0].P3 = PRB[1][0];
00594     TBuv[0].P1 = PRB_UV[0][0];
00595     TBuv[0].P2 = PRB_UV[0][1];
00596     TBuv[0].P3 = PRB_UV[1][0];
00597 
00598     TB[1].P1 = PRB[1][1];
00599     TB[1].P2 = PRB[1][0];
00600     TB[1].P3 = PRB[0][1];
00601     TBuv[1].P1 = PRB_UV[1][1];
00602     TBuv[1].P2 = PRB_UV[1][0];
00603     TBuv[1].P3 = PRB_UV[0][1];
00604 
00605     result = IntersectTrianglesUV(TA[0],TAuv[0],TB[0],TBuv[0],
00606                                   S1uv,S1flag,S2uv,S2flag,S);
00607     if( result )
00608     {
00609       // cout << "Intersection line segment: ((" << S[0] << "), (" 
00610       //     << S[1] << "))\n"; 
00611       StoreIntersectionSegment(S,II);
00612       StoreIntersectionSegmentUV(S1uv,S1flag,II->IA);
00613       StoreIntersectionSegmentUV(S2uv,S2flag,II->IB);
00614     }
00615 
00616     result = IntersectTrianglesUV(TA[1],TAuv[1],TB[0],TBuv[0],
00617                                   S1uv,S1flag,S2uv,S2flag,S);
00618     if( result )
00619     {
00620       StoreIntersectionSegment(S,II);
00621       StoreIntersectionSegmentUV(S1uv,S1flag,II->IA);
00622       StoreIntersectionSegmentUV(S2uv,S2flag,II->IB);
00623     }
00624 
00625     result = IntersectTrianglesUV(TA[0],TAuv[0],TB[1],TBuv[1],
00626                                   S1uv,S1flag,S2uv,S2flag,S);
00627     if( result )
00628     {
00629       StoreIntersectionSegment(S,II);
00630       StoreIntersectionSegmentUV(S1uv,S1flag,II->IA);
00631       StoreIntersectionSegmentUV(S2uv,S2flag,II->IB);
00632     }
00633 
00634     result = IntersectTrianglesUV(TA[1],TAuv[1],TB[1],TBuv[1],
00635                                   S1uv,S1flag,S2uv,S2flag,S);
00636     if( result )
00637     {
00638       StoreIntersectionSegment(S,II);
00639       StoreIntersectionSegmentUV(S1uv,S1flag,II->IA);
00640       StoreIntersectionSegmentUV(S2uv,S2flag,II->IB);
00641     }
00642   }
00643 }

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< double, point2< double > > *    C,
const double    tol,
void(*    usrfunc)(void *, point2< double > *, point2< double > *),
void *    usrdata
 

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< float, point2< float > > *    C,
const float    tol,
void(*    usrfunc)(void *, point2< float > *, point2< float > *),
void *    usrdata
 

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< double, point< double > > *    C,
const double    tol,
void(*    usrfunc)(void *, point< double > *, point< double > *),
void *    usrdata
 

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< float, point< float > > *    C,
const float    tol,
void(*    usrfunc)(void *, point< float > *, point< float > *),
void *    usrdata
 

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< double, hpoint2< double > > *    C,
const double    tol,
void(*    usrfunc)(void *, point2< double > *, point2< double > *),
void *    usrdata
 

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< float, hpoint2< float > > *    C,
const float    tol,
void(*    usrfunc)(void *, point2< float > *, point2< float > *),
void *    usrdata
 

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< double, hpoint< double > > *    C,
const double    tol,
void(*    usrfunc)(void *, point< double > *, point< double > *),
void *    usrdata
 

template void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< float, hpoint< float > > *    C,
const float    tol,
void(*    usrfunc)(void *, point< float > *, point< float > *),
void *    usrdata
 

template<class T, class HP, class EP>
void DoLinearizeCurve int    current_iter,
int    max_iter,
curve< T, HP > *    C,
const T    tol,
void(*    usrfunc)(void *, EP *, EP *),
void *    usrdata
 

Definition at line 234 of file gunu_linearize.cpp.

00237 {
00238   if( (current_iter < max_iter) &&
00239       (!guge::IsLinear<T,HP,EP>( C->cpt.n, C->cpt.Pw, tol )) )
00240   {   
00241     curve<T,HP> C1,C2;
00242 
00243     SplitCurve<T,HP>( C, 0.5, &C1, &C2 );
00244     C->cpt.Pw.reset();
00245     C->knt.U.reset();
00246     
00247     DoLinearizeCurve( current_iter+1, max_iter, &C1, tol, usrfunc, usrdata );
00248     DoLinearizeCurve( current_iter+1, max_iter, &C2, tol, usrfunc, usrdata );
00249   }
00250   else
00251   {
00252     EP P1,P2;
00253 
00254     P1 = euclid( C->cpt.Pw[0] );
00255     P2 = euclid( C->cpt.Pw[C->cpt.n] );
00256     C->cpt.Pw.reset();
00257     C->knt.U.reset();
00258 
00259     usrfunc( usrdata, &P1, &P2 );
00260   }
00261 }

template void DoLinearizeSurface int    current_iter,
int    max_iter,
TessInfo< double, point< double > > *    A,
const double    tol,
void outfunc(TessInfo< double, point< double > > *, void *)   ,
void *    outfunc_data
 

template void DoLinearizeSurface int    current_iter,
int    max_iter,
TessInfo< float, point< float > > *    A,
const float    tol,
void outfunc(TessInfo< float, point< float > > *, void *)   ,
void *    outfunc_data
 

template void DoLinearizeSurface int    current_iter,
int    max_iter,
TessInfo< double, hpoint< double > > *    A,
const double    tol,
void outfunc(TessInfo< double, hpoint< double > > *, void *)   ,
void *    outfunc_data
 

template void DoLinearizeSurface int    current_iter,
int    max_iter,
TessInfo< float, hpoint< float > > *    A,
const float    tol,
void outfunc(TessInfo< float, hpoint< float > > *, void *)   ,
void *    outfunc_data
 

template<class T, class HP>
void gunu::DoLinearizeSurface int    current_iter,
int    max_iter,
TessInfo< T, HP > *    A,
const T    tol,
void outfunc(TessInfo< T, HP > *, void *)   ,
void *    outfunc_data
 

Definition at line 298 of file gunu_intersect.cpp.

00304 {
00305   int nA,i;
00306   TessInfo<T,HP> **pA;  
00307 
00308   /*
00309   cout << "iter: " << current_iter << "\n";
00310       
00311   cout << gul::dump_surf<T,HP>( 
00312               A->org->nu, A->org->pu, A->org->U,
00313               A->org->nv, A->org->pv, A->org->V,
00314               A->org->Pw ) << "\n";  
00315   */
00316 
00317 /* --- A vierteln falls A nicht durch Dreiecke approximierbar: */    
00318 
00319   if( !A->linearized && !A->divided )
00320   {      
00321     if( current_iter < max_iter )
00322       gunu::LinearizeOrDivide( A, tol, false );
00323     else
00324       A->linearized = 1;
00325   }
00326 
00327   if( !A->linearized )
00328   {
00329     nA = 4;
00330     pA = A->sub;
00331 
00332     for( i = 0; i < nA; i++ )          /* Rekursion */
00333     {         
00334       DoLinearizeSurface( current_iter+1, max_iter, pA[i], tol,
00335                           outfunc, outfunc_data );
00336       delete pA[i];
00337       pA[i] = 0;      
00338     }
00339   }
00340   else       /* ------- Dreiecke ausgeben ------------------ */  
00341   {
00342     outfunc( A, outfunc_data ); 
00343   }
00344 }

template GULAPI void DoLinearizeTrimmedSurface int    max_iter,
const int    nu,
const int    pu,
Ptr< double > &    KnotsU,
const int    nv,
const int    pv,
Ptr< double > &    KnotsV,
Ptr< Ptr< point< double > > > &    Pw,
const double    tol,
Ptr< Ptr< point2< double > > > &    contour,
void outfunc1(TessInfo< double, point< double > > *, void *)   ,
void outfunc2(TessInfo< double, point< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *)   ,
void *    usrdata
 

template GULAPI void DoLinearizeTrimmedSurface int    max_iter,
const int    nu,
const int    pu,
Ptr< float > &    KnotsU,
const int    nv,
const int    pv,
Ptr< float > &    KnotsV,
Ptr< Ptr< point< float > > > &    Pw,
const float    tol,
Ptr< Ptr< point2< float > > > &    contour,
void outfunc1(gunu::TessInfo< float, point< float > > *, void *)   ,
void outfunc2(gunu::TessInfo< float, point< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *)   ,
void *    usrdata
 

template GULAPI void DoLinearizeTrimmedSurface int    max_iter,
const int    nu,
const int    pu,
Ptr< double > &    KnotsU,
const int    nv,
const int    pv,
Ptr< double > &    KnotsV,
Ptr< Ptr< hpoint< double > > > &    Pw,
const double    tol,
Ptr< Ptr< point2< double > > > &    contour,
void outfunc1(TessInfo< double, hpoint< double > > *, void *)   ,
void outfunc2(TessInfo< double, hpoint< double > > *, gugr::GraphInfo *, gugr::GraphConvInfo< double > *, void *)   ,
void *    usrdata
 

template GULAPI void DoLinearizeTrimmedSurface int    max_iter,
const int    nu,
const int    pu,
Ptr< float > &    KnotsU,
const int    nv,
const int    pv,
Ptr< float > &    KnotsV,
Ptr< Ptr< hpoint< float > > > &    Pw,
const float    tol,
Ptr< Ptr< point2< float > > > &    contour,
void outfunc1(gunu::TessInfo< float, hpoint< float > > *, void *)   ,
void outfunc2(gunu::TessInfo< float, hpoint< float > > *, gugr::GraphInfo *, gugr::GraphConvInfo< float > *, void *)   ,
void *    usrdata
 

template<class T, class HP>
GULAPI void gunu::DoLinearizeTrimmedSurface int    max_iter,
const int    nu,
const int    pu,
Ptr< T > &    KnotsU,
const int    nv,
const int    pv,
Ptr< T > &    KnotsV,
Ptr< Ptr< HP > > &    Pw,
const T    tol,
Ptr< Ptr< point2< T > > > &    contour,
void(*    outfunc1)(TessInfo< T, HP > *, void *),
void(*    outfunc2)(TessInfo< T, HP > *, gugr::GraphInfo *, gugr::GraphConvInfo< T > *, void *),
void *    usrdata
 

Definition at line 86 of file gunu_tesselate1.cpp.

00097 {
00098   TessInfo<T,HP>       A;
00099   gugr::GraphConvInfo<T>  Gconv;
00100   graph_edge_list   E;
00101   graph_vertex_list V;
00102   gugr::GraphInfo         G;
00103   rational MinX,MaxX,FarMinX,FarMaxX,MinY,MaxY,FarMinY,FarMaxY,X1,X2,Y1,Y2;
00104   T x1,x2,y1,y2,minx,maxx,miny,maxy,dx,dy,scale,scalei;
00105   int i,nContour,n;
00106   unsigned long *cbuf = (unsigned long *)alloca(gul::rtr<T>::mantissa_length());
00107   rational Big(guar::ULong(0x100000));
00108   List< ListNode<segment> > S;
00109   List< ListNode<polyline> > Pl;
00110   polyline *pl;
00111   ListNode<polyline> *pn;
00112  
00113   if( (nContour = contour.nElems()) < 1 ) return;
00114   
00115   minx = x1 = miny = y1 = (T)0.0;   /* --- initialise graph info --- */
00116   maxx = x2 = maxy = y2 = (T)1.0; 
00117   
00118   for( i = 0; i < nContour; i++ )
00119   {
00120     if( (n = contour[i].nElems()) < 2 ) return;
00121     // if( contour[i][0] != contour[i][n-1] ) return;  // not closed
00122     guge::UpdateBoundingBoxE<T>( n, contour[i], minx, maxx, miny, maxy );
00123   }  
00124   dx = maxx - minx;
00125   dy = maxy - miny;
00126   scale = dx > dy ? dx : dy;
00127   minx -= scale;         // after this the normalized points will lie between
00128   miny -= scale;         // 1 and 2
00129   scalei = (T)1/scale;
00130 
00131   /*  
00132   gugr::DumpPS<T>::set_transformation( minx, miny, scale, scale );
00133   gugr::Dump<T>::set_transformation( minx, miny, scale, scale );
00134   */
00135 
00136   Gconv.minx = minx; Gconv.miny = miny; Gconv.scale = scale;
00137 
00138   x1 = (x1 - minx)/scale;   x2 = (x2 - minx)/scale;
00139   y1 = (y1 - miny)/scale;   y2 = (y2 - miny)/scale;
00140 
00141   for( i = 0; i < nContour; i++ ) 
00142   {
00143     pn = new ListNode<polyline>();
00144     Pl.Append( pn );
00145     pl = &pn->el;
00146     pl->init( contour[i].nElems(), contour[i], minx, miny, scalei ); 
00147   }
00148 
00149   X1 = rational( coord2int(x1,cbuf),cbuf );
00150   X2 = rational( coord2int(x2,cbuf),cbuf );
00151   Gconv.MinY = rational( guar::ULong(0x100000), -1 );
00152   Gconv.MaxY = rational(coord2int((T)2,cbuf),cbuf)+Big;
00153   Gconv.FarMinY = rational(guar::ULong(0x200000),-1);
00154   Gconv.FarMaxY = Gconv.MaxY + Big;
00155   
00156   Y1 = rational(coord2int(y1,cbuf),cbuf);
00157   Y2 = rational(coord2int(y2,cbuf),cbuf);
00158   Gconv.MinX = Gconv.MinY;
00159   Gconv.MaxX = Gconv.MaxY;
00160   Gconv.FarMinX = Gconv.FarMinY;
00161   Gconv.FarMaxX = Gconv.FarMaxY;
00162 
00163   OddEvenRule( Pl, Gconv.FarMaxX, Gconv.FarMaxY, 1, 0, E, V, S );
00164 
00165   S.DeleteElems();
00166 
00167   // gugr::OrientEdges( E.head );
00168   
00169   gugr::InitGraph<T>( X1, X2, Y1, Y2, &Gconv, &E, &V, &G );  // initialise graph info
00170   E.DeleteElems();
00171   V.DeleteElems();
00172 
00173   /*
00174   cout << "after construction of graph\n";
00175   cout << "***************************\n";
00176   gugr::Dump<T>::dump_vertices( G.V.head );
00177   gugr::Dump<T>::dump_edges( G.E.head );
00178   */
00179 
00180                     /* --- initialise nurbs surface info --- */
00181   A.org->nu = nu;
00182   A.org->pu = pu;  
00183   A.org->U =  KnotsU;
00184   A.org->nv = nv;
00185   A.org->pv = pv;  
00186   A.org->V =  KnotsV;
00187   A.org->Pw = Pw;
00188   /*
00189   guge::CalcBoundingBox( (A.org->nu+1)*(A.org->nv+1), 
00190                A.org->Pw[0], A.x1, A.x2, A.y1, A.y2, A.z1, A.z2 ); 
00191   */
00192 
00193   A.org->P00 = gul::euclid( A.org->Pw[0][0] );
00194   A.org->P01 = gul::euclid( A.org->Pw[0][A.org->nu] );
00195   A.org->P10 = gul::euclid( A.org->Pw[A.org->nv][0] );
00196   A.org->P11 = gul::euclid( A.org->Pw[A.org->nv][A.org->nu] );
00197 
00198   A.u1 = 0.0;
00199   A.u2 = 1.0; 
00200   A.v1 = 0.0;
00201   A.v2 = 1.0; 
00202 
00203   /*
00204   _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );
00205   _RPT1( _CRT_WARN, "number of pool items = %d\n", 
00206          gust::pooldbg::count );
00207   _RPT2( _CRT_WARN, "rationals = %d, reps = %d\n", 
00208          rational::count, rational::rational_rep::count );
00209   _RPT3( _CRT_WARN, "graph_vertex's = %d, vertex's = %d, vertex_rep's = %d\n", 
00210          gugr::graph_vertex::count, gugr::vertex::count, 
00211          gugr::vertex_rep::count );
00212   */
00213 
00214   _DoLinearizeTrimmedSurface( 1, max_iter, &A, &G, &Gconv, tol,
00215                               outfunc1, outfunc2, usrdata );
00216 }

template<class T, class HP>
int ElevateCurveDegree int    n,
int    p,
Ptr< T > &    U,
Ptr< HP > &    Pw,
int    t,
Ptr< T > &    Uh,
Ptr< HP > &    Qw
 

raise the degree 'p' of a curve to 'p+t'.

this function doesn't reserves memory for Uh and Q, in the worst case for Q: p + (n-p+1)*(t+1), and for Uh: 2*p + (n-p+2)*(t+1) elements are needed, the function returns the new number of controlpoints - 1

template int ElevateCurveDegree int    n,
int    p,
const Ptr< double > &    U,
const Ptr< hpoint2< double > > &    Pw,
int    t,
Ptr< double > &    Uh,
Ptr< hpoint2< double > > &    Qw
 

template int ElevateCurveDegree int    n,
int    p,
const Ptr< double > &    U,
const Ptr< point2< double > > &    Pw,
int    t,
Ptr< double > &    Uh,
Ptr< point2< double > > &    Qw
 

template int ElevateCurveDegree int    n,
int    p,
const Ptr< double > &    U,
const Ptr< hpoint< double > > &    Pw,
int    t,
Ptr< double > &    Uh,
Ptr< hpoint< double > > &    Qw
 

template int ElevateCurveDegree int    n,
int    p,
const Ptr< double > &    U,
const Ptr< point< double > > &    Pw,
int    t,
Ptr< double > &    Uh,
Ptr< point< double > > &    Qw
 

template int ElevateCurveDegree int    n,
int    p,
const Ptr< float > &    U,
const Ptr< hpoint2< float > > &    Pw,
int    t,
Ptr< float > &    Uh,
Ptr< hpoint2< float > > &    Qw
 

template int ElevateCurveDegree int    n,
int    p,
const Ptr< float > &    U,
const Ptr< point2< float > > &    Pw,
int    t,
Ptr< float > &    Uh,
Ptr< point2< float > > &    Qw
 

template int ElevateCurveDegree int    n,
int    p,
const Ptr< float > &    U,
const Ptr< hpoint< float > > &    Pw,
int    t,
Ptr< float > &    Uh,
Ptr< hpoint< float > > &    Qw
 

template int ElevateCurveDegree int    n,
int    p,
const Ptr< float > &    U,
const Ptr< point< float > > &    Pw,
int    t,
Ptr< float > &    Uh,
Ptr< point< float > > &    Qw
 

template<class T, class HP>
int ElevateCurveDegree int    n,
int    p,
const Ptr< T > &    U,
const Ptr< HP > &    Pw,
int    t,
Ptr< T > &    Uh,
Ptr< HP > &    Qw
 

raise the degree 'p' of a curve to 'p+t'.

this function doesn't reserves memory for Uh and Q, in the worst case for Q: p + (n-p+1)*(t+1), and for Uh: 2*p + (n-p+2)*(t+1) elements are needed, the function returns the new number of controlpoints - 1

Definition at line 51 of file gunu_raise_degree.cpp.

00053 {
00054   int m,i,mpi,j,ph,ph2,mh,kind,r,a,b,cind;
00055   int mul,oldr,lbz,rbz,k,save,s,first,last,kj,tr;
00056   T inv,ua,ub,numer,den,bet,alf,gam;
00057   Ptr< Ptr<T> > bezalfs;
00058   Ptr<T> alfs;
00059   Ptr<HP> bpts,ebpts,Nextbpts;
00060 
00061   bezalfs.reserve_pool(p+t+1);
00062   for( i = 0; i <= p+t; i++ )
00063     bezalfs[i].reserve_pool(p+1);
00064 
00065   bpts.reserve_pool(p+1);
00066   ebpts.reserve_pool(p+t+1);
00067 
00068   if( p > 1 )
00069   {
00070     Nextbpts.reserve_pool(p-1);
00071     alfs.reserve_pool(p-1); 
00072   }
00073   m = n + p + 1;
00074   ph = p + t;
00075   ph2 = ph / 2;
00076 
00077 /* --- calc coefficients for raising the degree of the bezier segments ---- */  
00078 
00079   bezalfs[0][0] = (T)1;
00080   bezalfs[ph][p] = (T)1;
00081   
00082   for( i = 1; i <= ph2; i++ )
00083   {
00084     inv = (T)1 / rtr<T>::BinCoeff(ph,i);
00085     mpi = Min( p, i );
00086     
00087     for( j = Max( 0,i-t ); j <= mpi; j++ )
00088       bezalfs[i][j] = inv * rtr<T>::BinCoeff(p,j) * rtr<T>::BinCoeff(t,i-j);
00089   }    
00090   for( i = ph2+1; i <= ph-1; i++ )
00091   {
00092     mpi = Min( p, i );
00093     for( j = Max( 0,i-t ); j <= mpi; j++ )
00094       bezalfs[i][j] = bezalfs[ph-i][p-j];
00095   }       
00096   mh = ph;
00097   kind = ph+1;
00098   r = -1;
00099   a = p;
00100   b = p+1;
00101   cind = 1;
00102   ua = U[0];
00103   Qw[0] = Pw[0];
00104   
00105   for( i = 0; i <= ph; i++ )
00106     Uh[i] = ua;
00107     
00108   for( i = 0; i <= p; i++ )
00109     bpts[i] = Pw[i];  
00110     
00111   while( b < m )
00112   {
00113     i = b;
00114     while( (b < m) && (U[b] == U[b+1]) )
00115       b++;
00116 
00117     mul = b-i+1;
00118     mh = mh + mul + t;
00119     ub = U[b];
00120     oldr = r;
00121     r = p - mul;
00122     
00123     if( oldr > 0)
00124       lbz = (oldr+2) / 2;
00125     else
00126       lbz = 1;
00127 
00128     if( r > 0 )
00129       rbz = ph - ((r+1) / 2);
00130     else
00131       rbz = ph;  
00132 
00133     if( r > 0 )
00134     {
00135       numer = ub - ua;
00136       for( k = p; k > mul; k-- )
00137         alfs[k-mul-1] = numer / (U[a+k]-ua);
00138       for( j = 1; j <= r; j++ )  
00139       {
00140         save = r - j;
00141         s = mul + j;            
00142 
00143         for( k = p; k >= s; k-- )
00144           bpts[k] = ((T)1 - alfs[k-s]) * bpts[k-1] + alfs[k-s] * bpts[k];
00145 
00146         Nextbpts[save] = bpts[p];
00147       }  
00148     }
00149     for( i = lbz; i <= ph; i++ )
00150     {
00151       set( ebpts[i], (T)0 );
00152       mpi = Min( p, i );
00153 
00154       for( j = Max(0,i-t); j <= mpi; j++ )
00155         ebpts[i] = ebpts[i] + bezalfs[i][j] * bpts[j];
00156     }
00157 
00158     if( oldr > 1 )
00159     {
00160       first = kind-2;
00161       last = kind;
00162       den = ub-ua;
00163       bet = (ub-Uh[kind-1])/den;
00164       
00165       for( tr = 1; tr < oldr; tr++ )
00166       {        
00167         i = first;
00168         j = last;
00169         kj = j-kind+1;
00170         while( j - i > tr )
00171         {
00172           if( i < cind )
00173           {
00174             alf = (ub-Uh[i])/(ua-Uh[i]);
00175             Qw[i] = ((T)1 - alf) * Qw[i-1] + alf * Qw[i];
00176           }        
00177           if( j >= lbz )
00178           {
00179             if( j - tr <= kind-ph+oldr )
00180             {  
00181               gam = (ub-Uh[j-tr])/den;
00182               ebpts[kj] = ((T)1 - gam) * ebpts[kj+1] + gam * ebpts[kj];
00183             }
00184             else
00185               ebpts[kj] = ((T)1 - bet) * ebpts[kj+1] + bet * ebpts[kj];
00186           }
00187           i++;
00188           j--;
00189           kj--;
00190         }      
00191         
00192         first--;
00193         last++;
00194       }                    
00195     }    
00196     if( a != p )
00197       for( i = 0; i < ph-oldr; i++ )
00198       {
00199         Uh[kind] = ua;
00200         kind++;
00201       }      
00202     for( j = lbz; j <= rbz; j++ )
00203     {
00204       Qw[cind] = ebpts[j];
00205       cind++;
00206     }
00207     if( b < m )
00208     {
00209       for( j = 0; j < r; j++ )
00210         bpts[j] = Nextbpts[j];
00211       for( j = r; j <= p; j++ )
00212         bpts[j] = Pw[b-p+j];
00213       a = b;
00214       b++;
00215       ua = ub;
00216     }
00217     else
00218       for( i = 0; i <= ph; i++ )
00219         Uh[kind+i] = ub;
00220   }                      
00221   return( mh - ph - 1 );
00222 }          

template<class T, class HP>
void ElevateSurfaceDegree int    nu,
int    pu,
Ptr< T > &    U,
int    nv,
int    pv,
Ptr< T > &    V,
Ptr< Ptr< HP > > &    Pw,
int    t,
int    dir,
int *    nhu,
Ptr< T > &    Uh,
int *    nhv,
Ptr< T > &    Vh,
Ptr< Ptr< HP > > &    Qw
 

Definition at line 58 of file gunu_raise_degree.h.

00063 {
00064   if( dir == gul::u_direction )
00065     ElevateSurfaceDegreeU( nu,pu,U,nv,pv,V,Pw,t,nhu,Uh,nhv,Vh,Qw );
00066   else
00067     ElevateSurfaceDegreeV( nu,pu,U,nv,pv,V,Pw,t,nhu,Uh,nhv,Vh,Qw );
00068 }

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< hpoint1< double > > > &    Qw
 

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< point1< double > > > &    Qw
 

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< hpoint< double > > > &    Qw
 

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< point< double > > > &    Qw
 

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< hpoint1< float > > > &    Qw
 

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< point1< float > > > &    Qw
 

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< hpoint< float > > > &    Qw
 

template void ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< point< float > > > &    Qw
 

template<class T, class HP>
void gunu::ElevateSurfaceDegreeU int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
int    t,
int *    nhu,
Ptr< T > &    Uh,
int *    nhv,
Ptr< T > &    Vh,
Ptr< Ptr< HP > > &    Qw
 

raise the degree 'pu' or 'pv' of a surface by 't'.

this function doesn't reserves memory for Uh,Vh and Qw, they must be dimensioned in u or v direction like for curves.

Definition at line 255 of file gunu_raise_degree.cpp.

00260 {
00261   int m,i,mpi,j,ph,ph2,mh,kind,r,a,b,cind,row;
00262   int mul,oldr,lbz,rbz,k,save,s,first,last,kj,tr;
00263   T inv,ua,ub,numer,den,bet,alf,gam;
00264   Ptr< Ptr<T> > bezalfs;
00265   Ptr<T> alfs;
00266   Ptr< Ptr< HP > > bpts,ebpts,Nextbpts;
00267 
00268   bezalfs.reserve_pool(pu+t+1);
00269   for( i = 0; i <= pu+t; i++ )
00270     bezalfs[i].reserve_pool(pu+1);
00271 
00272   bpts.reserve_pool(nv+1);
00273   for( i = 0; i <= nv; i++ )
00274     bpts[i].reserve_pool(pu+1);
00275 
00276   ebpts.reserve_pool(nv+1);
00277   for( i = 0; i <= nv; i++ )
00278     ebpts[i].reserve_pool(pu+t+1);
00279 
00280   if( pu > 1 )
00281   {
00282     Nextbpts.reserve_pool(nv+1);
00283     for( i = 0; i <= nv; i++ )
00284       Nextbpts[i].reserve_pool(pu-1);
00285 
00286     alfs.reserve_pool(pu-1);
00287   }
00288   m = nu + pu + 1;
00289   ph = pu + t;
00290   ph2 = ph / 2;
00291   
00292 /* --- calc coefficients for raising the degree of the bezier segments ---- */  
00293 
00294   bezalfs[0][0] = 1.0;
00295   bezalfs[ph][pu] = 1.0;
00296   
00297   for( i = 1; i <= ph2; i++ )
00298   {
00299     inv = (T)1 / rtr<T>::BinCoeff( ph, i );
00300     mpi = Min( pu, i );
00301     
00302     for( j = Max( 0,i-t ); j <= mpi; j++ )
00303       bezalfs[i][j] = inv * rtr<T>::BinCoeff(pu,j) * rtr<T>::BinCoeff(t,i-j);
00304   }    
00305   for( i = ph2+1; i <= ph-1; i++ )
00306   {
00307     mpi = Min( pu, i );
00308     for( j = Max( 0,i-t ); j <= mpi; j++ )
00309     bezalfs[i][j] = bezalfs[ph-i][pu-j];
00310   }       
00311   mh = ph;
00312   kind = ph+1;
00313   r = -1;
00314   a = pu;
00315   b = pu+1;
00316   cind = 1;
00317   ua = U[0];
00318   for( row = 0; row <= nv; row++ )
00319     Qw[row][0] = Pw[row][0];
00320   
00321   for( i = 0; i <= ph; i++ )
00322     Uh[i] = ua;
00323     
00324   for( row = 0; row <= nv; row++ )
00325     for( i = 0; i <= pu; i++ )
00326       bpts[row][i] = Pw[row][i];  
00327     
00328   while( b < m )
00329   {
00330     i = b;
00331     while( (b < m) && (U[b] == U[b+1]) )
00332       b++;
00333 
00334     mul = b-i+1;
00335     mh = mh + mul + t;
00336     ub = U[b];
00337     oldr = r;
00338     r = pu - mul;
00339     
00340     if( oldr > 0)
00341       lbz = (oldr+2) / 2;
00342     else
00343       lbz = 1;
00344 
00345     if( r > 0 )
00346       rbz = ph - ((r+1) / 2);
00347     else
00348       rbz = ph;  
00349 
00350     if( r > 0 )
00351     {
00352       numer = ub - ua;
00353       for( k = pu; k > mul; k-- )
00354         alfs[k-mul-1] = numer / (U[a+k]-ua);
00355       for( j = 1; j <= r; j++ )  
00356       {
00357         save = r - j;
00358         s = mul + j;            
00359 
00360         for( row = 0; row <= nv; row++ )
00361         {
00362           for( k = pu; k >= s; k-- )
00363           {
00364             bpts[row][k] = 
00365                ((T)1 - alfs[k-s]) * bpts[row][k-1] + alfs[k-s] * bpts[row][k];
00366           }  
00367           Nextbpts[row][save] = bpts[row][pu];
00368         }
00369       }  
00370     }
00371     for( row = 0; row <= nv; row++ )
00372     {
00373       for( i = lbz; i <= ph; i++ )
00374       {
00375         set( ebpts[row][i], (T)0 );
00376         mpi = Min( pu, i );
00377         for( j = Max(0,i-t); j <= mpi; j++ )
00378           ebpts[row][i] = ebpts[row][i] + bezalfs[i][j] * bpts[row][j];      
00379       }
00380     }
00381     if( oldr > 1 )
00382     {
00383       first = kind-2;
00384       last = kind;
00385       den = ub-ua;
00386       bet = (ub-Uh[kind-1])/den;
00387       
00388       for( tr = 1; tr < oldr; tr++ )
00389       {        
00390         i = first;
00391         j = last;
00392         kj = j-kind+1;
00393         while( j - i > tr )
00394         {
00395           if( i < cind )
00396           {
00397             alf = (ub-Uh[i])/(ua-Uh[i]);
00398             for( row = 0; row <= nv; row++ )
00399               Qw[row][i] = ((T)1 - alf) * Qw[row][i-1] + alf * Qw[row][i];
00400           }        
00401           if( j >= lbz )
00402           {
00403             if( j - tr <= kind-ph+oldr )
00404             {  
00405               gam = (ub-Uh[j-tr])/den;
00406               for( row = 0; row <= nv; row++ )
00407               {
00408                 ebpts[row][kj] = 
00409                      ((T)1 - gam) * ebpts[row][kj+1] + gam * ebpts[row][kj];
00410               }
00411             }
00412             else
00413             {
00414               for( row = 0; row <= nv; row++ )
00415               {
00416                 ebpts[row][kj] = 
00417                      ((T)1 - bet) * ebpts[row][kj+1] + bet * ebpts[row][kj];
00418               }
00419             }
00420           }
00421           i++;
00422           j--;
00423           kj--;
00424         }      
00425         
00426         first--;
00427         last++;
00428       }                    
00429     }    
00430     if( a != pu )
00431       for( i = 0; i < ph-oldr; i++ )
00432       {
00433         Uh[kind] = ua;
00434         kind++;
00435       }
00436     for( j = lbz; j <= rbz; j++ )
00437     {
00438       for( row = 0; row <= nv; row++ )
00439         Qw[row][cind] = ebpts[row][j];
00440       cind++;
00441     }
00442     if( b < m )
00443     {
00444       for( row = 0; row <= nv; row++ )
00445       {
00446         for( j = 0; j < r; j++ )
00447           bpts[row][j] = Nextbpts[row][j];
00448         for( j = r; j <= pu; j++ )
00449           bpts[row][j] = Pw[row][b-pu+j];
00450       }
00451       a = b;
00452       b++;
00453       ua = ub;
00454     }
00455     else
00456       for( i = 0; i <= ph; i++ )
00457         Uh[kind+i] = ub;
00458   }                      
00459   *nhu = mh - ph - 1;
00460 
00461   // knot vector in V direction only needs to be copied
00462   for( i = 0; i < nv + pv + 2; i++ )
00463     Vh[i] = V[i];
00464 
00465   *nhv = nv;  
00466 }          

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< hpoint1< double > > > &    Qw
 

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< point1< double > > > &    Qw
 

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< hpoint< double > > > &    Qw
 

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
int    t,
int *    nhu,
Ptr< double > &    Uh,
int *    nhv,
Ptr< double > &    Vh,
Ptr< Ptr< point< double > > > &    Qw
 

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< hpoint1< float > > > &    Qw
 

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< point1< float > > > &    Qw
 

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< hpoint< float > > > &    Qw
 

template void ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
int    t,
int *    nhu,
Ptr< float > &    Uh,
int *    nhv,
Ptr< float > &    Vh,
Ptr< Ptr< point< float > > > &    Qw
 

template<class T, class HP>
void gunu::ElevateSurfaceDegreeV int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
int    t,
int *    nhu,
Ptr< T > &    Uh,
int *    nhv,
Ptr< T > &    Vh,
Ptr< Ptr< HP > > &    Qw
 

raise the degree 'pu' or 'pv' of a surface by 't'.

this function doesn't reserves memory for Uh,Vh and Qw, they must be dimensioned in u or v direction like for curves.

Definition at line 50 of file gunu_raise_degree2.cpp.

00055 {
00056   int m,i,mpi,j,ph,ph2,mh,kind,r,a,b,cind,col;
00057   int mul,oldr,lbz,rbz,k,save,s,first,last,kj,tr;
00058   T inv,ua,ub,numer,den,bet,alf,gam;
00059   Ptr< Ptr<T> > bezalfs;
00060   Ptr<T> alfs;
00061   Ptr< Ptr< HP > > bpts,ebpts,Nextbpts;
00062 
00063   bezalfs.reserve_pool(pv+t+1);
00064   for( i = 0; i <= pv+t; i++ ) 
00065     bezalfs[i].reserve_pool(pv+1);
00066 
00067   bpts.reserve_pool(pv+1);
00068   for( i = 0; i <= pv; i++ )
00069     bpts[i].reserve_pool(nu+1);
00070 
00071   ebpts.reserve_pool(pv+t+1);
00072   for( i = 0; i <= pv+t; i++ )
00073     ebpts[i].reserve_pool(nu+1);
00074 
00075   if( pv > 1 )
00076   {
00077     Nextbpts.reserve_pool(pv-1);
00078     for( i = 0; i < pv-1; i++ )
00079       Nextbpts[i].reserve_pool(nu+1);
00080 
00081     alfs.reserve_pool(pv-1);
00082   }
00083   m = nv + pv + 1;
00084   ph = pv + t;
00085   ph2 = ph / 2;
00086   
00087 /* --- calc coefficients for raising the degree of the bezier segments ---- */  
00088 
00089   bezalfs[0][0] = 1.0;
00090   bezalfs[ph][pv] = 1.0;
00091   
00092   for( i = 1; i <= ph2; i++ )
00093   {
00094     inv = (T)1 / rtr<T>::BinCoeff( ph, i );
00095     mpi = Min( pv, i );
00096     
00097     for( j = Max( 0,i-t ); j <= mpi; j++ )
00098       bezalfs[i][j] = inv * rtr<T>::BinCoeff(pv,j) * rtr<T>::BinCoeff(t,i-j);
00099   }    
00100   for( i = ph2+1; i <= ph-1; i++ )
00101   {
00102     mpi = Min( pv, i );
00103     for( j = Max( 0,i-t ); j <= mpi; j++ )
00104       bezalfs[i][j] = bezalfs[ph-i][pv-j];
00105   }       
00106   mh = ph;
00107   kind = ph+1;
00108   r = -1;
00109   a = pv;
00110   b = pv+1;
00111   cind = 1;
00112   ua = V[0];
00113   for( col = 0; col <= nu; col++ )
00114     Qw[0][col] = Pw[0][col];
00115   
00116   for( i = 0; i <= ph; i++ )
00117     Vh[i] = ua;
00118     
00119   for( i = 0; i <= pv; i++ )
00120     for( col = 0; col <= nu; col++ )
00121       bpts[i][col] = Pw[i][col];  
00122     
00123   while( b < m )
00124   {
00125     i = b;
00126     while( (b < m) && (V[b] == V[b+1]) )
00127       b++;
00128 
00129     mul = b-i+1;
00130     mh = mh + mul + t;
00131     ub = V[b];
00132     oldr = r;
00133     r = pv - mul;
00134     
00135     if( oldr > 0)
00136       lbz = (oldr+2) / 2;
00137     else
00138       lbz = 1;
00139 
00140     if( r > 0 )
00141       rbz = ph - ((r+1) / 2);
00142     else
00143       rbz = ph;  
00144 
00145     if( r > 0 )
00146     {
00147       numer = ub - ua;
00148       for( k = pv; k > mul; k-- )
00149         alfs[k-mul-1] = numer / (V[a+k]-ua);
00150       for( j = 1; j <= r; j++ )  
00151       {
00152         save = r - j;
00153         s = mul + j;            
00154 
00155         for( k = pv; k >= s; k-- )
00156         {
00157           for( col = 0; col <= nu; col++ )
00158           {
00159             bpts[k][col] = 
00160               ((T)1 - alfs[k-s]) * bpts[k-1][col] + alfs[k-s] * bpts[k][col];
00161           }  
00162         }
00163         for( col = 0; col <= nu; col++ )
00164           Nextbpts[save][col] = bpts[pv][col];
00165       }  
00166     }
00167     for( i = lbz; i <= ph; i++ )
00168     {
00169       for( col = 0; col <= nu; col++ )
00170         set( ebpts[i][col], (T)0 );
00171 
00172       mpi = Min( pv, i );
00173       for( j = Max(0,i-t); j <= mpi; j++ )
00174       {
00175         for( col = 0; col <= nu; col++ )
00176           ebpts[i][col] = ebpts[i][col] + bezalfs[i][j] * bpts[j][col];
00177       }      
00178     }
00179     if( oldr > 1 )
00180     {
00181       first = kind-2;
00182       last = kind;
00183       den = ub-ua;
00184       bet = (ub-Vh[kind-1])/den;
00185       
00186       for( tr = 1; tr < oldr; tr++ )
00187       {        
00188         i = first;
00189         j = last;
00190         kj = j-kind+1;
00191         while( j - i > tr )
00192         {
00193           if( i < cind )
00194           {
00195             alf = (ub-Vh[i])/(ua-Vh[i]);
00196             for( col = 0; col <= nu; col++ )
00197               Qw[i][col] = ((T)1 - alf) * Qw[i-1][col] + alf * Qw[i][col];
00198           }        
00199           if( j >= lbz )
00200           {
00201             if( j - tr <= kind-ph+oldr )
00202             {  
00203               gam = (ub-Vh[j-tr])/den;
00204               for( col = 0; col <= nu; col++ )
00205               {
00206                 ebpts[kj][col] = 
00207                       ((T)1 - gam) * ebpts[kj+1][col] + gam * ebpts[kj][col];
00208               }
00209             }
00210             else
00211             {
00212               for( col = 0; col <= nu; col++ )
00213               {
00214                 ebpts[kj][col] =
00215                       ((T)1 - bet) * ebpts[kj+1][col] + bet * ebpts[kj][col];
00216               }
00217             }
00218           }
00219           i++;
00220           j--;
00221           kj--;
00222         }      
00223         first--;
00224         last++;
00225       }                    
00226     }    
00227     if( a != pv )
00228       for( i = 0; i < ph-oldr; i++ )
00229       {
00230         Vh[kind] = ua;
00231         kind++;
00232       }
00233     for( j = lbz; j <= rbz; j++ )
00234     {
00235       for( col = 0; col <= nu; col++ )
00236         Qw[cind][col] = ebpts[j][col];
00237       cind++;
00238     }
00239     if( b < m )
00240     {
00241       for( j = 0; j < r; j++ )
00242         for( col = 0; col <= nu; col++ )
00243           bpts[j][col] = Nextbpts[j][col];
00244       for( j = r; j <= pv; j++ )
00245         for( col = 0; col <= nu; col++ )
00246           bpts[j][col] = Pw[b-pv+j][col];
00247 
00248       a = b;
00249       b++;
00250       ua = ub;
00251     }
00252     else
00253       for( i = 0; i <= ph; i++ )
00254         Vh[kind+i] = ub;
00255   }                  
00256     
00257   *nhv = mh - ph - 1;
00258 
00259   // just copy knot vector for U-direction
00260   for( i = 0; i < nu + pu + 2; i++ )
00261     Uh[i] = U[i];
00262 
00263   *nhu = nu;  
00264 }          

template GULAPI void EqualSpacedParameters int    n,
double    u1,
double    u2,
Ptr< double > &    U
 

template GULAPI void EqualSpacedParameters int    n,
float    u1,
float    u2,
Ptr< float > &    U
 

template<class T>
GULAPI void gunu::EqualSpacedParameters int    n,
  u1,
  u2,
Ptr< T > &    U
 

Definition at line 71 of file gunu_sample.cpp.

00072 {
00073   T d;
00074   int i;
00075 
00076   gul::Assert<gul::Error>( gul::ndebug || (n >= 2) );
00077   
00078   d = (u2-u1)/((T)(n-1));
00079 
00080   U[0] = u1;
00081   U[n-1] = u2;
00082 
00083   for( i = 1; i < n-1; i++ )
00084     U[i] = u1 + i*d;
00085 }

template<class T, class HP>
void EvaluateCurve const curve< T, HP > *    Curv,
const T    u,
point< T > *    C
 

Definition at line 238 of file gunu_basics.h.

00240 {
00241   CurvePoint( u, Curv->cpt.n, Curv->p, Curv->knt.U, Curv->cpt.Pw, C );
00242 }

template GULAPI void ExtractCurve const double    u1,
const double    u2,
const int    n,
const int    p,
Ptr< double >    U,
Ptr< point2< double > >    Pw,
int *    retn,
Ptr< double > *    retU,
Ptr< point2< double > > *    retPw
 

template GULAPI void ExtractCurve const float    u1,
const float    u2,
const int    n,
const int    p,
Ptr< float >    U,
Ptr< point2< float > >    Pw,
int *    retn,
Ptr< float > *    retU,
Ptr< point2< float > > *    retPw
 

template GULAPI void ExtractCurve const double    u1,
const double    u2,
const int    n,
const int    p,
Ptr< double >    U,
Ptr< point< double > >    Pw,
int *    retn,
Ptr< double > *    retU,
Ptr< point< double > > *    retPw
 

template GULAPI void ExtractCurve const float    u1,
const float    u2,
const int    n,
const int    p,
Ptr< float >    U,
Ptr< point< float > >    Pw,
int *    retn,
Ptr< float > *    retU,
Ptr< point< float > > *    retPw
 

template GULAPI void ExtractCurve const double    u1,
const double    u2,
const int    n,
const int    p,
Ptr< double >    U,
Ptr< hpoint2< double > >    Pw,
int *    retn,
Ptr< double > *    retU,
Ptr< hpoint2< double > > *    retPw
 

template GULAPI void ExtractCurve const float    u1,
const float    u2,
const int    n,
const int    p,
Ptr< float >    U,
Ptr< hpoint2< float > >    Pw,
int *    retn,
Ptr< float > *    retU,
Ptr< hpoint2< float > > *    retPw
 

template GULAPI void ExtractCurve const double    u1,
const double    u2,
const int    n,
const int    p,
Ptr< double >    U,
Ptr< hpoint< double > >    Pw,
int *    retn,
Ptr< double > *    retU,
Ptr< hpoint< double > > *    retPw
 

template GULAPI void ExtractCurve const float    u1,
const float    u2,
const int    n,
const int    p,
Ptr< float >    U,
Ptr< hpoint< float > >    Pw,
int *    retn,
Ptr< float > *    retU,
Ptr< hpoint< float > > *    retPw
 

template<class T, class HP>
GULAPI void gunu::ExtractCurve const T    u1,
const T    u2,
const int    n,
const int    p,
Ptr< T >    U,
Ptr< HP >    Pw,
int *    retn,
Ptr< T > *    retU,
Ptr< HP > *    retPw
 

Definition at line 535 of file gunu_divide.cpp.

00540 {
00541   int a,ra,sa,b,rb,sb,N,i,r; 
00542   HP v1,v2;
00543   T alpha;
00544 
00545   Ptr< HP > Cw;
00546   Ptr< T > Uh;
00547 
00548   a = FindSpanMultip( u1, n, p, U, &sa );
00549   if( sa > p )          /* Klammerknoten am Anfang */
00550     ra = 0;
00551   else
00552     ra = p - sa;
00553 
00554   b = FindSpanMultip( u2, n, p, U, &sb );
00555   if( sb > p )         /* Klammerknoten am Ende */
00556   {
00557    sb = p;
00558    rb = 0;
00559    b += p;
00560   }
00561   else 
00562     rb = p - sb;
00563    
00564   N = (b-sb) - a + p;
00565 
00566   Cw.reserve_pool( N+1 );
00567   Uh.reserve_pool( N+p+2 );
00568  
00569 /* ---- Linken Knoten einfuegen, bis Vielfachheit = p ------------------- */
00570 
00571   for( i = 0; i <= p; i++ )
00572   {
00573     Cw[i] = Pw[a-p+i];
00574     Uh[i] = u1;
00575   }
00576      
00577   for( r = 1; r <= ra; r++ )
00578   {
00579     for( i = 0; i <= ra-r; i++ )
00580     {
00581       alpha = (u1 - U[a-p+r+i]) / (U[a+r+i] - U[a-p+r+i]);
00582       v1 = ((T)1.0-alpha) * Cw[i];
00583       v2 = alpha * Cw[i+1];
00584       Cw[i] =  v1 + v2;
00585     }
00586   }     
00587 
00588 /* ---- Unveraenderten Teil uebernehmen ----------------------------------- */
00589 
00590   for( i = 0; i < (b-sb)-a; i++ )
00591   {
00592     Uh[p+1+i] = U[a+1+i];
00593     Cw[p+1+i] = Pw[a+1+i];
00594   }
00595   
00596 /* ---- Rechten Knoten einfuegen, bis Vielfachheit = p --------------------- */   
00597 
00598   for( r = 1; r <= rb; r++ )
00599   {
00600     for( i = 0; i <= rb-r; i++ )
00601     {
00602       alpha = (u2 - U[b-sb-i]) / (U[b-sb-i+p] - U[b-sb-i]);
00603       v1 = alpha * Cw[N-i];
00604       v2 = ((T)1.0-alpha) * Cw[N-i-1];
00605       Cw[N-i] = v1 + v2;      
00606     }
00607   }
00608 
00609   for( i = 0; i <= p; i++ )
00610     Uh[N+1+i] = u2;
00611 
00612   *retn = N;
00613   *retPw = Cw;
00614   *retU = Uh;  
00615 }         

template<class T, class HP>
void ExtractCurveN const T    u1,
const T    u2,
const int    n,
const int    p,
Ptr< T >    U,
Ptr< HP >    Pw,
int *    retn,
Ptr< T > *    retU,
Ptr< HP > *    retPw
[inline]
 

Definition at line 57 of file gunu_divide.h.

00062 {
00063   ExtractCurve<T,HP>( u1, u2, n, p, U, Pw, retn, retU, retPw );
00064   NormalizeKnotVector( *retn, p, *retU );
00065 }

template GULAPI void ExtractIsoCurveU double    u,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
Ptr< point1< double > > &    Cw
 

template GULAPI void ExtractIsoCurveU float    u,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
Ptr< point1< float > > &    Cw
 

template GULAPI void ExtractIsoCurveU double    u,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
Ptr< hpoint1< double > > &    Cw
 

template GULAPI void ExtractIsoCurveU float    u,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
Ptr< hpoint1< float > > &    Cw
 

template GULAPI void ExtractIsoCurveU double    u,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
Ptr< point< double > > &    Cw
 

template GULAPI void ExtractIsoCurveU float    u,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
Ptr< point< float > > &    Cw
 

template GULAPI void ExtractIsoCurveU double    u,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
Ptr< hpoint< double > > &    Cw
 

template GULAPI void ExtractIsoCurveU float    u,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
Ptr< hpoint< float > > &    Cw
 

template<class T, class HP>
GULAPI void gunu::ExtractIsoCurveU   u,
int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
Ptr< HP > &    Cw
 

Definition at line 227 of file gunu_sample.cpp.

00232 {
00233   Ptr< T > N;
00234   int span,i,j;
00235 
00236   N.reserve_place( reserve_stack(T,pu+1), pu+1 );
00237   
00238   span = FindSpan( u, nu, pu, U );
00239   CalcBasisFunctions<T>( u, span, pu, U, N );
00240 
00241   
00242   for( j = 0; j <= nv; j++ )
00243   {
00244     set( Cw[j], (T)0.0 );
00245     for( i = 0; i <= pu; i++ )
00246     {
00247       Cw[j] += N[i] * Pw[j][span-pu+i];
00248     }
00249   } 
00250 }

template GULAPI void ExtractIsoCurveV double    v,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point1< double > > > &    Pw,
Ptr< point1< double > > &    Cw
 

template GULAPI void ExtractIsoCurveV float    v,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point1< float > > > &    Pw,
Ptr< point1< float > > &    Cw
 

template GULAPI void ExtractIsoCurveV double    v,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint1< double > > > &    Pw,
Ptr< hpoint1< double > > &    Cw
 

template GULAPI void ExtractIsoCurveV float    v,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint1< float > > > &    Pw,
Ptr< hpoint1< float > > &    Cw
 

template GULAPI void ExtractIsoCurveV double    v,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< point< double > > > &    Pw,
Ptr< point< double > > &    Cw
 

template GULAPI void ExtractIsoCurveV float    v,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< point< float > > > &    Pw,
Ptr< point< float > > &    Cw
 

template GULAPI void ExtractIsoCurveV double    v,
int    nu,
int    pu,
const Ptr< double > &    U,
int    nv,
int    pv,
const Ptr< double > &    V,
const Ptr< Ptr< hpoint< double > > > &    Pw,
Ptr< hpoint< double > > &    Cw
 

template GULAPI void ExtractIsoCurveV float    v,
int    nu,
int    pu,
const Ptr< float > &    U,
int    nv,
int    pv,
const Ptr< float > &    V,
const Ptr< Ptr< hpoint< float > > > &    Pw,
Ptr< hpoint< float > > &    Cw
 

template<class T, class HP>
GULAPI void gunu::ExtractIsoCurveV   v,
int    nu,
int    pu,
const Ptr< T > &    U,
int    nv,
int    pv,
const Ptr< T > &    V,
const Ptr< Ptr< HP > > &    Pw,
Ptr< HP > &    Cw
 

Definition at line 300 of file gunu_sample.cpp.

00305 {
00306   Ptr< T > N;
00307   int span,i,j;
00308 
00309   N.reserve_place( reserve_stack(T,pv+1), pv+1 );
00310   
00311   span = FindSpan( v, nv, pv, V );
00312   CalcBasisFunctions<T>( v, span, pv, V, N );
00313 
00314   for( j = 0; j <= nu; j++ )
00315   {
00316     set( Cw[j], (T)0.0 );
00317     for( i = 0; i <= pv; i++ )
00318     {
00319       Cw[j] += N[i] * Pw[span-pv+i][j];
00320     }
00321   } 
00322 }

template GULAPI void ExtractSurface const double    u1,
const double    u2,
const double    v1,
const double    v2,
const int    nu,
const int    pu,
Ptr< double >    U,
const int    nv,
const int    pv,
Ptr< double >    V,
Ptr< Ptr< hpoint1< double > > >    Pw,
int *    ret_nu,
Ptr< double > *    retU,
int *    ret_nv,
Ptr< double > *    retV,
Ptr< Ptr< hpoint1< double > > > *    retPw
 

template GULAPI void ExtractSurface const float    u1,
const float    u2,
const float    v1,
const float    v2,
const int    nu,
const int    pu,
Ptr< float >    U,
const int    nv,
const int    pv,
Ptr< float >    V,
Ptr< Ptr< hpoint1< float > > >    Pw,
int *    ret_nu,
Ptr< float > *    retU,
int *    ret_nv,
Ptr< float > *    retV,
Ptr< Ptr< hpoint1< float > > > *    retPw
 

template GULAPI void ExtractSurface const double    u1,
const double    u2,
const double    v1,
const double    v2,
const int    nu,
const int    pu,
Ptr< double >    U,
const int    nv,
const int    pv,
Ptr< double >    V,
Ptr< Ptr< point1< double > > >    Pw,
int *    ret_nu,
Ptr< double > *    retU,
int *    ret_nv,
Ptr< double > *    retV,
Ptr< Ptr< point1< double > > > *    retPw
 

template GULAPI void ExtractSurface const float    u1,
const float    u2,
const float    v1,
const float    v2,
const int    nu,
const int    pu,
Ptr< float >    U,
const int    nv,
const int    pv,
Ptr< float >    V,
Ptr< Ptr< point1< float > > >    Pw,
int *    ret_nu,
Ptr< float > *    retU,
int *    ret_nv,
Ptr< float > *    retV,
Ptr< Ptr< point1< float > > > *    retPw
 

template GULAPI void ExtractSurface const double    u1,
const double    u2,
const double    v1,
const double    v2,
const int    nu,
const int    pu,
Ptr< double >    U,
const int    nv,
const int    pv,
Ptr< double >    V,
Ptr< Ptr< point< double > > >    Pw,
int *    ret_nu,
Ptr< double > *    retU,
int *    ret_nv,
Ptr< double > *    retV,
Ptr< Ptr< point< double > > > *    retPw
 

template GULAPI void ExtractSurface const float    u1,
const float    u2,
const float    v1,
const float    v2,
const int    nu,
const int    pu,
Ptr< float >    U,
const int    nv,
const int    pv,
Ptr< float >    V,
Ptr< Ptr< point< float > > >    Pw,
int *    ret_nu,
Ptr< float > *    retU,
int *    ret_nv,
Ptr< float > *    retV,
Ptr< Ptr< point< float > > > *    retPw
 

template GULAPI void ExtractSurface const double    u1,
const double    u2,
const double    v1,
const double    v2,
const int    nu,
const int    pu,
Ptr< double >    U,
const int    nv,
const int    pv,
Ptr< double >    V,
Ptr< Ptr< hpoint< double > > >    Pw,
int *    ret_nu,
Ptr< double > *    retU,
int *    ret_nv,
Ptr< double > *    retV,
Ptr< Ptr< hpoint< double > > > *    retPw
 

template GULAPI void ExtractSurface const float    u1,
const float    u2,
const float    v1,
const float    v2,
const int    nu,
const int    pu,
Ptr< float >    U,
const int    nv,
const int    pv,
Ptr< float >    V,
Ptr< Ptr< hpoint< float > > >    Pw,
int *    ret_nu,
Ptr< float > *    retU,
int *    ret_nv,
Ptr< float > *    retV,
Ptr< Ptr< hpoint< float > > > *    retPw
 

template<class T, class HP>
GULAPI void gunu::ExtractSurface const T    u1,
const T    u2,
const T    v1,
const T    v2,
const int    nu,
const int    pu,
Ptr< T >    U,
const int    nv,
const int    pv,
Ptr< T >    V,
Ptr< Ptr< HP > >    Pw,
int *    ret_nu,
Ptr< T > *    retU,
int *    ret_nv,
Ptr< T > *    retV,
Ptr< Ptr< HP > > *    retPw
 

Definition at line 665 of file gunu_divide.cpp.

00674 {
00675   int a,sa,ra,b,sb,rb,c,sc,rc,d,sd,rd,r,Nv,Nu,i,j,row,col;
00676   HP V1,V2;
00677   T alpha;
00678 
00679   Ptr< Ptr< HP > > Sw;
00680   Ptr< T > Uh,Vh;
00681 
00682   a = FindSpanMultip( v1, nv, pv, V, &sa );
00683   if( sa > pv )          /* Klammerknoten am Anfang */
00684     ra = 0;
00685   else
00686     ra = pv - sa;
00687 
00688   b = FindSpanMultip( v2, nv, pv, V, &sb );
00689   if( sb > pv )         /* Klammerknoten am Ende */
00690   {
00691    sb = pv;
00692    rb = 0;
00693    b += pv;
00694   }
00695   else 
00696     rb = pv - sb;
00697    
00698   Nv = (b-sb) - a + pv;
00699 
00700   c = FindSpanMultip( u1, nu, pu, U, &sc );
00701   if( sc > pu )          /* Klammerknoten am Anfang */
00702     rc = 0;
00703   else
00704     rc = pu - sc;
00705 
00706   d = FindSpanMultip( u2, nu, pu, U, &sd );
00707   if( sd > pu )         /* Klammerknoten am Ende */
00708   {
00709    sd = pu;
00710    rd = 0;
00711    d += pu;
00712   }
00713   else 
00714     rd = pu - sd;
00715    
00716   Nu = (d-sd) - c + pu;
00717 
00718   Sw.reserve_pool( Nv+1 );
00719   for( i = 0; i < Nv+1; i++ )
00720     Sw[i].reserve_pool( Nu+1 ); 
00721 
00722   Uh.reserve_pool( Nu+pu+2 );
00723   Vh.reserve_pool( Nv+pv+2 );
00724 
00725   for( i = 0; i <= Nv; i++ )
00726     for( j = 0; j < Nu+1; j++ )
00727       Sw[i][j] = Pw[a-pv+i][c-pu+j];
00728  
00729 /*-----------------------------------------------------------------------
00730   V-Richtung
00731 ----------------------------------------------------------------------- */  
00732 
00733 /* ---- Oberen Knoten einfuegen, bis Vielfachheit = p ------------------- */
00734 
00735   for( i = 0; i <= pv; i++ )
00736     Vh[i] = v1;
00737 
00738   for( r = 1; r <= ra; r++ )
00739   {
00740     for( i = 0; i <= ra-r; i++ )
00741     {
00742       alpha = (v1 - V[a-pv+r+i]) / (V[a+r+i] - V[a-pv+r+i]);
00743       for( col = 0; col <= Nu; col++ )
00744       {     
00745         V1 = ((T)1.0-alpha) * Sw[i][col];
00746         V2 = alpha * Sw[i+1][col];
00747         Sw[i][col] = V1 + V2;
00748       }
00749     }
00750   }     
00751 
00752 /* ---- Unveraenderten Teil uebernehmen ----------------------------------- */
00753 
00754   for( i = 0; i < b-sb-a; i++ )
00755     Vh[pv+1+i] = V[a+1+i];
00756 
00757 /* ---- Unteren Knoten einfuegen, bis Vielfachheit = p --------------------- */   
00758 
00759   for( r = 1; r <= rb; r++ )
00760   {
00761     for( i = 0; i <= rb-r; i++ )
00762     {
00763       alpha = (v2 - V[b-sb-i]) / (V[b-sb-i+pv] - V[b-sb-i]);
00764       for( col = 0; col <= Nu; col++ )
00765       {     
00766         V1 = alpha * Sw[Nv-i][col];
00767         V2 = ((T)1.0-alpha) * Sw[Nv-i-1][col];
00768         Sw[Nv-i][col] = V1 + V2;      
00769       }
00770     }
00771   }
00772 
00773   for( i = 0; i <= pv; i++ )
00774     Vh[Nv+1+i] = v2;
00775 
00776 
00777 /*-----------------------------------------------------------------------
00778   U-Richtung
00779 ----------------------------------------------------------------------- */  
00780 
00781 /* ---- Linken Knoten einfuegen, bis Vielfachheit = p ------------------- */
00782 
00783   for( i = 0; i <= pu; i++ )
00784     Uh[i] = u1;
00785 
00786   for( r = 1; r <= rc; r++ )
00787   {
00788     for( i = 0; i <= rc-r; i++ )
00789     {
00790       alpha = (u1 - U[c-pu+r+i]) / (U[c+r+i] - U[c-pu+r+i]);
00791       for( row = 0; row <= Nv; row++ )
00792       {     
00793         V1 = ((T)1.0-alpha) * Sw[row][i];
00794         V2 = alpha * Sw[row][i+1];
00795         Sw[row][i] = V1 + V2;
00796       }
00797     }
00798   }  
00799 
00800 /* ---- Unveraenderten Teil uebernehmen ----------------------------------- */
00801 
00802   for( i = 0; i < d-sd-c; i++ )
00803     Uh[pu+1+i] = U[c+1+i];
00804 
00805 /* ---- Rechten Knoten einfuegen, bis Vielfachheit = p --------------------- */   
00806 
00807   for( r = 1; r <= rd; r++ )
00808   {
00809     for( i = 0; i <= rd-r; i++ )
00810     {
00811       alpha = (u2 - U[d-sd-i]) / (U[d-sd-i+pu] - U[d-sd-i]);
00812       for( row = 0; row <= Nv; row++ )
00813       {     
00814         V1 = alpha * Sw[row][Nu-i];
00815         V2 = ((T)1.0-alpha) * Sw[row][Nu-i-1];
00816         Sw[row][Nu-i] = V1 + V2;      
00817       }
00818     }
00819   }
00820 
00821   for( i = 0; i <= pu; i++ )
00822     Uh[Nu+1+i] = u2;
00823 
00824 /* ------------------------------------------------------------------------- */
00825 
00826   *ret_nu = Nu;
00827   *ret_nv = Nv;
00828   *retU = Uh;
00829   *retV = Vh;
00830   *retPw = Sw;  
00831 }

template<class T, class HP>
void ExtractSurfaceN const T    u1,
const T    u2,
const T    v1,
const T    v2,
const int    nu,
const int    pu,
Ptr< T >    U,
const int    nv,
const int    pv,
Ptr< T >    V,
Ptr< Ptr< HP > >    Pw,
int *    ret_nu,
Ptr< T > *    retU,
int *    ret_nv,
Ptr< T > *    retV,
Ptr< Ptr< HP > > *    retPw
[inline]
 

Definition at line 84 of file gunu_divide.h.

00093 {
00094   ExtractSurface<T,HP>( u1, u2, v1, v2, nu, pu, U, nv, pv, V, Pw,
00095                         ret_nu, retU, ret_nv, retV, retPw );
00096 
00097   NormalizeKnotVector( *ret_nu, pu, *retU );
00098   NormalizeKnotVector( *ret_nv, pv, *retV );
00099 }

template<class T>
vertex_convert_cache<T>* FillVertexCache vertex_rep *    vert,
const int    code,
bool    normals,
const T &    orgx,
const T &    orgy,
const T &    scale,
const T &    u0,
const T &    v0,
const T &    w,
const T &    h,
const T &    a,
const point< T > &    W1,
const point< T > &    V2,
const point< T > &    V1,
const point< T > &    U1,
const point< T > &    W1n,
const point< T > &    V2n,
const point< T > &    V1n,
const point< T > &    U1n
 

Definition at line 286 of file gunu_tesselate.cpp.

00294 {
00295   guar::Interval iu,iv;
00296   T u,v,ru,rv,tu,tv,tw;
00297   vertex_convert_cache<T> *buf;
00298   
00299   vert->reserved.p = buf = new vertex_convert_cache<T>();
00300       
00301   iu = vert->v.x.get_bounds();
00302   iv = vert->v.y.get_bounds();
00303   u = (T)((iu.m_low+iu.m_high)/2.0);
00304   v = (T)((iv.m_low+iv.m_high)/2.0);
00305   u = buf->d.x = gugr::cnv2coord(u)*scale + orgx; 
00306   v = buf->d.y = gugr::cnv2coord(v)*scale + orgy; 
00307   ru = u-u0;
00308   rv = v-v0;
00309   if( code > 0 )  // vertex lies above quad diagonal
00310   {
00311     tu = h*ru/a;
00312     tw = w*(h-rv)/a;
00313     tv = (T)1.0 - tu - tw;
00314     buf->p = tu*U1 + tv*V1 + tw*W1;
00315     if( normals ) buf->n = tu*U1n + tv*V1n + tw*W1n;       
00316   }
00317   else if( code < 0 )  // below diagonal
00318   {
00319     tu = w*rv/a;
00320     tw = h*(w-ru)/a;
00321     tv = (T)1.0 - tu - tw;
00322     buf->p = tu*U1 + tv*V2 + tw*W1;
00323     if( normals ) buf->n = tu*U1n + tv*V2n + tw*W1n;
00324   }
00325   else       // on diagonal 
00326   {
00327     tw = (w-ru)/w;        /* interpolate linearly on diagonal */
00328     tu = (T)1.0 - tw;
00329     buf->p = tw*W1 + tu*U1;
00330     if( normals ) buf->n = tw*W1n + tu*U1n;
00331   }
00332   return buf;
00333 }

template int FindSpan const double    u,
const int    n,
const int    p,
const Ptr< double > &    U
 

template int FindSpan const float    u,
const int    n,
const int    p,
const Ptr< float > &    U
 

template<class T>
int gunu::FindSpan const T    u,
const int    n,
const int    p,
const Ptr< T > &    U
 

Definition at line 50 of file gunu_basics.cpp.

00052 {
00053   int low,mid,high;
00054   
00055 /* --- search knotspan (from right):   */
00056 
00057   if( u == U[n+1] )
00058   {
00059     if( u == U[n+p+1] ) // clamped
00060       return(n);
00061                       
00062     return( n+1 );   // unclamped, knot span = n+1
00063   }
00064      
00065   low = p;
00066   high = n+1;
00067   mid = (low+high) / 2 ;  
00068 
00069   while( (u < U[mid]) || (u >= U[mid+1]) ) 
00070   {
00071     if( u < U[mid] )
00072       high = mid;
00073     else
00074       low = mid;
00075       
00076     mid = (low+high) / 2;
00077   }
00078   
00079   return(mid);     
00080 }           

template int FindSpanMultip const double    u,
const int    n,
const int    p,
const Ptr< double > &    U,
int *    s
 

template int FindSpanMultip const float    u,
const int    n,
const int    p,
const Ptr< float > &    U,
int *    s
 

template<class T>
int gunu::FindSpanMultip const T    u,
const int    n,
const int    p,
const Ptr< T > &    U,
int *    s
 

Definition at line 93 of file gunu_basics.cpp.

00095 {
00096   int l,low,mid,high;
00097   
00098 /* --- Knotenspanne suchen (von rechts):   */
00099 
00100   if( u == U[n+1] )
00101   {
00102     if( u == U[n+p+1] ) // clamped
00103     {
00104       *s = p + 1;
00105       return(n);
00106     }
00107                       
00108     l = n;           // if unclamped
00109     while( l >= 0 )  //   count multiplicity
00110     {
00111       if( U[l] != u ) break;
00112       l--;
00113     }
00114     *s = n+1 - l;
00115     return( n+1 );   // knot span = n+1
00116   }
00117      
00118   low = p;
00119   high = n+1;
00120   mid = (low+high) / 2 ;  
00121 
00122   while( (u < U[mid]) || (u >= U[mid+1]) ) 
00123   {
00124     if( u < U[mid] )
00125       high = mid;
00126     else
00127       low = mid;
00128       
00129     mid = (low+high) / 2;
00130   }
00131   
00132   l = mid;
00133   while( l >= 0 )
00134   {
00135     if( U[l] != u ) break;
00136     l--;
00137   }
00138   *s = mid - l;
00139 
00140   return(mid);     
00141 }              

template<class T>
int GetKnotMultiplicity const T    u,
const Ptr< T > &    U,
const int    span
[inline]
 

Definition at line 55 of file gunu_basics.h.

00056 {
00057   int l;
00058 
00059   l = span;
00060 
00061   while( l >= 0 )
00062   {
00063     if( U[l] != u )
00064       break; 
00065     l--;
00066   }
00067 
00068   return(span-l);
00069 }

template int GetMultiplicities int    n,
int    p,
const Ptr< float > &    U,
Ptr< int > &    S,
Ptr< int > &    R
 

template<class T>
int GetMultiplicities int    n,
int    p,
const Ptr< T > &    U,
Ptr< int > &    S,
Ptr< int > &    R
 

Definition at line 343 of file gunu_knot_removal.cpp.

00344 {
00345   int i,k,s;
00346 
00347   k = 0;
00348   i = p+1;
00349 
00350   while( i <= n )  
00351   {
00352     s = 1;
00353 
00354     while( U[i+s] == U[i] )
00355       s++;
00356 
00357     S[k] = s;
00358     R[k] = i + s - 1;
00359 
00360     i += s;
00361     k++;
00362   }
00363 
00364   return k;
00365 }

template GULAPI bool GlobalCurveApproximation int    nQ,
const Ptr< point2< double > > &    Q,
int    n,
int    p,
Ptr< double > &    U,
Ptr< point2< double > > &    P
 

template GULAPI bool GlobalCurveApproximation int    nQ,
const Ptr< point2< float > > &    Q,
int    n,
int    p,
Ptr< float > &    U,
Ptr< point2< float > > &    P
 

template GULAPI bool GlobalCurveApproximation int    nQ,
const Ptr< point< double > > &    Q,
int    n,
int    p,
Ptr< double > &    U,
Ptr< point< double > > &    P
 

template GULAPI bool GlobalCurveApproximation int    nQ,
const Ptr< point< float > > &    Q,
int    n,
int    p,
Ptr< float > &    U,
Ptr< point< float > > &    P
 

template<class T, class EP>
GULAPI bool gunu::GlobalCurveApproximation int    nQ,
const Ptr< EP > &    Q,
int    n,
int    p,
Ptr< T > &    U,
Ptr< EP > &    P
 

Definition at line 534 of file gunu_global_approximate.cpp.

00536 {
00537   Ptr<T> Uq,d;
00538   T sum;
00539   Ptr< Ptr< Ptr<T> > > N;
00540   int Mmax;
00541   Ptr< Ptr<T> > A;
00542   Ptr<int> M;
00543  
00544   // return GlobalCurveApproximationDBG<T>(nQ,Q,n,p,U,P);
00545 
00546   d.reserve_pool(nQ);
00547   Uq.reserve_pool(nQ);
00548 
00549   sum = ChordLength( nQ, Q, d );
00550   if( sum == (T)0 ) return false;
00551   ChordLengthParameters( nQ, sum, d, Uq );
00552   if( !(Mmax = KnotVectorByAveraging(nQ, Uq, n, p, U)) ) return false;
00553 
00554   /*
00555   cout << "Parameters:\n";
00556   cout << dump_vector<T>(nQ,Uq);
00557   cout << "Knot Vector:\n";
00558   cout << dump_vector<T>(n+p+2,U);
00559   */
00560 
00561   return DoGlobalCurveApproximation(nQ,Q,Uq,n,p,U,Mmax,P);
00562 }

template<class T, class EP>
GULAPI bool gunu::GlobalCurveApproximationE int    nQ,
const Ptr< EP > &    Q,
  tol,
  eps,
int    degree,
int *    ret_n,
Ptr< T > *    ret_U,
Ptr< EP > *    ret_Pw,
Ptr< T > *    ret_QE,
Ptr< T > *    ret_QU
 

Definition at line 893 of file gunu_knot_removal.cpp.

00905 {
00906   Ptr<T> d,QU,QE,U;
00907   Ptr<EP> Pw;
00908   T sum,u;
00909   int i,n,nn,p;
00910   int j,nh,ph,maxpps,deg;
00911   Ptr<T> Uh;
00912   Ptr<EP> Ph,Pwh;
00913   bool result;
00914   Ptr<EP> D;
00915 
00916   d.reserve_pool(nQ);
00917   QU.reserve_pool(nQ);
00918   QE.reserve_pool(nQ);
00919   Pw.reserve_pool(nQ);
00920   U.reserve_pool(nQ+2);
00921   D.reserve_pool(3);
00922 
00923   sum = ChordLength( nQ, Q, d );
00924   if( sum == (T)0 ) return false;
00925   ChordLengthParameters( nQ, sum, d, QU );
00926 
00927   // build a linear curve interpolating the data points
00928   U[0] = (T)0;
00929   U[1] = (T)0;
00930   for( i = 1; i < nQ-1; i++ )
00931     U[i+1] = QU[i];
00932   U[nQ] = (T)1;
00933   U[nQ+1] = (T)1;
00934 
00935   for( i = 0; i < nQ; i++ )
00936     Pw[i] = Q[i];
00937 
00938   // initialize errors to zero
00939   for( i = 0; i < nQ; i++ )
00940     QE[i] = (T)0;
00941 
00942   n = nQ-1;
00943   p = 1;
00944 
00945   for( deg = 1; deg <= degree; deg++ )
00946   { 
00947     nn = RemoveCurveKnots( n, p, U, Pw, nQ, QU, tol, QE );
00948 
00949     // build a knot vector with degree p + 1 (increases multiplicities by 1)
00950     if( p < degree )
00951     {
00952       n = nn;
00953 
00954       Uh.reserve_pool(2*(n+p+2));
00955       j = IncMultiplicities(n,p,U,Uh);
00956 
00957       ph = p+1;
00958       nh = j-ph-1;
00959       Pwh.reserve_pool(nh+1);  
00960     }
00961     // when the final degree has been reached, do a final fit with a curve of
00962     // the same degree, if the knot removal was successful
00963     else
00964     {
00965       if( nn == n )
00966         break; 
00967 
00968       n = nn;
00969 
00970       Uh = U;
00971       ph = p;
00972       nh = n;
00973       Pwh.reserve_pool(nh+1);  
00974     }
00975     maxpps = CalcMaxPointsPerSpan(nh,ph,Uh,nQ,QU);
00976     result = DoGlobalCurveApproximation(nQ,Q,QU,nh,ph,Uh,maxpps,Pwh);
00977     if( !result ) return false;
00978 
00979     for( i = 0; i < nQ; i++ )
00980     {
00981       result = ProjectToCurve<T,EP,EP>( Q[i], QU[i], eps, 
00982                                         nh, ph, Uh, Pwh, &u, D );
00983       if( !result ) return false;
00984 
00985       if( (i > 0) && (u <= QU[i-1]) ) // for the time being
00986         return false;
00987   
00988       QU[i] = u;   
00989       QE[i] = length(D[0]-Q[i]);
00990     }
00991 
00992     Pw = Pwh;
00993     U = Uh;
00994     n = nh;
00995     p = ph;
00996   }
00997  
00998   *ret_n = n;
00999   (*ret_U) = U;
01000   (*ret_Pw) = Pw;
01001   (*ret_QE) = QE;
01002   (*ret_QU) = QU;
01003 
01004   return true;
01005 }

template GULAPI bool GlobalCurveApproximationE< float, point< float > > int    nQ,
const Ptr< point< float > > &    Q,
float    tol,
float    eps,
int    degree,
int *    ret_n,
Ptr< float > *    ret_U,
Ptr< point< float > > *    ret_Pw,
Ptr< float > *    ret_QE,
Ptr< float > *    ret_QU
 

template GULAPI bool GlobalCurveInterpolation int    nQ,
const Ptr< point2< double > > &    Q,
int    p,
Ptr< double > &    U,
Ptr< point2< double > > &    P
 

template GULAPI bool GlobalCurveInterpolation int    nQ,
const Ptr< point2< float > > &    Q,
int    p,
Ptr< float > &    U,
Ptr< point2< float > > &    P
 

template GULAPI bool GlobalCurveInterpolation int