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 =========================================================================*/
39 #ifndef vtkInteractorEventRecorder_h
40 #define vtkInteractorEventRecorder_h
41 
42 #include "vtkRenderingCoreModule.h" // For export macro
43 #include "vtkInteractorObserver.h"
44 
45 // The superclass that all commands should be subclasses of
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
53  // Satisfy the superclass API. Enable/disable listening for events.
54  virtual void SetEnabled(int);
55  virtual void SetInteractor(vtkRenderWindowInteractor* iren);
56 
58 
59  vtkSetStringMacro(FileName);
60  vtkGetStringMacro(FileName);
62 
65  void Record();
66 
69  void Play();
70 
72  void Stop();
73 
75  void Rewind();
76 
78 
80  vtkSetMacro(ReadFromInputString,int);
81  vtkGetMacro(ReadFromInputString,int);
82  vtkBooleanMacro(ReadFromInputString,int);
84 
86 
87  vtkSetStringMacro(InputString);
88  vtkGetStringMacro(InputString);
90 
91 protected:
94 
95  // file to read/write from
96  char *FileName;
97 
98  // control whether to read from string
100  char *InputString;
101 
102  // for reading and writing
103  istream *InputStream;
104  ostream *OutputStream;
105 
106  //methods for processing events
107  static void ProcessCharEvent(vtkObject* object, unsigned long event,
108  void* clientdata, void* calldata);
109  static void ProcessEvents(vtkObject* object, unsigned long event,
110  void* clientdata, void* calldata);
111 
112  virtual void WriteEvent(const char* event, int pos[2], int ctrlKey,
113  int shiftKey, int keyCode, int repeatCount,
114  char* keySym);
115 
116  virtual void ReadEvent();
117 
118 //BTX - manage the state of the recorder
119  int State;
121  {
122  Start=0,
124  Recording
125  };
126 //ETX
127 
128  static float StreamVersion;
129 
130 private:
131  vtkInteractorEventRecorder(const vtkInteractorEventRecorder&); // Not implemented.
132  void operator=(const vtkInteractorEventRecorder&); // Not implemented.
133 
134 };
135 
136 #endif /* vtkInteractorEventRecorder_h */
137 
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
abstract base class for most VTK objects
Definition: vtkObject.h:61
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
virtual void SetEnabled(int)
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:94
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
platform-independent render window interaction including picking and frame rate control.
struct _cl_event * event
Definition: vtkgl.h:14387
a simple class to control print indentation
Definition: vtkIndent.h:38
record and play VTK events passing through a vtkRenderWindowInteractor
#define vtkGetStringMacro(name)
Definition: vtkSetGet.h:120
#define VTKRENDERINGCORE_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
static vtkObject * New()
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69