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>
34 class Adaptor3d_Curve;
40 class IntCurvesFace_ShapeIntersector
47 Standard_EXPORT IntCurvesFace_ShapeIntersector();
49 Standard_EXPORT void Load (const TopoDS_Shape& Sh, const Standard_Real Tol);
51 //! Perform the intersection between the
52 //! segment L and the loaded shape.
54 //! PInf is the smallest parameter on the line
55 //! PSup is the highest parammter on the line
57 //! For an infinite line PInf and PSup can be
59 Standard_EXPORT void Perform (const gp_Lin& L, const Standard_Real PInf, const Standard_Real PSup);
61 //! Perform the intersection between the
62 //! segment L and the loaded shape.
64 //! PInf is the smallest parameter on the line
65 //! PSup is the highest parammter on the line
67 //! For an infinite line PInf and PSup can be
69 Standard_EXPORT void PerformNearest (const gp_Lin& L, const Standard_Real PInf, const Standard_Real PSup);
71 //! same method for a HCurve from Adaptor3d.
72 //! PInf an PSup can also be - and + INF.
73 Standard_EXPORT void Perform (const Handle(Adaptor3d_Curve)& HCu, const Standard_Real PInf, const Standard_Real PSup);
75 //! True is returned when the intersection have been computed.
76 Standard_Boolean IsDone() const;
78 Standard_Integer NbPnt() const;
80 //! Returns the U parameter of the ith intersection point
82 Standard_Real UParameter (const Standard_Integer I) const;
84 //! Returns the V parameter of the ith intersection point
86 Standard_Real VParameter (const Standard_Integer I) const;
88 //! Returns the parameter of the ith intersection point
90 Standard_Real WParameter (const Standard_Integer I) const;
92 //! Returns the geometric point of the ith intersection
93 //! between the line and the surface.
94 const gp_Pnt& Pnt (const Standard_Integer I) const;
96 //! Returns the ith transition of the line on the surface.
97 IntCurveSurface_TransitionOnCurve Transition (const Standard_Integer I) const;
99 //! Returns the ith state of the point on the face.
100 //! The values can be either TopAbs_IN
101 //! ( the point is in the face)
103 //! ( the point is on a boundary of the face).
104 TopAbs_State State (const Standard_Integer I) const;
106 //! Returns the significant face used to determine
107 //! the intersection.
108 const TopoDS_Face& Face (const Standard_Integer I) const;
110 //! Internal method. Sort the result on the Curve
112 Standard_EXPORT void SortResult();
114 Standard_EXPORT void Destroy();
115 ~IntCurvesFace_ShapeIntersector()
133 Standard_Boolean done;
134 Standard_Integer nbfaces;
135 Standard_Address PtrJetons;
136 Standard_Address PtrJetonsIndex;
137 BRepTopAdaptor_SeqOfPtr PtrIntersector;
138 TColStd_SequenceOfInteger IndexPt;
139 TColStd_SequenceOfInteger IndexFace;
140 TColStd_SequenceOfInteger IndexIntPnt;
141 TColStd_SequenceOfReal IndexPar;
147 #include <IntCurvesFace_ShapeIntersector.lxx>
153 #endif // _IntCurvesFace_ShapeIntersector_HeaderFile