]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for
authorenk <enk@opencascade.com>
Thu, 6 Jul 2006 13:15:33 +0000 (13:15 +0000)
committerenk <enk@opencascade.com>
Thu, 6 Jul 2006 13:15:33 +0000 (13:15 +0000)
Bug PAL12711:SMESH sigsev when trying to see a mesh in a med file
Bug PAL12710:Visu sigsev when reading a med file

src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_ConvexTool.h

index 7c66519fdb9f1d9e775ee79c726e6503c7232bf6..b89fd4d998a52683fe5f24b77fd014ca0561b80f 100644 (file)
@@ -508,12 +508,17 @@ vtkPoints*
 VTKViewer_DelaunayTriangulator
 ::InitPoints()
 {
+  myPoints->Reset();
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
   myUnstructuredGrid->SetPoints(myPoints);
 
   vtkIdType aNumPts;
   myInput->GetCellPoints(myCellId,aNumPts,myPointIds); 
+  
+  if ( aNumPts < myPoints->GetNumberOfPoints() )
+    myPoints->Reset();
+  
   {
     vtkFloatingPointType aPntCoord[3];
     myPoints->SetNumberOfPoints(aNumPts);
@@ -524,15 +529,13 @@ VTKViewer_DelaunayTriangulator
     }
   }
 
-  return myPoints;
-}
+  myPoints->Modified();
+  myUnstructuredGrid->Modified();
 
-void
-VTKViewer_DelaunayTriangulator
-::UpdatePolyData()
-{
   myGeometryFilter->Update();
   myPolyData = myGeometryFilter->GetOutput();
+  
+  return myPoints;
 }
 
 vtkIdType 
@@ -553,7 +556,6 @@ vtkFloatingPointType
 VTKViewer_DelaunayTriangulator
 ::GetCellLength()
 {
-  if(!myPolyData) this->UpdatePolyData();
   return myPolyData->GetLength();
 }
 
@@ -561,7 +563,6 @@ vtkIdType
 VTKViewer_DelaunayTriangulator
 ::GetNumFaces()
 {
-  if(!myPolyData) this->UpdatePolyData();
   return myPolyData->GetNumberOfCells();
 }
 
@@ -569,7 +570,6 @@ vtkCell*
 VTKViewer_DelaunayTriangulator
 ::GetFace(vtkIdType theFaceId)
 {
-  if(!myPolyData) this->UpdatePolyData();
   return myPolyData->GetCell(theFaceId);
 }
 
index e6de8106b90f72a9eed3e5015326239405607b1c..11844fb44751f1be97cbf54ff5989a194f91a524 100644 (file)
@@ -198,8 +198,6 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu
   vtkIdType 
   GetConnectivity(vtkIdType thePntId);
 
-  void UpdatePolyData();
-  
 };