0024784: Move documentation in CDL files to proper location
[occt.git] / src / TopCnx / TopCnx_EdgeFaceTransition.cxx
CommitLineData
b311480e 1// Created on: 1992-08-12
2// Created by: Remi LEQUETTE
3// Copyright (c) 1992-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <TopCnx_EdgeFaceTransition.ixx>
18
19
20//=======================================================================
21//function : TopCnx_EdgeFaceTransition
22//purpose :
23//=======================================================================
24
25TopCnx_EdgeFaceTransition::TopCnx_EdgeFaceTransition() :
26 nbBoundForward(0),
27 nbBoundReversed(0)
28{
29}
30
31//=======================================================================
32//function : Reset
33//purpose :
34//=======================================================================
35
36void TopCnx_EdgeFaceTransition::Reset(const gp_Dir& Tgt,
37 const gp_Dir& Norm,
38 const Standard_Real Curv)
39{
40 myCurveTransition.Reset(Tgt,Norm,Curv);
41 nbBoundForward = nbBoundReversed = 0;
42}
43
44//=======================================================================
45//function : Reset
46//purpose :
47//=======================================================================
48
49void TopCnx_EdgeFaceTransition::Reset(const gp_Dir& Tgt)
50{
51 myCurveTransition.Reset(Tgt);
52 nbBoundForward = nbBoundReversed = 0;
53}
54
55//=======================================================================
56//function : AddInterference
57//purpose :
58//=======================================================================
59
60void TopCnx_EdgeFaceTransition::AddInterference(const Standard_Real Tole,
61 const gp_Dir& Tang,
62 const gp_Dir& Norm,
63 const Standard_Real Curv,
64 const TopAbs_Orientation Or,
65 const TopAbs_Orientation Tr,
66 const TopAbs_Orientation BTr)
67{
68 myCurveTransition.Compare(Tole,Tang,Norm,Curv,Tr,Or);
69 switch (BTr) {
70
71 case TopAbs_FORWARD :
72 nbBoundForward++;
73 break;
74
75 case TopAbs_REVERSED :
76 nbBoundReversed++;
77 break;
78
79 case TopAbs_INTERNAL :
80 case TopAbs_EXTERNAL :
81 break;
82 }
83}
84
85//=======================================================================
86//function : Transition
87//purpose :
88//=======================================================================
89
90TopAbs_Orientation TopCnx_EdgeFaceTransition::Transition()const
91{
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;
99 else
100 cout << "\n*** Complex Transition : unprocessed state"<<endl;
101 }
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;
107 else
108 cout << "\n*** Complex Transition : unprocessed state"<<endl;
109 }
110 else
111 cout << "\n*** Complex Transition : unprocessed state"<<endl;
112 return TopAbs_INTERNAL;
113}
114
115//=======================================================================
116//function : BoundaryTransition
117//purpose :
118//=======================================================================
119
120TopAbs_Orientation TopCnx_EdgeFaceTransition::BoundaryTransition()const
121{
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;
128 else
129 return TopAbs_EXTERNAL;
130}
131
132