Bug IPAL21615 Problem in VTK viewer when number of isos = 0

This commit is contained in:
dmv 2010-03-15 15:54:26 +00:00
parent 40782e018b
commit 7780c41f49

View File

@ -224,29 +224,33 @@ CreateIso(const TopoDS_Face& theFace,
Standard_Real confusion = Min(DeltaU, DeltaV) * HATHCER_CONFUSION_3D ;
aHatcher.Confusion3d (confusion) ;
Standard_Real StepU = DeltaU / (Standard_Real)theNbIso[0];
if(StepU > confusion){
Standard_Real UPrm = anUMin + StepU / 2.;
gp_Dir2d Dir(0., 1.) ;
for(IIso = 1 ; IIso <= theNbIso[0] ; IIso++) {
anUPrm(IIso) = UPrm ;
gp_Pnt2d Ori (UPrm, 0.) ;
Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ;
anUInd(IIso) = aHatcher.AddHatching (HCur) ;
UPrm += StepU ;
if ( theNbIso[0] ) {
Standard_Real StepU = DeltaU / (Standard_Real)theNbIso[0];
if(StepU > confusion){
Standard_Real UPrm = anUMin + StepU / 2.;
gp_Dir2d Dir(0., 1.) ;
for(IIso = 1 ; IIso <= theNbIso[0] ; IIso++) {
anUPrm(IIso) = UPrm ;
gp_Pnt2d Ori (UPrm, 0.) ;
Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ;
anUInd(IIso) = aHatcher.AddHatching (HCur) ;
UPrm += StepU ;
}
}
}
Standard_Real StepV = DeltaV / (Standard_Real) theNbIso[1] ;
if(StepV > confusion){
Standard_Real VPrm = aVMin + StepV / 2.;
gp_Dir2d Dir(1., 0.);
for(IIso = 1 ; IIso <= theNbIso[1] ; IIso++){
aVPrm(IIso) = VPrm;
gp_Pnt2d Ori (0., VPrm);
Geom2dAdaptor_Curve HCur(new Geom2d_Line (Ori, Dir));
aVInd(IIso) = aHatcher.AddHatching (HCur) ;
VPrm += StepV ;
if ( theNbIso[1] ) {
Standard_Real StepV = DeltaV / (Standard_Real) theNbIso[1] ;
if(StepV > confusion){
Standard_Real VPrm = aVMin + StepV / 2.;
gp_Dir2d Dir(1., 0.);
for(IIso = 1 ; IIso <= theNbIso[1] ; IIso++){
aVPrm(IIso) = VPrm;
gp_Pnt2d Ori (0., VPrm);
Geom2dAdaptor_Curve HCur(new Geom2d_Line (Ori, Dir));
aVInd(IIso) = aHatcher.AddHatching (HCur) ;
VPrm += StepV ;
}
}
}