00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00039
#ifndef __vtkInteractorEventRecorder_h
00040
#define __vtkInteractorEventRecorder_h
00041
00042
#include "vtkInteractorObserver.h"
00043
00044
00045 class VTK_RENDERING_EXPORT vtkInteractorEventRecorder :
public vtkInteractorObserver
00046 {
00047
public:
00048
static vtkInteractorEventRecorder *
New();
00049 vtkTypeRevisionMacro(vtkInteractorEventRecorder,
vtkInteractorObserver);
00050
void PrintSelf(ostream& os,
vtkIndent indent);
00051
00052
00053
virtual void SetEnabled(
int);
00054
virtual void SetInteractor(
vtkRenderWindowInteractor* iren);
00055
00057
00058 vtkSetStringMacro(FileName);
00059 vtkGetStringMacro(FileName);
00061
00064
void Record();
00065
00068
void Play();
00069
00071
void Stop();
00072
00074
void Rewind();
00075
00077
00079 vtkSetMacro(ReadFromInputString,
int);
00080 vtkGetMacro(ReadFromInputString,
int);
00081 vtkBooleanMacro(ReadFromInputString,
int);
00083
00085
00086 vtkSetStringMacro(InputString);
00087 vtkGetStringMacro(InputString);
00089
00090
protected:
00091 vtkInteractorEventRecorder();
00092 ~vtkInteractorEventRecorder();
00093
00094
00095 char *FileName;
00096
00097
00098 int ReadFromInputString;
00099 char *InputString;
00100
00101
00102 istream *InputStream;
00103 ostream *OutputStream;
00104
00105
00106
static void ProcessCharEvent(
vtkObject* object,
unsigned long event,
00107
void* clientdata,
void* calldata);
00108
static void ProcessEvents(
vtkObject* object,
unsigned long event,
00109
void* clientdata,
void* calldata);
00110
00111
virtual void WriteEvent(
const char* event,
int pos[2],
int ctrlKey,
00112
int shiftKey,
int keyCode,
int repeatCount,
00113
char* keySym);
00114
00115
virtual void ReadEvent();
00116
00117
00118 int State;
00119 enum WidgetState
00120 {
00121 Start=0,
00122 Playing,
00123 Recording
00124 };
00125
00126
00127 static float StreamVersion;
00128
00129
private:
00130 vtkInteractorEventRecorder(
const vtkInteractorEventRecorder&);
00131
void operator=(
const vtkInteractorEventRecorder&);
00132
00133 };
00134
00135
#endif
00136