Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-19409

Add getCenter to Box2I

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: geom
    • Labels:
      None

      Description

      Many region specifications (DS9, STC) define boxes in terms of center and width. Box2D has a getCenter() method but it would be useful if Box2I also had one to allow for more seamless usage.

        Attachments

          Activity

          Hide
          tjenness Tim Jenness added a comment -

          Was trivial to add and moved some code from the tests that was implementing the getCenter functionality.

          Show
          tjenness Tim Jenness added a comment - Was trivial to add and moved some code from the tests that was implementing the getCenter functionality.
          Hide
          jbosch Jim Bosch added a comment -

           

          Did you happen to test while doing this whether our makeCenteredBox factory method for Box2I has the same convention as DS9 and/or STC?  Or do they not deal with intrinsically integer-bounded boxes at all?

          Show
          jbosch Jim Bosch added a comment -   Did you happen to test while doing this whether our makeCenteredBox factory method for Box2I has the same convention as DS9 and/or STC?  Or do they not deal with intrinsically integer-bounded boxes at all?
          Hide
          tjenness Tim Jenness added a comment -

          I had not looked at DS9 regions directly although it is the case that they are always floating point so it's probably not relevant.

          I see there are a few tests in afw that use the workaround of going via Box2D to calculate the center. Should I fix those to use the new API or does no-one care?

          Show
          tjenness Tim Jenness added a comment - I had not looked at DS9 regions directly although it is the case that they are always floating point so it's probably not relevant. I see there are a few tests in afw that use the workaround of going via Box2D to calculate the center. Should I fix those to use the new API or does no-one care?
          Hide
          jbosch Jim Bosch added a comment -

          I wouldn't bother with the afw tests.

          Show
          jbosch Jim Bosch added a comment - I wouldn't bother with the afw tests.

            People

            • Assignee:
              tjenness Tim Jenness
              Reporter:
              tjenness Tim Jenness
              Reviewers:
              Jim Bosch
              Watchers:
              Jim Bosch, Simon Krughoff, Tim Jenness
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: