0027341: Incorrect exact HLR results
[occt.git] / src / Geom2dInt / Geom2dInt_GInter.hxx
1 // Created on: 1992-06-04
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Geom2dInt_GInter_HeaderFile
18 #define _Geom2dInt_GInter_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <IntCurve_IntConicConic.hxx>
26 #include <Geom2dInt_TheIntConicCurveOfGInter.hxx>
27 #include <Geom2dInt_TheIntPCurvePCurveOfGInter.hxx>
28 #include <IntRes2d_Intersection.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <Standard_Integer.hxx>
31 #include <TColStd_Array1OfReal.hxx>
32 class Standard_ConstructionError;
33 class Adaptor2d_Curve2d;
34 class Geom2dInt_Geom2dCurveTool;
35 class Geom2dInt_TheProjPCurOfGInter;
36 class Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter;
37 class Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter;
38 class Geom2dInt_TheIntConicCurveOfGInter;
39 class Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter;
40 class Geom2dInt_IntConicCurveOfGInter;
41 class Geom2dInt_TheIntPCurvePCurveOfGInter;
42 class Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter;
43 class Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter;
44 class Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter;
45 class IntRes2d_Domain;
46
47
48
49 class Geom2dInt_GInter  : public IntRes2d_Intersection
50 {
51 public:
52
53   DEFINE_STANDARD_ALLOC
54
55   
56   //! Empty constructor.
57     Geom2dInt_GInter();
58   
59   //! Self Intersection of a curve
60     Geom2dInt_GInter(const Adaptor2d_Curve2d& C, const Standard_Real TolConf, const Standard_Real Tol);
61   
62   //! Self Intersection of a curve with a domain.
63     Geom2dInt_GInter(const Adaptor2d_Curve2d& C, const IntRes2d_Domain& D, const Standard_Real TolConf, const Standard_Real Tol);
64   
65   //! Intersection between 2 curves.
66     Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol);
67   
68   //! Intersection between 2 curves.
69     Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol);
70   
71   //! Intersection between 2 curves.
72     Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
73   
74   //! Intersection between 2 curves.
75     Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
76   
77   //! Intersection between 2 curves.
78   Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
79   
80   //! Intersection between 2 curves.
81     void Perform (const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol);
82   
83   //! Intersection between 2 curves.
84   Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Standard_Real TolConf, const Standard_Real Tol);
85   
86   //! Intersection between 2 curves.
87   Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const Standard_Real TolConf, const Standard_Real Tol);
88   
89   //! Intersection between 2 curves.
90     void Perform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol);
91   
92   //! Intersection between 2 curves.
93     void Perform (const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
94   
95   //! Create a domain from a curve
96   Standard_EXPORT IntRes2d_Domain ComputeDomain (const Adaptor2d_Curve2d& C1, const Standard_Real TolDomain) const;
97
98   //! Set / get minimum number of points in polygon intersection.
99   Standard_EXPORT void SetMinNbSamples (const Standard_Integer theMinNbSamples);
100   Standard_EXPORT Standard_Integer GetMinNbSamples () const;
101
102
103 protected:
104
105
106
107
108
109 private:
110
111   
112   //! Intersection between 2 curves.
113   Standard_EXPORT void InternalPerform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
114   
115   //! Part of InternalCompositePerform function
116   Standard_EXPORT void InternalCompositePerform_noRecurs (const Standard_Integer NbInterC1, const Adaptor2d_Curve2d& C1, const Standard_Integer NumInterC1, const TColStd_Array1OfReal& Tab1, const IntRes2d_Domain& D1, const Standard_Integer NbInterC2, const Adaptor2d_Curve2d& C2, const Standard_Integer NumInterC2, const TColStd_Array1OfReal& Tab2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol);
117   
118   //! Intersection between 2 curves.
119   Standard_EXPORT void InternalCompositePerform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Standard_Integer N1, const Standard_Integer NB1, const TColStd_Array1OfReal& Tab1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Integer N2, const Standard_Integer NB2, const TColStd_Array1OfReal& Tab2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite);
120
121
122   Standard_Real param1inf;
123   Standard_Real param1sup;
124   Standard_Real param2inf;
125   Standard_Real param2sup;
126   IntCurve_IntConicConic intconiconi;
127   Geom2dInt_TheIntConicCurveOfGInter intconicurv;
128   Geom2dInt_TheIntPCurvePCurveOfGInter intcurvcurv;
129
130
131 };
132
133 #define TheCurve Adaptor2d_Curve2d
134 #define TheCurve_hxx <Adaptor2d_Curve2d.hxx>
135 #define TheCurveTool Geom2dInt_Geom2dCurveTool
136 #define TheCurveTool_hxx <Geom2dInt_Geom2dCurveTool.hxx>
137 #define IntCurve_TheProjPCur Geom2dInt_TheProjPCurOfGInter
138 #define IntCurve_TheProjPCur_hxx <Geom2dInt_TheProjPCurOfGInter.hxx>
139 #define IntCurve_TheCurveLocatorOfTheProjPCur Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter
140 #define IntCurve_TheCurveLocatorOfTheProjPCur_hxx <Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx>
141 #define IntCurve_TheLocateExtPCOfTheProjPCur Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter
142 #define IntCurve_TheLocateExtPCOfTheProjPCur_hxx <Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx>
143 #define IntCurve_TheCurveLocatorOfTheProjPCur Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter
144 #define IntCurve_TheCurveLocatorOfTheProjPCur_hxx <Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx>
145 #define IntCurve_TheLocateExtPCOfTheProjPCur Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter
146 #define IntCurve_TheLocateExtPCOfTheProjPCur_hxx <Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx>
147 #define IntCurve_TheIntConicCurve Geom2dInt_TheIntConicCurveOfGInter
148 #define IntCurve_TheIntConicCurve_hxx <Geom2dInt_TheIntConicCurveOfGInter.hxx>
149 #define IntCurve_TheIntersectorOfTheIntConicCurve Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter
150 #define IntCurve_TheIntersectorOfTheIntConicCurve_hxx <Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx>
151 #define IntCurve_TheIntersectorOfTheIntConicCurve Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter
152 #define IntCurve_TheIntersectorOfTheIntConicCurve_hxx <Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx>
153 #define IntCurve_IntConicCurve Geom2dInt_IntConicCurveOfGInter
154 #define IntCurve_IntConicCurve_hxx <Geom2dInt_IntConicCurveOfGInter.hxx>
155 #define IntCurve_TheIntPCurvePCurve Geom2dInt_TheIntPCurvePCurveOfGInter
156 #define IntCurve_TheIntPCurvePCurve_hxx <Geom2dInt_TheIntPCurvePCurveOfGInter.hxx>
157 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter
158 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx <Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx>
159 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter
160 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx <Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx>
161 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter
162 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx <Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter.hxx>
163 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter
164 #define IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx <Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx>
165 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter
166 #define IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx <Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx>
167 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter
168 #define IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx <Geom2dInt_ExactIntersectionPointOfTheIntPCurvePCurveOfGInter.hxx>
169 #define IntCurve_IntCurveCurveGen Geom2dInt_GInter
170 #define IntCurve_IntCurveCurveGen_hxx <Geom2dInt_GInter.hxx>
171
172 #include <IntCurve_IntCurveCurveGen.lxx>
173
174 #undef TheCurve
175 #undef TheCurve_hxx
176 #undef TheCurveTool
177 #undef TheCurveTool_hxx
178 #undef IntCurve_TheProjPCur
179 #undef IntCurve_TheProjPCur_hxx
180 #undef IntCurve_TheCurveLocatorOfTheProjPCur
181 #undef IntCurve_TheCurveLocatorOfTheProjPCur_hxx
182 #undef IntCurve_TheLocateExtPCOfTheProjPCur
183 #undef IntCurve_TheLocateExtPCOfTheProjPCur_hxx
184 #undef IntCurve_TheCurveLocatorOfTheProjPCur
185 #undef IntCurve_TheCurveLocatorOfTheProjPCur_hxx
186 #undef IntCurve_TheLocateExtPCOfTheProjPCur
187 #undef IntCurve_TheLocateExtPCOfTheProjPCur_hxx
188 #undef IntCurve_TheIntConicCurve
189 #undef IntCurve_TheIntConicCurve_hxx
190 #undef IntCurve_TheIntersectorOfTheIntConicCurve
191 #undef IntCurve_TheIntersectorOfTheIntConicCurve_hxx
192 #undef IntCurve_TheIntersectorOfTheIntConicCurve
193 #undef IntCurve_TheIntersectorOfTheIntConicCurve_hxx
194 #undef IntCurve_IntConicCurve
195 #undef IntCurve_IntConicCurve_hxx
196 #undef IntCurve_TheIntPCurvePCurve
197 #undef IntCurve_TheIntPCurvePCurve_hxx
198 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve
199 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx
200 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve
201 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx
202 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve
203 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx
204 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve
205 #undef IntCurve_ThePolygon2dOfTheIntPCurvePCurve_hxx
206 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve
207 #undef IntCurve_TheDistBetweenPCurvesOfTheIntPCurvePCurve_hxx
208 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve
209 #undef IntCurve_ExactIntersectionPointOfTheIntPCurvePCurve_hxx
210 #undef IntCurve_IntCurveCurveGen
211 #undef IntCurve_IntCurveCurveGen_hxx
212
213
214
215
216 #endif // _Geom2dInt_GInter_HeaderFile