GeoTol.h

00001 //===========================================================================
00002 // GoTools - SINTEF Geometry Tools
00003 //
00004 // GoTools module: Intersections, 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 _GEOTOL_H
00034 #define _GEOTOL_H
00035 
00036 
00037 #include <fstream>
00038 
00039 
00040 namespace Go {
00043 
00044 
00045 // @@@ VSK 0904, As long as this class only contains a constant tolerance,
00046 // then it is OK just to pass it down into Intersectors with fewer parameter
00047 // directions. When/if the tolerance gets parameter dependent, then this
00048 // is not good enough. Then also the tolerance class needs a reduction
00049 // in the number of parameter directions. Thus, the constructors in the
00050 // Intersector tree is not final.
00051 
00052 // @@@jbt Some functions are left un-Doxygen-documented, since this
00053 // class is partly under development
00054 
00055 
00057 
00058 class GeoTol {
00059 public:
00061     GeoTol(double epsge, double rel_par_res = 1.0e-12, 
00062            double numerical_tol = 1.0e-16);
00063 
00065     GeoTol(GeoTol *epsge);
00066 
00068     ~GeoTol();
00069 
00071     const double& getEpsge() const 
00072     { return epsge_; }
00073 
00074     const double& getMinEpsge() const 
00075     { return epsge_; }  // For the time being until a varying
00076                         // tolerance is implemented
00077  
00079     const double& getRelParRes() const 
00080     { return rel_par_res_;}
00081 
00082     const double& getMaxEpsge() const 
00083     { return epsge_; }   // For the time being
00084 
00087     const double& getEpsBracket() const 
00088     { return eps_bracket_;}
00089 
00090     const double& getRefAng() const 
00091     { return ref_ang_; }
00092 
00094     const double& getAngleTol() const 
00095     { return ang_tol_; }
00096     
00098     const double& getNumericalTol() const
00099     { return numerical_tol_;  }
00100 
00102     void write(std::ostream& os) const;
00104     void read(std::istream& is);
00105     
00106 private:
00107     double epsge_;  // Constant tolerance
00108     double eps_bracket_;
00109     double ref_ang_;
00110     double ang_tol_;
00111 
00112     // It should also be room for a varying tolerance for use together
00113     // with functions and a directional dependent tolerance for use
00114     // with subdivision and boundary curves and points.
00115 
00116     double rel_par_res_;
00117     double numerical_tol_;
00118 };
00119 
00120 
00122 } // namespace Go
00123 
00124 
00125 #endif // _GEOTOL_H
00126 

Generated on Fri Nov 23 12:24:32 2007 for GoTools Intersections Library by  doxygen 1.5.1