0026586: Eliminate compile warnings obtained by building occt with vc14: declaration...
[occt.git] / src / IntTools / IntTools_EdgeEdge.lxx
1 // Created by: Eugeny MALTCHIKOV
2 // Copyright (c) 2013-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 #include <Precision.hxx>
16 #include <BRep_Tool.hxx>
17
18 //=======================================================================
19 //function : IntTools_EdgeEdge
20 //purpose  : 
21 //=======================================================================
22 inline IntTools_EdgeEdge::IntTools_EdgeEdge()
23
24   myTol1(0.),
25   myTol2(0.),
26   myTol(0.),
27   myRes1(0.),
28   myRes2(0.),
29   myResCoeff1(0.),
30   myResCoeff2(0.),
31   myPTol1(0.),
32   myPTol2(0.),
33   myRange1(0., 0.),
34   myRange2(0., 0.),
35   mySwap(Standard_False),
36   myErrorStatus(0)
37 {
38 }
39 //=======================================================================
40 //function : IntTools_EdgeEdge
41 //purpose  : 
42 //=======================================================================
43 inline IntTools_EdgeEdge::IntTools_EdgeEdge(const TopoDS_Edge&  theEdge1,
44                                             const TopoDS_Edge&  theEdge2)
45
46   myEdge1(theEdge1), 
47   myEdge2(theEdge2),
48   myTol1(0.),
49   myTol2(0.),
50   myTol(0.),
51   myRes1(0.),
52   myRes2(0.),
53   myResCoeff1(0.),
54   myResCoeff2(0.),
55   myPTol1(0.),
56   myPTol2(0.),
57   myRange1(0., 0.),
58   myRange2(0., 0.),
59   mySwap(Standard_False),
60   myErrorStatus(0)
61 {
62 }
63 //=======================================================================
64 //function : IntTools_EdgeEdge
65 //purpose  : 
66 //=======================================================================
67 inline IntTools_EdgeEdge::IntTools_EdgeEdge(const TopoDS_Edge&  theEdge1,
68                                             const Standard_Real aT11,
69                                             const Standard_Real aT12,
70                                             const TopoDS_Edge&  theEdge2,
71                                             const Standard_Real aT21,
72                                             const Standard_Real aT22)
73
74   myEdge1(theEdge1), 
75   myEdge2(theEdge2),
76   myTol1(0.),
77   myTol2(0.),
78   myTol(0.),
79   myRes1(0.),
80   myRes2(0.),
81   myResCoeff1(0.),
82   myResCoeff2(0.),
83   myPTol1(0.),
84   myPTol2(0.),
85   myRange1(aT11, aT12),
86   myRange2(aT21, aT22),
87   mySwap(Standard_False),
88   myErrorStatus(0)
89 {
90 }
91 //=======================================================================
92 //function : IntTools_EdgeEdge
93 //purpose  : 
94 //=======================================================================
95 inline IntTools_EdgeEdge::~IntTools_EdgeEdge()
96 {
97 }
98 //=======================================================================
99 //function : SetEdge1
100 //purpose  : 
101 //=======================================================================
102 inline void IntTools_EdgeEdge::SetEdge1(const TopoDS_Edge& theEdge)
103 {
104   myEdge1 = theEdge;
105 }
106 //=======================================================================
107 //function : SetRange1
108 //purpose  : 
109 //=======================================================================
110 inline void IntTools_EdgeEdge::SetRange1(const IntTools_Range& theRange)
111 {
112   myRange1 = theRange;
113 }
114 //=======================================================================
115 //function : SetRange1
116 //purpose  : 
117 //=======================================================================
118 inline void IntTools_EdgeEdge::SetRange1(const Standard_Real aT1,
119                                          const Standard_Real aT2)
120 {
121   myRange1.SetFirst(aT1);
122   myRange1.SetLast(aT2);
123 }
124 //=======================================================================
125 //function : SetEdge1
126 //purpose  : 
127 //=======================================================================
128 inline void IntTools_EdgeEdge::SetEdge1(const TopoDS_Edge&  theEdge,
129                                         const Standard_Real aT1,
130                                         const Standard_Real aT2)
131 {
132   SetEdge1(theEdge);
133   SetRange1(aT1, aT2);
134 }
135 //=======================================================================
136 //function : SetEdge2
137 //purpose  : 
138 //=======================================================================
139 inline void IntTools_EdgeEdge::SetEdge2(const TopoDS_Edge& theEdge)
140 {
141   myEdge2 = theEdge;
142 }
143 //=======================================================================
144 //function : SetRange1
145 //purpose  : 
146 //=======================================================================
147 inline void IntTools_EdgeEdge::SetRange2(const IntTools_Range& theRange)
148 {
149   myRange2 = theRange;
150 }
151 //=======================================================================
152 //function : SetRange1
153 //purpose  : 
154 //=======================================================================
155 inline void IntTools_EdgeEdge::SetRange2(const Standard_Real aT1,
156                                          const Standard_Real aT2)
157 {
158   myRange2.SetFirst(aT1);
159   myRange2.SetLast(aT2);
160 }
161 //=======================================================================
162 //function : SetEdge1
163 //purpose  : 
164 //=======================================================================
165 inline void IntTools_EdgeEdge::SetEdge2(const TopoDS_Edge&  theEdge,
166                                         const Standard_Real aT1,
167                                         const Standard_Real aT2)
168 {
169   SetEdge2(theEdge);
170   SetRange2(aT1, aT2);
171 }
172 //=======================================================================
173 //function : CommonParts
174 //purpose  : 
175 //=======================================================================
176 inline const IntTools_SequenceOfCommonPrts& IntTools_EdgeEdge::CommonParts() const
177 {
178   return myCommonParts;
179 }
180 //=======================================================================
181 //function : IsDone
182 //purpose  : 
183 //=======================================================================
184 inline Standard_Boolean IntTools_EdgeEdge::IsDone() const
185 {
186   return (myErrorStatus == 0);
187 }
188 //=======================================================================
189 //function : CheckData
190 //purpose  : 
191 //=======================================================================
192 inline void IntTools_EdgeEdge::CheckData()
193 {
194   if (myEdge1.IsNull() || myEdge2.IsNull()) {
195     myErrorStatus = 1;
196     return;
197   }
198   //
199   if (BRep_Tool::Degenerated(myEdge1) || BRep_Tool::Degenerated(myEdge2)) {
200     myErrorStatus = 2;
201     return;
202   }
203   //
204   if (!BRep_Tool::IsGeometric(myEdge1) || !BRep_Tool::IsGeometric(myEdge2)) { 
205     myErrorStatus = 3;
206     return;
207   }
208 }
209