Version: 9.15.0
OCCViewer_ViewportInputFilter Class Referenceabstract

The user input filter of OCC viewports. The class can be used to introduce custom interactive operations in OCC viewer, e.g. manipulating IO. The filter receives events in priority to the viewport itself and can bypass some events if it provides custom handling. More...

#include <OCCViewer_ViewportInputFilter.h>

Inheritance diagram for OCCViewer_ViewportInputFilter:
Inheritance graph

Public Member Functions

 OCCViewer_ViewportInputFilter (OCCViewer_ViewManager *, QObject *)
 Constructor. More...
 
 ~OCCViewer_ViewportInputFilter ()
 Destructor. More...
 
virtual void setEnabled (const bool)
 Enables or disables event processing within the viewer. More...
 

Protected Slots

void onViewCreated (SUIT_ViewWindow *)
 Connects newly created within viewer to event processing. More...
 
void onViewRemoved (SUIT_ViewWindow *)
 Disconnects view being removed from viewer. More...
 

Protected Member Functions

virtual bool mouseMove (QMouseEvent *, OCCViewer_ViewPort3d *)=0
 
virtual bool mousePress (QMouseEvent *, OCCViewer_ViewPort3d *)=0
 
virtual bool mouseRelease (QMouseEvent *, OCCViewer_ViewPort3d *)=0
 
virtual bool mouseDoubleClick (QMouseEvent *, OCCViewer_ViewPort3d *)=0
 
virtual bool keyPress (QKeyEvent *, OCCViewer_ViewPort3d *)=0
 
virtual bool keyRelease (QKeyEvent *, OCCViewer_ViewPort3d *)=0
 
void connectView (SUIT_ViewWindow *)
 Connects view to event processing. More...
 
void disconnectView (SUIT_ViewWindow *)
 Disconnects view to event processing. More...
 
bool eventFilter (QObject *, QEvent *)
 Base-level implementation of event filtering. Routes user input events to associated implementation methods. More...
 

Protected Attributes

OCCViewer_ViewManagermyVM
 
OCCViewer_ViewermyViewer
 
bool myIsEnabled
 

Detailed Description

The user input filter of OCC viewports. The class can be used to introduce custom interactive operations in OCC viewer, e.g. manipulating IO. The filter receives events in priority to the viewport itself and can bypass some events if it provides custom handling.

This class is abstract and required implementation of custom reaction on hooked viewport events. The role of the code behind this class is to properly embed the event filter into OCC viewer's structure.

Constructor & Destructor Documentation

◆ OCCViewer_ViewportInputFilter()

OCCViewer_ViewportInputFilter::OCCViewer_ViewportInputFilter ( OCCViewer_ViewManager theVM,
QObject theParent 
)

Constructor.

Parameters
theVM[in] the view manager to embed the filter into.
theParent[in] the parent object.

◆ ~OCCViewer_ViewportInputFilter()

OCCViewer_ViewportInputFilter::~OCCViewer_ViewportInputFilter ( )

Destructor.

References setEnabled().

Member Function Documentation

◆ connectView()

void OCCViewer_ViewportInputFilter::connectView ( SUIT_ViewWindow theView)
protected

Connects view to event processing.

Parameters
theView[in] the view to connect.

◆ disconnectView()

void OCCViewer_ViewportInputFilter::disconnectView ( SUIT_ViewWindow theView)
protected

Disconnects view to event processing.

Parameters
theView[in] the view to disconnect.

◆ eventFilter()

bool OCCViewer_ViewportInputFilter::eventFilter ( QObject theObject,
QEvent theEvent 
)
protected

Base-level implementation of event filtering. Routes user input events to associated implementation methods.

Parameters
theObject[in] the filtered object.
theEvent[in] the incoming event.

References keyPress(), keyRelease(), mouseDoubleClick(), mouseMove(), mousePress(), and mouseRelease().

◆ keyPress()

virtual bool OCCViewer_ViewportInputFilter::keyPress ( QKeyEvent *  ,
OCCViewer_ViewPort3d  
)
protectedpure virtual

◆ keyRelease()

virtual bool OCCViewer_ViewportInputFilter::keyRelease ( QKeyEvent *  ,
OCCViewer_ViewPort3d  
)
protectedpure virtual

◆ mouseDoubleClick()

virtual bool OCCViewer_ViewportInputFilter::mouseDoubleClick ( QMouseEvent *  ,
OCCViewer_ViewPort3d  
)
protectedpure virtual

◆ mouseMove()

virtual bool OCCViewer_ViewportInputFilter::mouseMove ( QMouseEvent *  ,
OCCViewer_ViewPort3d  
)
protectedpure virtual

◆ mousePress()

virtual bool OCCViewer_ViewportInputFilter::mousePress ( QMouseEvent *  ,
OCCViewer_ViewPort3d  
)
protectedpure virtual

◆ mouseRelease()

virtual bool OCCViewer_ViewportInputFilter::mouseRelease ( QMouseEvent *  ,
OCCViewer_ViewPort3d  
)
protectedpure virtual

◆ onViewCreated

void OCCViewer_ViewportInputFilter::onViewCreated ( SUIT_ViewWindow theView)
protectedslot

Connects newly created within viewer to event processing.

Parameters
theView[in] the view to connect.

References connectView().

◆ onViewRemoved

void OCCViewer_ViewportInputFilter::onViewRemoved ( SUIT_ViewWindow theView)
protectedslot

Disconnects view being removed from viewer.

Parameters
theView[in] the view to disconnect.

References disconnectView().

◆ setEnabled()

void OCCViewer_ViewportInputFilter::setEnabled ( const bool  theIsEnabled)
virtual

Member Data Documentation

◆ myIsEnabled

bool OCCViewer_ViewportInputFilter::myIsEnabled
protected

◆ myViewer

OCCViewer_Viewer* OCCViewer_ViewportInputFilter::myViewer
protected

◆ myVM

OCCViewer_ViewManager* OCCViewer_ViewportInputFilter::myVM
protected

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