From 8261116513343f092198ca5a9c48cb1a8a2d18a4 Mon Sep 17 00:00:00 2001 From: "y.zobus" <y.zobus@gsi.de> Date: Thu, 24 Oct 2024 13:21:49 +0000 Subject: [PATCH] * cargo fmt + test fix * cargo fmt * fixed up-direction problem. however, creates new display error for ghost focus, since all history is now plotted again --- opossum/src/properties/property.rs | 6 ++++-- opossum/src/ray.rs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/opossum/src/properties/property.rs b/opossum/src/properties/property.rs index 2e416a1a..8277b59f 100644 --- a/opossum/src/properties/property.rs +++ b/opossum/src/properties/property.rs @@ -195,8 +195,10 @@ impl Property { ghost_hist.plot_view_direction = Some(vector![1.0, 0.0, 0.0]); ghost_hist.to_plot(&file_path, crate::plottable::PltBackEnd::SVG)?; } - Proptype::WaveFrontData(_wf_data) => { - todo!() + Proptype::WaveFrontData(wf_data) => { + let file_path = report_path.join(Path::new(&format!("{id}.png"))); + wf_data.wavefront_error_maps[0] + .to_plot(&file_path, crate::plottable::PltBackEnd::Bitmap)?; } Proptype::HitMap(hit_map) => { let file_path = report_path.join(Path::new(&format!("{id}.svg"))); diff --git a/opossum/src/ray.rs b/opossum/src/ray.rs index 5166cd8f..7fc28160 100644 --- a/opossum/src/ray.rs +++ b/opossum/src/ray.rs @@ -492,7 +492,7 @@ impl Ray { self.dir = refract_dir; self.e = input_energy * (1. - reflectivity); let mut reflected_ray = self.clone(); - reflected_ray.pos_hist.clear(); + // reflected_ray.pos_hist.clear(); reflected_ray.dir = reflected_dir; reflected_ray.e = input_energy * reflectivity; reflected_ray.number_of_bounces += 1; @@ -1069,7 +1069,7 @@ mod test { assert_eq!(reflected_ray.pos, millimeter!(0., 0., 10.)); assert_eq!(reflected_ray.refractive_index, 1.0); assert_eq!(reflected_ray.dir, -1.0 * Vector3::z()); - assert_eq!(reflected_ray.pos_hist, vec![]); + assert_eq!(reflected_ray.pos_hist, vec![millimeter!(0., 0., 0.)]); assert_eq!(reflected_ray.path_length(), plane_z_pos); assert_eq!(reflected_ray.number_of_bounces(), 1); assert_eq!(reflected_ray.number_of_refractions(), 0); -- GitLab