Skip to content
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

Refactor: getAngularSize->getAngularRadius #2180

Merged
merged 13 commits into from
Jan 19, 2022
Merged

Refactor: getAngularSize->getAngularRadius #2180

merged 13 commits into from
Jan 19, 2022

Conversation

gzotti
Copy link
Member

@gzotti gzotti commented Jan 16, 2022

It occurred to me that we need to rename this method to clarify that these values are in fact radii, not sizes
See the documentation in StelObject.h

Description

Fixes # (issue)

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

TODOs

  • Rename method
  • add default implementation to StelObject base class
  • clarify CustomObject's weird size
  • clarify Nebula's intermediate result. Better return majorAxisSize/2? Adapt other code accordingly.
  • clarify why MeteorShowers, Quasars, Pulsars, Exoplanet systems, Novae, Supernovae have non-zero but some distinct fixed small radii? Proposal: remove method override to inherit StelObject's zero size.
  • clarify for the Satellite class what RCS is (document the variables!!!) and how to derive radius, not diameter (as it is maybe now), from that. Adapt other places in the satellites code accordingly!

How Has This Been Tested?

Test Configuration:

  • Operating system: Win10 (irrelevant)
  • Graphics Card: irrelevant

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

- rename to clarify that these are radii, not sizes
- also fixed a few typecasting warnings
@gzotti gzotti added importance: low Small problem, rarely visible, no crash documentation Improvements or additions to documentation labels Jan 16, 2022
@gzotti gzotti added this to the 0.22.0 milestone Jan 16, 2022
@gzotti gzotti self-assigned this Jan 16, 2022
@github-actions
Copy link

github-actions bot commented Jan 16, 2022

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files

@gzotti
Copy link
Member Author

gzotti commented Jan 16, 2022

@alex-w several classes have small arbitrary but distinctly non-zero sizes. The size for stars is zero. Why not also for these classes? A non-zero value implies we could enlarge it to see more than a dot.
The Nebula and Satellite I think do not follow the specification and return diameters, not radii. This should be fixed finally in this branch.

@gzotti
Copy link
Member Author

gzotti commented Jan 17, 2022

@alex-w I have added 2 TODO annotations in the StelObject::getInfoMap(): I don't understand the test for negative values. (Just add an assert if in doubt?) And why do we need size in radians?

@alex-w
Copy link
Member

alex-w commented Jan 17, 2022

@alex-w I have added 2 TODO annotations in the StelObject::getInfoMap(): I don't understand the test for negative values. (Just add an assert if in doubt?) And why do we need size in radians?

I don't remember details, probably this part was added into map to backward compatibility. I think we may delete this data.

@alex-w
Copy link
Member

alex-w commented Jan 17, 2022

@alex-w several classes have small arbitrary but distinctly non-zero sizes. The size for stars is zero. Why not also for these classes? A non-zero value implies we could enlarge it to see more than a dot.

I've refactor this stuff. The most of these non-zero values was added a long time ago (around series 0.11-0.12) and probably on some step of refactoring we just forgot the fix this points.

@gzotti
Copy link
Member Author

gzotti commented Jan 18, 2022

I think I caught all cases now.

@gzotti gzotti marked this pull request as ready for review January 18, 2022 23:43
@github-actions github-actions bot requested a review from alex-w January 18, 2022 23:44
Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gzotti gzotti merged commit ad9366b into master Jan 19, 2022
@gzotti gzotti deleted the fix-angularSize branch January 19, 2022 09:38
@github-actions
Copy link

Hello @gzotti! Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@github-actions
Copy link

Hello @gzotti! Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation importance: low Small problem, rarely visible, no crash
Development

Successfully merging this pull request may close these issues.

2 participants