From 7780c41f495faea9036a9ed35743183f2f2581c7 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 15 Mar 2010 15:54:26 +0000 Subject: [PATCH] Bug IPAL21615 Problem in VTK viewer when number of isos = 0 --- src/OBJECT/GEOM_WireframeFace.cxx | 44 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/OBJECT/GEOM_WireframeFace.cxx b/src/OBJECT/GEOM_WireframeFace.cxx index 04fa3aac6..83f71e830 100755 --- a/src/OBJECT/GEOM_WireframeFace.cxx +++ b/src/OBJECT/GEOM_WireframeFace.cxx @@ -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 ; + } } } -- 2.39.2