#include <VTKViewer_RenderWindowInteractor.h>
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_InteractorStyle * | GetInteractorStyle () 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_InteractorStyle * | myInteractorStyle |
QTimer * | mTimer |
int | myDisplayMode |
VTKViewer_Actor * | myPointActor |
VTKViewer_Actor * | myEdgeActor |
VTKViewer_Actor * | myCellActor |
vtkPicker * | myBasicPicker |
vtkCellPicker * | myCellPicker |
vtkPointPicker * | myPointPicker |
int | PositionBeforeStereo [2] |
Private Slots | |
void | TimerFunc () |
Private Attributes | |
VTKViewer_ViewWindow * | myViewWnd |
double | myTolNodes |
Selection node tolerance. More... | |
double | myTolItems |
Selection cell tolerance. More... | |
Friends | |
class | VTKViewer_ViewWindow |
typedef void(* VTKViewer_RenderWindowInteractor::TUpdateActor)(const TColStd_IndexedMapOfInteger &theMapIndex, VTKViewer_Actor *theMapActor, VTKViewer_Actor *theActor) |
|
protected |
Constructor.
References mTimer, myBasicPicker, myCellActor, myCellPicker, myDisplayMode, myEdgeActor, myPointActor, myPointPicker, VTKViewer_Actor::New(), VTKViewer_Actor::SetColor(), and TimerFunc().
|
protected |
Destructor.
References mTimer, myBasicPicker, myCellActor, myCellPicker, myEdgeActor, myPointActor, myPointPicker, myViewWnd, and VTKViewer_ViewWindow::RemoveActor().
|
slot |
Reaction on button pressed.
|
slot |
Reaction on button released..
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().
|
signal |
|
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
1 |
Start a one-shot timer for 10ms.
References mTimer.
|
virtual |
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.
|
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().
|
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.
|
inline |
Return interactor style pointer.
vtkRenderer * VTKViewer_RenderWindowInteractor::GetRenderer | ( | ) |
Gets renderer.
|
protected |
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 |
||
) |
|
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().
|
slot |
default key press event (empty implementation)
NOT_IMPLEMENTED
|
slot |
Reaction on left button pressed.
*Same as left button down for interactor style.
*If render window enabled.
References myInteractorStyle, and VTKViewer_InteractorStyle::OnLeftButtonDown().
|
slot |
Reaction on left button releases.
*Same as left button up for interactor style.
*If render window enabled.
References myInteractorStyle, and VTKViewer_InteractorStyle::OnLeftButtonUp().
|
slot |
Reaction on middle button pressed.
*Same as middle button down for interactor style.
*If render window enabled.
References myInteractorStyle, and VTKViewer_InteractorStyle::OnMiddleButtonDown().
|
slot |
Reaction on middle button released.
*Same as middle button up for interactor style.
*If render window enabled.
References myInteractorStyle, and VTKViewer_InteractorStyle::OnMiddleButtonUp().
|
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().
|
protected |
Move selection actors to view window.
References VTKViewer_ViewWindow::MoveActor(), myCellActor, myEdgeActor, myPointActor, and myViewWnd.
|
static |
Create new instance of VTKViewer_RenderWindowInteractor
References VTKViewer_RenderWindowInteractor().
void VTKViewer_RenderWindowInteractor::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
Print interactor to stream
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().
|
signal |
|
slot |
Reaction on right button pressed.
*Same as right button down for interactor style.
*If render window enabled.
References myInteractorStyle, and VTKViewer_InteractorStyle::OnRightButtonDown().
|
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.
|
protected |
Sets actors data.
|
inline |
void VTKViewer_RenderWindowInteractor::SetDisplayMode | ( | int | theMode | ) |
Sets display mode.
References ChangeRepresentationToSurface(), ChangeRepresentationToSurfaceWithEdges(), ChangeRepresentationToWireframe(), and myDisplayMode.
|
inline |
|
virtual |
Sets interactor style.
References myInteractorStyle.
|
inline |
void VTKViewer_RenderWindowInteractor::SetSelectionProp | ( | const double & | theRed = 1 , |
const double & | theGreen = 1 , |
||
const double & | theBlue = 0 , |
||
const int & | theWidth = 5 |
||
) |
Sets selection properties.
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
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.
|
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.
|
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.
|
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 | ( | ) |
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().
|
virtual |
Description:
Event loop notification member for Window size change
VTKViewer_RenderWindowInteractor::vtkTypeMacro | ( | VTKViewer_RenderWindowInteractor | , |
vtkRenderWindowInteractor | |||
) |
|
friend |
|
protected |
Timer used during various mouse events to figure out mouse movements.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
|
private |
|
protected |
User for switching to stereo mode.