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  //listens to delete events
100 
101  // control whether to read from string
103  char *InputString;
104 
105  // for reading and writing
106  istream *InputStream;
107  ostream *OutputStream;
108 
109  //methods for processing events
110  static void ProcessCharEvent(vtkObject* object, unsigned long event,
111  void* clientdata, void* calldata);
112  static void ProcessDeleteEvent(vtkObject* object, unsigned long event,
113  void* clientdata, void* calldata);
114  static void ProcessEvents(vtkObject* object, unsigned long event,
115  void* clientdata, void* calldata);
116 
117  virtual void WriteEvent(const char* event, int pos[2], int ctrlKey,
118  int shiftKey, int keyCode, int repeatCount,
119  char* keySym);
120 
121  virtual void ReadEvent();
122 
123 //BTX - manage the state of the recorder
124  int State;
126  {
127  Start=0,
129  Recording
130  };
131 //ETX
132 
133  static float StreamVersion;
134 
135 private:
136  vtkInteractorEventRecorder(const vtkInteractorEventRecorder&); // Not implemented.
137  void operator=(const vtkInteractorEventRecorder&); // Not implemented.
138 
139 };
140 
141 #endif /* vtkInteractorEventRecorder_h */
142 
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)
virtual void SetEnabled(int)
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
platform-independent render window interaction including picking and frame rate control.
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkCallbackCommand * DeleteEventCallbackCommand
record and play VTK events passing through a vtkRenderWindowInteractor
#define VTKRENDERINGCORE_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()