summaryrefslogtreecommitdiff
path: root/src/GeomFill/GeomFill_SimpleBound.cxx
blob: 1544c5f06f00ea896b6d6252bf01974dbd682e49 (plain)
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
// File:	GeomFill_SimpleBound.cxx
// Created:	Fri Nov  3 15:23:16 1995
// Author:	Laurent BOURESCHE
//		<lbo@phylox>


#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;
}