1 // Created by: Eugeny MALTCHIKOV
2 // Copyright (c) 2013-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
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.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <Precision.hxx>
16 #include <BRep_Tool.hxx>
18 //=======================================================================
19 //function : IntTools_EdgeEdge
21 //=======================================================================
22 inline IntTools_EdgeEdge::IntTools_EdgeEdge()
27 myFuzzyValue(Precision::Confusion()),
36 mySwap(Standard_False),
38 myQuickCoincidenceCheck(Standard_False)
41 //=======================================================================
42 //function : IntTools_EdgeEdge
44 //=======================================================================
45 inline IntTools_EdgeEdge::IntTools_EdgeEdge(const TopoDS_Edge& theEdge1,
46 const TopoDS_Edge& theEdge2)
53 myFuzzyValue(Precision::Confusion()),
62 mySwap(Standard_False),
64 myQuickCoincidenceCheck(Standard_False)
67 //=======================================================================
68 //function : IntTools_EdgeEdge
70 //=======================================================================
71 inline IntTools_EdgeEdge::IntTools_EdgeEdge(const TopoDS_Edge& theEdge1,
72 const Standard_Real aT11,
73 const Standard_Real aT12,
74 const TopoDS_Edge& theEdge2,
75 const Standard_Real aT21,
76 const Standard_Real aT22)
83 myFuzzyValue(Precision::Confusion()),
92 mySwap(Standard_False),
94 myQuickCoincidenceCheck(Standard_False)
97 //=======================================================================
98 //function : IntTools_EdgeEdge
100 //=======================================================================
101 inline IntTools_EdgeEdge::~IntTools_EdgeEdge()
104 //=======================================================================
105 //function : SetEdge1
107 //=======================================================================
108 inline void IntTools_EdgeEdge::SetEdge1(const TopoDS_Edge& theEdge)
112 //=======================================================================
113 //function : SetRange1
115 //=======================================================================
116 inline void IntTools_EdgeEdge::SetRange1(const IntTools_Range& theRange)
120 //=======================================================================
121 //function : SetRange1
123 //=======================================================================
124 inline void IntTools_EdgeEdge::SetRange1(const Standard_Real aT1,
125 const Standard_Real aT2)
127 myRange1.SetFirst(aT1);
128 myRange1.SetLast(aT2);
130 //=======================================================================
131 //function : SetEdge1
133 //=======================================================================
134 inline void IntTools_EdgeEdge::SetEdge1(const TopoDS_Edge& theEdge,
135 const Standard_Real aT1,
136 const Standard_Real aT2)
141 //=======================================================================
142 //function : SetEdge2
144 //=======================================================================
145 inline void IntTools_EdgeEdge::SetEdge2(const TopoDS_Edge& theEdge)
149 //=======================================================================
150 //function : SetRange1
152 //=======================================================================
153 inline void IntTools_EdgeEdge::SetRange2(const IntTools_Range& theRange)
157 //=======================================================================
158 //function : SetRange1
160 //=======================================================================
161 inline void IntTools_EdgeEdge::SetRange2(const Standard_Real aT1,
162 const Standard_Real aT2)
164 myRange2.SetFirst(aT1);
165 myRange2.SetLast(aT2);
167 //=======================================================================
168 //function : SetEdge1
170 //=======================================================================
171 inline void IntTools_EdgeEdge::SetEdge2(const TopoDS_Edge& theEdge,
172 const Standard_Real aT1,
173 const Standard_Real aT2)
178 //=======================================================================
179 //function : SetFuzzyValue
181 //=======================================================================
182 inline void IntTools_EdgeEdge::SetFuzzyValue(const Standard_Real theFuzz)
184 myFuzzyValue = Max(theFuzz, Precision::Confusion());
186 //=======================================================================
187 //function : FuzzyValue
189 //=======================================================================
190 inline Standard_Real IntTools_EdgeEdge::FuzzyValue() const
195 //=======================================================================
196 //function : CommonParts
198 //=======================================================================
199 inline const IntTools_SequenceOfCommonPrts& IntTools_EdgeEdge::CommonParts() const
201 return myCommonParts;
203 //=======================================================================
206 //=======================================================================
207 inline Standard_Boolean IntTools_EdgeEdge::IsDone() const
209 return (myErrorStatus == 0);
211 //=======================================================================
212 //function : CheckData
214 //=======================================================================
215 inline void IntTools_EdgeEdge::CheckData()
217 if (myEdge1.IsNull() || myEdge2.IsNull()) {
222 if (BRep_Tool::Degenerated(myEdge1) || BRep_Tool::Degenerated(myEdge2)) {
227 if (!BRep_Tool::IsGeometric(myEdge1) || !BRep_Tool::IsGeometric(myEdge2)) {