42cf5bc1 |
1 | // Created on: 1992-01-30 |
2 | // Created by: Didier PIFFAULT |
3 | // Copyright (c) 1992-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 _TopTrans_CurveTransition_HeaderFile |
18 | #define _TopTrans_CurveTransition_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
42cf5bc1 |
22 | |
23 | #include <gp_Dir.hxx> |
42cf5bc1 |
24 | #include <TopAbs_Orientation.hxx> |
25 | #include <TopAbs_State.hxx> |
42cf5bc1 |
26 | |
27 | |
28 | //! This algorithm is used to compute the transition |
29 | //! of a Curve intersecting a curvilinear boundary. |
30 | //! |
31 | //! The geometric elements are described locally at |
32 | //! the intersection point by a second order |
33 | //! development. |
34 | //! |
35 | //! The curve is described by the intersection point, |
36 | //! the tangent vector and the curvature. |
37 | //! |
38 | //! The boundary is described by a set of curve |
39 | //! elements, a curve element is either : |
40 | //! |
41 | //! - A curve. |
42 | //! |
43 | //! - A curve and an orientation called a half-curve, |
44 | //! the boundary of the curve is before or after the |
45 | //! intersection point depending on the orientation. |
46 | class TopTrans_CurveTransition |
47 | { |
48 | public: |
49 | |
50 | DEFINE_STANDARD_ALLOC |
51 | |
52 | |
53 | //! Create an empty Curve Transition. |
54 | Standard_EXPORT TopTrans_CurveTransition(); |
55 | |
56 | //! Initialize a Transition with the local description |
57 | //! of a Curve. |
58 | Standard_EXPORT void Reset (const gp_Dir& Tgt, const gp_Dir& Norm, const Standard_Real Curv); |
59 | |
03ca365a |
60 | //! Initialize a Transition with the local description of a straight line. |
42cf5bc1 |
61 | Standard_EXPORT void Reset (const gp_Dir& Tgt); |
62 | |
63 | //! Add a curve element to the boundary. If Or is |
64 | //! REVERSED the curve is before the intersection, |
65 | //! else if Or is FORWARD the curv is after the |
66 | //! intersection and if Or is INTERNAL the |
67 | //! intersection is in the middle of the curv. |
68 | Standard_EXPORT void Compare (const Standard_Real Tole, const gp_Dir& Tang, const gp_Dir& Norm, const Standard_Real Curv, const TopAbs_Orientation S, const TopAbs_Orientation Or); |
69 | |
70 | //! returns the state of the curve before the |
71 | //! intersection, this is the position relative to the |
72 | //! boundary of a point very close to the intersection |
73 | //! on the negative side of the tangent. |
74 | Standard_EXPORT TopAbs_State StateBefore() const; |
75 | |
76 | //! returns the state of the curve after the |
77 | //! intersection, this is the position relative to the |
78 | //! boundary of a point very close to the intersection |
79 | //! on the positive side of the tangent. |
80 | Standard_EXPORT TopAbs_State StateAfter() const; |
81 | |
82 | |
83 | |
84 | |
85 | protected: |
86 | |
87 | |
88 | |
89 | |
90 | |
91 | private: |
92 | |
93 | |
94 | //! Compare two curvature and return true if N1,C1 is |
95 | //! before N2,C2 in the edge orientation |
96 | Standard_EXPORT Standard_Boolean IsBefore (const Standard_Real Tole, const Standard_Real Angl, const gp_Dir& Nor1, const Standard_Real Cur1, const gp_Dir& Nor2, const Standard_Real Cur2) const; |
97 | |
98 | //! Compare two angles at tolerance Tole |
99 | Standard_EXPORT Standard_Integer Compare (const Standard_Real Ang1, const Standard_Real Ang2, const Standard_Real Tole) const; |
100 | |
101 | |
102 | gp_Dir myTgt; |
103 | gp_Dir myNorm; |
104 | Standard_Real myCurv; |
105 | Standard_Boolean Init; |
106 | gp_Dir TgtFirst; |
107 | gp_Dir NormFirst; |
108 | Standard_Real CurvFirst; |
109 | TopAbs_Orientation TranFirst; |
110 | gp_Dir TgtLast; |
111 | gp_Dir NormLast; |
112 | Standard_Real CurvLast; |
113 | TopAbs_Orientation TranLast; |
114 | |
115 | |
116 | }; |
117 | |
118 | |
119 | |
120 | |
121 | |
122 | |
123 | |
124 | #endif // _TopTrans_CurveTransition_HeaderFile |