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
6 // under the terms of the GNU Lesser General Public 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.
14 #include <IntTools_Curve.ixx>
15 #include <Geom_BoundedCurve.hxx>
16 #include <GeomAdaptor_Curve.hxx>
18 //=======================================================================
19 //function : IntTools_Curve::IntTools_Curve
21 //=======================================================================
22 IntTools_Curve::IntTools_Curve()
25 //=======================================================================
26 //function : IntTools_Curve::IntTools_Curve
28 //=======================================================================
29 IntTools_Curve::IntTools_Curve(const Handle(Geom_Curve)& Curve3d,
30 const Handle(Geom2d_Curve)& FirstCurve2d,
31 const Handle(Geom2d_Curve)& SecondCurve2d)
33 SetCurves(Curve3d, FirstCurve2d, SecondCurve2d);
35 //=======================================================================
36 //function : SetCurves
38 //=======================================================================
39 void IntTools_Curve::SetCurves(const Handle(Geom_Curve)& Curve3d,
40 const Handle(Geom2d_Curve)& FirstCurve2d,
41 const Handle(Geom2d_Curve)& SecondCurve2d)
44 SetFirstCurve2d(FirstCurve2d);
45 SetSecondCurve2d(SecondCurve2d);
48 //=======================================================================
49 //function : HasBounds
51 //=======================================================================
52 Standard_Boolean IntTools_Curve::HasBounds() const
54 Standard_Boolean bBounded;
56 Handle(Geom_BoundedCurve) aC3DBounded =
57 Handle(Geom_BoundedCurve)::DownCast(my3dCurve);
59 bBounded=!aC3DBounded.IsNull();
64 //=======================================================================
67 //=======================================================================
68 void IntTools_Curve::Bounds(Standard_Real& aT1,
75 aP1.SetCoord(0.,0.,0.);
76 aP2.SetCoord(0.,0.,0.);
78 aT1=my3dCurve->FirstParameter();
79 aT2=my3dCurve->LastParameter();
80 my3dCurve->D0(aT1, aP1);
81 my3dCurve->D0(aT2, aP2);
85 //=======================================================================
88 //=======================================================================
89 Standard_Boolean IntTools_Curve::D0(Standard_Real& aT,
94 aF=my3dCurve->FirstParameter();
95 aL=my3dCurve->LastParameter();
97 return Standard_False;
99 my3dCurve->D0(aT, aP);
100 return Standard_True;
103 //=======================================================================
106 //=======================================================================
107 GeomAbs_CurveType IntTools_Curve::Type() const
109 GeomAdaptor_Curve aGAC(my3dCurve);
110 GeomAbs_CurveType aType=aGAC.GetType();