Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

enum  {
  HorizontalGradient, VerticalGradient, FirstDiagonalGradient, SecondDiagonalGradient,
  FirstCornerGradient, SecondCornerGradient, ThirdCornerGradient, FourthCornerGradient,
  LastGradient = FourthCornerGradient
}
 
enum  {
  CrystalEyesType, RedBlueType, InterlacedType, LeftType,
  RightType, DresdenType, AnaglyphType, CheckerboardType,
  SplitViewPortHorizontalType
}
 
typedef SVTK_ViewWindow TViewWindow
 

Signals

void actorAdded (SVTK_ViewWindow *, VTKViewer_Actor *)
 
void actorRemoved (SVTK_ViewWindow *, VTKViewer_Actor *)
 
- Signals inherited from SVTK_ViewModelBase
void selectionChanged ()
 To declare signal on selection changed. More...
 

Public Member Functions

 SVTK_Viewer ()
 
virtual ~SVTK_Viewer ()
 
virtual SUIT_ViewWindowcreateView (SUIT_Desktop *)
 See SUIT_ViewModel::createView. More...
 
virtual void setViewManager (SUIT_ViewManager *theViewManager)
 See SUIT_ViewModel::createView. More...
 
virtual void contextMenuPopup (QMenu *)
 See SUIT_ViewModel::contextMenuPopup. More...
 
virtual QString getType () const
 See SUIT_ViewModel::getType. More...
 
QColor backgroundColor () const
 Get background color of the viewer [obsolete]. More...
 
void setBackgroundColor (const QColor &)
 Set background color to the viewer [obsolete]. More...
 
Qtx::BackgroundData background () const
 Get background color of the viewer. More...
 
void setBackground (const Qtx::BackgroundData &)
 Set background color to the viewer. More...
 
double trihedronSize () const
 Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize) More...
 
bool trihedronRelative () const
 Shows if the size of trihedron relative (see SVTK_Renderer::SetTrihedronSize) More...
 
void setTrihedronSize (const double, const bool=true)
 Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize) More...
 
bool isStaticTrihedronVisible () const
 Get visibility status of the static trihedron. More...
 
void setStaticTrihedronVisible (const bool)
 Set visibility status of the static trihedron. More...
 
int projectionMode () const
 Gets projection mode. More...
 
void setProjectionMode (const int)
 Sets projection mode. More...
 
int stereoType () const
 Gets stereo type. More...
 
void setStereoType (const int)
 Sets stereo type. More...
 
int anaglyphFilter () const
 Gets anaglyph filter. More...
 
void setAnaglyphFilter (const int)
 Sets anaglyph filter. More...
 
bool isQuadBufferSupport () const
 Get support quad-buffered stereo. More...
 
void setQuadBufferSupport (const bool)
 Set support quad-buffered stereo. More...
 
int interactionStyle () const
 Gets interaction style. More...
 
void setInteractionStyle (const int)
 Sets interaction style. More...
 
int zoomingStyle () const
 Gets zooming style. More...
 
void setZoomingStyle (const int)
 Sets zooming style. More...
 
Preselection_Mode preSelectionMode () const
 Gets current preselection mode (standard, dynamic or disabled) More...
 
void setPreSelectionMode (Preselection_Mode)
 Sets new preselection mode. More...
 
int incrementalSpeed () const
 Get incremental speed (see SVTK_InteractorStyle::ControllerIncrement) More...
 
int incrementalSpeedMode () const
 Returns modification mode of incremental speed (see SVTK_InteractorStyle::ControllerIncrement) More...
 
void setIncrementalSpeed (const int, const int=0)
 Set the incremental speed for view operation (see SVTK_InteractorStyle::ControllerIncrement) More...
 
int spacemouseBtn (const int) const
 Gets spacemouse button for specified function. More...
 
void setSpacemouseButtons (const int, const int, const int)
 Sets spacemouse buttons. More...
 
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* ) More...
 
void Erase (const SALOME_VTKPrs *, const bool=false)
 See SALOME_View::Erase( const SALOME_VTKPrs*, const bool = false ) More...
 
void EraseAll (SALOME_Displayer *, const bool=false)
 See SALOME_View::EraseAll( SALOME_Displayer*, const bool = false ) More...
 
virtual void GetVisible (SALOME_ListIO &)
 See #SALOME_View::getVisible( SALOME_ListIO& ) More...
 
SALOME_PrsCreatePrs (const char *entry=0)
 See SALOME_View::CreatePrs( const char* entry = 0 ) More...
 
virtual bool isVisible (const Handle(SALOME_InteractiveObject)&)
 See SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& ) More...
 
virtual void Repaint ()
 See SALOME_View::Repaint() More...
 
- Public Member Functions inherited from SALOME_View
virtual ~SALOME_View ()
 Destructor. More...
 
void Display (SALOME_Displayer *, const SALOME_Prs *)
 This Display() method should be called to display given presentation created anywhere by anybody. More...
 
void Erase (SALOME_Displayer *, const SALOME_Prs *, const bool=false)
 This Erase() method should be called to erase given presentation created anywhere by anybody. More...
 
void LocalSelection (const SALOME_Prs *, const int)
 This LocalSelection() method should be called to activate sub-shapes selection created anywhere by anybody. More...
 
void LocalSelection (const SALOME_Prs *, const std::list< int >)
 
virtual void Display (const SALOME_OCCPrs *)
 Display SALOME_OCCPrs presentation. More...
 
virtual void Display (const SALOME_Prs2d *)
 Display SALOME_Prs2d presentation. More...
 
virtual void Erase (const SALOME_OCCPrs *, const bool=false)
 Erase SALOME_OCCPrs. More...
 
virtual void Erase (const SALOME_Prs2d *, const bool=false)
 Erase SALOME_Prs2d. More...
 
virtual void LocalSelection (const SALOME_OCCPrs *, const int)
 Local selection SALOME_OCCPrs. More...
 
virtual void LocalSelection (const SALOME_OCCPrs *, const std::list< int >)
 Multiple local selection SALOME_OCCPrs. More...
 
virtual void LocalSelection (const SALOME_VTKPrs *, const int)
 Local selection SALOME_VTKPrs. More...
 
virtual void LocalSelection (const SALOME_Prs2d *, const int)
 Local selection SALOME_Prs2d. More...
 
virtual void GlobalSelection (const bool=false) const
 Deactivates selection of sub-shapes (must be redefined with OCC viewer) More...
 
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 *)
 

Static Public Member Functions

static QString Type ()
 Define string representation of the viewer type. More...
 
static QString backgroundData (QStringList &, QIntList &, QIntList &)
 
static void stereoData (QStringList &, QIntList &)
 

Protected Slots

void onMousePress (SUIT_ViewWindow *, QMouseEvent *)
 
void onMouseMove (SUIT_ViewWindow *, QMouseEvent *)
 
void onMouseRelease (SUIT_ViewWindow *, QMouseEvent *)
 
void onDumpView ()
 
void onChangeBackground ()
 
void onActorAdded (VTKViewer_Actor *)
 
void onActorRemoved (VTKViewer_Actor *)
 

Private Member Functions

void updateToolBars ()
 

Private Attributes

Qtx::BackgroundData myDefaultBackground
 
double myTrihedronSize
 
bool myTrihedronRelative
 
bool myIsStaticTrihedronVisible
 
bool mySelectionEnabled
 
bool myMultiSelectionEnabled
 
int myIncrementSpeed
 
int myIncrementMode
 
int myProjMode
 
int myStereoType
 
int myAnaglyphFilter
 
bool myQuadBufferSupport
 
int myStyle
 
int myZoomingStyle
 
Preselection_Mode myPreSelectionMode
 
int mySpaceBtn [3]
 

Additional Inherited Members

- Public Slots inherited from SVTK_ViewModelBase
void onSelectionChanged ()
 To invoke Qt selectionChanged signal. More...
 
- Static Public Attributes inherited from SUIT_ViewModel
static InteractionStyle2StatesMap myStateMap
 
static InteractionStyle2ButtonsMap myButtonMap
 
- Protected Attributes inherited from SUIT_ViewModel
SUIT_ViewManagermyViewManager
 

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum

supported gradient types

Enumerator
HorizontalGradient 
VerticalGradient 
FirstDiagonalGradient 
SecondDiagonalGradient 
FirstCornerGradient 
SecondCornerGradient 
ThirdCornerGradient 
FourthCornerGradient 
LastGradient 
anonymous enum
Enumerator
CrystalEyesType 
RedBlueType 
InterlacedType 
LeftType 
RightType 
DresdenType 
AnaglyphType 
CheckerboardType 
SplitViewPortHorizontalType 

Constructor & Destructor Documentation

SVTK_Viewer::~SVTK_Viewer ( )
virtual

Destructor

Member Function Documentation

void SVTK_Viewer::actorAdded ( SVTK_ViewWindow ,
VTKViewer_Actor  
)
signal
void SVTK_Viewer::actorRemoved ( SVTK_ViewWindow ,
VTKViewer_Actor  
)
signal
int SVTK_Viewer::anaglyphFilter ( ) const
Returns
anaglyph filter

References myAnaglyphFilter.

Qtx::BackgroundData SVTK_Viewer::background ( ) const
Returns
background data

References myDefaultBackground.

QColor SVTK_Viewer::backgroundColor ( ) const
QString SVTK_Viewer::backgroundData ( QStringList &  gradList,
QIntList idList,
QIntList txtList 
)
static
void SVTK_Viewer::contextMenuPopup ( QMenu thePopup)
virtual

Builds popup for vtk viewer

Reimplemented from SUIT_ViewModel.

References SUIT_ViewManager::getActiveView(), SUIT_ViewModel::myViewManager, onChangeBackground(), and onDumpView().

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().

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::enableMultiselection ( bool  isEnable)

Enables/disables selection of many object

Parameters
isEnabled- new state

! To be done for view windows

References myMultiSelectionEnabled.

void SVTK_Viewer::enableSelection ( bool  isEnabled)

Enables/disables selection

Parameters
isEnabled- new state

! To be done for view windows

References SUIT_ViewModel::getViewManager(), and mySelectionEnabled.

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 ( SALOME_Displayer d,
const bool  forced = false 
)
virtual

Erase all presentations

Parameters
forced- removes all objects from view

Reimplemented from SALOME_View.

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

int SVTK_Viewer::getSelectionCount ( ) const
virtual QString SVTK_Viewer::getType ( ) const
inlinevirtual

Reimplemented from SUIT_ViewModel.

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.

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.

int SVTK_Viewer::interactionStyle ( ) const
Returns
interaction style

References myStyle.

bool SVTK_Viewer::isMultiSelectionEnabled ( ) const
inline
bool SVTK_Viewer::isQuadBufferSupport ( ) const
Returns
support quad-buffered stereo

References myQuadBufferSupport.

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

References myIsStaticTrihedronVisible.

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

Reimplemented from SALOME_View.

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

void SVTK_Viewer::onActorAdded ( VTKViewer_Actor theActor)
protectedslot

References actorAdded().

void SVTK_Viewer::onActorRemoved ( VTKViewer_Actor theActor)
protectedslot

References actorRemoved().

void SVTK_Viewer::onChangeBackground ( )
protectedslot
void SVTK_Viewer::onDumpView ( )
protectedslot

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

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

void SVTK_Viewer::onMouseMove ( SUIT_ViewWindow vw,
QMouseEvent *  event 
)
protectedslot

SLOT: called on mouse move, empty implementation

void SVTK_Viewer::onMousePress ( SUIT_ViewWindow vw,
QMouseEvent *  event 
)
protectedslot

SLOT: called on mouse button press, empty implementation

void SVTK_Viewer::onMouseRelease ( SUIT_ViewWindow vw,
QMouseEvent *  event 
)
protectedslot

SLOT: called on mouse button release, empty implementation

Preselection_Mode SVTK_Viewer::preSelectionMode ( ) const
Returns
current preselection mode

References myPreSelectionMode.

int SVTK_Viewer::projectionMode ( ) const
Returns
projection mode

References myProjMode.

void SVTK_Viewer::Repaint ( )
virtual

Updates current viewer

Reimplemented from SALOME_View.

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

void SVTK_Viewer::setAnaglyphFilter ( const int  theFilter)

Sets anaglyph filter

Parameters
theFilter- new anaglyph filter

References SUIT_ViewModel::getViewManager(), and myAnaglyphFilter.

void SVTK_Viewer::setBackground ( const Qtx::BackgroundData theBackground)

Changes background

Parameters
theBackground- new background data

References SUIT_ViewManager::getViews(), Qtx::BackgroundData::isValid(), myDefaultBackground, and SUIT_ViewModel::myViewManager.

void SVTK_Viewer::setBackgroundColor ( const QColor &  c)
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.

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.

void SVTK_Viewer::setPreSelectionMode ( Preselection_Mode  theMode)

Sets preselection mode

Parameters
theMode- new preselection mode

References SUIT_ViewModel::getViewManager(), and myPreSelectionMode.

void SVTK_Viewer::setProjectionMode ( const int  theMode)

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

Parameters
theMode- new projection mode

References SUIT_ViewModel::getViewManager(), myProjMode, and SVTK_ViewWindow::Stereo.

void SVTK_Viewer::setQuadBufferSupport ( const bool  theEnable)

Set support quad-buffered stereo

Parameters
theEnable- enable/disable support quad-buffered stereo

References SUIT_ViewModel::getViewManager(), and myQuadBufferSupport.

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::setStaticTrihedronVisible ( const bool  theIsVisible)

Sets visibility status of the static trihedron

Parameters
theIsVisible- new visibility status

References SUIT_ViewModel::getViewManager(), and myIsStaticTrihedronVisible.

void SVTK_Viewer::setStereoType ( const int  theType)

Sets stereo type

Parameters
theType- new stereo type

References SUIT_ViewModel::getViewManager(), and myStereoType.

void SVTK_Viewer::setTrihedronSize ( const double  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.

void SVTK_Viewer::setViewManager ( SUIT_ViewManager theViewManager)
virtual

Sets new view manager

Parameters
theViewManager- new view manager

Reimplemented from SUIT_ViewModel.

References onMouseMove(), onMousePress(), onMouseRelease(), and SUIT_ViewModel::setViewManager().

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::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::stereoData ( QStringList &  typeList,
QIntList idList 
)
static

Get data for supported background modes: gradient types, identifiers and supported image formats

References AnaglyphType, CheckerboardType, CrystalEyesType, DresdenType, InterlacedType, LeftType, RedBlueType, RightType, and SplitViewPortHorizontalType.

int SVTK_Viewer::stereoType ( ) const
Returns
stereo type

References myStereoType.

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

References myTrihedronRelative.

double SVTK_Viewer::trihedronSize ( ) const
Returns
trihedron size

References myTrihedronSize.

static QString SVTK_Viewer::Type ( )
inlinestatic
void SVTK_Viewer::updateToolBars ( )
private
int SVTK_Viewer::zoomingStyle ( ) const
Returns
zooming style

References myZoomingStyle.

Member Data Documentation

int SVTK_Viewer::myAnaglyphFilter
private
Qtx::BackgroundData SVTK_Viewer::myDefaultBackground
private
int SVTK_Viewer::myIncrementMode
private
int SVTK_Viewer::myIncrementSpeed
private
bool SVTK_Viewer::myIsStaticTrihedronVisible
private
bool SVTK_Viewer::myMultiSelectionEnabled
private
Preselection_Mode SVTK_Viewer::myPreSelectionMode
private
int SVTK_Viewer::myProjMode
private
bool SVTK_Viewer::myQuadBufferSupport
private
bool SVTK_Viewer::mySelectionEnabled
private
int SVTK_Viewer::mySpaceBtn[3]
private
int SVTK_Viewer::myStereoType
private
int SVTK_Viewer::myStyle
private
bool SVTK_Viewer::myTrihedronRelative
private
double SVTK_Viewer::myTrihedronSize
private
int SVTK_Viewer::myZoomingStyle
private

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