Skip to content

Replace CC_RAD_TO_DEG/CC_DEG_TO_RAD with inline methods #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
6 of 7 tasks
asmaloney opened this issue Apr 24, 2020 · 3 comments
Open
6 of 7 tasks

Replace CC_RAD_TO_DEG/CC_DEG_TO_RAD with inline methods #20

asmaloney opened this issue Apr 24, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@asmaloney
Copy link
Member

asmaloney commented Apr 24, 2020

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
@asmaloney asmaloney added the enhancement New feature or request label Apr 24, 2020
@dgirardeau
Copy link
Member

Why not

@asmaloney
Copy link
Member Author

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?

@dgirardeau
Copy link
Member

Yes why not!

asmaloney added a commit that referenced this issue Apr 29, 2020
asmaloney added a commit that referenced this issue Apr 29, 2020
asmaloney added a commit to CloudCompare/CloudCompare that referenced this issue Apr 30, 2020
asmaloney added a commit to CloudCompare/CloudCompare that referenced this issue May 1, 2020
asmaloney added a commit that referenced this issue May 2, 2020
asmaloney added a commit that referenced this issue May 2, 2020
asmaloney added a commit to CloudCompare/CloudCompare that referenced this issue May 2, 2020
asmaloney added a commit to CloudCompare/CloudCompare that referenced this issue May 2, 2020
asmaloney added a commit that referenced this issue May 3, 2020
asmaloney added a commit that referenced this issue May 4, 2020
Adds ZERO_TOLERANCE_F and ZERO_TOLERANCE_D as replacements (see comments in CCConst.h).

Part of #20
asmaloney added a commit to CloudCompare/CloudCompare that referenced this issue May 12, 2020
asmaloney added a commit to CloudCompare/CloudCompare that referenced this issue May 15, 2020
tmontaigu pushed a commit to tmontaigu/CloudCompare that referenced this issue Mar 12, 2021
tmontaigu pushed a commit to tmontaigu/CloudCompare that referenced this issue Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants