1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Geom2d_Curve.hxx>
16 #include <Geom_BoundedCurve.hxx>
17 #include <Geom_Curve.hxx>
18 #include <GeomAdaptor_Curve.hxx>
20 #include <IntTools_Curve.hxx>
22 //=======================================================================
23 //function : IntTools_Curve::IntTools_Curve
25 //=======================================================================
26 IntTools_Curve::IntTools_Curve()
29 //=======================================================================
30 //function : IntTools_Curve::IntTools_Curve
32 //=======================================================================
33 IntTools_Curve::IntTools_Curve(const Handle(Geom_Curve)& Curve3d,
34 const Handle(Geom2d_Curve)& FirstCurve2d,
35 const Handle(Geom2d_Curve)& SecondCurve2d)
37 SetCurves(Curve3d, FirstCurve2d, SecondCurve2d);
39 //=======================================================================
40 //function : SetCurves
42 //=======================================================================
43 void IntTools_Curve::SetCurves(const Handle(Geom_Curve)& Curve3d,
44 const Handle(Geom2d_Curve)& FirstCurve2d,
45 const Handle(Geom2d_Curve)& SecondCurve2d)
48 SetFirstCurve2d(FirstCurve2d);
49 SetSecondCurve2d(SecondCurve2d);
52 //=======================================================================
53 //function : HasBounds
55 //=======================================================================
56 Standard_Boolean IntTools_Curve::HasBounds() const
58 Standard_Boolean bBounded;
60 Handle(Geom_BoundedCurve) aC3DBounded =
61 Handle(Geom_BoundedCurve)::DownCast(my3dCurve);
63 bBounded=!aC3DBounded.IsNull();
68 //=======================================================================
71 //=======================================================================
72 void IntTools_Curve::Bounds(Standard_Real& aT1,
79 aP1.SetCoord(0.,0.,0.);
80 aP2.SetCoord(0.,0.,0.);
82 aT1=my3dCurve->FirstParameter();
83 aT2=my3dCurve->LastParameter();
84 my3dCurve->D0(aT1, aP1);
85 my3dCurve->D0(aT2, aP2);
89 //=======================================================================
92 //=======================================================================
93 Standard_Boolean IntTools_Curve::D0(Standard_Real& aT,
98 aF=my3dCurve->FirstParameter();
99 aL=my3dCurve->LastParameter();
100 if (aT<aF || aT>aL) {
101 return Standard_False;
103 my3dCurve->D0(aT, aP);
104 return Standard_True;
107 //=======================================================================
110 //=======================================================================
111 GeomAbs_CurveType IntTools_Curve::Type() const
113 GeomAdaptor_Curve aGAC(my3dCurve);
114 GeomAbs_CurveType aType=aGAC.GetType();