SplineUtils.h

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 _GOSPLINEUTILS_H
00034 #define _GOSPLINEUTILS_H
00035 
00036 
00037 #include "SplineSurface.h"
00038 #include "SplineCurve.h"
00039 #include "errormacros.h"
00040 #include <math.h>
00041 #include <algorithm>
00042 #include <ctype.h>
00043 
00044 
00045 namespace Go {
00048 
00049 
00050 
00059     void transpose_array(int dim, int m, int n, double* array_start);
00060 
00067     int closest_in_array(const double* pt,
00068                          const double* array,
00069                          int n, 
00070                          int dim);
00071 
00078     Vector3D closest_on_triangle(const Vector3D& pt,
00079                                  const Vector3D tri[3],
00080                                  double& clo_dist2);
00081 
00090     double closest_on_line_segment(const Vector3D& pt,
00091                                    const Vector3D& beg,
00092                                    const Vector3D& end);
00093 
00094 
00109     void closest_on_rectgrid(const double* pt,
00110                              const double* array,
00111                              int m, int n,
00112                              double& clo_u,
00113                              double& clo_v);
00114 
00134     void closest_on_rectgrid(const double* pt, const double* array,
00135                              int u_min, int u_max, int v_min, int v_max,
00136                              int nmb_coefs_u,
00137                              double& clo_u, double& clo_v);
00138 
00139 
00146     void make_coef_array_from_rational_coefs(const double* rationals,
00147                                              double* coefs,
00148                                              int num_coefs,
00149                                              int dim);
00150 
00162     void curve_ratder(double const eder[],int idim,int ider,double gder[]);
00163 
00186     void surface_ratder(double const eder[],int idim,int ider,double gder[]);
00187 
00215     void osloalg(int ij,int imy,int ik,int in,int *jpl,int *jfi,int *jla,
00216                  double *et,double *etau,double *galfa);
00217 
00246     void refmatrix(double *et, int im, int ik, 
00247                    double *etau, int in,
00248                    double *ea, int *nfirst,int *nlast);
00249 
00251 } // End of namespace Go
00252 
00253 
00254 #endif
00255 
00256 

Generated on Mon Jun 11 14:48:18 2007 for GoTools Core Library by  doxygen 1.5.1