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