X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SewingDlg.cxx;h=94e008506572aa7767d2fb2da34192d4bfb9aea8;hb=39b656bb9f1231fc394b47c7c639800e6a2e4a30;hp=1017b19e98d54e2370136b870d5db8c495260948;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index 1017b19e9..94e008506 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -1,24 +1,25 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 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 // -// 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. +// 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. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// 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 SMESHGUI : GUI for SMESH component // File : SMESHGUI_SewingDlg.cxx // Author : Michael ZORIN, Open CASCADE S.A.S. @@ -256,7 +257,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule ) /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); @@ -271,7 +272,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule ) connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); @@ -385,9 +386,9 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId) LineEdit5->setEnabled(false); if (!CheckBoxPolygons->isVisible()) - CheckBoxPolygons->show(); + CheckBoxPolygons->show(); if (!CheckBoxPolyedrs->isVisible()) - CheckBoxPolyedrs->show(); + CheckBoxPolyedrs->show(); myOk5 = true; @@ -412,7 +413,7 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId) SMESH::SetPointRepresentation(false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + aViewWindow->SetSelectionMode(CellSelection); break; } } @@ -439,7 +440,7 @@ void SMESHGUI_SewingDlg::ConstructorsClicked (int constructorId) QApplication::instance()->processEvents(); updateGeometry(); - resize( minimumSize() ); + resize(100,100); } //================================================================================= @@ -472,8 +473,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply() LineEdit4->text().toLong(), LineEdit5->text().toLong(), LineEdit6->text().toLong(), - toCreatePolygons, - toCreatePolyedrs); + toCreatePolygons, + toCreatePolyedrs); else if (aConstructorId == 1) anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(), LineEdit2->text().toLong(), @@ -486,8 +487,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply() LineEdit3->text().toLong(), LineEdit4->text().toLong(), LineEdit6->text().toLong(), - toCreatePolygons, - toCreatePolyedrs); + toCreatePolygons, + toCreatePolyedrs); else if (aConstructorId == 3) { QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts); QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts); @@ -532,6 +533,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply() Init(); ConstructorsClicked(GetConstructorId()); + + SMESHGUI::Modified(); } } @@ -545,14 +548,14 @@ bool SMESHGUI_SewingDlg::ClickOnApply() void SMESHGUI_SewingDlg::ClickOnOk() { if (ClickOnApply()) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_SewingDlg::ClickOnCancel() +void SMESHGUI_SewingDlg::reject() { //mySelectionMgr->clearSelected(); SMESH::SetPointRepresentation(false); @@ -560,7 +563,7 @@ void SMESHGUI_SewingDlg::ClickOnCancel() aViewWindow->SetSelectionMode(ActorSelection); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -580,10 +583,10 @@ void SMESHGUI_SewingDlg::ClickOnHelp() platform = "application"; #endif SUIT_MessageBox::warning(this, tr("WRN_WARNING"), - tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", - platform)). - arg(myHelpFileName)); + tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", + platform)). + arg(myHelpFileName)); } } @@ -632,15 +635,15 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) SMESH::SetPointRepresentation(true); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(NodeSelection); + aViewWindow->SetSelectionMode(NodeSelection); const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt()); if (n) { - newIndices.Add(n->GetID()); - mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); - + newIndices.Add(n->GetID()); + mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->highlight( myActor->getIO(), true, true ); + if (send == LineEdit1) myOk1 = true; else if (send == LineEdit2) @@ -658,7 +661,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) SMESH::SetPointRepresentation(false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(CellSelection); + aViewWindow->SetSelectionMode(CellSelection); QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); @@ -667,8 +670,8 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) for (int i = 0; i < aListId.count(); i++) { const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); if (e) - newIndices.Add(e->GetID()); - + newIndices.Add(e->GetID()); + if (!isEvenOneExists) isEvenOneExists = true; } @@ -676,7 +679,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->highlight( myActor->getIO(), true, true ); + aViewWindow->highlight( myActor->getIO(), true, true ); if (isEvenOneExists) { if (send == LineEdit1) @@ -870,26 +873,6 @@ void SMESHGUI_SewingDlg::enterEvent (QEvent* e) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_SewingDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_SewingDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : GetConstructorId() // purpose :