diff --git a/doc/salome/gui/SMESH/images/meshtopass.png b/doc/salome/gui/SMESH/images/meshtopass.png index 1c426783e..ebddaf448 100755 Binary files a/doc/salome/gui/SMESH/images/meshtopass.png and b/doc/salome/gui/SMESH/images/meshtopass.png differ diff --git a/doc/salome/gui/SMESH/input/mesh_through_point.doc b/doc/salome/gui/SMESH/input/mesh_through_point.doc index 968bfbc0b..b84df8b1b 100644 --- a/doc/salome/gui/SMESH/input/mesh_through_point.doc +++ b/doc/salome/gui/SMESH/input/mesh_through_point.doc @@ -24,6 +24,10 @@ The following dialog box shall appear: select the necessary node manually (X, Y, Z, dX, dY, dZ fields allow to see original coordinates and displacement of the node to move). \b Preview check-box allows to see the results of the operation. +
  • The Update Destination button is activated when Find +closest to destination option is unchecked. Click the Update +Destination button for update coordinates of the destination point +from original coordinates of the node to move.
  • Click the \b Apply or Apply and Close button.
  • @@ -34,4 +38,4 @@ to see original coordinates and displacement of the node to move).
    See Also a sample TUI Script of a \ref tui_moving_nodes "Moving Nodes" operation. -*/ \ No newline at end of file +*/ diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index 9c2b90fb0..1c0e05abd 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -175,6 +175,9 @@ QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent) myId = new QLineEdit(myNodeToMoveGrp); myId->setValidator(new SMESHGUI_IdValidator(this, 1)); + myUpdateBtn = new QPushButton(tr("UPDATE_DESTINATION"), myNodeToMoveGrp); + myUpdateBtn->setAutoDefault(true); + QWidget* aCoordWidget = new QWidget(myNodeToMoveGrp); QLabel* aCurrentXLabel = new QLabel(tr("SMESH_X"), aCoordWidget); @@ -243,9 +246,10 @@ QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent) myNodeToMoveGrpLayout->addWidget( idLabel, 0, 0 ); myNodeToMoveGrpLayout->addWidget( myIdBtn, 0, 1 ); myNodeToMoveGrpLayout->addWidget( myId, 0, 2 ); - myNodeToMoveGrpLayout->addWidget( aCoordWidget, 1, 0, 1, 3 ); - myNodeToMoveGrpLayout->addWidget( myAutoSearchChkBox, 2, 0, 1, 3 ); - myNodeToMoveGrpLayout->addWidget( myPreviewChkBox, 3, 0, 1, 3 ); + myNodeToMoveGrpLayout->addWidget( myUpdateBtn, 0, 3 ); + myNodeToMoveGrpLayout->addWidget( aCoordWidget, 1, 0, 1, 4 ); + myNodeToMoveGrpLayout->addWidget( myAutoSearchChkBox, 2, 0, 1, 4 ); + myNodeToMoveGrpLayout->addWidget( myPreviewChkBox, 3, 0, 1, 4 ); QVBoxLayout* aLay = new QVBoxLayout(aFrame); aLay->addWidget(aPixGrp); @@ -297,10 +301,12 @@ void SMESHGUI_MakeNodeAtPointDlg::ButtonToggled (bool on) myIdBtn->setChecked( false ); myIdBtn->setEnabled( false ); myCoordBtn->setChecked( true ); + myUpdateBtn->setEnabled( false ); } else { myId->setReadOnly ( false ); myIdBtn->setEnabled( true ); + myUpdateBtn->setEnabled( true ); } } } @@ -318,6 +324,9 @@ SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp() myFilter = 0; myHelpFileName = "mesh_through_point_page.html"; + myNoPreview = false; + myUpdateDestination = false; + // connect signals and slots connect(myDlg->myX, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview())); connect(myDlg->myY, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview())); @@ -329,6 +338,14 @@ SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp() // IPAL22913: TC6.5.0: selected in "Move node" dialog box node is not highlighted // note: this slot seems to be lost together with removed obsolete SMESHGUI_MoveNodesDlg class connect(myDlg->myId,SIGNAL (textChanged(const QString&)),SLOT(onTextChange(const QString&))); + connect(myDlg->myUpdateBtn, SIGNAL (clicked()), this, SLOT(onUpdateDestination())); +} + +void SMESHGUI_MakeNodeAtPointOp::onUpdateDestination() +{ + myUpdateDestination = true; + redisplayPreview(); + myUpdateDestination = false; } //======================================================================= @@ -667,7 +684,14 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview() double x = aXYZ->operator[](0); double y = aXYZ->operator[](1); double z = aXYZ->operator[](2); - double dx = myDlg->myX->GetValue() - x; + + if ( myUpdateDestination ) { + myDlg->myX->SetValue(x); + myDlg->myY->SetValue(y); + myDlg->myZ->SetValue(z); + } + + double dx = myDlg->myX->GetValue() - x; double dy = myDlg->myY->GetValue() - y; double dz = myDlg->myZ->GetValue() - z; myDlg->myCurrentX->SetValue(x); diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h index 07ae2c933..4ab5194e1 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h @@ -69,6 +69,7 @@ private slots: void onSelectionDone(); void redisplayPreview(); void onTextChange( const QString& ); + void onUpdateDestination(); private: SMESHGUI_MakeNodeAtPointDlg* myDlg; @@ -78,6 +79,7 @@ private: SMESHGUI_MeshEditPreview* mySimulation; SMESH_Actor* myMeshActor; bool myNoPreview; + bool myUpdateDestination; }; /*! @@ -95,6 +97,7 @@ private: QWidget* createMainFrame( QWidget* ); QPushButton* myCoordBtn; + QPushButton* myUpdateBtn; SMESHGUI_SpinBox* myX; SMESHGUI_SpinBox* myY; SMESHGUI_SpinBox* myZ; diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 7fe4e8f7c..2dd8eacf4 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -3953,6 +3953,10 @@ Please check preferences of Mesh module. UNKNOWN_CONTROL Unknown + + UPDATE_DESTINATION + Update Destination + VOLUME_3D_ELEMENTS Volume diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 27645cecb..6aae4287a 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -3929,6 +3929,10 @@ Vérifiez la limite dans les préférences du module Mesh. UNKNOWN_CONTROL Inconnu + + UPDATE_DESTINATION + Update Destination + VOLUME_3D_ELEMENTS Volume