51 #ifndef vtkRenderWindowInteractor_h
52 #define vtkRenderWindowInteractor_h
54 #include "vtkRenderingCoreModule.h"
61 #define VTKI_TIMER_FIRST 0
62 #define VTKI_TIMER_UPDATE 1
66 #define VTKI_MAX_POINTERS 5
96 virtual void Initialize();
112 virtual void Start();
134 vtkGetMacro(EnableRender,
bool);
149 virtual void UpdateSize(
int x,
int y);
167 virtual int CreateTimer(
int timerType);
168 virtual int DestroyTimer();
174 int CreateRepeatingTimer(
unsigned long duration);
180 int CreateOneShotTimer(
unsigned long duration);
186 int IsOneShotTimer(
int timerId);
191 unsigned long GetTimerDuration(
int timerId);
196 int ResetTimer(
int timerId);
202 int DestroyTimer(
int timerId);
207 virtual int GetVTKTimerId(
int platformTimerId);
211 enum {OneShotTimer=1,RepeatingTimer};
223 vtkSetClampMacro(TimerDuration,
unsigned long,1,100000);
224 vtkGetMacro(TimerDuration,
unsigned long);
241 vtkGetMacro(TimerEventId,
int);
243 vtkGetMacro(TimerEventType,
int);
245 vtkGetMacro(TimerEventDuration,
int);
247 vtkGetMacro(TimerEventPlatformId,
int);
272 vtkGetMacro(LightFollowCamera,
int);
284 vtkSetClampMacro(DesiredUpdateRate,
double,0.0001,
VTK_FLOAT_MAX);
285 vtkGetMacro(DesiredUpdateRate,
double);
294 vtkSetClampMacro(StillUpdateRate,
double,0.0001,
VTK_FLOAT_MAX);
295 vtkGetMacro(StillUpdateRate,
double);
303 vtkGetMacro(Initialized,
int);
338 virtual void ExitCallback();
339 virtual void UserCallback();
340 virtual void StartPickCallback();
341 virtual void EndPickCallback();
362 virtual void Render();
370 void FlyTo(
vtkRenderer *ren,
double x,
double y,
double z);
372 {this->FlyTo(ren, x[0], x[1], x[2]);}
373 void FlyToImage(
vtkRenderer *ren,
double x,
double y);
375 {this->FlyToImage(ren, x[0], x[1]);}
382 vtkSetClampMacro(NumberOfFlyFrames,
int,1,
VTK_INT_MAX);
383 vtkGetMacro(NumberOfFlyFrames,
int);
392 vtkGetMacro(Dolly,
double);
404 vtkGetVector2Macro(EventPosition,
int);
405 vtkGetVector2Macro(LastEventPosition,
int);
406 vtkSetVector2Macro(LastEventPosition,
int);
410 <<
"): setting EventPosition to (" << x <<
"," << y <<
")");
411 if (this->EventPosition[0] != x || this->EventPosition[1] != y ||
412 this->LastEventPosition[0] != x || this->LastEventPosition[1] != y)
414 this->LastEventPosition[0] = this->EventPosition[0];
415 this->LastEventPosition[1] = this->EventPosition[1];
416 this->EventPosition[0] = x;
417 this->EventPosition[1] = y;
423 this->SetEventPosition(pos[0], pos[1]);
427 this->SetEventPosition(x, this->Size[1] - y - 1);
431 this->SetEventPositionFlipY(pos[0], pos[1]);
441 return this->EventPositions[pointerIndex];
449 return this->LastEventPositions[pointerIndex];
457 if (pointerIndex == 0)
459 this->LastEventPosition[0] = this->EventPosition[0];
460 this->LastEventPosition[1] = this->EventPosition[1];
461 this->EventPosition[0] = x;
462 this->EventPosition[1] = y;
465 <<
"): setting EventPosition to (" << x <<
"," << y <<
") for pointerIndex number " << pointerIndex);
466 if (this->EventPositions[pointerIndex][0] != x || this->EventPositions[pointerIndex][1] != y ||
467 this->LastEventPositions[pointerIndex][0] != x || this->LastEventPositions[pointerIndex][1] != y)
469 this->LastEventPositions[pointerIndex][0] = this->EventPositions[pointerIndex][0];
470 this->LastEventPositions[pointerIndex][1] = this->EventPositions[pointerIndex][1];
471 this->EventPositions[pointerIndex][0] = x;
472 this->EventPositions[pointerIndex][1] = y;
478 this->SetEventPosition(pos[0], pos[1], pointerIndex);
482 this->SetEventPosition(x, this->Size[1] - y - 1, pointerIndex);
486 this->SetEventPositionFlipY(pos[0], pos[1], pointerIndex);
494 vtkGetMacro(AltKey,
int);
502 vtkGetMacro(ControlKey,
int);
510 vtkGetMacro(ShiftKey,
int);
518 vtkGetMacro(KeyCode,
char);
527 vtkGetMacro(RepeatCount,
int);
537 vtkSetStringMacro(KeySym);
546 vtkGetMacro(PointerIndex,
int);
553 void SetRotation(
double val);
554 vtkGetMacro(Rotation,
double);
555 vtkGetMacro(LastRotation,
double);
562 void SetScale(
double val);
563 vtkGetMacro(Scale,
double);
564 vtkGetMacro(LastScale,
double);
571 void SetTranslation(
double val[2]);
572 vtkGetVector2Macro(Translation,
double);
573 vtkGetVector2Macro(LastTranslation,
double);
589 this->SetEventPosition(x,y,pointerIndex);
590 this->ControlKey = ctrl;
591 this->ShiftKey = shift;
592 this->KeyCode = keycode;
593 this->RepeatCount = repeatcount;
594 this->PointerIndex = pointerIndex;
597 this->SetKeySym(keysym);
602 int ctrl=0,
int shift=0,
605 const char* keysym=0)
607 this->SetEventInformation(x,y,ctrl,shift,keycode,repeatcount,keysym,0);
623 this->SetEventInformation(x,
624 this->Size[1] - y - 1,
633 int ctrl=0,
int shift=0,
636 const char* keysym=0)
638 this->SetEventInformationFlipY(x,y,ctrl,shift,keycode,repeatcount,keysym,0);
650 const char* keysym=0)
652 this->ControlKey = ctrl;
653 this->ShiftKey = shift;
654 this->KeyCode = keycode;
655 this->RepeatCount = repeatcount;
658 this->SetKeySym(keysym);
676 vtkSetVector2Macro(Size,
int);
677 vtkGetVector2Macro(Size,
int);
678 vtkSetVector2Macro(EventSize,
int);
679 vtkGetVector2Macro(EventSize,
int);
708 vtkGetMacro(UseTDx,
bool);
717 virtual void MouseMoveEvent();
718 virtual void RightButtonPressEvent();
719 virtual void RightButtonReleaseEvent();
720 virtual void LeftButtonPressEvent();
721 virtual void LeftButtonReleaseEvent();
722 virtual void MiddleButtonPressEvent();
723 virtual void MiddleButtonReleaseEvent();
724 virtual void MouseWheelForwardEvent();
725 virtual void MouseWheelBackwardEvent();
726 virtual void ExposeEvent();
727 virtual void ConfigureEvent();
728 virtual void EnterEvent();
729 virtual void LeaveEvent();
730 virtual void KeyPressEvent();
731 virtual void KeyReleaseEvent();
732 virtual void CharEvent();
733 virtual void ExitEvent();
741 virtual void StartPinchEvent();
742 virtual void PinchEvent();
743 virtual void EndPinchEvent();
744 virtual void StartRotateEvent();
745 virtual void RotateEvent();
746 virtual void EndRotateEvent();
747 virtual void StartPanEvent();
748 virtual void PanEvent();
749 virtual void EndPanEvent();
750 virtual void TapEvent();
751 virtual void LongTapEvent();
752 virtual void SwipeEvent();
763 vtkGetMacro(RecognizeGestures,
bool);
772 vtkGetMacro(PointersDownCount,
int);
783 void ClearContact(
size_t contactID);
784 int GetPointerIndexForContact(
size_t contactID);
785 int GetPointerIndexForExistingContact(
size_t contactID);
786 bool IsPointerIndexSet(
int i);
787 void ClearPointerIndex(
int i);
825 double Translation[2];
826 double LastTranslation[2];
829 int EventPosition[2];
830 int LastEventPosition[2];
868 friend struct vtkTimerStruct;
878 virtual int InternalCreateTimer(
int timerId,
int timerType,
unsigned long duration);
879 virtual int InternalDestroyTimer(
int platformTimerId);
880 int GetCurrentTimerId();
900 virtual void RecognizeGesture(vtkCommand::EventIds);