00001 00012 #ifndef __SPLINE_H__ 00013 #define __SPLINE_H__ 00014 00015 #include <surface.h> 00016 #include <b_spline.h> 00017 #include <generator/oct_gen.h> 00018 00022 class Spline : public Surface { 00023 public: 00029 Spline(BSpline bSpline, OctGen* generator); 00030 00034 virtual ~Spline(); 00035 00040 void addToOctree(Color color); 00041 00042 virtual Hight getHight(); 00043 00044 virtual bool isIn(GeomPoint p); 00045 00046 virtual void setHight(Hight h); 00047 00048 virtual bool testLine(GeomPoint p, GeomPoint &q, 00049 bool &intersect, bool &inside); 00050 00054 virtual void print(); 00055 00056 private: 00060 typedef BSpline::EXTENT EXTENT; 00061 00069 void basisFuns(EXTENT axis, int i, Coordinate u, Coordinate N[]); 00070 00081 bool chkSplinePart(GeomPoint p, 00082 GeomPoint &q, bool &intersect, bool &inside); 00083 00090 int findSpan(EXTENT axis, Coordinate u); 00091 00097 GeomPoint getCP(int m_idx, int n_idx); 00098 00107 NodeIndex getFaceIndex(Coordinate u, Coordinate v); 00108 00117 GeomPoint getFacePoint(Coordinate u, Coordinate v); 00118 00124 AxIndex getGranulty(EXTENT axis); 00125 00129 OctGen* gen; 00130 00134 Hight h; 00135 00139 BSpline spl; 00140 00141 }; 00142 00143 #endif // ! __SPLINE_H__