From: apo Date: Thu, 27 Apr 2006 14:02:15 +0000 (+0000) Subject: Fix for Bug12312 TC: SIGFPE exception is raised during nodes selection in VTK viewer... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a5b057181b112ef494e0813a29134b4c4b432d02;p=modules%2Fgui.git Fix for Bug12312 TC: SIGFPE exception is raised during nodes selection in VTK viewer when "Add Node" dialog is opened. (addtional check were introduced before applying value to the SetNumberOfCloudPoints method) --- diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index 168149018..d171c8572 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -198,8 +198,12 @@ void VTKViewer_Actor ::Render(vtkRenderer *ren, vtkMapper* m) { - static vtkFloatingPointType PERCENTS_OF_DETAILS = 0.50; - SetNumberOfCloudPoints(vtkIdType(GetInput()->GetNumberOfPoints()*PERCENTS_OF_DETAILS)); + if(vtkDataSet* aDataSet = GetInput()){ + static vtkFloatingPointType PERCENTS_OF_DETAILS = 0.50; + vtkIdType aNbOfPoints = vtkIdType(aDataSet->GetNumberOfPoints()*PERCENTS_OF_DETAILS); + if(aNbOfPoints > 0) + SetNumberOfCloudPoints(aNbOfPoints); + } if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();