00001 #include "nurbs.cpp"
00002
00003 namespace PLib {
00004
00005
00006
00007 template <>
00008 Point_nD<float,2> NurbsCurve<float,2>::normal(float u, const Point_nD<float,2>& v) const{
00009 cerr << "YOU CAN'T COMPUTE THE NORMAL in 2D of a 2D vector!\n" ;
00010 return firstDn(u) ;
00011 }
00012
00013 template <>
00014 void NurbsCurve<float,2>::makeCircle(const Point_nD<float,2>& O, float r, double as, double ae){
00015 makeCircle(O,Point_nD<float,2>(1,0),Point_nD<float,2>(0,1),r,as,ae) ;
00016 }
00017
00018 template <>
00019 int NurbsCurve<float,2>::writeVRML(const char* filename,float radius,int K, const Color& color,int Nu,int Nv, float u_s, float u_e) const{
00020 NurbsCurve<float,3> C ;
00021 to3D(*this,C) ;
00022 return C.writeVRML(filename,radius,K,color,Nu,Nv,u_s,u_e) ;
00023 }
00024
00025 template <>
00026 int NurbsCurve<float,2>::writeVRML97(const char* filename,float radius,int K, const Color& color,int Nu,int Nv, float u_s, float u_e) const{
00027 NurbsCurve<float,3> C ;
00028 to3D(*this,C) ;
00029 return C.writeVRML97(filename,radius,K,color,Nu,Nv,u_s,u_e) ;
00030 }
00031
00032 template <>
00033 int NurbsCurve<float,2>::writeVRML(ostream& fout,float radius,int K, const Color& color,int Nu,int Nv, float u_s, float u_e) const{
00034 NurbsCurve<float,3> C ;
00035 to3D(*this,C) ;
00036 return C.writeVRML(fout,radius,K,color,Nu,Nv,u_s,u_e) ;
00037 }
00038
00039 template <>
00040 int NurbsCurve<float,2>::writeVRML97(ostream& fout,float radius,int K, const Color& color,int Nu,int Nv, float u_s, float u_e) const{
00041 NurbsCurve<float,3> C ;
00042 to3D(*this,C) ;
00043 return C.writeVRML97(fout,radius,K,color,Nu,Nv,u_s,u_e) ;
00044 }
00045
00046 template <>
00047 void NurbsCurve<float,2>::drawAaImg(Image_Color& Img, const Color& color, int precision, int alpha){
00048 NurbsCurve<float,3> C ;
00049 to3D(*this,C) ;
00050 C.drawAaImg(Img,color,precision,alpha) ;
00051 }
00052
00053
00054 #ifdef NO_IMPLICIT_TEMPLATES
00055
00056 template class NurbsCurve<float,3>;
00057 template class OpLengthFcn<float,3>;
00058
00059
00060 template float chordLengthParam(const Vector< Point_nD<float,3> >& Q, Vector<float> &ub);
00061 template float chordLengthParamH(const Vector< HPoint_nD<float,3> >& Q, Vector<float> &ub);
00062 template float chordLengthParamClosed(const Vector< Point_nD<float,3> >& Q, Vector<float> &ub, int deg);
00063 template float chordLengthParamClosedH(const Vector< HPoint_nD<float,3> >& Q, Vector<float> &ub, int deg);
00064 template void binomialCoef(Matrix<float>& Bin) ;
00065 template Vector<float> knotUnion(const Vector<float>& Ua, const Vector<float>& Ub);
00066 template float nurbsBasisFun(float u, int i, int p, const Vector<float>& U) ;
00067 template void nurbsBasisFuns(float u, int span, int deg, const Vector<float>& U, Vector<float>& N);
00068 template void nurbsDersBasisFuns(int n, float u, int span, int deg, const Vector<float>& U, Matrix<float>& ders) ;
00069 template int intersectLine(const Point_nD<float,3>& p1, const Point_nD<float,3>& t1, const Point_nD<float,3>& p2, const Point_nD<float,3>& t2, Point_nD<float,3>& p);
00070 template void knotAveraging(const Vector<float>& uk, int deg, Vector<float>& U) ;
00071 template void knotAveragingClosed(const Vector<float>& uk, int deg, Vector<float>& U) ;
00072 template void averagingKnots(const Vector<float>& U, int deg, Vector<float>& uk);
00073 template int findSpan(float u, const Vector<float>& U, int deg);
00074
00075 template int maxInfluence(int i, const Vector<float>& U, int p, float &u);
00076
00077 template void generateCompatibleCurves(NurbsCurveArray<float,3> &ca);
00078
00079 template void knotApproximationClosed( Vector<float>& U, const Vector<float>& ub, int n, int p);
00080
00081 template void wrapPointVector(const Vector<Point_nD<float,3> >& Q, int d, Vector<Point_nD<float,3> >& Qw);
00082 template void wrapPointVectorH(const Vector<HPoint_nD<float,3> >& Q, int d, Vector<HPoint_nD<float,3> >& Qw);
00083
00084
00085 template class NurbsCurve<float,2> ;
00086 template class OpLengthFcn<float,2>;
00087
00088 template float chordLengthParam(const Vector< Point_nD<float,2> >& Q, Vector<float> &ub);
00089 template float chordLengthParamH(const Vector< HPoint_nD<float,2> >& Q, Vector<float> &ub);
00090 template float chordLengthParamClosed(const Vector< Point_nD<float,2> >& Q, Vector<float> &ub, int deg);
00091 template float chordLengthParamClosedH(const Vector< HPoint_nD<float,2> >& Q, Vector<float> &ub, int deg);
00092 template int intersectLine(const Point_nD<float,2>& p1, const Point_nD<float,2>& t1, const Point_nD<float,2>& p2, const Point_nD<float,2>& t2, Point_nD<float,2>& p);
00093
00094 template void generateCompatibleCurves(NurbsCurveArray<float,2> &ca);
00095
00096 template void wrapPointVector(const Vector<Point_nD<float,2> >& Q, int d, Vector<Point_nD<float,2> >& Qw);
00097 template void wrapPointVectorH(const Vector<HPoint_nD<float,2> >& Q, int d, Vector<HPoint_nD<float,2> >& Qw);
00098
00099
00100
00101 template void to3D(const NurbsCurve<float,2>&, NurbsCurve<float,3>&);
00102 template void to3D(const NurbsCurve<float,3>&, NurbsCurve<float,3>&);
00103 template void to2D(const NurbsCurve<float,3>&, NurbsCurve<float,2>&);
00104
00105
00106
00107
00108
00109 #endif
00110
00111 }
00112