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 ; Standard_Real confusion = Min(DeltaU, DeltaV) * HATHCER_CONFUSION_3D ;
aHatcher.Confusion3d (confusion) ; aHatcher.Confusion3d (confusion) ;
Standard_Real StepU = DeltaU / (Standard_Real)theNbIso[0]; if ( theNbIso[0] ) {
if(StepU > confusion){ Standard_Real StepU = DeltaU / (Standard_Real)theNbIso[0];
Standard_Real UPrm = anUMin + StepU / 2.; if(StepU > confusion){
gp_Dir2d Dir(0., 1.) ; Standard_Real UPrm = anUMin + StepU / 2.;
for(IIso = 1 ; IIso <= theNbIso[0] ; IIso++) { gp_Dir2d Dir(0., 1.) ;
anUPrm(IIso) = UPrm ; for(IIso = 1 ; IIso <= theNbIso[0] ; IIso++) {
gp_Pnt2d Ori (UPrm, 0.) ; anUPrm(IIso) = UPrm ;
Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ; gp_Pnt2d Ori (UPrm, 0.) ;
anUInd(IIso) = aHatcher.AddHatching (HCur) ; Geom2dAdaptor_Curve HCur (new Geom2d_Line (Ori, Dir)) ;
UPrm += StepU ; anUInd(IIso) = aHatcher.AddHatching (HCur) ;
UPrm += StepU ;
}
} }
} }
Standard_Real StepV = DeltaV / (Standard_Real) theNbIso[1] ; if ( theNbIso[1] ) {
if(StepV > confusion){ Standard_Real StepV = DeltaV / (Standard_Real) theNbIso[1] ;
Standard_Real VPrm = aVMin + StepV / 2.; if(StepV > confusion){
gp_Dir2d Dir(1., 0.); Standard_Real VPrm = aVMin + StepV / 2.;
for(IIso = 1 ; IIso <= theNbIso[1] ; IIso++){ gp_Dir2d Dir(1., 0.);
aVPrm(IIso) = VPrm; for(IIso = 1 ; IIso <= theNbIso[1] ; IIso++){
gp_Pnt2d Ori (0., VPrm); aVPrm(IIso) = VPrm;
Geom2dAdaptor_Curve HCur(new Geom2d_Line (Ori, Dir)); gp_Pnt2d Ori (0., VPrm);
aVInd(IIso) = aHatcher.AddHatching (HCur) ; Geom2dAdaptor_Curve HCur(new Geom2d_Line (Ori, Dir));
VPrm += StepV ; aVInd(IIso) = aHatcher.AddHatching (HCur) ;
VPrm += StepV ;
}
} }
} }