0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / LocOpe / LocOpe_CurveShapeIntersector.hxx
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
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 _LocOpe_CurveShapeIntersector_HeaderFile
18 #define _LocOpe_CurveShapeIntersector_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
31 class gp_Ax1;
32 class TopoDS_Shape;
33 class gp_Circ;
34 class LocOpe_PntFace;
35
36
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 
42 {
43 public:
44
45   DEFINE_STANDARD_ALLOC
46
47   
48   //! Empty constructor.
49     LocOpe_CurveShapeIntersector();
50   
51   //! Creates  and performs the intersection     betwwen
52   //! <Ax1> and <S>.
53     LocOpe_CurveShapeIntersector(const gp_Ax1& Axis, const TopoDS_Shape& S);
54   
55   //! Creates  and performs yte intersection     betwwen
56   //! <C> and <S>.
57     LocOpe_CurveShapeIntersector(const gp_Circ& C, const TopoDS_Shape& S);
58   
59   //! Performs the intersection between <Ax1 and <S>.
60   Standard_EXPORT void Init (const gp_Ax1& Axis, const TopoDS_Shape& S);
61   
62   //! Performs the intersection between <Ax1 and <S>.
63   Standard_EXPORT void Init (const gp_Circ& C, const TopoDS_Shape& S);
64   
65   //! Returns <Standard_True>  if the  intersection  has
66   //! been done.
67     Standard_Boolean IsDone() const;
68   
69   //! Returns the number of intersection point.
70     Standard_Integer NbPoints() const;
71   
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;
76   
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  <=
84   //! IndTo).
85   //!
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;
88   
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  <=
96   //! IndTo).
97   //!
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;
100   
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).
109   //!
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;
112   
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).
121   //!
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;
124
125
126
127
128 protected:
129
130
131
132
133
134 private:
135
136
137
138   Standard_Boolean myDone;
139   LocOpe_SequenceOfPntFace myPoints;
140
141
142 };
143
144
145 #include <LocOpe_CurveShapeIntersector.lxx>
146
147
148
149
150
151 #endif // _LocOpe_CurveShapeIntersector_HeaderFile