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 > |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
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 } |
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
Definition at line 82 of file gunu_derivatives.h.
00086 { 00087 BSPCurveDerivatives(u,n,p,U,Pw,d,CK); 00088 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
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 } |
|
|
|
|
|
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 } |
|
|
|
|
|
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 } |
|
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 } |
|
|
|
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 } |
|
|
|
|
|
|
|
|
|
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 } |
|
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 } |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 170 of file gunu_global_interpolate.cpp.
00173 { 00174 Ptr<T> Uq,d; 00175 Ptr< Ptr<T> > A,L; 00176 Ptr<int> index; 00177 T dsum; 00178 int i; 00179 00180 d.reserve_pool(nQ); 00181 Uq.reserve_pool(nQ); 00182 index.reserve_pool(nQ); 00183 00184 dsum = ChordLength( nQ, Q, d ); 00185 if( dsum == (T)0 ) return false; 00186 00187 ChordLengthParameters( nQ, dsum, d, Uq ); 00188 KnotVectorByAveraging( nQ, Uq, p, U ); 00189 00190 A.reserve_pool(nQ); 00191 L.reserve_pool(nQ); 00192 for( i = 0; i < nQ; i++ ) 00193 { 00194 A[i].reserve_pool(p+p-1); 00195 L[i].reserve_pool(p+p-1); 00196 } 00197 index.reserve_pool(nQ); 00198 00199 CIDecompose(nQ, Uq, p, U, A, L, index); 00200 CIBackSubst<T>(nQ, Q, p, A, L, index, P); 00201 00202 return true; 00203 } |
|
Definition at line 582 of file gunu_global_approximate.cpp.
00586 { 00587 Ptr<T> Uq,Vq; 00588 Ptr< Ptr< Ptr<T> > > N; 00589 int i,j,Mmaxu,Mmaxv,sign,offset,bw,shift; 00590 Ptr< Ptr<T> > A,L; 00591 Ptr< Ptr<EP> > R; 00592 Ptr<int> index,M; 00593 00594 if( (pu < 2) || (pv < 2) ) return false; 00595 if( (nu < pu) || (nv < pv) ) return false; 00596 if( (nRows <= nv+1) || (nCols <= nu+1) ) return false; 00597 00598 Uq.reserve_pool(nCols); 00599 Vq.reserve_pool(nRows); 00600 00601 if( !ChordLengthMeshParams( nRows, nCols, Q, Uq, Vq ) ) return false; 00602 00603 if( !(Mmaxu = KnotVectorByAveraging(nCols, Uq, nu, pu, U)) ) return false; 00604 if( !(Mmaxv = KnotVectorByAveraging(nRows, Vq, nv, pv, V)) ) return false; 00605 00606 // calcuate the row curves 00607 00608 M.reserve_pool(nu-pu+1); 00609 N.reserve_pool(nu-pu+1); 00610 for( i = 0; i <= nu-pu; i++ ) { 00611 N[i].reserve_pool(pu+1); 00612 for( j = 0; j <= pu; j++ ) N[i][j].reserve_pool(Mmaxu); 00613 } 00614 A.reserve_pool(nu-1); 00615 for( i = 0; i < nu-1; i++ ) 00616 A[i].reserve_pool(pu+pu+1); 00617 00618 R.reserve_pool(nu+1); 00619 for( i = 0; i <= nu; i++ ) 00620 R[i].reserve_pool(nRows); 00621 00622 CACalcNTN<T>( nCols, Uq, nu, pu, U, M, N, A ); 00623 00624 L.reserve_pool(nu-1); 00625 for( i = 0; i < nu-1; i++ ) 00626 L[i].reserve_pool(pu+pu+1); 00627 index.reserve_pool(nu-1); 00628 00629 if( nu-1 < pu ) // band width adjustment necessary 00630 { 00631 bw = nu-1; 00632 shift = pu - bw; 00633 00634 for( i = 0; i < nu-1; i++ ) 00635 { 00636 offset = bw-i; 00637 for( j = 0; j < bw+bw+1-offset; j++ ) 00638 A[i][offset+j] = A[i][offset+j+shift]; 00639 } 00640 } 00641 else 00642 bw = pu; 00643 00644 BandDecomposition( nu-1, bw, bw, A, L, &sign, index ); 00645 00646 for( i = 0; i < nRows; i++ ) 00647 { 00648 CASolveToCol( nCols, Q[i], Uq, nu, pu, U, M, N, A, L, index, i, R ); 00649 } 00650 00651 // calcuate the column curves 00652 00653 M.reserve_pool(nv-pv+1); 00654 N.reserve_pool(nv-pv+1); // this automatically frees old content of N 00655 for( i = 0; i <= nv-pv; i++ ) { 00656 N[i].reserve_pool(pv+1); 00657 for( j = 0; j <= pv; j++ ) N[i][j].reserve_pool(Mmaxv); 00658 } 00659 A.reserve_pool(nv-1); 00660 for( i = 0; i < nv-1; i++ ) 00661 A[i].reserve_pool(pv+pv+1); 00662 00663 CACalcNTN<T>( nRows, Vq, nv, pv, V, M, N, A ); 00664 00665 L.reserve_pool(nv-1); 00666 for( i = 0; i < nv-1; i++ ) 00667 L[i].reserve_pool(pv+pv+1); 00668 index.reserve_pool(nv-1); 00669 00670 if( nv-1 < pv ) // band width adjustment necessary 00671 { 00672 bw = nv-1; 00673 shift = pv - bw; 00674 00675 for( i = 0; i < nv-1; i++ ) 00676 { 00677 offset = bw-i; 00678 for( j = 0; j < bw+bw+1-offset; j++ ) 00679 A[i][offset+j] = A[i][offset+j+shift]; 00680 } 00681 } 00682 else 00683 bw = pv; 00684 00685 BandDecomposition( nv-1, bw, bw, A, L, &sign, index ); 00686 00687 for( i = 0; i <= nu; i++ ) 00688 { 00689 CASolveToCol( nRows, R[i], Vq, nv, pv, V, M, N, A, L, index, i, P ); 00690 } 00691 00692 return true; 00693 } |
|
|
|
|
|
Definition at line 220 of file gunu_global_interpolate.cpp.
00223 { 00224 Ptr<T> Uq, Vq; 00225 int nu,nv,i; 00226 Ptr< Ptr<T> > A,L; 00227 Ptr<int> index; 00228 Ptr< Ptr<EP> > R; 00229 nu = nCols-1; 00230 nv = nRows-1; 00231 00232 Uq.reserve_pool(nCols); 00233 Vq.reserve_pool(nRows); 00234 00235 if( !ChordLengthMeshParams( nRows, nCols, Q, Uq, Vq ) ) return false; 00236 00237 KnotVectorByAveraging( nu+1, Uq, pu, U ); 00238 KnotVectorByAveraging( nv+1, Vq, pv, V ); 00239 00240 R.reserve_pool(nu+1); 00241 for( i = 0; i <= nu; i++ ) 00242 R[i].reserve_pool(nv+1); 00243 00244 A.reserve_pool(nu+1); 00245 L.reserve_pool(nu+1); 00246 for( i = 0; i <= nu; i++ ) 00247 { 00248 A[i].reserve_pool(pu+pu-1); 00249 L[i].reserve_pool(pu+pu-1); 00250 } 00251 index.reserve_pool(nu+1); 00252 00253 CIDecompose(nu+1, Uq, pu, U, A, L, index); 00254 00255 for( i = 0; i <= nv; i++ ) 00256 { 00257 CIBackSubstToCol(nu+1, Q[i], pu, A, L, index, i, R); 00258 } 00259 00260 A.reserve_pool(nv+1); 00261 L.reserve_pool(nv+1); 00262 for( i = 0; i <= nv; i++ ) 00263 { 00264 A[i].reserve_pool(pv+pv-1); 00265 L[i].reserve_pool(pv+pv-1); 00266 } 00267 index.reserve_pool(nv+1); 00268 00269 CIDecompose(nv+1, Vq, pv, V, A, L, index); 00270 for( i = 0; i <= nu; i++ ) 00271 { 00272 CIBackSubstToCol(nv+1, R[i], pv, A, L, index, i, P); 00273 } 00274 00275 return true; 00276 } |
|
|
|
|
|
Definition at line 866 of file gunu_knot_removal.cpp.
00867 { 00868 int i,j; 00869 00870 Uh[0] = U[0]; 00871 j = 1; 00872 00873 for( i = 1; i <= n+p+1; i++ ) 00874 { 00875 if( U[i] != U[i-1] ) 00876 { 00877 Uh[j] = U[i-1]; 00878 j++; 00879 } 00880 Uh[j] = U[i]; 00881 j++; 00882 } 00883 00884 Uh[j] = U[n+p+1]; 00885 00886 return j; 00887 } |
|
|
|
|
|
Definition at line 678 of file gunu_intersect.cpp.
00689 { 00690 TessInfo<T,HP> A,B; 00691 point<T> maxP,minP; 00692 int j; 00693 IntersectInfo<T> II; 00694 T maxx,maxy,maxz,scale,d; 00695 rkdtree<point2<T>,T,random_des> KDT(2); 00696 is_uv_point<T> *Puv,*Peq,*Puv_next; 00697 List< is_uv_point<T> > LPuv,LPeq,LPtmp; 00698 ListNode<kdrec<point2<T>,T> > *nn; 00699 ListNode<IntersectionLineInfo<T> > *iin; 00700 Ptr<kdnnrec<point2<T>,T> > N; 00701 List< gul::ListNode<kdrec<point2<T>,T> > > outrecs; 00702 point2<T> M; 00703 00704 // initialize tesselation info structure for A 00705 A.org->nu = nu1; 00706 A.org->pu = pu1; 00707 A.org->U = U1; 00708 A.org->nv = nv1; 00709 A.org->pv = pv1; 00710 A.org->V = V1; 00711 A.org->Pw = Pw1; 00712 00713 guge::CalcBoundingBoxVerts<HP,point<T> >( 00714 A.org->nu+1, A.org->Pw[0], minP, maxP ); 00715 for( j = 1; j < A.org->nv+1; j++ ) 00716 guge::UpdateBoundingBoxVerts<HP,point<T> >( 00717 A.org->nu+1, A.org->Pw[j], minP, maxP ); 00718 A.x1 = minP.x; A.x2 = maxP.x; 00719 A.y1 = minP.y; A.y2 = maxP.y; 00720 A.z1 = minP.z; A.z2 = maxP.z; 00721 00722 A.org->P00 = euclid( A.org->Pw[0][0] ); 00723 A.org->P01 = euclid( A.org->Pw[0][A.org->nu] ); 00724 A.org->P10 = euclid( A.org->Pw[A.org->nv][0] ); 00725 A.org->P11 = euclid( A.org->Pw[A.org->nv][A.org->nu] ); 00726 00727 A.u1 = 0.0; 00728 A.u2 = 1.0; 00729 A.v1 = 0.0; 00730 A.v2 = 1.0; 00731 00732 // initialize tesselation info structure for B 00733 B.org->nu = nu2; 00734 B.org->pu = pu2; 00735 B.org->U = U2; 00736 B.org->nv = nv2; 00737 B.org->pv = pv2; 00738 B.org->V = V2; 00739 B.org->Pw = Pw2; 00740 00741 guge::CalcBoundingBoxVerts<HP,point<T> >( 00742 B.org->nu+1, B.org->Pw[0], minP, maxP ); 00743 for( j = 1; j < B.org->nv+1; j++ ) 00744 guge::UpdateBoundingBoxVerts<HP,point<T> >( 00745 B.org->nu+1, B.org->Pw[j], minP, maxP ); 00746 B.x1 = minP.x; B.x2 = maxP.x; 00747 B.y1 = minP.y; B.y2 = maxP.y; 00748 B.z1 = minP.z; B.z2 = maxP.z; 00749 00750 B.org->P00 = euclid( B.org->Pw[0][0] ); 00751 B.org->P01 = euclid( B.org->Pw[0][B.org->nu] ); 00752 B.org->P10 = euclid( B.org->Pw[B.org->nv][0] ); 00753 B.org->P11 = euclid( B.org->Pw[B.org->nv][B.org->nu] ); 00754 00755 B.u1 = 0.0; 00756 B.u2 = 1.0; 00757 B.v1 = 0.0; 00758 B.v2 = 1.0; 00759 00760 // initialize float to rational conversion parameters 00761 II.minx = Min(A.x1,B.x1); 00762 maxx = Max(A.x2,B.x2); 00763 II.miny = Min(A.y1,B.y1); 00764 maxy = Max(A.y2,B.y2); 00765 II.minz = Min(A.z1,B.z1); 00766 maxz = Max(A.z2,B.z2); 00767 00768 scale = maxx - II.minx; 00769 d = maxy - II.miny; 00770 if( d > scale ) scale = d; 00771 d = maxz - II.minz; 00772 if( d > scale ) scale = d; 00773 if( !test(scale) ) return; 00774 II.minx -= scale; 00775 II.miny -= scale; 00776 II.minz -= scale; 00777 II.scalei = (T)1/scale; 00778 00779 DoIntersectSurfaces(&A,&B,tol,&II); 00780 00781 // cout << "number of intersection segments = " 00782 // << II.IA.nElems << "\n"; 00783 00784 // insert endpoints of intersection segments into kd-tree 00785 for( iin = II.IA.First(); iin; iin = iin->next ) 00786 { 00787 Puv = new is_uv_point<T>(&iin->el.Suv[0],&iin->el); 00788 LPuv.Append(Puv); 00789 KDT.insert(Puv); 00790 00791 Puv = new is_uv_point<T>(&iin->el.Suv[1],&iin->el); 00792 LPuv.Append(Puv); 00793 KDT.insert(Puv); 00794 } 00795 00796 // compress points which are approximately equal into a single point 00797 for(;;) 00798 { 00799 Puv = LPuv.First(); 00800 if( !Puv ) break; 00801 00802 LPuv.Remove(Puv); 00803 KDT.remove(Puv,outrecs); 00804 // cout << "removed " << outrecs.nElems << " record(s)\n"; 00805 LPtmp.Append(Puv); 00806 00807 for(;;) 00808 { 00809 Puv = LPtmp.First(); 00810 if( !Puv ) break; 00811 LPtmp.Remove(Puv); 00812 LPeq.Append(Puv); 00813 00814 N.reserve_pool(1); 00815 if( KDT.nearest_neighbors( *Puv, 1, N ) ) 00816 { 00817 nn = N[0].m_recs.First(); 00818 00819 if( rel_equal(*Puv,*nn->el.m_base,rtr<T>::zero_tol()) ) 00820 { 00821 for( ; nn; nn = nn->next ) // all records have the same distance 00822 { 00823 // cast back to derived class 00824 Peq = (is_uv_point<T> *)nn->el.m_base; 00825 LPuv.Remove(Peq); 00826 KDT.remove(Peq,outrecs); 00827 // cout << "removed " << outrecs.nElems << " record(s)\n"; 00828 LPtmp.Append(Peq); 00829 } 00830 } 00831 } 00832 } 00833 00834 if( LPeq.nElems > 1 ) 00835 { 00836 // calculate center of "equal" points 00837 Puv = LPeq.First(); 00838 M = *Puv; 00839 j = 1; 00840 Puv = Puv->next; 00841 for( ; Puv; Puv = Puv->next ) 00842 { 00843 M += *Puv; 00844 j++; 00845 } 00846 M = ((T)1/(T)j)*M; 00847 00848 // change points in affected intersection segments 00849 Puv = LPeq.First(); 00850 LPeq.ReleaseElems(); 00851 for( ; Puv; Puv = Puv_next ) 00852 { 00853 *Puv->ip = M; 00854 Puv_next = Puv->next; 00855 delete Puv; 00856 } 00857 } 00858 else 00859 LPeq.DeleteElems(); 00860 } 00861 00862 S1 = II.IA; 00863 S2 = II.IB; 00864 S = II.IS; 00865 } |
|
Definition at line 93 of file gunu_parametrize.h.
00095 { 00096 T tid,tidf,d,alpha; 00097 int i,ii; 00098 00099 for( i = 0; i <= p; i++ ) 00100 { 00101 U[i] = 0.0; 00102 U[n+1+i] = 1.0; 00103 } 00104 00105 d = (T)nQ / (T)(n - p + 1); 00106 if( d < (T)1 ) return 0; 00107 00108 for( i = 1; i <= n - p; i++ ) 00109 { 00110 tid = (T)i * d; 00111 tidf = gul::rtr<T>::floor(tid); 00112 00113 ii = (int)tidf; 00114 00115 alpha = tid - tidf; 00116 00117 U[p+i] = ((T)1 - alpha) * Uq[ii-1] + alpha * Uq[ii]; 00118 } 00119 return ((int)gul::rtr<T>::ceil(d))+1; 00120 } |
|
Definition at line 68 of file gunu_parametrize.h.
00070 { 00071 int i,j; 00072 T p_inv,sum; 00073 int n = nQ-1, m = nQ+p; 00074 00075 for( i = 0; i <= p; i++ ) U[i] = (T)0; 00076 for( i = m-p; i <= m; i++ ) U[i] = (T)1; 00077 00078 p_inv = (T)1/(T)p; 00079 for( j = 1; j <= n-p; j++ ) 00080 { 00081 sum = (T)0; 00082 for( i = j; i < j+p; i++ ) 00083 sum += Uq[i]; 00084 U[j+p] = sum * p_inv; 00085 } 00086 } |
|
|
|
|
|
|
|
|
|
Definition at line 55 of file gunu_linearize.cpp.
00056 { 00057 point<T> P00,P01,P10,P11,T00,T01,T10,T11; 00058 int nu,nv,pu,pv; 00059 LinearizeCallbackData<T,HP> *cb = (LinearizeCallbackData<T,HP> *)usrdata; 00060 Ptr< Ptr< HP > > Pw; 00061 00062 P00 = A->org->P00; 00063 P01 = A->org->P01; 00064 P10 = A->org->P10; 00065 P11 = A->org->P11; 00066 00067 if( cb->much_info == 0 ) 00068 { 00069 cb->usrfunc( cb->usrdata, 00070 &P00, &P01, &P10, &P11, NULL, NULL, NULL, NULL, 00071 NULL, NULL, NULL, NULL ); 00072 } 00073 else /* Calc Normals */ 00074 { 00075 nu = A->org->nu; 00076 pu = A->org->pu; 00077 nv = A->org->nv; 00078 pv = A->org->pv; 00079 Pw = A->org->Pw; 00080 00081 CalcNormal_U0V0<T>( nu, pu, nv, pv, Pw, &T00 ); 00082 CalcNormal_U1V0<T>( nu, pu, nv, pv, Pw, &T01 ); 00083 CalcNormal_U0V1<T>( nu, pu, nv, pv, Pw, &T10 ); 00084 CalcNormal_U1V1<T>( nu, pu, nv, pv, Pw, &T11 ); 00085 00086 cb->usrfunc( cb->usrdata, &P00, &P01, &P10, &P11, 00087 &T00, &T01, &T10, &T11, &A->u1, &A->u2, &A->v1, &A->v2 ); 00088 } 00089 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 398 of file gunu_linearize.cpp.
00402 { 00403 List< ListNode<EP> > L; 00404 ListNode<EP> *node = new ListNode<EP>(euclid(Pw[0])); 00405 int i,nEl; 00406 Ptr< EP > P; 00407 00408 L.Append( node ); 00409 00410 LinearizeCurve( max_iter, n, p, U, Pw, tol, 00411 LinearizeLineCallback<EP>, (void *)&L ); 00412 00413 nEl = L.nElems; 00414 node = L.head; 00415 P.reserve_pool( nEl ); 00416 for( i = 0; i < nEl; i++ ) 00417 { 00418 P[nEl-1-i] = node->el; 00419 node = node->next; 00420 } 00421 *ret_nP = nEl; 00422 *retP = P; 00423 00424 L.DeleteElems(); 00425 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 315 of file gunu_linearize.cpp.
00319 { 00320 curve<T,HP> C; 00321 00322 C.p = p; 00323 C.knt.m = n+p+1; 00324 C.knt.U = U; 00325 00326 C.cpt.n = n; 00327 C.cpt.Pw = Pw; 00328 00329 DoLinearizeCurve( 1, max_iter, &C, tol, usrfunc, usrdata ); 00330 } |
|
|
|
|
|
|
|
|
|
Definition at line 383 of file gunu_linearize.cpp.
00384 { 00385 List< ListNode<EP> > *L = (List< ListNode<EP> > *)usrdata; 00386 ListNode<EP> *node = new ListNode<EP>(*p2); 00387 L->Append(node); 00388 } |
|
|
|
|
|
|
|
|
|
Definition at line 78 of file gunu_intersect.cpp.
00080 { 00081 int nu,nv,i,pu,pv,j; 00082 Ptr< T > U,V; 00083 Ptr< Ptr< HP > > Pw; 00084 point<T> P00, P01, P10, P11, SP0, SP1, SP2, SP3, CP, minP, maxP; 00085 bool subdiv; 00086 surface< T, HP > S[4], surf; 00087 Ptr< HP > buf; 00088 gul::Ptr< int > test; 00089 00090 nu = A->org->nu; 00091 pu = A->org->pu; 00092 nv = A->org->nv; 00093 pv = A->org->pv; 00094 U = A->org->U; 00095 V = A->org->V; 00096 Pw = A->org->Pw; 00097 00098 P00 = A->org->P00; 00099 P01 = A->org->P01; 00100 P10 = A->org->P10; 00101 P11 = A->org->P11; 00102 00103 buf.reserve_place( reserve_stack(hpoint<T>,nv+1), nv+1 ); 00104 00105 /*** Pruefen, ob Randkurven linear approximierbar: ***/ 00106 subdiv = false; 00107 /* --- obere Randkurve: --- */ 00108 if( !guge::IsLinear< T,HP,point<T> >( nu, Pw[0], tol ) ) 00109 { 00110 subdiv = true; 00111 CurvePoint< T, HP, point<T> >( (T)0.5, nu, pu, U, Pw[0], &SP0 ); 00112 } 00113 else 00114 { 00115 SP0 = (T)0.5 * (P00 + P01); 00116 } 00117 /* --- untere Randkurve: --- */ 00118 if( !guge::IsLinear<T,HP,point<T> >( nu, Pw[nv], tol ) ) 00119 { 00120 subdiv = true; 00121 CurvePoint< T, HP, point<T> >( (T)0.5, nu, pu, U, Pw[nv], &SP1 ); 00122 } 00123 else 00124 { 00125 SP1 = (T)0.5 * (P10 + P11); 00126 } 00127 /* --- linke Randkurve: --- */ 00128 for( i = 0; i <= nv; i++ ) 00129 buf[i] = Pw[i][0]; 00130 if( !guge::IsLinear<T,HP,point<T> >( nv, buf, tol ) ) 00131 { 00132 subdiv = true; 00133 CurvePoint< T, HP, point<T> >( (T)0.5, nv, pv, V, buf, &SP2 ); 00134 } 00135 else 00136 { 00137 SP2 = (T)0.5 * (P00 + P10); 00138 } 00139 /* --- rechte Randkurve: --- */ 00140 for( i = 0; i <= nv; i++ ) 00141 buf[i] = Pw[i][nu]; 00142 if( !guge::IsLinear<T,HP,point<T> >( nv, buf, tol ) ) 00143 { 00144 subdiv = true; 00145 CurvePoint< T, HP, point<T> >( (T)0.5, nv, pv, V, buf, &SP3 ); 00146 } 00147 else 00148 { 00149 SP3 = (T)0.5 * (P01 + P11); 00150 } 00151 00152 #if 0 00153 /* not necessary if the tesselation tolerance is fine enough and the 00154 surface doesn't intersect itself, i.e. in normal cases 00155 */ 00156 00157 // check if iso curves are linear enough 00158 if( !subdiv ) 00159 { 00160 for( i = 1; i < nv; i++ ) 00161 { 00162 if( !guge::IsLinear< T,HP,point<T> >( nu, Pw[i], tol, t ) ) 00163 { 00164 subdiv = true; 00165 break; 00166 } 00167 } 00168 } 00169 if( !subdiv ) 00170 { 00171 for( j = 1; j < nu; j++ ) 00172 { 00173 for( i = 0; i <= nv; i++ ) 00174 buf[i] = Pw[i][j]; 00175 if( !guge::IsLinear<T,HP,point<T> >( nv, buf, tol, t ) ) 00176 { 00177 subdiv = true; 00178 break; 00179 } 00180 } 00181 } 00182 #endif 00183 /* --- Pruefen ob Flaeche linear approxmierbar --- */ 00184 if( !subdiv ) 00185 { 00186 if( !guge::IsPlanar<T,HP>( nu, nv, Pw, tol ) ) 00187 subdiv = true; 00188 } 00189 /*** Flaeche nicht linear approximierbar, also unterteilen: ***/ 00190 if( subdiv ) 00191 { 00192 surf.pu = pu; 00193 surf.pv = pv; 00194 surf.net.nu = nu; 00195 surf.net.nv = nv; 00196 surf.net.Pw = Pw; 00197 surf.knu.m = nu+pu+1; 00198 surf.knu.U = U; 00199 surf.knv.m = nv+pv+1; 00200 surf.knv.U = V; 00201 00202 SplitSurface< T, HP >( &surf, 0.5, 0.5, &S[0], &S[1], &S[2], &S[3] ); 00203 00204 A->divided = 1; 00205 delete A->org; /* Speicher fuer ungeteilte Flaeche freigeben */ 00206 A->org = 0; 00207 for( i = 0; i < 4; i++ ) A->sub[i] = new TessInfo<T,HP>(); 00208 00209 for( i = 0; i < 4; i++ ) 00210 { 00211 if( need_bbox ) 00212 { 00213 guge::CalcBoundingBoxVerts< HP, point<T> >( 00214 S[i].net.nu+1, S[i].net.Pw[0], minP, maxP ); 00215 for( j = 1; j < S[i].net.nv+1; j++ ) 00216 guge::UpdateBoundingBoxVerts< HP, point<T> >( 00217 S[i].net.nu+1, S[i].net.Pw[j], minP, maxP ); 00218 A->sub[i]->x1 = minP.x; A->sub[i]->x2 = maxP.x; 00219 A->sub[i]->y1 = minP.y; A->sub[i]->y2 = maxP.y; 00220 A->sub[i]->z1 = minP.z; A->sub[i]->z2 = maxP.z; 00221 } 00222 A->sub[i]->org->nu = S[i].net.nu; 00223 A->sub[i]->org->pu = S[i].pu; 00224 A->sub[i]->org->nv = S[i].net.nv; 00225 A->sub[i]->org->pv = S[i].pv; 00226 A->sub[i]->org->U = S[i].knu.U; 00227 A->sub[i]->org->V = S[i].knv.U; 00228 A->sub[i]->org->Pw = S[i].net.Pw; 00229 } 00230 CP = euclid( A->sub[0]->org->Pw[ A->sub[0]->org->nv ][ A->sub[0]->org->nu ] ); 00231 00232 A->sub[0]->org->P00 = P00; 00233 A->sub[0]->org->P01 = SP0; 00234 A->sub[0]->org->P10 = SP2; 00235 A->sub[0]->org->P11 = CP; 00236 A->sub[0]->u1 = A->u1; 00237 A->sub[0]->u2 = (A->u1 + A->u2) / (T)2.0; 00238 A->sub[0]->v1 = A->v1; 00239 A->sub[0]->v2 = (A->v1 + A->v2) / (T)2.0; 00240 00241 A->sub[1]->org->P00 = SP0; 00242 A->sub[1]->org->P01 = P01; 00243 A->sub[1]->org->P10 = CP; 00244 A->sub[1]->org->P11 = SP3; 00245 A->sub[1]->u1 = (A->u1 + A->u2) / (T)2.0;; 00246 A->sub[1]->u2 = A->u2; 00247 A->sub[1]->v1 = A->v1; 00248 A->sub[1]->v2 = (A->v1 + A->v2) / (T)2.0; 00249 00250 A->sub[2]->org->P00 = SP2; 00251 A->sub[2]->org->P01 = CP; 00252 A->sub[2]->org->P10 = P10; 00253 A->sub[2]->org->P11 = SP1; 00254 A->sub[2]->u1 = A->u1; 00255 A->sub[2]->u2 = (A->u1 + A->u2) / (T)2.0; 00256 A->sub[2]->v1 = (A->v1 + A->v2) / (T)2.0; 00257 A->sub[2]->v2 = A->v2; 00258 00259 A->sub[3]->org->P00 = CP; 00260 A->sub[3]->org->P01 = SP3; 00261 A->sub[3]->org->P10 = SP1; 00262 A->sub[3]->org->P11 = P11; 00263 A->sub[3]->u1 = (A->u1 + A->u2) / (T)2.0;; 00264 A->sub[3]->u2 = A->u2; 00265 A->sub[3]->v1 = (A->v1 + A->v2) / (T)2.0; 00266 A->sub[3]->v2 = A->v2; 00267 } 00268 else 00269 { /****** Flaeche durch 2 Dreiecke approximierbar *****/ 00270 A->linearized = 1; 00271 A->divided = 0; 00272 } 00273 return; 00274 } |
|
|
|
|
|
|
|
|
|
Definition at line 109 of file gunu_linearize.cpp.
00120 { 00121 TessInfo<T,HP> A,B; 00122 LinearizeCallbackData<T,HP> Cb(0,0,0,0); 00123 00124 /* Flaechen Info initialisieren */ 00125 00126 A.org->nu = nu; 00127 A.org->pu = pu; 00128 A.org->U = U; 00129 A.org->nv = nv; 00130 A.org->pv = pv; 00131 A.org->V = V; 00132 A.org->Pw = Pw; 00133 /* 00134 guge::CalcBoundingBox( (A.org->nu+1)*(A.org->nv+1), 00135 A.org->Pw[0], A.x1, A.x2, A.y1, A.y2, A.z1, A.z2 ); 00136 */ 00137 A.org->P00 = euclid( A.org->Pw[0][0] ); 00138 A.org->P01 = euclid( A.org->Pw[0][A.org->nu] ); 00139 A.org->P10 = euclid( A.org->Pw[A.org->nv][0] ); 00140 A.org->P11 = euclid( A.org->Pw[A.org->nv][A.org->nu] ); 00141 00142 A.u1 = 0.0; 00143 A.u2 = 1.0; 00144 A.v1 = 0.0; 00145 A.v2 = 1.0; 00146 00147 /* Daten fuer Callback initialisieren */ 00148 00149 B.org->nu = nu; 00150 B.org->pu = pu; 00151 B.org->U = U; 00152 B.org->nv = nv; 00153 B.org->pv = pv; 00154 B.org->V = V; 00155 B.org->Pw = Pw; 00156 /* 00157 guge::CalcBoundingBox( (B.org->nu+1)*(B.org->nv+1), 00158 B.org->Pw[0], B.x1, B.x2, B.y1, B.y2, B.z1, B.z2 ); 00159 */ 00160 B.org->P00 = euclid( B.org->Pw[0][0] ); 00161 B.org->P01 = euclid( B.org->Pw[0][B.org->nu] ); 00162 B.org->P10 = euclid( B.org->Pw[B.org->nv][0] ); 00163 B.org->P11 = euclid( B.org->Pw[B.org->nv][B.org->nu] ); 00164 00165 B.u1 = 0.0; 00166 B.u2 = 1.0; 00167 B.v1 = 0.0; 00168 B.v2 = 1.0; 00169 00170 Cb.much_info = 1; 00171 Cb.Org = &B; 00172 Cb.usrfunc = usrfunc; 00173 Cb.usrdata = usrdata; 00174 00175 DoLinearizeSurface<T,HP>( 1, max_iter, &A, tol, LinearizeCallback<T,HP>, 00176 &Cb ); 00177 } |
|
Definition at line 117 of file gunu_tesselate.h.
00134 { 00135 TessCbData<T> Cb(normal_flag,quadfunc,trifunc,usrdata); 00136 00137 DoLinearizeTrimmedSurface( 00138 max_iter,nu,pu,KnotsU,nv,pv,KnotsV,Pw,tol,contour, 00139 TessQuadCb<T,HP>,TessTriCb<T,HP>,(void *)&Cb ); 00140 } |
|
Definition at line 66 of file gunu_make_compatible.h.
00080 { 00081 if( dir==gul::u_direction ) 00082 MakeSurfacesCompatibleU( 00083 nu1,pu1,U1,nv1,pv1,V1,Pw1,nu2,pu2,U2,nv2,pv2,V2,Pw2, 00084 ret_nu1,ret_pu1,ret_U1,ret_nv1,ret_pv1,ret_V1,ret_Pw1, 00085 ret_nu2,ret_pu2,ret_U2,ret_nv2,ret_pv2,ret_V2,ret_Pw2 ); 00086 else 00087 MakeSurfacesCompatibleV( 00088 nu1,pu1,U1,nv1,pv1,V1,Pw1,nu2,pu2,U2,nv2,pv2,V2,Pw2, 00089 ret_nu1,ret_pu1,ret_U1,ret_nv1,ret_pv1,ret_V1,ret_Pw1, 00090 ret_nu2,ret_pu2,ret_U2,ret_nv2,ret_pv2,ret_V2,ret_Pw2 ); 00091 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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. (remark: the knot vectors must already have the same bounds, for example U1 = [0,0,0.5,1,1], U2 = [0,0,0,0.2,0.4,1,1,1]) Definition at line 53 of file gunu_make_compatible.cpp.
00066 { 00067 Ptr<T> Uh1, Uh2, Vh1, Vh2, X1, X2, Ur1, Ur2, Vr1, Vr2; 00068 T u; 00069 Ptr< Ptr<HP1> > Qwh1, Pwr1; 00070 Ptr< Ptr<HP2> > Qwh2, Pwr2; 00071 int i,j,nuh1,nuh2,nvh1,nvh2,maxx,x1,x2,k1,k2,k,t,pu; 00072 00073 /* --- make degrees beeing the same ---------------------------------------- */ 00074 00075 if( pu1 < pu2 ) 00076 { 00077 t = pu2 - pu1; 00078 00079 Uh1.reserve_pool(2*pu1 + (nu1-pu1+2)*(t+1)); 00080 Vh1.reserve_pool(nv1 + pv1 + 2); 00081 00082 Qwh1.reserve_pool(nv1+1); 00083 for( i = 0; i < nv1+1; i++ ) 00084 Qwh1[i].reserve_pool(pu1 + (nu1-pu1+1)*(t+1)); 00085 00086 ElevateSurfaceDegree(nu1, pu1, U1, nv1, pv1, V1, Pw1, t, gul::u_direction, 00087 &nuh1, Uh1, &nvh1, Vh1, Qwh1 ); 00088 nuh2 = nu2; 00089 nvh2 = nv2; 00090 Uh2 = U2; // Uh2,Vh2,Qwh2 don't get changed, so the pointers can point 00091 Vh2 = V2; // to the same location 00092 Qwh2 = Pw2; 00093 00094 pu = pu2; 00095 } 00096 else if( pu2 < pu1 ) 00097 { 00098 t = pu1 - pu2; 00099 00100 Uh2.reserve_pool(2*pu2 + (nu2-pu2+2)*(t+1)); 00101 Vh2.reserve_pool(nv2 + pv2 + 2); 00102 00103 Qwh2.reserve_pool(nv2+1); 00104 for( i = 0; i < nv2+1; i++ ) 00105 Qwh2[i].reserve_pool(pu2 + (nu2-pu2+1)*(t+1)); 00106 00107 ElevateSurfaceDegree(nu2, pu2, U2, nv2, pv2, V2, Pw2, t, gul::u_direction, 00108 &nuh2, Uh2, &nvh2, Vh2, Qwh2 ); 00109 nuh1 = nu1; 00110 nvh1 = nv1; 00111 Uh1 = U1; // Uh1,Vh1,Qwh1 don't get changed, so the pointers can point 00112 Vh1 = V1; // can point to the same location 00113 Qwh1 = Pw1; 00114 00115 pu = pu1; 00116 } 00117 else /* p1 == p2 */ 00118 { 00119 nuh1 = nu1; 00120 nvh1 = nv1; 00121 Uh1 = U1; // Uh1,Vh1,Qwh1 don't get changed, so the pointers can point 00122 Vh1 = V1; // can point to the same location 00123 Qwh1 = Pw1; 00124 00125 nuh2 = nu2; 00126 nvh2 = nv2; 00127 Uh2 = U2; // Uh2,Vh2,Qwh2 don't get changed, so the pointers can point 00128 Vh2 = V2; // can point to the same location 00129 Qwh2 = Pw2; 00130 00131 pu = pu1; 00132 } 00133 /* ---------------------------------------------------------- 00134 now both surfaces have the same degree, and are given by: 00135 nuh1, pu, Uh1, nvh1, pv1, Vh1, Qwh1 00136 nuh2, pu, Uh2, nvh2, pv2, Vh2, Qwh2 00137 ----------------------------------------------------------- */ 00138 00139 /* --- make both knot vectors beeing the same ----------------------------- */ 00140 00141 maxx = nuh1-pu + nuh2-pu; 00142 if( maxx > 0 ) 00143 { 00144 X1.reserve_pool(maxx); 00145 X2.reserve_pool(maxx); 00146 } 00147 k1 = 0; 00148 k2 = 0; 00149 k = 0; 00150 x1 = 0; 00151 x2 = 0; 00152 00153 while( (k1 <= nuh1 + pu + 1) && (k2 <= nuh2 + pu + 1) ) 00154 { 00155 if( rel_equal(Uh1[k1],Uh2[k2],rtr<T>::zero_tol()) ) 00156 { 00157 k1++; 00158 k2++; 00159 } 00160 else if( Uh1[k1] < Uh2[k2] ) 00161 { 00162 X2[x2] = Uh1[k1]; 00163 x2++; 00164 k1++; 00165 } 00166 else 00167 { 00168 X1[x1] = Uh2[k2]; 00169 x1++; 00170 k2++; 00171 } 00172 k++; 00173 } 00174 /* k now contains the number of knots of the union knot vector */ 00175 00176 gul::Assert<InternalError>( ndebug || (nuh1 + x1 == nuh2 + x2) ); 00177 00178 /* --- reserve memory for output arrays ------------------------- */ 00179 00180 Ur1.reserve_pool(k); 00181 Vr1.reserve_pool(nvh1+pv1+2); 00182 00183 Pwr1.reserve_pool(nvh1+1); 00184 for( i = 0; i <= nvh1; i++ ) 00185 Pwr1[i].reserve_pool(k-pu-1); 00186 00187 Ur2.reserve_pool(k); 00188 Vr2.reserve_pool(nvh2+pv2+2); 00189 00190 Pwr2.reserve_pool(nvh2+1); 00191 for( i = 0; i <= nvh2; i++ ) 00192 Pwr2[i].reserve_pool(k-pu-1); 00193 00194 if( x1 > 0 ) 00195 { 00196 RefineSurface( nuh1, pu, Uh1, nvh1, pv1, Vh1, Qwh1, 00197 X1, x1-1, gul::u_direction, Ur1, Vr1, Pwr1 ); 00198 } 00199 else 00200 { 00201 // copy the first surface, when it is not needed to refine it 00202 for( i = 0; i < k; i++ ) Ur1[i] = Uh1[i]; 00203 for( i = 0; i < nvh1+pv1+2; i++ ) Vr1[i] = Vh1[i]; 00204 00205 for( i = 0; i < nvh1+1; i++ ) 00206 for( j = 0; j < k - pu - 1; j++ ) 00207 Pwr1[i][j] = Qwh1[i][j]; 00208 } 00209 if( x2 > 0 ) 00210 { 00211 RefineSurface( nuh2, pu, Uh2, nvh2, pv2, Vh2, Qwh2, 00212 X2, x2-1, gul::u_direction, Ur2, Vr2, Pwr2 ); 00213 } 00214 else 00215 { 00216 // copy the second surface, when it is not needed to refine it 00217 for( i = 0; i < k; i++ ) Ur2[i] = Uh2[i]; 00218 for( i = 0; i < nvh2+pv2+2; i++ ) Vr2[i] = Vh2[i]; 00219 00220 for( i = 0; i < nvh2+1; i++ ) 00221 for( j = 0; j < k - pu - 1; j++ ) 00222 Pwr2[i][j] = Qwh2[i][j]; 00223 } 00224 for( i = pu+1; i < k-pu-1; i++ ) 00225 { 00226 u = (Ur1[i] + Ur2[i]) / (T)2; // because of the knot coincidence tol 00227 Ur1[i] = u; 00228 Ur2[i] = u; 00229 } 00230 *ret_pu1 = pu; 00231 *ret_pu2 = pu; 00232 *ret_nu1 = k-pu-2; 00233 *ret_nu2 = k-pu-2; 00234 *ret_pv1 = pv1; 00235 *ret_pv2 = pv2; 00236 *ret_nv1 = nvh1; 00237 *ret_nv2 = nvh2; 00238 *ret_U1 = Ur1; 00239 *ret_U2 = Ur2; 00240 *ret_V1 = Vr1; 00241 *ret_V2 = Vr2; 00242 *ret_Pw1 = Pwr1; 00243 *ret_Pw2 = Pwr2; 00244 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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. (remark: the knot vectors must already have the same bounds, for example U1 = [0,0,0.5,1,1], U2 = [0,0,0,0.2,0.4,1,1,1]) Definition at line 53 of file gunu_make_compatible2.cpp.
00066 { 00067 Ptr<T> Uh1, Uh2, Vh1, Vh2, X1, X2, Ur1, Ur2, Vr1, Vr2; 00068 T v; 00069 Ptr< Ptr<HP1> > Qwh1, Pwr1; 00070 Ptr< Ptr<HP2> > Qwh2, Pwr2; 00071 int i,j,nuh1,nuh2,nvh1,nvh2,maxx,x1,x2,k1,k2,k,t,pv; 00072 00073 /* --- make degrees beeing the same ---------------------------------------- */ 00074 00075 if( pv1 < pv2 ) 00076 { 00077 t = pv2 - pv1; 00078 00079 Vh1.reserve_pool(2*pv1 + (nv1-pv1+2)*(t+1)); 00080 Uh1.reserve_pool(nu1 + pu1 + 2); 00081 00082 Qwh1.reserve_pool(pv1 + (nv1-pv1+1)*(t+1)); 00083 for( i = 0; i < (pv1 + (nv1-pv1+1)*(t+1)); i++ ) 00084 Qwh1[i].reserve_pool(nu1+1); 00085 00086 ElevateSurfaceDegree(nu1, pu1, U1, nv1, pv1, V1, Pw1, t, gul::v_direction, 00087 &nuh1, Uh1, &nvh1, Vh1, Qwh1 ); 00088 nuh2 = nu2; 00089 nvh2 = nv2; 00090 Uh2 = U2; // Uh2,Vh2,Qwh2 don't get changed, so the pointers can point 00091 Vh2 = V2; // can point to the same location 00092 Qwh2 = Pw2; 00093 00094 pv = pv2; 00095 } 00096 else if( pv2 < pv1 ) 00097 { 00098 t = pv1 - pv2; 00099 00100 Vh2.reserve_pool(2*pv2 + (nv2-pv2+2)*(t+1)); 00101 Uh2.reserve_pool(nu2 + pu2 + 2); 00102 00103 Qwh2.reserve_pool(pv2 + (nv2-pv2+1)*(t+1)); 00104 for( i = 0; i < (pv2 + (nv2-pv2+1)*(t+1)); i++ ) 00105 Qwh2[i].reserve_pool(nu2+1); 00106 00107 ElevateSurfaceDegree(nu2, pu2, U2, nv2, pv2, V2, Pw2, t, gul::v_direction, 00108 &nuh2, Uh2, &nvh2, Vh2, Qwh2 ); 00109 nuh1 = nu1; 00110 nvh1 = nv1; 00111 Uh1 = U1; // Uh1,Vh1,Qwh1 don't get changed, so the pointers can point 00112 Vh1 = V1; // to the same location 00113 Qwh1 = Pw1; 00114 00115 pv = pv1; 00116 } 00117 else /* p1 == p2 */ 00118 { 00119 nuh1 = nu1; 00120 nvh1 = nv1; 00121 Uh1 = U1; // Uh1,Vh1,Qwh1 don't get changed, so the pointers can point 00122 Vh1 = V1; // to the same location 00123 Qwh1 = Pw1; 00124 00125 nuh2 = nu2; 00126 nvh2 = nv2; 00127 Uh2 = U2; // Uh2,Vh2,Qwh2 don't get changed, so the pointers can point 00128 Vh2 = V2; // to the same location 00129 Qwh2 = Pw2; 00130 00131 pv = pv1; 00132 } 00133 /* ---------------------------------------------------------- 00134 now both surfaces have the same degree, and are given by: 00135 nuh1, pu, Uh1, nvh1, pv1, Vh1, Qwh1 00136 nuh2, pu, Uh2, nvh2, pv2, Vh2, Qwh2 00137 ----------------------------------------------------------- */ 00138 00139 /* --- make both knot vectors beeing the same ----------------------------- */ 00140 00141 maxx = nvh1-pv + nvh2-pv; 00142 if( maxx > 0 ) 00143 { 00144 X1.reserve_pool(maxx); 00145 X2.reserve_pool(maxx); 00146 } 00147 k1 = 0; 00148 k2 = 0; 00149 k = 0; 00150 x1 = 0; 00151 x2 = 0; 00152 00153 while( (k1 <= nvh1 + pv + 1) && (k2 <= nvh2 + pv + 1) ) 00154 { 00155 if( rel_equal(Vh1[k1],Vh2[k2],rtr<T>::zero_tol()) ) 00156 { 00157 k1++; 00158 k2++; 00159 } 00160 else if( Vh1[k1] < Vh2[k2] ) 00161 { 00162 X2[x2] = Vh1[k1]; 00163 x2++; 00164 k1++; 00165 } 00166 else 00167 { 00168 X1[x1] = Vh2[k2]; 00169 x1++; 00170 k2++; 00171 } 00172 k++; 00173 } 00174 /* k now contains the number of knots of the union knot vector */ 00175 00176 gul::Assert<InternalError>( ndebug || (nvh1 + x1 == nvh2 + x2) ); 00177 00178 /* --- reserve memory for output arrays ------------------------- */ 00179 00180 Vr1.reserve_pool(k); 00181 Ur1.reserve_pool(nuh1+pu1+2); 00182 00183 Pwr1.reserve_pool(k - pv - 1); 00184 for( i = 0; i < k-pv-1; i++ ) 00185 Pwr1[i].reserve_pool(nuh1+1); 00186 00187 Vr2.reserve_pool(k); 00188 Ur2.reserve_pool(nuh2+pu2+2); 00189 00190 Pwr2.reserve_pool(k - pv - 1); 00191 for( i = 0; i < k-pv-1; i++ ) 00192 Pwr2[i].reserve_pool(nuh2+1); 00193 00194 if( x1 > 0 ) 00195 { 00196 RefineSurface( nuh1, pu1, Uh1, nvh1, pv, Vh1, Qwh1, 00197 X1, x1-1, gul::v_direction, Ur1, Vr1, Pwr1 ); 00198 } 00199 else 00200 { 00201 // copy the first surface, when it is not needed to refine it 00202 for( i = 0; i < nuh1+pu1+2; i++ ) Ur1[i] = Uh1[i]; 00203 for( i = 0; i < k; i++ ) Vr1[i] = Vh1[i]; 00204 00205 for( i = 0; i < k - pv - 1; i++ ) 00206 for( j = 0; j < nuh1+1; j++ ) 00207 Pwr1[i][j] = Qwh1[i][j]; 00208 } 00209 if( x2 > 0 ) 00210 { 00211 RefineSurface( nuh2, pu2, Uh2, nvh2, pv, Vh2, Qwh2, 00212 X2, x2-1, gul::v_direction, Ur2, Vr2, Pwr2 ); 00213 } 00214 else 00215 { 00216 // copy the second surface, when it is not needed to refine it 00217 for( i = 0; i < nuh2+pu2+2; i++ ) Ur2[i] = Uh2[i]; 00218 for( i = 0; i < k; i++ ) Vr2[i] = Vh2[i]; 00219 00220 for( i = 0; i < k - pv - 1; i++ ) 00221 for( j = 0; j < nuh2+1; j++ ) 00222 Pwr2[i][j] = Qwh2[i][j]; 00223 } 00224 for( i = pv+1; i < k-pv-1; i++ ) 00225 { 00226 v = (Vr1[i] + Vr2[i]) / (T)2; // because of the knot coincidence tol 00227 Vr1[i] = v; 00228 Vr2[i] = v; 00229 } 00230 *ret_pv1 = pv; 00231 *ret_pv2 = pv; 00232 *ret_nv1 = k-pv-2; 00233 *ret_nv2 = k-pv-2; 00234 *ret_pu1 = pu1; 00235 *ret_pu2 = pu2; 00236 *ret_nu1 = nuh1; 00237 *ret_nu2 = nuh2; 00238 *ret_U1 = Ur1; 00239 *ret_U2 = Ur2; 00240 *ret_V1 = Vr1; 00241 *ret_V2 = Vr2; 00242 *ret_Pw1 = Pwr1; 00243 *ret_Pw2 = Pwr2; 00244 } |
|
|
|
|
|
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). An individual standard deviation for each data point can be given in 'Sigma'. (Remarks: the data point array P is changed - after the algorithm the P[].z contain the difference between the function values of the calculated surface and and the original value!!!, Output arrays U,V,Psi must be reserved by the caller: U: 2*pu + 2^(nIter-1) + 1, V: 2*pv + 2^(nIter-1) + 1, Psi: (pv + 2^(nIter-1))*(pu + 2^(nIter-1)) Definition at line 255 of file gunu_mba_approximate.cpp.
00258 { 00259 Ptr<T> U1,V1,X; 00260 Ptr< Ptr< point1<T> > > Phi; 00261 int xp,i,j,nu,nv,s,maxSpans; 00262 point1<T> S; 00263 T d; 00264 00265 if( nIter < 1 ) return; 00266 maxSpans = 1 << (nIter-1); 00267 00268 /* --- reserve memory for local arrays ----------------------------- */ 00269 00270 U1.reserve_pool(pu + maxSpans + pu + 1); 00271 V1.reserve_pool(pv + maxSpans + pv + 1); 00272 i = Max(pu,pv); 00273 X.reserve_pool(i + maxSpans + i + 1); 00274 00275 Phi.reserve_pool(pv + maxSpans); 00276 for( i = 0; i < maxSpans + pv; i++ ) 00277 Phi[i].reserve_pool(pu + maxSpans); 00278 00279 /* ----------------------------------------------------------------- */ 00280 00281 for( i = 0; i <= pu; i++ ) 00282 { 00283 U[i] = (T)0; 00284 U[pu+1+i] = (T)1; 00285 } 00286 for( i = 0; i <= pv; i++ ) 00287 { 00288 V[i] = (T)0; 00289 V[pv+1+i] = (T)1; 00290 } 00291 00292 for( j = 0; j <= pv; j++ ) 00293 for( i = 0; i <= pu; i++ ) 00294 set( Psi[j][i], (T)0 ); 00295 00296 s = 1; 00297 nu = pu; 00298 nv = pv; 00299 00300 do 00301 { 00302 if( useSigma ) 00303 BAapproximate( nP, P, Sigma, nu, pu, U, nv, pv, V, Phi ); 00304 else 00305 BAapproximate( nP, P, nu, pu, U, nv, pv, V, Phi ); 00306 00307 for( j = 0; j <= nv; j++ ) 00308 for( i = 0; i <= nu; i++ ) 00309 Psi[j][i].x += Phi[j][i].x; 00310 00311 for( i = 0; i < nP; i++ ) 00312 { 00313 SurfacePoint( P[i].x, P[i].y, nu, pu, U, nv, pv, V, Phi, &S ); 00314 P[i].z -= S.x; 00315 } 00316 00317 if( s >= maxSpans ) /* --- ready --- */ 00318 break; 00319 00320 s <<= 1; 00321 00322 d = (T)1/(T)s; 00323 for( i = pu+1, xp = 0; i <= nu+1; i++, xp++ ) 00324 X[xp] = U[i] - d; 00325 RefineSurface( nu, pu, U, nv, pv, V, Psi, 00326 X, xp-1, gul::u_direction, U1, V1, Phi ); 00327 nu += xp; 00328 00329 for( i = pv+1, xp = 0; i <= nv+1; i++, xp++ ) 00330 X[xp] = V[i] - d; 00331 RefineSurface( nu, pu, U1, nv, pv, V1, Phi, 00332 X, xp-1, gul::v_direction, U, V, Psi ); 00333 nv += xp; 00334 00335 }while(1); 00336 } |
|
|
|
|
|
creates a surface with the MBA algorithm. 'Dat' contains the 3d values and 'Dom' the locations in the parametric domain (output arrays are reserved automatically) Definition at line 672 of file gunu_mba_approximate.cpp. Referenced by GUL_MBASurface().
00677 { 00678 T minu,maxu,minv,maxv; 00679 int nu,nv,i,j; 00680 Ptr<T> U,V,null; 00681 Ptr< Ptr< point1<T> > > F; 00682 Ptr< point<T> > coord; 00683 Ptr< Ptr< point<T> > > Pw; 00684 00685 // reserve work arrays 00686 00687 coord.reserve_pool(nDat); 00688 00689 nu = pu + (1<<(nIter-1)) - 1; 00690 U.reserve_pool( 2*pu + (1<<(nIter-1)) + 1 ); 00691 nv = pv + (1<<(nIter-1)) - 1; 00692 V.reserve_pool( 2*pv + (1<<(nIter-1)) + 1 ); 00693 F.reserve_pool(nv+1); 00694 Pw.reserve_pool(nv+1); 00695 for( i = 0; i < nv+1; i++ ) 00696 { 00697 F[i].reserve_pool(nu+1); 00698 Pw[i].reserve_pool(nu+1); 00699 } 00700 00701 // normalize domain points 00702 00703 CalcBoundingBoxE( nDat, Dom, minu, maxu, minv, maxv ); 00704 00705 for( i = 0; i < nDat; i++ ) 00706 { 00707 coord[i].x = (Dom[i].x - minu) / (maxu-minu); 00708 if( coord[i].x < (T)0 ) coord[i].x = (T)0; 00709 else if( coord[i].x > (T)1 ) coord[i].x = (T)1; 00710 00711 coord[i].y = (Dom[i].y - minv) / (maxv-minv); 00712 if( coord[i].y < (T)0 ) coord[i].y = (T)0; 00713 else if( coord[i].y > (T)1 ) coord[i].y = (T)1; 00714 } 00715 00716 /* -------- calculate x-coordinate function ----------------------------- */ 00717 00718 for( i = 0; i < nDat; i++ ) 00719 coord[i].z = Dat[i].x; 00720 00721 MBAapproximate<T>( nDat, coord, false, null, 00722 nIter, pu, pv, U, V, F ); 00723 00724 for( i = 0; i <= nv; i++ ) 00725 for( j = 0; j <= nu; j++ ) 00726 Pw[i][j].x = F[i][j].x; 00727 00728 /* -------- calculate y-coordinate function ----------------------------- */ 00729 00730 for( i = 0; i < nDat; i++ ) 00731 coord[i].z = Dat[i].y; 00732 00733 MBAapproximate<T>( nDat, coord, false, null, 00734 nIter, pu, pv, U, V, F ); 00735 00736 for( i = 0; i <= nv; i++ ) 00737 for( j = 0; j <= nu; j++ ) 00738 Pw[i][j].y = F[i][j].x; 00739 00740 /* -------- calculate z-coordinate function ----------------------------- */ 00741 00742 for( i = 0; i < nDat; i++ ) 00743 coord[i].z = Dat[i].z; 00744 00745 MBAapproximate<T>( nDat, coord, false, null, 00746 nIter, pu, pv, U, V, F ); 00747 00748 for( i = 0; i <= nv; i++ ) 00749 for( j = 0; j <= nu; j++ ) 00750 Pw[i][j].z = F[i][j].x; 00751 00752 /* ----------- ready ---------------------------------------------------- */ 00753 00754 *ret_nu = nu; 00755 *retU = U; 00756 *ret_nv = nv; 00757 *retV = V; 00758 *retP = Pw; 00759 } |
|
|
|
|
|
calculate the rotation about the Z-axis, so that the bounding box of the given Points 'P' gets minimal volume. 'mintol' is the minimum change in the domaain between two iterations (in degree), and 'maxits' the maximum number of iterations Definition at line 413 of file gunu_mba_approximate.cpp.
00414 { 00415 T minx,maxx,miny,maxy,minz,maxz,theta,V,V1; 00416 minbbox_rec<T> mr( nP, P, (T)0, (T)0, (T)0 ); 00417 00418 CalcBoundingBoxE( nP, P, minx, maxx, miny, maxy, minz, maxz ); 00419 V = (maxx-minx)*(maxy-miny)*(maxz-minz); /* volume at 0 and 90 degree */ 00420 /* between these: */ 00421 V1 = mr.volume( (T)0, (T)0, rtr<T>::golden_c() * rtr<T>::pi()/(T)2 ); 00422 if( V1 < V ) 00423 { 00424 GoldenSectionSearch( 00425 (T)0, rtr<T>::golden_c() * rtr<T>::pi()/(T)2, rtr<T>::pi()/(T)2, 00426 minbbox_rec<T>::minimize_about_z_cb, (void *)&mr, 00427 mintol*rtr<T>::pi()/(T)180, maxits, &theta, 00428 &V ); 00429 } 00430 else 00431 theta = (T)0; 00432 00433 return theta; 00434 } |
|
Definition at line 182 of file gunu_basics.h.
00183 { 00184 int i,j, m = nRows-1; 00185 00186 for( i = 0; i <= m/2; i++ ) 00187 for( j = 0; j < nCols; j++ ) 00188 Swap( P[i][j], P[m-i][j] ); 00189 } |
|
Definition at line 151 of file gunu_basics.h.
00152 { 00153 T uw,ui; 00154 int i, m = nU-1; 00155 00156 uw = U[0] + U[m]; 00157 00158 for( i = 1; i <= m/2; i++ ) 00159 { 00160 ui = U[i]; 00161 U[i] = uw - U[m-i]; 00162 U[m-i] = uw - ui; 00163 } 00164 } |
|
Definition at line 170 of file gunu_basics.h.
00171 { 00172 int i, m = nP-1; 00173 00174 for( i = 0; i <= m/2; i++ ) 00175 Swap( P[i], P[m-i] ); 00176 } |
|
Definition at line 98 of file gunu_basics.h.
00100 { 00101 T u0,su; 00102 int i; 00103 00104 offsetU = u0 = U[0]; 00105 scaleU = su = U[n+1] - u0; 00106 if( (u0 == 0.) && (su == 1.) ) return; 00107 00108 for( i = 0; i <= p; i++ ) 00109 retU[i] = 0.; 00110 for( i = p+1; i <= n; i++ ) 00111 retU[i] = (U[i] - u0) / su; 00112 for( i = n+1; i <= n+p+1; i++ ) 00113 retU[i] = 1.; 00114 } |
|
Definition at line 76 of file gunu_basics.h.
00077 { 00078 T u0,su; 00079 int i; 00080 00081 u0 = U[0]; 00082 su = U[n+1] - u0; 00083 if( (u0 == 0.) && (su == 1.) ) return; 00084 00085 for( i = 0; i <= p; i++ ) 00086 U[i] = 0.; 00087 for( i = p+1; i <= n; i++ ) 00088 U[i] = (U[i] - u0) / su; 00089 for( i = n+1; i <= n+p+1; i++ ) 00090 U[i] = 1.; 00091 } |
|
Definition at line 767 of file gunu_knot_removal.cpp.
00770 { 00771 bool found; 00772 EP C,V,A; 00773 T u1,err,err1,a,b; 00774 int t,s,sav,i,j; 00775 00776 CurveDerivatives(u,n,p,U,Pw,2,D); 00777 found = PTCCheck( P, D, eps, &err ); 00778 if( found ) 00779 { 00780 *ret_u = u; 00781 return true; 00782 } 00783 00784 // initialize parameter range interval [a,b] 00785 // (C2 continuity required for changing knot spans) 00786 00787 t = sav = FindSpan(u,n,p,U); 00788 for(;;) // find left boundary 00789 { 00790 s = 1; 00791 while( (s <= p) && (U[t-s] == U[t]) ) s++; 00792 if( p-s < 2 ) 00793 { 00794 a = U[t]; 00795 break; 00796 } 00797 t = t-s; 00798 } 00799 00800 t = sav + 1; 00801 for(;;) // find right boundary 00802 { 00803 s = 1; 00804 while( (s <= p) && (U[t+s] == U[t]) ) s++; 00805 if( p-s < 2 ) 00806 { 00807 b = U[t]; 00808 break; 00809 } 00810 t = t+s; 00811 } 00812 00813 // main loop 00814 for( j = 0; j < 100; j++ ) // max iterations = 100 ? 00815 { 00816 // calc next value for u 00817 C = D[0]; 00818 V = D[1]; 00819 A = D[2]; 00820 u1 = u - (V*(C-P))/(A*(C-P) + V*V); 00821 00822 // clip with search interval 00823 if( u1 < a ) u1 = a; 00824 if( u1 >= b ) u1 = b - b*rtr<T>::epsilon(); 00825 00826 // check that parameter changes enough 00827 if( rel_equal(u,u1,eps) ) 00828 { 00829 *ret_u = u; 00830 return true; 00831 } 00832 00833 // check step width (error should decrease when doing a newton step) 00834 for( i = 0; i < 10; i++ ) 00835 { 00836 CurveDerivatives(u1,n,p,U,Pw,2,D); 00837 found = PTCCheck( P, D, eps, &err1 ); 00838 if( found ) 00839 { 00840 *ret_u = u1; 00841 return true; 00842 } 00843 00844 if( err1 < err ) 00845 break; 00846 00847 u1 = u + (T)0.5*(u1-u); 00848 } 00849 // step width adjustment not successful 00850 if( err1 > err ) 00851 return false; 00852 00853 u = u1; 00854 err = err1; 00855 } 00856 00857 return false; 00858 } |
|
|
|
|
|
|
|
|
|
Definition at line 208 of file gunu_project.cpp.
00214 { 00215 Ptr<T> BezU,BezV; 00216 Ptr< Ptr< Ptr<HP> > > strips; 00217 Ptr< Ptr< Ptr<HP> > > segs; 00218 Ptr<T> sampU, sampV; 00219 Ptr< Ptr<EP> > sampP; 00220 int nStrips, nSegs, i, j, k, l; 00221 int nSampU, nSampV; 00222 int nKu, nKv; 00223 Ptr<int> Ku,Mu,Kv,Mv; 00224 bezier_ninfo<T,HP,EP> I((T)0.000001,(T)0.000001); 00225 Ptr< patch_ninfo<T,HP> > S; 00226 point_ninfo<T,HP,EP> *P; 00227 List< point_ninfo<T,HP,EP> > LP; 00228 rkdtree< kdpoint<T,EP>,T,random_des > KDT(3); 00229 Ptr< kdnnrec< kdpoint<T,EP>,T > > N; 00230 ListNode< kdrec< kdpoint<T,EP>,T > > *r; 00231 Ptr<T> dom,x1,x2; 00232 point_ninfo<T,HP,EP> *pi; 00233 int n; 00234 bool found; 00235 int index,nFound; 00236 T u,v,nurbs_u,nurbs_v,min_u,min_v,dist,min_dist; 00237 EP min_S; 00238 int nRetPts; 00239 00240 nRetPts = 0; 00241 00242 dom.reserve_pool(2); 00243 x1.reserve_pool(2); 00244 x2.reserve_pool(2); 00245 00246 /* form Bezier knot vectors */ 00247 00248 BezU.reserve_pool(ref_pu+ref_pu+2); 00249 BezV.reserve_pool(ref_pv+ref_pv+2); 00250 00251 BezierKnotVector(ref_pu,BezU); 00252 BezierKnotVector(ref_pv,BezV); 00253 00254 /* ----- divide surface into Bezier segments ----------------------- */ 00255 00256 nSampU = ref_pu*3; 00257 nSampV = ref_pv*3; 00258 00259 sampP.reserve_pool(nSampV); 00260 for( i = 0; i < nSampV; i++ ) 00261 sampP[i].reserve_pool(nSampU); 00262 00263 sampU.reserve_pool(nSampU); 00264 sampV.reserve_pool(nSampV); 00265 EqualSpacedParameters( nSampU, BezU[0], BezU[ref_pu+1], sampU ); 00266 EqualSpacedParameters( nSampV, BezV[0], BezV[ref_pv+1], sampV ); 00267 00268 nKu = BezierPositions( ref_nu, ref_pu, refU, Ku, Mu ); 00269 nKv = BezierPositions( ref_nv, ref_pv, refV, Kv, Mv ); 00270 nStrips = nKv; 00271 nSegs = nKu; 00272 00273 // form horizontal Bezier strips: 00274 00275 BezierDecomposeSurfaceV( nKv, Kv, Mv, ref_nu, ref_pu, refU, 00276 ref_nv, ref_pv, refV, refPw, &strips ); 00277 00278 // divide horizontal strips into Bezier segments: 00279 00280 segs.reserve_pool( nStrips ); 00281 00282 for( i = 0; i < nStrips; i++ ) 00283 { 00284 BezierDecomposeSurfaceU( nKu, Ku, Mu, ref_nu, ref_pu, refU, 00285 ref_pv, ref_pv, BezV, strips[i], &segs ); 00286 00287 strips[i].reset(); // delete memory of strips, not needed anymore 00288 00289 for( j = 0; j < nSegs; j++ ) 00290 { 00291 CalcSurfaceMesh( ref_pu, ref_pu, BezU, ref_pv, ref_pv, BezV, segs[j], 00292 nSampU, sampU, nSampV, sampV, sampP ); 00293 00294 S.reserve_pool(1); 00295 00296 S[0].pu = ref_pu; 00297 S[0].pv = ref_pv; 00298 S[0].U = BezU; 00299 S[0].V = BezV; 00300 S[0].Pw = segs[j]; 00301 S[0].row = i; 00302 S[0].col = j; 00303 00304 for( k = 0; k < nSampV; k++ ) 00305 { 00306 for( l = 0; l < nSampU; l++ ) 00307 { 00308 P = new point_ninfo<T,HP,EP>( sampP[k][l], S, sampU[l], sampV[k] ); 00309 LP.Append( P ); 00310 00311 KDT.insert( P ); 00312 } 00313 } 00314 } 00315 // control points are referenced now by the patch infos, and the 'strips' 00316 // array is still needed for the next strip, so it is neither necessary 00317 // nor possible to free something ! 00318 } 00319 00320 // search for each data point a nearest neighbor, and then do the newton 00321 // iteration 00322 00323 x1[0] = x1[1] = (T)0; 00324 x2[0] = x2[1] = (T)1; 00325 00326 for( i = 0; i < nDatPoints; i++ ) 00327 { 00328 N.reserve_pool(1); // this ensures that memory from previous runs is freed 00329 // (though this isn't necessary since N only has 1 element) 00330 00331 n = KDT.nearest_neighbors( kdpoint<T,EP>(datPoints[i],0), 1, N ); 00332 if( !n ) continue; 00333 00334 /* 00335 cout << "data point #" << i << ": " << datPoints[i] << "\n"; 00336 cout << "nearest neighbors with rkdtree\n"; 00337 for( j = 0; j < n; j++ ) 00338 N[j].dump(3); 00339 */ 00340 00341 nFound = 0; 00342 for( r = N[0].m_recs.First(); r; r = r->next ) 00343 { 00344 pi = (point_ninfo<T,HP,EP> *)r->el.m_base; 00345 I.setCurrentPoint( &datPoints[i], pi ); 00346 00347 dom[0] = pi->u; 00348 dom[1] = pi->v; 00349 found = Newton( dom, x1, x2, I, 200 ); 00350 if( !found ) continue; 00351 00352 // calculate position in nurbs surface domain 00353 00354 u = I.last_u; 00355 v = I.last_v; 00356 00357 index = pi->S[0].row-1; 00358 if( index < 0 ) 00359 nurbs_v = ((T)1-v)*refV[ref_pu] + v*refV[Kv[index+1]]; 00360 else 00361 nurbs_v = ((T)1-v)*refV[Kv[index]] + v*refV[Kv[index+1]]; 00362 00363 index = pi->S[0].col-1; 00364 if( index < 0 ) 00365 nurbs_u = ((T)1-u)*refU[ref_pu] + u*refU[Ku[index+1]]; 00366 else 00367 nurbs_u = ((T)1-u)*refU[Ku[index]] + u*refU[Ku[index+1]]; 00368 00369 // if multiple points were found, take the nearest 00370 00371 dist = distance( I.SKL[0][0], datPoints[i] ); 00372 00373 if( !nFound || (dist < min_dist) ) 00374 { 00375 min_dist = dist; 00376 min_u = nurbs_u; 00377 min_v = nurbs_v; 00378 min_S = I.SKL[0][0]; 00379 } 00380 nFound++; 00381 00382 /* 00383 cout << "point calculated by newton iteration: " << I.SKL[0][0] << "\n"; 00384 */ 00385 } 00386 00387 // append a record to the result list 00388 00389 if( nFound ) 00390 { 00391 retPts[nRetPts].i = i; 00392 retPts[nRetPts].u = min_u; 00393 retPts[nRetPts].v = min_v; 00394 retPts[nRetPts].S = min_S; 00395 nRetPts++; 00396 } 00397 } 00398 00399 return nRetPts; 00400 } |
|
Definition at line 742 of file gunu_knot_removal.cpp.
00743 { 00744 EP C,V,A; 00745 T num,den; 00746 00747 C = D[0]; 00748 V = D[1]; 00749 A = D[2]; 00750 00751 // check point coincidence 00752 if( rel_equal(C,P,eps) ) 00753 return true; 00754 00755 // check zero cosine 00756 num = V*(C-P); 00757 den = rtr<T>::sqrt(V*V) * rtr<T>::sqrt((C-P)*(C-P)); 00758 if( rel_equal(num+den,den,eps) ) 00759 return true; 00760 00761 *err = rtr<T>::fabs(num/den); 00762 00763 return false; 00764 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inserts 'r'+1 knots given by the refinement vector 'X' into the knot vector of a curve (and calculates the changed control points). no validity checks are made, multiplicity of the inserted knots mustn't exceed the degree 'p', memory for the new knot vector 'Ubar' and control point vector 'Q' must be reserved by the caller: Ubar: n+p+2+r, Q: n+1+r Definition at line 47 of file gunu_refine.cpp.
00049 { 00050 int i,j,k,l,m,a,b,ind; 00051 T alfa; 00052 00053 m = n + p + 1; 00054 00055 a = FindSpan( X[0], n, p, U ); 00056 b = FindSpan( X[r], n, p, U ); 00057 b = b + 1; 00058 00059 for( j = 0; j <= a-p; j++ ) 00060 Q[j] = P[j]; 00061 for( j = b-1; j <= n; j++ ) 00062 Q[j+r+1] = P[j]; 00063 00064 for( j = 0; j <= a; j++ ) 00065 Ubar[j] = U[j]; 00066 for( j = b+p; j <= m; j++ ) 00067 Ubar[j+r+1] = U[j]; 00068 00069 i = b+p-1; 00070 k = b+p+r; 00071 for( j = r; j >= 0; j-- ) 00072 { 00073 while( (X[j] <= U[i]) && (i > a) ) 00074 { 00075 Q[k-p-1] = P[i-p-1]; 00076 Ubar[k] = U[i]; 00077 k--; 00078 i--; 00079 } 00080 Q[k-p-1] = Q[k-p]; 00081 00082 for( l = 1; l <= p; l++ ) 00083 { 00084 ind = k-p+l; 00085 alfa = Ubar[k+l] - X[j]; 00086 if( fabs(alfa) == 0.0 ) 00087 Q[ind-1] = Q[ind]; 00088 else 00089 { 00090 alfa = alfa / ( Ubar[k+l] - U[i-p+l] ); 00091 Q[ind-1] = alfa * Q[ind-1] + ((T)1 - alfa) * Q[ind]; 00092 } 00093 } 00094 Ubar[k] = X[j]; 00095 k--; 00096 } 00097 } |
|
Definition at line 61 of file gunu_refine.h.
00065 { 00066 if( dir == gul::u_direction ) 00067 RefineSurfaceU( nu,pu,U,nv,pv,V,P,X,r,Ubar,Vbar,Q ); 00068 else 00069 RefineSurfaceV( nu,pu,U,nv,pv,V,P,X,r,Ubar,Vbar,Q ); 00070 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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). no validity checks are made, multiplicity of the inserted knots mustn't exceed the degree 'pu' or 'pv', memory for the new knot vectors 'Ubar' and Vbar and the control point matrix 'Q' must be reserved by the caller: Ubar: nu+pu+2+r, Q: [nv]*[nu+1+r], if 'dir' == u_direction, Vbar: nv+pv+2+r, Q: [nv+1+r]*[nu], if 'dir' == v_direction Definition at line 134 of file gunu_refine.cpp.
00138 { 00139 int i,j,k,l,m,a,b,ind,row; 00140 T alfa; 00141 00142 m = nu + pu + 1; 00143 00144 /* ----- search minimum and maximum+1 knot span a and b ----------- */ 00145 a = FindSpan( X[0], nu, pu, U ); 00146 b = FindSpan( X[r], nu, pu, U ); 00147 b = b + 1; 00148 00149 /* ------ initialise Ubar -------------------------------------- */ 00150 for( j = 0; j <= a; j++ ) 00151 Ubar[j] = U[j]; 00152 for( j = b+pu; j <= m; j++ ) 00153 Ubar[j+r+1] = U[j]; 00154 00155 /* ------ copy V to Vbar --------------------------------------- */ 00156 for( j = 0; j <= nv + pv + 1; j++ ) 00157 Vbar[j] = V[j]; 00158 00159 /* ------ copy unchanged control points ------------------------ */ 00160 for( row = 0; row <= nv; row++ ) 00161 { 00162 for( k = 0; k <= a-pu; k++ ) 00163 Q[row][k] = P[row][k]; 00164 for( k = b-1; k <= nu; k++ ) 00165 Q[row][k+r+1] = P[row][k]; 00166 } 00167 00168 i = b+pu-1; 00169 k = b+pu+r; 00170 for( j = r; j >= 0; j-- ) 00171 { 00172 while( (X[j] <= U[i]) && (i > a) ) 00173 { 00174 /*--------- calc Ubar -------------------------------------------- */ 00175 Ubar[k] = U[i]; 00176 00177 for( row = 0; row <= nv; row++ ) 00178 Q[row][k-pu-1] = P[row][i-pu-1]; 00179 k -= 1; 00180 i -= 1; 00181 } 00182 for( row = 0; row <= nv; row++ ) 00183 Q[row][k-pu-1] = Q[row][k-pu]; 00184 00185 for( l = 1; l <= pu; l++ ) 00186 { 00187 ind = k-pu+l; 00188 alfa = Ubar[k+l] - X[j]; 00189 if( fabs(alfa) == 0.0 ) 00190 for( row = 0; row <= nv; row++ ) 00191 Q[row][ind-1] = Q[row][ind]; 00192 else 00193 { 00194 alfa = alfa / ( Ubar[k+l] - U[i-pu+l] ); 00195 for( row = 0; row <= nv; row++ ) 00196 { 00197 Q[row][ind-1] = alfa * Q[row][ind-1] + ((T)1 - alfa) * Q[row][ind]; 00198 } 00199 } 00200 } 00201 Ubar[k] = X[j]; 00202 k--; 00203 } 00204 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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). no validity checks are made, multiplicity of the inserted knots mustn't exceed the degree 'pu' or 'pv', memory for the new knot vectors 'Ubar' and Vbar and the control point matrix 'Q' must be reserved by the caller: Ubar: nu+pu+2+r, Q: [nv]*[nu+1+r], if 'dir' == u_direction, Vbar: nv+pv+2+r, Q: [nv+1+r]*[nu], if 'dir' == v_direction Definition at line 49 of file gunu_refine2.cpp.
00053 { 00054 int i,j,k,l,m,a,b,ind,col; 00055 T alfa; 00056 00057 m = nv + pv + 1; 00058 00059 /* ----- search minimum and maximum+1 knot span a and b ----------- */ 00060 a = FindSpan( X[0], nv, pv, V ); 00061 b = FindSpan( X[r], nv, pv, V ); 00062 b = b + 1; 00063 00064 /* ------ initialise Vbar ------------------------------------------ */ 00065 for( j = 0; j <= a; j++ ) 00066 Vbar[j] = V[j]; 00067 for( j = b+pv; j <= m; j++ ) 00068 Vbar[j+r+1] = V[j]; 00069 00070 /* ------ copy U to Ubar ------------------------------------------- */ 00071 for( j = 0; j <= nu + pu + 1; j++ ) 00072 Ubar[j] = U[j]; 00073 00074 /* ------ copy unchanged control points ------------------------ */ 00075 for( col = 0; col <= nu; col++ ) 00076 { 00077 for( k = 0; k <= a-pv; k++ ) 00078 Q[k][col] = P[k][col]; 00079 for( k = b-1; k <= nv; k++ ) 00080 Q[k+r+1][col] = P[k][col]; 00081 } 00082 00083 i = b+pv-1; 00084 k = b+pv+r; 00085 for( j = r; j >= 0; j-- ) 00086 { 00087 while( (X[j] <= V[i]) && (i > a) ) 00088 { 00089 /*--------- calc Vbar ------------------------------------------------- */ 00090 Vbar[k] = V[i]; 00091 00092 for( col = 0; col <= nu; col++ ) 00093 Q[k-pv-1][col] = P[i-pv-1][col]; 00094 k -= 1; 00095 i -= 1; 00096 } 00097 for( col = 0; col <= nu; col++ ) 00098 Q[k-pv-1][col] = Q[k-pv][col]; 00099 00100 for( l = 1; l <= pv; l++ ) 00101 { 00102 ind = k-pv+l; 00103 alfa = Vbar[k+l] - X[j]; 00104 if( fabs(alfa) == 0.0 ) 00105 for( col = 0; col <= nu; col++ ) 00106 Q[ind-1][col] = Q[ind][col]; 00107 else 00108 { 00109 alfa = alfa / ( Vbar[k+l] - V[i-pv+l] ); 00110 for( col = 0; col <= nu; col++ ) 00111 { 00112 Q[ind-1][col] = alfa * Q[ind-1][col] + ((T)1 - alfa) * Q[ind][col]; 00113 } 00114 } 00115 } 00116 Vbar[k] = X[j]; 00117 k--; 00118 } 00119 } |
|
|
|
Definition at line 281 of file gunu_knot_removal.cpp.
00283 { 00284 T u,alfi,alfj,Br; 00285 int ord,last,first,off,i,j,ii,jj; 00286 Ptr<HP> temp; 00287 00288 temp.reserve_pool(2*p+1); 00289 u = U[r]; 00290 00291 ord = p+1; 00292 last = r-s; 00293 first = r-p; 00294 00295 off = first-1; 00296 00297 temp[0] = Pw[off]; 00298 temp[last+1-off] = Pw[last+1]; 00299 00300 i = first; 00301 j = last; 00302 ii = 1; 00303 jj = last - off; 00304 00305 while( j-i > 0 ) 00306 { 00307 alfi = (u-U[i])/(U[i+ord]-U[i]); 00308 alfj = (u-U[j])/(U[j+ord]-U[j]); 00309 00310 temp[ii] = ((T)1/alfi)*(Pw[i]-((T)1-alfi)*temp[ii-1]); 00311 temp[jj] = ((T)1/((T)1-alfj))*(Pw[j]-alfj*temp[jj+1]); 00312 00313 i = i+1; 00314 j = j-1; 00315 ii = ii+1; 00316 jj = jj-1; 00317 } 00318 00319 if( j-i < 0 ) 00320 { 00321 Br = euclidian_distance( temp[ii-1], temp[jj+1] ); 00322 } 00323 else 00324 { 00325 alfi = (u-U[i])/(U[i+ord]-U[i]); 00326 Br = euclidian_distance( Pw[i], alfi*temp[ii+1] + ((T)1-alfi)*temp[ii-1] ); 00327 } 00328 00329 return Br; 00330 } |
|
|
|
|
|
|
|
|
|
Definition at line 179 of file gunu_knot_removal.cpp.
00182 { 00183 T u,alfi,alfj; 00184 int m,ord,fout,last,first,t,off,i,j,ii,jj,k; 00185 Ptr<HP> temp; 00186 00187 if( num == 0 ) // nothing to do 00188 return; 00189 00190 temp.reserve_pool(2*p+1); 00191 u = U[r]; 00192 00193 m = n+p+1; 00194 ord = p+1; 00195 00196 fout = (2*r - s - p)/2; 00197 last = r-s; 00198 first = r-p; 00199 00200 for( t = 0; t < num; t++ ) 00201 { 00202 off = first-1; 00203 temp[0] = Pw[off]; 00204 temp[last+1-off] = Pw[last+1]; 00205 00206 i = first; 00207 j = last; 00208 ii = 1; 00209 jj = last - off; 00210 00211 while( j-i > t ) 00212 { 00213 alfi = (u-U[i])/(U[i+ord+t]-U[i]); 00214 alfj = (u-U[j-t])/(U[j+ord]-U[j-t]); 00215 temp[ii] = ((T)1/alfi)*(Pw[i]-((T)1-alfi)*temp[ii-1]); 00216 temp[jj] = ((T)1/((T)1-alfj))*(Pw[j]-alfj*temp[jj+1]); 00217 00218 i = i+1; 00219 j = j-1; 00220 ii = ii+1; 00221 jj = jj-1; 00222 } 00223 00224 i = first; 00225 j = last; 00226 00227 while( j-i > t ) 00228 { 00229 Pw[i] = temp[i-off]; 00230 Pw[j] = temp[j-off]; 00231 00232 i = i+1; 00233 j = j-1; 00234 } 00235 00236 first = first-1; 00237 last = last+1; 00238 } 00239 00240 for( k = r+1; k <= m; k++ ) 00241 U[k-t] = U[k]; 00242 00243 i = j = fout; 00244 00245 for( k = 1; k < t; k++ ) 00246 { 00247 if( k%2 ) 00248 i = i+1; 00249 else 00250 j = j-1; 00251 } 00252 00253 for( k = i+1; k <= n; k++, j++ ) 00254 { 00255 Pw[j] = Pw[k]; 00256 } 00257 00258 return; 00259 } |
|
|
|
|
|
|
|
|
|
Definition at line 57 of file gunu_knot_removal.cpp.
00060 { 00061 T u,alfi,alfj; 00062 int m,ord,fout,last,first,t,off,i,j,ii,jj,k; 00063 bool remflag; 00064 Ptr<HP> temp; 00065 00066 temp.reserve_pool(2*p+1); 00067 u = U[r]; 00068 00069 m = n+p+1; 00070 ord = p+1; 00071 00072 fout = (2*r - s - p)/2; 00073 last = r-s; 00074 first = r-p; 00075 00076 for( t = 0; t < num; t++ ) 00077 { 00078 off = first-1; 00079 temp[0] = Pw[off]; 00080 temp[last+1-off] = Pw[last+1]; 00081 00082 i = first; 00083 j = last; 00084 ii = 1; 00085 jj = last - off; 00086 remflag = false; 00087 00088 while( j-i > t ) 00089 { 00090 alfi = (u-U[i])/(U[i+ord+t]-U[i]); 00091 alfj = (u-U[j-t])/(U[j+ord]-U[j-t]); 00092 temp[ii] = ((T)1/alfi)*(Pw[i]-((T)1-alfi)*temp[ii-1]); 00093 temp[jj] = ((T)1/((T)1-alfj))*(Pw[j]-alfj*temp[jj+1]); 00094 00095 i = i+1; 00096 j = j-1; 00097 ii = ii+1; 00098 jj = jj-1; 00099 } 00100 00101 if( j-i < t ) 00102 { 00103 if( abs_equal(temp[ii-1], temp[jj+1], tol) ) 00104 remflag = true; 00105 } 00106 else 00107 { 00108 alfi = (u-U[i])/(U[i+ord+t]-U[i]); 00109 if( abs_equal( Pw[i], alfi*temp[ii+t+1] + ((T)1-alfi)*temp[ii-1], tol) ) 00110 remflag = true; 00111 } 00112 00113 if( !remflag ) 00114 break; 00115 00116 i = first; 00117 j = last; 00118 00119 while( j-i > t ) 00120 { 00121 Pw[i] = temp[i-off]; 00122 Pw[j] = temp[j-off]; 00123 00124 i = i+1; 00125 j = j-1; 00126 } 00127 00128 first = first-1; 00129 last = last+1; 00130 } 00131 00132 if( t == 0 ) 00133 return 0; 00134 00135 for( k = r+1; k <= m; k++ ) 00136 U[k-t] = U[k]; 00137 00138 i = j = fout; 00139 00140 for( k = 1; k < t; k++ ) 00141 { 00142 if( k%2 ) 00143 i = i+1; 00144 else 00145 j = j-1; 00146 } 00147 00148 for( k = i+1; k <= n; k++, j++ ) 00149 { 00150 Pw[j] = Pw[k]; 00151 } 00152 00153 return t; 00154 } |
|
|
|
|
|
Definition at line 524 of file gunu_knot_removal.cpp.
00533 { 00534 Ptr<int> R,S,QR,QS; 00535 Ptr<T> B,newerr; 00536 int i,mini,nK,r,s,k,ilo,ihi,dummi; 00537 T minB,N,alfa; 00538 bool removable; 00539 00540 S.reserve_pool(n-p); 00541 R.reserve_pool(n-p); 00542 B.reserve_pool(n-p); 00543 QR.reserve_pool(n+1); 00544 QS.reserve_pool(n+1); 00545 newerr.reserve_pool(nQ); 00546 00547 nK = GetMultiplicities(n,p,U,S,R); 00548 if( nK == 0 ) return n; // nothing to remove 00549 00550 // calc removal error factors for each distinct interior knot 00551 00552 minB = B[0] = RemovalError(R[0],S[0],n,p,U,Pw); 00553 mini = 0; 00554 00555 for( i = 1; i < nK; i++ ) 00556 { 00557 B[i] = RemovalError(R[i],S[i],n,p,U,Pw); 00558 if( B[i] <= minB ) 00559 { 00560 minB = B[i]; 00561 mini = i; 00562 } 00563 } 00564 00565 CalcParameterRanges(n,p,U,nQ,QU,QR,QS); 00566 00567 for(;;) 00568 { 00569 if( minB == rtr<T>::maximum() ) break; 00570 00571 r = R[mini]; 00572 s = S[mini]; 00573 00574 removable = true; 00575 00576 if( ((p+s)%2) == 0 ) 00577 { 00578 k = (p+s)/2; 00579 00580 for( i = QR[r-k]; i < QR[r-k]+QS[r-k]; i++ ) 00581 { 00582 N = CalcBasisFunction(p,r-k,QU[i],n,U); 00583 newerr[i] = N*minB + QE[i]; 00584 if( newerr[i] > tol ) 00585 { 00586 removable = false; 00587 B[mini] = rtr<T>::maximum(); 00588 break; 00589 } 00590 } 00591 if( removable ) 00592 { 00593 for( i = QR[r-k]; i < QR[r-k]+QS[r-k]; i++ ) 00594 QE[i] = newerr[i]; 00595 } 00596 } 00597 else 00598 { 00599 k = (p+s+1)/2; 00600 alfa = (U[r]-U[r-k+1])/(U[r-k+p+2]-U[r-k+1]); 00601 minB *= (T)1 - alfa; 00602 00603 for( i = QR[r-k+1]; i < QR[r-k+1]+QS[r-k+1]; i++ ) 00604 { 00605 N = CalcBasisFunction(p,r-k+1,QU[i],n,U); 00606 newerr[i] = N*minB + QE[i]; 00607 if( newerr[i] > tol ) 00608 { 00609 removable = false; 00610 B[mini] = rtr<T>::maximum(); 00611 break; 00612 } 00613 } 00614 if( removable ) 00615 { 00616 for( i = QR[r-k+1]; i < QR[r-k+1]+QS[r-k+1]; i++ ) 00617 QE[i] = newerr[i]; 00618 } 00619 } 00620 00621 if( removable ) 00622 { 00623 RemoveCurveKnot(1,r,s,n,p,U,Pw); 00624 00625 // U now contains the new knot vector 00626 n--; 00627 00628 // remove entries for removed knot/basis function 00629 00630 if( s == 1 ) 00631 { 00632 nK--; 00633 if( nK == 0 ) break; // no more internal knots 00634 00635 for( i = mini; i < nK; i++ ) 00636 { 00637 B[i] = B[i+1]; 00638 R[i] = R[i+1]-1; 00639 S[i] = S[i+1]; 00640 } 00641 } 00642 else 00643 { 00644 S[mini]--; 00645 00646 for( i = mini; i < nK; i++ ) 00647 R[i]--; 00648 } 00649 00650 // calculate changed 'Br' values: 00651 00652 // for these inner knots new span index = old span index: 00653 00654 i = mini-1; 00655 while( (i >= 0) && (R[i] >= r-p) ) 00656 { 00657 B[i] = RemovalError(R[i],S[i],n,p,U,Pw); 00658 i--; 00659 } 00660 00661 // for these inner knots new span index = old span index - 1: 00662 00663 i = mini; 00664 while( (i < nK) && (R[i] <= r+p-s) ) 00665 { 00666 B[i] = RemovalError(R[i],S[i],n,p,U,Pw); 00667 i++; 00668 } 00669 00670 // update parameter index ranges 00671 for( i = r-p-1; i <= r-s; i++ ) 00672 { 00673 if( QS[i] == 0 ) // if parameter range was empty for this basis func. 00674 { 00675 _BinarySearch(U[i],nQ,QU,&dummi,&ilo); 00676 QR[i] = ihi = ilo; 00677 } 00678 else 00679 ilo = ihi = QR[i]; 00680 00681 if( ilo < 0 ) continue; // still no points in this domain 00682 00683 while( QU[ihi] <= U[i+p+1] ) 00684 { 00685 ihi++; 00686 if( ihi >= nQ ) break; 00687 } 00688 ihi--; 00689 00690 // if not the last interval, skip last point if it is on 00691 // the interval end 00692 if( (i+p+1 <= n) && (QU[ihi] == U[i+p+1]) ) 00693 ihi--; 00694 00695 QS[i] = ihi-ilo+1; 00696 } 00697 00698 // remove parameter range entries for removed basis function 00699 00700 for( i = r; i <= n; i++ ) 00701 { 00702 QR[i] = QR[i+1]; 00703 QS[i] = QS[i+1]; 00704 } 00705 } 00706 00707 // search knot with smallest 'Br' 00708 mini = 0; 00709 minB = B[0]; 00710 for( i = 1; i < nK; i++ ) 00711 { 00712 if( B[i] <= minB ) 00713 { 00714 mini = i; 00715 minB = B[i]; 00716 } 00717 } 00718 00719 } 00720 00721 return n; 00722 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creates a surface of revolution.
Definition at line 196 of file gunu_revolve.cpp.
00206 { 00207 Ptr<T> U; 00208 T dtheta, wm, wj, angle, sines[5], cosines[5], r, dummy; 00209 int narcs, i, j, n, index; 00210 point<T> P0, T0, P1, P2, T2, X, Y, O; 00211 Ptr< Ptr< hpoint<T> > > Pwij; 00212 00213 if( theta <= rtr<T>::pi() / 2.0 ) narcs = 1; 00214 else if( theta <= rtr<T>::pi() ) narcs = 2; 00215 else if( theta <= (T)1.5 * rtr<T>::pi() ) narcs = 3; 00216 else narcs = 4; 00217 00218 dtheta = theta / ((T)narcs); 00219 00220 n = 2 * narcs; /* number of control points per row */ 00221 /* (rows = circles) */ 00222 U.reserve_pool(n+4); 00223 00224 Pwij.reserve_pool(m+1); 00225 for( i = 0; i <= m; i++ ) 00226 Pwij[i].reserve_pool(n+1); 00227 00228 wm = rtr<T>::cos( dtheta / (T)2 ); /* medium weight for circle segment */ 00229 00230 angle = (T)0; 00231 00232 for( i = 1; i <= narcs; i++ ) 00233 { 00234 angle += dtheta; 00235 cosines[i] = rtr<T>::cos(angle); 00236 sines[i] = rtr<T>::sin(angle); 00237 } 00238 for( j = 0; j <= m; j++ ) /* calc rows */ 00239 { 00240 wj = weight(Pwj[j]); /* j. control point of curve to P0 */ 00241 P0 = euclid(Pwj[j]); 00242 00243 O = ProjectToLine( S, A, P0 ); 00244 00245 X.x = P0.x - O.x; 00246 X.y = P0.y - O.y; 00247 X.z = P0.z - O.z; 00248 00249 r = normalize( &X, X ); 00250 Y = cross_product( A, X ); 00251 00252 Pwij[j][0] = Pwj[j]; /* first control point of row */ 00253 00254 T0 = Y; 00255 index = 0; 00256 angle = (T)0; 00257 00258 for( i = 1; i <= narcs; i++ ) /* remaining control points of row */ 00259 { 00260 P2.x = O.x + r*cosines[i]*X.x + r*sines[i]*Y.x; 00261 P2.y = O.y + r*cosines[i]*X.y + r*sines[i]*Y.y; 00262 P2.z = O.z + r*cosines[i]*X.z + r*sines[i]*Y.z; 00263 00264 Pwij[j][index+2].x = wj * P2.x; 00265 Pwij[j][index+2].y = wj * P2.y; 00266 Pwij[j][index+2].z = wj * P2.z; 00267 Pwij[j][index+2].w = wj; 00268 00269 T2.x = -sines[i]*X.x + cosines[i]*Y.x; 00270 T2.y = -sines[i]*X.y + cosines[i]*Y.y; 00271 T2.z = -sines[i]*X.z + cosines[i]*Y.z; 00272 00273 SVDIntersectLines( P0, T0, P2, T2, &dummy, &dummy, &P1 ); 00274 00275 Pwij[j][index+1].x = wm*wj*P1.x; 00276 Pwij[j][index+1].y = wm*wj*P1.y; 00277 Pwij[j][index+1].z = wm*wj*P1.z; 00278 Pwij[j][index+1].w = wm*wj; 00279 00280 index += 2; 00281 00282 if( i < narcs ) 00283 { 00284 P0 = P2; 00285 T0 = T2; 00286 } 00287 } 00288 } 00289 /* --- construct knot vector for rows ---------------------------- */ 00290 00291 j = 2 * narcs + 1; 00292 00293 for( i = 0; i < 3; i++ ) 00294 { 00295 U[i] = (T)0; 00296 U[i+j] = (T)1; 00297 } 00298 switch( narcs ) 00299 { 00300 case 2: 00301 U[3] = U[4] = (T)0.5; 00302 break; 00303 00304 case 3: 00305 U[3] = U[4] = (T)1 / (T)3; 00306 U[5] = U[6] = (T)2 / (T)3; 00307 break; 00308 00309 case 4: 00310 U[3] = U[4] = (T)0.25; 00311 U[5] = U[6] = (T)0.5; 00312 U[7] = U[8] = (T)0.75; 00313 break; 00314 } 00315 *ret_nu = n; 00316 *ret_pu = 2; 00317 *retU = U; 00318 *retPw = Pwij; 00319 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 46 of file gunu_divide.cpp.
00048 { 00049 int i,j,k,s,r,ir,n,n1,n2,p; 00050 T alpha; 00051 Ptr< T > U,U1,U2; 00052 Ptr< HP > P,R,NP,Q1,Q2; 00053 00054 p = Curve->p; 00055 n = Curve->cpt.n; 00056 P = Curve->cpt.Pw; 00057 U = Curve->knt.U; 00058 k = FindSpanMultip( u, n, p, U, &s ); 00059 r = p - s; 00060 00061 /* Speicher fuer Ausgabekurven C1,C2 reservieren */ 00062 00063 n1 = k - s; 00064 n2 = n + r - (k - s); 00065 00066 Q1.reserve_pool( n1+1 ); 00067 Q2.reserve_pool( n2+1 ); 00068 U1.reserve_pool( n1 + p + 2 ); 00069 U2.reserve_pool( n2 + p + 2 ); 00070 00071 C1->p = p; 00072 C1->cpt.n = n1; 00073 C1->cpt.Pw = Q1; 00074 C1->knt.m = n1 + p + 1; 00075 C1->knt.U = U1; 00076 00077 C2->p = p; 00078 C2->cpt.n = n2; 00079 C2->cpt.Pw = Q2; 00080 C2->knt.m = n2 + p + 1; 00081 C2->knt.U = U2; 00082 00083 /* Array fuer Hilfspunkte reservieren */ 00084 00085 R.reserve_place( reserve_stack(HP,p+1), p+1 ); 00086 if( p-s+r-1 > 0 ) NP.reserve_place( reserve_stack(HP, p-s+r-1), p-s+r-1 ); 00087 00088 for( i = 0; i <= p - s; i++ ) 00089 { 00090 R[i] = P[k - p + i]; 00091 } 00092 00093 for( ir = 1; ir <= r; ir++ ) 00094 { 00095 for( i = 0; i <= p - s - ir; i++ ) 00096 { 00097 alpha = (u - U[k-p+ir+i]) / (U[k+i+1] - U[k-p+ir+i]); 00098 00099 R[i] = (alpha * R[i+1]) + (((T)1.0 - alpha) * R[i]); 00100 } 00101 00102 NP[ir - 1] = R[0]; 00103 NP[p - s + r - 1 - ir] = R[p - s - ir]; 00104 } 00105 00106 for( i = 1; i < p - s - r; i++ ) 00107 { 00108 NP[r - 1 + i] = R[i]; 00109 } 00110 00111 for( i = 0; i <= k - p; i++ ) 00112 { 00113 Q1[i] = P[i]; 00114 } 00115 00116 for( i = 0; i <= p - s - 1; i++ ) 00117 { 00118 j = k - p + 1 + i; 00119 Q1[j] = NP[i]; 00120 } 00121 00122 for( i = p - s - 1; i <= p - s + r - 2; i++ ) 00123 { 00124 j = i - (p - s - 1); 00125 Q2[j] = NP[i]; 00126 } 00127 00128 for( i = k - s; i <= n; i++ ) 00129 { 00130 j = r + i - (k - s); 00131 Q2[j] = P[i]; 00132 } 00133 00134 /* Knotenvektoren der 2 Teilkurven bilden */ 00135 00136 for( i = 0; i < k - s + 1; i++ ) 00137 U1[i] = U[i]; 00138 for( i = 0; i <= p; i++ ) 00139 U1[k - s + 1 + i] = u; 00140 NormalizeKnotVector( n1, p, U1 ); 00141 00142 for( i = 0; i < n + p + 1 - k; i++ ) 00143 U2[p+1+i] = U[k+1+i]; 00144 for( i = 0; i <= p; i++ ) 00145 U2[i] = u; 00146 NormalizeKnotVector( n2, p, U2 ); 00147 } |
|
|
|
|
|
|
|
|
|
Definition at line 191 of file gunu_divide.cpp.
00195 { 00196 int nrows,ncols; 00197 int i,j,ir; 00198 int pu,pv; 00199 int nu,nv,nu1,nu2,nv1,nv2; 00200 int ku,kv,su,sv,ru,rv,col,row; 00201 00202 Ptr< T > U,V,U11,U12,U21,U22,V11,V12,V21,V22; 00203 Ptr< HP * > NR; 00204 Ptr< HP > NR_buf,R; 00205 Ptr< Ptr< HP > > NP,P,Q11,Q12,Q21,Q22; 00206 Ptr< Ptr< T > > alpha; 00207 00208 /* Lokale Notation: */ 00209 00210 pu = Surf->pu; 00211 pv = Surf->pv; 00212 nu = Surf->net.nu; 00213 nv = Surf->net.nv; 00214 P = Surf->net.Pw; 00215 U = Surf->knu.U; 00216 V = Surf->knv.U; 00217 00218 ku = FindSpanMultip( u, nu, pu, U, &su ); 00219 kv = FindSpanMultip( v, nv, pv, V, &sv ); 00220 ru = pu - su; 00221 rv = pv - sv; 00222 00223 /* Speicher fuer Ausgabeflaechen S11,S12,S21,S22 reservieren */ 00224 00225 nv1 = kv - sv; 00226 nv2 = nv + rv - (kv - sv); 00227 00228 Q11.reserve_pool( nv1 + 1 ); 00229 Q12.reserve_pool( nv1 + 1 ); 00230 Q21.reserve_pool( nv2 + 1 ); 00231 Q22.reserve_pool( nv2 + 1 ); 00232 00233 nu1 = ku - su; 00234 nu2 = nu + ru - (ku - su); 00235 00236 for( i = 0; i <= nv1; i++ ) 00237 { 00238 Q11[i].reserve_pool( nu1 + 1 ); 00239 Q12[i].reserve_pool( nu2 + 1 ); 00240 } 00241 for( i = 0; i <= nv2; i++ ) 00242 { 00243 Q21[i].reserve_pool( nu1 + 1 ); 00244 Q22[i].reserve_pool( nu2 + 1 ); 00245 } 00246 00247 U11.reserve_pool( nu1 + pu + 2 ); 00248 U21.reserve_pool( nu1 + pu + 2 ); 00249 U12.reserve_pool( nu2 + pu + 2 ); 00250 U22.reserve_pool( nu2 + pu + 2 ); 00251 00252 V11.reserve_pool( nv1 + pv + 2 ); 00253 V12.reserve_pool( nv1 + pv + 2 ); 00254 V21.reserve_pool( nv2 + pv + 2 ); 00255 V22.reserve_pool( nv2 + pv + 2 ); 00256 00257 S11->pu = pu; 00258 S11->pv = pv; 00259 S11->net.nu = nu1; 00260 S11->net.nv = nv1; 00261 S11->net.Pw = Q11; 00262 S11->knu.m = nu1 + pu + 1; 00263 S11->knu.U = U11; 00264 S11->knv.m = nv1 + pv + 1; 00265 S11->knv.U = V11; 00266 00267 S12->pu = pu; 00268 S12->pv = pv; 00269 S12->net.nu = nu2; 00270 S12->net.nv = nv1; 00271 S12->net.Pw = Q12; 00272 S12->knu.m = nu2 + pu + 1; 00273 S12->knu.U = U12; 00274 S12->knv.m = nv1 + pv + 1; 00275 S12->knv.U = V12; 00276 00277 S21->pu = pu; 00278 S21->pv = pv; 00279 S21->net.nu = nu1; 00280 S21->net.nv = nv2; 00281 S21->net.Pw = Q21; 00282 S21->knu.m = nu1 + pu + 1; 00283 S21->knu.U = U21; 00284 S21->knv.m = nv2 + pv + 1; 00285 S21->knv.U = V21; 00286 00287 S22->pu = pu; 00288 S22->pv = pv; 00289 S22->net.nu = nu2; 00290 S22->net.nv = nv2; 00291 S22->net.Pw = Q22; 00292 S22->knu.m = nu2 + pu + 1; 00293 S22->knu.U = U22; 00294 S22->knv.m = nv2 + pv + 1; 00295 S22->knv.U = V22; 00296 00297 /* Array fuer alphas reservieren */ 00298 00299 nrows = rv > ru ? rv : ru; 00300 ncols = pv > pu ? pv : pu; 00301 00302 alpha.reserve_place( reserve_stack(Ptr< T >,nrows), nrows ); 00303 for( i = 0; i < nrows; i++ ) 00304 alpha[i].reserve_place( reserve_stack(T,ncols), ncols ); 00305 00306 /* Array fuer Hilfspunkte reservieren */ 00307 00308 R.reserve_place( reserve_stack(HP,ncols+1), ncols+1 ); 00309 00310 NR.reserve_place( reserve_stack(HP*,nv+rv+1), nv+rv+1 ); 00311 for( i = 0; i <= kv - pv; i++ ) 00312 NR[i] = P[i].get(); 00313 for( i = kv - sv; i <= nv; i++ ) 00314 { 00315 j = rv + i; 00316 NR[j] = P[i].get(); 00317 } 00318 if( rv > 0 ) 00319 { 00320 NR_buf.reserve_place( reserve_stack(HP,(nu+1)*(pv-sv+rv-1)), 00321 (nu+1)*(pv-sv+rv-1) ); 00322 00323 for( i = 0; i < pv - sv + rv - 1; i++ ) 00324 { 00325 j = kv - pv + 1 + i; 00326 NR[j] = &NR_buf[i * (nu + 1)]; 00327 } 00328 } 00329 00330 if( ru > 0 ) 00331 { 00332 NP.reserve_place( reserve_stack(Ptr< HP >,nv+rv+1), nv+rv+1 ); 00333 for( i = 0; i < nv+rv+1; i++ ) 00334 NP[i].reserve_place( reserve_stack(HP,pu-su+ru-1), pu-su+ru-1 ); 00335 } 00336 00337 /* Alphas fuer V-Richtung berechnen: */ 00338 00339 for( ir = 1; ir <= rv; ir++ ) 00340 { 00341 for( i = kv - pv + ir; i <= kv - sv; i++ ) 00342 { 00343 alpha[ir - 1][i - (kv - pv + ir)] = 00344 (v - V[i]) / (V[i + pv - ir + 1] - V[i]); 00345 } 00346 } 00347 00348 /* Neue Kontrollpunkt-Zeilen berechnen, NR enthaelt nach Ausfuehrung 00349 neue + unveraenderte Zeilen */ 00350 00351 ncols = nu; 00352 00353 for( col = 0; col <= ncols; col++ ) 00354 { 00355 /* Hilfspunkte R initialisieren */ 00356 00357 for( i = 0; i <= pv - sv; i++ ) 00358 { 00359 R[i] = P[kv - pv + i][col]; 00360 } 00361 00362 for( ir = 1; ir <= rv; ir++ ) 00363 { 00364 for( i = 0; i <= pv - sv - ir; i++ ) 00365 { 00366 R[i] = (alpha[ir-1][i] * R[i+1]) + (((T)1.0 - alpha[ir-1][i]) * R[i]); 00367 } 00368 00369 NR[kv - pv + ir][col] = R[0]; 00370 NR[kv - sv + rv - ir][col] = R[pv - sv - ir]; 00371 } 00372 00373 for( i = 1; i < pv - sv - rv; i++ ) 00374 NR[kv - pv + rv + i][col] = R[i]; 00375 } 00376 00377 /* Neue Kontrollpunkte berechnen fuer jede Zeile row */ 00378 /* NP enthaelt nach Ausfuehrung die neu entstandenen Kontrollpunkte */ 00379 00380 /* Alphas berechnen: */ 00381 00382 for( ir = 1; ir <= ru; ir++ ) 00383 { 00384 for( i = ku - pu + ir; i <= ku - su; i++ ) 00385 { 00386 alpha[ir - 1][i - (ku - pu + ir)] = 00387 (u - U[i]) / (U[i + pu - ir + 1] - U[i]); 00388 } 00389 } 00390 00391 /* Neue Kontrollpunkte NP berechnen, fuer jede Zeile row */ 00392 00393 nrows = nv + rv; 00394 00395 for( row = 0; row <= nrows; row++ ) 00396 { 00397 /* Hilfspunkte R initialisieren */ 00398 00399 for( i = 0; i <= pu - su; i++ ) 00400 { 00401 R[i] = NR[row][ku - pu + i]; 00402 } 00403 00404 for( ir = 1; ir <= ru; ir++ ) 00405 { 00406 for( i = 0; i <= pu - su - ir; i++ ) 00407 { 00408 R[i] = (alpha[ir-1][i] * R[i+1]) + (((T)1.0 - alpha[ir-1][i]) * R[i]); 00409 } 00410 00411 NP[row][ir-1] = R[0]; 00412 NP[row][pu - su + ru - 1 - ir] = R[pu - su - ir]; 00413 } 00414 00415 for( i = 1; i < pu - su - ru; i++ ) 00416 NP[row][ru - 1 + i] = R[i]; 00417 } 00418 00419 /* Kontrollpunkt-Netze der 4 Teilflaechen bilden */ 00420 00421 for( row = 0; row <= kv - sv; row++ ) 00422 { 00423 for( i = 0; i <= ku - pu; i++ ) 00424 { 00425 Q11[row][i] = NR[row][i]; 00426 } 00427 00428 for( i = 0; i <= pu - su - 1; i++ ) 00429 { 00430 j = ku - pu + 1 + i; 00431 Q11[row][j] = NP[row][i]; 00432 } 00433 00434 for( i = pu - su - 1; i <= pu - su + ru - 2; i++ ) 00435 { 00436 j = i - (pu - su - 1); 00437 Q12[row][j] = NP[row][i]; 00438 } 00439 00440 for( i = ku - su; i <= nu; i++ ) 00441 { 00442 j = ru + i - (ku - su); 00443 Q12[row][j] = NR[row][i]; 00444 } 00445 } 00446 00447 for( row = kv - sv; row <= nv + rv; row++ ) 00448 { 00449 for( i = 0; i <= ku - pu; i++ ) 00450 { 00451 Q21[row - (kv - sv)][i] = NR[row][i]; 00452 } 00453 00454 for( i = 0; i <= pu - su - 1; i++ ) 00455 { 00456 j = ku - pu + 1 + i; 00457 Q21[row - (kv - sv)][j] = NP[row][i]; 00458 } 00459 00460 for( i = pu - su - 1; i <= pu - su + ru - 2; i++ ) 00461 { 00462 j = i - (pu - su - 1); 00463 Q22[row - (kv - sv)][j] = NP[row][i]; 00464 } 00465 00466 for( i = ku - su; i <= nu; i++ ) 00467 { 00468 j = ru + i - (ku - su); 00469 Q22[row - (kv - sv)][j] = NR[row][i]; 00470 } 00471 } 00472 00473 /* Knotenvektoren der 4 Teilflaechen bilden */ 00474 00475 for( i = 0; i < ku - su + 1; i++ ) 00476 U11[i] = U[i]; 00477 for( i = 0; i <= pu; i++ ) 00478 U11[ku - su + 1 + i] = u; 00479 NormalizeKnotVector( nu1, pu, U11 ); 00480 for( i = 0; i < ku - su + pu + 2; i++ ) 00481 U21[i] = U11[i]; 00482 00483 for( i = 0; i < nu + pu + 1 - ku; i++ ) 00484 U12[pu+1+i] = U[ku+1+i]; 00485 for( i = 0; i <= pu; i++ ) 00486 U12[i] = u; 00487 NormalizeKnotVector( nu2, pu, U12 ); 00488 for( i = 0; i < nu2 + pu + 2; i++ ) 00489 U22[i] = U12[i]; 00490 00491 00492 for( i = 0; i < kv - sv + 1; i++ ) 00493 V11[i] = V[i]; 00494 for( i = 0; i <= pv; i++ ) 00495 V11[kv - sv + 1 + i] = v; 00496 NormalizeKnotVector( nv1, pv, V11 ); 00497 for( i = 0; i < kv - sv + pv + 2; i++ ) 00498 V12[i] = V11[i]; 00499 00500 for( i = 0; i < nv + pv + 1 - kv; i++ ) 00501 V21[pv+1+i] = V[kv+1+i]; 00502 for( i = 0; i <= pv; i++ ) 00503 V21[i] = v; 00504 NormalizeKnotVector( nv2, pv, V21 ); 00505 for( i = 0; i < nv2 + pv + 2; i++ ) 00506 V22[i] = V21[i]; 00507 } |
|
Definition at line 403 of file gunu_intersect.cpp.
00406 { 00407 T scale,x,y,z; 00408 ListNode<line<T> > *in; 00409 00410 in = new ListNode<line<T> >; 00411 II->IS.Append(in); 00412 00413 scale = (T)1/II->scalei; 00414 00415 cnv2coord_rnd(S[0].x,&x); 00416 in->el.P1.x = x * scale + II->minx; 00417 cnv2coord_rnd(S[0].y,&y); 00418 in->el.P1.y = y * scale + II->miny; 00419 cnv2coord_rnd(S[0].z,&z); 00420 in->el.P1.z = z * scale + II->minz; 00421 00422 cnv2coord_rnd(S[1].x,&x); 00423 in->el.P2.x = x * scale + II->minx; 00424 cnv2coord_rnd(S[1].y,&y); 00425 in->el.P2.y = y * scale + II->miny; 00426 cnv2coord_rnd(S[1].z,&z); 00427 in->el.P2.z = z * scale + II->minz; 00428 } |
|
Definition at line 378 of file gunu_intersect.cpp.
00382 { 00383 ListNode<IntersectionLineInfo<T> > *in; 00384 T u,v; 00385 00386 in = new ListNode<IntersectionLineInfo<T> >; 00387 I.Append(in); 00388 cnv2coord_rnd(Suv[0].x,&u); 00389 in->el.Suv[0].x = u - (T)1; 00390 cnv2coord_rnd(Suv[0].y,&v); 00391 in->el.Suv[0].y = v - (T)1; 00392 cnv2coord_rnd(Suv[1].x,&u); 00393 in->el.Suv[1].x = u - (T)1; 00394 cnv2coord_rnd(Suv[1].y,&v); 00395 in->el.Suv[1].y = v - (T)1; 00396 in->el.Sflag[0] = Sflag[0]; 00397 in->el.Sflag[1] = Sflag[1]; 00398 } |
|
|
|
|
|
|
|
|
|
Definition at line 396 of file gunu_derivatives.cpp.
00402 { 00403 int i,j,k,l; 00404 EP v1,v2,vh; 00405 T w00; 00406 Ptr< Ptr < HP > > SKLh; 00407 00408 SKLh.reserve_place( reserve_stack(Ptr < HP >,d+1), d+1 ); 00409 for( i = 0; i < d+1; i++ ) 00410 SKLh[i].reserve_place( reserve_stack(HP,d+1), d+1 ); 00411 00412 BSPSurfaceDerivatives<T,HP>( u, v, nu, pu, U, nv, pv, V, Pw, d, SKLh ); 00413 00414 w00 = SKLh[0][0].w; 00415 00416 for( k = 0; k <= d; k++ ) 00417 { 00418 for( l = 0; l <= d-k; l++ ) 00419 { 00420 v1 = ortho( SKLh[k][l] ); 00421 00422 for( j = 1; j <= l; j++ ) 00423 { 00424 vh = (rtr<T>::BinCoeff(l,j) * SKLh[0][j].w) * SKL[k][l-j]; 00425 v1 = v1 - vh; 00426 } 00427 for( i = 1; i <= k; i++ ) 00428 { 00429 vh = (rtr<T>::BinCoeff(k,i) * SKLh[i][0].w) * SKL[k-i][l]; 00430 v1 = v1 - vh; 00431 00432 set( v2, (T)0.0 ); 00433 for( j = 1; j <= l; j++ ) 00434 { 00435 vh = (rtr<T>::BinCoeff(l,j) * SKLh[i][j].w) * SKL[k-i][l-j]; 00436 v2 = v2 + vh; 00437 } 00438 vh = rtr<T>::BinCoeff(k,i) * v2; 00439 v1 = v1 - vh; 00440 } 00441 SKL[k][l] = ((T)1.0 / w00) * v1; 00442 } 00443 } 00444 } |
|
|
|
|
|
executes the MBA algorithm and constructs a 3-dimensional surface from the results (x(),y() are identity mappings). when 'minimize' is set, the base rectangle in the xy-plane is chosen so that its area is minimal Definition at line 448 of file gunu_mba_approximate.cpp.
00456 { 00457 00458 T minx,maxx,miny,maxy,minz,maxz; 00459 Ptr< point<T> > mbaPoints; 00460 int ref_nu, ref_nv, mba_nu, mba_nv, nu, nv; 00461 int ref_pu, ref_pv, mba_pu, mba_pv, i, j; 00462 Ptr<T> refU, refV, mbaU, mbaV, U, V; 00463 Ptr< Ptr< point<T> > > refP, tmp1P, P; 00464 Ptr< Ptr< point1<T> > > mbaPz, tmp2P; 00465 Ptr<T> tmp1U, tmp1V, tmp2U, tmp2V; 00466 int tmp1_nu, tmp1_nv, tmp2_nu, tmp2_nv; 00467 int tmp1_pu, tmp1_pv, tmp2_pu, tmp2_pv; 00468 T x,y,z,ox,oy,sint,cost,theta; 00469 Ptr< Ptr<HP> > Pw; 00470 point<T> CP; 00471 00472 mbaPoints.reserve_pool(nDatPoints); 00473 00474 if( minimize != 0 ) 00475 { 00476 /* --- minimize area of base rectangle in xy-plane --------- */ 00477 00478 theta = MinimizeBBoxAboutZ( nDatPoints, datPoints, (T)1, 20 ); 00479 00480 sint = rtr<T>::sin(theta); 00481 cost = rtr<T>::cos(theta); 00482 00483 // 1. point: 00484 ox = datPoints[0].x; 00485 oy = datPoints[0].y; 00486 z = datPoints[0].z; 00487 minz = maxz = z; 00488 minx = maxx = x = cost * ox + sint * oy; 00489 miny = maxy = y = cost * oy - sint * ox; 00490 mbaPoints[0].x = x; 00491 mbaPoints[0].y = y; 00492 mbaPoints[0].z = z; 00493 00494 // remaining points: 00495 for( i = 1; i < nDatPoints; i++ ) 00496 { 00497 ox = datPoints[i].x; 00498 oy = datPoints[i].y; 00499 z = datPoints[i].z; 00500 x = cost * ox + sint * oy; 00501 y = cost * oy - sint * ox; 00502 00503 if( x < minx ) minx = x; 00504 else if( x > maxx ) maxx = x; 00505 if( y < miny ) miny = y; 00506 else if( y > maxy ) maxy = y; 00507 if( z < minz ) minz = z; 00508 else if( z > maxz ) maxz = z; 00509 00510 mbaPoints[i].x = x; 00511 mbaPoints[i].y = y; 00512 mbaPoints[i].z = z; 00513 } 00514 // normalise coordinates: 00515 for( i = 0; i < nDatPoints; i++ ) 00516 { 00517 mbaPoints[i].x = (mbaPoints[i].x - minx) / (maxx-minx); 00518 if( mbaPoints[i].x < (T)0 ) mbaPoints[i].x = (T)0; 00519 else if( mbaPoints[i].x > (T)1 ) mbaPoints[i].x = (T)1; 00520 mbaPoints[i].y = (mbaPoints[i].y - miny) / (maxy-miny); 00521 if( mbaPoints[i].y < (T)0 ) mbaPoints[i].y = (T)0; 00522 else if( mbaPoints[i].y > (T)1 ) mbaPoints[i].y = (T)1; 00523 mbaPoints[i].z = (mbaPoints[i].z - minz) / (maxz-minz); 00524 } 00525 } 00526 else 00527 { 00528 /* --- do not minimize area of base rectangle in xy-plane --------- */ 00529 00530 CalcBoundingBoxE( nDatPoints, datPoints, 00531 minx, maxx, miny, maxy, minz, maxz ); 00532 // normalise coordinates: 00533 for( i = 0; i < nDatPoints; i++ ) 00534 { 00535 mbaPoints[i].x = (datPoints[i].x - minx) / (maxx-minx); 00536 if( mbaPoints[i].x < (T)0 ) mbaPoints[i].x = (T)0; 00537 else if( mbaPoints[i].x > (T)1 ) mbaPoints[i].x = (T)1; 00538 mbaPoints[i].y = (datPoints[i].y - miny) / (maxy-miny); 00539 if( mbaPoints[i].y < (T)0 ) mbaPoints[i].y = (T)0; 00540 else if( mbaPoints[i].y > (T)1 ) mbaPoints[i].y = (T)1; 00541 mbaPoints[i].z = (datPoints[i].z - minz) / (maxz-minz); 00542 } 00543 } 00544 /* ------ do the MBA-Algorithm: ------------------------------------ */ 00545 00546 // reserve return arrays 00547 mba_nu = pu + (1<<(nIter-1)) - 1; 00548 mbaU.reserve_pool( 2*pu + (1<<(nIter-1)) + 1 ); 00549 mba_nv = pv + (1<<(nIter-1)) - 1; 00550 mbaV.reserve_pool( 2*pv + (1<<(nIter-1)) + 1 ); 00551 mbaPz.reserve_pool(mba_nv+1); 00552 Pw.reserve_pool(mba_nv+1); 00553 for( i = 0; i < mba_nv+1; i++ ) 00554 { 00555 mbaPz[i].reserve_pool(mba_nu+1); 00556 Pw[i].reserve_pool(mba_nu+1); 00557 } 00558 MBAapproximate<T>( nDatPoints, mbaPoints, useStdDevs, StdDevs, 00559 nIter, pu, pv, mbaU, mbaV, mbaPz ); 00560 00561 /* ---- construct a 3d return surface: --------------------------------- */ 00562 00563 // build a bilinear basis surface 00564 refU.reserve_pool(4); 00565 for( i = 0; i < 2; i++ ) 00566 { 00567 refU[i] = (T)0; 00568 refU[i+2] = (T)1; 00569 } 00570 refV = refU; 00571 ref_nu = 1; 00572 ref_pu = 1; 00573 ref_nv = 1; 00574 ref_pv = 1; 00575 00576 refP.reserve_pool(2); 00577 refP[0].reserve_pool(2); 00578 refP[1].reserve_pool(2); 00579 00580 refP[0][0].x = (T)0; refP[0][0].y = (T)0; refP[0][0].z = (T)0; 00581 refP[0][1].x = (T)1; refP[0][1].y = (T)0; refP[0][1].z = (T)0; 00582 refP[1][0].x = (T)0; refP[1][0].y = (T)1; refP[1][0].z = (T)0; 00583 refP[1][1].x = (T)1; refP[1][1].y = (T)1; refP[1][1].z = (T)0; 00584 00585 /* --- make base surface and surface created by MBA compatible ------ */ 00586 00587 MakeSurfacesCompatible<T,point1<T>,point<T> >( 00588 mba_nu, pu, mbaU, mba_nv, pv, mbaV, mbaPz, 00589 ref_nu, ref_pu, refU, ref_nv, ref_pv, refV, refP, 00590 gul::v_direction, 00591 &tmp2_nu, &tmp2_pu, &tmp2U, &tmp2_nv, &tmp2_pv, &tmp2V, &tmp2P, 00592 &tmp1_nu, &tmp1_pu, &tmp1U, &tmp1_nv, &tmp1_pv, &tmp1V, &tmp1P ); 00593 00594 MakeSurfacesCompatible<T,point1<T>,point<T> >( 00595 tmp2_nu, tmp2_pu, tmp2U, tmp2_nv, tmp2_pv, tmp2V, tmp2P, 00596 tmp1_nu, tmp1_pu, tmp1U, tmp1_nv, tmp1_pv, tmp1V, tmp1P, 00597 gul::u_direction, 00598 &mba_nu, &mba_pu, &mbaU, &mba_nv, &mba_pv, &mbaV, &mbaPz, 00599 &nu, &pu, &U, &nv, &pv, &V, &P ); 00600 00601 /* set z-coordinate of result surface control points: */ 00602 00603 for( j = 0; j <= nv; j++ ) 00604 for( i = 0; i <= nu; i++ ) 00605 P[j][i].z = mbaPz[j][i].x; 00606 00607 /* denormalise control points: */ 00608 00609 for( j = 0; j <= nv; j++ ) 00610 for( i = 0; i <= nu; i++ ) 00611 { 00612 CP.x = (P[j][i].x * (maxx-minx)) + minx; 00613 CP.y = (P[j][i].y * (maxy-miny)) + miny; 00614 CP.z = (P[j][i].z * (maxz-minz)) + minz; 00615 Pw[j][i] = CP; 00616 } 00617 00618 if( minimize != 0 ) 00619 { 00620 /* --- rotate surface to the original orientation ------------------ */ 00621 00622 sint = rtr<T>::sin(-theta); 00623 cost = rtr<T>::cos(-theta); 00624 00625 for( j = 0; j <= nv; j++ ) 00626 for( i = 0; i <= nu; i++ ) 00627 { 00628 ox = Pw[j][i].x; 00629 oy = Pw[j][i].y; 00630 00631 x = cost * ox + sint * oy; 00632 y = cost * oy - sint * ox; 00633 00634 Pw[j][i].x = x; 00635 Pw[j][i].y = y; 00636 } 00637 } 00638 00639 /* ready: */ 00640 00641 *ret_nu = nu; 00642 *retU = U; 00643 *ret_nv = nv; 00644 *retV = V; 00645 *retPw = Pw; 00646 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 403 of file gunu_basics.cpp.
00408 { 00409 Ptr< T > Nu,Nv; 00410 int uspan,vspan,uind,vind,l,k; 00411 HP S,temp,v1; 00412 00413 Nu.reserve_place( reserve_stack(T,pu+1), pu+1 ); 00414 Nv.reserve_place( reserve_stack(T,pv+1), pv+1 ); 00415 00416 uspan = FindSpan( u, nu, pu, U ); 00417 CalcBasisFunctions( u, uspan, pu, U, Nu ); 00418 00419 vspan = FindSpan( v, nv, pv, V ); 00420 CalcBasisFunctions( v, vspan, pv, V, Nv ); 00421 00422 uind = uspan-pu; 00423 set( S, (T)0.0 ); 00424 for( l = 0; l <= pv; l++ ) 00425 { 00426 set( temp, (T)0.0 ); 00427 vind = vspan - pv + l; 00428 for( k = 0; k <= pu; k++ ) 00429 { 00430 v1 = Nu[k] * Pw[vind][uind+k]; /* meine Kontrollpunktmatrix ist falschrum, 00431 muss daher transponiert werden */ 00432 temp = temp + v1; 00433 } 00434 v1 = Nv[l] * temp; 00435 S = S + v1; 00436 } 00437 *retS = euclid( S ); 00438 } |
|
|
|
|
|
|
|
|
|
Definition at line 210 of file gunu_tesselate.cpp.
00211 { 00212 gul::point<T> P00,P01,P10,P11,T00,T01,T10,T11; 00213 int nu,nv,pu,pv; 00214 TessCbData<T> *cb = (TessCbData<T> *)usrdata; 00215 00216 P00 = A->org->P00; 00217 P01 = A->org->P01; 00218 P10 = A->org->P10; 00219 P11 = A->org->P11; 00220 00221 if( cb->need_normals == 0 ) 00222 { 00223 cb->quadfunc( cb->usrdata, 00224 &P00, &P01, &P10, &P11, NULL, NULL, NULL, NULL, 00225 NULL, NULL, NULL, NULL ); 00226 } 00227 else /* Calc Normals */ 00228 { 00229 nu = A->org->nu; 00230 pu = A->org->pu; 00231 nv = A->org->nv; 00232 pv = A->org->pv; 00233 Ptr< Ptr < HP > >& Pw = A->org->Pw; 00234 00235 CalcNormal_U0V0<T>( nu, pu, nv, pv, Pw, &T00 ); 00236 CalcNormal_U1V0<T>( nu, pu, nv, pv, Pw, &T01 ); 00237 CalcNormal_U0V1<T>( nu, pu, nv, pv, Pw, &T10 ); 00238 CalcNormal_U1V1<T>( nu, pu, nv, pv, Pw, &T11 ); 00239 00240 cb->quadfunc( cb->usrdata, &P00, &P01, &P10, &P11, 00241 &T00, &T01, &T10, &T11, &A->u1, &A->u2, &A->v1, &A->v2 ); 00242 } 00243 } |
|
|
|
|
|
|
|
|
|
Definition at line 336 of file gunu_tesselate.cpp.
00338 { 00339 gugr::triangle_list Tri; 00340 gugr::triangle *tri,*tri_next; 00341 TessCbData<T> *cb = (TessCbData<T> *)data; 00342 point<T> T00,T01,T10,T11; 00343 vertex_convert_cache<T> *c1,*c2,*c3; 00344 00345 const point<T>& P00 = A->org->P00; 00346 const point<T>& P01 = A->org->P01; 00347 const point<T>& P10 = A->org->P10; 00348 const point<T>& P11 = A->org->P11; 00349 const int& nu = A->org->nu; 00350 const int& pu = A->org->pu; 00351 const int& nv = A->org->nv; 00352 const int& pv = A->org->pv; 00353 Ptr< Ptr< HP > >& Pw = A->org->Pw; 00354 00355 const T& orgx = Gconv->minx; 00356 const T& orgy = Gconv->miny; 00357 const T& scale = Gconv->scale; 00358 00359 const T& u0 = A->u1; 00360 const T& u1 = A->u2; 00361 const T& v0 = A->v1; 00362 const T& v1 = A->v2; 00363 00364 bool normals = cb->need_normals; 00365 void *usrdata = cb->usrdata; 00366 00367 T w = u1-u0; // width of quad (u) 00368 T h = v1-v0; // height of quad (v) 00369 T a = w*h; // area of quad 00370 00371 /* 00372 cout << "before insertion of diagonal\n"; 00373 cout << "***************************\n"; 00374 gugr::Dump<T>::dump_vertices( G->V.head ); 00375 gugr::Dump<T>::dump_edges( G->E.head ); 00376 */ 00377 00378 gugr::InsertDiagonal( &(G->E), &(G->V), G->P[0][0], G->P[1][1] ); 00379 00380 /* 00381 cout << "after insertion of diagonal\n"; 00382 cout << "***************************\n"; 00383 gugr::Dump<T>::dump_vertices( G->V.head ); 00384 gugr::Dump<T>::dump_edges( G->E.head ); 00385 */ 00386 00387 gugr::Regularize( &(G->E), &(G->V) ); 00388 00389 /* 00390 cout << "after regularization\n"; 00391 cout << "***************************\n"; 00392 gugr::Dump<T>::dump_vertices( G->V.head ); 00393 gugr::Dump<T>::dump_edges( G->E.head ); 00394 */ 00395 00396 gugr::Triangulate( &(G->E), &(G->V), Gconv->FarMinX, &Tri ); 00397 // Tri.DeleteElems(); 00398 00399 if( normals ) /* calc Normals */ 00400 { 00401 CalcNormal_U0V0<T>( nu, pu, nv, pv, Pw, &T00 ); 00402 CalcNormal_U1V0<T>( nu, pu, nv, pv, Pw, &T01 ); 00403 CalcNormal_U0V1<T>( nu, pu, nv, pv, Pw, &T10 ); 00404 CalcNormal_U1V1<T>( nu, pu, nv, pv, Pw, &T11 ); 00405 } 00406 00407 tri = Tri.head; 00408 while( tri != 0 ) 00409 { 00410 if( tri->v[0].m_rep->reserved.p == 0 ) 00411 c1 = FillVertexCache( 00412 tri->v[0].m_rep, tri->code0, normals, orgx, orgy, scale, 00413 u0, v0, w, h, a, P00, P01, P10, P11, T00, T01, T10, T11 ); 00414 else 00415 c1 = (vertex_convert_cache<T> *)tri->v[0].m_rep->reserved.p; 00416 00417 if( tri->v[1].m_rep->reserved.p == 0 ) 00418 c2 = FillVertexCache( 00419 tri->v[1].m_rep, tri->code1, normals, orgx, orgy, scale, 00420 u0, v0, w, h, a, P00, P01, P10, P11, T00, T01, T10, T11 ); 00421 else 00422 c2 = (vertex_convert_cache<T> *)tri->v[1].m_rep->reserved.p; 00423 00424 if( tri->v[2].m_rep->reserved.p == 0 ) 00425 c3 = FillVertexCache( 00426 tri->v[2].m_rep, tri->code2, normals, orgx, orgy, scale, 00427 u0, v0, w, h, a, P00, P01, P10, P11, T00, T01, T10, T11 ); 00428 else 00429 c3 = (vertex_convert_cache<T> *)tri->v[2].m_rep->reserved.p; 00430 00431 /* 00432 cout << "(" << c1->d.x << ", " << c1->d.y << ") (" << 00433 c2->d.x << ", " << c2->d.y << ") (" << 00434 c3->d.x << ", " << c3->d.y << ")\n"; 00435 */ 00436 00437 cb->trifunc( usrdata, &c1->p, &c2->p, &c3->p, &c1->n, &c2->n, &c3->n, 00438 &c1->d, &c2->d, &c3->d ); 00439 tri = tri->next; 00440 } 00441 tri = Tri.First(); 00442 Tri.ReleaseElems(); 00443 while( tri != 0 ) // delete vertex_convert_caches 00444 { 00445 delete ((vertex_convert_cache<T> *)tri->v[0].m_rep->reserved.p); 00446 tri->v[0].m_rep->reserved.p = 0; 00447 delete ((vertex_convert_cache<T> *)tri->v[1].m_rep->reserved.p); 00448 tri->v[1].m_rep->reserved.p = 0; 00449 delete ((vertex_convert_cache<T> *)tri->v[2].m_rep->reserved.p); 00450 tri->v[2].m_rep->reserved.p = 0; 00451 00452 tri_next = tri->next; 00453 delete tri; // delete triangle rec; 00454 tri = tri_next; 00455 } 00456 } |
|
|
|
|
|
Definition at line 320 of file gunu_basics.cpp.
00321 { 00322 int segs,i; 00323 T seglen; 00324 00325 for( i = 0; i <= p; i++ ) 00326 { 00327 U[i] = 0.; 00328 U[n+1+i] = 1.; 00329 } 00330 00331 segs = n-p+1; 00332 seglen = (T)1. / ((T)segs); 00333 for( i = p+1; i <= n; i++ ) 00334 { 00335 // U[i] = U[i-1] + seglen; 00336 U[i] = U[p] + seglen*(T)(i-p); 00337 } 00338 } |
|
|
|
|
|
Creates a unit sphere (centered at origin).
Definition at line 408 of file gunu_revolve.cpp.
00412 { 00413 point<T> O,X,Y,S,A; 00414 T r; 00415 Ptr<T> U,V; 00416 Ptr< hpoint<T> > Cw; 00417 Ptr< Ptr< hpoint<T> > > Pw; 00418 int nu,nv,pu,pv; 00419 00420 O.x = (T)0.0; O.y = (T)0.0; O.z = (T)0.0; 00421 Y.x = (T)0.0; Y.y = (T)1.0; Y.z = (T)0.0; 00422 X.x = (T)1.0; X.y = (T)0.0; X.z = (T)0.0; 00423 r = (T)1.0; 00424 00425 Circle( O, X, Y, r, (T)0, rtr<T>::pi(), &nv, &pv, &V, &Cw ); 00426 00427 /* create rotation surface: */ 00428 S.x = (T)0.0; S.y = (T)0.0; S.z = (T)0.0; 00429 A.x = (T)1.0; A.y = (T)0.0; A.z = (T)0.0; 00430 00431 Revolution( S, A, (T)2*rtr<T>::pi(), nv, Cw, &nu, &pu, &U, &Pw ); 00432 00433 *ret_nu = nu; 00434 *ret_pu = pu; 00435 *retU = U; 00436 *ret_nv = nv; 00437 *ret_pv = pv; 00438 *retV = V; 00439 *retPw = Pw; 00440 } |
|
|
|
|
|
Definition at line 153 of file gunu_basics.cpp.
00155 { 00156 int m, multi, i; 00157 bool clamped0=false, clamped1=false; 00158 T u; 00159 00160 m = knt.nElems() - 1; 00161 if( m != n+p+1 ) return false; 00162 00163 u = knt[0]; 00164 multi = 1; 00165 for( i = 1; i <= m; i++ ) 00166 { 00167 if( knt[i] < knt[i-1] ) 00168 return false; // knots must be increasing 00169 00170 if( knt[i] == u ) 00171 multi++; 00172 else 00173 { 00174 u = knt[i]; 00175 multi = 1; 00176 } 00177 00178 if( multi > p ) 00179 { 00180 if( multi == p+1 ) 00181 { 00182 if( i == p ) 00183 { 00184 clamped0 = true; 00185 continue; 00186 } 00187 if( i == m ) 00188 { 00189 clamped1 = true; 00190 continue; 00191 } 00192 } 00193 return false; 00194 } 00195 } 00196 00197 is_clamped = clamped0 && clamped1; 00198 is_normalized = ((knt[p] == (T)0.0) && (knt[n+1] == (T)1.0)); 00199 00200 return true; 00201 } |
|
Definition at line 403 of file gunu_mba_approximate.cpp. |
|
Definition at line 402 of file gunu_mba_approximate.cpp. |