Par2FuncIntersector.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 _PAR2FUNCINTERSECTOR_H
00034 #define _PAR2FUNCINTERSECTOR_H
00035 
00036 
00037 #include "IntersectorFuncConst.h"
00038 #include "IntersectionPoint.h"
00039 
00040 
00041 namespace Go {
00044 
00045 
00046 
00049 
00050 class Par2FuncIntersector : public IntersectorFuncConst {
00051 public:
00052 
00053 //     Par2FuncIntersector(boost::shared_ptr<ParamFunctionInt> func,
00054 //                      boost::shared_ptr<ParamFunctionInt> C,
00055 //                      double epsge,
00056 //                      Intersector* prev = 0);
00057 
00073     Par2FuncIntersector(boost::shared_ptr<ParamFunctionInt> func,
00074                         boost::shared_ptr<ParamFunctionInt> C,
00075                         boost::shared_ptr<GeoTol> epsge,
00076                         Intersector *prev = 0,
00077                         int eliminated_parameter = -1,
00078                         double eliminated_value = 0);
00079 
00081     virtual ~Par2FuncIntersector();
00082 
00083 //     // Validation of given intersection results
00084 //     virtual void validate(int level, ValidationStat status);
00085 
00088     virtual int numParams() const
00089     { return 2; }
00090         
00091 protected:
00092     // Data members
00093 
00094     virtual boost::shared_ptr<Intersector> 
00095     lowerOrderIntersector(boost::shared_ptr<ParamFunctionInt> obj1,
00096                           boost::shared_ptr<ParamFunctionInt> obj2,
00097                           Intersector* prev = 0,
00098                           int eliminated_parameter = -1,
00099                           double eliminated_value = 0);
00100 
00101     virtual int checkCoincidence();
00102 
00103     virtual void microCase();
00104     
00105     virtual int updateIntersections();
00106 
00107     virtual int repairIntersections()
00108     { return 0; }
00109 
00110     bool
00111     isConnected(std::vector<boost::shared_ptr<IntersectionPoint> > bd_ints,
00112                 int nmbbd);
00113 
00114     bool isConnected(std::vector<std::
00115                      pair<boost::shared_ptr<IntersectionPoint>,
00116                      IntPtClassification> >& bd_ints, 
00117                      int nmb_nottouch);
00118 
00119     bool connectDirected(std::vector<std::
00120                          pair<boost::shared_ptr<IntersectionPoint>,
00121                          IntPtClassification> >& bd_ints,
00122                          int nmbbd);
00123 
00124     bool canConnect(boost::shared_ptr<IntersectionPoint> pt1,
00125                     boost::shared_ptr<IntersectionPoint> pt2);
00126 
00127     virtual int doSubdivide();
00128 
00129 private:
00130 
00131     int getSubdivisionParameter(int dir, double& par);
00132 
00133     // We need to decide in which direction to subdivide.
00134     int sortParameterDirections(int perm[]); //, int deg_edge[]);
00135 
00136     int checkSubdivParam(int dir, double par, double ta, double tb,
00137                          std::vector<boost::
00138                          shared_ptr<IntersectionPoint> >& int_pts);
00139 
00140     int checkIsoCurve(int pdir, bool first, double par,
00141                       std::vector<boost::
00142                       shared_ptr<IntersectionPoint> > int_pts);
00143 
00144     bool getSubdivAtSing(int dir, double ta, double tb, double& par);
00145 
00146 //     void splitIntResults(std::vector<boost::
00147 //                       shared_ptr<IntersectionPoint> >& int_pts,
00148 //                       int pardir, double par,
00149 //                       double start, double end);
00150 
00151 //     void doIterate(int pardir, double parval, double param[], double& dist,
00152 //                 double seed[]);
00153 
00154 //     // Utility function for sorting input bd_int's.
00155 //     IntPtClassification bdDir(const IntersectionPoint& int_pt,
00156 //                            Point sorting_dir);
00157 
00158     void writeDebugConnect(std::vector<std::
00159                            pair<boost::shared_ptr<IntersectionPoint>,
00160                            IntPtClassification> >& bd_ints);
00161 
00162 };
00163 
00164 
00166 } // namespace Go
00167 
00168 
00169 #endif // _PAR2FUNCINTERSECTOR_H
00170 
00171 

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