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

Add QskTickmarksMetrics / QskGraduationMetrics #347

Closed
wants to merge 16 commits into from

Conversation

vrcomputing
Copy link
Contributor

@vrcomputing vrcomputing commented Nov 5, 2023

Motivation: Just recently again I needed to be able to style the linear tickmarks sizes for all types (minor, medium, major), therefore here a suggestion of how to make them configurable with the current proportional behavior.

Advantages

  • Each tickmark type can freely be styled
  • Tickmark type's length no longer implementation detail

image

qreal m_minorRatio = 0.7;
qreal m_mediumRatio = 0.85;
qreal m_majorRatio = 1.0;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@uwerat I was thinking about adding Qt::SizeMode but this would need more adaptions in the QskTickmarksNode. What do you think?

Copy link
Owner

Choose a reason for hiding this comment

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

Guess setting the length of the ticks as absolute values ( pixels/dp ) is what a user usually want to do.

IIRC the current implementation relates the tick lengths to a metric, that is given as a skin hint. IMHO this does not make much sense anymore as QskTickmarksMetrics allows to pass the tick lengths as skin hint instead.

@uwerat
Copy link
Owner

uwerat commented Nov 7, 2023

Guess QskTickmarkMetrics should be usable as skin hint:

a) some boilerplate code to make it usable with QVariant ( see qskRegisterIntervalF as an example )
b) interpolation needs to be implemented and registered in QskVariantAnimator.cpp

@uwerat
Copy link
Owner

uwerat commented Nov 7, 2023

Please note that I have been working on the tickmarks in the features/plots branch some time ago. I'm not 100% happy yet with what you find there, but it is much closer to the final result than what you find in master. ( f.e there is a QskScaleRenderer - no QskTickmarksNode anymore ).

Please split this merge request into a part that implements QskTickmarksMetrics and another that is using it. Then I can adjust features/plots also using it.

@uwerat
Copy link
Owner

uwerat commented Nov 7, 2023

Please add:

  • QskHashValue QskTickmarkMetrics::hash( QskHashValue seed = 0 ) const noexcept;

@uwerat
Copy link
Owner

uwerat commented Nov 8, 2023

I would like to extend the concept of QskTickmarksMetrics to something, where you can configure more metrics of a scale.
This might include the width of the ticks, if the scale has a backbone ( with/without arrow ) and maybe even options like the rotation/alignment of the tick labels.

Having the lengths of the ticks is good enough for the first step, but I would like to start with a different terminology so that additional values can be added later without breaking the meaning of the class name.

Unfortunately the term "scale" is heavily used in the context of transformations and "axis" might be a bit too specific for coordinate systems. But there seems to be another good one: "graduation" ( https://en.wikipedia.org/wiki/Graduation_(scale) )

So please rename QskTickmarksMetrics to QskGraduationMetrics.

@vrcomputing vrcomputing changed the title Add QskTickmarksMetrics Add QskTickmarksMetrics / QskGraduationMetrics Nov 19, 2023
@uwerat
Copy link
Owner

uwerat commented Nov 28, 2023

QskGraduationMetrics is in master now

@uwerat uwerat closed this Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants