VTK
vtkInteractorEventRecorder.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkInteractorEventRecorder.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
37#ifndef vtkInteractorEventRecorder_h
38#define vtkInteractorEventRecorder_h
39
40#include "vtkRenderingCoreModule.h" // For export macro
42
43// The superclass that all commands should be subclasses of
44class VTKRENDERINGCORE_EXPORT vtkInteractorEventRecorder : public vtkInteractorObserver
45{
46public:
49 void PrintSelf(ostream& os, vtkIndent indent);
50
51 // Satisfy the superclass API. Enable/disable listening for events.
52 virtual void SetEnabled(int);
54
56
59 vtkSetStringMacro(FileName);
62
67 void Record();
68
73 void Play();
74
78 void Stop();
79
83 void Rewind();
84
86
90 vtkSetMacro(ReadFromInputString,int);
91 vtkGetMacro(ReadFromInputString,int);
92 vtkBooleanMacro(ReadFromInputString,int);
94
96
99 vtkSetStringMacro(InputString);
100 vtkGetStringMacro(InputString);
102
103protected:
106
107 // file to read/write from
108 char *FileName;
109
110 //listens to delete events
112
113 // control whether to read from string
116
117 // for reading and writing
118 istream *InputStream;
119 ostream *OutputStream;
120
121 //methods for processing events
122 static void ProcessCharEvent(vtkObject* object, unsigned long event,
123 void* clientdata, void* calldata);
124 static void ProcessDeleteEvent(vtkObject* object, unsigned long event,
125 void* clientdata, void* calldata);
126 static void ProcessEvents(vtkObject* object, unsigned long event,
127 void* clientdata, void* calldata);
128
129 virtual void WriteEvent(const char* event, int pos[2], int ctrlKey,
130 int shiftKey, int keyCode, int repeatCount,
131 char* keySym);
132
133 virtual void ReadEvent();
134
135 // Manage the state of the recorder
136 int State;
138 {
139 Start=0,
141 Recording
142 };
143
144 static float StreamVersion;
145
146private:
147 vtkInteractorEventRecorder(const vtkInteractorEventRecorder&) VTK_DELETE_FUNCTION;
148 void operator=(const vtkInteractorEventRecorder&) VTK_DELETE_FUNCTION;
149
150};
151
152#endif /* vtkInteractorEventRecorder_h */
153
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:40
record and play VTK events passing through a vtkRenderWindowInteractor
virtual void WriteEvent(const char *event, int pos[2], int ctrlKey, int shiftKey, int keyCode, int repeatCount, char *keySym)
void Record()
Invoke this method to begin recording events.
virtual void SetEnabled(int)
Methods for turning the interactor observer on and off, and determining its state.
static void ProcessCharEvent(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
void Rewind()
Rewind to the beginning of the file.
void Play()
Invoke this method to begin playing events from the current position.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
This method is used to associate the widget with the render window interactor.
void Stop()
Invoke this method to stop recording/playing events.
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
static void ProcessDeleteEvent(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkCallbackCommand * DeleteEventCallbackCommand
static vtkInteractorEventRecorder * New()
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
abstract base class for most VTK objects
Definition: vtkObject.h:60
platform-independent render window interaction including picking and frame rate control.
@ shiftKey
Definition: vtkX3D.h:474
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.