Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'V9_9_BR'
[modules/smesh.git]
/
src
/
StdMeshers_I
/
StdMeshers_LayerDistribution_i.cxx
diff --git
a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
index e162f22aa32c593f1e684866a137b9f53e1354f6..b222673db9ad82312c03ba61f683d37361b6ed83 100644
(file)
--- a/
src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
+++ b/
src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
1
2 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
2
2 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
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-20,7
+20,6
@@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// 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
// File : StdMeshers_LayerDistribution_i.cxx
// Author : Edward AGAPOV
// Module : SMESH
@@
-46,14
+45,11
@@
using namespace std;
//=============================================================================
StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
//=============================================================================
StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
- : SALOME::GenericObj_i( thePOA ),
+ ::SMESH_Gen* theGenImpl )
+ : SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i" );
myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(),
myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
theGenImpl );
}
@@
-67,19
+63,19
@@
StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::
StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i()
{
StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i()
{
- MESSAGE( "StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i" );
+ if ( !myHyp->_is_nil() )
+ myHyp->UnRegister();
}
//=============================================================================
/*!
* StdMeshers_LayerDistribution_i::SetLayerDistribution
*
}
//=============================================================================
/*!
* StdMeshers_LayerDistribution_i::SetLayerDistribution
*
-
+
*/
//=============================================================================
void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesis_ptr hyp1D)
*/
//=============================================================================
void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesis_ptr hyp1D)
- throw ( SALOME::SALOME_Exception )
{
ASSERT( myBaseImpl );
try {
{
ASSERT( myBaseImpl );
try {
@@
-87,12
+83,17
@@
void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesi
bool isNewHyp = ( hyp_i->GetImpl() != this->GetImpl()->GetLayerDistribution() );
this->GetImpl()->SetLayerDistribution( hyp_i->GetImpl() );
myHyp = SMESH::SMESH_Hypothesis::_duplicate( hyp1D );
bool isNewHyp = ( hyp_i->GetImpl() != this->GetImpl()->GetLayerDistribution() );
this->GetImpl()->SetLayerDistribution( hyp_i->GetImpl() );
myHyp = SMESH::SMESH_Hypothesis::_duplicate( hyp1D );
+ myHyp->Register();
// Remove SO of 1D hypothesis if it was published
// Remove SO of 1D hypothesis if it was published
- if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen())
{
- SALOMEDS::Study_var study = gen->GetCurrentStudy();
- SALOMEDS::SObject_var
SO = gen->ObjectToSObject( study,
hyp1D );
+ if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen())
+ {
+ SALOMEDS::SObject_var
SO = gen->ObjectToSObject(
hyp1D );
if ( ! SO->_is_nil() )
if ( ! SO->_is_nil() )
- study->NewBuilder()->RemoveObjectWithChildren( SO );
+ {
+ SALOMEDS::StudyBuilder_var builder = SMESH_Gen_i::GetSMESHGen()->getStudyServant()->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
}
// Update Python script: write creation of 1D hyp as it is not published and
// for this, SMESH_Gen does not write it's creation
@@
-138,12
+139,13
@@
SMESH::SMESH_Hypothesis_ptr StdMeshers_LayerDistribution_i::GetLayerDistribution
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
-
*
\param type - dimension (see SMESH::Dimension enumeration)
-
*
\retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
+
*
\param type - dimension (see SMESH::Dimension enumeration)
+
*
\retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
*
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
*
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
+
CORBA::Boolean StdMeshers_LayerDistribution_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_3D;
CORBA::Boolean StdMeshers_LayerDistribution_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_3D;
@@
-152,7
+154,7
@@
CORBA::Boolean StdMeshers_LayerDistribution_i::IsDimSupported( SMESH::Dimension
//================================================================================
/*!
* \brief Write parameters in a string
//================================================================================
/*!
* \brief Write parameters in a string
-
*
\retval char* - resulting string
+
*
\retval char* - resulting string
*/
//================================================================================
*/
//================================================================================
@@
-178,7
+180,7
@@
char* StdMeshers_LayerDistribution_i::SaveTo()
//================================================================================
/*!
* \brief Retrieve parameters from the string
//================================================================================
/*!
* \brief Retrieve parameters from the string
-
*
\param theStream - the input string
+
*
\param theStream - the input string
*/
//================================================================================
*/
//================================================================================
@@
-192,8
+194,7
@@
void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
is >> libName )
{
SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
is >> libName )
{
SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var curStudy = gen->GetCurrentStudy();
- gen->SetCurrentStudy( SALOMEDS::Study::_nil() ); // prevent hypo publishing
+ gen->SetEnablePublish( false ); // prevent hypo publishing
try {
SMESH::SMESH_Hypothesis_var hyp1D =
try {
SMESH::SMESH_Hypothesis_var hyp1D =
@@
-203,6
+204,9
@@
void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
hyp1D_i->LoadFrom( & theStream[ (streamoff) is.tellg()+1 ]);
this->GetImpl()->SetLayerDistribution( hyp1D_i->GetImpl() );
myHyp = hyp1D;
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 << " )";
// as hyp1D is not published, its ID changes
//SMESH::TPythonDump() << _this() << ".SetLayerDistribution( " << hyp1D << " )";
@@
-212,7
+216,7
@@
void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream )
}
catch (...) {
}
}
catch (...) {
}
- gen->Set
CurrentStudy( curStudy
); // enable hypo publishing
+ gen->Set
EnablePublish( true
); // enable hypo publishing
}
}
}
}