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
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 _TopTrans_CurveTransition_HeaderFile
18 #define _TopTrans_CurveTransition_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TopAbs_Orientation.hxx>
28 #include <TopAbs_State.hxx>
29 #include <Standard_Integer.hxx>
33 //! This algorithm is used to compute the transition
34 //! of a Curve intersecting a curvilinear boundary.
36 //! The geometric elements are described locally at
37 //! the intersection point by a second order
40 //! The curve is described by the intersection point,
41 //! the tangent vector and the curvature.
43 //! The boundary is described by a set of curve
44 //! elements, a curve element is either :
48 //! - A curve and an orientation called a half-curve,
49 //! the boundary of the curve is before or after the
50 //! intersection point depending on the orientation.
51 class TopTrans_CurveTransition
58 //! Create an empty Curve Transition.
59 Standard_EXPORT TopTrans_CurveTransition();
61 //! Initialize a Transition with the local description
63 Standard_EXPORT void Reset (const gp_Dir& Tgt, const gp_Dir& Norm, const Standard_Real Curv);
65 //! Initialize a Transition with the local description
66 //! of a straigth line.
67 Standard_EXPORT void Reset (const gp_Dir& Tgt);
69 //! Add a curve element to the boundary. If Or is
70 //! REVERSED the curve is before the intersection,
71 //! else if Or is FORWARD the curv is after the
72 //! intersection and if Or is INTERNAL the
73 //! intersection is in the middle of the curv.
74 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);
76 //! returns the state of the curve before the
77 //! intersection, this is the position relative to the
78 //! boundary of a point very close to the intersection
79 //! on the negative side of the tangent.
80 Standard_EXPORT TopAbs_State StateBefore() const;
82 //! returns the state of the curve after the
83 //! intersection, this is the position relative to the
84 //! boundary of a point very close to the intersection
85 //! on the positive side of the tangent.
86 Standard_EXPORT TopAbs_State StateAfter() const;
100 //! Compare two curvature and return true if N1,C1 is
101 //! before N2,C2 in the edge orientation
102 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;
104 //! Compare two angles at tolerance Tole
105 Standard_EXPORT Standard_Integer Compare (const Standard_Real Ang1, const Standard_Real Ang2, const Standard_Real Tole) const;
110 Standard_Real myCurv;
111 Standard_Boolean Init;
114 Standard_Real CurvFirst;
115 TopAbs_Orientation TranFirst;
118 Standard_Real CurvLast;
119 TopAbs_Orientation TranLast;
130 #endif // _TopTrans_CurveTransition_HeaderFile