0022623: Use of uninitialized variables in HLRBRep_Curve::UpdateMinMax in debug mode
[occt.git] / src / HLRBRep / HLRBRep_CurveTool.cxx
CommitLineData
733a0e55
S
1// File: HLRBRep_CurveTool.cxx
2// Created: Mon Jul 17 17:39:39 1995
3// Author: Modelistation
4// Copyright: OPEN CASCADE 2000
7fd59977 5
6#include <HLRBRep_CurveTool.ixx>
7#include <HLRBRep_Curve.hxx>
8#include <GeomAbs_CurveType.hxx>
9#include <GeomAbs_Shape.hxx>
10#include <Handle_Geom2d_BezierCurve.hxx>
11#include <Handle_Geom2d_BSplineCurve.hxx>
12#include <TColStd_Array1OfReal.hxx>
13
14//=======================================================================
15//function : NbSamples
16//purpose :
17//=======================================================================
18
19Standard_Integer
20HLRBRep_CurveTool::NbSamples (const Standard_Address C)
21{
22 GeomAbs_CurveType typC = ((HLRBRep_Curve *)C)->GetType();
23 static Standard_Real nbsOther = 10.0;
24 Standard_Real nbs = nbsOther;
25
26 if(typC == GeomAbs_Line)
27 nbs = 2;
28 else if(typC == GeomAbs_BezierCurve)
29 nbs = 3 + ((HLRBRep_Curve *)C)->NbPoles();
30 else if(typC == GeomAbs_BSplineCurve) {
31 nbs = ((HLRBRep_Curve *)C)->NbKnots();
32 nbs*= ((HLRBRep_Curve *)C)->Degree();
33 if(nbs < 2.0) nbs=2;
34 }
35 if(nbs>50)
36 nbs = 50;
37 return((Standard_Integer)nbs);
38}
39
40//=======================================================================
41//function : NbSamples
42//purpose :
43//=======================================================================
44
45Standard_Integer
46HLRBRep_CurveTool::NbSamples (const Standard_Address C,
47 const Standard_Real u1,
48 const Standard_Real u2)
49{
50 GeomAbs_CurveType typC = ((HLRBRep_Curve *)C)->GetType();
51 static Standard_Real nbsOther = 10.0;
52 Standard_Real nbs = nbsOther;
53
54 if(typC == GeomAbs_Line)
55 nbs = 2;
56 else if(typC == GeomAbs_BezierCurve)
57 nbs = 3 + ((HLRBRep_Curve *)C)->NbPoles();
58 else if(typC == GeomAbs_BSplineCurve) {
59 nbs = ((HLRBRep_Curve *)C)->NbKnots();
60 nbs*= ((HLRBRep_Curve *)C)->Degree();
61 if(nbs < 2.0) nbs=2;
62 }
63 if(nbs>50)
64 nbs = 50;
65 return((Standard_Integer)nbs);
66}