1 // Created on: 1992-04-03
2 // Created by: Laurent BUCHARD
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 _IntRes2d_Transition_HeaderFile
18 #define _IntRes2d_Transition_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <IntRes2d_Position.hxx>
26 #include <IntRes2d_TypeTrans.hxx>
27 #include <IntRes2d_Situation.hxx>
28 class Standard_DomainError;
31 //! Definition of the type of transition near an
32 //! intersection point between two curves. The transition
33 //! is either a "true transition", which means that one of
34 //! the curves goes inside or outside the area defined by
35 //! the other curve near the intersection, or a "touch
36 //! transition" which means that the first curve does not
37 //! cross the other one, or an "undecided" transition,
38 //! which means that the curves are superposed.
39 class IntRes2d_Transition
46 //! Empty constructor.
47 Standard_EXPORT IntRes2d_Transition();
49 //! Creates an IN or OUT transition.
50 IntRes2d_Transition(const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_TypeTrans Type);
52 //! Creates a TOUCH transition.
53 IntRes2d_Transition(const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_Situation Situ, const Standard_Boolean Oppos);
55 //! Creates an UNDECIDED transition.
56 IntRes2d_Transition(const IntRes2d_Position Pos);
58 //! Sets the values of an IN or OUT transition.
59 void SetValue (const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_TypeTrans Type);
61 //! Sets the values of a TOUCH transition.
62 void SetValue (const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_Situation Situ, const Standard_Boolean Oppos);
64 //! Sets the values of an UNDECIDED transition.
65 void SetValue (const IntRes2d_Position Pos);
67 //! Sets the value of the position.
68 void SetPosition (const IntRes2d_Position Pos);
70 //! Indicates if the intersection is at the beginning
71 //! (IntRes2d_Head), at the end (IntRes2d_End), or in
72 //! the middle (IntRes2d_Middle) of the curve.
73 IntRes2d_Position PositionOnCurve() const;
75 //! Returns the type of transition at the intersection.
76 //! It may be IN or OUT or TOUCH, or UNDECIDED if the
77 //! two first derivatives are not enough to give
78 //! the tangent to one of the two curves.
79 IntRes2d_TypeTrans TransitionType() const;
81 //! Returns TRUE when the 2 curves are tangent at the
82 //! intersection point.
83 //! Theexception DomainError is raised if the type of
84 //! transition is UNDECIDED.
85 Standard_Boolean IsTangent() const;
87 //! returns a significant value if TransitionType returns
88 //! TOUCH. In this case, the function returns :
89 //! INSIDE when the curve remains inside the other one,
90 //! OUTSIDE when it remains outside the other one,
91 //! UNKNOWN when the calculus, based on the second derivatives
92 //! cannot give the result.
93 //! If TransitionType returns IN or OUT or UNDECIDED, the
94 //! exception DomainError is raised.
95 IntRes2d_Situation Situation() const;
97 //! returns a significant value if TransitionType
98 //! returns TOUCH. In this case, the function returns
99 //! true when the 2 curves locally define two
100 //! different parts of the space. If TransitionType
101 //! returns IN or OUT or UNDECIDED, the exception
102 //! DomainError is raised.
103 Standard_Boolean IsOpposite() const;
118 Standard_Boolean tangent;
119 IntRes2d_Position posit;
120 IntRes2d_TypeTrans typetra;
121 IntRes2d_Situation situat;
122 Standard_Boolean oppos;
128 #include <IntRes2d_Transition.lxx>
134 #endif // _IntRes2d_Transition_HeaderFile