1 //-- File : HLRBRep_SurfaceTool.gxx
2 //-- Created : Wed Jui 7 18:00:00 1c93
3 //-- Author : Laurent BUCHARD
5 //-- Copyright: Matra Datavision 1993
7 #include <HLRBRep_SurfaceTool.ixx>
8 #include <BRepAdaptor_Surface.hxx>
10 Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S) {
12 GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface *)S)->GetType();
19 case GeomAbs_BezierSurface:
21 nbs = 3 + ((BRepAdaptor_Surface *)S)->NbUPoles();
24 case GeomAbs_BSplineSurface:
26 nbs = ((BRepAdaptor_Surface *)S)->NbUKnots();
27 nbs*= ((BRepAdaptor_Surface *)S)->UDegree();
37 case GeomAbs_Cylinder:
40 case GeomAbs_SurfaceOfRevolution:
41 case GeomAbs_SurfaceOfExtrusion:
56 Standard_Integer HLRBRep_SurfaceTool::NbSamplesV(const Standard_Address S) {
58 GeomAbs_SurfaceType typS = ((BRepAdaptor_Surface *)S)->GetType();
65 case GeomAbs_BezierSurface:
67 nbs = 3 + ((BRepAdaptor_Surface *)S)->NbVPoles();
70 case GeomAbs_BSplineSurface:
72 nbs = ((BRepAdaptor_Surface *)S)->NbVKnots();
73 nbs*= ((BRepAdaptor_Surface *)S)->VDegree();
78 case GeomAbs_Cylinder:
82 case GeomAbs_SurfaceOfRevolution:
83 case GeomAbs_SurfaceOfExtrusion:
98 Standard_Integer HLRBRep_SurfaceTool::NbSamplesU(const Standard_Address S,
99 const Standard_Real u1,
100 const Standard_Real u2) {
101 Standard_Integer nbs = NbSamplesU(S);
102 Standard_Integer n = nbs;
104 Standard_Real uf = FirstUParameter(S);
105 Standard_Real ul = LastUParameter(S);
106 n*= (Standard_Integer)((u2-u1)/(uf-ul));
113 Standard_Integer HLRBRep_SurfaceTool::NbSamplesV(const Standard_Address S,
114 const Standard_Real v1,
115 const Standard_Real v2) {
116 Standard_Integer nbs = NbSamplesV(S);
117 Standard_Integer n = nbs;
119 Standard_Real vf = FirstVParameter(S);
120 Standard_Real vl = LastVParameter(S);
121 n*= (Standard_Integer)((v2-v1)/(vf-vl));