Version: 9.12.0
SVTK_View Class Reference

This class is introduced just for compatibility with old code. More...

#include <SVTK_View.h>

Inheritance diagram for SVTK_View:
Inheritance graph

Public Member Functions

 SVTK_View (SVTK_ViewWindow *theMainWindow)
 
virtual ~SVTK_View ()
 
void highlight (const Handle(SALOME_InteractiveObject)&IObject, bool highlight, bool immediatly=true)
 To highlight a VTK presentation with the same SALOME_InteractiveObject. More...
 
void unHighlightAll ()
 To unhighlight all VTK presentations. More...
 
 Handle (SALOME_InteractiveObject) FindIObject(const char *Entry)
 Try to find a SALOME_InteractiveObject in the view that corresponds to the entry. More...
 
bool isInViewer (const Handle(SALOME_InteractiveObject)&IObject)
 Check, if the viewer contains a presentatin with defined SALOME_InteractiveObject. More...
 
bool isVisible (const Handle(SALOME_InteractiveObject)&IObject)
 Check, if a presentatin with defined SALOME_InteractiveObject is visible. More...
 
void rename (const Handle(SALOME_InteractiveObject)&IObject, const QString &newName)
 
int GetDisplayMode ()
 Get current display mode (obsolete) More...
 
void SetDisplayMode (int)
 Set current display mode. More...
 
void SetDisplayMode (const Handle(SALOME_InteractiveObject)&IObject, int theMode)
 Switch representation wireframe/shading. More...
 
void ChangeRepresentationToWireframe ()
 Change all actors to wireframe. More...
 
void ChangeRepresentationToSurface ()
 Change all actors to surface. More...
 
void ChangeRepresentationToSurfaceWithEdges ()
 Change all actors to surface with edges. More...
 
void ChangeRepresentationToWireframe (vtkActorCollection *theListofActors)
 Change to wireframe a list of vtkactor. More...
 
void ChangeRepresentationToSurface (vtkActorCollection *theListofActors)
 Change to surface a list of vtkactor. More...
 
void ChangeRepresentationToSurfaceWithEdges (vtkActorCollection *theListofActors)
 Change to surface with edges a list of vtkactor. More...
 
void SetTransparency (const Handle(SALOME_InteractiveObject)&theIObject, float trans)
 Change transparency. More...
 
float GetTransparency (const Handle(SALOME_InteractiveObject)&theIObject)
 Get current transparency. More...
 
void SetColor (const Handle(SALOME_InteractiveObject)&theIObject, const QColor &theColor)
 Change color. More...
 
QColor GetColor (const Handle(SALOME_InteractiveObject)&theIObject)
 Get current color. More...
 
void SetMaterial (const Handle(SALOME_InteractiveObject)&theIObject, vtkProperty *thePropF, vtkProperty *thePropB)
 Change material. More...
 
vtkProperty * GetFrontMaterial (const Handle(SALOME_InteractiveObject)&theIObject)
 Get current front material. More...
 
vtkProperty * GetBackMaterial (const Handle(SALOME_InteractiveObject)&theIObject)
 Get current back material. More...
 
void EraseAll ()
 To erase all existing VTK presentations. More...
 
void DisplayAll ()
 To display all existing VTK presentations. More...
 
void RemoveAll (const bool immediatly)
 To remove from the view all existing VTK presentations. More...
 
void Erase (const Handle(SALOME_InteractiveObject)&IObject, bool immediatly=true)
 To erase VTK presentation with defined SALOME_InteractiveObject. More...
 
void Remove (const Handle(SALOME_InteractiveObject)&IObject, bool immediatly=true)
 
void Display (const Handle(SALOME_InteractiveObject)&IObject, bool immediatly=true)
 To display VTK presentation with defined SALOME_InteractiveObject. More...
 
void DisplayOnly (const Handle(SALOME_InteractiveObject)&IObject)
 To display VTK presentation with defined SALOME_InteractiveObject and erase all anothers. More...
 
void Display (SALOME_Actor *SActor, bool immediatly=true)
 To display the VTK presentation. More...
 
void Erase (SALOME_Actor *SActor, bool immediatly=true)
 To erase the VTK presentation. More...
 
void Remove (SALOME_Actor *SActor, bool updateViewer=true)
 To remove the VTK presentation. More...
 
void GetVisible (SALOME_ListIO &theList)
 Collect objects visible in viewer. More...
 
void SetSelectionProp (const double &theRed=1, const double &theGreen=1, const double &theBlue=0, const int &theWidth=5)
 Redirect the request to SVTK_Renderer::SetPreselectionProp. More...
 
void SetPreselectionProp (const double &theRed=0, const double &theGreen=1, const double &theBlue=1, const int &theWidth=5)
 Redirect the request to SVTK_Renderer::SetPreselectionProp. More...
 
void SetSelectionTolerance (const double &theTolNodes=0.025, const double &theTolCell=0.001, const double &theTolObjects=0.025)
 Redirect the request to SVTK_Renderer::SetPreselectionProp. More...
 
- Public Member Functions inherited from SVTK_SignalHandler
 SVTK_SignalHandler (SVTK_ViewWindow *theMainWindow)
 
virtual ~SVTK_SignalHandler ()
 
SVTK_ViewWindowGetMainWindow ()
 Get reference to its SVTK_ViewWindow. More...
 
void Repaint (bool theUpdateTrihedron=true)
 Redirect the request to SVTK_ViewWindow::Repaint (just for flexibility) More...
 
SVTK_RendererGetRenderer ()
 Redirect the request to SVTK_ViewWindow::GetRenderer (just for flexibility) More...
 
vtkRenderer * getRenderer ()
 Redirect the request to SVTK_ViewWindow::getRenderer (just for flexibility) More...
 

Protected Attributes

int myDisplayMode
 
- Protected Attributes inherited from SVTK_SignalHandler
SVTK_ViewWindowmyMainWindow
 

Additional Inherited Members

- Public Slots inherited from SVTK_SignalHandler
void onSelectionChanged ()
 
- Signals inherited from SVTK_SignalHandler
void MouseMove (QMouseEvent *)
 
void MouseButtonPressed (QMouseEvent *)
 
void MouseButtonReleased (QMouseEvent *)
 
void MouseDoubleClicked (QMouseEvent *)
 
void ButtonPressed (const QMouseEvent *event)
 
void ButtonReleased (const QMouseEvent *event)
 
void WheelMoved (QWheelEvent *)
 
void KeyPressed (QKeyEvent *)
 
void KeyReleased (QKeyEvent *)
 
void contextMenuRequested (QContextMenuEvent *e)
 
void selectionChanged ()
 

Detailed Description

This class is introduced just for compatibility with old code.

This class contains frequantly used functionality in old code. Now, you are supposed to extend existing functionality through writing corresponding functors (see SVTK_Functor.h for example).

Constructor & Destructor Documentation

◆ SVTK_View()

SVTK_View::SVTK_View ( SVTK_ViewWindow theMainWindow)

Constructor

◆ ~SVTK_View()

SVTK_View::~SVTK_View ( )
virtual

Destructor

Member Function Documentation

◆ ChangeRepresentationToSurface() [1/2]

void SVTK_View::ChangeRepresentationToSurface ( )

Change all actors to surface.

Change all actors to shading

References VTK::ActorCollectionCopy::GetActors(), and SVTK_SignalHandler::getRenderer().

◆ ChangeRepresentationToSurface() [2/2]

void SVTK_View::ChangeRepresentationToSurface ( vtkActorCollection *  theCollection)

Change to surface a list of vtkactor.

Change to shading a list of vtkactor theCollection - list of vtkactor

References SVTK_SignalHandler::Repaint(), and VTKViewer_Actor::setDisplayMode().

◆ ChangeRepresentationToSurfaceWithEdges() [1/2]

void SVTK_View::ChangeRepresentationToSurfaceWithEdges ( )

Change all actors to surface with edges.

Change all actors to shading with edges

References VTK::ActorCollectionCopy::GetActors(), and SVTK_SignalHandler::getRenderer().

◆ ChangeRepresentationToSurfaceWithEdges() [2/2]

void SVTK_View::ChangeRepresentationToSurfaceWithEdges ( vtkActorCollection *  theCollection)

Change to surface with edges a list of vtkactor.

Change to shading with edges a list of vtkactor theCollection - list of vtkactor

References SVTK_SignalHandler::Repaint(), and VTKViewer_Actor::setDisplayMode().

◆ ChangeRepresentationToWireframe() [1/2]

void SVTK_View::ChangeRepresentationToWireframe ( )

Change all actors to wireframe.

Change all actors to wireframe

References VTK::ActorCollectionCopy::GetActors(), and SVTK_SignalHandler::getRenderer().

◆ ChangeRepresentationToWireframe() [2/2]

void SVTK_View::ChangeRepresentationToWireframe ( vtkActorCollection *  theCollection)

Change to wireframe a list of vtkactor.

Change to wireframe a list of vtkactor theCollection - list of vtkactor

References SVTK_SignalHandler::Repaint(), and VTKViewer_Actor::setDisplayMode().

◆ Display() [1/2]

void SVTK_View::Display ( const Handle(SALOME_InteractiveObject)&  theIObject,
bool  theIsUpdate = true 
)

To display VTK presentation with defined SALOME_InteractiveObject.

To display the VTK presentation

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and SVTK_SignalHandler::Repaint().

◆ Display() [2/2]

void SVTK_View::Display ( SALOME_Actor theActor,
bool  theIsUpdate = true 
)

To display the VTK presentation.

To display the VTK presentation

References SVTK_Renderer::AddActor(), SVTK_SignalHandler::GetRenderer(), SVTK_SignalHandler::Repaint(), and SALOME_Actor::SetVisibility().

◆ DisplayAll()

void SVTK_View::DisplayAll ( )

To display all existing VTK presentations.

To display all existing VTK presentations

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and SVTK_SignalHandler::Repaint().

◆ DisplayOnly()

void SVTK_View::DisplayOnly ( const Handle(SALOME_InteractiveObject)&  theIObject)

To display VTK presentation with defined SALOME_InteractiveObject and erase all anothers.

To display VTK presentation with defined SALOME_InteractiveObject and erase all others

References Display(), and EraseAll().

◆ Erase() [1/2]

void SVTK_View::Erase ( const Handle(SALOME_InteractiveObject)&  theIObject,
bool  theIsUpdate = true 
)

To erase VTK presentation with defined SALOME_InteractiveObject.

To erase VTK presentation

Parameters
theIObject- object
theIsUpdate- updates current viewer

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and SVTK_SignalHandler::Repaint().

◆ Erase() [2/2]

void SVTK_View::Erase ( SALOME_Actor theActor,
bool  theIsUpdate = true 
)

To erase the VTK presentation.

To erase VTK presentation

Parameters
theActor- actor
theIsUpdate- updates current viewer

References SVTK_SignalHandler::Repaint().

◆ EraseAll()

void SVTK_View::EraseAll ( )

To erase all existing VTK presentations.

To erase all existing VTK presentations

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and SVTK_SignalHandler::Repaint().

◆ GetBackMaterial()

vtkProperty * SVTK_View::GetBackMaterial ( const Handle(SALOME_InteractiveObject)&  theIObject)

Get current back material.

Get current back material

Parameters
theIObject- object
Returns
property contained back material properties of the given object

References VTK::ActorCollectionCopy::GetActors(), VTKViewer_Actor::GetBackMaterial(), and SVTK_SignalHandler::getRenderer().

◆ GetColor()

QColor SVTK_View::GetColor ( const Handle(SALOME_InteractiveObject)&  theIObject)

Get current color.

Returns
object color
Parameters
theIObject- object

References VTK::ActorCollectionCopy::GetActors(), VTKViewer_Actor::GetColor(), and SVTK_SignalHandler::getRenderer().

◆ GetDisplayMode()

int SVTK_View::GetDisplayMode ( )

Get current display mode (obsolete)

Returns
current display mode (obsolete)

References myDisplayMode.

◆ GetFrontMaterial()

vtkProperty * SVTK_View::GetFrontMaterial ( const Handle(SALOME_InteractiveObject)&  theIObject)

Get current front material.

Get current front material

Parameters
theIObject- object
Returns
property contained front material properties of the given object

References VTK::ActorCollectionCopy::GetActors(), VTKViewer_Actor::GetFrontMaterial(), and SVTK_SignalHandler::getRenderer().

◆ GetTransparency()

float SVTK_View::GetTransparency ( const Handle(SALOME_InteractiveObject)&  theIObject)

Get current transparency.

Returns
current transparency
Parameters
theIObject- object

References VTK::ActorCollectionCopy::GetActors(), VTKViewer_Actor::GetOpacity(), and SVTK_SignalHandler::getRenderer().

◆ GetVisible()

void SVTK_View::GetVisible ( SALOME_ListIO theList)

Collect objects visible in viewer.

\Collect objects visible in viewer

Parameters
theList- visible objects collection

References VTK::ActorCollectionCopy::GetActors(), and SVTK_SignalHandler::getRenderer().

◆ Handle()

SVTK_View::Handle ( SALOME_InteractiveObject  ) const

Try to find a SALOME_InteractiveObject in the view that corresponds to the entry.

◆ highlight()

void SVTK_View::highlight ( const Handle(SALOME_InteractiveObject)&  theIO,
bool  theIsHighlight,
bool  immediatly = true 
)

To highlight a VTK presentation with the same SALOME_InteractiveObject.

Hilights/unhilights object in viewer

Parameters
theIO- object to be updated
theIsHighlight- if it is true, object will be hilighted, otherwise it will be unhilighted
theIsUpdate- update current viewer

References VTK::ActorCollectionCopy::GetActors().

◆ isInViewer()

bool SVTK_View::isInViewer ( const Handle(SALOME_InteractiveObject)&  theIObject)

Check, if the viewer contains a presentatin with defined SALOME_InteractiveObject.

Returns
true if object is in viewer or in collector
Parameters
theIO- object to be checked

References VTK::ActorCollectionCopy::GetActors(), and SVTK_SignalHandler::getRenderer().

◆ isVisible()

bool SVTK_View::isVisible ( const Handle(SALOME_InteractiveObject)&  theIObject)

Check, if a presentatin with defined SALOME_InteractiveObject is visible.

Returns
true if object is displayed in viewer
Parameters
theIO- object to be checked

References VTK::ActorCollectionCopy::GetActors(), and SVTK_SignalHandler::getRenderer().

◆ Remove() [1/2]

void SVTK_View::Remove ( const Handle(SALOME_InteractiveObject)&  theIObject,
bool  theIsUpdate = true 
)

◆ Remove() [2/2]

void SVTK_View::Remove ( SALOME_Actor theActor,
bool  theIsUpdate = true 
)

To remove the VTK presentation.

To remove the VTK presentation

References SVTK_SignalHandler::GetRenderer(), SVTK_Renderer::RemoveActor(), and SVTK_SignalHandler::Repaint().

◆ RemoveAll()

void SVTK_View::RemoveAll ( const bool  immediatly)

To remove from the view all existing VTK presentations.

To remove all VTK presentations

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and SVTK_SignalHandler::Repaint().

◆ rename()

void SVTK_View::rename ( const Handle(SALOME_InteractiveObject)&  theIObject,
const QString &  theName 
)

Changes name of object

Parameters
theIObject- object to be renamed
theName- new name

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and SALOME_Actor::setName().

◆ SetColor()

void SVTK_View::SetColor ( const Handle(SALOME_InteractiveObject)&  theIObject,
const QColor &  theColor 
)

Change color.

Change color

Parameters
theIObject- object
theColor- new color

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and VTKViewer_Actor::SetColor().

◆ SetDisplayMode() [1/2]

void SVTK_View::SetDisplayMode ( const Handle(SALOME_InteractiveObject)&  theIObject,
int  theMode 
)

Switch representation wireframe/shading.

Set current display mode

Parameters
theIObject- object
theMode- new display mode

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and VTKViewer_Actor::setDisplayMode().

◆ SetDisplayMode() [2/2]

void SVTK_View::SetDisplayMode ( int  theMode)

Set current display mode.

Set current display mode

Parameters
theMode- new display mode

References ChangeRepresentationToSurface(), ChangeRepresentationToSurfaceWithEdges(), ChangeRepresentationToWireframe(), and myDisplayMode.

◆ SetMaterial()

void SVTK_View::SetMaterial ( const Handle(SALOME_InteractiveObject)&  theIObject,
vtkProperty *  thePropF,
vtkProperty *  thePropB 
)

Change material.

Change material

Parameters
theIObject- object
thePropF- property contained new properties of front material
thePropB- property contained new properties of back material

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and VTKViewer_Actor::SetMaterial().

◆ SetPreselectionProp()

void SVTK_View::SetPreselectionProp ( const double &  theRed = 0,
const double &  theGreen = 1,
const double &  theBlue = 1,
const int &  theWidth = 5 
)

◆ SetSelectionProp()

void SVTK_View::SetSelectionProp ( const double &  theRed = 1,
const double &  theGreen = 1,
const double &  theBlue = 0,
const int &  theWidth = 5 
)

◆ SetSelectionTolerance()

void SVTK_View::SetSelectionTolerance ( const double &  theTolNodes = 0.025,
const double &  theTolCell = 0.001,
const double &  theTolObjects = 0.025 
)

◆ SetTransparency()

void SVTK_View::SetTransparency ( const Handle(SALOME_InteractiveObject)&  theIObject,
float  theTrans 
)

Change transparency.

Sets current transparency

Parameters
theIObject- object
theTrans- new transparency

References VTK::ActorCollectionCopy::GetActors(), SVTK_SignalHandler::getRenderer(), and VTKViewer_Actor::SetOpacity().

◆ unHighlightAll()

void SVTK_View::unHighlightAll ( )

To unhighlight all VTK presentations.

Unhilights all objects in viewer

References VTK::ActorCollectionCopy::GetActors().

Member Data Documentation

◆ myDisplayMode

int SVTK_View::myDisplayMode
protected

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