Version: 9.16.0
SVTK_Recorder.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef SVTK_RECORDER_H
21#define SVTK_RECORDER_H
22
23#include <list>
24#include <string>
25#include <vector>
26
27#include <vtkObject.h>
28
29class vtkRenderWindow;
30class vtkCallbackCommand;
31class vtkWindowToImageFilter;
33
34class SVTK_Recorder : public vtkObject
35{
36 protected:
37 enum State {
41 };
42
43 public:
44 static SVTK_Recorder *New();
46
47 void
48 SetRenderWindow(vtkRenderWindow* theRenderWindow);
49
50 vtkRenderWindow*
52
53 void
54 SetName(const char *theName);
55
56 const char*
57 Name() const;
58
59 void
60 SetNbFPS(const double theNbFPS);
61
62 double
63 NbFPS() const;
64
65 void
66 SetQuality(int theQuality);
67
68 int
69 GetQuality() const;
70
71 void
72 SetProgressiveMode(bool theProgressiveMode);
73
74 bool
75 GetProgressiveMode() const;
76
77 void
78 SetUseSkippedFrames(bool theUseSkippedFrames);
79
80 bool
81 UseSkippedFrames() const;
82
83 void
84 Record();
85
86 void
87 Pause();
88
89 void
90 Stop();
91
92 int
93 State() const;
94
95 int
96 ErrorStatus() const;
97
98 void
100
101protected :
103
105
106 void
107 DoRecord();
108
109 void
110 MakeFileAVI();
111
112 void
114
115 void
116 PreWrite();
117
118 static
119 void
120 ProcessEvents(vtkObject* theObject,
121 unsigned long theEvent,
122 void* theClientData,
123 void* theCallData);
124
125protected :
129
132
135
136 double myNbFPS;
139
140 typedef std::vector<int> TFrameIndexes;
143
144 std::string myName;
145 std::string myNameAVIMaker;
146
147 vtkCallbackCommand *myCommand;
148 vtkRenderWindow *myRenderWindow;
149 vtkWindowToImageFilter *myFilter;
151
152private:
153 SVTK_Recorder(const SVTK_Recorder&); //Not implemented
154 void operator=(const SVTK_Recorder&); //Not implemented
155};
156
157#endif
Definition: SVTK_ImageWriterMgr.h:33
Definition: SVTK_Recorder.h:35
int myPaused
Definition: SVTK_Recorder.h:127
float myPriority
Definition: SVTK_Recorder.h:130
std::string myName
Definition: SVTK_Recorder.h:144
bool UseSkippedFrames() const
Definition: SVTK_Recorder.cxx:212
const char * Name() const
Definition: SVTK_Recorder.cxx:132
void AddSkippedFrames()
Definition: SVTK_Recorder.cxx:406
int myState
Definition: SVTK_Recorder.h:126
double myNbFPS
Definition: SVTK_Recorder.h:136
std::vector< int > TFrameIndexes
Definition: SVTK_Recorder.h:140
~SVTK_Recorder()
Definition: SVTK_Recorder.cxx:96
TFrameIndexes myFrameIndexes
Definition: SVTK_Recorder.h:141
vtkCallbackCommand * myCommand
Definition: SVTK_Recorder.h:147
void MakeFileAVI()
Definition: SVTK_Recorder.cxx:456
vtkTypeMacro(SVTK_Recorder, vtkObject) void SetRenderWindow(vtkRenderWindow *theRenderWindow)
int myFrameIndex
Definition: SVTK_Recorder.h:133
int GetQuality() const
Definition: SVTK_Recorder.cxx:164
void Stop()
Definition: SVTK_Recorder.cxx:278
void SetNbFPS(const double theNbFPS)
Definition: SVTK_Recorder.cxx:141
int ErrorStatus() const
Definition: SVTK_Recorder.cxx:221
SVTK_ImageWriterMgr * myWriterMgr
Definition: SVTK_Recorder.h:150
bool myProgressiveMode
Definition: SVTK_Recorder.h:138
void SetUseSkippedFrames(bool theUseSkippedFrames)
Definition: SVTK_Recorder.cxx:205
void CheckExistAVIMaker()
Definition: SVTK_Recorder.cxx:107
double myTimeStart
Definition: SVTK_Recorder.h:131
void Pause()
Definition: SVTK_Recorder.cxx:305
vtkRenderWindow * myRenderWindow
Definition: SVTK_Recorder.h:148
void PreWrite()
Definition: SVTK_Recorder.cxx:390
static void ProcessEvents(vtkObject *theObject, unsigned long theEvent, void *theClientData, void *theCallData)
Definition: SVTK_Recorder.cxx:237
void operator=(const SVTK_Recorder &)
void Record()
Definition: SVTK_Recorder.cxx:257
SVTK_Recorder(const SVTK_Recorder &)
vtkRenderWindow * RenderWindow()
Definition: SVTK_Recorder.cxx:180
static SVTK_Recorder * New()
void SetName(const char *theName)
Definition: SVTK_Recorder.cxx:126
int myErrorStatus
Definition: SVTK_Recorder.h:128
bool GetProgressiveMode() const
Definition: SVTK_Recorder.cxx:196
bool myUseSkippedFrames
Definition: SVTK_Recorder.h:142
void DoRecord()
Definition: SVTK_Recorder.cxx:330
std::string myNameAVIMaker
Definition: SVTK_Recorder.h:145
void SetProgressiveMode(bool theProgressiveMode)
Definition: SVTK_Recorder.cxx:189
State
Definition: SVTK_Recorder.h:37
@ SVTK_Recorder_Record
Definition: SVTK_Recorder.h:39
@ SVTK_Recorder_Unknown
Definition: SVTK_Recorder.h:38
@ SVTK_Recorder_Stop
Definition: SVTK_Recorder.h:40
int myNbWrittenFrames
Definition: SVTK_Recorder.h:134
void SetQuality(int theQuality)
Definition: SVTK_Recorder.cxx:157
double NbFPS() const
Definition: SVTK_Recorder.cxx:148
vtkWindowToImageFilter * myFilter
Definition: SVTK_Recorder.h:149
int myQuality
Definition: SVTK_Recorder.h:137