CoonsPatchGen.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 _GOCOONSPATCHGEN_H
00034 #define _GOCOONSPATCHGEN_H
00035 
00036 
00037 #include "CurveLoop.h"
00038 
00039 
00040 namespace Go {
00043 
00044 
00045 
00046 class SplineSurface;
00047 class SplineCurve;
00048 class ParamCurve;
00049 
00050 
00053 
00055 namespace CoonsPatchGen {
00058 
00059 
00060     // We introduce some exception classes.
00061 
00063     class UnKnownError{};
00064 
00074     SplineSurface* createCoonsPatch(const CurveLoop& boundary);
00075 
00076 
00077     // bd_curves must contain four curves cross_curves must contain
00078     // four curves (may be 0 curves) bd_curves and cross_curves must
00079     // be SplineCurves bd_curves and cross_curves must lie in the same
00080     // dimension and be nonrational bd curves will be reparameterized
00081     // to have reasonable tangent values at endpoints and
00082     // corresponding curves will share parameter interval.
00083     // neighbour_tol - hvor mye en kantkurve kan flyttes
00084 
00099     SplineSurface*
00100     createCoonsPatch(std::vector<boost::shared_ptr<ParamCurve> >& bd_curves,
00101                      std::vector<boost::shared_ptr<ParamCurve> >& cross_curves,
00102                      double epsge, double kink_tol);
00103 
00113     SplineSurface*
00114     createCoonsPatch(std::vector<boost::shared_ptr<SplineCurve> >& bd_curves,
00115                      std::vector<boost::shared_ptr<SplineCurve> >&
00116                      cross_curves);
00117 
00118     // None of the Gordon Surfaces perform manipulation of the cross
00119     // tangs.
00120 
00136     // @@sbr Include new version which sets up parameters.
00137     SplineSurface*
00138     createGordonSurface(std::vector<boost::shared_ptr<SplineCurve> >&
00139                         mesh_curves,
00140                         std::vector<double>& params, int& nmb_u_crvs,
00141                         bool use_param_values);
00142 
00158     SplineSurface*
00159     createGordonSurface(std::vector<boost::shared_ptr<SplineCurve> >&
00160                         mesh_curves,
00161                         std::vector<double>& params, int& nmb_u_crvs,
00162                         std::vector<boost::shared_ptr<SplineCurve> >&
00163                         cross_curves,
00164                         std::vector<int>& cross_index,
00165                         bool use_param_values = true);
00166 
00179     SplineSurface*
00180     doCreateSurface(std::vector<boost::shared_ptr<SplineCurve> >& mesh_curves,
00181                     std::vector<double>& params, int& nmb_u_crvs,
00182                     std::vector<boost::shared_ptr<SplineCurve> >& cross_curves,
00183                     std::vector<int>& cross_index);
00184 
00189     SplineSurface* loftSurface(std::vector<boost::shared_ptr<SplineCurve> >::iterator
00190                                first_curve, int nmb_crvs);
00191 
00198     SplineSurface* loftSurface(std::vector<boost::shared_ptr<SplineCurve> >::iterator
00199                                first_curve,
00200                                std::vector<double>::iterator first_param,
00201                                int nmb_crvs);
00202 
00211     SplineSurface*
00212       loftSurface(std::vector<boost::shared_ptr<SplineCurve> >::iterator first_curve,
00213                   std::vector<double>::iterator first_param,
00214                   int nmb_crvs,
00215                   std::vector<boost::shared_ptr<SplineCurve> >::iterator first_cross_curve,
00216                   std::vector<int>& cross_index);
00217 
00227     SplineSurface* tpSurface(const std::vector<boost::shared_ptr<SplineCurve> >& mesh_curves,
00228                               std::vector<double> params, int nmb_u_crvs,
00229                               const std::vector<boost::shared_ptr<SplineCurve> >& cross_curves,
00230                               std::vector<int>& cross_index);
00231 
00240     void splitMeshCurves(std::vector<boost::shared_ptr<SplineCurve> >& mesh_curves,
00241                          std::vector<double>& params, int& nmb_u_crvs,
00242                          std::vector<int>& cross_index, double epsgeo);
00243 
00246     void sortMeshCurves(std::vector<boost::shared_ptr<SplineCurve> >& mesh_curves,
00247                         std::vector<double>& params, int nmb_u_crvs,
00248                         std::vector<int>& cross_index);
00249 
00250 
00257     void getCrossTangs(const std::vector<boost::shared_ptr<SplineCurve> >& curves,
00258                        std::vector<boost::shared_ptr<SplineCurve> >& mod_cross_curves,
00259                        double tol1, double tol2);
00260 
00267     void addMissingCrossCurves(const std::vector<boost::shared_ptr<SplineCurve> >& bnd_curves,
00268                                std::vector<boost::shared_ptr<SplineCurve> >& cross_crvs);
00269 
00277     void getTangBlends(std::vector<boost::shared_ptr<SplineCurve> >& curves, int iedge,
00278                        std::vector<boost::shared_ptr<SplineCurve> >& blend_functions);
00279 
00289     void blendcoef(double evecu[],double evecv[],double etang[],
00290                    int idim,int isign,double *coef1, double *coef2);
00291 
00302     void hermit(double econd[], int icond, bool hasder1,
00303                 double astart, double aend, int idim);
00304 
00311     void fixCrossEndPts(const std::vector<boost::shared_ptr<SplineCurve> >& bd_curves,
00312                         const std::vector<boost::shared_ptr<SplineCurve> >& cross_curves);
00313 
00314 
00322     void
00323     makeLoftParams(std::vector<boost::shared_ptr<SplineCurve> >::const_iterator first_curve,
00324                    int nmb_crvs, double param_length, std::vector<double>& params);
00325 
00335     void
00336     reparamBoundaryCurve(std::vector<boost::shared_ptr<SplineCurve> >& curves, double aconst);
00337 
00339 } // namespace CoonsPatchGen
00340 
00341 
00343 } // namespace Go
00344 
00345 
00346 #endif // _GOCOONSPATCHGEN_H
00347 

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