1 // Created on: 1992-08-12
2 // Created by: Remi LEQUETTE
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 #include <TopCnx_EdgeFaceTransition.ixx>
20 //=======================================================================
21 //function : TopCnx_EdgeFaceTransition
23 //=======================================================================
25 TopCnx_EdgeFaceTransition::TopCnx_EdgeFaceTransition() :
31 //=======================================================================
34 //=======================================================================
36 void TopCnx_EdgeFaceTransition::Reset(const gp_Dir& Tgt,
38 const Standard_Real Curv)
40 myCurveTransition.Reset(Tgt,Norm,Curv);
41 nbBoundForward = nbBoundReversed = 0;
44 //=======================================================================
47 //=======================================================================
49 void TopCnx_EdgeFaceTransition::Reset(const gp_Dir& Tgt)
51 myCurveTransition.Reset(Tgt);
52 nbBoundForward = nbBoundReversed = 0;
55 //=======================================================================
56 //function : AddInterference
58 //=======================================================================
60 void TopCnx_EdgeFaceTransition::AddInterference(const Standard_Real Tole,
63 const Standard_Real Curv,
64 const TopAbs_Orientation Or,
65 const TopAbs_Orientation Tr,
66 const TopAbs_Orientation BTr)
68 myCurveTransition.Compare(Tole,Tang,Norm,Curv,Tr,Or);
75 case TopAbs_REVERSED :
79 case TopAbs_INTERNAL :
80 case TopAbs_EXTERNAL :
85 //=======================================================================
86 //function : Transition
88 //=======================================================================
90 TopAbs_Orientation TopCnx_EdgeFaceTransition::Transition()const
92 TopAbs_State Bef = myCurveTransition.StateBefore();
93 TopAbs_State Aft = myCurveTransition.StateAfter();
94 if (Bef == TopAbs_IN) {
95 if (Aft == TopAbs_IN )
96 return TopAbs_INTERNAL;
97 else if (Aft == TopAbs_OUT)
98 return TopAbs_REVERSED;
100 cout << "\n*** Complex Transition : unprocessed state"<<endl;
102 else if (Bef == TopAbs_OUT) {
103 if (Aft == TopAbs_IN )
104 return TopAbs_FORWARD;
105 else if (Aft == TopAbs_OUT)
106 return TopAbs_EXTERNAL;
108 cout << "\n*** Complex Transition : unprocessed state"<<endl;
111 cout << "\n*** Complex Transition : unprocessed state"<<endl;
112 return TopAbs_INTERNAL;
115 //=======================================================================
116 //function : BoundaryTransition
118 //=======================================================================
120 TopAbs_Orientation TopCnx_EdgeFaceTransition::BoundaryTransition()const
122 if (nbBoundForward > nbBoundReversed)
123 return TopAbs_FORWARD;
124 else if (nbBoundForward < nbBoundReversed)
125 return TopAbs_REVERSED;
126 else if ((nbBoundReversed % 2) == 0)
127 return TopAbs_EXTERNAL;
129 return TopAbs_EXTERNAL;