Minimum distance measurement widget. More...
#include <SMESHGUI_Measurements.h>
Public Member Functions | |
SMESHGUI_MinDistance (QWidget *=0) | |
Constructor. More... | |
~SMESHGUI_MinDistance () | |
Destructor. More... | |
bool | eventFilter (QObject *, QEvent *) |
Event filter. More... | |
void | updateSelection () |
Setup selection mode depending on the current widget state. More... | |
void | deactivate () |
Deactivate widget. More... | |
Private Types | |
enum | { NoTgt, FirstTgt, SecondTgt } |
enum | { OriginTgt, NodeTgt, ElementTgt, ObjectTgt } |
Private Slots | |
void | selectionChanged () |
Called when selection is changed. More... | |
void | firstChanged () |
Called when first target mode is changed by the user. More... | |
void | secondChanged () |
Called when second target mode is changed by the user. More... | |
void | firstEdited () |
Called when first target is edited by the user. More... | |
void | secondEdited () |
Called when second target is edited by the user. More... | |
void | compute () |
Compute the minimum distance between targets. More... | |
void | clear () |
Reset the widget to the initial state (nullify result fields) More... | |
Private Member Functions | |
void | setTarget (int) |
Set current target for selection. More... | |
void | erasePreview () |
Erase preview actor. More... | |
void | displayPreview () |
Display preview actor. More... | |
void | createPreview (double, double, double, double, double, double) |
Create preview actor. More... | |
Private Attributes | |
QButtonGroup * | myFirst |
QButtonGroup * | mySecond |
QLineEdit * | myFirstTgt |
QLineEdit * | mySecondTgt |
QLineEdit * | myDX |
QLineEdit * | myDY |
QLineEdit * | myDZ |
QLineEdit * | myDistance |
int | myCurrentTgt |
SMESH::SMESH_IDSource_var | myFirstSrc |
SMESH::SMESH_IDSource_var | mySecondSrc |
SMESH_Actor * | myFirstActor |
SMESH_Actor * | mySecondActor |
SMESHGUI_IdValidator * | myValidator |
SUIT_SelectionFilter * | myFilter |
SALOME_Actor * | myPreview |
Minimum distance measurement widget.
Widget to calculate minimum distance between two objects.
SMESHGUI_MinDistance::SMESHGUI_MinDistance | ( | QWidget * | parent = 0 | ) |
Constructor.
parent | parent widget |
References clear(), compute(), ElementTgt, firstChanged(), firstEdited(), SMESH::GROUP, SMESH_LogicalFilter::LO_OR, SMESH::MESHorSUBMESH, myDistance, myDX, myDY, myDZ, myFilter, myFirst, myFirstTgt, mySecond, mySecondTgt, myValidator, NodeTgt, ObjectTgt, OriginTgt, secondChanged(), secondEdited(), and selectionChanged().
SMESHGUI_MinDistance::~SMESHGUI_MinDistance | ( | ) |
Destructor.
References erasePreview(), and myPreview.
|
privateslot |
Reset the widget to the initial state (nullify result fields)
References erasePreview(), myDistance, myDX, myDY, and myDZ.
Referenced by compute(), firstChanged(), firstEdited(), secondChanged(), secondEdited(), selectionChanged(), and SMESHGUI_MinDistance().
|
privateslot |
Compute the minimum distance between targets.
References clear(), createPreview(), displayPreview(), ElementTgt, erasePreview(), SMESH::FACE, SMESHGUI::GetSMESHGen(), me, SMESH::Measure::minX, SMESH::Measure::minY, SMESH::Measure::minZ, myDistance, myDX, myDY, myDZ, myFirst, myFirstSrc, myFirstTgt, mySecond, mySecondSrc, mySecondTgt, SMESH::NODE, SMESH::Measure::node1, SMESH::Measure::node2, NodeTgt, OriginTgt, SMESHGUI::resourceMgr(), and SMESH::Measure::value.
Referenced by SMESHGUI_MinDistance().
|
private |
void SMESHGUI_MinDistance::deactivate | ( | ) |
Deactivate widget.
References SMESHGUI::selectionMgr().
Referenced by SMESHGUI_MeasureDlg::deactivate().
|
private |
|
private |
Erase preview actor.
References SMESH::GetViewWindow(), and myPreview.
Referenced by clear(), compute(), and ~SMESHGUI_MinDistance().
Event filter.
o | object |
o | event |
true
if event is filtered or false
otherwise References FirstTgt, myFirstTgt, mySecondTgt, SecondTgt, and setTarget().
|
privateslot |
Called when first target mode is changed by the user.
References clear(), FirstTgt, myFirst, myFirstSrc, myFirstTgt, myValidator, ObjectTgt, setTarget(), and updateSelection().
Referenced by SMESHGUI_MinDistance().
|
privateslot |
Called when first target is edited by the user.
References clear(), ElementTgt, FirstTgt, SMESH::GetViewWindow(), Handle(), myFirst, myFirstActor, myFirstTgt, NodeTgt, SMESHGUI_SelectionOp::selector(), and setTarget().
Referenced by SMESHGUI_MinDistance(), and updateSelection().
|
privateslot |
Called when second target mode is changed by the user.
References clear(), mySecond, mySecondSrc, mySecondTgt, myValidator, NoTgt, ObjectTgt, OriginTgt, SecondTgt, setTarget(), and updateSelection().
Referenced by SMESHGUI_MinDistance().
|
privateslot |
Called when second target is edited by the user.
References clear(), ElementTgt, SMESH::GetViewWindow(), Handle(), mySecond, mySecondActor, mySecondTgt, NodeTgt, SecondTgt, selectionChanged(), SMESHGUI_SelectionOp::selector(), and setTarget().
Referenced by SMESHGUI_MinDistance(), and updateSelection().
|
privateslot |
Called when selection is changed.
References clear(), SMESH::FindActorByEntry(), FirstTgt, SMESH::GetNameOfSelectedElements(), SMESH::GetNameOfSelectedIObjects(), SMESH::GetNameOfSelectedNodes(), SMESH::GetViewWindow(), Handle(), myCurrentTgt, myFirst, myFirstActor, myFirstSrc, myFirstTgt, mySecond, mySecondActor, mySecondSrc, mySecondTgt, NodeTgt, ObjectTgt, SecondTgt, SMESHGUI_SelectionOp::selected(), SMESHGUI::selectionMgr(), and SMESHGUI_SelectionOp::selector().
Referenced by secondEdited(), SMESHGUI_MinDistance(), and updateSelection().
|
private |
Set current target for selection.
target | new target ID |
References myCurrentTgt, and updateSelection().
Referenced by eventFilter(), firstChanged(), firstEdited(), secondChanged(), and secondEdited().
void SMESHGUI_MinDistance::updateSelection | ( | ) |
Setup selection mode depending on the current widget state.
References ElementTgt, firstEdited(), FirstTgt, SMESH::GetViewWindow(), myCurrentTgt, myFilter, myFirst, mySecond, NodeTgt, NoTgt, ObjectTgt, secondEdited(), SecondTgt, selectionChanged(), SMESHGUI::selectionMgr(), and SMESH::SetPointRepresentation().
Referenced by firstChanged(), secondChanged(), setTarget(), and SMESHGUI_MeasureDlg::updateSelection().
|
private |
Referenced by selectionChanged(), setTarget(), and updateSelection().
|
private |
Referenced by clear(), compute(), and SMESHGUI_MinDistance().
|
private |
Referenced by clear(), compute(), and SMESHGUI_MinDistance().
|
private |
Referenced by clear(), compute(), and SMESHGUI_MinDistance().
|
private |
Referenced by clear(), compute(), and SMESHGUI_MinDistance().
|
private |
Referenced by SMESHGUI_MinDistance(), and updateSelection().
|
private |
Referenced by compute(), firstChanged(), firstEdited(), selectionChanged(), SMESHGUI_MinDistance(), and updateSelection().
|
private |
Referenced by firstEdited(), and selectionChanged().
|
private |
Referenced by compute(), firstChanged(), and selectionChanged().
|
private |
Referenced by compute(), eventFilter(), firstChanged(), firstEdited(), selectionChanged(), and SMESHGUI_MinDistance().
|
private |
Referenced by createPreview(), displayPreview(), erasePreview(), and ~SMESHGUI_MinDistance().
|
private |
Referenced by compute(), secondChanged(), secondEdited(), selectionChanged(), SMESHGUI_MinDistance(), and updateSelection().
|
private |
Referenced by secondEdited(), and selectionChanged().
|
private |
Referenced by compute(), secondChanged(), and selectionChanged().
|
private |
Referenced by compute(), eventFilter(), secondChanged(), secondEdited(), selectionChanged(), and SMESHGUI_MinDistance().
|
private |
Referenced by firstChanged(), secondChanged(), and SMESHGUI_MinDistance().