Add spacenavd motion event support to Placement dialog that allows for object rotation and translation #15375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds spacemouse/spacenavd support to Placement dialog that allows for moving of objects (rotation and translation with 6-axis controller) instead of rotating the view.
It allows for smooth changing of object`s pitch/yaw/roll despite the range limits set in ui spinboxes (object rotation does not stop when reaching the spinbox limit).
When one of the angles exceeds limits set in spinbox all angles are corrected in such a way that the actual direction is still accurate.
Rotation and translation is relative to the main coordinate system (not the current camera view position).
Because this commit is using the Gui::QuantitySpinBox as data storage for object Placement it is susceptible to errors introduced by rounding (inherent to Gui::QuantitySpinBox and configured by decimal places setting).
Rounding errors accumulation is especially visible when using "Rotation axis with angle" in Placement dialog during consecutive calls to "Placement::eventFilter(QObject*, QEvent* ev)". This issue can be circumvented by increasing the decimal places setting in Edit->Preferences->General->Units->Number of decimals.
This can be tested by orienting object in such a way that x/y/z part of direction vector is non zero and then rotating it by 360degrees around any axis - the object does not return to the same, starting orientation when the rounding issue is present.
Code was tested and was working in 3 versions of freecad:
Libraries used by above compilations of freecad: