Wayverb
tree.h
1 #pragma once
2 
4 #include "raytracer/multitree.h"
5 
6 #include "core/cl/include.h"
7 #include "core/geo/triangle_vec.h"
8 #include "core/spatial_division/voxelised_scene_data.h"
9 
10 #include "utilities/aligned/vector.h"
11 
12 namespace wayverb {
13 namespace raytracer {
14 namespace image_source {
15 
18 struct path_element final {
19  cl_uint index;
20  bool visible;
21 };
22 
23 constexpr auto to_tuple(const path_element& x) {
24  return std::tie(x.index, x.visible);
25 }
26 
27 constexpr bool operator==(const path_element& a, const path_element& b) {
28  return to_tuple(a) == to_tuple(b);
29 }
30 
31 constexpr bool operator!=(const path_element& a, const path_element& b) {
32  return !(a == b);
33 }
34 
36 constexpr bool operator<(const path_element& a, const path_element& b) {
37  return a.index < b.index;
38 }
39 
41 
42 class tree final {
43 public:
44  void push(const util::aligned::vector<path_element>& path);
45  const multitree<path_element>::branches_type& get_branches() const;
46 
47 private:
49 };
50 
51 using postprocessor = std::function<void(
52  const glm::vec3&,
53  util::aligned::vector<reflection_metadata>::const_iterator,
54  util::aligned::vector<reflection_metadata>::const_iterator)>;
55 
56 void find_valid_paths(
58  const glm::vec3& source,
59  const glm::vec3& receiver,
60  const core::voxelised_scene_data<cl_float3,
62  voxelised,
63  const postprocessor& callback);
64 
65 } // namespace image_source
66 } // namespace raytracer
67 } // namespace wayverb
Definition: pressure.h:22
Definition: capsule_base.h:9
Definition: multitree.h:13
Definition: recursive_vector.h:225
Definition: voxelised_scene_data.h:14