|
19 | 19 | from diffCheck import diffcheck_bindings # type: ignore |
20 | 20 | from diffCheck import df_cvt_bindings |
21 | 21 | from diffCheck.df_geometries import DFAssembly |
| 22 | +from diffCheck.df_poses import DFPosesBeam, DFPose |
22 | 23 |
|
23 | 24 |
|
24 | 25 | class NumpyEncoder(json.JSONEncoder): |
@@ -268,6 +269,24 @@ def analysis_type(self): |
268 | 269 | self._analysis_type = self._compute_dfresult_type() |
269 | 270 | return self._analysis_type |
270 | 271 |
|
| 272 | +class DFPoseResults(): |
| 273 | + """ |
| 274 | + This class compiles the results of the pose estimation into one object |
| 275 | + """ |
| 276 | + def __init__(self, assembly: DFAssembly): |
| 277 | + self.assembly = assembly |
| 278 | + self.pose_history : dict[str, DFPosesBeam] = dict() |
| 279 | + self.last_poses : dict[str, DFPose] = dict() |
| 280 | + def add_history(self, pose_history): |
| 281 | + """ |
| 282 | + The pose history is a dictionnary where the keys are the element names ("element_0", "element_1", etc), |
| 283 | + and the values are DFPosesBeam objects containing a dictionnary of poses for each element. |
| 284 | + """ |
| 285 | + self.pose_history = pose_history |
| 286 | + for element in pose_history: |
| 287 | + self.last_poses[element] = pose_history[element].poses_dictionary[list(pose_history[element].poses_dictionary.keys())[-1]] |
| 288 | + |
| 289 | + |
271 | 290 | # FIXME: ths is currently broken, we need to fix it |
272 | 291 | def df_cloud_2_df_cloud_comparison( |
273 | 292 | assembly: DFAssembly, |
|
0 commit comments