0022101: EDF 2492 SMESH: Update Destination field when "Find closest to destination" is unchecked in "Move node"

This commit is contained in:
vsr 2013-05-22 15:48:24 +00:00
parent 5dcf8c6597
commit 5de80d5f32
6 changed files with 44 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View 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>
<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>
@ -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.
*/
*/

View File

@ -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);

View File

@ -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;

View File

@ -3953,6 +3953,10 @@ Please check preferences of Mesh module.
<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>

View File

@ -3929,6 +3929,10 @@ Vérifiez la limite dans les préférences du module Mesh.
<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>