1 // Created on: 1995-11-03
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <Adaptor3d_HCurve.hxx>
19 #include <GeomFill_SimpleBound.hxx>
23 #include <Law_BSpFunc.hxx>
24 #include <Law_Function.hxx>
25 #include <Standard_Type.hxx>
27 IMPLEMENT_STANDARD_RTTIEXT(GeomFill_SimpleBound,GeomFill_Boundary)
29 //=======================================================================
30 //function : GeomFill_SimpleBound
32 //=======================================================================
33 GeomFill_SimpleBound::GeomFill_SimpleBound
34 (const Handle(Adaptor3d_HCurve)& Curve,
35 const Standard_Real Tol3d,
36 const Standard_Real Tolang) :
37 GeomFill_Boundary(Tol3d,Tolang), myC3d(Curve)
41 //=======================================================================
44 //=======================================================================
46 gp_Pnt GeomFill_SimpleBound::Value(const Standard_Real U) const
49 if(!myPar.IsNull()) x = myPar->Value(U);
50 return myC3d->Value(x);
54 //=======================================================================
57 //=======================================================================
59 void GeomFill_SimpleBound::D1(const Standard_Real U,
63 Standard_Real x = U, dx = 1.;
64 if(!myPar.IsNull()) myPar->D1(U,x,dx);
69 //=======================================================================
70 //function : Reparametrize
72 //=======================================================================
74 void GeomFill_SimpleBound::Reparametrize(const Standard_Real First,
75 const Standard_Real Last,
76 const Standard_Boolean HasDF,
77 const Standard_Boolean HasDL,
78 const Standard_Real DF,
79 const Standard_Real DL,
80 const Standard_Boolean Rev)
82 Handle(Law_BSpline) curve = Law::Reparametrize(myC3d->Curve(),
86 myPar = new Law_BSpFunc();
87 Handle(Law_BSpFunc)::DownCast (myPar)->SetCurve(curve);
90 //=======================================================================
93 //=======================================================================
95 void GeomFill_SimpleBound::Bounds(Standard_Real& First,
96 Standard_Real& Last) const
98 if(!myPar.IsNull()) myPar->Bounds(First,Last);
100 First = myC3d->FirstParameter();
101 Last = myC3d->LastParameter();
106 //=======================================================================
107 //function : IsDegenerated
109 //=======================================================================
111 Standard_Boolean GeomFill_SimpleBound::IsDegenerated() const
113 return Standard_False;