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
94 virtual void Initialize();
106 virtual void Start();
124 vtkBooleanMacro(EnableRender,
bool);
125 vtkSetMacro(EnableRender,
bool);
126 vtkGetMacro(EnableRender,
bool);
137 virtual void UpdateSize(
int x,
int y);
155 virtual int CreateTimer(
int timerType);
156 virtual int DestroyTimer();
161 int CreateRepeatingTimer(
unsigned long duration);
165 int CreateOneShotTimer(
unsigned long duration);
169 int IsOneShotTimer(
int timerId);
172 unsigned long GetTimerDuration(
int timerId);
175 int ResetTimer(
int timerId);
179 int DestroyTimer(
int timerId);
182 virtual int GetVTKTimerId(
int platformTimerId);
187 enum {OneShotTimer=1,RepeatingTimer};
198 vtkSetClampMacro(TimerDuration,
unsigned long,1,100000);
199 vtkGetMacro(TimerDuration,
unsigned long);
213 vtkSetMacro(TimerEventId,
int);
214 vtkGetMacro(TimerEventId,
int);
215 vtkSetMacro(TimerEventType,
int);
216 vtkGetMacro(TimerEventType,
int);
217 vtkSetMacro(TimerEventDuration,
int);
218 vtkGetMacro(TimerEventDuration,
int);
219 vtkSetMacro(TimerEventPlatformId,
int);
220 vtkGetMacro(TimerEventPlatformId,
int);
238 vtkSetMacro(LightFollowCamera,
int);
239 vtkGetMacro(LightFollowCamera,
int);
240 vtkBooleanMacro(LightFollowCamera,
int);
249 vtkSetClampMacro(DesiredUpdateRate,
double,0.0001,
VTK_FLOAT_MAX);
250 vtkGetMacro(DesiredUpdateRate,
double);
257 vtkSetClampMacro(StillUpdateRate,
double,0.0001,
VTK_FLOAT_MAX);
258 vtkGetMacro(StillUpdateRate,
double);
263 vtkGetMacro(Initialized,
int);
290 virtual void ExitCallback();
291 virtual void UserCallback();
292 virtual void StartPickCallback();
293 virtual void EndPickCallback();
308 virtual void Render();
314 void FlyTo(
vtkRenderer *ren,
double x,
double y,
double z);
316 {this->FlyTo(ren, x[0], x[1], x[2]);}
317 void FlyToImage(
vtkRenderer *ren,
double x,
double y);
319 {this->FlyToImage(ren, x[0], x[1]);}
324 vtkSetClampMacro(NumberOfFlyFrames,
int,1,
VTK_INT_MAX);
325 vtkGetMacro(NumberOfFlyFrames,
int);
331 vtkSetMacro(Dolly,
double);
332 vtkGetMacro(Dolly,
double);
341 vtkGetVector2Macro(EventPosition,
int);
342 vtkGetVector2Macro(LastEventPosition,
int);
343 vtkSetVector2Macro(LastEventPosition,
int);
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);
428 vtkSetMacro(AltKey,
int);
429 vtkGetMacro(AltKey,
int);
434 vtkSetMacro(ControlKey,
int);
435 vtkGetMacro(ControlKey,
int);
440 vtkSetMacro(ShiftKey,
int);
441 vtkGetMacro(ShiftKey,
int);
446 vtkSetMacro(KeyCode,
char);
447 vtkGetMacro(KeyCode,
char);
453 vtkSetMacro(RepeatCount,
int);
454 vtkGetMacro(RepeatCount,
int);
463 vtkSetStringMacro(KeySym);
464 vtkGetStringMacro(KeySym);
469 vtkSetMacro(PointerIndex,
int);
470 vtkGetMacro(PointerIndex,
int);
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);
563 vtkSetVector2Macro(Size,
int);
564 vtkGetVector2Macro(Size,
int);
565 vtkSetVector2Macro(EventSize,
int);
566 vtkGetVector2Macro(EventSize,
int);
588 vtkSetMacro(UseTDx,
bool);
589 vtkGetMacro(UseTDx,
bool);
596 virtual void MouseMoveEvent();
597 virtual void RightButtonPressEvent();
598 virtual void RightButtonReleaseEvent();
599 virtual void LeftButtonPressEvent();
600 virtual void LeftButtonReleaseEvent();
601 virtual void MiddleButtonPressEvent();
602 virtual void MiddleButtonReleaseEvent();
603 virtual void MouseWheelForwardEvent();
604 virtual void MouseWheelBackwardEvent();
605 virtual void ExposeEvent();
606 virtual void ConfigureEvent();
607 virtual void EnterEvent();
608 virtual void LeaveEvent();
609 virtual void KeyPressEvent();
610 virtual void KeyReleaseEvent();
611 virtual void CharEvent();
612 virtual void ExitEvent();
646 int EventPosition[2];
647 int LastEventPosition[2];
686 friend struct vtkTimerStruct;
694 virtual int InternalCreateTimer(
int timerId,
int timerType,
unsigned long duration);
695 virtual int InternalDestroyTimer(
int platformTimerId);
696 int GetCurrentTimerId();
virtual void SetEventPositionFlipY(int pos[2])
virtual void GetMousePosition(int *x, int *y)
abstract base class for most VTK objects
unsigned long TimerDuration
void SetEventInformation(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0)
void SetEventInformationFlipY(int x, int y, int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0)
void SetEventInformation(int x, int y, int ctrl, int shift, char keycode, int repeatcount, const char *keysym, int pointerIndex)
virtual void SetEventPosition(int pos[2], int pointerIndex)
virtual void SetRenderWindow(vtkRenderWindow *renwin)
vtkInteractorObserver * InteractorStyle
virtual void SetEventPositionFlipY(int pos[2], int pointerIndex)
abstract specification for renderers
vtkRenderWindow * RenderWindow
void SetKeyEventInformation(int ctrl=0, int shift=0, char keycode=0, int repeatcount=0, const char *keysym=0)
virtual int * GetLastEventPositions(int pointerIndex)
virtual void SetEventPosition(int pos[2])
void GrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
virtual int * GetEventPositions(int pointerIndex)
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
void FlyTo(vtkRenderer *ren, double *x)
platform-independent render window interaction including picking and frame rate control.
void InternalReleaseFocus()
void InternalGrabFocus(vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
superclass for callback/observer methods
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual void UnRegister(vtkObjectBase *o)
a list of nodes that form an assembly path
vtkObserverMediator * ObserverMediator
a simple class to control print indentation
const char * GetClassName() const
virtual void StartEventLoop()
virtual void TerminateApp(void)
void SetEventInformationFlipY(int x, int y, int ctrl, int shift, char keycode, int repeatcount, const char *keysym, int pointerIndex)
record and play VTK events passing through a vtkRenderWindowInteractor
virtual void SetEventPosition(int x, int y, int pointerIndex)
abstract base class for most VTK objects
virtual void SetEventPosition(int x, int y)
vtkWeakPointer< vtkRenderWindow > RenderWindow
virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
abstract API for pickers that can pick an instance of vtkProp
create a window for renderers to draw into
#define VTKRENDERINGCORE_EXPORT
#define VTKI_MAX_POINTERS
vtkAbstractPicker * Picker
define API for picking subclasses
vtkPickingManager * PickingManager
void FlyToImage(vtkRenderer *ren, double *x)
virtual void SetEventPositionFlipY(int x, int y)