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
a7745c44
Commit
a7745c44
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix to RenderTextureStack - Z axis range was not being updated when
GLObject was being updated.
parent
294f6a8b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/fsleyes/gl/textures/rendertexturestack.py
+15
-7
15 additions, 7 deletions
fsl/fsleyes/gl/textures/rendertexturestack.py
with
15 additions
and
7 deletions
fsl/fsleyes/gl/textures/rendertexturestack.py
+
15
−
7
View file @
a7745c44
...
@@ -68,7 +68,7 @@ class RenderTextureStack(object):
...
@@ -68,7 +68,7 @@ class RenderTextureStack(object):
self
.
__globj
.
addUpdateListener
(
self
.
__globj
.
addUpdateListener
(
'
{}_{}
'
.
format
(
type
(
self
).
__name__
,
id
(
self
)),
'
{}_{}
'
.
format
(
type
(
self
).
__name__
,
id
(
self
)),
self
.
__
refreshAllTextures
)
self
.
__
onGLObjectUpdate
)
import
wx
import
wx
wx
.
GetApp
().
Bind
(
wx
.
EVT_IDLE
,
self
.
__textureUpdateLoop
)
wx
.
GetApp
().
Bind
(
wx
.
EVT_IDLE
,
self
.
__textureUpdateLoop
)
...
@@ -134,8 +134,7 @@ class RenderTextureStack(object):
...
@@ -134,8 +134,7 @@ class RenderTextureStack(object):
self
.
__yax
=
yax
self
.
__yax
=
yax
self
.
__zax
=
zax
self
.
__zax
=
zax
lo
,
hi
=
self
.
__globj
.
getDisplayBounds
()
res
=
self
.
__globj
.
getDataResolution
(
xax
,
yax
)
res
=
self
.
__globj
.
getDataResolution
(
xax
,
yax
)
if
res
is
not
None
:
numTextures
=
res
[
zax
]
if
res
is
not
None
:
numTextures
=
res
[
zax
]
else
:
numTextures
=
self
.
__defaultNumTextures
else
:
numTextures
=
self
.
__defaultNumTextures
...
@@ -143,9 +142,6 @@ class RenderTextureStack(object):
...
@@ -143,9 +142,6 @@ class RenderTextureStack(object):
if
numTextures
>
self
.
__maxNumTextures
:
if
numTextures
>
self
.
__maxNumTextures
:
numTextures
=
self
.
__maxNumTextures
numTextures
=
self
.
__maxNumTextures
self
.
__zmin
=
lo
[
zax
]
self
.
__zmax
=
hi
[
zax
]
self
.
__destroyTextures
()
self
.
__destroyTextures
()
for
i
in
range
(
numTextures
):
for
i
in
range
(
numTextures
):
...
@@ -153,7 +149,7 @@ class RenderTextureStack(object):
...
@@ -153,7 +149,7 @@ class RenderTextureStack(object):
rendertexture
.
RenderTexture
(
'
{}_{}
'
.
format
(
self
.
name
,
i
)))
rendertexture
.
RenderTexture
(
'
{}_{}
'
.
format
(
self
.
name
,
i
)))
self
.
__textureDirty
=
[
True
]
*
numTextures
self
.
__textureDirty
=
[
True
]
*
numTextures
self
.
__
refreshAllTextures
()
self
.
__
onGLObjectUpdate
()
def
__destroyTextures
(
self
):
def
__destroyTextures
(
self
):
...
@@ -167,6 +163,18 @@ class RenderTextureStack(object):
...
@@ -167,6 +163,18 @@ class RenderTextureStack(object):
for
tex
in
texes
:
for
tex
in
texes
:
wx
.
CallLater
(
50
,
tex
.
destroy
)
wx
.
CallLater
(
50
,
tex
.
destroy
)
def
__onGLObjectUpdate
(
self
,
*
a
):
"""
Called when the :class:`.GLObject` display is updated. Re-calculates
the display space Z-axis range, and marks all render textures as dirty.
"""
lo
,
hi
=
self
.
__globj
.
getDisplayBounds
()
self
.
__zmin
=
lo
[
self
.
__zax
]
self
.
__zmax
=
hi
[
self
.
__zax
]
self
.
__refreshAllTextures
()
def
__refreshAllTextures
(
self
,
*
a
):
def
__refreshAllTextures
(
self
,
*
a
):
"""
Marks all :class:`.RenderTexture` instances as *dirty*, so that
"""
Marks all :class:`.RenderTexture` instances as *dirty*, so that
...
...
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