Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VTKViewer_RenderWindowInteractor Class Reference

#include <VTKViewer_RenderWindowInteractor.h>

Inheritance diagram for VTKViewer_RenderWindowInteractor:
Inheritance graph

Public Types

typedef void(* TUpdateActor )(const TColStd_IndexedMapOfInteger &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor)
 

Public Slots

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)
 

Signals

void RenderWindowModified ()
 
void contextMenuRequested (QContextMenuEvent *e)
 

Public Member Functions

 vtkTypeMacro (VTKViewer_RenderWindowInteractor, vtkRenderWindowInteractor)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
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)
 
virtual void TerminateApp (void)
 
void Update ()
 
vtkRenderer * GetRenderer ()
 
void setViewWindow (VTKViewer_ViewWindow *theViewWnd)
 
void setCellData (const int &theIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor)
 
void setEdgeData (const int &theCellIndex, VTKViewer_Actor *theMapActor, const int &theEdgeIndex, VTKViewer_Actor *theActor)
 
void setPointData (const int &theIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor)
 
Timer options
virtual int CreateTimer (int)
 
virtual int DestroyTimer ()
 
Selection Management
bool highlightCell (const TColStd_IndexedMapOfInteger &MapIndex, VTKViewer_Actor *theMapActor, bool hilight, bool update=true)
 
bool highlightEdge (const TColStd_IndexedMapOfInteger &MapIndex, VTKViewer_Actor *theMapActor, bool hilight, bool update=true)
 
bool highlightPoint (const TColStd_IndexedMapOfInteger &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)
 
Erase Display functions
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)
 

Static Public Member Functions

static
VTKViewer_RenderWindowInteractor
New ()
 

Protected Member Functions

 VTKViewer_RenderWindowInteractor ()
 
 ~VTKViewer_RenderWindowInteractor ()
 
bool highlight (const TColStd_IndexedMapOfInteger &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor, TUpdateActor theFun, bool hilight, bool update)
 
void setActorData (const TColStd_IndexedMapOfInteger &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor, TUpdateActor theFun)
 
void MoveInternalActors ()
 

Protected Attributes

VTKViewer_InteractorStylemyInteractorStyle
 
QTimer * mTimer
 
int myDisplayMode
 
VTKViewer_ActormyPointActor
 
VTKViewer_ActormyEdgeActor
 
VTKViewer_ActormyCellActor
 
vtkPicker * myBasicPicker
 
vtkCellPicker * myCellPicker
 
vtkPointPicker * myPointPicker
 
int PositionBeforeStereo [2]
 

Private Slots

void TimerFunc ()
 

Private Attributes

VTKViewer_ViewWindowmyViewWnd
 
double myTolNodes
 Selection node tolerance. More...
 
double myTolItems
 Selection cell tolerance. More...
 

Friends

class VTKViewer_ViewWindow
 

Member Typedef Documentation

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

Constructor & Destructor Documentation

VTKViewer_RenderWindowInteractor::VTKViewer_RenderWindowInteractor ( )
protected
VTKViewer_RenderWindowInteractor::~VTKViewer_RenderWindowInteractor ( )
protected

Member Function Documentation

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

Reaction on button pressed.

Warning
Do nothing.
void VTKViewer_RenderWindowInteractor::ButtonReleased ( const QMouseEvent *  event)
slot

Reaction on button released..

Warning
Do nothing.
void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface ( )

Change all actors to surface

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

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface ( vtkActorCollection *  theCollection)

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

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

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurfaceWithEdges ( )

Change all actors to surface with edges

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

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

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe ( )

Change all actors to wireframe

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

void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe ( vtkActorCollection *  theCollection)

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

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

void VTKViewer_RenderWindowInteractor::contextMenuRequested ( QContextMenuEvent *  e)
signal
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.

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.

void VTKViewer_RenderWindowInteractor::Disable ( )
virtual

See Enable().

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

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

References GetRenderer(), and RenderWindowModified().

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

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.

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

Do nothing

void VTKViewer_RenderWindowInteractor::EraseAll ( )

Do nothing

int VTKViewer_RenderWindowInteractor::GetDisplayMode ( )

Gets display mode.

References myDisplayMode.

VTKViewer_InteractorStyle* VTKViewer_RenderWindowInteractor::GetInteractorStyle ( ) const
inline

Return interactor style pointer.

vtkRenderer * VTKViewer_RenderWindowInteractor::GetRenderer ( )

Gets renderer.

bool VTKViewer_RenderWindowInteractor::highlight ( const TColStd_IndexedMapOfInteger &  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().

bool VTKViewer_RenderWindowInteractor::highlightCell ( const TColStd_IndexedMapOfInteger &  MapIndex,
VTKViewer_Actor theMapActor,
bool  hilight,
bool  update = true 
)
bool VTKViewer_RenderWindowInteractor::highlightEdge ( const TColStd_IndexedMapOfInteger &  MapIndex,
VTKViewer_Actor theMapActor,
bool  hilight,
bool  update = true 
)
bool VTKViewer_RenderWindowInteractor::highlightPoint ( const TColStd_IndexedMapOfInteger &  MapIndex,
VTKViewer_Actor theMapActor,
bool  hilight,
bool  update = true 
)
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().

void VTKViewer_RenderWindowInteractor::KeyPressed ( QKeyEvent *  event)
slot

default key press event (empty implementation)

NOT_IMPLEMENTED

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

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

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

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

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

void VTKViewer_RenderWindowInteractor::MoveInternalActors ( )
protected

Move selection actors to view window.

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

VTKViewer_RenderWindowInteractor * VTKViewer_RenderWindowInteractor::New ( )
static
void VTKViewer_RenderWindowInteractor::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

Print interactor to stream

Parameters
os- stream
indent
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().

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

void VTKViewer_RenderWindowInteractor::RenderWindowModified ( )
signal
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().

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.

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

Sets actors data.

void VTKViewer_RenderWindowInteractor::setCellData ( const int &  theIndex,
VTKViewer_Actor theMapActor,
VTKViewer_Actor theActor 
)
inline
void VTKViewer_RenderWindowInteractor::SetDisplayMode ( int  theMode)
void VTKViewer_RenderWindowInteractor::setEdgeData ( const int &  theCellIndex,
VTKViewer_Actor theMapActor,
const int &  theEdgeIndex,
VTKViewer_Actor theActor 
)
inline
void VTKViewer_RenderWindowInteractor::SetInteractorStyle ( vtkInteractorObserver theInteractor)
virtual

Sets interactor style.

References myInteractorStyle.

void VTKViewer_RenderWindowInteractor::setPointData ( const int &  theIndex,
VTKViewer_Actor theMapActor,
VTKViewer_Actor theActor 
)
inline
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().

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.

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.

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.

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.

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

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

References RenderWindowModified(), and unHighlightSubSelection().

void VTKViewer_RenderWindowInteractor::unHighlightSubSelection ( )

Unhighlight all selection actors.

References myCellActor, myEdgeActor, and myPointActor.

void VTKViewer_RenderWindowInteractor::Update ( )

Update all actors from renderer and emit render window modified.

References GetRenderer(), and RenderWindowModified().

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

Description:
Event loop notification member for Window size change

VTKViewer_RenderWindowInteractor::vtkTypeMacro ( VTKViewer_RenderWindowInteractor  ,
vtkRenderWindowInteractor   
)

Friends And Related Function Documentation

friend class VTKViewer_ViewWindow
friend

Member Data Documentation

QTimer* VTKViewer_RenderWindowInteractor::mTimer
protected

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

vtkPicker* VTKViewer_RenderWindowInteractor::myBasicPicker
protected
VTKViewer_Actor* VTKViewer_RenderWindowInteractor::myCellActor
protected
vtkCellPicker* VTKViewer_RenderWindowInteractor::myCellPicker
protected
int VTKViewer_RenderWindowInteractor::myDisplayMode
protected
VTKViewer_Actor* VTKViewer_RenderWindowInteractor::myEdgeActor
protected
VTKViewer_InteractorStyle* VTKViewer_RenderWindowInteractor::myInteractorStyle
protected
VTKViewer_Actor* VTKViewer_RenderWindowInteractor::myPointActor
protected
vtkPointPicker* VTKViewer_RenderWindowInteractor::myPointPicker
protected
double VTKViewer_RenderWindowInteractor::myTolItems
private
double VTKViewer_RenderWindowInteractor::myTolNodes
private
VTKViewer_ViewWindow* VTKViewer_RenderWindowInteractor::myViewWnd
private
int VTKViewer_RenderWindowInteractor::PositionBeforeStereo[2]
protected

User for switching to stereo mode.


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