//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //===========================================================================

2dpoly_for_s2m.h

Go to the documentation of this file.
00001 #ifndef TDPOLY_FOR_S2M_H_INCLUDED
00002 #define TDPOLY_FOR_S2M_H_INCLUDED
00003 
00004 
00005 
00006 
00007 
00008 
00009 //#include <functional>
00010 //#include <algorithm>
00011 #include <vector>
00012 
00013 // Hvilken av alle disse definerer navnerommet Go?!
00014 
00015 //#include "DefaultDataHandler.h"
00016 
00017 // #include "gvCurveTesselator.h"
00018 // #include "gvRectangularSurfaceTesselator.h"
00019 // #include "gvNoopTesselator.h"
00020 // #include "gvLineCloudTesselator.h"
00021 // #include "gvRectGridTesselator.h"
00022 
00023 // #include "gvCurvePaintable.h"
00024 // #include "gvRectangularSurfacePaintable.h"
00025 // #include "gvPointCloudPaintable.h"
00026 // #include "gvLineCloudPaintable.h"
00027 // #include "gvQuadsPaintable.h"
00028 
00029 // #include "gvParametricSurfacePaintable.h"
00030 // #include "gvParametricSurfaceTesselator.h"
00031 // #include "ParametricSurfacePropertySheet.h"
00032 
00033 // #include "gvPropertySheet.h"
00034 // #include "GoTools/geometry/SplineCurvePropertySheet.h"
00035 // #include "RectangularSurfacePropertySheet.h"
00036 // #include "PointCloudPropertySheet.h"
00037 
00038 // #include "GoTools/geometry/SplineSurface.h"
00039 // #include "BoundedSurface.h"
00040 // #include "GoTools/geometry/SplineCurve.h"
00041 // #include "PointCloud.h"
00042 // #include "GoTools/geometry/LineCloud.h"
00043 // #include "GoTools/geometry/ParamSurface.h"
00044 // #include "RectGrid.h"
00045 // #include "ClassType.h"
00046 
00047 // #include "Factory.h"
00048 
00049 #include "GoTools/utils/Array.h" // for Vector3D
00050 
00051 #include "GoTools/utils/errormacros.h"
00052 
00053 
00054 
00055 
00056 
00057 
00058 using namespace Go;
00059 
00060 // using std::vector; // 100213: Not a good idea to use in a header file?
00061 
00062 
00063 
00064 
00065 typedef std::pair<short, std::vector<short> *> short_list;
00066 typedef std::pair<short, std::vector<short_list> *> short_list_short_list;
00067 
00068 
00069 namespace Go
00070 {
00071   
00072   
00073   
00074   bool point_inside_contour(const double x0, const double y0,
00075                             const double * const vertices,
00076                             const std::vector<int> &contour
00077                             
00078                             // 090129: Usage of this has not been implemented so far. I am not sure it is a good
00079                             //         idea to do it either. Assumptions upon which its usefulness was once
00080                             //         based may not be present.  Commenting it out in order to avoid computing
00081                             //         it...
00082                             //vector<short_list_short_list> &sorted_segments
00083     );
00084   
00085   // 090115:
00086   // bool point_on_contour_corner(const double x0, const double y0,
00087   //                         const double * const vertices, const vector<int> &contour);
00088   
00089   bool segment_contour_intersection_for_s2m(const double x0, const double y0,
00090                                             const double x1, const double y1,
00091                                             const double * const vertices,
00092                                             const std::vector<int> &contour,
00093                                             
00094                                             // 090129: Usage of this has not been implemented so far. I am not
00095                                             //         sure it is a good idea to do it either. Assumptions upon
00096                                             //         which its usefulness was once based may not be present.
00097                                             //         Commenting it out in order to avoid computing it...
00098                                             //const vector<short_list_short_list> &sorted_segments,
00099                                             
00100                                             double &x, double &y, double &s,
00101                                             const bool snap_ends = false
00102 #ifdef DBG
00103                                             , const bool dbg = false
00104 #endif
00105     );
00106   
00107   std::vector< short_list_short_list > sort_2dpoly_segments(const double * const vertices,
00108                                                        const std::vector<int> &contour,
00109                                                        const bool transposed=false);
00110   
00111   int is_inside(const std::vector< Vector3D > &trim_curve_p, const std::vector<int> &contour,
00112                 const double u, const double v
00113 #ifdef DBG
00114                 , const bool dbg=false
00115 #endif
00116     );
00117   
00118   
00119   // 090115: This must be (re)checked before being used...
00120   bool is_on_corner(const std::vector< Vector3D > &trim_curve_p, const std::vector<int> &contour,
00121                     const double u, const double v);
00122   
00123   // 090117:
00124   int is_on_contour(const std::vector< Vector3D > &trim_curve_p, const std::vector<int> &contour,
00125                     const double u, const double v
00126 #ifdef DBG
00127                     , const bool dbg=false
00128 #endif
00129     );
00130   
00131   
00132   // 090204:
00133   bool degenerate_triangle(const Vector2D &c1, const Vector2D &c2, const Vector2D &c3
00134 #ifdef DBG
00135                            , const bool dbg = false
00136 #endif
00137     );
00138   
00139   
00140   
00141 
00142 
00143 
00144 } // namespace Go
00145 
00146 
00147 
00148 
00149 
00150 
00151 #endif
Generated on Tue Sep 21 15:44:17 2010 for GoTools Core by  doxygen 1.6.3