-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_LayerDistribution_i.cxx
// Author : Edward AGAPOV
// Module : SMESH
this->GetImpl()->SetLayerDistribution( hyp_i->GetImpl() );
myHyp = SMESH::SMESH_Hypothesis::_duplicate( hyp1D );
// Remove SO of 1D hypothesis if it was published
- if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) {
+ if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen())
+ {
SALOMEDS::Study_var study = gen->GetCurrentStudy();
- SALOMEDS::SObject_var SO = gen->ObjectToSObject( study, hyp1D );
+ SALOMEDS::SObject_var SO = gen->ObjectToSObject( study, hyp1D );
if ( ! SO->_is_nil() )
- study->NewBuilder()->RemoveObjectWithChildren( SO );
+ {
+ SALOMEDS::StudyBuilder_var builder = study->NewBuilder();
+ builder->RemoveObjectWithChildren( SO );
+ SO->UnRegister();
+ }
}
// Update Python script: write creation of 1D hyp as it is not published and
// for this, SMESH_Gen does not write it's creation
hyp1D_i->LoadFrom( & theStream[ (streamoff) is.tellg()+1 ]);
this->GetImpl()->SetLayerDistribution( hyp1D_i->GetImpl() );
myHyp = hyp1D;
+
+ SMESH::SMESH_Hypothesis_var me = _this();
+ hyp1D->SetHolderHypothesis( me );
// as hyp1D is not published, its ID changes
//SMESH::TPythonDump() << _this() << ".SetLayerDistribution( " << hyp1D << " )";