ImplicitizeCurveAndVectorAlgo.h

00001 //===========================================================================
00002 // GoTools - SINTEF Geometry Tools
00003 //
00004 // GoTools module: Implicitization, version 1.0
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 _IMPLICITIZECURVEANDVECTORALGO_H
00034 #define _IMPLICITIZECURVEANDVECTORALGO_H
00035 
00036 
00037 #include "BernsteinTetrahedralPoly.h"
00038 #include "SplineCurve.h"
00039 #include "Point.h"
00040 #include "BaryCoordSystem.h"
00041 
00042 
00043 namespace Go {
00046 
00047 
00048 
00071 class ImplicitizeCurveAndVectorAlgo {
00072 public:
00074     ImplicitizeCurveAndVectorAlgo() : tol_(3.0e-15) { }
00077     explicit ImplicitizeCurveAndVectorAlgo(int deg) 
00078         : deg_(deg), tol_(3.0e-15) { }
00083     ImplicitizeCurveAndVectorAlgo(const SplineCurve& crv,
00084                                   const Point& pt, int deg)
00085         : crv_(crv), pt_(pt), deg_(deg), tol_(3.0e-15) { }
00086 
00089     void useSplineCurve(const SplineCurve& crv)
00090     { crv_ = crv; }
00091 
00094     void useVector(const Point& pt)
00095     { pt_ = pt; }
00096 
00099     void setDegree(int deg)
00100     { deg_ = deg; }
00101 
00104     void setTolerance(double tol)
00105     { tol_ = tol; }
00106 
00109     int perform();
00110 
00116     void getResultData(BernsteinTetrahedralPoly& implicit,
00117                        BaryCoordSystem3D& bc, double& sigma_min)
00118     {
00119         implicit = implicit_;
00120         bc = bc_;
00121         sigma_min = sigma_min_;
00122     }
00123 
00124 private:
00125     SplineCurve crv_;
00126     Point pt_;
00127     BernsteinTetrahedralPoly implicit_;
00128     BaryCoordSystem3D bc_;
00129     int deg_;
00130     double tol_;
00131     double sigma_min_;
00132 
00133 };
00134 
00135 
00137 } // namespace Go
00138 
00139 
00140 #endif // _IMPLICITIZECURVEANDVECTORALGO_H
00141 
00142 

Generated on Mon Jun 11 15:13:16 2007 for GoTools Implicitization Library by  doxygen 1.5.1