Go to the documentation of this file.
53 #ifndef vtkRenderWindowInteractor_h
54 #define vtkRenderWindowInteractor_h
62 #define VTKI_TIMER_FIRST 0
63 #define VTKI_TIMER_UPDATE 1
67 #define VTKI_MAX_POINTERS 5
187 enum {OneShotTimer=1,RepeatingTimer};
316 {this->FlyTo(ren,
x[0],
x[1],
x[2]);}
319 {this->FlyToImage(ren,
x[0],
x[1]);}
347 <<
"): setting EventPosition to (" << x <<
"," <<
y <<
")");
348 if (this->EventPosition[0] !=
x || this->EventPosition[1] !=
y ||
349 this->LastEventPosition[0] !=
x || this->LastEventPosition[1] !=
y)
351 this->LastEventPosition[0] = this->EventPosition[0];
352 this->LastEventPosition[1] = this->EventPosition[1];
353 this->EventPosition[0] =
x;
354 this->EventPosition[1] =
y;
360 this->SetEventPosition(pos[0], pos[1]);
364 this->SetEventPosition(
x, this->Size[1] -
y - 1);
368 this->SetEventPositionFlipY(pos[0], pos[1]);
378 return this->EventPositions[pointerIndex];
386 return this->LastEventPositions[pointerIndex];
394 if (pointerIndex == 0)
396 this->LastEventPosition[0] = this->EventPosition[0];
397 this->LastEventPosition[1] = this->EventPosition[1];
398 this->EventPosition[0] =
x;
399 this->EventPosition[1] =
y;
402 <<
"): setting EventPosition to (" << x <<
"," <<
y <<
") for pointerIndex number " << pointerIndex);
403 if (this->EventPositions[pointerIndex][0] !=
x || this->EventPositions[pointerIndex][1] !=
y ||
404 this->LastEventPositions[pointerIndex][0] !=
x || this->LastEventPositions[pointerIndex][1] !=
y)
406 this->LastEventPositions[pointerIndex][0] = this->EventPositions[pointerIndex][0];
407 this->LastEventPositions[pointerIndex][1] = this->EventPositions[pointerIndex][1];
408 this->EventPositions[pointerIndex][0] =
x;
409 this->EventPositions[pointerIndex][1] =
y;
415 this->SetEventPosition(pos[0], pos[1], pointerIndex);
419 this->SetEventPosition(
x, this->Size[1] -
y - 1, pointerIndex);
423 this->SetEventPositionFlipY(pos[0], pos[1], pointerIndex);
484 this->SetEventPosition(
x,
y,pointerIndex);
485 this->ControlKey = ctrl;
486 this->ShiftKey = shift;
487 this->KeyCode = keycode;
488 this->RepeatCount = repeatcount;
489 this->PointerIndex = pointerIndex;
492 this->SetKeySym(keysym);
497 int ctrl=0,
int shift=0,
500 const char* keysym=0)
502 this->SetEventInformation(
x,
y,ctrl,shift,keycode,repeatcount,keysym,0);
516 this->SetEventInformation(
x,
517 this->Size[1] -
y - 1,
526 int ctrl=0,
int shift=0,
529 const char* keysym=0)
531 this->SetEventInformationFlipY(
x,
y,ctrl,shift,keycode,repeatcount,keysym,0);
541 const char* keysym=0)
543 this->ControlKey = ctrl;
544 this->ShiftKey = shift;
545 this->KeyCode = keycode;
546 this->RepeatCount = repeatcount;
549 this->SetKeySym(keysym);
646 int EventPosition[2];
647 int LastEventPosition[2];
686 friend struct vtkTimerStruct;
void SetRenderWindow(vtkRenderWindow *aren)
static vtkRenderWindowInteractor * New()
superclass for callback/observer methods
virtual void MouseWheelForwardEvent()
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
record and play VTK events passing through a vtkRenderWindowInteractor
#define vtkGetObjectMacro(name, type)
virtual int CreateTimer(int timerType)
#define vtkSetVector2Macro(name, type)
virtual void StartEventLoop()
virtual void MiddleButtonPressEvent()
#define vtkGetVector2Macro(name, type)
virtual void MouseWheelBackwardEvent()
virtual int InternalDestroyTimer(int platformTimerId)
vtkObserverMediator * GetObserverMediator()
void FlyTo(vtkRenderer *ren, double *x)
virtual void EndPickCallback()
~vtkRenderWindowInteractor()
#define vtkTypeMacro(thisClass, superclass)
abstract base class for most VTK objects
virtual void UpdateSize(int x, int y)
vtkRenderWindow * RenderWindow
virtual void SetEventPosition(int x, int y)
GLint GLint GLint GLint GLint x
virtual void LeaveEvent()
vtkPickingManager * PickingManager
void SetKeyEventInformation(int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0)
define API for picking subclasses
a list of nodes that form an assembly path
virtual void SetPickingManager(vtkPickingManager *)
virtual void KeyPressEvent()
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
virtual vtkRenderer * FindPokedRenderer(int, int)
virtual int * GetLastEventPositions(int pointerIndex)
void InternalReleaseFocus()
virtual int * GetEventPositions(int pointerIndex)
int CreateOneShotTimer(unsigned long duration)
virtual void RightButtonReleaseEvent()
vtkAbstractPicker * Picker
#define vtkSetClampMacro(name, type, min, max)
virtual void RightButtonPressEvent()
const char * GetClassName() const
virtual void GetMousePosition(int *x, int *y)
void FlyToImage(vtkRenderer *ren, double *x)
abstract base class for most VTK objects
vtkObserverMediator * ObserverMediator
virtual void ConfigureEvent()
virtual void SetInteractorStyle(vtkInteractorObserver *)
a simple class to control print indentation
virtual void SetEventPosition(int pos[2])
#define vtkSetStringMacro(name)
int DestroyTimer(int timerId)
int ResetTimer(int timerId)
int IsOneShotTimer(int timerId)
unsigned long GetTimerDuration(int timerId)
virtual vtkPickingManager * CreateDefaultPickingManager()
virtual void UnRegister(vtkObjectBase *o)
vtkInteractorObserver * InteractorStyle
#define vtkGetMacro(name, type)
virtual void LeftButtonReleaseEvent()
vtkGetStringMacro(ExtensionsString)
virtual vtkAbstractPropPicker * CreateDefaultPicker()
virtual void SetEventPosition(int x, int y, int pointerIndex)
virtual void SetEventPositionFlipY(int pos[2])
virtual int DestroyTimer()
platform-independent render window interaction including picking and frame rate control.
virtual void MiddleButtonReleaseEvent()
virtual void ExitCallback()
abstract API for pickers that can pick an instance of vtkProp
virtual void UserCallback()
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro(IgnoreDriverBugs, bool)
virtual void TerminateApp(void)
GLint GLint GLint GLint GLint GLint y
void GrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
virtual void EnterEvent()
virtual void KeyReleaseEvent()
void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount, const char *keysym, int pointerIndex)
void PrintSelf(ostream &os, vtkIndent indent)
vtkRenderWindowInteractor()
abstract specification for renderers
void FlyToImage(vtkRenderer *ren, double x, double y)
virtual void SetEventPosition(int pos[2], int pointerIndex)
void SetEventInformationFlipY(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0)
virtual void SetEventPositionFlipY(int x, int y)
virtual void SetPicker(vtkAbstractPicker *)
#define VTKI_MAX_POINTERS
virtual void Initialize()
void FlyTo(vtkRenderer *ren, double x, double y, double z)
void InternalGrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
int CreateRepeatingTimer(unsigned long duration)
virtual void LeftButtonPressEvent()
virtual void ExposeEvent()
virtual void MouseMoveEvent()
#define VTKRENDERINGCORE_EXPORT
create a window for renderers to draw into
virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
virtual void StartPickCallback()
virtual int GetVTKTimerId(int platformTimerId)
void SetEventInformation(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0)
unsigned long TimerDuration
void SetEventInformation(int x, int y, int ctrl, int shift, char keycode, int repeatcount, const char *keysym, int pointerIndex)