1 // Created on: 2000-10-27
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
18 #include <IntTools_CommonPrt.hxx>
19 #include <IntTools_Range.hxx>
20 #include <IntTools_SequenceOfRanges.hxx>
21 #include <TopoDS_Edge.hxx>
23 //=======================================================================
24 //function : IntTools_CommonPrt::IntTools_CommonPr
26 //=======================================================================
27 IntTools_CommonPrt::IntTools_CommonPrt()
30 myAllNullFlag(Standard_False)
34 myPnt1.SetCoord(0.,0.,0.);
35 myPnt2.SetCoord(0.,0.,0.);
37 // modified by NIZHNY-MKK Wed Jun 8 16:47:04 2005.BEGIN
40 // modified by NIZHNY-MKK Wed Jun 8 16:47:07 2005.END
43 //=======================================================================
44 //function : IntTools_CommonPrt::IntTools_CommonPrt
46 //=======================================================================
47 IntTools_CommonPrt::IntTools_CommonPrt(const IntTools_CommonPrt& Other)
49 myEdge1(Other.myEdge1),
50 myEdge2(Other.myEdge2),
51 myType (Other.myType),
52 myRange1 (Other.myRange1),
53 myVertPar1(Other.myVertPar1),
54 myVertPar2(Other.myVertPar2),
55 myAllNullFlag(Standard_False),
61 Standard_Integer i, aNb=Other.myRanges2.Length();
62 for (i=1; i<=aNb; i++) {
63 myRanges2.Append(Other.myRanges2(i));
67 //=======================================================================
68 //function : IntTools_CommonPrt::Assign
70 //=======================================================================
71 IntTools_CommonPrt& IntTools_CommonPrt::Assign(const IntTools_CommonPrt& Other)
73 myEdge1=Other.myEdge1;
74 myEdge2=Other.myEdge2;
76 myRange1 =Other.myRange1;
77 myVertPar1=Other.myVertPar1;
78 myVertPar2=Other.myVertPar2;
83 Standard_Integer i, aNb=Other.myRanges2.Length();
84 for (i=1; i<=aNb; i++) {
85 myRanges2.Append(Other.myRanges2(i));
87 myAllNullFlag=Other.myAllNullFlag;
91 //=======================================================================
94 //=======================================================================
95 void IntTools_CommonPrt::SetEdge1(const TopoDS_Edge& anEdge)
100 //=======================================================================
101 //function : SetEdge2
103 //=======================================================================
104 void IntTools_CommonPrt::SetEdge2(const TopoDS_Edge& anEdge)
109 //=======================================================================
112 //=======================================================================
113 void IntTools_CommonPrt::SetType (const TopAbs_ShapeEnum aType)
118 //=======================================================================
119 //function : SetRange1
121 //=======================================================================
122 void IntTools_CommonPrt::SetRange1 (const IntTools_Range& aRange)
127 //=======================================================================
128 //function : SetRange1
130 //=======================================================================
131 void IntTools_CommonPrt::SetRange1 (const Standard_Real tf,
132 const Standard_Real tl)
134 myRange1.SetFirst(tf);
135 myRange1.SetLast (tl);
138 //=======================================================================
139 //function : AppendRange2
141 //=======================================================================
142 void IntTools_CommonPrt::AppendRange2 (const IntTools_Range& aRange)
144 myRanges2.Append(aRange);
146 //=======================================================================
147 //function : AppendRange2
149 //=======================================================================
150 void IntTools_CommonPrt::AppendRange2 (const Standard_Real tf,
151 const Standard_Real tl)
153 IntTools_Range aRange(tf, tl);
154 myRanges2.Append(aRange);
156 //=======================================================================
157 //function : SetVertexParameter1
159 //=======================================================================
160 void IntTools_CommonPrt::SetVertexParameter1(const Standard_Real tV)
164 //=======================================================================
165 //function : SetVertexParameter2
167 //=======================================================================
168 void IntTools_CommonPrt::SetVertexParameter2(const Standard_Real tV)
173 //=======================================================================
176 //=======================================================================
177 const TopoDS_Edge& IntTools_CommonPrt::Edge1() const
182 //=======================================================================
185 //=======================================================================
186 const TopoDS_Edge& IntTools_CommonPrt::Edge2() const
191 //=======================================================================
192 //function : TopAbs_ShapeEnum
194 //=======================================================================
195 TopAbs_ShapeEnum IntTools_CommonPrt::Type() const
200 //=======================================================================
203 //=======================================================================
204 const IntTools_Range& IntTools_CommonPrt::Range1() const
209 //=======================================================================
212 //=======================================================================
213 void IntTools_CommonPrt::Range1(Standard_Real& tf,
214 Standard_Real& tl) const
219 //=======================================================================
222 //=======================================================================
223 const IntTools_SequenceOfRanges& IntTools_CommonPrt::Ranges2() const
227 //=======================================================================
228 //function : ChangeRanges2
230 //=======================================================================
231 IntTools_SequenceOfRanges& IntTools_CommonPrt::ChangeRanges2()
236 //=======================================================================
237 //function : VertexParameter1
239 //=======================================================================
240 Standard_Real IntTools_CommonPrt::VertexParameter1() const
244 //=======================================================================
245 //function : VertexParameter2
247 //=======================================================================
248 Standard_Real IntTools_CommonPrt::VertexParameter2() const
253 //=======================================================================
256 //=======================================================================
257 void IntTools_CommonPrt::Copy(IntTools_CommonPrt& aCP) const
259 aCP.SetEdge1(Edge1());
260 aCP.SetEdge2(Edge2());
261 aCP.SetType (Type());
262 aCP.SetRange1(Range1());
263 aCP.SetVertexParameter1(myVertPar1);
264 aCP.SetVertexParameter2(myVertPar2);
266 IntTools_SequenceOfRanges aSeqRanges;
267 Standard_Integer i, aNb;
268 aNb=myRanges2.Length();
269 for (i=1; i<=aNb; i++) {
270 aCP.AppendRange2(myRanges2(i));
274 //=======================================================================
275 //function : SetAllNullFlag
277 //=======================================================================
278 void IntTools_CommonPrt::SetAllNullFlag(const Standard_Boolean aFlag)
283 //=======================================================================
284 //function : AllNullFlag
286 //=======================================================================
287 Standard_Boolean IntTools_CommonPrt::AllNullFlag()const
289 return myAllNullFlag;
293 //=======================================================================
294 //function : SetBoundingPoints
296 //=======================================================================
297 void IntTools_CommonPrt::SetBoundingPoints(const gp_Pnt& aP1,
303 //=======================================================================
304 //function : BoundingPoints
306 //=======================================================================
307 void IntTools_CommonPrt::BoundingPoints(gp_Pnt& aP1,