Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SVTK_Recorder.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, 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 
29 class vtkRenderWindow;
30 class vtkCallbackCommand;
31 class vtkWindowToImageFilter;
33 
34 class 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*
51  RenderWindow();
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 
101 protected :
102  SVTK_Recorder();
103 
104  ~SVTK_Recorder();
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 
125 protected :
126  int myState;
127  int myPaused;
129 
130  float myPriority;
131  double myTimeStart;
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 
152 private:
153  SVTK_Recorder(const SVTK_Recorder&); //Not implemented
154  void operator=(const SVTK_Recorder&); //Not implemented
155 };
156 
157 #endif