X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_CopyMeshDlg.cxx;h=9f85f5c2762a0215fbfb152b0578db62865afb97;hp=0e1f921cceaa87d0bf89feba2907a8aea78f7e8c;hb=3369d458eaf2f08db6e32b75609679f06771a5cb;hpb=5c95ba9078f96d3e32b6d0dc4f09da6eb6dd38e3 diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index 0e1f921cc..9f85f5c27 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-2015 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 @@ -109,8 +109,8 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myFilterDlg(0), mySelectedObject(SMESH::SMESH_IDSource::_nil()), + myFilterDlg(0), myIsApplyAndClose( false ) { QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH"))); @@ -166,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); @@ -178,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); @@ -233,6 +234,10 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) this, SLOT (SelectionIntoArgument())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */ this, SLOT (reject())); + connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), + this, SLOT (onOpenView())); + connect(mySMESHGUI, SIGNAL (SignalCloseView()), + this, SLOT (onCloseView())); connect(myLineEditElements, SIGNAL(textChanged(const QString&)), this, SLOT (onTextChange(const QString&))); @@ -308,7 +313,8 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() try { SUIT_OverrideCursor aWaitCursor; - SMESH::SMESH_IDSource_wrap aPartToCopy; + + SMESH::IDSource_wrap aPartToCopy; if ( myIdSourceCheck->isChecked()) { aPartToCopy = mySelectedObject; @@ -379,6 +385,31 @@ void SMESHGUI_CopyMeshDlg::reject() QDialog::reject(); } +//================================================================================= +// function : onOpenView() +// purpose : +//================================================================================= +void SMESHGUI_CopyMeshDlg::onOpenView() +{ + if ( mySelector ) { + SMESH::SetPointRepresentation(false); + } + else { + mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); + ActivateThisDialog(); + } +} + +//================================================================================= +// function : onCloseView() +// purpose : +//================================================================================= +void SMESHGUI_CopyMeshDlg::onCloseView() +{ + DeactivateActiveDialog(); + mySelector = 0; +} + //================================================================================= // function : ClickOnHelp() // purpose : @@ -477,7 +508,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; @@ -600,16 +631,21 @@ void SMESHGUI_CopyMeshDlg::ActivateThisDialog() SelectionIntoArgument(); } + //================================================================================= // function : enterEvent() // purpose : //================================================================================= void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*) { - if (!ConstructorsBox->isEnabled()) + if ( !ConstructorsBox->isEnabled() ) { + SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + if ( aViewWindow && !mySelector ) { + mySelector = aViewWindow->GetSelector(); + } ActivateThisDialog(); + } } - //================================================================================= // function : keyPressEvent() // purpose :