Version: 9.12.0
VTKViewer_RenderWindowInteractor Class Reference

#include <VTKViewer_RenderWindowInteractor.h>

Inheritance diagram for VTKViewer_RenderWindowInteractor:
Inheritance graph

Public Member Functions

 vtkTypeMacro (VTKViewer_RenderWindowInteractor, vtkRenderWindowInteractor) void PrintSelf(ostream &os
 
virtual void Initialize ()
 
virtual void SetInteractorStyle (vtkInteractorObserver *)
 
VTKViewer_InteractorStyleGetInteractorStyle () const
 
virtual void Start ()
 
virtual void Enable ()
 
virtual void Disable ()
 
virtual void UpdateSize (int x, int y)
 
Timer options
virtual int CreateTimer (int)
 
virtual int DestroyTimer ()
 
virtual void TerminateApp (void)
 
Selection Management
bool highlightCell (const TIndexedMapOfVtkId &MapIndex, VTKViewer_Actor *theMapActor, bool hilight, bool update=true)
 
bool highlightEdge (const TIndexedMapOfVtkId &MapIndex, VTKViewer_Actor *theMapActor, bool hilight, bool update=true)
 
bool highlightPoint (const TIndexedMapOfVtkId &MapIndex, VTKViewer_Actor *theMapActor, bool hilight, bool update=true)
 
void unHighlightSubSelection ()
 
bool unHighlightAll ()
 
void SetSelectionProp (const double &theRed=1, const double &theGreen=1, const double &theBlue=0, const int &theWidth=5)
 
void SetSelectionTolerance (const double &theTolNodes=0.025, const double &theTolCell=0.001)
 
Displaymode management
int GetDisplayMode ()
 
void SetDisplayMode (int)
 
Change all actors to wireframe or surface
void ChangeRepresentationToWireframe ()
 
void ChangeRepresentationToSurface ()
 
void ChangeRepresentationToSurfaceWithEdges ()
 
Change to wireframe or surface a list of vtkactor
void ChangeRepresentationToWireframe (vtkActorCollection *ListofActors)
 
void ChangeRepresentationToSurface (vtkActorCollection *ListofActors)
 
void ChangeRepresentationToSurfaceWithEdges (vtkActorCollection *ListofActors)
 

Static Public Member Functions

static VTKViewer_RenderWindowInteractorNew ()
 

Public Attributes

vtkIndent indent
 

Erase Display functions

typedef void(* TUpdateActor) (const TIndexedMapOfVtkId &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor)
 
VTKViewer_InteractorStylemyInteractorStyle
 
QTimer * mTimer
 
int myDisplayMode
 
VTKViewer_ActormyPointActor
 
VTKViewer_ActormyEdgeActor
 
VTKViewer_ActormyCellActor
 
vtkPicker * myBasicPicker
 
vtkCellPicker * myCellPicker
 
vtkPointPicker * myPointPicker
 
int PositionBeforeStereo [2]
 
class VTKViewer_ViewWindow
 
VTKViewer_ViewWindowmyViewWnd
 
double myTolNodes
 Selection node tolerance. More...
 
double myTolItems
 Selection cell tolerance. More...
 
void EraseAll ()
 
void DisplayAll ()
 
void RemoveAll (const bool immediatly)
 
void Display (VTKViewer_Actor *SActor, bool immediatly=true)
 Display the theActor. More...
 
void Erase (VTKViewer_Actor *SActor, bool immediatly=true)
 
void Remove (VTKViewer_Actor *SActor, bool updateViewer=true)
 
void Update ()
 
vtkRenderer * GetRenderer ()
 
void setViewWindow (VTKViewer_ViewWindow *theViewWnd)
 
void setCellData (const int &, VTKViewer_Actor *, VTKViewer_Actor *)
 
void setEdgeData (const int &, VTKViewer_Actor *, const int &, VTKViewer_Actor *)
 
void setPointData (const int &, VTKViewer_Actor *, VTKViewer_Actor *)
 
 VTKViewer_RenderWindowInteractor ()
 
 ~VTKViewer_RenderWindowInteractor ()
 
bool highlight (const TIndexedMapOfVtkId &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor, TUpdateActor theFun, bool hilight, bool update)
 
void setActorData (const TIndexedMapOfVtkId &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor, TUpdateActor theFun)
 
void MoveInternalActors ()
 
void MouseMove (QMouseEvent *event)
 
void LeftButtonPressed (const QMouseEvent *event)
 
void LeftButtonReleased (const QMouseEvent *event)
 
void MiddleButtonPressed (const QMouseEvent *event)
 
void MiddleButtonReleased (const QMouseEvent *event)
 
void RightButtonPressed (const QMouseEvent *event)
 
void RightButtonReleased (const QMouseEvent *event)
 
void ButtonPressed (const QMouseEvent *event)
 
void ButtonReleased (const QMouseEvent *event)
 
void KeyPressed (QKeyEvent *event)
 
void TimerFunc ()
 
void RenderWindowModified ()
 
void contextMenuRequested (QContextMenuEvent *e)
 

Member Typedef Documentation

◆ TUpdateActor

typedef void(* VTKViewer_RenderWindowInteractor::TUpdateActor) (const TIndexedMapOfVtkId &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor)

Constructor & Destructor Documentation

◆ VTKViewer_RenderWindowInteractor()

VTKViewer_RenderWindowInteractor::VTKViewer_RenderWindowInteractor ( )
protected

◆ ~VTKViewer_RenderWindowInteractor()

VTKViewer_RenderWindowInteractor::~VTKViewer_RenderWindowInteractor ( )
protected

Member Function Documentation

◆ ButtonPressed

void VTKViewer_RenderWindowInteractor::ButtonPressed ( const QMouseEvent *  event)
slot

Reaction on button pressed.

Warning
Do nothing.

◆ ButtonReleased

void VTKViewer_RenderWindowInteractor::ButtonReleased ( const QMouseEvent *  event)
slot

Reaction on button released..

Warning
Do nothing.

◆ ChangeRepresentationToSurface() [1/2]

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface ( )

Change all actors to surface

References VTK::ActorCollectionCopy::GetActors(), and GetRenderer().

◆ ChangeRepresentationToSurface() [2/2]

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface ( vtkActorCollection *  theCollection)

Change all actors from theCollection to surface and emit render window modified.

References RenderWindowModified(), and VTKViewer_Actor::setDisplayMode().

◆ ChangeRepresentationToSurfaceWithEdges() [1/2]

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges ( )

Change all actors to surface with edges

References VTK::ActorCollectionCopy::GetActors(), and GetRenderer().

◆ ChangeRepresentationToSurfaceWithEdges() [2/2]

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges ( vtkActorCollection *  theCollection)

Change all actors from theCollection to surface with edges and emit render window modified.

References RenderWindowModified(), and VTKViewer_Actor::setDisplayMode().

◆ ChangeRepresentationToWireframe() [1/2]

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe ( )

Change all actors to wireframe

References VTK::ActorCollectionCopy::GetActors(), and GetRenderer().

◆ ChangeRepresentationToWireframe() [2/2]

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe ( vtkActorCollection *  theCollection)

Change all actors from theCollection to wireframe and emit render window modified.

References RenderWindowModified(), and VTKViewer_Actor::setDisplayMode().

◆ contextMenuRequested

void VTKViewer_RenderWindowInteractor::contextMenuRequested ( QContextMenuEvent *  e)
signal

◆ CreateTimer()

int VTKViewer_RenderWindowInteractor::CreateTimer ( int   )
virtual

Description: Timer methods must be overridden by platform dependent subclasses. flag is passed to indicate if this is first timer set or an update as Win32 uses repeating timers, whereas X uses One shot more timer if flag == VTKXI_TIMER_FIRST Win32 and X should createtimer otherwise Win32 should exit and X should perform AddTimeOut

Return values
1

Start a one-shot timer for 10ms.

References mTimer.

◆ DestroyTimer()

int VTKViewer_RenderWindowInteractor::DestroyTimer ( void  )
virtual
See also
CreateTimer(int )
Return values
1

QTimer will automatically expire after 10ms. So we do not need to do anything here. In fact, we should not even Stop() the QTimer here because doing this will skip some of the processing that the TimerFunc() does and will result in undesirable effects. For example, this will result in vtkLODActor to leave the models in low-res mode after the mouse stops moving.

◆ Disable()

void VTKViewer_RenderWindowInteractor::Disable ( )
virtual

See Enable().

◆ Display()

void VTKViewer_RenderWindowInteractor::Display ( VTKViewer_Actor theActor,
bool  update = true 
)

Display the theActor.

Add actor to renderer and set visibility to true. Emit render window modified, if update - true.

References GetRenderer(), and RenderWindowModified().

◆ DisplayAll()

void VTKViewer_RenderWindowInteractor::DisplayAll ( )

Display all actors. Sets visible for all actors from renderer collection and emit render window modified.

References VTK::ActorCollectionCopy::GetActors(), GetRenderer(), and RenderWindowModified().

◆ Enable()

void VTKViewer_RenderWindowInteractor::Enable ( )
virtual

Description:
Enable/Disable interactions. By default interactors are enabled when
initialized. Initialize() must be called prior to enabling/disabling
interaction. These methods are used when a window/widget is being
shared by multiple renderers and interactors. This allows a "modal"
display where one interactor is active when its data is to be displayed
and all other interactors associated with the widget are disabled
when their data is not displayed.

◆ Erase()

void VTKViewer_RenderWindowInteractor::Erase ( VTKViewer_Actor SActor,
bool  immediatly = true 
)

Do nothing

◆ EraseAll()

void VTKViewer_RenderWindowInteractor::EraseAll ( )

Do nothing

◆ GetDisplayMode()

int VTKViewer_RenderWindowInteractor::GetDisplayMode ( )

Gets display mode.

References myDisplayMode.

◆ GetInteractorStyle()

VTKViewer_InteractorStyle* VTKViewer_RenderWindowInteractor::GetInteractorStyle ( ) const
inline

Return interactor style pointer.

◆ GetRenderer()

vtkRenderer * VTKViewer_RenderWindowInteractor::GetRenderer ( )

Gets renderer.

◆ highlight()

bool VTKViewer_RenderWindowInteractor::highlight ( const TIndexedMapOfVtkId theMapIndex,
VTKViewer_Actor theMapActor,
VTKViewer_Actor theActor,
TUpdateActor  theFun,
bool  hilight,
bool  update 
)
protected
  • Sets actors data and sets visibility to true, if flag hilight - true, else sets visibility to false.
  • Emit render window modified, if flag update - true.

References VTKViewer_Actor::Render(), RenderWindowModified(), and setActorData().

◆ highlightCell()

bool VTKViewer_RenderWindowInteractor::highlightCell ( const TIndexedMapOfVtkId MapIndex,
VTKViewer_Actor theMapActor,
bool  hilight,
bool  update = true 
)

◆ highlightEdge()

bool VTKViewer_RenderWindowInteractor::highlightEdge ( const TIndexedMapOfVtkId MapIndex,
VTKViewer_Actor theMapActor,
bool  hilight,
bool  update = true 
)

◆ highlightPoint()

bool VTKViewer_RenderWindowInteractor::highlightPoint ( const TIndexedMapOfVtkId MapIndex,
VTKViewer_Actor theMapActor,
bool  hilight,
bool  update = true 
)

◆ Initialize()

void VTKViewer_RenderWindowInteractor::Initialize ( )
virtual

Description:
Initializes the event handlers without an XtAppContext. This is
good for when you don`t have a user interface, but you still
want to have mouse interaction.
We never allow the VTKViewer_RenderWindowInteractor to control
the event loop. The application always has the control.

References Enable(), myBasicPicker, and SetSelectionTolerance().

◆ KeyPressed

void VTKViewer_RenderWindowInteractor::KeyPressed ( QKeyEvent *  event)
slot

default key press event (empty implementation)

NOT_IMPLEMENTED

◆ LeftButtonPressed

void VTKViewer_RenderWindowInteractor::LeftButtonPressed ( const QMouseEvent *  event)
slot

Reaction on left button pressed.
Same as left button down for interactor style.
If render window enabled.

References myInteractorStyle, and VTKViewer_InteractorStyle::OnLeftButtonDown().

◆ LeftButtonReleased

void VTKViewer_RenderWindowInteractor::LeftButtonReleased ( const QMouseEvent *  event)
slot

Reaction on left button releases.
Same as left button up for interactor style.
If render window enabled.

References myInteractorStyle, and VTKViewer_InteractorStyle::OnLeftButtonUp().

◆ MiddleButtonPressed

void VTKViewer_RenderWindowInteractor::MiddleButtonPressed ( const QMouseEvent *  event)
slot

Reaction on middle button pressed.
Same as middle button down for interactor style.
If render window enabled.

References myInteractorStyle, and VTKViewer_InteractorStyle::OnMiddleButtonDown().

◆ MiddleButtonReleased

void VTKViewer_RenderWindowInteractor::MiddleButtonReleased ( const QMouseEvent *  event)
slot

Reaction on middle button released.
Same as middle button up for interactor style.
If render window enabled.

References myInteractorStyle, and VTKViewer_InteractorStyle::OnMiddleButtonUp().

◆ MouseMove

void VTKViewer_RenderWindowInteractor::MouseMove ( QMouseEvent *  event)
slot

Emit render window modified on mouse move,
if interactor style needs redrawing and render window enabled.

References myInteractorStyle, VTKViewer_InteractorStyle::needsRedrawing(), VTKViewer_InteractorStyle::OnMouseMove(), and RenderWindowModified().

◆ MoveInternalActors()

void VTKViewer_RenderWindowInteractor::MoveInternalActors ( )
protected

Move selection actors to view window.

References VTKViewer_ViewWindow::MoveActor(), myCellActor, myEdgeActor, myPointActor, and myViewWnd.

◆ New()

VTKViewer_RenderWindowInteractor * VTKViewer_RenderWindowInteractor::New ( )
static

◆ Remove()

void VTKViewer_RenderWindowInteractor::Remove ( VTKViewer_Actor SActor,
bool  updateViewer = true 
)

Remove SActor from renderer and emit update window, if updateViewer - true

References GetRenderer(), and RenderWindowModified().

◆ RemoveAll()

void VTKViewer_RenderWindowInteractor::RemoveAll ( const bool  updateViewer)

Remove actors from render window collection(not implemented). Emit render window modified, if updateViewer - true.

References VTK::ActorCollectionCopy::GetActors(), GetRenderer(), and RenderWindowModified().

◆ RenderWindowModified

void VTKViewer_RenderWindowInteractor::RenderWindowModified ( )
signal

◆ RightButtonPressed

void VTKViewer_RenderWindowInteractor::RightButtonPressed ( const QMouseEvent *  event)
slot

Reaction on right button pressed.
Same as right button down for interactor style.
If render window enabled.

References myInteractorStyle, and VTKViewer_InteractorStyle::OnRightButtonDown().

◆ RightButtonReleased

void VTKViewer_RenderWindowInteractor::RightButtonReleased ( const QMouseEvent *  event)
slot

Reaction on right button released.
Same as right button up for interactor style.If render window enabled.
Emit context menu requested, if interactor style state equal VTK_INTERACTOR_STYLE_CAMERA_NONE.

References contextMenuRequested(), VTKViewer_InteractorStyle::CurrentState(), myInteractorStyle, VTKViewer_InteractorStyle::OnRightButtonUp(), and VTK_INTERACTOR_STYLE_CAMERA_NONE.

◆ setActorData()

void VTKViewer_RenderWindowInteractor::setActorData ( const TIndexedMapOfVtkId theMapIndex,
VTKViewer_Actor theMapActor,
VTKViewer_Actor theActor,
TUpdateActor  theFun 
)
protected

Sets actors data.

◆ setCellData()

void VTKViewer_RenderWindowInteractor::setCellData ( const int &  ,
VTKViewer_Actor ,
VTKViewer_Actor  
)
inline

◆ SetDisplayMode()

void VTKViewer_RenderWindowInteractor::SetDisplayMode ( int  theMode)

◆ setEdgeData()

void VTKViewer_RenderWindowInteractor::setEdgeData ( const int &  ,
VTKViewer_Actor ,
const int &  ,
VTKViewer_Actor  
)
inline

◆ SetInteractorStyle()

void VTKViewer_RenderWindowInteractor::SetInteractorStyle ( vtkInteractorObserver theInteractor)
virtual

Sets interactor style.

References myInteractorStyle.

◆ setPointData()

void VTKViewer_RenderWindowInteractor::setPointData ( const int &  ,
VTKViewer_Actor ,
VTKViewer_Actor  
)
inline

◆ SetSelectionProp()

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

Sets selection properties.

Parameters
theRed- red component of color
theGreen- green component of color
theBlue- blue component of color
theWidth- point size and line width

References myCellActor, myPointActor, and VTKViewer_Actor::SetColor().

◆ SetSelectionTolerance()

void VTKViewer_RenderWindowInteractor::SetSelectionTolerance ( const double &  theTolNodes = 0.025,
const double &  theTolItems = 0.001 
)

Sets selection tolerance

Parameters
theTolNodes- nodes selection tolerance
theTolItems- selection tolerance for basic and cell pickers.

References myBasicPicker, myCellPicker, myPointPicker, myTolItems, and myTolNodes.

◆ setViewWindow()

void VTKViewer_RenderWindowInteractor::setViewWindow ( VTKViewer_ViewWindow theViewWnd)

Sets view window and add to it selection actors.

References VTKViewer_ViewWindow::InsertActor(), myCellActor, myEdgeActor, myPointActor, and myViewWnd.

◆ Start()

void VTKViewer_RenderWindowInteractor::Start ( )
virtual

Description:
This will start up the X event loop and never return. If you
call this method it will loop processing X events until the
application is exited.

◆ TerminateApp()

virtual void VTKViewer_RenderWindowInteractor::TerminateApp ( void  )
inlinevirtual

Description:
This function is called on 'q','e' keypress if exitmethod is not
specified and should be overidden by platform dependent subclasses
to provide a termination procedure if one is required.

◆ TimerFunc

void VTKViewer_RenderWindowInteractor::TimerFunc ( )
privateslot

Not all of these slots are needed in VTK_MAJOR_VERSION=3,
but moc does not understand "#if VTK_MAJOR_VERSION". Hence,
we have to include all of these for the time being. Once,
this bug in MOC is fixed, we can separate these.

References RenderWindowModified().

◆ unHighlightAll()

bool VTKViewer_RenderWindowInteractor::unHighlightAll ( )
See also
unHighlightSubSelection() Also emit render window modified.

References RenderWindowModified(), and unHighlightSubSelection().

◆ unHighlightSubSelection()

void VTKViewer_RenderWindowInteractor::unHighlightSubSelection ( )

Unhighlight all selection actors.

References myCellActor, myEdgeActor, and myPointActor.

◆ Update()

void VTKViewer_RenderWindowInteractor::Update ( )

Update all actors from renderer and emit render window modified.

References VTK::ActorCollectionCopy::GetActors(), GetRenderer(), and RenderWindowModified().

◆ UpdateSize()

void VTKViewer_RenderWindowInteractor::UpdateSize ( int  w,
int  h 
)
virtual

Description:
Event loop notification member for Window size change

◆ vtkTypeMacro()

VTKViewer_RenderWindowInteractor::vtkTypeMacro ( VTKViewer_RenderWindowInteractor  ,
vtkRenderWindowInteractor   
) &

Friends And Related Function Documentation

◆ VTKViewer_ViewWindow

friend class VTKViewer_ViewWindow
friend

Member Data Documentation

◆ indent

vtkIndent VTKViewer_RenderWindowInteractor::indent

◆ mTimer

QTimer* VTKViewer_RenderWindowInteractor::mTimer
protected

Timer used during various mouse events to figure out mouse movements.

◆ myBasicPicker

vtkPicker* VTKViewer_RenderWindowInteractor::myBasicPicker
protected

◆ myCellActor

VTKViewer_Actor* VTKViewer_RenderWindowInteractor::myCellActor
protected

◆ myCellPicker

vtkCellPicker* VTKViewer_RenderWindowInteractor::myCellPicker
protected

◆ myDisplayMode

int VTKViewer_RenderWindowInteractor::myDisplayMode
protected

◆ myEdgeActor

VTKViewer_Actor* VTKViewer_RenderWindowInteractor::myEdgeActor
protected

◆ myInteractorStyle

VTKViewer_InteractorStyle* VTKViewer_RenderWindowInteractor::myInteractorStyle
protected

◆ myPointActor

VTKViewer_Actor* VTKViewer_RenderWindowInteractor::myPointActor
protected

◆ myPointPicker

vtkPointPicker* VTKViewer_RenderWindowInteractor::myPointPicker
protected

◆ myTolItems

double VTKViewer_RenderWindowInteractor::myTolItems
private

Selection cell tolerance.

◆ myTolNodes

double VTKViewer_RenderWindowInteractor::myTolNodes
private

Selection node tolerance.

◆ myViewWnd

VTKViewer_ViewWindow* VTKViewer_RenderWindowInteractor::myViewWnd
private

◆ PositionBeforeStereo

int VTKViewer_RenderWindowInteractor::PositionBeforeStereo[2]
protected

User for switching to stereo mode.


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