Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
b1e87155
Commit
b1e87155
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Oops, LightBoxCanvas fix from previous commit was bad. Separated out
duplicate LBC/SC logic into a SC method.
parent
0fd92604
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/fsleyes/gl/lightboxcanvas.py
+3
-11
3 additions, 11 deletions
fsl/fsleyes/gl/lightboxcanvas.py
fsl/fsleyes/gl/slicecanvas.py
+33
-18
33 additions, 18 deletions
fsl/fsleyes/gl/slicecanvas.py
with
36 additions
and
29 deletions
fsl/fsleyes/gl/lightboxcanvas.py
+
3
−
11
View file @
b1e87155
...
...
@@ -741,18 +741,10 @@ class LightBoxCanvas(slicecanvas.SliceCanvas):
if
not
self
.
_setGLContext
():
return
# See comments regarding this process in
# SliceCanvas.._draw. I guess I should
# put this in a method or something.
overlays
=
self
.
displayCtx
.
getOrderedOverlays
()
globjs
=
[]
overlays
,
globjs
=
self
.
_getGLObjects
()
for
ovl
in
overlays
:
globj
=
self
.
_glObjects
.
get
(
ovl
,
None
)
if
globj
is
None
:
self
.
__genGLObject
(
ovl
)
elif
globj
:
globjs
.
append
(
globj
)
# See comment in SliceCanvas._draw
# regarding this test
if
any
([
not
g
.
ready
()
for
g
in
globjs
]):
return
...
...
This diff is collapsed.
Click to expand it.
fsl/fsleyes/gl/slicecanvas.py
+
33
−
18
View file @
b1e87155
...
...
@@ -873,6 +873,37 @@ class SliceCanvas(props.HasProperties):
async
.
idle
(
refresh
)
def
_getGLObjects
(
self
):
"""
Called by :meth:`_draw`. Builds a list of all :class:`.GLObjects`
to be drawn.
:returns: A list of overlays, and a list of corresponding
:class:`.GLObjects` to be drawn.
"""
overlays
=
[]
globjs
=
[]
for
ovl
in
self
.
displayCtx
.
getOrderedOverlays
():
globj
=
self
.
_glObjects
.
get
(
ovl
,
None
)
# If an overlay does not yet have a corresponding
# GLObject, we presume that it hasn't been created
# yet, so we'll tell genGLObject to create one for
# it.
if
globj
is
None
:
self
.
__genGLObject
(
ovl
)
# If there is a value for this overlay in
# the globjects dictionary, but it evaluates
# to False, then GLObject creation has been
# scheduled for the overlay - see genGLObject.
elif
globj
:
overlays
.
append
(
ovl
)
globjs
.
append
(
globj
)
return
overlays
,
globjs
def
_overlayBoundsChanged
(
self
,
*
a
):
"""
Called when the display bounds are changed.
...
...
@@ -1225,24 +1256,8 @@ class SliceCanvas(props.HasProperties):
if
not
self
.
_setGLContext
():
return
overlays
=
self
.
displayCtx
.
getOrderedOverlays
()
globjs
=
[]
for
ovl
in
overlays
:
globj
=
self
.
_glObjects
.
get
(
ovl
,
None
)
# If an overlay does not yet have a corresponding
# GLObject, we presume that it hasn't been created
# yet, so we'll tell genGLObject to create one for
# it.
if
globj
is
None
:
self
.
__genGLObject
(
ovl
)
# If there is a value for this overlay in
# the globjects dictionary, but it evaluates
# to False, then GLObject creation has been
# scheduled for the overlay - see genGLObject.
elif
globj
:
globjs
.
append
(
globj
)
overlays
,
globjs
=
self
.
_getGLObjects
()
# Do not draw anything if some globjects
# are not ready. This is because, if a
# GLObject was drawn, but is now temporarily
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment