SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
anEntryList.append( aMeshSO->GetID().c_str() );
-
- // 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
- aMeshes[i]->UnRegister();
}
else {
isEmpty = true;
aSO = aRefSObject; // Delete main Object instead of reference
listSO.push_back( aSO );
- std::list< _PTR(SObject) >::iterator itSO = listSO.begin();
+ std::list< _PTR(SObject) >::iterator itSO = --listSO.end();
for ( ; itSO != listSO.end(); ++itSO ) {
_PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO );
for (it->InitEx(false); it->More(); it->Next())
if ( !SO ) continue;
std::string anEntry = SO->GetID();
- /** Erase graphical object **/
+ /** Erase graphical object and remove all its data **/
if(SO->FindAttribute(anAttr, "AttributeIOR")) {
SMESH::RemoveVisualObjectWithActors( anEntry.c_str(), true);
- // ViewManagerList aViewMenegers = anApp->viewManagers();
- // ViewManagerList::const_iterator it = aViewMenegers.begin();
- // for( ; it != aViewMenegers.end(); it++) {
- // SUIT_ViewManager* vm = *it;
- // int nbSf = vm ? vm->getViewsCount() : 0;
- // if(vm) {
- // QVector<SUIT_ViewWindow*> aViews = vm->getViews();
- // for(int i = 0; i < nbSf; i++){
- // SUIT_ViewWindow *sf = aViews[i];
- // if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
- // SMESH::RemoveActor(sf,anActor);
- // }
- // }
- // }
- // }
}
/** Remove an object from data structures **/
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
if (vtkwnd) {
SALOME_ListIteratorOfListIO It( to_process );
for ( ; It.More(); It.Next()) {
- MESSAGE("---");
+ MESSAGE("---");
Handle(SALOME_InteractiveObject) IOS = It.Value();
if (IOS->hasEntry()) {
- MESSAGE("---");
+ MESSAGE("---");
if (!SMESH::UpdateView(anAction, IOS->getEntry())) {
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
break; // PAL16774 (Crash after display of many groups)
// PAL13338 + PAL15161 -->
if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy)) {
- MESSAGE("anAction = SMESH::eDisplayOnly");
+ MESSAGE("anAction = SMESH::eDisplayOnly");
SMESH::UpdateView();
SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged();
}
#define SPACING 6
#define MARGIN 11
-//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
-
//=================================================================================
// name : SMESHGUI_BuildCompoundDlg
// Purpose :
SMESHGUI::Modified();
- // 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 (!CORBA::is_nil(aCompoundMesh))
- aCompoundMesh->UnRegister();
-
return true;
}
return false;
#define SPACING 6
#define MARGIN 11
-//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
-
//================================================================================
/*!
if( !newMesh->_is_nil() )
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-#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
- newMesh->UnRegister();
-#endif
- } catch (...) {
+ }
+ catch (...) {
}
mySMESHGUI->updateObjBrowser(true);
create( false, theHypName, parent, obj, slot );
}
-void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
+void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
const QString& theHypName,
QWidget* theParent, QObject* obj, const QString& slot )
{
if (isAlgo) {
SMESH::SMESH_Hypothesis_var anAlgo =
SMESH::CreateHypothesis( hypType(), theHypName, isAlgo );
- if (!CORBA::is_nil(anAlgo))
- anAlgo->UnRegister();
+ anAlgo.out(); // avoid unused variable warning
}
else {
SMESH::SMESH_Hypothesis_var aHypothesis =
SMESH::CreateHypothesis( hypType(), theHypName, false );
editHypothesis( aHypothesis.in(), theHypName, theParent, obj, slot );
- if (!CORBA::is_nil(aHypothesis))
- aHypothesis->UnRegister();
}
}
void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis,
- const QString& theHypName,
+ const QString& theHypName,
QWidget* theParent, QObject* obj, const QString& slot )
{
if( CORBA::is_nil( theHypothesis ) )
return;
- MESSAGE("Edition of hypothesis");
-
myIsCreate = false;
editHypothesis( theHypothesis, theHypName, theParent, obj, slot );
if ( !newMesh->_is_nil() ) {
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) )
theEntryList.append( aSObject->GetID().c_str() );
-#ifdef WITHGENERICOBJ
- newMesh->UnRegister();
-#endif
- }
- if ( !newGrp->_is_nil() ) {
-#ifdef WITHGENERICOBJ
- newGrp->UnRegister();
-#endif
}
ok = true;
#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;
}
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;
#define SPACING 8
#define MARGIN 11
-//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
//=================================================================================
// class : SMESHGUI_RotationDlg()
if (!mesh->_is_nil()) {
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-#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
- mesh->UnRegister();
-#endif
}
}
}
if (!mesh->_is_nil()) {
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-#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
- mesh->UnRegister();
-#endif
}
}
break;
#define SPACING 6
#define MARGIN 11
-//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
-
//=================================================================================
// class : SMESHGUI_ScaleDlg()
// purpose :
aName.toLatin1().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-#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
- mesh->UnRegister();
-#endif
}
}
else {
LineEditNewMesh->text().toLatin1().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-#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
- mesh->UnRegister();
-#endif
}
break;
}
#define SPACING 6
#define MARGIN 11
-//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
-
//=================================================================================
// class : SMESHGUI_SymmetryDlg()
// purpose :
aName.toLatin1().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-#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
- mesh->UnRegister();
-#endif
}
else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
LineEditNewMesh->text().toLatin1().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-#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
- mesh->UnRegister();
-#endif
}
}
break;
aName.toLatin1().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-
- // 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
- mesh->UnRegister();
}
}
else {
LineEditNewMesh->text().toLatin1().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
-
- // 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
- mesh->UnRegister();
}
break;
}