Wayverb
reflection_path_builder.h
1 #pragma once
2 
3 #include "raytracer/image_source/tree.h"
4 #include "raytracer/iterative_builder.h"
5 
6 namespace wayverb {
7 namespace raytracer {
8 namespace image_source {
9 
11 public:
12  reflection_path_builder(size_t rays)
13  : reflection_path_builder_{rays} {}
14 
15  template <typename It>
16  void push(It b, It e) {
17  reflection_path_builder_.push(b, e, [](const reflection& i) {
18  return i.keep_going
19  ? std::experimental::make_optional(path_element{
20  i.triangle,
21  static_cast<bool>(i.receiver_visible)})
22  : std::experimental::nullopt;
23  });
24  }
25 
26  const auto& get_data() const { return reflection_path_builder_.get_data(); }
27  auto& get_data() { return reflection_path_builder_.get_data(); }
28 
29 private:
30  iterative_builder<path_element> reflection_path_builder_;
31 };
32 
33 } // namespace image_source
34 } // namespace raytracer
35 } // namespace wayverb
Definition: iterative_builder.h:11
Definition: reflection_path_builder.h:10
Definition: pressure.h:22
Definition: capsule_base.h:9
Definition: reflection.h:10