SPH
CameraJobs.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gui/Settings.h"
4 #include "gui/objects/Camera.h"
5 #include "run/Job.h"
6 
8 
9 enum class GuiJobType {
10  CAMERA = 3,
11 };
12 
14 
15 struct CameraData {
18 
20 };
21 
22 class ICameraJob : public IJob {
23 private:
24  SharedPtr<CameraData> result;
25 
26 protected:
28 
29 public:
30  explicit ICameraJob(const std::string& name)
31  : IJob(name) {}
32 
33  virtual Optional<ExtJobType> provides() const override final {
34  return GuiJobType::CAMERA;
35  }
36 
37  virtual JobContext getResult() const override final {
38  return result;
39  }
40 
42  return {};
43  }
44 
45  virtual void evaluate(const RunSettings& global, IRunCallbacks& callbacks) override;
46 };
47 
48 class OrthoCameraJob : public ICameraJob {
49 public:
50  explicit OrthoCameraJob(const std::string& name);
51 
52  virtual std::string className() const override {
53  return "orthographic camera";
54  }
55 
56  virtual VirtualSettings getSettings() override;
57 };
58 
60 public:
61  explicit PerspectiveCameraJob(const std::string& name);
62 
63  virtual std::string className() const override {
64  return "perspective camera";
65  }
66 
67  virtual VirtualSettings getSettings() override;
68 };
69 
70 class FisheyeCameraJob : public ICameraJob {
71 public:
72  explicit FisheyeCameraJob(const std::string& name);
73 
74  virtual std::string className() const override {
75  return "fisheye camera";
76  }
77 
78  virtual VirtualSettings getSettings() override;
79 };
80 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
GuiJobType
Definition: CameraJobs.h:9
SPH_EXTEND_ENUM(GuiJobType, JobType)
Defines projection transforming 3D particles onto 2D screen.
JobType
Definition: Job.h:20
#define NAMESPACE_SPH_END
Definition: Object.h:12
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
Definition: CameraJobs.cpp:123
FisheyeCameraJob(const std::string &name)
Definition: CameraJobs.cpp:118
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
Definition: CameraJobs.h:74
virtual Optional< ExtJobType > provides() const override final
Specifies the type of the job, i.e. what kind of data the job provides.
Definition: CameraJobs.h:33
virtual JobContext getResult() const override final
Returns the result of the job.
Definition: CameraJobs.h:37
GuiSettings gui
Definition: CameraJobs.h:27
ICameraJob(const std::string &name)
Definition: CameraJobs.h:30
virtual UnorderedMap< std::string, ExtJobType > getSlots() const override
Lists all potential inputs of the job.
Definition: CameraJobs.h:41
virtual void evaluate(const RunSettings &global, IRunCallbacks &callbacks) override
Runs the operation provided by the job.
Definition: CameraJobs.cpp:6
Base class for all object performing an operation in a simulation hierarchy.
Definition: Job.h:96
Callbacks executed by the simulation to provide feedback to the user.
Definition: IRun.h:27
Data exchanged by jobs.
Definition: Job.h:52
Wrapper of type value of which may or may not be present.
Definition: Optional.h:23
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
Definition: CameraJobs.h:52
OrthoCameraJob(const std::string &name)
Definition: CameraJobs.cpp:23
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
Definition: CameraJobs.cpp:66
PerspectiveCameraJob(const std::string &name)
Definition: CameraJobs.cpp:89
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
Definition: CameraJobs.cpp:94
virtual std::string className() const override
Name representing the type of the job (e.e. "SPH").
Definition: CameraJobs.h:63
Holds a map of virtual entries, associated with a unique name.
const EmptySettingsTag EMPTY_SETTINGS
Definition: Settings.h:32
GuiSettings overrides
Definition: CameraJobs.h:19
AutoPtr< ITracker > tracker
Definition: CameraJobs.h:17
AutoPtr< ICamera > camera
Definition: CameraJobs.h:16