The spica renderer
scene.h
1 #ifdef _MSC_VER
2 #pragma once
3 #endif
4 
5 #ifndef _SPICA_SCENE_H_
6 #define _SPICA_SCENE_H_
7 
8 #include <vector>
9 #include <memory>
10 
11 #include "core/core.hpp"
12 #include "core/common.h"
13 
14 #include "core/bounds3d.h"
15 #include "core/light.h"
16 #include "core/accelerator.h"
17 
18 namespace spica {
19 
23 class SPICA_EXPORTS Scene : private Uncopyable {
24 public:
25  Scene();
26  Scene(const std::shared_ptr<Accelerator>& aggregate,
27  const std::vector<std::shared_ptr<Light> >& lights);
28  Scene(Scene&& scene);
29 
30  virtual ~Scene();
31 
32  Scene& operator=(Scene&& scene);
33 
34  bool intersect(Ray& ray, SurfaceInteraction* isect) const;
35  bool intersect(Ray& ray) const;
36  bool intersectTr(Ray& ray, Sampler& sampler, SurfaceInteraction* isect,
37  Spectrum* tr) const;
38 
39  inline const Bounds3d& worldBound() const { return worldBound_; }
40  inline const std::vector<std::shared_ptr<Primitive>>& primitives() const {
41  return aggregate_->primitives();
42  }
43  inline const std::vector<std::shared_ptr<Light> >& lights() const {
44  return lights_;
45  }
46 
47 private:
48  std::shared_ptr<Accelerator> aggregate_;
49  std::vector<std::shared_ptr<Light> > lights_;
50  Bounds3d worldBound_;
51 
52 }; // class Scene
53 
54 } // namespace spica
55 
56 #endif // _SPICA_SCENE_H_
Definition: interaction.h:68
Random sampler class.
Definition: sampler.h:24
RGB spectrum.
Definition: spectrum.h:18
Ray class.
Definition: ray.h:24
Interface class which forbids copy and assignment.
Definition: uncopyable.h:15
Scene provides the interface for scene graph.
Definition: scene.h:23