X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_Object.cxx;h=520abe33550aaffcc59c8f0dfea99bdd8477a3db;hp=2997063e5ace9f902c3de26869090a20c0bf25c9;hb=8a1ff9ba77b7b72b64b08134f941b56aac80ff55;hpb=7eda9ca931ed2a11cb5e4637e4ffe19f5c061115 diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 2997063e5..520abe335 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -67,7 +67,7 @@ using namespace std; #endif #ifdef _DEBUG_ -static int MYDEBUG = 1; +static int MYDEBUG = 0; static int MYDEBUGWITHFILES = 0;//1; #else static int MYDEBUG = 0; @@ -133,7 +133,7 @@ static int MYDEBUGWITHFILES = 0; //================================================================================= SMESH_VisualObjDef::SMESH_VisualObjDef() { - MESSAGE("---------------------------------------------SMESH_VisualObjDef::SMESH_VisualObjDef"); + if ( MYDEBUG ) MESSAGE("-------------------------------SMESH_VisualObjDef::SMESH_VisualObjDef"); myGrid = vtkUnstructuredGrid::New(); myLocalGrid = false; ClearEntitiesFlags(); @@ -141,9 +141,8 @@ SMESH_VisualObjDef::SMESH_VisualObjDef() } SMESH_VisualObjDef::~SMESH_VisualObjDef() { - MESSAGE("---------------------------------------------SMESH_VisualObjDef::~SMESH_VisualObjDef"); - //if ( MYDEBUG ) - MESSAGE( "~SMESH_MeshObj - myGrid->GetReferenceCount() = " << myGrid->GetReferenceCount() ); + if ( MYDEBUG ) MESSAGE("--------------------------------SMESH_VisualObjDef::~SMESH_VisualObjDef"); + if ( MYDEBUG ) MESSAGE( "myGrid->GetReferenceCount() = " << myGrid->GetReferenceCount() ); myGrid->Delete(); } @@ -248,7 +247,7 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints ) //================================================================================= void SMESH_VisualObjDef::buildPrs(bool buildGrid) { - MESSAGE("----------------------------------------------------------SMESH_VisualObjDef::buildPrs " << buildGrid); + if ( MYDEBUG ) MESSAGE("---------------------------SMESH_VisualObjDef::buildPrs " << buildGrid); if (buildGrid) { myLocalGrid = true; @@ -281,7 +280,8 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid) myLocalGrid = false; if (!GetMesh()->isCompacted()) { - MESSAGE("*** buildPrs ==> compactMesh!"); + NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh() + if ( MYDEBUG ) MESSAGE("*** buildPrs ==> compactMesh!"); GetMesh()->compactMesh(); } vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); @@ -571,6 +571,7 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid() { if ( !myLocalGrid && !GetMesh()->isCompacted() ) { + NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh() GetMesh()->compactMesh(); updateEntitiesFlags(); vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); @@ -697,9 +698,9 @@ SMESH_MeshObj::~SMESH_MeshObj() bool SMESH_MeshObj::Update( int theIsClear ) { // Update SMDS_Mesh on client part - MESSAGE("SMESH_MeshObj::Update " << this); + if ( MYDEBUG ) MESSAGE("SMESH_MeshObj::Update " << this); if ( myClient.Update(theIsClear) || GetUnstructuredGrid()->GetNumberOfPoints()==0) { - MESSAGE("buildPrs"); + if ( MYDEBUG ) MESSAGE("buildPrs"); buildPrs(); // Fill unstructured grid return true; } @@ -708,7 +709,7 @@ bool SMESH_MeshObj::Update( int theIsClear ) bool SMESH_MeshObj::NulData() { - MESSAGE ("SMESH_MeshObj::NulData() =================================================================================="); + if ( MYDEBUG ) MESSAGE ("SMESH_MeshObj::NulData() ============================================="); if (!myEmptyGrid) { myEmptyGrid = SMDS_UnstructuredGrid::New(); @@ -901,7 +902,7 @@ void SMESH_SubMeshObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunc //================================================================================= bool SMESH_SubMeshObj::Update( int theIsClear ) { - MESSAGE("SMESH_SubMeshObj::Update " << this) + if ( MYDEBUG ) MESSAGE("SMESH_SubMeshObj::Update " << this) bool changed = myMeshObj->Update( theIsClear ); buildPrs(true); return changed;