Version: 8.3.0
SMESHGUI_MinDistance Class Reference

Minimum distance measurement widget. More...

#include <SMESHGUI_Measurements.h>

Inheritance diagram for SMESHGUI_MinDistance:

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_ActormyFirstActor
 
SMESH_ActormySecondActor
 
SMESHGUI_IdValidatormyValidator
 
SUIT_SelectionFiltermyFilter
 
SALOME_ActormyPreview
 

Detailed Description

Minimum distance measurement widget.

Widget to calculate minimum distance between two objects.

Member Enumeration Documentation

anonymous enum
private
Enumerator
NoTgt 
FirstTgt 
SecondTgt 
anonymous enum
private
Enumerator
OriginTgt 
NodeTgt 
ElementTgt 
ObjectTgt 

Constructor & Destructor Documentation

SMESHGUI_MinDistance::~SMESHGUI_MinDistance ( )

Destructor.

References erasePreview(), and myPreview.

Member Function Documentation

void SMESHGUI_MinDistance::clear ( )
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().

void SMESHGUI_MinDistance::createPreview ( double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2 
)
private

Create preview actor.

Parameters
x1X coordinate of first point
y1X coordinate of first point
z1Y coordinate of first point
x2Y coordinate of second point
y2Z coordinate of second point
z2Z coordinate of second point

References myPreview.

Referenced by compute().

void SMESHGUI_MinDistance::deactivate ( )

Deactivate widget.

References SMESHGUI::selectionMgr().

Referenced by SMESHGUI_MeasureDlg::deactivate().

void SMESHGUI_MinDistance::displayPreview ( )
private

Display preview actor.

References SMESH::GetViewWindow(), and myPreview.

Referenced by compute().

void SMESHGUI_MinDistance::erasePreview ( )
private

Erase preview actor.

References SMESH::GetViewWindow(), and myPreview.

Referenced by clear(), compute(), and ~SMESHGUI_MinDistance().

bool SMESHGUI_MinDistance::eventFilter ( QObject o,
QEvent *  e 
)

Event filter.

Parameters
oobject
oevent
Returns
true if event is filtered or false otherwise

References FirstTgt, myFirstTgt, mySecondTgt, SecondTgt, and setTarget().

void SMESHGUI_MinDistance::firstChanged ( )
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().

void SMESHGUI_MinDistance::firstEdited ( )
privateslot
void SMESHGUI_MinDistance::secondChanged ( )
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().

void SMESHGUI_MinDistance::secondEdited ( )
privateslot
void SMESHGUI_MinDistance::setTarget ( int  target)
private

Set current target for selection.

Parameters
targetnew target ID

References myCurrentTgt, and updateSelection().

Referenced by eventFilter(), firstChanged(), firstEdited(), secondChanged(), and secondEdited().

Field Documentation

int SMESHGUI_MinDistance::myCurrentTgt
private
QLineEdit* SMESHGUI_MinDistance::myDistance
private
QLineEdit* SMESHGUI_MinDistance::myDX
private
QLineEdit* SMESHGUI_MinDistance::myDY
private
QLineEdit* SMESHGUI_MinDistance::myDZ
private
SUIT_SelectionFilter* SMESHGUI_MinDistance::myFilter
private
QButtonGroup* SMESHGUI_MinDistance::myFirst
private
SMESH_Actor* SMESHGUI_MinDistance::myFirstActor
private

Referenced by firstEdited(), and selectionChanged().

SMESH::SMESH_IDSource_var SMESHGUI_MinDistance::myFirstSrc
private
QLineEdit* SMESHGUI_MinDistance::myFirstTgt
private
SALOME_Actor* SMESHGUI_MinDistance::myPreview
private
QButtonGroup* SMESHGUI_MinDistance::mySecond
private
SMESH_Actor* SMESHGUI_MinDistance::mySecondActor
private

Referenced by secondEdited(), and selectionChanged().

SMESH::SMESH_IDSource_var SMESHGUI_MinDistance::mySecondSrc
private
QLineEdit* SMESHGUI_MinDistance::mySecondTgt
private
SMESHGUI_IdValidator* SMESHGUI_MinDistance::myValidator
private