Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Christian Butz
VTK
Commits
66485499
Commit
66485499
authored
Mar 10, 2015
by
Scott Wittenburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow clients to know when a render occurred that was not stale.
Change-Id: Ia3f3d4ac9e970f0827321329a9ac341f897453d2
parent
a701e9c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
Web/JavaScript/Lib/vtkweb.viewport.image.js
Web/JavaScript/Lib/vtkweb.viewport.image.js
+4
-0
Web/JavaScript/Lib/vtkweb.viewport.js
Web/JavaScript/Lib/vtkweb.viewport.js
+24
-0
No files found.
Web/JavaScript/Lib/vtkweb.viewport.image.js
View file @
66485499
...
...
@@ -177,6 +177,10 @@
// request another render to try to get the latest image.
if
(
res
.
stale
===
true
)
{
renderOnIdle
();
}
else
{
container
.
trigger
({
type
:
'
renderer-ready
'
});
}
});
}
...
...
Web/JavaScript/Lib/vtkweb.viewport.js
View file @
66485499
...
...
@@ -537,6 +537,18 @@
throw
"
'session' must be provided within the option.
"
;
}
function
onReadyInternal
()
{
if
(
userReadyCallback
.
fn
)
{
// Providing just a short delay before triggering the "image-not-state"
// event provides a break in the action so that the browser can draw the
// image we just copied to the src attribute.
setTimeout
(
userReadyCallback
.
fn
,
0
);
if
(
userReadyCallback
.
once
)
{
userReadyCallback
.
fn
=
null
;
}
}
}
// Create viewport
var
config
=
$
.
extend
({},
DEFAULT_VIEWPORT_OPTIONS
,
options
),
session
=
options
.
session
,
...
...
@@ -547,6 +559,7 @@
onDoneQueue
=
[],
statisticManager
=
createStatisticManager
(),
inSelectionMode
=
false
,
userReadyCallback
=
{
fn
:
null
,
once
:
false
},
viewport
=
{
/**
* Update the active renderer to be something else.
...
...
@@ -669,6 +682,14 @@
rendererContainer
.
trigger
(
'
clearCache
'
);
},
/*
* Provide a function that will be called when
*/
onReady
:
function
(
readyCallback
,
once
)
{
userReadyCallback
.
fn
=
readyCallback
;
userReadyCallback
.
once
=
once
;
},
/**
* Attach viewport to a DOM element
*
...
...
@@ -802,6 +823,9 @@
}
});
// Attach the on ready internal
rendererContainer
.
bind
(
'
renderer-ready
'
,
onReadyInternal
);
// Create any renderer type that is available
for
(
var
key
in
vtkWeb
.
ViewportFactory
)
{
try
{
...
...
Write
Preview
Markdown
is supported
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