Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GLViewer_Viewer Class Reference

#include <GLViewer_Viewer.h>

Inheritance diagram for GLViewer_Viewer:
Inheritance graph

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_SelectorgetSelector () const
 
virtual void update (int=0)
 
void activateTransform (int)
 
void activateSketching (int)
 
GLViewer_ViewFramegetActiveView () const
 
- Public Member Functions inherited from SUIT_ViewModel
 SUIT_ViewModel ()
 
virtual ~SUIT_ViewModel ()
 
virtual SUIT_ViewWindowcreateView (SUIT_Desktop *theDesktop)
 
SUIT_ViewManagergetViewManager () 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_ViewTransformercreateTransformer (int)
 
virtual GLViewer_ViewSketchercreateSketcher (int)
 
virtual GLViewer_SelectorcreateSelector ()
 
virtual void startOperations (QMouseEvent *)
 
virtual bool updateOperations (QMouseEvent *)
 
virtual void finishOperations (QMouseEvent *)
 
virtual void startOperations (QWheelEvent *)
 

Protected Attributes

GLViewer_SelectormySelector
 
SelectionMode mySelMode
 
GLViewer_ViewSketchermySketcher
 
GLViewer_ViewTransformermyTransformer
 
- Protected Attributes inherited from SUIT_ViewModel
SUIT_ViewManagermyViewManager
 

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
 

Member Enumeration Documentation

Enumerator
NoSelection 
Single 
Multiple 
Enumerator
NoSketching 
Rect 
UserSketching 
Enumerator
NoTransform 
Reset 
FitAll 
FitRect 
FitSelect 
Zoom 
PanGlobal 
Pan 
Rotate 
UserTransform 

Constructor & Destructor Documentation

GLViewer_Viewer::GLViewer_Viewer ( const QString &  title)

Constructor

GLViewer_Viewer::~GLViewer_Viewer ( )

Destructor

References mySelector.

Member Function Documentation

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)
void GLViewer_Viewer::contextMenuPopup ( QMenu thePopup)
virtual

Builds popup for GL viewer

Reimplemented from SUIT_ViewModel.

References onChangeBgColor().

GLViewer_Selector * GLViewer_Viewer::createSelector ( )
protectedvirtual

Returns null by default. [ virtual protected ]

Reimplemented in GLViewer_Viewer2d.

GLViewer_ViewSketcher * GLViewer_Viewer::createSketcher ( int  type)
protectedvirtual

Creates default sketcher. [ virtual protected ]

GLViewer_ViewTransformer * GLViewer_Viewer::createTransformer ( int  type)
protectedvirtual

Creates default transformer. [ virtual protected ]

Reimplemented in GLViewer_Viewer2d.

bool GLViewer_Viewer::eventFilter ( QObject o,
QEvent e 
)
protectedvirtual

Installed while 'fit area' and 'global panning' operations are active. [ virtual protected ]

References activateSketching(), activateTransform(), getActiveView(), GLViewer_ViewFrame::getViewPort(), NoSketching, and NoTransform.

virtual void GLViewer_Viewer::finishOperations ( QMouseEvent *  )
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().

virtual QString GLViewer_Viewer::getType ( ) const
inlinevirtual

Reimplemented from SUIT_ViewModel.

void GLViewer_Viewer::handleMouseMove ( QMouseEvent *  e)
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().

void GLViewer_Viewer::handleMousePress ( QMouseEvent *  e)
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().

void GLViewer_Viewer::handleMouseRelease ( QMouseEvent *  e)
private
void GLViewer_Viewer::handleWheel ( QWheelEvent *  e)
private

Wheel rolling handler

References startOperations().

void GLViewer_Viewer::onChangeBgColor ( )
protectedvirtualslot

Sets the background color with color selection dialog. [ virtual protected slot ]

References GLViewer_ViewPort::backgroundColor(), getActiveView(), GLViewer_ViewFrame::getViewPort(), and GLViewer_ViewPort::setBackgroundColor().

void GLViewer_Viewer::onKeyEvent ( SUIT_ViewWindow ,
QKeyEvent *   
)
protectedvirtualslot

Listens to key events of the active view. [ virtual protected slot ]

void GLViewer_Viewer::onMouseEvent ( SUIT_ViewWindow ,
QMouseEvent *  e 
)
protectedvirtualslot

Listens to mouse events of the active view. [ virtual protected slot ]

References handleMouseMove(), handleMousePress(), and handleMouseRelease().

void GLViewer_Viewer::onSelectionCancel ( )
protectedvirtualslot

Called when selection is cleared in this viewer. [ virtual protected slot ]

References SCS_Invalid, and selectionChanged().

void GLViewer_Viewer::onSelectionDone ( bool  bAdded,
SelectionChangeStatus  status 
)
protectedvirtualslot

Called when smth is selected in this viewer. [ virtual protected slot ]

References selectionChanged().

void GLViewer_Viewer::onSelectionModeChanged ( )
protectedvirtual

Enables / disables rectangle sketching. [ virtual protected ]

References SUIT_ViewModel::getViewManager(), SUIT_ViewManager::getViews(), Multiple, mySelMode, and GLViewer_ViewPort::setSketchingEnabled().

void GLViewer_Viewer::onSketchingFinished ( )
protectedvirtual
void GLViewer_Viewer::onSketchingStarted ( )
protectedvirtual

Unhilights detected entities. [ virtual protected ]

References unhilightDetected().

void GLViewer_Viewer::onTransformationFinished ( )
protectedvirtual

Unlock selection, removes event filter. [ virtual protected ]

References getSelector(), GLViewer_Selector::lock(), and myTransformer.

void GLViewer_Viewer::onTransformationStarted ( )
protectedvirtual

Unhilights detected entities, lock selection, sets event filter on the whole application. [ virtual protected ]

References getSelector(), GLViewer_Selector::lock(), myTransformer, and unhilightDetected().

void GLViewer_Viewer::onWheelEvent ( SUIT_ViewWindow ,
QWheelEvent *  e 
)
protectedvirtualslot

Listens to mouse events of the active view. [ virtual protected slot ]

References handleWheel().

void GLViewer_Viewer::selectionChanged ( SelectionChangeStatus  )
signal
void GLViewer_Viewer::setSelectionMode ( GLViewer_Viewer::SelectionMode  mode)

Sets the selection mode for this viewer. [ public ]

References mySelMode, and onSelectionModeChanged().

void GLViewer_Viewer::setViewManager ( SUIT_ViewManager theViewManager)
virtual

Sets new view manager

Parameters
theViewManager- new view manager

Reimplemented from SUIT_ViewModel.

References onMouseEvent(), onWheelEvent(), and SUIT_ViewModel::setViewManager().

virtual void GLViewer_Viewer::startOperations ( QMouseEvent *  )
inlineprotectedvirtual

Reimplemented in GLViewer_Viewer2d.

virtual void GLViewer_Viewer::startOperations ( QWheelEvent *  )
inlineprotectedvirtual

Reimplemented in GLViewer_Viewer2d.

static QString GLViewer_Viewer::Type ( )
inlinestatic
void GLViewer_Viewer::unhilightDetected ( )
protectedvirtual

Unhilights the currect detected objects. [ virtual private ]

References getSelector(), and GLViewer_Selector::undetectAll().

void GLViewer_Viewer::update ( int  flags = 0)
virtual

Updates all views of this viewer. Use 'flags' to customize update process. [ virtual public ]

References SUIT_ViewModel::getViewManager(), and SUIT_ViewManager::getViews().

virtual bool GLViewer_Viewer::updateOperations ( QMouseEvent *  )
inlineprotectedvirtual

Reimplemented in GLViewer_Viewer2d.

Member Data Documentation

GLViewer_Selector* GLViewer_Viewer::mySelector
protected
SelectionMode GLViewer_Viewer::mySelMode
protected
GLViewer_ViewSketcher* GLViewer_Viewer::mySketcher
protected
GLViewer_ViewTransformer* GLViewer_Viewer::myTransformer
protected

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