0027664: Incomplete intersection curve from the attached shapes
[occt.git] / src / IntPatch / IntPatch_HInterTool.hxx
1 // Created on: 1995-07-02
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1995-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 _IntPatch_HInterTool_HeaderFile
18 #define _IntPatch_HInterTool_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Real.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 class Adaptor3d_HSurface;
28 class Adaptor2d_HCurve2d;
29 class gp_Pnt2d;
30 class Adaptor3d_HVertex;
31 class gp_Pnt;
32
33
34 //! Tool for the intersection between 2 surfaces.
35 //! Regroupe pour l instant les methodes hors Adaptor3d...
36 class IntPatch_HInterTool 
37 {
38 public:
39
40   DEFINE_STANDARD_ALLOC
41
42   
43   Standard_EXPORT IntPatch_HInterTool();
44   
45     static Standard_Boolean SingularOnUMin (const Handle(Adaptor3d_HSurface)& S);
46   
47     static Standard_Boolean SingularOnUMax (const Handle(Adaptor3d_HSurface)& S);
48   
49     static Standard_Boolean SingularOnVMin (const Handle(Adaptor3d_HSurface)& S);
50   
51     static Standard_Boolean SingularOnVMax (const Handle(Adaptor3d_HSurface)& S);
52   
53   Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(Adaptor3d_HSurface)& S, const Standard_Real u1, const Standard_Real u2);
54   
55   Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(Adaptor3d_HSurface)& S, const Standard_Real v1, const Standard_Real v2);
56   
57   Standard_EXPORT Standard_Integer NbSamplePoints (const Handle(Adaptor3d_HSurface)& S);
58   
59   Standard_EXPORT void SamplePoint (const Handle(Adaptor3d_HSurface)& S, const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const;
60   
61   //! Returns True if all the intersection point and edges
62   //! are known on the Arc.
63   //! The intersection point are given as vertices.
64   //! The intersection edges are given as intervals between
65   //! two vertices.
66   Standard_EXPORT static Standard_Boolean HasBeenSeen (const Handle(Adaptor2d_HCurve2d)& C);
67   
68   //! returns the number of points which is used to make
69   //! a sample on the arc. this number is a function of
70   //! the Surface and the CurveOnSurface complexity.
71   Standard_EXPORT static Standard_Integer NbSamplesOnArc (const Handle(Adaptor2d_HCurve2d)& A);
72   
73   //! Returns the parametric limits on the arc C.
74   //! These limits must be finite : they are either
75   //! the real limits of the arc, for a finite arc,
76   //! or a bounding box for an infinite arc.
77   Standard_EXPORT static void Bounds (const Handle(Adaptor2d_HCurve2d)& C, Standard_Real& Ufirst, Standard_Real& Ulast);
78   
79   //! Projects the point P on the arc C.
80   //! If the methods returns Standard_True, the projection is
81   //! successful, and Paramproj is the parameter on the arc
82   //! of the projected point, Ptproj is the projected Point.
83   //! If the method returns Standard_False, Param proj and Ptproj
84   //! are not significant.
85   Standard_EXPORT static Standard_Boolean Project (const Handle(Adaptor2d_HCurve2d)& C, const gp_Pnt2d& P, Standard_Real& Paramproj, gp_Pnt2d& Ptproj);
86   
87   //! Returns the parametric tolerance used to consider
88   //! that the vertex and another point meet, i-e
89   //! if Abs(parameter(Vertex) - parameter(OtherPnt))<=
90   //! Tolerance, the points are "merged".
91   Standard_EXPORT static Standard_Real Tolerance (const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_HCurve2d)& C);
92   
93   //! Returns the parameter of the vertex V on the arc A.
94   Standard_EXPORT static Standard_Real Parameter (const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_HCurve2d)& C);
95   
96   //! Returns the number of intersection points on the arc A.
97   Standard_EXPORT static Standard_Integer NbPoints (const Handle(Adaptor2d_HCurve2d)& C);
98   
99   //! Returns the value (Pt), the tolerance (Tol), and
100   //! the parameter (U) on the arc A , of the intersection
101   //! point of range Index.
102   Standard_EXPORT static void Value (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, gp_Pnt& Pt, Standard_Real& Tol, Standard_Real& U);
103   
104   //! Returns True if the intersection point of range Index
105   //! corresponds with a vertex on the arc A.
106   Standard_EXPORT static Standard_Boolean IsVertex (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index);
107   
108   //! When IsVertex returns True, this method returns the
109   //! vertex on the arc A.
110   Standard_EXPORT static void Vertex (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, Handle(Adaptor3d_HVertex)& V);
111   
112   //! returns the number of part of A solution of the
113   //! of intersection problem.
114   Standard_EXPORT static Standard_Integer NbSegments (const Handle(Adaptor2d_HCurve2d)& C);
115   
116   //! Returns True when the segment of range Index is not
117   //! open at the left side. In that case, IndFirst is the
118   //! range in the list intersection points (see NbPoints)
119   //! of the one which defines the left bound of the segment.
120   //! Otherwise, the method has to return False, and IndFirst
121   //! has no meaning.
122   Standard_EXPORT static Standard_Boolean HasFirstPoint (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, Standard_Integer& IndFirst);
123   
124   //! Returns True when the segment of range Index is not
125   //! open at the right side. In that case, IndLast is the
126   //! range in the list intersection points (see NbPoints)
127   //! of the one which defines the right bound of the segment.
128   //! Otherwise, the method has to return False, and IndLast
129   //! has no meaning.
130   Standard_EXPORT static Standard_Boolean HasLastPoint (const Handle(Adaptor2d_HCurve2d)& C, const Standard_Integer Index, Standard_Integer& IndLast);
131   
132   //! Returns True when the whole restriction is solution
133   //! of the intersection problem.
134   Standard_EXPORT static Standard_Boolean IsAllSolution (const Handle(Adaptor2d_HCurve2d)& C);
135
136
137
138
139 protected:
140
141
142
143
144
145 private:
146
147
148
149   Standard_Real uinf;
150   Standard_Real vinf;
151   Standard_Real usup;
152   Standard_Real vsup;
153
154
155 };
156
157
158 #include <IntPatch_HInterTool.lxx>
159
160
161
162
163
164 #endif // _IntPatch_HInterTool_HeaderFile