1 // Created on: 2000-10-27
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #include <IntTools_CommonPrt.ixx>
23 #include <IntTools_Range.hxx>
24 #include <IntTools_SequenceOfRanges.hxx>
26 //=======================================================================
27 //function : IntTools_CommonPrt::IntTools_CommonPr
29 //=======================================================================
30 IntTools_CommonPrt::IntTools_CommonPrt()
33 myAllNullFlag(Standard_False)
37 myPnt1.SetCoord(0.,0.,0.);
38 myPnt2.SetCoord(0.,0.,0.);
40 // modified by NIZHNY-MKK Wed Jun 8 16:47:04 2005.BEGIN
43 // modified by NIZHNY-MKK Wed Jun 8 16:47:07 2005.END
46 //=======================================================================
47 //function : IntTools_CommonPrt::IntTools_CommonPrt
49 //=======================================================================
50 IntTools_CommonPrt::IntTools_CommonPrt(const IntTools_CommonPrt& Other)
52 myEdge1(Other.myEdge1),
53 myEdge2(Other.myEdge2),
54 myType (Other.myType),
55 myRange1 (Other.myRange1),
56 myVertPar1(Other.myVertPar1),
57 myVertPar2(Other.myVertPar2),
58 myAllNullFlag(Standard_False),
64 Standard_Integer i, aNb=Other.myRanges2.Length();
65 for (i=1; i<=aNb; i++) {
66 myRanges2.Append(Other.myRanges2(i));
70 //=======================================================================
71 //function : IntTools_CommonPrt::Assign
73 //=======================================================================
74 IntTools_CommonPrt& IntTools_CommonPrt::Assign(const IntTools_CommonPrt& Other)
76 myEdge1=Other.myEdge1;
77 myEdge2=Other.myEdge2;
79 myRange1 =Other.myRange1;
80 myVertPar1=Other.myVertPar1;
81 myVertPar2=Other.myVertPar2;
86 Standard_Integer i, aNb=Other.myRanges2.Length();
87 for (i=1; i<=aNb; i++) {
88 myRanges2.Append(Other.myRanges2(i));
90 myAllNullFlag=Other.myAllNullFlag;
94 //=======================================================================
97 //=======================================================================
98 void IntTools_CommonPrt::SetEdge1(const TopoDS_Edge& anEdge)
103 //=======================================================================
104 //function : SetEdge2
106 //=======================================================================
107 void IntTools_CommonPrt::SetEdge2(const TopoDS_Edge& anEdge)
112 //=======================================================================
115 //=======================================================================
116 void IntTools_CommonPrt::SetType (const TopAbs_ShapeEnum aType)
121 //=======================================================================
122 //function : SetRange1
124 //=======================================================================
125 void IntTools_CommonPrt::SetRange1 (const IntTools_Range& aRange)
130 //=======================================================================
131 //function : SetRange1
133 //=======================================================================
134 void IntTools_CommonPrt::SetRange1 (const Standard_Real tf,
135 const Standard_Real tl)
137 myRange1.SetFirst(tf);
138 myRange1.SetLast (tl);
141 //=======================================================================
142 //function : AppendRange2
144 //=======================================================================
145 void IntTools_CommonPrt::AppendRange2 (const IntTools_Range& aRange)
147 myRanges2.Append(aRange);
149 //=======================================================================
150 //function : AppendRange2
152 //=======================================================================
153 void IntTools_CommonPrt::AppendRange2 (const Standard_Real tf,
154 const Standard_Real tl)
156 IntTools_Range aRange(tf, tl);
157 myRanges2.Append(aRange);
159 //=======================================================================
160 //function : SetVertexParameter1
162 //=======================================================================
163 void IntTools_CommonPrt::SetVertexParameter1(const Standard_Real tV)
167 //=======================================================================
168 //function : SetVertexParameter2
170 //=======================================================================
171 void IntTools_CommonPrt::SetVertexParameter2(const Standard_Real tV)
176 //=======================================================================
179 //=======================================================================
180 const TopoDS_Edge& IntTools_CommonPrt::Edge1() const
185 //=======================================================================
188 //=======================================================================
189 const TopoDS_Edge& IntTools_CommonPrt::Edge2() const
194 //=======================================================================
195 //function : TopAbs_ShapeEnum
197 //=======================================================================
198 TopAbs_ShapeEnum IntTools_CommonPrt::Type() const
203 //=======================================================================
206 //=======================================================================
207 const IntTools_Range& IntTools_CommonPrt::Range1() const
212 //=======================================================================
215 //=======================================================================
216 void IntTools_CommonPrt::Range1(Standard_Real& tf,
217 Standard_Real& tl) const
222 //=======================================================================
225 //=======================================================================
226 const IntTools_SequenceOfRanges& IntTools_CommonPrt::Ranges2() const
230 //=======================================================================
231 //function : ChangeRanges2
233 //=======================================================================
234 IntTools_SequenceOfRanges& IntTools_CommonPrt::ChangeRanges2()
239 //=======================================================================
240 //function : VertexParameter1
242 //=======================================================================
243 Standard_Real IntTools_CommonPrt::VertexParameter1() const
247 //=======================================================================
248 //function : VertexParameter2
250 //=======================================================================
251 Standard_Real IntTools_CommonPrt::VertexParameter2() const
256 //=======================================================================
259 //=======================================================================
260 void IntTools_CommonPrt::Copy(IntTools_CommonPrt& aCP) const
262 aCP.SetEdge1(Edge1());
263 aCP.SetEdge2(Edge2());
264 aCP.SetType (Type());
265 aCP.SetRange1(Range1());
266 aCP.SetVertexParameter1(myVertPar1);
267 aCP.SetVertexParameter2(myVertPar2);
269 IntTools_SequenceOfRanges aSeqRanges;
270 Standard_Integer i, aNb;
271 aNb=myRanges2.Length();
272 for (i=1; i<=aNb; i++) {
273 aCP.AppendRange2(myRanges2(i));
277 //=======================================================================
278 //function : SetAllNullFlag
280 //=======================================================================
281 void IntTools_CommonPrt::SetAllNullFlag(const Standard_Boolean aFlag)
286 //=======================================================================
287 //function : AllNullFlag
289 //=======================================================================
290 Standard_Boolean IntTools_CommonPrt::AllNullFlag()const
292 return myAllNullFlag;
296 //=======================================================================
297 //function : SetBoundingPoints
299 //=======================================================================
300 void IntTools_CommonPrt::SetBoundingPoints(const gp_Pnt& aP1,
306 //=======================================================================
307 //function : BoundingPoints
309 //=======================================================================
310 void IntTools_CommonPrt::BoundingPoints(gp_Pnt& aP1,