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
41 #include "vtkInteractorObserver.h"
42 
43 // The superclass that all commands should be subclasses of
44 class VTKRENDERINGCORE_EXPORT vtkInteractorEventRecorder : public vtkInteractorObserver
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
51  // Satisfy the superclass API. Enable/disable listening for events.
52  virtual void SetEnabled(int);
53  virtual void SetInteractor(vtkRenderWindowInteractor* iren);
54 
56 
59  vtkSetStringMacro(FileName);
60  vtkGetStringMacro(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 
103 protected:
106 
107  // file to read/write from
108  char *FileName;
109 
110  //listens to delete events
112 
113  // control whether to read from string
115  char *InputString;
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 
146 private:
147  vtkInteractorEventRecorder(const vtkInteractorEventRecorder&) VTK_DELETE_FUNCTION;
148  void operator=(const vtkInteractorEventRecorder&) VTK_DELETE_FUNCTION;
149 
150 };
151 
152 #endif /* vtkInteractorEventRecorder_h */
153 
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
This method is used to associate the widget with the render window interactor.
abstract base class for most VTK objects
Definition: vtkObject.h:59
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
Handles the char widget activation event.
virtual void SetEnabled(int)
Methods for turning the interactor observer on and off, and determining its state.
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:39
vtkCallbackCommand * DeleteEventCallbackCommand
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
record and play VTK events passing through a vtkRenderWindowInteractor
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...