00001 //=========================================================================== 00002 // GoTools - SINTEF Geometry Tools version 1.1 00003 // 00004 // GoTools module: CORE 00005 // 00006 // Copyright (C) 2000-2007 SINTEF ICT, Applied Mathematics, Norway. 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation version 2 of the License. 00011 // 00012 // This program is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this program; if not, write to the Free Software 00019 // Foundation, Inc., 00020 // 59 Temple Place - Suite 330, 00021 // Boston, MA 02111-1307, USA. 00022 // 00023 // Contact information: E-mail: tor.dokken@sintef.no 00024 // SINTEF ICT, Department of Applied Mathematics, 00025 // P.O. Box 124 Blindern, 00026 // 0314 Oslo, Norway. 00027 // 00028 // Other licenses are also available for this software, notably licenses 00029 // for: 00030 // - Building commercial software. 00031 // - Building software whose source code you wish to keep private. 00032 //=========================================================================== 00033 #ifndef _GOHERMITEGRID1DMULTI_H_ 00034 #define _GOHERMITEGRID1DMULTI_H_ 00035 00036 #include <vector> 00037 #include "Point.h" 00038 00039 namespace Go 00040 { 00043 00044 00045 class EvalCurveSet; 00046 00051 00052 class HermiteGrid1DMulti 00053 { 00054 public: 00064 HermiteGrid1DMulti(EvalCurveSet& surf, double start, double end, std::vector<int> dims); 00065 00076 HermiteGrid1DMulti(EvalCurveSet& surf, double param[], int n, std::vector<int> dims); 00077 00079 ~HermiteGrid1DMulti(); 00080 00086 int addKnot(EvalCurveSet& surf, double knot); 00087 00099 void getSegment(int left, int right, double& spar, 00100 double& epar, std::vector<std::vector<Point> >& bezcoef); 00101 00103 std::vector<double> getKnots() 00104 { return knots_; } 00105 00107 std::vector<std::vector<Point> > getData() { return array_; } 00108 00110 int dims(int ki) { return dims_[ki]; } 00111 00113 int size() {return MM_;} 00114 00115 private: 00116 std::vector<double> knots_; // Sorted array of DISTINCT parameters of curve 00117 std::vector<std::vector<Point> > array_; // Array holding position, and 00118 // directional derivative 00119 std::vector<int> dims_; // Spatial dimension of positions, 00120 int MM_; // Number of grid points 00121 int elem_size_; // Number of Point stored for each 00122 // grid point (typically 2: pt, der) 00123 int index_; // Index into knot array 00124 00125 00126 int getPosition(double knot); 00127 00128 }; 00129 00131 } // namespace Go 00132 00133 #endif //_GOHERMITEGRID1DMULTI_H_ 00134