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);
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 
vtkInteractorEventRecorder::InputStream
istream * InputStream
Definition: vtkInteractorEventRecorder.h:106
vtkInteractorEventRecorder
record and play VTK events passing through a vtkRenderWindowInteractor
Definition: vtkInteractorEventRecorder.h:47
vtkInteractorEventRecorder::ProcessDeleteEvent
static void ProcessDeleteEvent(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkInteractorEventRecorder::InputString
char * InputString
Definition: vtkInteractorEventRecorder.h:103
vtkInteractorEventRecorder::WidgetState
WidgetState
Definition: vtkInteractorEventRecorder.h:126
vtkInteractorEventRecorder::FileName
char * FileName
Definition: vtkInteractorEventRecorder.h:96
vtkInteractorEventRecorder::StreamVersion
static float StreamVersion
Definition: vtkInteractorEventRecorder.h:133
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkInteractorEventRecorder::State
int State
Definition: vtkInteractorEventRecorder.h:124
vtkInteractorEventRecorder::vtkInteractorEventRecorder
vtkInteractorEventRecorder()
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:62
vtkgl::event
struct _cl_event * event
Definition: vtkgl.h:14387
vtkInteractorEventRecorder::SetEnabled
virtual void SetEnabled(int)
vtkInteractorEventRecorder::Playing
@ Playing
Definition: vtkInteractorEventRecorder.h:128
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInteractorEventRecorder::ProcessEvents
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkRenderingCoreModule.h
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkInteractorEventRecorder::SetInteractor
virtual void SetInteractor(vtkRenderWindowInteractor *iren)
vtkInteractorEventRecorder::DeleteEventCallbackCommand
vtkCallbackCommand * DeleteEventCallbackCommand
Definition: vtkInteractorEventRecorder.h:99
vtkInteractorEventRecorder::Play
void Play()
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:80
vtkInteractorEventRecorder::ProcessCharEvent
static void ProcessCharEvent(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInteractorEventRecorder::OutputStream
ostream * OutputStream
Definition: vtkInteractorEventRecorder.h:107
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkInteractorEventRecorder::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkInteractorEventRecorder::Stop
void Stop()
vtkInteractorEventRecorder::Record
void Record()
vtkInteractorEventRecorder::Rewind
void Rewind()
vtkInteractorEventRecorder::WriteEvent
virtual void WriteEvent(const char *event, int pos[2], int ctrlKey, int shiftKey, int keyCode, int repeatCount, char *keySym)
vtkInteractorObserver.h
vtkInteractorEventRecorder::~vtkInteractorEventRecorder
~vtkInteractorEventRecorder()
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
VTKRENDERINGCORE_EXPORT
#define VTKRENDERINGCORE_EXPORT
Definition: vtkRenderingCoreModule.h:15
vtkInteractorEventRecorder::ReadFromInputString
int ReadFromInputString
Definition: vtkInteractorEventRecorder.h:102
vtkX3D::shiftKey
@ shiftKey
Definition: vtkX3D.h:474
vtkInteractorEventRecorder::ReadEvent
virtual void ReadEvent()
vtkInteractorEventRecorder::New
static vtkInteractorEventRecorder * New()