blob: 3f132e1174b639def2f93af66efd4e9d05f29901 (
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
|
// File: BRepBlend_HCurveToolGen.gxx
// Created: Mon Jul 17 17:39:39 1995
// Author: Modelistation
// <model@mastox>
#include CurveGen_hxx
#include <GeomAbs_CurveType.hxx>
#include <GeomAbs_Shape.hxx>
#include <Handle_Geom_BezierCurve.hxx>
#include <Handle_Geom_BSplineCurve.hxx>
#include <TColStd_Array1OfReal.hxx>
//============================================================
Standard_Integer BRepBlend_HCurveToolGen::NbSamples (const CurveGen& C,
const Standard_Real U0,
const Standard_Real U1) {
GeomAbs_CurveType typC = C->GetType();
static Standard_Real nbsOther = 10.0;
Standard_Real nbs = nbsOther;
if(typC == GeomAbs_Line)
nbs = 2;
else if(typC == GeomAbs_BezierCurve)
nbs = 3 + C->Bezier()->NbPoles();
else if(typC == GeomAbs_BSplineCurve) {
Handle(Geom_BSplineCurve) BSC = C->BSpline();
nbs = BSC->NbKnots();
nbs*= BSC->Degree();
nbs*= BSC->LastParameter()- BSC->FirstParameter();
nbs/= U1-U0;
if(nbs < 2.0) nbs=2;
}
if(nbs>50)
nbs = 50;
return((Standard_Integer)nbs);
}
|