SPH
Movie.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 #include "common/Globals.h"
9 #include "gui/Settings.h"
11 #include "io/Output.h"
12 #include <condition_variable>
13 
15 
16 class IRenderer;
17 
22 class Movie : public Noncopyable {
23 private:
25  Float outputStep;
26  Float nextOutput;
27 
29  OutputFile paths;
30 
32  Path animationPath;
33 
35  bool enabled;
36 
38  bool makeAnimation;
39 
41  AutoPtr<IRenderer> renderer;
42 
44  Array<AutoPtr<IColorizer>> colorizers;
45 
46  RenderParams params;
47 
48  Vector cameraVelocity;
49  Float cameraOrbit;
50 
51  Float lastFrame = 0._f;
52 
53 public:
54  Movie(const GuiSettings& settings,
55  AutoPtr<IRenderer>&& renderer,
56  Array<AutoPtr<IColorizer>>&& colorizers,
57  RenderParams&& params);
58 
59  ~Movie();
60 
68  void onTimeStep(const Storage& storage, Statistics& stats);
69 
71  void save(const Storage& storage, Statistics& stats);
72 
73  void setCamera(AutoPtr<ICamera>&& camera);
74 
76  void finalize();
77 
78  void setEnabled(const bool enable = true);
79 };
80 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Global parameters of the code.
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Definition: Globals.h:13
Interface for renderers.
#define NAMESPACE_SPH_END
Definition: Object.h:12
Saving and loading particle data.
Generic dynamically allocated resizable storage.
Definition: Array.h:43
Interface used to implement renderers.
Definition: IRenderer.h:166
Object managing periodic rendering of images and saving them to given paths.
Definition: Movie.h:22
Movie(const GuiSettings &settings, AutoPtr< IRenderer > &&renderer, Array< AutoPtr< IColorizer >> &&colorizers, RenderParams &&params)
Definition: Movie.cpp:22
void onTimeStep(const Storage &storage, Statistics &stats)
Called every time step, saves the images every IMAGES_TIMESTEP.
Definition: Movie.cpp:103
void save(const Storage &storage, Statistics &stats)
Manually saves the images.
Definition: Movie.cpp:112
void setEnabled(const bool enable=true)
Definition: Movie.cpp:187
void finalize()
Creates the animations from generated images.
Definition: Movie.cpp:161
void setCamera(AutoPtr< ICamera > &&camera)
Definition: Movie.cpp:157
Helper file generating file names for output files.
Definition: Output.h:21
Object representing a path on a filesystem.
Definition: Path.h:17
Object holding various statistics about current run.
Definition: Statistics.h:22
Container storing all quantities used within the simulations.
Definition: Storage.h:230
Object with deleted copy constructor and copy operator.
Definition: Object.h:54
Parameters of the rendered image.
Definition: IRenderer.h:60