1 // Created on: 1998-01-27
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1998-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 _IntCurvesFace_ShapeIntersector_HeaderFile
18 #define _IntCurvesFace_ShapeIntersector_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Address.hxx>
27 #include <BRepTopAdaptor_SeqOfPtr.hxx>
28 #include <TColStd_SequenceOfInteger.hxx>
29 #include <TColStd_SequenceOfReal.hxx>
30 #include <Standard_Real.hxx>
31 #include <IntCurveSurface_TransitionOnCurve.hxx>
32 #include <TopAbs_State.hxx>
35 class Adaptor3d_HCurve;
41 class IntCurvesFace_ShapeIntersector
48 Standard_EXPORT IntCurvesFace_ShapeIntersector();
50 Standard_EXPORT void Load (const TopoDS_Shape& Sh, const Standard_Real Tol);
52 //! Perform the intersection between the
53 //! segment L and the loaded shape.
55 //! PInf is the smallest parameter on the line
56 //! PSup is the highest parammter on the line
58 //! For an infinite line PInf and PSup can be
60 Standard_EXPORT void Perform (const gp_Lin& L, const Standard_Real PInf, const Standard_Real PSup);
62 //! Perform the intersection between the
63 //! segment L and the loaded shape.
65 //! PInf is the smallest parameter on the line
66 //! PSup is the highest parammter on the line
68 //! For an infinite line PInf and PSup can be
70 Standard_EXPORT void PerformNearest (const gp_Lin& L, const Standard_Real PInf, const Standard_Real PSup);
72 //! same method for a HCurve from Adaptor3d.
73 //! PInf an PSup can also be - and + INF.
74 Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& HCu, const Standard_Real PInf, const Standard_Real PSup);
76 //! True is returned when the intersection have been computed.
77 Standard_Boolean IsDone() const;
79 Standard_Integer NbPnt() const;
81 //! Returns the U parameter of the ith intersection point
83 Standard_Real UParameter (const Standard_Integer I) const;
85 //! Returns the V parameter of the ith intersection point
87 Standard_Real VParameter (const Standard_Integer I) const;
89 //! Returns the parameter of the ith intersection point
91 Standard_Real WParameter (const Standard_Integer I) const;
93 //! Returns the geometric point of the ith intersection
94 //! between the line and the surface.
95 const gp_Pnt& Pnt (const Standard_Integer I) const;
97 //! Returns the ith transition of the line on the surface.
98 IntCurveSurface_TransitionOnCurve Transition (const Standard_Integer I) const;
100 //! Returns the ith state of the point on the face.
101 //! The values can be either TopAbs_IN
102 //! ( the point is in the face)
104 //! ( the point is on a boudary of the face).
105 TopAbs_State State (const Standard_Integer I) const;
107 //! Returns the significant face used to determine
108 //! the intersection.
109 const TopoDS_Face& Face (const Standard_Integer I) const;
111 //! Internal method. Sort the result on the Curve
113 Standard_EXPORT void SortResult();
115 Standard_EXPORT void Destroy();
116 ~IntCurvesFace_ShapeIntersector()
134 Standard_Boolean done;
135 Standard_Integer nbfaces;
136 Standard_Address PtrJetons;
137 Standard_Address PtrJetonsIndex;
138 BRepTopAdaptor_SeqOfPtr PtrIntersector;
139 TColStd_SequenceOfInteger IndexPt;
140 TColStd_SequenceOfInteger IndexFace;
141 TColStd_SequenceOfInteger IndexIntPnt;
142 TColStd_SequenceOfReal IndexPar;
148 #include <IntCurvesFace_ShapeIntersector.lxx>
154 #endif // _IntCurvesFace_ShapeIntersector_HeaderFile