Skip to content

Replace CC_RAD_TO_DEG/CC_DEG_TO_RAD with inline methods #20

Open

Description

@asmaloney

Describe the feature you would like

Replacing these constants with inlines would make code more readable and help eliminate casting and compiler warnings.

CCLib::CC_RAD_TO_DEG*phi

becomes

CCLib::radiansToDegrees( phi )

(Move strategy here from comment below.)

Because this touches a lot of math, I'm going to do this in multiple steps so it can be reviewed more easily.

  • Add CCMath.h, mark RAD_TO_DEG as deprecated, and commit CCCoreLib
  • Change all occurrences in CloudCompare and wait for code review
  • Mark DEG_TO_RAD as deprecated and commit CCCoreLib
  • Change all occurrences in CloudCompare and wait for code review
  • Mark ZERO_TOLERANCE as deprecated and commit CCCoreLib
  • Change all occurrences in CloudCompare and wait for code review
  • Once everything is converted, remove RAD_TO_DEG, DEG_TO_RAD, and ZERO_TOLERANCE

Activity

  1. dgirardeau commented on Apr 24, 2020

    @dgirardeau
    Member

    Why not

  2. asmaloney commented on Apr 25, 2020

    @asmaloney
    MemberAuthor

    So the next question is where do these new methods (and the ZERO_TOLERANCE ones) live? They are no longer constants.

    Maybe a new CCMath.h?

  3. dgirardeau commented on Apr 25, 2020

    @dgirardeau
    Member

    Yes why not!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions