1 // Created on: 1992-05-07
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IntPatch_ImpImpIntersection_HeaderFile
18 #define _IntPatch_ImpImpIntersection_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <IntPatch_SequenceOfPoint.hxx>
26 #include <IntPatch_SequenceOfLine.hxx>
27 #include <IntPatch_TheSOnBounds.hxx>
28 #include <Standard_Real.hxx>
29 #include <Standard_Integer.hxx>
30 class StdFail_NotDone;
31 class Standard_OutOfRange;
32 class Standard_DomainError;
33 class Standard_ConstructionError;
34 class Adaptor3d_HSurface;
35 class Adaptor3d_TopolTool;
40 //! Implementation of the intersection between two
41 //! quadric patches : Plane, Cone, Cylinder or Sphere.
42 class IntPatch_ImpImpIntersection
50 //! OK. Good intersection result.
53 //! Intersection curve is too long (e.g. as in the bug #26894).
54 //! We cannot provide precise computation of value and
55 //! derivatives of this curve having used floating-point model
56 //! determined by IEEE 754 standard. As result, OCCT algorithms
57 //! cannot work with that curve correctly.
58 IntStatus_InfiniteSectionCurve,
60 //! Algorithm cannot finish correctly.
64 Standard_EXPORT IntPatch_ImpImpIntersection();
66 //! Flag theIsReqToKeepRLine has been entered only for
67 //! compatibility with TopOpeBRep package. It shall be deleted
68 //! after deleting TopOpeBRep.
69 //! When intersection result returns IntPatch_RLine and another
70 //! IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
71 //! will always keep both lines even if they are coincided.
72 Standard_EXPORT IntPatch_ImpImpIntersection(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Boolean theIsReqToKeepRLine = Standard_False);
74 //! Flag theIsReqToKeepRLine has been entered only for
75 //! compatibility with TopOpeBRep package. It shall be deleted
76 //! after deleting TopOpeBRep.
77 //! When intersection result returns IntPatch_RLine and another
78 //! IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
79 //! will always keep both lines even if they are coincided.
80 Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& S1,
81 const Handle(Adaptor3d_TopolTool)& D1,
82 const Handle(Adaptor3d_HSurface)& S2,
83 const Handle(Adaptor3d_TopolTool)& D2,
84 const Standard_Real TolArc,
85 const Standard_Real TolTang,
86 const Standard_Boolean theIsReqToKeepRLine =
89 //! Returns True if the calculus was successful.
90 Standard_Boolean IsDone() const;
93 IntStatus GetStatus() const;
95 //! Returns true if the is no intersection.
96 Standard_Boolean IsEmpty() const;
98 //! Returns True if the two patches are considered as
99 //! entirely tangent, i.e every restriction arc of one
100 //! patch is inside the geometric base of the other patch.
101 Standard_Boolean TangentFaces() const;
103 //! Returns True when the TangentFaces returns True and the
104 //! normal vectors evaluated at a point on the first and the
105 //! second surface are opposite.
106 //! The exception DomainError is raised if TangentFaces
108 Standard_Boolean OppositeFaces() const;
110 //! Returns the number of "single" points.
111 Standard_Integer NbPnts() const;
113 //! Returns the point of range Index.
114 //! An exception is raised if Index<=0 or Index>NbPnt.
115 const IntPatch_Point& Point (const Standard_Integer Index) const;
117 //! Returns the number of intersection lines.
118 Standard_Integer NbLines() const;
120 //! Returns the line of range Index.
121 //! An exception is raised if Index<=0 or Index>NbLine.
122 const Handle(IntPatch_Line)& Line (const Standard_Integer Index) const;
138 Standard_Boolean empt;
139 Standard_Boolean tgte;
140 Standard_Boolean oppo;
141 IntPatch_SequenceOfPoint spnt;
142 IntPatch_SequenceOfLine slin;
143 IntPatch_TheSOnBounds solrst;
149 #include <IntPatch_ImpImpIntersection.lxx>
155 #endif // _IntPatch_ImpImpIntersection_HeaderFile