#include <OCCViewer_ViewModel.h>

Public Types | |
| 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 () |
| void | deselection () |
Public Member Functions | |
| OCCViewer_Viewer (bool DisplayTrihedron=true, bool DisplayStaticTrihedron=true) | |
| virtual | ~OCCViewer_Viewer () |
| void | update () |
| virtual SUIT_ViewWindow * | createView (SUIT_Desktop *theDesktop) |
| virtual void | setViewManager (SUIT_ViewManager *theViewManager) |
| virtual QString | getType () const |
| virtual void | contextMenuPopup (QMenu *) |
| void | getSelectedObjects (AIS_ListOfInteractive &theList) |
| void | setObjectsSelected (const AIS_ListOfInteractive &theList) |
| void | setSelected (const Handle(AIS_InteractiveObject)&theIO) |
| void | performSelectionChanged () |
| QColor | backgroundColor () const |
| void | setBackgroundColor (const QColor &) |
| QColor | backgroundColor (int theViewId) const |
| void | setBackgroundColor (int theViewId, const QColor &) |
| bool | trihedronActivated () const |
| returns true if 3d Trihedron in viewer was created | |
| void | toggleTrihedron () |
| bool | isTrihedronVisible () const |
| virtual void | setTrihedronShown (const bool) |
| double | trihedronSize () const |
| virtual void | setTrihedronSize (const double) |
| virtual OCCViewer_ViewWindow * | createSubWindow () |
| Handle (V3d_Viewer) getViewer3d() const | |
| Handle (V3d_Viewer) getCollector3d() const | |
| Handle (AIS_InteractiveContext) getAISContext() const | |
| Handle (AIS_Trihedron) getTrihedron() const | |
| int | interactionStyle () const |
| void | setInteractionStyle (const int) |
| int | zoomingStyle () const |
| void | setZoomingStyle (const int) |
| void | enableSelection (bool isEnabled) |
| bool | isSelectionEnabled () const |
| void | enableMultiselection (bool isEnable) |
| bool | isMultiSelectionEnabled () const |
| int | getSelectionCount () const |
| bool | isStaticTrihedronDisplayed () |
| bool | highlight (const Handle(AIS_InteractiveObject)&, bool, bool=true) |
| bool | unHighlightAll (bool=true) |
| bool | isInViewer (const Handle(AIS_InteractiveObject)&, bool=false) |
| bool | isVisible (const Handle(AIS_InteractiveObject)&) |
| void | setColor (const Handle(AIS_InteractiveObject)&, const QColor &, bool=true) |
| void | switchRepresentation (const Handle(AIS_InteractiveObject)&, int, bool=true) |
| void | setTransparency (const Handle(AIS_InteractiveObject)&, float, bool=true) |
| void | setIsos (const int u, const int v) |
| void | isos (int &u, int &v) const |
| void | initView (OCCViewer_ViewWindow *view) |
| SUIT_ViewManager * | getViewManager () const |
Static Public Member Functions | |
| static QString | Type () |
| 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) |
Static Public Attributes | |
| static InteractionStyle2StatesMap | myStateMap |
| static InteractionStyle2ButtonsMap | myButtonMap |
Protected Slots | |
| void | onMousePress (SUIT_ViewWindow *, QMouseEvent *) |
| void | onMouseMove (SUIT_ViewWindow *, QMouseEvent *) |
| void | onMouseRelease (SUIT_ViewWindow *, QMouseEvent *) |
| void | onKeyPress (SUIT_ViewWindow *, QKeyEvent *) |
| void | onDumpView () |
| void | onChangeBgColor () |
Protected Attributes | |
| SUIT_ViewManager * | myViewManager |
Private Member Functions | |
| Handle (V3d_Viewer) myV3dViewer | |
| Handle (V3d_Viewer) myV3dCollector | |
| Handle (AIS_Trihedron) myTrihedron | |
| Handle (AIS_InteractiveContext) myAISContext | |
Private Attributes | |
| int | myInteractionStyle |
| int | myZoomingStyle |
| bool | mySelectionEnabled |
| bool | myMultiSelectionEnabled |
| QPoint | myStartPnt |
| QPoint | myEndPnt |
| bool | myShowStaticTrihedron |
| QVector< QColor > | myColors |
typedef QMap<HotOperation, Qt::KeyboardModifiers> SUIT_ViewModel.StatesMap [inherited] |
typedef QMap<HotOperation, Qt::MouseButtons> SUIT_ViewModel.ButtonsMap [inherited] |
typedef QMap<InteractionStyle, StatesMap> SUIT_ViewModel.InteractionStyle2StatesMap [inherited] |
typedef QMap<InteractionStyle, ButtonsMap> SUIT_ViewModel.InteractionStyle2ButtonsMap [inherited] |
enum SUIT_ViewModel::HotOperation [inherited] |
enum SUIT_ViewModel::InteractionStyle [inherited] |
| OCCViewer_Viewer::OCCViewer_Viewer | ( | bool | DisplayTrihedron = true, |
| bool | DisplayStaticTrihedron = true |
||
| ) |
Constructor
| DisplayTrihedron | - is trihedron displayed |
References Handle(), myInteractionStyle, myMultiSelectionEnabled, mySelectionEnabled, myZoomingStyle, and OCCViewer_VService.Viewer3d().
| OCCViewer_Viewer::~OCCViewer_Viewer | ( | ) | [virtual] |
Destructor
| static QString OCCViewer_Viewer.Type | ( | ) | [static] |
| void OCCViewer_Viewer::update | ( | ) |
Updates OCC 3D viewer
References SUIT_ViewManager.getActiveView(), SUIT_ViewModel.myViewManager, and OCCViewer_ViewWindow.updateGravityCoords().
| SUIT_ViewWindow * OCCViewer_Viewer::createView | ( | SUIT_Desktop * | theDesktop | ) | [virtual] |
Creates new view window
| theDesktop | - main window of application |
Reimplemented from SUIT_ViewModel.
References OCCViewer_ViewFrame.getView(), initView(), and OCCViewer_ViewFrame.MAIN_VIEW.
| void OCCViewer_Viewer::setViewManager | ( | SUIT_ViewManager * | theViewManager | ) | [virtual] |
Sets new view manager
| theViewManager | - new view manager |
Reimplemented from SUIT_ViewModel.
References onKeyPress(), onMouseMove(), onMousePress(), and onMouseRelease().
| virtual QString OCCViewer_Viewer.getType | ( | ) | const [virtual] |
Reimplemented from SUIT_ViewModel.
| void OCCViewer_Viewer::contextMenuPopup | ( | QMenu * | thePopup | ) | [virtual] |
Builds popup for occ viewer
Reimplemented from SUIT_ViewModel.
References SUIT_ViewManager.getActiveView(), SUIT_ViewModel.myViewManager, onChangeBgColor(), and onDumpView().
| void OCCViewer_Viewer::getSelectedObjects | ( | AIS_ListOfInteractive & | theList | ) |
| theList | - list to be filled with selected objects |
| void OCCViewer_Viewer::setObjectsSelected | ( | const AIS_ListOfInteractive & | theList | ) |
Selects objects in 3D viewer. Other selected objects are left as selected
| theList | - list objects to be selected |
| void OCCViewer_Viewer.setSelected | ( | const Handle(AIS_InteractiveObject)& | theIO | ) |
| void OCCViewer_Viewer::performSelectionChanged | ( | ) |
Auxiliary method to emit signal selectionChanged()
References selectionChanged().
| QColor OCCViewer_Viewer::backgroundColor | ( | ) | const |
References myColors.
| void OCCViewer_Viewer::setBackgroundColor | ( | const QColor & | c | ) |
Sets background color
| c | - new background color |
| QColor OCCViewer_Viewer::backgroundColor | ( | int | theViewId | ) | const |
References myColors.
| void OCCViewer_Viewer::setBackgroundColor | ( | int | theViewId, |
| const QColor & | theColor | ||
| ) |
References myColors.
| bool OCCViewer_Viewer.trihedronActivated | ( | ) | const |
| void OCCViewer_Viewer::toggleTrihedron | ( | ) |
Changes visibility of trihedron to opposite
References isTrihedronVisible(), and setTrihedronShown().
| bool OCCViewer_Viewer::isTrihedronVisible | ( | ) | const |
| void OCCViewer_Viewer::setTrihedronShown | ( | const bool | on | ) | [virtual] |
Sets visibility state of trihedron
| on | - new state |
| double OCCViewer_Viewer::trihedronSize | ( | ) | const |
| void OCCViewer_Viewer::setTrihedronSize | ( | const double | sz | ) | [virtual] |
Changes trihedron size
| sz | - new size |
| OCCViewer_ViewWindow * OCCViewer_Viewer::createSubWindow | ( | ) | [virtual] |
Reimplemented in SOCC_Viewer.
| OCCViewer_Viewer.Handle | ( | V3d_Viewer | ) | const |
| OCCViewer_Viewer.Handle | ( | V3d_Viewer | ) | const |
| OCCViewer_Viewer.Handle | ( | AIS_InteractiveContext | ) | const |
| OCCViewer_Viewer.Handle | ( | AIS_Trihedron | ) | const |
| int OCCViewer_Viewer::interactionStyle | ( | ) | const |
References myInteractionStyle.
| void OCCViewer_Viewer::setInteractionStyle | ( | const int | theStyle | ) |
Sets interaction style: 0 - standard, 1 - keyboard free interaction
| theStyle | - new interaction style |
! To be done for view windows
References SUIT_ViewManager.getViews(), myInteractionStyle, SUIT_ViewModel.myViewManager, and OCCViewer_ViewWindow.setInteractionStyle().
| int OCCViewer_Viewer::zoomingStyle | ( | ) | const |
References myZoomingStyle.
| void OCCViewer_Viewer::setZoomingStyle | ( | const int | theStyle | ) |
Sets zooming style: 0 - standard, 1 - advanced (at cursor)
| theStyle | - new zooming style |
! To be done for view windows
References SUIT_ViewManager.getViews(), SUIT_ViewModel.myViewManager, myZoomingStyle, and OCCViewer_ViewWindow.setZoomingStyle().
| void OCCViewer_Viewer::enableSelection | ( | bool | isEnabled | ) |
Sets selection enabled status
| isEnabled | - new status |
! To be done for view windows
References SUIT_ViewManager.getViews(), mySelectionEnabled, SUIT_ViewModel.myViewManager, and OCCViewer_ViewWindow.updateEnabledDrawMode().
| bool OCCViewer_Viewer.isSelectionEnabled | ( | ) | const |
| void OCCViewer_Viewer::enableMultiselection | ( | bool | isEnable | ) |
Sets multiselection enabled status
| isEnabled | - new status |
! To be done for view windows
References SUIT_ViewManager.getViews(), myMultiSelectionEnabled, SUIT_ViewModel.myViewManager, and OCCViewer_ViewWindow.updateEnabledDrawMode().
| bool OCCViewer_Viewer.isMultiSelectionEnabled | ( | ) | const |
| int OCCViewer_Viewer.getSelectionCount | ( | ) | const |
| bool OCCViewer_Viewer.isStaticTrihedronDisplayed | ( | ) |
| bool OCCViewer_Viewer::highlight | ( | const Handle(AIS_InteractiveObject)& | obj, |
| bool | hilight, | ||
| bool | update = true |
||
| ) |
Hilights/unhilights object in viewer
| obj | - object to be updated |
| hilight | - if it is true, object will be hilighted, otherwise it will be unhilighted |
| update | - update current viewer |
| bool OCCViewer_Viewer::unHighlightAll | ( | bool | updateviewer = true | ) |
Unhilights all objects in viewer
| updateviewer | - update current viewer |
| bool OCCViewer_Viewer::isInViewer | ( | const Handle(AIS_InteractiveObject)& | obj, |
| bool | onlyInViewer = false |
||
| ) |
| obj | - object to be checked |
| onlyInViewer | - search object only in viewer (so object must be displayed) |
References PyInterp.obj.
| bool OCCViewer_Viewer::isVisible | ( | const Handle(AIS_InteractiveObject)& | obj | ) |
| obj | - object to be checked |
| void OCCViewer_Viewer::setColor | ( | const Handle(AIS_InteractiveObject)& | obj, |
| const QColor & | color, | ||
| bool | update = true |
||
| ) |
Sets color of object
| obj | - object to be updated |
| color | - new color |
| update | - update current viewer |
| void OCCViewer_Viewer::switchRepresentation | ( | const Handle(AIS_InteractiveObject)& | obj, |
| int | mode, | ||
| bool | update = true |
||
| ) |
Changes display mode of object
| obj | - object to be processed |
| mode | - new display mode |
| update | - update current viewer |
| void OCCViewer_Viewer::setTransparency | ( | const Handle(AIS_InteractiveObject)& | obj, |
| float | trans, | ||
| bool | update = true |
||
| ) |
Changes transparency of object
| obj | - object to be processed |
| trans | - new transparency |
| update | - update current viewer |
| void OCCViewer_Viewer::setIsos | ( | const int | u, |
| const int | v | ||
| ) |
Set number of isolines
| u | - u-isolines (first parametric co-ordinate) |
| v | - v-isolines (second parametric co-ordinate) |
References Handle().
| void OCCViewer_Viewer::isos | ( | int & | u, |
| int & | v | ||
| ) | const |
| u | - to return u-isolines (first parametric co-ordinate) |
| v | - to return v-isolines (second parametric co-ordinate) |
References Handle().
| void OCCViewer_Viewer::initView | ( | OCCViewer_ViewWindow * | view | ) |
Start initialization of view window
| view | - view window to be initialized |
References OCCViewer_ViewWindow.getViewPort(), OCCViewer_ViewWindow.initLayout(), OCCViewer_ViewWindow.initSketchers(), interactionStyle(), myColors, OCCViewer_ViewPort3d.setBackgroundColor(), OCCViewer_ViewWindow.setInteractionStyle(), OCCViewer_ViewWindow.setZoomingStyle(), and zoomingStyle().
| void OCCViewer_Viewer.selectionChanged | ( | ) | [signal] |
| void OCCViewer_Viewer.deselection | ( | ) | [signal] |
| void OCCViewer_Viewer::onMousePress | ( | SUIT_ViewWindow * | theWindow, |
| QMouseEvent * | theEvent | ||
| ) | [protected, slot] |
SLOT: called on mouse button press, stores current mouse position as start point for transformations
References myStartPnt.
| void OCCViewer_Viewer::onMouseMove | ( | SUIT_ViewWindow * | theWindow, |
| QMouseEvent * | theEvent | ||
| ) | [protected, slot] |
SLOT: called on mouse move, processes transformation or hilighting
References OCCViewer_ViewWindow.getViewPort(), Handle(), OCCViewer_ViewPort3d.isBusy(), isSelectionEnabled(), and mySelectionEnabled.
| void OCCViewer_Viewer::onMouseRelease | ( | SUIT_ViewWindow * | theWindow, |
| QMouseEvent * | theEvent | ||
| ) | [protected, slot] |
SLOT: called on mouse button release, finishes transformation or selection
References deselection(), OCCViewer_ViewWindow.getViewPort(), Handle(), OCCViewer_ViewWindow.interactionStyle(), myEndPnt, myMultiSelectionEnabled, mySelectionEnabled, myStartPnt, selectionChanged(), and SUIT_ViewModel.STANDARD.
| void OCCViewer_Viewer::onKeyPress | ( | SUIT_ViewWindow * | theWindow, |
| QKeyEvent * | theEvent | ||
| ) | [protected, slot] |
SLOT: called on key press, processes selection in "key free" interaction style
References deselection(), OCCViewer_ViewWindow.interactionStyle(), SUIT_ViewModel.KEY_FREE, mySelectionEnabled, and selectionChanged().
| void OCCViewer_Viewer::onDumpView | ( | ) | [protected, slot] |
SLOT: called on dump view operation is activated, stores scene to raster file
References SUIT_ViewManager.getActiveView(), SUIT_ViewModel.myViewManager, and SUIT_ViewWindow.onDumpView().
| void OCCViewer_Viewer::onChangeBgColor | ( | ) | [protected, slot] |
SLOT: called if background color is to be changed changed, passes new color to view port
References OCCViewer_ViewWindow.backgroundColor(), SUIT_ViewManager.getActiveView(), SUIT_ViewModel.myViewManager, and OCCViewer_ViewWindow.setBackgroundColor().
| OCCViewer_Viewer.Handle | ( | V3d_Viewer | ) | [private] |
| OCCViewer_Viewer.Handle | ( | V3d_Viewer | ) | [private] |
| OCCViewer_Viewer.Handle | ( | AIS_Trihedron | ) | [private] |
| OCCViewer_Viewer.Handle | ( | AIS_InteractiveContext | ) | [private] |
| SUIT_ViewManager * SUIT_ViewModel::getViewManager | ( | ) | const [inherited] |
| void SUIT_ViewModel::setHotButton | ( | InteractionStyle | theInteractionStyle, |
| HotOperation | theOper, | ||
| Qt::KeyboardModifiers | theState, | ||
| Qt::MouseButtons | theButton | ||
| ) | [static, inherited] |
Sets hot button
| theOper | - hot operation |
| theState | - adding state to state map operations. |
| theButton | - adding state to button map operations. |
References SUIT_ViewModel.myButtonMap, and SUIT_ViewModel.myStateMap.
| void SUIT_ViewModel::getHotButton | ( | InteractionStyle | theInteractionStyle, |
| HotOperation | theOper, | ||
| Qt::KeyboardModifiers & | theState, | ||
| Qt::MouseButtons & | theButton | ||
| ) | [static, inherited] |
Gets hot button for operation theOper.
| theOper | - input hot operation |
| theState | - output state from state map operations. |
| theButton | - output state from button map operations. |
References SUIT_ViewModel.myButtonMap, and SUIT_ViewModel.myStateMap.
int OCCViewer_Viewer.myInteractionStyle [private] |
int OCCViewer_Viewer.myZoomingStyle [private] |
bool OCCViewer_Viewer.mySelectionEnabled [private] |
bool OCCViewer_Viewer.myMultiSelectionEnabled [private] |
QPoint OCCViewer_Viewer.myStartPnt [private] |
QPoint OCCViewer_Viewer.myEndPnt [private] |
bool OCCViewer_Viewer.myShowStaticTrihedron [private] |
QVector<QColor> OCCViewer_Viewer.myColors [private] |
SUIT_ViewManager* SUIT_ViewModel.myViewManager [protected, inherited] |
SUIT_ViewModel::InteractionStyle2StatesMap SUIT_ViewModel::myStateMap [static, inherited] |
SUIT_ViewModel::InteractionStyle2ButtonsMap SUIT_ViewModel::myButtonMap [static, inherited] |