Conversation
|
If memory serves the |
I believe both calls are needed, but both should either be called together, or both not called. |
18c96a3 to
50bbc75
Compare
|
It seems rather unsatisfactory to me that there should be an enableAutoLevels state and yet the user is allowed to disable it on a case-by-case basis in a call to setData(). Furthermore, one can only override an enabled state to disabled, but not the other way round. |
I agree. That doesn't sound ideal. |
|
Hello @SimenZhor, I am doing some refactoring of PCMI in #2879 (merged) and this PR, which would possibly modify the changes introduced in #2463. What is the use case for having both an overall I would propose to remove the per-data-update |
|
Hi @pijyoi , thanks for taking care of the I don't have an issue with changing this behavior. |
|
If the per-update
|
|
It seems to me like we all agree that this part of the API is not intuitive or easy to understand. Since it was not clear to you why this solution was implemented, and since this confusion arrived so quickly after my PR, I'm inclined to take that as a sign that the API needs an overhaul (both for If a breaking API change is not desired, I think your tri-state alternative sounds reasonable. |
previously, autoLevels=True would not override enableautolevels=False.
the docs don't match the code.
what the code does:
if levels is None, auto-scaling occurs
_and_ levels will be automatically set.
i.e. in the next cycle, levels will no
longer be None
50bbc75 to
a5e6f71
Compare
|
I certainly won't oppose a nicely thought out improvement to the API. The But having to call that at every update is inconvenient, so If given, I think we should add the same
|
|
The naming of I am not saying it cannot be simplified, but that was the reasoning in the previous discusion. |
5bbd9b2 to
6f812f0
Compare
|
changes to |
|
I know Thanks @pijyoi this LGTM, merging. |
PColorMeshItem::setData()was a giant function that was also being called bysetLevels()andsetLookupTable().This PR refactors
setData()to_rerender()and_drawPicture()while removing_updateDisplayWithCurrentState()_rerender()is for redrawing when only levels or colors have changed.i.e. data bounds have not changed.
i.e. after a call to
setLevels()orsetLookupTable().may fix #2875
It is not clear to me why
prepareGeometryChange()is being called unconditionally, but care is taken to callinformViewBoundsChanged()only if bounds have been detected to have changed.