0025418: Debug output to be limited to OCC development environment
[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;
0797d9d3 99#ifdef OCCT_DEBUG
7fd59977 100 else
101 cout << "\n*** Complex Transition : unprocessed state"<<endl;
63c629aa 102#endif
7fd59977 103 }
104 else if (Bef == TopAbs_OUT) {
105 if (Aft == TopAbs_IN )
106 return TopAbs_FORWARD;
107 else if (Aft == TopAbs_OUT)
108 return TopAbs_EXTERNAL;
0797d9d3 109#ifdef OCCT_DEBUG
7fd59977 110 else
111 cout << "\n*** Complex Transition : unprocessed state"<<endl;
63c629aa 112#endif
7fd59977 113 }
0797d9d3 114#ifdef OCCT_DEBUG
7fd59977 115 else
116 cout << "\n*** Complex Transition : unprocessed state"<<endl;
63c629aa 117#endif
7fd59977 118 return TopAbs_INTERNAL;
119}
120
121//=======================================================================
122//function : BoundaryTransition
123//purpose :
124//=======================================================================
125
126TopAbs_Orientation TopCnx_EdgeFaceTransition::BoundaryTransition()const
127{
128 if (nbBoundForward > nbBoundReversed)
129 return TopAbs_FORWARD;
130 else if (nbBoundForward < nbBoundReversed)
131 return TopAbs_REVERSED;
132 else if ((nbBoundReversed % 2) == 0)
133 return TopAbs_EXTERNAL;
134 else
135 return TopAbs_EXTERNAL;
136}
137
138