1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
// Created on: 1995-11-03
// Created by: Laurent BOURESCHE
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <GeomFill_SimpleBound.ixx>
#include <Law_BSpFunc.hxx>
#include <Law.hxx>
//=======================================================================
//function : GeomFill_SimpleBound
//purpose :
//=======================================================================
GeomFill_SimpleBound::GeomFill_SimpleBound
(const Handle(Adaptor3d_HCurve)& Curve,
const Standard_Real Tol3d,
const Standard_Real Tolang) :
GeomFill_Boundary(Tol3d,Tolang), myC3d(Curve)
{
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
gp_Pnt GeomFill_SimpleBound::Value(const Standard_Real U) const
{
Standard_Real x = U;
if(!myPar.IsNull()) x = myPar->Value(U);
return myC3d->Value(x);
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
void GeomFill_SimpleBound::D1(const Standard_Real U,
gp_Pnt& P,
gp_Vec& V) const
{
Standard_Real x = U, dx = 1.;
if(!myPar.IsNull()) myPar->D1(U,x,dx);
myC3d->D1(x, P, V);
V.Multiply(dx);
}
//=======================================================================
//function : Reparametrize
//purpose :
//=======================================================================
void GeomFill_SimpleBound::Reparametrize(const Standard_Real First,
const Standard_Real Last,
const Standard_Boolean HasDF,
const Standard_Boolean HasDL,
const Standard_Real DF,
const Standard_Real DL,
const Standard_Boolean Rev)
{
Handle(Law_BSpline) curve = Law::Reparametrize(myC3d->Curve(),
First,Last,
HasDF,HasDL,DF,DL,
Rev,30);
myPar = new Law_BSpFunc();
(*((Handle(Law_BSpFunc)*) &myPar))->SetCurve(curve);
}
//=======================================================================
//function : Bounds
//purpose :
//=======================================================================
void GeomFill_SimpleBound::Bounds(Standard_Real& First,
Standard_Real& Last) const
{
if(!myPar.IsNull()) myPar->Bounds(First,Last);
else {
First = myC3d->FirstParameter();
Last = myC3d->LastParameter();
}
}
//=======================================================================
//function : IsDegenerated
//purpose :
//=======================================================================
Standard_Boolean GeomFill_SimpleBound::IsDegenerated() const
{
return Standard_False;
}
|