]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for Bug12312 TC: SIGFPE exception is raised during nodes selection in VTK viewer...
authorapo <apo@opencascade.com>
Thu, 27 Apr 2006 14:02:15 +0000 (14:02 +0000)
committerapo <apo@opencascade.com>
Thu, 27 Apr 2006 14:02:15 +0000 (14:02 +0000)
(addtional check were introduced before applying value to the SetNumberOfCloudPoints method)

src/VTKViewer/VTKViewer_Actor.cxx

index 168149018e2802a2c54cc2fa460c248eae0fbb6e..d171c857288709ebe4677dc4a2f8fa48500d6c9c 100755 (executable)
@@ -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();