X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MoveNodesDlg.cxx;h=842753af5aa030d5b5cc630665f3b44f1a3316b3;hb=bf4b4d36c45465982258693c08c256429394335a;hp=944a6d2a9e74540a3696813584dc4563d006c4e5;hpb=b33324fe602b1fe1158c14a866c3802df12370fa;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx index 944a6d2a9..842753af5 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx @@ -17,7 +17,7 @@ // 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -39,9 +39,12 @@ #include "SMDS_Mesh.hxx" #include "SMDS_MeshNode.hxx" -#include "SalomeApp_SelectionMgr.h" +#include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SVTK_Selector.h" #include "SVTK_ViewModel.h" @@ -49,6 +52,7 @@ #include "SALOME_ListIO.hxx" #include "SVTK_ViewWindow.h" +#include "VTKViewer_CellLocationsArray.h" #include "utilities.h" @@ -58,11 +62,11 @@ // VTK includes #include #include -#include #include #include #include #include +#include // QT includes #include @@ -113,6 +117,8 @@ SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule, mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector(); + myHelpFileName = "/files/displacing_nodes.htm"; + Init(); } @@ -128,6 +134,7 @@ QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent) myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame); myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -137,10 +144,12 @@ QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myApplyBtn); aLay->addItem(aSpacer); aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); return aFrame; } @@ -223,9 +232,6 @@ void SMESHGUI_MoveNodesDlg::Init() reset(); setEnabled(true); - int x, y; - mySMESHGUI->DefineDlgPosition(this, x, y); - this->move(x, y); this->show(); // set selection mode @@ -322,16 +328,40 @@ void SMESHGUI_MoveNodesDlg::onOk() //======================================================================= void SMESHGUI_MoveNodesDlg::onClose() { - mySelectionMgr->clearSelected(); + //mySelectionMgr->clearSelected(); SMESH::SetPointRepresentation(false); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); disconnect(mySelectionMgr, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0); + erasePreview(); mySMESHGUI->ResetState(); reject(); } +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_MoveNodesDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + //======================================================================= // name : SMESHGUI_MoveNodesDlg::onTextChange // Purpose : @@ -523,7 +553,7 @@ void SMESHGUI_MoveNodesDlg::redisplayPreview() aCellTypesArray->InsertNextValue(VTK_VERTEX); anIdList->Delete(); - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(1);