Salome HOME
0022101: EDF 2492 SMESH: Update Destination field when "Find closest to destination...
authorvsr <vsr@opencascade.com>
Wed, 22 May 2013 15:48:24 +0000 (15:48 +0000)
committervsr <vsr@opencascade.com>
Wed, 22 May 2013 15:48:24 +0000 (15:48 +0000)
doc/salome/gui/SMESH/images/meshtopass.png
doc/salome/gui/SMESH/input/mesh_through_point.doc
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHGUI/SMESH_msg_fr.ts

index 1c426783e94d591b1e8a11f91afa51d28bf623fc..ebddaf4480928da9962cec1b0aa82835e1ff6125 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/meshtopass.png and b/doc/salome/gui/SMESH/images/meshtopass.png differ
index 968bfbc0b7c99acde86adb51fce510dccd977a5b..b84df8b1b59619b97ce7e55f2173f6a93b9d41d7 100644 (file)
@@ -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.</li>
 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.</li>
+<li>The <b>Update Destination</b> button is activated when <b>Find
+closest to destination</b> option is unchecked. Click the <b>Update
+Destination</b> button for update coordinates of the destination point
+from original coordinates of the node to move.</li>
 <li>Click the \b Apply or <b>Apply and Close</b> button.</li>
 </ol>
 
 <li>Click the \b Apply or <b>Apply and Close</b> button.</li>
 </ol>
 
@@ -34,4 +38,4 @@ to see original coordinates and displacement of the node to move).
 <br><b>See Also</b> a sample TUI Script of a 
 \ref tui_moving_nodes "Moving Nodes" operation.  
 
 <br><b>See Also</b> a sample TUI Script of a 
 \ref tui_moving_nodes "Moving Nodes" operation.  
 
-*/
\ No newline at end of file
+*/
index 9c2b90fb0955ae39e2546b9cdde560347066e151..1c0e05abd4ed64f49f4e6f4b23233bc59e99a2d5 100644 (file)
@@ -175,6 +175,9 @@ QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent)
   myId = new QLineEdit(myNodeToMoveGrp);
   myId->setValidator(new SMESHGUI_IdValidator(this, 1));
 
   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);
   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( 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);
 
   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 );
       myIdBtn->setChecked( false );
       myIdBtn->setEnabled( false );
       myCoordBtn->setChecked( true );
+      myUpdateBtn->setEnabled( false );
     }
     else {
       myId->setReadOnly ( false );
       myIdBtn->setEnabled( true );
     }
     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";
 
   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()));
   // 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&)));
   // 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 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);
               double dy = myDlg->myY->GetValue() - y;
               double dz = myDlg->myZ->GetValue() - z;
               myDlg->myCurrentX->SetValue(x);
index 07ae2c933ba46c0cb03573e0f25e39ccc787fea3..4ab5194e1829186add827080482aa20fb8c2cee8 100644 (file)
@@ -69,6 +69,7 @@ private slots:
   void                           onSelectionDone();
   void                           redisplayPreview();
   void                           onTextChange( const QString& );
   void                           onSelectionDone();
   void                           redisplayPreview();
   void                           onTextChange( const QString& );
+  void                           onUpdateDestination();
 
 private:
   SMESHGUI_MakeNodeAtPointDlg*  myDlg;
 
 private:
   SMESHGUI_MakeNodeAtPointDlg*  myDlg;
@@ -78,6 +79,7 @@ private:
   SMESHGUI_MeshEditPreview*     mySimulation;
   SMESH_Actor*                  myMeshActor;
   bool                          myNoPreview;
   SMESHGUI_MeshEditPreview*     mySimulation;
   SMESH_Actor*                  myMeshActor;
   bool                          myNoPreview;
+  bool                          myUpdateDestination;
 };
 
 /*!
 };
 
 /*!
@@ -95,6 +97,7 @@ private:
   QWidget*                      createMainFrame( QWidget* );
 
   QPushButton*                  myCoordBtn;
   QWidget*                      createMainFrame( QWidget* );
 
   QPushButton*                  myCoordBtn;
+  QPushButton*                  myUpdateBtn;
   SMESHGUI_SpinBox*             myX;
   SMESHGUI_SpinBox*             myY;
   SMESHGUI_SpinBox*             myZ;
   SMESHGUI_SpinBox*             myX;
   SMESHGUI_SpinBox*             myY;
   SMESHGUI_SpinBox*             myZ;
index 7fe4e8f7c0cda1356c77c709e427275917b43a76..2dd8eacf40945aff796969bc5ed318fd25f27221 100644 (file)
@@ -3953,6 +3953,10 @@ Please check preferences of Mesh module.
         <source>UNKNOWN_CONTROL</source>
         <translation>Unknown</translation>
     </message>
         <source>UNKNOWN_CONTROL</source>
         <translation>Unknown</translation>
     </message>
+    <message>
+        <source>UPDATE_DESTINATION</source>
+        <translation>Update Destination</translation>
+    </message>
     <message>
         <source>VOLUME_3D_ELEMENTS</source>
         <translation>Volume</translation>
     <message>
         <source>VOLUME_3D_ELEMENTS</source>
         <translation>Volume</translation>
index 27645cecb35b98b15044ec7bce02dce129c7197a..6aae4287aef9e894b0f2d21ef18703c3c859235d 100755 (executable)
@@ -3929,6 +3929,10 @@ Vérifiez la limite dans les préférences du module Mesh.
         <source>UNKNOWN_CONTROL</source>
         <translation>Inconnu</translation>
     </message>
         <source>UNKNOWN_CONTROL</source>
         <translation>Inconnu</translation>
     </message>
+    <message>
+        <source>UPDATE_DESTINATION</source>
+        <translation type="unfinished">Update Destination</translation>
+    </message>
     <message>
         <source>VOLUME_3D_ELEMENTS</source>
         <translation>Volume</translation>
     <message>
         <source>VOLUME_3D_ELEMENTS</source>
         <translation>Volume</translation>