Import 2017-06-07 23:51:09: master b30a0627

Author Committer Branch Timestamp Parent
lassoan lassoan master 2015-12-21 23:50:53 master 23cddf3a
Changeset

BUG: Fixed of truncation of imported transforms

Fixes http://na-mic.org/Mantis/view.php?id=4114

Expected behavior of the translation slider widgets in global mode is to set the slider value to the current translation value.
However, if the current translation value is out of the slider's range then the range has to be updated to accommodate the large value.

There were two issues with the automatic range update:

  1. If current transform in the qMRMLTransformSliders widget changed then the range was updated to the previous transform => fixed by computing it for the new Transform
  2. Sometimes the transform node modified events are called in qMRMLLinearTransformSlider than the slider range is updated in qMRMLTransformSliders, which caused setting of a truncated value => fixed by not attempting to set a value in the slider that is not reachable (move the slider to the closest value, without emitting any event)

Also added a test case to qMRMLTransformSlidersTest1 to detect similar problems in the future.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24820 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Libs/MRML/Widgets/Testing/qMRMLTransformSlidersTest1.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLLinearTransformSlider.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLTransformSliders.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLTransformSliders.h Diff File