0024737: Coding - remove <br> tag from header files
[occt.git] / src / Geom2dInt / Geom2dInt_CurveTool.gxx
CommitLineData
b311480e 1// Created on: 1992-10-22
2// Created by: Laurent BUCHARD
3// Copyright (c) 1992-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <GeomAbs_CurveType.hxx>
cb389a77 18#include <Geom2d_BezierCurve.hxx>
19#include <Geom2d_BSplineCurve.hxx>
7fd59977 20#include <Geom2d_BezierCurve.hxx>
21#include <Geom2d_BSplineCurve.hxx>
22
23//============================================================
24Standard_Integer Geom2dInt_CurveTool::NbSamples (const IntCurveCurve& C,
25 const Standard_Real U0,
26 const Standard_Real U1) {
27 GeomAbs_CurveType typC = C.GetType();
28 static Standard_Real nbsOther = 10.0;
29 Standard_Real nbs = nbsOther;
30
31 if(typC == GeomAbs_Line)
32 nbs = 2;
33 else if(typC == GeomAbs_BezierCurve)
34 nbs = 3 + C.NbPoles();
35 else if(typC == GeomAbs_BSplineCurve) {
36 Standard_Real t=C.LastParameter()-C.FirstParameter();
37 Standard_Real t1=U1-U0;
38 if(t1<0.0) t1=-t1;
39 nbs = C.NbKnots();
40 nbs*= C.Degree();
41 nbs*= (t1/t);
42 if(nbs < 4.0) nbs=4;
43 }
44 //// modified by jgv, 20.02.02 for bug OCC165 ////
45 else if (typC == GeomAbs_OtherCurve)
46 nbs = 20;
47 //////////////////////////////////////////////////
48
49 if(nbs>300)
50 nbs = 300;
51 return((Standard_Integer)nbs);
52}
53//============================================================
54Standard_Integer Geom2dInt_CurveTool::NbSamples (const IntCurveCurve& C) {
55 GeomAbs_CurveType typC = C.GetType();
56 static Standard_Real nbsOther = 10.0;
57 Standard_Real nbs = nbsOther;
58
59 if(typC == GeomAbs_Line)
60 nbs = 2;
61 else if(typC == GeomAbs_BezierCurve)
62 nbs = 3 + C.NbPoles();
63 else if(typC == GeomAbs_BSplineCurve) {
64 nbs = C.NbKnots();
65 nbs*= C.Degree();
66 if(nbs < 2.0) nbs=2;
67 }
68 //// modified by jgv, 20.02.02 for bug OCC165 ////
69 else if (typC == GeomAbs_OtherCurve)
70 nbs = 20;
71 //////////////////////////////////////////////////
72
73 if(nbs>300)
74 nbs = 300;
75 return((Standard_Integer)nbs);
76}
77
78
79
80