Version: 9.12.0
MeasureGUI_DimensionInteractor Class Reference

#include <MeasureGUI_DimensionInteractor.h>

Inheritance diagram for MeasureGUI_DimensionInteractor:
Inheritance graph

Public Types

enum  Operation { Operation_MoveFlyoutFree , Operation_MoveFlyoutInPlane , Operation_MoveText , Operation_None }
 

Signals

void InteractionStarted (Handle_AIS_InteractiveObject theIO)
 
void InteractionFinished (Handle_AIS_InteractiveObject theIO)
 

Public Member Functions

 MeasureGUI_DimensionInteractor (GeometryGUI *, QObject *)
 
 ~MeasureGUI_DimensionInteractor ()
 
void Enable ()
 
void Disable ()
 

Protected Slots

void OnViewCreated (SUIT_ViewWindow *)
 
void OnViewRemoved (SUIT_ViewWindow *)
 

Protected Member Functions

Operation GetOperation (const Handle(SelectMgr_EntityOwner)&theEntity, const Qt::MouseButtons theButtons, const Qt::KeyboardModifiers theKeys)
 Identify interactive operation by picked entity and pressed buttons with modifiers. More...
 
bool StartOperation (const Operation theOperation, const Handle(V3d_View)&theView, const int theX, const int theY)
 Prepare for interactive operation. More...
 
void MoveFlyoutFree (const Handle(V3d_View)&theView, const int theX, const int theY)
 Perform "Operation_MoveFlyoutFree". Modify flyout of interactive dimension so as the flyout follows the mouse by its length and orientation. More...
 
void MoveFlyoutInPlane (const Handle(V3d_View)&theView, const int theX, const int theY)
 Perform "Operation_MoveFlyoutInPlane". Modify flyout of interactive dimension so as the flyout is extended to the mouse point location in the presentation plane. More...
 
void MoveText (const Handle(V3d_View)&theView, const int theX, const int theY)
 Perform "Operation_MoveText". Modify text of interactive dimension so as the text is moved to its fixed positions. More...
 
void ConnectView (SUIT_ViewWindow *)
 
void DisconnectView (SUIT_ViewWindow *)
 
gp_Lin Projection (const Handle(V3d_View)&, const int, const int)
 
gp_Pnt ProjectPlane (const Handle(V3d_View)&, const int, const int, const gp_Pln &, bool &)
 
Standard_Real SensitivityTolerance (const Handle(V3d_View)&)
 
virtual bool eventFilter (QObject *, QEvent *)
 Process events from OCC viewer prior to their coming into the base viewer class. More...
 

Private Types

typedef NCollection_Sequence< Handle(SelectMgr_EntityOwner)> SeqOfOwners
 

Private Member Functions

 Handle (AIS_Dimension) myInteractedIO
 

Private Attributes

GeometryGUImyGeomGUI
 
bool myIsEnabled
 
QPointer< OCCViewer_ViewManager > myVM
 
OCCViewer_Viewer * myViewer
 
Operation myOperation
 
bool myOperationStarted
 
gp_Pln myFreeMovePlane
 
SeqOfOwners mySelection
 

Member Typedef Documentation

◆ SeqOfOwners

Member Enumeration Documentation

◆ Operation

Enumerator
Operation_MoveFlyoutFree 
Operation_MoveFlyoutInPlane 
Operation_MoveText 
Operation_None 

Constructor & Destructor Documentation

◆ MeasureGUI_DimensionInteractor()

MeasureGUI_DimensionInteractor::MeasureGUI_DimensionInteractor ( GeometryGUI theGUI,
QObject theParent 
)

◆ ~MeasureGUI_DimensionInteractor()

MeasureGUI_DimensionInteractor::~MeasureGUI_DimensionInteractor ( )

References Disable().

Member Function Documentation

◆ ConnectView()

void MeasureGUI_DimensionInteractor::ConnectView ( SUIT_ViewWindow *  theView)
protected

◆ Disable()

void MeasureGUI_DimensionInteractor::Disable ( )

References DisconnectView(), myIsEnabled, and myVM.

◆ DisconnectView()

void MeasureGUI_DimensionInteractor::DisconnectView ( SUIT_ViewWindow *  theView)
protected

◆ Enable()

void MeasureGUI_DimensionInteractor::Enable ( )

◆ eventFilter()

bool MeasureGUI_DimensionInteractor::eventFilter ( QObject theObject,
QEvent *  theEvent 
)
protectedvirtual

It handles the events coming to viewport and identifies whether the events correspond to interactive operation on dimension. If yes, the operation is performed within the interactor class and events are "accepted". Otherwise, the events are passed to viewer subroutines.

The method manages internal workflow related to starting and stopping interactive operations to modify the presentations which were passed for this interactor class.

References GetOperation(), Handle(), InteractionFinished(), InteractionStarted(), MoveFlyoutFree(), MoveFlyoutInPlane(), MoveText(), myOperation, mySelection, myViewer, Operation_MoveFlyoutFree, Operation_MoveFlyoutInPlane, Operation_MoveText, Operation_None, and StartOperation().

◆ GetOperation()

MeasureGUI_DimensionInteractor::Operation MeasureGUI_DimensionInteractor::GetOperation ( const Handle(SelectMgr_EntityOwner)&  theEntity,
const Qt::MouseButtons  theButtons,
const Qt::KeyboardModifiers  theKeys 
)
protected
Parameters
theEntity[in] the picked entity.
theButtons[in] the mouse buttons.
theKeys[in] the keyboard modifiers.

References Handle(), Operation_MoveFlyoutFree, Operation_MoveFlyoutInPlane, Operation_MoveText, and Operation_None.

◆ Handle()

MeasureGUI_DimensionInteractor::Handle ( AIS_Dimension  )
private

◆ InteractionFinished

void MeasureGUI_DimensionInteractor::InteractionFinished ( Handle_AIS_InteractiveObject  theIO)
signal

◆ InteractionStarted

void MeasureGUI_DimensionInteractor::InteractionStarted ( Handle_AIS_InteractiveObject  theIO)
signal

◆ MoveFlyoutFree()

void MeasureGUI_DimensionInteractor::MoveFlyoutFree ( const Handle(V3d_View)&  theView,
const int  theX,
const int  theY 
)
protected
Parameters
theView[in] the interacted view.
theX[in] the mouse position x.
theY[in] the mouse position y.

References Handle(), myFreeMovePlane, myViewer, and ProjectPlane().

◆ MoveFlyoutInPlane()

void MeasureGUI_DimensionInteractor::MoveFlyoutInPlane ( const Handle(V3d_View)&  theView,
const int  theX,
const int  theY 
)
protected
Parameters
theView[in] the interacted view.
theX[in] the mouse position x.
theY[in] the mouse position y.

References Handle(), myViewer, and ProjectPlane().

◆ MoveText()

void MeasureGUI_DimensionInteractor::MoveText ( const Handle(V3d_View)&  theView,
const int  theX,
const int  theY 
)
protected
Parameters
theView[in] the interacted view.
theX[in] the mouse position x.
theY[in] the mouse position y.

References Handle(), myViewer, and ProjectPlane().

◆ OnViewCreated

void MeasureGUI_DimensionInteractor::OnViewCreated ( SUIT_ViewWindow *  theView)
protectedslot

References ConnectView().

◆ OnViewRemoved

void MeasureGUI_DimensionInteractor::OnViewRemoved ( SUIT_ViewWindow *  theView)
protectedslot

References DisconnectView().

◆ Projection()

gp_Lin MeasureGUI_DimensionInteractor::Projection ( const Handle(V3d_View)&  theView,
const int  theMouseX,
const int  theMouseY 
)
protected

◆ ProjectPlane()

gp_Pnt MeasureGUI_DimensionInteractor::ProjectPlane ( const Handle(V3d_View)&  theView,
const int  theMouseX,
const int  theMouseY,
const gp_Pln &  thePlane,
bool &  theIsDone 
)
protected

References Handle(), and Projection().

◆ SensitivityTolerance()

Standard_Real MeasureGUI_DimensionInteractor::SensitivityTolerance ( const Handle(V3d_View)&  theView)
protected

◆ StartOperation()

bool MeasureGUI_DimensionInteractor::StartOperation ( const Operation  theOperation,
const Handle(V3d_View)&  theView,
const int  theX,
const int  theY 
)
protected
Parameters
theOp[in] the operation.
theView[in] the interacted view.
theX[in] the mouse position x.
theY[in] the mouse position y.
Returns
TRUE if operation can be started.

References Handle(), myFreeMovePlane, Operation_MoveFlyoutFree, Operation_MoveFlyoutInPlane, Operation_MoveText, Projection(), and ProjectPlane().

Member Data Documentation

◆ myFreeMovePlane

gp_Pln MeasureGUI_DimensionInteractor::myFreeMovePlane
private

◆ myGeomGUI

GeometryGUI* MeasureGUI_DimensionInteractor::myGeomGUI
private

◆ myIsEnabled

bool MeasureGUI_DimensionInteractor::myIsEnabled
private

◆ myOperation

Operation MeasureGUI_DimensionInteractor::myOperation
private

◆ myOperationStarted

bool MeasureGUI_DimensionInteractor::myOperationStarted
private

◆ mySelection

SeqOfOwners MeasureGUI_DimensionInteractor::mySelection
private

◆ myViewer

OCCViewer_Viewer* MeasureGUI_DimensionInteractor::myViewer
private

◆ myVM

QPointer<OCCViewer_ViewManager> MeasureGUI_DimensionInteractor::myVM
private

The documentation for this class was generated from the following files: