From: dmv Date: Mon, 15 Mar 2010 15:54:26 +0000 (+0000) Subject: Bug IPAL21615 Problem in VTK viewer when number of isos = 0 X-Git-Tag: V5_1_4a1~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7780c41f495faea9036a9ed35743183f2f2581c7;p=modules%2Fgeom.git Bug IPAL21615 Problem in VTK viewer when number of isos = 0 --- 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 ; + } } }