Ticket #2061 (closed: fixed)
Adjust SpatialGrouping Algorithm to deal with Non-Square Detectors
Reported by: | Michael Whitty | Owned by: | Michael Whitty |
---|---|---|---|
Priority: | critical | Milestone: | Iteration 27 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Nick Draper |
Description
Because tubes ain't cubes.
Continues from #2028
Change History
comment:1 Changed 10 years ago by Michael Whitty
- Status changed from new to accepted
- Milestone changed from Iteration 26 to Iteration 27
comment:2 Changed 10 years ago by Michael Whitty
To determine whether a detector is within the distance, need to:
- take bounding box of detector (scaled correctly by object component)
- multiply each dimension by 2 (so that the distance to each corner is the whole of that dimension for the detector shape)
- multiply each dimension by the user-provided factor
- either use BoundingBox::isPointInside(V3D) or, if that proves unsuitable for any reason, some custom form of "collision detection" to see if a specified point is within this range
Could possibly save on recreating the box every time by assuming detectors are geometrically identical (as current version does) and just moving the centre point, but current implementation of bounding box doesn't make that look particularly friendly.
Will also need to adjust the "sorting" of the nearest detectors (when pruning results of the find) to be relative to the dimension of the bounding box.
This will probably also mean we can never trust NearestNeighbours to return us the "right" eight detectors when search on a 3x3 grid.
comment:6 Changed 10 years ago by Michael Whitty
- Status changed from accepted to verify
- Resolution set to fixed
this is, I believe, done now.
comment:7 Changed 10 years ago by Nick Draper
- Status changed from verify to verifying
- Tester set to Nick Draper