Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
sched.h
1 /*
2  Lightmetrica : A research-oriented renderer
3 
4  Copyright (c) 2014 Hisanari Otsu
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 #ifndef LIB_LIGHTMETRICA_RENDER_SCHED_H
22 #define LIB_LIGHTMETRICA_RENDER_SCHED_H
23 
24 #include "component.h"
25 #include <boost/signals2.hpp>
26 
27 LM_NAMESPACE_BEGIN
28 
33 enum class TerminationMode
34 {
35  Samples,
36  Time,
37 };
38 
39 // --------------------------------------------------------------------------------
40 
41 class ConfigNode;
42 class Assets;
43 class Renderer;
44 class Scene;
45 
53 {
54 public:
55 
56  LM_COMPONENT_INTERFACE_DEF("rendersched");
57 
58 public:
59 
61  virtual ~RenderProcessScheduler() {}
62 
63 private:
64 
65  LM_DISABLE_COPY_AND_MOVE(RenderProcessScheduler);
66 
67 public:
68 
77  virtual bool Configure(const ConfigNode& node, const Assets& assets) = 0;
78 
85  virtual void SetTerminationMode(TerminationMode mode, double time) = 0;
86 
94  virtual bool Render(Renderer& renderer, const Scene& scene) const = 0;
95 
101  virtual boost::signals2::connection Connect_ReportProgress(const std::function<void (double, bool)>& func) = 0;
102 
103 };
104 
105 // --------------------------------------------------------------------------------
106 
112 {
113 public:
114 
116  virtual ~SamplingBasedRenderProcessScheduler() override {}
117 
118 public:
119 
125  virtual long long NumSamples() const = 0;
126 
127 };
128 
129 LM_NAMESPACE_END
130 
131 #endif // LIB_LIGHTMETRICA_RENDER_SCHED_H
Definition: component.h:45
Definition: renderer.h:39
virtual void SetTerminationMode(TerminationMode mode, double time)=0
virtual boost::signals2::connection Connect_ReportProgress(const std::function< void(double, bool)> &func)=0
virtual long long NumSamples() const =0
Definition: scene.h:47
Definition: assets.h:39
virtual bool Render(Renderer &renderer, const Scene &scene) const =0
virtual bool Configure(const ConfigNode &node, const Assets &assets)=0
Definition: confignode.h:37
Definition: sched.h:52