53 #ifndef __vtkRenderWindowInteractor_h
54 #define __vtkRenderWindowInteractor_h
61 #define VTKI_TIMER_FIRST 0
62 #define VTKI_TIMER_UPDATE 1
85 virtual void Initialize();
115 vtkBooleanMacro(EnableRender,
bool);
116 vtkSetMacro(EnableRender,
bool);
117 vtkGetMacro(EnableRender,
bool);
128 virtual void UpdateSize(
int x,
int y);
146 virtual int CreateTimer(
int timerType);
147 virtual int DestroyTimer();
152 int CreateRepeatingTimer(
unsigned long duration);
156 int CreateOneShotTimer(
unsigned long duration);
160 int IsOneShotTimer(
int timerId);
163 unsigned long GetTimerDuration(
int timerId);
166 int ResetTimer(
int timerId);
170 int DestroyTimer(
int timerId);
173 virtual int GetVTKTimerId(
int platformTimerId);
178 enum {OneShotTimer=1,RepeatingTimer};
189 vtkSetClampMacro(TimerDuration,
unsigned long,1,100000);
190 vtkGetMacro(TimerDuration,
unsigned long);
204 vtkSetMacro(TimerEventId,
int);
205 vtkGetMacro(TimerEventId,
int);
206 vtkSetMacro(TimerEventType,
int);
207 vtkGetMacro(TimerEventType,
int);
208 vtkSetMacro(TimerEventDuration,
int);
209 vtkGetMacro(TimerEventDuration,
int);
210 vtkSetMacro(TimerEventPlatformId,
int);
211 vtkGetMacro(TimerEventPlatformId,
int);
229 vtkSetMacro(LightFollowCamera,
int);
230 vtkGetMacro(LightFollowCamera,
int);
231 vtkBooleanMacro(LightFollowCamera,
int);
241 vtkGetMacro(DesiredUpdateRate,
double);
249 vtkGetMacro(StillUpdateRate,
double);
254 vtkGetMacro(Initialized,
int);
273 virtual void ExitCallback();
274 virtual void UserCallback();
275 virtual void StartPickCallback();
276 virtual void EndPickCallback();
291 virtual void Render();
297 void FlyTo(
vtkRenderer *ren,
double x,
double y,
double z);
299 {this->
FlyTo(ren, x[0], x[1], x[2]);}
300 void FlyToImage(
vtkRenderer *ren,
double x,
double y);
308 vtkGetMacro(NumberOfFlyFrames,
int);
314 vtkSetMacro(Dolly,
double);
315 vtkGetMacro(Dolly,
double);
324 vtkGetVector2Macro(EventPosition,
int);
325 vtkGetVector2Macro(LastEventPosition,
int);
326 vtkSetVector2Macro(LastEventPosition,
int);
327 virtual void SetEventPosition(
int x,
int y)
330 <<
"): setting EventPosition to (" << x <<
"," << y <<
")");
331 if (this->EventPosition[0] != x || this->EventPosition[1] != y ||
332 this->LastEventPosition[0] != x || this->LastEventPosition[1] != y)
334 this->LastEventPosition[0] = this->EventPosition[0];
335 this->LastEventPosition[1] = this->EventPosition[1];
336 this->EventPosition[0] = x;
337 this->EventPosition[1] = y;
341 virtual void SetEventPosition(
int pos[2])
343 this->SetEventPosition(pos[0], pos[1]);
345 virtual void SetEventPositionFlipY(
int x,
int y)
347 this->SetEventPosition(x, this->Size[1] - y - 1);
349 virtual void SetEventPositionFlipY(
int pos[2])
351 this->SetEventPositionFlipY(pos[0], pos[1]);
357 vtkSetMacro(AltKey,
int);
358 vtkGetMacro(AltKey,
int);
363 vtkSetMacro(ControlKey,
int);
364 vtkGetMacro(ControlKey,
int);
369 vtkSetMacro(ShiftKey,
int);
370 vtkGetMacro(ShiftKey,
int);
375 vtkSetMacro(KeyCode,
char);
376 vtkGetMacro(KeyCode,
char);
382 vtkSetMacro(RepeatCount,
int);
383 vtkGetMacro(RepeatCount,
int);
392 vtkSetStringMacro(KeySym);
393 vtkGetStringMacro(KeySym);
398 void SetEventInformation(
int x,
404 const char* keysym=0)
406 this->LastEventPosition[0] = this->EventPosition[0];
407 this->LastEventPosition[1] = this->EventPosition[1];
408 this->EventPosition[0] = x;
409 this->EventPosition[1] = y;
410 this->ControlKey = ctrl;
411 this->ShiftKey = shift;
412 this->KeyCode = keycode;
413 this->RepeatCount = repeatcount;
416 this->SetKeySym(keysym);
425 void SetEventInformationFlipY(
int x,
431 const char* keysym=0)
433 this->SetEventInformation(x,
434 this->Size[1] - y - 1,
445 void SetKeyEventInformation(
int ctrl=0,
449 const char* keysym=0)
451 this->ControlKey = ctrl;
452 this->ShiftKey = shift;
453 this->KeyCode = keycode;
454 this->RepeatCount = repeatcount;
457 this->SetKeySym(keysym);
471 vtkSetVector2Macro(Size,
int);
472 vtkGetVector2Macro(Size,
int);
473 vtkSetVector2Macro(EventSize,
int);
474 vtkGetVector2Macro(EventSize,
int);
496 vtkSetMacro(UseTDx,
bool);
497 vtkGetMacro(UseTDx,
bool);
504 virtual void MouseMoveEvent();
505 virtual void RightButtonPressEvent();
506 virtual void RightButtonReleaseEvent();
507 virtual void LeftButtonPressEvent();
508 virtual void LeftButtonReleaseEvent();
509 virtual void MiddleButtonPressEvent();
510 virtual void MiddleButtonReleaseEvent();
511 virtual void MouseWheelForwardEvent();
512 virtual void MouseWheelBackwardEvent();
513 virtual void ExposeEvent();
514 virtual void ConfigureEvent();
515 virtual void EnterEvent();
516 virtual void LeaveEvent();
517 virtual void KeyPressEvent();
518 virtual void KeyReleaseEvent();
519 virtual void CharEvent();
520 virtual void ExitEvent();
549 int EventPosition[2];
550 int LastEventPosition[2];
585 friend struct vtkTimerStruct;
593 virtual int InternalCreateTimer(
int timerId,
int timerType,
unsigned long duration);
594 virtual int InternalDestroyTimer(
int platformTimerId);
595 int GetCurrentTimerId();