#include <GLViewer_Viewer.h>
Public Types | |
enum | SelectionMode { NoSelection, Single, Multiple } |
enum | TransformType { NoTransform, Reset, FitAll, FitRect, FitSelect, Zoom, PanGlobal, Pan, Rotate, UserTransform = 100 } |
enum | SketchingType { NoSketching, Rect, UserSketching = 100 } |
Public Types inherited from SUIT_ViewModel | |
enum | HotOperation { PAN, ZOOM, ROTATE, FIT_AREA } |
enum | InteractionStyle { STANDARD, KEY_FREE } |
typedef QMap< HotOperation, Qt::KeyboardModifiers > | StatesMap |
typedef QMap< HotOperation, Qt::MouseButtons > | ButtonsMap |
typedef QMap< InteractionStyle, StatesMap > | InteractionStyle2StatesMap |
typedef QMap< InteractionStyle, ButtonsMap > | InteractionStyle2ButtonsMap |
Signals | |
void | selectionChanged (SelectionChangeStatus) |
Public Member Functions | |
GLViewer_Viewer (const QString &title) | |
~GLViewer_Viewer () | |
virtual void | setViewManager (SUIT_ViewManager *theViewManager) |
virtual QString | getType () const |
virtual void | contextMenuPopup (QMenu *) |
void | setSelectionMode (SelectionMode) |
SelectionMode | getSelectionMode () const |
GLViewer_Selector * | getSelector () const |
virtual void | update (int=0) |
void | activateTransform (int) |
void | activateSketching (int) |
GLViewer_ViewFrame * | getActiveView () const |
Public Member Functions inherited from SUIT_ViewModel | |
SUIT_ViewModel () | |
virtual | ~SUIT_ViewModel () |
virtual SUIT_ViewWindow * | createView (SUIT_Desktop *theDesktop) |
SUIT_ViewManager * | getViewManager () const |
Static Public Member Functions | |
static QString | Type () |
Static Public Member Functions inherited from SUIT_ViewModel | |
static void | setHotButton (InteractionStyle theInteractionStyle, HotOperation theOper, Qt::KeyboardModifiers theState, Qt::MouseButtons theButton) |
static void | getHotButton (InteractionStyle theInteractionStyle, HotOperation theOper, Qt::KeyboardModifiers &theState, Qt::MouseButtons &theButton) |
Protected Slots | |
virtual void | onKeyEvent (SUIT_ViewWindow *, QKeyEvent *) |
virtual void | onMouseEvent (SUIT_ViewWindow *, QMouseEvent *) |
virtual void | onWheelEvent (SUIT_ViewWindow *, QWheelEvent *) |
virtual void | onSelectionCancel () |
virtual void | onSelectionDone (bool add, SelectionChangeStatus status) |
virtual void | onChangeBgColor () |
Protected Member Functions | |
virtual void | onSketchingStarted () |
virtual void | onSketchingFinished () |
virtual void | onTransformationStarted () |
virtual void | onTransformationFinished () |
virtual void | onSelectionModeChanged () |
virtual void | unhilightDetected () |
virtual bool | eventFilter (QObject *, QEvent *) |
virtual GLViewer_ViewTransformer * | createTransformer (int) |
virtual GLViewer_ViewSketcher * | createSketcher (int) |
virtual GLViewer_Selector * | createSelector () |
virtual void | startOperations (QMouseEvent *) |
virtual bool | updateOperations (QMouseEvent *) |
virtual void | finishOperations (QMouseEvent *) |
virtual void | startOperations (QWheelEvent *) |
Protected Attributes | |
GLViewer_Selector * | mySelector |
SelectionMode | mySelMode |
GLViewer_ViewSketcher * | mySketcher |
GLViewer_ViewTransformer * | myTransformer |
Protected Attributes inherited from SUIT_ViewModel | |
SUIT_ViewManager * | myViewManager |
Private Member Functions | |
void | handleMouseMove (QMouseEvent *) |
void | handleMousePress (QMouseEvent *) |
void | handleMouseRelease (QMouseEvent *) |
void | handleWheel (QWheelEvent *) |
Additional Inherited Members | |
Static Public Attributes inherited from SUIT_ViewModel | |
static InteractionStyle2StatesMap | myStateMap |
static InteractionStyle2ButtonsMap | myButtonMap |
GLViewer_Viewer::GLViewer_Viewer | ( | const QString & | title | ) |
Constructor
GLViewer_Viewer::~GLViewer_Viewer | ( | ) |
Destructor
References mySelector.
void GLViewer_Viewer::activateSketching | ( | int | type | ) |
Handles requests for sketching in the active view. [ virtual public ]
References createSketcher(), getActiveView(), GLViewer_ViewPort::isSketchingEnabled(), mySketcher, NoSketching, onSketchingFinished(), and onSketchingStarted().
void GLViewer_Viewer::activateTransform | ( | int | type | ) |
Handles requests for transformations in the active view. [ virtual public ]
References createTransformer(), GLViewer_ViewTransformer::exec(), getActiveView(), GLViewer_ViewPort::isTransformEnabled(), myTransformer, NoTransform, onTransformationFinished(), and onTransformationStarted().
|
virtual |
|
protectedvirtual |
Returns null by default. [ virtual protected ]
Reimplemented in GLViewer_Viewer2d.
|
protectedvirtual |
Creates default sketcher. [ virtual protected ]
|
protectedvirtual |
Creates default transformer. [ virtual protected ]
Reimplemented in GLViewer_Viewer2d.
Installed while 'fit area' and 'global panning' operations are active. [ virtual protected ]
References activateSketching(), activateTransform(), getActiveView(), GLViewer_ViewFrame::getViewPort(), NoSketching, and NoTransform.
|
inlineprotectedvirtual |
Reimplemented in GLViewer_Viewer2d.
GLViewer_ViewFrame * GLViewer_Viewer::getActiveView | ( | ) | const |
Returns the active view. [ public ]
References SUIT_ViewManager::getActiveView(), and SUIT_ViewModel::getViewManager().
GLViewer_Viewer::SelectionMode GLViewer_Viewer::getSelectionMode | ( | ) | const |
Returns the selection mode of this viewer. [ public ]
References mySelMode.
GLViewer_Selector * GLViewer_Viewer::getSelector | ( | ) | const |
Returns selector of this viewer. [ public ]
References createSelector(), mySelector, onSelectionCancel(), and onSelectionDone().
|
inlinevirtual |
Reimplemented from SUIT_ViewModel.
|
private |
Mouse move handler. If dragged with MB1, activates rectangle sketching in the active viewport, otherwise highlights the selectable entities. [ private ]
References activateSketching(), GLViewer_Selector::detect(), getActiveView(), getSelector(), l_mbPressEvent, mySketcher, Rect, GLViewer_ViewSketcher::sketchButton(), and updateOperations().
|
private |
Mouse press handler. If 'accelKey()' is pressed, activates default transformations( Zoom or Pan ) in the active viewport. [ private ]
References GLViewer_ViewTransformer::accelKey(), activateTransform(), Pan, GLViewer_ViewTransformer::panButton(), startOperations(), Zoom, and GLViewer_ViewTransformer::zoomButton().
|
private |
Mouse move handler. Activates popup of the active view. [ private ]
References GLViewer_Selector::appendKey(), BS_Selection, GLViewer_ViewPort::currentBlock(), finishOperations(), getActiveView(), getSelector(), GLViewer_ViewFrame::getViewPort(), l_mbPressEvent, and GLViewer_Selector::select().
|
private |
Wheel rolling handler
References startOperations().
|
protectedvirtualslot |
Sets the background color with color selection dialog. [ virtual protected slot ]
References GLViewer_ViewPort::backgroundColor(), getActiveView(), GLViewer_ViewFrame::getViewPort(), and GLViewer_ViewPort::setBackgroundColor().
|
protectedvirtualslot |
Listens to key events of the active view. [ virtual protected slot ]
|
protectedvirtualslot |
Listens to mouse events of the active view. [ virtual protected slot ]
References handleMouseMove(), handleMousePress(), and handleMouseRelease().
|
protectedvirtualslot |
Called when selection is cleared in this viewer. [ virtual protected slot ]
References SCS_Invalid, and selectionChanged().
|
protectedvirtualslot |
Called when smth is selected in this viewer. [ virtual protected slot ]
References selectionChanged().
|
protectedvirtual |
Enables / disables rectangle sketching. [ virtual protected ]
References SUIT_ViewModel::getViewManager(), SUIT_ViewManager::getViews(), Multiple, mySelMode, and GLViewer_ViewPort::setSketchingEnabled().
|
protectedvirtual |
Selection by rectangle. [ virtual protected ]
References GLViewer_Selector::appendKey(), GLViewer_ViewSketcher::buttonState(), GLViewer_ViewSketcher::data(), getSelector(), mySketcher, Rect, GLViewer_Selector::select(), and GLViewer_ViewSketcher::type().
|
protectedvirtual |
Unhilights detected entities. [ virtual protected ]
References unhilightDetected().
|
protectedvirtual |
Unlock selection, removes event filter. [ virtual protected ]
References getSelector(), GLViewer_Selector::lock(), and myTransformer.
|
protectedvirtual |
Unhilights detected entities, lock selection, sets event filter on the whole application. [ virtual protected ]
References getSelector(), GLViewer_Selector::lock(), myTransformer, and unhilightDetected().
|
protectedvirtualslot |
Listens to mouse events of the active view. [ virtual protected slot ]
References handleWheel().
|
signal |
void GLViewer_Viewer::setSelectionMode | ( | GLViewer_Viewer::SelectionMode | mode | ) |
Sets the selection mode for this viewer. [ public ]
References mySelMode, and onSelectionModeChanged().
|
virtual |
Sets new view manager
theViewManager | - new view manager |
Reimplemented from SUIT_ViewModel.
References onMouseEvent(), onWheelEvent(), and SUIT_ViewModel::setViewManager().
|
inlineprotectedvirtual |
Reimplemented in GLViewer_Viewer2d.
|
inlineprotectedvirtual |
Reimplemented in GLViewer_Viewer2d.
|
inlinestatic |
|
protectedvirtual |
Unhilights the currect detected objects. [ virtual private ]
References getSelector(), and GLViewer_Selector::undetectAll().
|
virtual |
Updates all views of this viewer. Use 'flags' to customize update process. [ virtual public ]
References SUIT_ViewModel::getViewManager(), and SUIT_ViewManager::getViews().
|
inlineprotectedvirtual |
Reimplemented in GLViewer_Viewer2d.
|
protected |
|
protected |
|
protected |
|
protected |