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();
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};
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]);}
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);
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)
#define vtkGetMacro(name, type)
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)
#define vtkSetClampMacro(name, type, min, max)
virtual int * GetLastEventPositions(int pointerIndex)
#define vtkSetStringMacro(name)
#define vtkTypeMacro(thisClass, superclass)
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
const char * GetClassName() const
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
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
#define vtkGetStringMacro(name)
virtual void SetEventPosition(int x, int y)
#define vtkGetObjectMacro(name, type)
virtual void SetEventPositionFlipY(int x, int y, int pointerIndex)
abstract API for pickers that can pick an instance of vtkProp
#define vtkGetVector2Macro(name, type)
create a window for renderers to draw into
#define VTKRENDERINGCORE_EXPORT
#define VTKI_MAX_POINTERS
vtkAbstractPicker * Picker
define API for picking subclasses
#define vtkBooleanMacro(name, type)
vtkPickingManager * PickingManager
void FlyToImage(vtkRenderer *ren, double *x)
#define vtkSetVector2Macro(name, type)
#define vtkSetMacro(name, type)
virtual void SetEventPositionFlipY(int x, int y)