Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
kmap
xsocs
Commits
66c3a240
Commit
66c3a240
authored
Nov 22, 2018
by
Thomas Vincent
Browse files
Scale 3d view display if largest axis is more than 3 times the smallest
one
parent
7fe68903
Changes
1
Hide whitespace changes
Inline
Side-by-side
xsocs/gui/view/QspaceView.py
View file @
66c3a240
...
...
@@ -61,6 +61,17 @@ except ImportError:
SFViewParamTree
=
None
# Monkey patch ScalarFieldView
from
pkg_resources
import
parse_version
import
silx
if
parse_version
(
silx
.
version
)
<
parse_version
(
'0.10.0'
):
from
silx.gui.plot3d.scene
import
transform
class
ScalarFieldView
(
ScalarFieldView
):
def
setOuterScale
(
self
,
sx
=
1.
,
sy
=
1.
,
sz
=
1.
):
self
.
_bbox
.
transforms
=
[
transform
.
Scale
(
sx
,
sy
,
sz
)]
def
_useOpenGL
():
"""Returns True if OpenGL is available and enabled
...
...
@@ -508,7 +519,11 @@ class QSpaceView(Qt.QMainWindow):
widget
.
setText
(
label
)
if
self
.
__view3d
is
not
None
:
# swap scale, transition, labels as it is follows x, y, z convention
extents
=
np
.
array
(
binSteps
)
*
np
.
array
(
qspace
.
shape
)[::
-
1
]
if
extents
.
max
()
/
extents
.
min
()
>
3.
:
_logger
.
info
(
"Rescale 3D View to display data as a cube"
)
self
.
__view3d
.
setOuterScale
(
*
(
1.
/
extents
))
self
.
__view3d
.
setScale
(
*
binSteps
)
self
.
__view3d
.
setTranslation
(
*
minBinEdge
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment