SurfaceAssembly.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 _SURFACEASSEMBLY_H
00034 #define _SURFACEASSEMBLY_H
00035 
00036 #include "ParamSurfaceInt.h"
00037 
00038 namespace Go
00039 {
00042 
00043 
00044 class SurfaceAssembly
00045     {
00046     public:
00047 
00049         SurfaceAssembly(boost::shared_ptr<ParamSurfaceInt> surf,
00050                         std::vector<std::pair<double,int> > u_div,
00051                         std::vector<std::pair<double,int> > v_div,
00052                         std::vector<RectDomain> sing_domain,
00053                         double rel_par_res);
00054 
00056         ~SurfaceAssembly();
00057 
00058         void resetSubIndex(int idx=0)
00059             { idx_sub_ = idx; }
00060 
00061         void resetAssemblyIndex()
00062             { idx_assembly_ = 0; }
00063 
00064         int getNmbSubSurface();
00065 
00066 
00067         bool getNextSubSurface(boost::shared_ptr<ParamSurfaceInt>& sub_sf,
00068                                int& idx, int& sing_idx);
00069 
00070         bool getNextAssembly(boost::shared_ptr<ParamSurfaceInt>& assembly,
00071                              int& idx, bool& potential_sing);
00072 
00076         bool subSfNeighbour(int idx1, int idx2);
00077 
00078         bool doTouch(int idx1, int idx2);
00079 
00080         bool touchAtSingularity(int idx1, int idx2);
00081 
00082         bool isInPrevAssembly(int idx1, int idx2);
00083 
00084         bool isInFirstAssembly(boost::shared_ptr<ParamSurfaceInt> sub_srf);
00085 
00086         int getSubSurfaceIndex(boost::shared_ptr<ParamSurfaceInt> sub_srf,
00087                                bool& at_end);
00088 
00089         std::vector<std::pair<double,int> > getUdiv()
00090             {
00091                 return u_div_;
00092             }
00093 
00094         std::vector<std::pair<double,int> > getVdiv()
00095             {
00096                 return v_div_;
00097             }
00098 
00099     private:
00100         boost::shared_ptr<ParamSurfaceInt> surf_;
00101         std::vector<std::pair<double,int> > u_div_;
00102         std::vector<std::pair<double,int> > v_div_;
00103         std::vector<RectDomain> sing_domain_;
00104         double ptol_;
00105         bool closed_in_u_;
00106         bool closed_in_v_;
00107         mutable int idx_sub_;
00108         mutable int idx_assembly_;  // The index corresponds to the
00109         // sub surface where the lower left corner of the assembly lies.
00110         // Thus, the index does not count the total number of assemblies
00111 
00112         // Refine the surface according to the given division parameters
00113         // if possible (to save time at a later stage)
00114         void refineSurf();
00115     };
00117 } // namespace Go
00118 
00119 #endif  // _SURFACEASSEMBLY_H
00120 
00121 
00122 
00123 

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