From a5b057181b112ef494e0813a29134b4c4b432d02 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 27 Apr 2006 14:02:15 +0000 Subject: [PATCH] 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) --- src/VTKViewer/VTKViewer_Actor.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); -- 2.39.2