X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_CopyMeshDlg.cxx;h=8a02ddd031d6b44c85f5609a63947c15c7e73f11;hb=e3e19dc2facbac0fd8e309ad4b43e1f679f17259;hp=fbb71ea96ee44b24bc8e648273a1d55643fba967;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index fbb71ea96..8a02ddd03 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2014 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 @@ -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 -// 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 @@ -98,10 +98,6 @@ namespace #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 - //================================================================================ /*! @@ -170,9 +166,10 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) myCopyGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments); myCopyGroupsCheck->setChecked(false); - // CheckBox for keeping ids + // CheckBox for keeping ids ( OBSOLETE ) myKeepIdsCheck = new QCheckBox(tr("SMESH_KEEP_IDS"), GroupArguments); myKeepIdsCheck->setChecked(true); + myKeepIdsCheck->hide(); // layout GroupArgumentsLayout->addWidget(myTextLabelElements, 0, 0); @@ -182,7 +179,7 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) GroupArgumentsLayout->addWidget(meshNameLabel, 2, 0); GroupArgumentsLayout->addWidget(myMeshNameEdit, 2, 1, 1, 5); GroupArgumentsLayout->addWidget(myCopyGroupsCheck, 3, 0, 1, 6); - GroupArgumentsLayout->addWidget(myKeepIdsCheck, 4, 0, 1, 6); + // GroupArgumentsLayout->addWidget(myKeepIdsCheck, 4, 0, 1, 6); /***************************************************************/ GroupButtons = new QGroupBox(this); @@ -312,10 +309,11 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() try { SUIT_OverrideCursor aWaitCursor; - SMESH::SMESH_IDSource_var aPartToCopy; + SMESH::SMESH_IDSource_wrap aPartToCopy; if ( myIdSourceCheck->isChecked()) { aPartToCopy = mySelectedObject; + aPartToCopy->Register(); } else { @@ -338,13 +336,8 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() 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); @@ -485,7 +478,7 @@ void SMESHGUI_CopyMeshDlg::SelectionIntoArgument() // get selected mesh SALOME_ListIO aList; - mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type()); + mySelectionMgr->selectedObjects(aList); int nbSel = aList.Extent(); if (nbSel != 1) return;