1 // File: Contap_HCurve2dToolGen.gxx
2 // Created: Mon Jul 17 17:39:39 1995
3 // Author: Modelistation
7 #include <GeomAbs_CurveType.hxx>
8 #include <GeomAbs_Shape.hxx>
9 #include <Handle_Geom2d_BezierCurve.hxx>
10 #include <Handle_Geom2d_BSplineCurve.hxx>
12 #include <TColStd_Array1OfReal.hxx>
15 //============================================================
16 Standard_Integer Contap_HCurve2dToolGen::NbSamples (const CurveGen& C,
17 const Standard_Real U0,
18 const Standard_Real U1) {
19 GeomAbs_CurveType typC = C->GetType();
20 static Standard_Real nbsOther = 10.0;
21 Standard_Real nbs = nbsOther;
23 if(typC == GeomAbs_Line)
25 else if(typC == GeomAbs_BezierCurve)
26 nbs = 3 + C->NbPoles();
27 else if(typC == GeomAbs_BSplineCurve) {
30 nbs*= C->LastParameter()- C->FirstParameter();
36 return((Standard_Integer)nbs);