Version: 6.3.1
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Slots | Protected Attributes | Private Member Functions | Private Attributes

SVTK_Viewer Class Reference

Extends two interfaces SVTK_ViewModelBase and SALOME_View.

#include <SVTK_ViewModel.h>

Inheritance diagram for SVTK_Viewer:
Inheritance graph

Public Types

typedef SVTK_ViewWindow TViewWindow
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

Public Slots

void onSelectionChanged ()
 To invoke Qt selectionChanged signal.

Signals

void actorAdded (SVTK_ViewWindow *, VTKViewer_Actor *)
void actorRemoved (SVTK_ViewWindow *, VTKViewer_Actor *)
void selectionChanged ()
 To declare signal on selection changed.

Public Member Functions

 SVTK_Viewer ()
virtual ~SVTK_Viewer ()
virtual SUIT_ViewWindowcreateView (SUIT_Desktop *)
 See #SUIT_ViewModel::createView.
virtual void setViewManager (SUIT_ViewManager *theViewManager)
 See #SUIT_ViewModel::createView.
virtual void contextMenuPopup (QMenu *)
 See #SUIT_ViewModel::contextMenuPopup.
virtual QString getType () const
 See #SUIT_ViewModel::getType.
QColor backgroundColor () const
 Get background color of the viewer.
void setBackgroundColor (const QColor &)
 Set background color to the viewer.
vtkFloatingPointType trihedronSize () const
 Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
bool trihedronRelative () const
 Shows if the size of trihedron relative (see #SVTK_Renderer::SetTrihedronSize)
void setTrihedronSize (const vtkFloatingPointType, const bool=true)
 Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
bool isStaticTrihedronVisible () const
 Get visibility status of the static trihedron.
void setStaticTrihedronVisible (const bool)
 Set visibility status of the static trihedron.
int projectionMode () const
 Gets projection mode.
void setProjectionMode (const int)
 Sets projection mode.
int interactionStyle () const
 Gets interaction style.
void setInteractionStyle (const int)
 Sets interaction style.
int zoomingStyle () const
 Gets zooming style.
void setZoomingStyle (const int)
 Sets zooming style.
int incrementalSpeed () const
 Get incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
int incrementalSpeedMode () const
 Returns modification mode of incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
void setIncrementalSpeed (const int, const int=0)
 Set the incremental speed for view operation (see #SVTK_InteractorStyle::ControllerIncrement)
int spacemouseBtn (const int) const
 Gets spacemouse button for specified function.
void setSpacemouseButtons (const int, const int, const int)
 Sets spacemouse buttons.
void enableSelection (bool isEnabled)
bool isSelectionEnabled () const
void enableMultiselection (bool isEnable)
bool isMultiSelectionEnabled () const
int getSelectionCount () const
void Display (const SALOME_VTKPrs *)
 See #SALOME_View::Display( const SALOME_Prs* )
void Erase (const SALOME_VTKPrs *, const bool=false)
 See #SALOME_View::Erase( const SALOME_VTKPrs*, const bool = false )
void EraseAll (const bool=false)
 See #SALOME_View::EraseAll( const bool = false )
virtual void GetVisible (SALOME_ListIO &)
 See #SALOME_View::getVisible( SALOME_ListIO& )
SALOME_PrsCreatePrs (const char *entry=0)
 See #SALOME_View::CreatePrs( const char* entry = 0 )
virtual bool isVisible (const Handle(SALOME_InteractiveObject)&)
 See #SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& )
virtual void Repaint ()
 See #SALOME_View::Repaint()
SUIT_ViewManagergetViewManager () const
void Display (const SALOME_Prs *)
 This Display() method should be called to display given presentation created anywhere by anybody.
virtual void Display (const SALOME_OCCPrs *)
 Display SALOME_OCCPrs presentation.
virtual void Display (const SALOME_Prs2d *)
 Display SALOME_Prs2d presentation.
void Erase (const SALOME_Prs *, const bool=false)
 This Erase() method should be called to erase given presentation created anywhere by anybody.
virtual void Erase (const SALOME_OCCPrs *, const bool=false)
 Erase SALOME_OCCPrs.
virtual void Erase (const SALOME_Prs2d *, const bool=false)
 Erase SALOME_Prs2d.
void LocalSelection (const SALOME_Prs *, const int)
 This LocalSelection() method should be called to activate sub-shapes selection created anywhere by anybody.
virtual void LocalSelection (const SALOME_OCCPrs *, const int)
 Local selection SALOME_OCCPrs.
virtual void LocalSelection (const SALOME_VTKPrs *, const int)
 Local selection SALOME_VTKPrs.
virtual void LocalSelection (const SALOME_Prs2d *, const int)
 Local selection SALOME_Prs2d.
virtual void GlobalSelection (const bool=false) const
 Deactivates selection of sub-shapes (must be redefined with OCC viewer)
virtual void BeforeDisplay (SALOME_Displayer *, const SALOME_Prs *)
virtual void AfterDisplay (SALOME_Displayer *, const SALOME_Prs *)
virtual void BeforeErase (SALOME_Displayer *, const SALOME_Prs *)
virtual void AfterErase (SALOME_Displayer *, const SALOME_Prs *)
virtual bool isVisible (const Handle_SALOME_InteractiveObject &)

Static Public Member Functions

static QString Type ()
 Define string representation of the viewer 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 onDumpView ()
void onChangeBgColor ()
void onActorAdded (VTKViewer_Actor *)
void onActorRemoved (VTKViewer_Actor *)

Protected Attributes

SUIT_ViewManagermyViewManager

Private Member Functions

void updateToolBars ()

Private Attributes

QColor myBgColor
vtkFloatingPointType myTrihedronSize
bool myTrihedronRelative
bool myIsStaticTrihedronVisible
bool mySelectionEnabled
bool myMultiSelectionEnabled
int myIncrementSpeed
int myIncrementMode
int myProjMode
int myStyle
int myZoomingStyle
int mySpaceBtn [3]

Member Typedef Documentation

typedef QMap<HotOperation, Qt::KeyboardModifiers> SUIT_ViewModel.StatesMap [inherited]
typedef QMap<HotOperation, Qt::MouseButtons> SUIT_ViewModel.ButtonsMap [inherited]

Member Enumeration Documentation

enum SUIT_ViewModel::HotOperation [inherited]
Enumerator:
PAN 
ZOOM 
ROTATE 
FIT_AREA 
Enumerator:
STANDARD 
KEY_FREE 

Constructor & Destructor Documentation

SVTK_Viewer::SVTK_Viewer ( )
SVTK_Viewer::~SVTK_Viewer ( ) [virtual]

Destructor


Member Function Documentation

static QString SVTK_Viewer.Type ( ) [static]
SUIT_ViewWindow * SVTK_Viewer::createView ( SUIT_Desktop theDesktop) [virtual]
void SVTK_Viewer::setViewManager ( SUIT_ViewManager theViewManager) [virtual]

Sets new view manager

Parameters:
theViewManager- new view manager

Reimplemented from SUIT_ViewModel.

References onMouseMove(), onMousePress(), and onMouseRelease().

void SVTK_Viewer::contextMenuPopup ( QMenu thePopup) [virtual]

Builds popup for vtk viewer

Reimplemented from SUIT_ViewModel.

References SUIT_ViewManager.getActiveView(), SUIT_ViewModel.myViewManager, onChangeBgColor(), and onDumpView().

virtual QString SVTK_Viewer.getType ( ) const [virtual]

Reimplemented from SUIT_ViewModel.

QColor SVTK_Viewer::backgroundColor ( ) const
Returns:
background color

References myBgColor.

void SVTK_Viewer::setBackgroundColor ( const QColor &  theColor)

Changes background color

Parameters:
theColor- new background color

References SUIT_ViewManager.getViews(), myBgColor, and SUIT_ViewModel.myViewManager.

vtkFloatingPointType SVTK_Viewer::trihedronSize ( ) const
Returns:
trihedron size

References myTrihedronSize.

bool SVTK_Viewer::trihedronRelative ( ) const
Returns:
true if thihedron changes size in accordance with bounding box

References myTrihedronRelative.

void SVTK_Viewer::setTrihedronSize ( const vtkFloatingPointType  theSize,
const bool  theRelative = true 
)

Sets trihedron size and relativeness( whether thihedron changes size in accordance with bounding box)

Parameters:
theSize- new size
theRelative- new relativeness

References SUIT_ViewModel.getViewManager(), myTrihedronRelative, and myTrihedronSize.

bool SVTK_Viewer::isStaticTrihedronVisible ( ) const
Returns:
visibility status of the static trihedron

References myIsStaticTrihedronVisible.

void SVTK_Viewer::setStaticTrihedronVisible ( const bool  theIsVisible)

Sets visibility status of the static trihedron

Parameters:
theIsVisible- new visibility status

References SUIT_ViewModel.getViewManager(), and myIsStaticTrihedronVisible.

int SVTK_Viewer::projectionMode ( ) const
Returns:
projection mode

References myProjMode.

void SVTK_Viewer::setProjectionMode ( const int  theMode)

Sets projection mode: 0 - orthogonal, 1 - perspective projection

Parameters:
theMode- new projection mode

References SUIT_ViewModel.getViewManager(), and myProjMode.

int SVTK_Viewer::interactionStyle ( ) const
Returns:
interaction style

References myStyle.

void SVTK_Viewer::setInteractionStyle ( const int  theStyle)

Sets interaction style: 0 - standard, 1 - keyboard free interaction

Parameters:
theStyle- new interaction style

References SUIT_ViewModel.getViewManager(), and myStyle.

int SVTK_Viewer::zoomingStyle ( ) const
Returns:
zooming style

References myZoomingStyle.

void SVTK_Viewer::setZoomingStyle ( const int  theStyle)

Sets zooming style: 0 - standard, 1 - advanced (at cursor)

Parameters:
theStyle- new zooming style

References SUIT_ViewModel.getViewManager(), and myZoomingStyle.

int SVTK_Viewer::incrementalSpeed ( ) const
Returns:
incremental speed value

References myIncrementSpeed.

int SVTK_Viewer::incrementalSpeedMode ( ) const
Returns:
modification mode of the incremental speed

References myIncrementMode.

void SVTK_Viewer::setIncrementalSpeed ( const int  theValue,
const int  theMode = 0 
)

Set the incremental speed value and modification mode

Parameters:
theValue- new value
theMode- new mode: 0 - arithmetic, 1 - geometrical progression

References SUIT_ViewModel.getViewManager(), myIncrementMode, and myIncrementSpeed.

int SVTK_Viewer::spacemouseBtn ( const int  theIndex) const
Returns:
spacemouse button assigned to the specified function
Parameters:
theIndex- function by number (from 1 to 3)

References mySpaceBtn.

void SVTK_Viewer::setSpacemouseButtons ( const int  theBtn1,
const int  theBtn2,
const int  theBtn3 
)

Set the spacemouse buttons

Parameters:
theBtn1,theBtn2,theBtn3- new buttons

References SUIT_ViewModel.getViewManager(), and mySpaceBtn.

void SVTK_Viewer::enableSelection ( bool  isEnabled)

Enables/disables selection

Parameters:
isEnabled- new state

! To be done for view windows

References mySelectionEnabled.

bool SVTK_Viewer.isSelectionEnabled ( ) const
void SVTK_Viewer::enableMultiselection ( bool  isEnable)

Enables/disables selection of many object

Parameters:
isEnabled- new state

! To be done for view windows

References myMultiSelectionEnabled.

bool SVTK_Viewer.isMultiSelectionEnabled ( ) const
int SVTK_Viewer.getSelectionCount ( ) const
void SVTK_Viewer::Display ( const SALOME_VTKPrs prs) [virtual]

Display presentation

Parameters:
prs- presentation

Reimplemented from SALOME_View.

References SUIT_ViewManager.getViews(), and SUIT_ViewModel.myViewManager.

void SVTK_Viewer::Erase ( const SALOME_VTKPrs prs,
const bool  forced = false 
) [virtual]

Erase presentation

Parameters:
prs- presentation
forced- removes object from view

Reimplemented from SALOME_View.

References SUIT_ViewManager.getViews(), and SUIT_ViewModel.myViewManager.

void SVTK_Viewer::EraseAll ( const bool  forced = false) [virtual]

Erase all presentations

Parameters:
forced- removes all objects from view

Reimplemented from SALOME_View.

References VTK.ActorCollectionCopy.GetActors(), SUIT_ViewManager.getViews(), SUIT_ViewModel.myViewManager, and Repaint().

void SVTK_Viewer::GetVisible ( SALOME_ListIO theList) [virtual]

objects visible in viewer

Parameters:
theList- visible objects collection

Reimplemented from SALOME_View.

References SUIT_ViewManager.getViews(), and SUIT_ViewModel.myViewManager.

SALOME_Prs * SVTK_Viewer::CreatePrs ( const char *  entry = 0) [virtual]

Create presentation corresponding to the entry

Parameters:
entry- entry

Reimplemented from SALOME_View.

References SVTK_Prs.AddObject(), VTK.ActorCollectionCopy.GetActors(), SUIT_ViewModel.getViewManager(), and SALOME_Actor.hasIO().

bool SVTK_Viewer::isVisible ( const Handle(SALOME_InteractiveObject)&  io) [virtual]
Returns:
true if object is displayed in viewer
Parameters:
obj- object to be checked

References SUIT_ViewManager.getViews(), and SUIT_ViewModel.myViewManager.

void SVTK_Viewer::Repaint ( ) [virtual]

Updates current viewer

Reimplemented from SALOME_View.

References SUIT_ViewManager.getViews(), and SUIT_ViewModel.myViewManager.

void SVTK_Viewer.actorAdded ( SVTK_ViewWindow ,
VTKViewer_Actor  
) [signal]
void SVTK_Viewer.actorRemoved ( SVTK_ViewWindow ,
VTKViewer_Actor  
) [signal]
void SVTK_Viewer::onMousePress ( SUIT_ViewWindow vw,
QMouseEvent *  event 
) [protected, slot]

SLOT: called on mouse button press, empty implementation

void SVTK_Viewer::onMouseMove ( SUIT_ViewWindow vw,
QMouseEvent *  event 
) [protected, slot]

SLOT: called on mouse move, empty implementation

void SVTK_Viewer::onMouseRelease ( SUIT_ViewWindow vw,
QMouseEvent *  event 
) [protected, slot]

SLOT: called on mouse button release, empty implementation

void SVTK_Viewer::onDumpView ( ) [protected, slot]

SLOT: called on dump view operation is activated, stores scene to raster file

References SUIT_ViewManager.getActiveView(), and SUIT_ViewModel.myViewManager.

void SVTK_Viewer::onChangeBgColor ( ) [protected, slot]

SLOT: called if background color is to be changed changed, passes new color to view port

References backgroundColor(), SUIT_ViewManager.getActiveView(), SUIT_ViewModel.myViewManager, and setBackgroundColor().

void SVTK_Viewer::onActorAdded ( VTKViewer_Actor theActor) [protected, slot]

References actorAdded().

void SVTK_Viewer::onActorRemoved ( VTKViewer_Actor theActor) [protected, slot]

References actorRemoved().

void SVTK_Viewer.updateToolBars ( ) [private]
void SVTK_ViewModelBase.onSelectionChanged ( ) [slot, inherited]
void SVTK_ViewModelBase.selectionChanged ( ) [signal, inherited]
SUIT_ViewManager * SUIT_ViewModel::getViewManager ( ) const [inherited]

Get view manager.

Returns:
view manager

References SUIT_ViewModel.myViewManager.

void SUIT_ViewModel::setHotButton ( InteractionStyle  theInteractionStyle,
HotOperation  theOper,
Qt::KeyboardModifiers  theState,
Qt::MouseButtons  theButton 
) [static, inherited]

Sets hot button

Parameters:
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.

Parameters:
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.

void SALOME_View::Display ( const SALOME_Prs prs) [inherited]

It simply passes control to SALOME_Prs object so that it could perform double dispatch.

Gives control to SALOME_Prs object, so that it could perform double dispatch

References SALOME_Prs.DisplayIn().

void SALOME_View::Display ( const SALOME_OCCPrs ) [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SOCC_Viewer.

void SALOME_View::Display ( const SALOME_Prs2d ) [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SPlot2d_Viewer.

void SALOME_View::Erase ( const SALOME_Prs prs,
const bool  forced = false 
) [inherited]

It simply passes control to SALOME_Prs object so that it could perform double dispatch.

Gives control to SALOME_Prs object, so that it could perform double dispatch

References SALOME_Prs.EraseIn().

void SALOME_View::Erase ( const SALOME_OCCPrs ,
const bool  = false 
) [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SOCC_Viewer.

void SALOME_View::Erase ( const SALOME_Prs2d ,
const bool  = false 
) [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SPlot2d_Viewer.

void SALOME_View::LocalSelection ( const SALOME_Prs prs,
const int  mode 
) [inherited]

It simply passes control to SALOME_Prs object so that it could perform double dispatch.

Gives control to SALOME_Prs object, so that it could perform double dispatch

References SALOME_Prs.LocalSelectionIn().

void SALOME_View::LocalSelection ( const SALOME_OCCPrs ,
const int   
) [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SOCC_Viewer.

void SALOME_View::LocalSelection ( const SALOME_VTKPrs ,
const int   
) [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

void SALOME_View::LocalSelection ( const SALOME_Prs2d ,
const int   
) [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

void SALOME_View::GlobalSelection ( const bool  = false) const [virtual, inherited]

Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.

Reimplemented in SOCC_Viewer.

void SALOME_View::BeforeDisplay ( SALOME_Displayer d,
const SALOME_Prs p 
) [virtual, inherited]
void SALOME_View::AfterDisplay ( SALOME_Displayer d,
const SALOME_Prs p 
) [virtual, inherited]
void SALOME_View::BeforeErase ( SALOME_Displayer d,
const SALOME_Prs p 
) [virtual, inherited]
void SALOME_View::AfterErase ( SALOME_Displayer d,
const SALOME_Prs p 
) [virtual, inherited]
virtual bool SALOME_View.isVisible ( const Handle_SALOME_InteractiveObject &  ) [virtual, inherited]
Return values:
Returnfalse.

Field Documentation

QColor SVTK_Viewer.myBgColor [private]
int SVTK_Viewer.myProjMode [private]
int SVTK_Viewer.myStyle [private]
int SVTK_Viewer.mySpaceBtn[3] [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS