From: enk Date: Thu, 6 Jul 2006 13:15:33 +0000 (+0000) Subject: Fix for X-Git-Tag: T3_2_1_pre~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=572b53bb305b25041e2ecf135c95bad4048df14a;p=modules%2Fgui.git Fix for Bug PAL12711:SMESH sigsev when trying to see a mesh in a med file Bug PAL12710:Visu sigsev when reading a med file --- diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index 7c66519fd..b89fd4d99 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -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); } diff --git a/src/VTKViewer/VTKViewer_ConvexTool.h b/src/VTKViewer/VTKViewer_ConvexTool.h index e6de8106b..11844fb44 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.h +++ b/src/VTKViewer/VTKViewer_ConvexTool.h @@ -198,8 +198,6 @@ class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangu vtkIdType GetConnectivity(vtkIdType thePntId); - void UpdatePolyData(); - };