void SetParameter(double theParam) { _func->SetReal(ARG_PARAM, theParam); }
void SetParameter2(double theParam) { _func->SetReal(ARG_PARAM2, theParam); }
- void SetNumberOfPoints(double theNumberOfPnts) { _func->SetReal(ARG_NBPNTS, theNumberOfPnts); }
+ void SetNumberOfPoints(int theNumberOfPnts) { _func->SetInteger(ARG_NBPNTS, theNumberOfPnts); }
void SetLength(double theLength) { _func->SetReal(ARG_LENGTH, theLength); }
void SetTakeOrientationIntoAccount(bool takeOrientationIntoAccount)
{ _func->SetInteger(ARG_USE_ORIENTATION, takeOrientationIntoAccount); }
Handle(GEOM_Function) aRefFunc = aPI.GetSurface();
TopoDS_Shape aRefShape = aRefFunc->GetValue();
int aNbPnts = aPI.GetNumberOfPoints();
+ if (aNbPnts < 1) {
+ Standard_TypeMismatch::Raise
+ ("Point On Surface creation aborted : number of points is zero or negative");
+ }
if (aRefShape.ShapeType() != TopAbs_FACE) {
Standard_TypeMismatch::Raise
("Point On Surface creation aborted : surface shape is not a face");