1 // Created on: 1995-05-29
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1995-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 _LocOpe_CurveShapeIntersector_HeaderFile
18 #define _LocOpe_CurveShapeIntersector_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <LocOpe_SequenceOfPntFace.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_Real.hxx>
28 #include <TopAbs_Orientation.hxx>
29 class StdFail_NotDone;
30 class Standard_OutOfRange;
37 //! This class provides the intersection between an
38 //! axis or a circle and the faces of a shape. The
39 //! intersection points are sorted in increasing
40 //! parameter along the axis.
41 class LocOpe_CurveShapeIntersector
48 //! Empty constructor.
49 LocOpe_CurveShapeIntersector();
51 //! Creates and performs the intersection betwwen
53 LocOpe_CurveShapeIntersector(const gp_Ax1& Axis, const TopoDS_Shape& S);
55 //! Creates and performs yte intersection betwwen
57 LocOpe_CurveShapeIntersector(const gp_Circ& C, const TopoDS_Shape& S);
59 //! Performs the intersection between <Ax1 and <S>.
60 Standard_EXPORT void Init (const gp_Ax1& Axis, const TopoDS_Shape& S);
62 //! Performs the intersection between <Ax1 and <S>.
63 Standard_EXPORT void Init (const gp_Circ& C, const TopoDS_Shape& S);
65 //! Returns <Standard_True> if the intersection has
67 Standard_Boolean IsDone() const;
69 //! Returns the number of intersection point.
70 Standard_Integer NbPoints() const;
72 //! Returns the intersection point of range <Index>.
73 //! The points are sorted in increasing order of
74 //! parameter along the axis.
75 const LocOpe_PntFace& Point (const Standard_Integer Index) const;
77 //! Searches the first intersection point located
78 //! after the parameter <From>, wich orientation is
79 //! not TopAbs_EXTERNAL. If found, returns
80 //! <Standard_True>. <Or> contains the orientation of
81 //! the point, <IndFrom> and <IndTo> represents the
82 //! interval of index in the sequence of intersection
83 //! point corresponding to the point. (IndFrom <=
86 //! Otherwise, returns <Standard_False>.
87 Standard_EXPORT Standard_Boolean LocalizeAfter (const Standard_Real From, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
89 //! Searches the first intersection point located
90 //! before the parameter <From>, wich orientation is
91 //! not TopAbs_EXTERNAL. If found, returns
92 //! <Standard_True>. <Or> contains the orientation of
93 //! the point, <IndFrom> and <IndTo> represents the
94 //! interval of index in the sequence of intersection
95 //! point corresponding to the point (IndFrom <=
98 //! Otherwise, returns <Standard_False>.
99 Standard_EXPORT Standard_Boolean LocalizeBefore (const Standard_Real From, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
101 //! Searches the first intersection point located
102 //! after the index <FromInd> ( >= FromInd + 1), wich
103 //! orientation is not TopAbs_EXTERNAL. If found,
104 //! returns <Standard_True>. <Or> contains the
105 //! orientation of the point, <IndFrom> and <IndTo>
106 //! represents the interval of index in the sequence
107 //! of intersection point corresponding to the
108 //! point. (IndFrom <= IndTo).
110 //! Otherwise, returns <Standard_False>.
111 Standard_EXPORT Standard_Boolean LocalizeAfter (const Standard_Integer FromInd, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
113 //! Searches the first intersection point located
114 //! before the index <FromInd> ( <= FromInd -1), wich
115 //! orientation is not TopAbs_EXTERNAL. If found,
116 //! returns <Standard_True>. <Or> contains the
117 //! orientation of the point, <IndFrom> and <IndTo>
118 //! represents the interval of index in the sequence
119 //! of intersection point corresponding to the point
120 //! (IndFrom <= IndTo).
122 //! Otherwise, returns <Standard_False>.
123 Standard_EXPORT Standard_Boolean LocalizeBefore (const Standard_Integer FromInd, TopAbs_Orientation& Or, Standard_Integer& IndFrom, Standard_Integer& IndTo) const;
138 Standard_Boolean myDone;
139 LocOpe_SequenceOfPntFace myPoints;
145 #include <LocOpe_CurveShapeIntersector.lxx>
151 #endif // _LocOpe_CurveShapeIntersector_HeaderFile