#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SMESH_Gen)
-//To disable automatic genericobj management, the following line should be commented.
-//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx
-#define WITHGENERICOBJ
-
//================================================================================
/*!
* \brief Constructor
// Call hypothesis creation server method (without GUI)
SMESH::SMESH_Hypothesis_var aHyp =
SMESH::CreateHypothesis(theTypeName, aHypName, false);
-#ifdef WITHGENERICOBJ
- if (!CORBA::is_nil(aHyp))
- aHyp->UnRegister();
-#endif
- } else {
+ aHyp.out();
+ }
+ else {
// Get hypotheses creator client (GUI)
- // BUG 0020378
- //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
// Create hypothesis
else {
SMESH::SMESH_Hypothesis_var aHyp =
SMESH::CreateHypothesis(theTypeName, aHypName, false);
-#ifdef WITHGENERICOBJ
- if (!CORBA::is_nil(aHyp))
- aHyp->UnRegister();
-#endif
+ aHyp.out();
}
}
if ( !anAlgoVar->_is_nil() )
SMESH::AddHypothesisOnMesh( aMeshVar, anAlgoVar );
}
-#ifdef WITHGENERICOBJ
- // obj has been published in study. Its refcount has been incremented.
- // It is safe to decrement its refcount
- // so that it will be destroyed when the entry in study will be removed
- if (aMeshSO)
- aMeshVar->UnRegister();
-#endif
}
return true;
}
GEOM::GEOM_Object_wrap aGroupVar = op->CreateGroup(mainGeom, aGroupType);
op->UnionList(aGroupVar, aSeq);
- if (op->IsDone()) {
- aGeomVar = aGroupVar.in();
+ if (op->IsDone())
+ {
+ aGeomVar = GEOM::GEOM_Object::_duplicate( aGroupVar.in() );
// publish the GEOM group in study
QString aNewGeomGroupName ("Auto_group_for_");
if (aHypData)
{
QString aClientLibName = aHypData->ClientLibName;
- if (aClientLibName == "")
+ if ( aClientLibName.isEmpty() )
{
// Call hypothesis creation server method (without GUI)
SMESH::SMESH_Hypothesis_var aHyp =
SMESH::CreateHypothesis(aHypName, aHypName, true);
-#ifdef WITHGENERICOBJ
- if (!CORBA::is_nil(aHyp))
- aHyp->UnRegister();
-#endif
+ aHyp.out();
}
else
{
// Get hypotheses creator client (GUI)
- // BUG 0020378
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
// Create algorithm
if (aCreator)
- aCreator->create(true, aHypName, myDlg, 0, QString::null );
+ aCreator->create( true, aHypName, myDlg, 0, QString::null );
else {
SMESH::SMESH_Hypothesis_var aHyp =
SMESH::CreateHypothesis(aHypName, aHypName, true);
-#ifdef WITHGENERICOBJ
- if (!CORBA::is_nil(aHyp))
- aHyp->UnRegister();
-#endif
+ aHyp.out();
}
}
QStringList tmpList;