//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //===========================================================================
00001 #ifndef _HERMITEGRID1DMULTI_H_ 00002 #define _HERMITEGRID1DMULTI_H_ 00003 00004 #include <vector> 00005 #include "GoTools/utils/Point.h" 00006 00007 namespace Go 00008 { 00009 00010 class EvalCurveSet; 00011 00016 00017 class HermiteGrid1DMulti 00018 { 00019 public: 00029 HermiteGrid1DMulti(EvalCurveSet& surf, double start, double end, std::vector<int> dims); 00030 00041 HermiteGrid1DMulti(EvalCurveSet& surf, double param[], int n, std::vector<int> dims); 00042 00044 ~HermiteGrid1DMulti(); 00045 00051 int addKnot(EvalCurveSet& surf, double knot); 00052 00064 void getSegment(int left, int right, double& spar, 00065 double& epar, std::vector<std::vector<Point> >& bezcoef); 00066 00068 std::vector<double> getKnots() 00069 { return knots_; } 00070 00072 std::vector<std::vector<Point> > getData() { return array_; } 00073 00075 int dims(int ki) { return dims_[ki]; } 00076 00078 int size() {return MM_;} 00079 00080 private: 00081 std::vector<double> knots_; // Sorted array of DISTINCT parameters of curve 00082 std::vector<std::vector<Point> > array_; // Array holding position, and 00083 // directional derivative 00084 std::vector<int> dims_; // Spatial dimension of positions, 00085 int MM_; // Number of grid points 00086 int elem_size_; // Number of Point stored for each 00087 // grid point (typically 2: pt, der) 00088 int index_; // Index into knot array 00089 00090 00091 int getPosition(double knot); 00092 00093 }; 00094 00095 } // namespace Go 00096 00097 #endif //_HERMITEGRID1DMULTI_H_