kicad-developers team mailing list archive
Mailing list archive
Re: Pcbnew display origin transforms for v6
Wayne Stambaugh <stambaughw@xxxxxxxxx>
Thu, 2 May 2019 07:56:02 -0400
addr=stambaughw@xxxxxxxxx; prefer-encrypt=mutual; keydata= mQGiBEM0hxQRBAC2fNh3YOVLu1d5GZ0SbrTNldGiGnCJPLqzEnqFX9v6jmf33TMt6EmSLkl6 Wtfkoj0nVwKxcYmJkA8DX0QAokBkwNIzhSsBzQvthBLIk/5LnPVVKrEXOcL4mUyH1doKlkaE slgJozNa6Av+oavcvD02o1zJOloBbaHlNlyRt7fKswCgtIFlVjWggVH/15KfWk+Qo5JVPbME AIUBAQyL2OAx0n60AWec2WHnO9buHuG0ibtICgUMkE+2MRmYyKwYRdyVwGoIUemFuOyHp0AJ InX4T+vy2E7vkwODqjtMLfIoRkokW74Fi4nrvjlhOAw/vdq/twLbAmR9MOfPTpR4y7kQy1O2 /n+RkkRvh26vTzfbQmrH7cBJhk6aA/9Uwvu3E4zNJgHVZeS0HyWtmR1eOPPRbnkPgJTToX5O KMKzTJI/FX6kT7cFoCamitHrW3BJP4Dx+cMMsa47EGxqVTdbVJ4LjogsXTXxb+0Fn1u4zBdx x3Cer6O7+hqWy7zvpzeC6nSREjqDKa5CgHtv/GLm5uFPOmsjAsnHj2tlBrQmV2F5bmUgU3Rh bWJhdWdoIDxzdGFtYmF1Z2h3QGdtYWlsLmNvbT6IeAQTEQIAOBYhBOffs6CbblRzBkv33BtR cWlZ+CReBQJbFBS2AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBtRcWlZ+CReMI8A nRbrLkzp7+c2f0vX7sfg4ICX8LAKAJ9uClo4uJajmZa5zZrL2nKdZlUwIrkCDQRDNIcxEAgA gCru+3/aOC6RCjpvYC72wY+d5SmHphC6yeiV2/mOumyt5MLo/Ps2GznZr11JspqFk5K/Zpvp MMLqqjDZ39+50a2iKRQFJ6NlK+hJWMmj6eJygQrCwYo3Gjc6CqfrqUv+8VSnf/i5sIZmtOVA 4ZjML18MuBvMSsNdVLFJd5HNnYb1iOECpvqdPVh/21LLCEw7MUUGGnHBhCrmk2aJe5hFmcSN g4ldBcXrgMQBwf7aMVoobXBMFDb/IENByXn0llB7Gr2IFMRmNS9/p8s/II1Yl2bTqyX4FSz8 cfn7C9KEz7faZ7wzAcpwHFC/zs3JoAjJ0IEKdNUpIwAlKMzT3CzctwADBQf/cxpG28MKyrqk nNmq/8LQLy+x6FSYXBLjxQz9BiBNYeesDZQ6J5UbL1mjpJzMa5tLZypPYo4bbGyR22hrbyDF K7m6AcVaMIJKl98g4ukMutFfAJyRDaREH5Zl/X1P4u1Z/yaAIy9mKaNbaK1/5djNJ5wCTFen TUgAp9xdc30kGkFDdLJFp5uxDY4P0vaZiZdjUCvDM3Zjv5IzpNOfxVqTUBQNUP/BnnKhkk0p DTD6s3X8S+D0rOtEBQ8K0cwERI/E8EFa8nj0TNw4e2MYGR8wg+SxqJ7z5f0zPY0bO6G9DDFB wYCqzzPWGqdAh9vA5971TAbPERtdFybhkurozp2SfYhJBBgRAgAJBQJDNIcxAhsMAAoJEBtR cWlZ+CResHUAniULLCWiT26ieRTl7N2vS6vBo/DuAJ4m7Ss/gyiW6ybTn1ctDXAUgm2QVQ==
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
Just a few comments on top of Jeff's reply since this will be your first
Please follow the coding style policy. It saves a lot of back and
forth. There is also a git commit hook which you can use to verify
your coding style is correct. You will have to have clang-format
installed on your system in order to use this feature.
When you are ready to submit your patch(es), use `git format-patch` to
create the patch(es) and post them on the mailing list for comment.
It was great talking with you at KiCon. Thank you again for your
interest in contributing to KiCad.
On 4/30/19 9:50 PM, Reece R. Pollack wrote:
> Inspired by KiCon (and before the high wears off) I'm moving forward
> with my project to allow the user to specify the coordinate display
> origin in pcbnew. I have this working as patches to the v5.1.2 branch,
> but they're hard-coded to use the Aux origin. I'd like some guidance on
> how best to code this for eventual inclusion into the v6 development branch.
> My plan is:
> 1. Create a new class ORIGIN_TRANSFORM. This class maintains the user's
> configuration and provides functions to perform the transforms
> necessary to convert between the internal coordinate representation
> and the equivalent coordinates relative to the user-selected origin.
> 2. Embed two ORIGIN_TRANSFORM objects in the BOARD_DESIGN_SETTINGS
> class representing the origin transforms for the X and Y axes.
> 3. Create a new tab in the pcbnew "Preferences" to allow the user to
> select the origin (Page [default], Aux, or Grid) and direction (Left
> or Right [default], Up or Down [default]) for each axis.
> 4. Modify the board file format to save and load the user's
> ORIGIN_TRANSFORM configuration. Saving this in the .kicad_pcb file
> allows everyone editing the board to see coordinates reported
> relative to the same origin.
> 5. Modify each of the dialog classes that displays object coordinates
> to use the ORIGIN_TRANSFORM objects to display coordinates relative
> to the user-selected origin. When the dialog is closed object
> coordinates are converted back to internal coordinates.
> 6. Modify the PCB_BASE_FRAME class to display the absolute cursor
> position relative to the user-selected origin.
> This is structured to allow the UNIT_BINDER class to manage origin
> transforms, much like it handles the mm/mil conversions. I would change
> the constructor to take a reference to an ORIGIN_TRANSFORM object as an
> additional argument; the default value would be a unity-transform whose
> conversion functions return the value to be converted unmodified. Those
> UNIT_BINDER objects that represent a coordinate value (commonly m_posX
> and m_posY) would be constructed with a reference to one of the two
> ORIGIN_TRANSFORM objects in the BOARD_DESIGN_SETTINGS class.
> The problem with this strategy is that KiCad reuses UNIT_BINDER objects
> for dissimilar purposes. For example,
> DIALOG_GRAPHIC_ITEM_PROPERTIES::m_endX can represent the end point of a
> graphic line, for which origin transform is needed. But it can also
> represent the radius of a circle, for which origin transform is
> inappropriate. Thus UNIT_BINDER needs a method similar to the Show()
> function to enable or disable the origin transform depending on how it
> is being used. This may argue against pushing this functionality into
> If I don't modify the UNIT_BINDER class I'll probably code the
> ORIGIN_TRANSFORM class to handle wxPoint objects rather than individual
> coordinates. Thus there would be only one ORIGIN_TRANSFORM object added
> to the BOARD_DESIGN_SETTINGS class. The transform in the dialog class
> then becomes a single call to transform a coordinate pair rather than
> one each for X and Y.
> Thoughts? Comments? Suggestions? Brickbats?
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp