00001 00012 #ifndef __B_SPLINE_H__ 00013 #define __B_SPLINE_H__ 00014 00015 #include <face.h> 00016 #include <point.h> 00017 00018 #include <vector> 00019 00023 #define DEGREE 3 00024 00028 class BSpline : public Face { 00029 public: 00033 enum EXTENT { M_DIR= 0, 00034 N_DIR= 1 00035 }; 00036 00044 BSpline(int m_count, bool pMeshClosedM, int n_count, bool pMeshClosedN); 00045 00049 virtual ~BSpline(); 00050 00055 void addCP(Point p); 00056 00062 Point getControlPoint(int m_idx, int n_idx); 00063 00070 int getCount(EXTENT axis); 00071 00076 virtual const DataType getDataType(); 00077 00084 int getKnot(EXTENT axis, int n_idx); 00085 00091 int getKnotCount(EXTENT axis); 00092 00098 int getKnotMax(EXTENT axis); 00099 00105 int getKnotMin(EXTENT axis); 00106 00114 virtual Point getMaxPoint(); 00115 00123 virtual Point getMinPoint(); 00124 00130 bool isClosed(EXTENT axis); 00131 00135 virtual void print(); 00136 00137 private: 00142 typedef vector<Point> CPContainer; 00143 00147 bool closedM; 00148 00152 bool closedN; 00153 00157 CPContainer controlPoints; 00158 00162 int countM; 00163 00167 int countN; 00168 00169 }; 00170 00171 #endif // ! __BSPLINE_H__