RobinTrace
lseq_part.h
Go to the documentation of this file.
1 
2 #ifndef LSEQ_PART_H
3 #define LSEQ_PART_H
4 
5 #include <memory>
6 #include "ray_pack.h"
7 #include "pinyo.h"
8 
9 #include "type_map/type_map.h"
10 
16 
19 class lseq_part {
20  public:
22  std::unique_ptr<lpart> part;
25 
27  bool save_rays;
28 
30  template <typename T>
31  lseq_part (const T &part) {
32  static_assert(std::is_base_of<lpart, T>::value,
33  "T must be derived from lpart.");
34  this->part = part.clone();
35  save_rays = false;
36  }
37 
41  void trace (ray_pack &ray_buns);
43  void compute_semi_diameter ();
46  ray_pack rays_to_global (const ray_pack &local_rays);
50  void compute_global_rays ();
58  //std::vector<Vec3> query_surface_points (const point_sampling query_points);
59 };
60 
61 #endif // LSEQ_PART_H
62 
A part in a lseq. It contains both data and methods relative to a single part.
Definition: lseq_part.h:19
void compute_semi_diameter()
Compute the part semi-diameter from the saved ray states.
Definition: lseq_part.cpp:13
bool save_rays
Whether to save ray states when tracing.
Definition: lseq_part.h:27
void trace(ray_pack &ray_buns)
Apply raytracing of the part to a ray_pack.
Definition: lseq_part.cpp:3
std::unique_ptr< lpart > part
A copy of the underlying lpart.
Definition: lseq_part.h:22
lseq_part(const T &part)
Constructor.
Definition: lseq_part.h:31
void compute_propagation_direction()
Compute the lseq_part_propagation_direction.
Definition: lseq_part.cpp:51
ray_pack rays_to_global(const ray_pack &local_rays)
Convert a ray_pack in the part's LCS to a ray_pack in global coordinates.
Definition: lseq_part.cpp:28
type_map< lseq_part_result > results
Results table.
Definition: lseq_part.h:24
void compute_global_rays()
Convert the lseq_part_rays to lseq_part_global_rays.
Definition: lseq_part.cpp:45
std::vector< bun > ray_pack
Vector of ray bundles.
Definition: ray_pack.h:12