X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_Object.cxx;h=a1a69ff3fc4e4df79c066ceeaedf55cb468b1c94;hb=264eeb2edd6977ccf2d2bd88cbb210353f63f7c9;hp=61b36a78c706f0b5270700ee4678bd80994a9b19;hpb=004925bca40d46c25cf9cc837193335163c2d44f;p=modules%2Fsmesh.git diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 61b36a78c..a1a69ff3f 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -32,6 +32,8 @@ #include "SMDS_Mesh.hxx" #include "SMDS_MeshCell.hxx" #include "SMDS_PolyhedralVolumeOfNodes.hxx" +#include "SMESHDS_Mesh.hxx" +#include "SMESHDS_Script.hxx" #include "SMESH_Actor.h" #include "SMESH_ControlsDef.hxx" @@ -54,7 +56,7 @@ #include #include -#include "utilities.h" +#include using namespace std; @@ -280,8 +282,11 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid) myLocalGrid = false; if (!GetMesh()->isCompacted()) { + NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh() if ( MYDEBUG ) MESSAGE("*** buildPrs ==> compactMesh!"); GetMesh()->compactMesh(); + if ( SMESHDS_Mesh* m = dynamic_cast( GetMesh() )) // IPAL53915 + m->GetScript()->SetModified(false); // drop IsModified set in compactMesh() } vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); updateEntitiesFlags(); @@ -458,7 +463,7 @@ void SMESH_VisualObjDef::buildElemPrs() SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator(); { - // Convertions connectivities from SMDS to VTK + // Convert connectivities from SMDS to VTK if (aType == SMDSAbs_Volume && anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE anIdList->Reset(); @@ -570,7 +575,10 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid() { if ( !myLocalGrid && !GetMesh()->isCompacted() ) { + NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh() GetMesh()->compactMesh(); + if ( SMESHDS_Mesh* m = dynamic_cast( GetMesh() )) // IPAL53915 + m->GetScript()->SetModified(false); // drop IsModified set in compactMesh() updateEntitiesFlags(); vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); myGrid->ShallowCopy(theGrid); @@ -717,7 +725,7 @@ bool SMESH_MeshObj::NulData() points->SetNumberOfPoints(0); myEmptyGrid->SetPoints( points ); points->Delete(); - myEmptyGrid->BuildLinks(); + //myEmptyGrid->BuildLinks(); } myGrid->ShallowCopy(myEmptyGrid); return true;