name of HTML5 element
Initial width of this viewport
Initial height of this viewport
creates a unique hash key for the specified mouse adaptor to mouse event mapping
turn off the right-click popup menu
Display the FPS text in the viewport
@ param showFPS Set to true to display frames per seoond in the viewport, false to hide it
By default, JavaScript windows only see mosue events within its Canvas element, which means when the mouse moves outside the element, they are no longer tracked. By enabling this option, mouse events outside the HTML element are passed to this adaptor. By default, this is off (to adhere to standard javaScript behavior). In all cases, when a mouseUp occurs outside the active viewport, that event will be passed to the adaptor.
HTML element associated with this viewport
return the octree associated with tis viewport
Get the orientation for this viewport
return the renderEngine associated with this viewport.
return the renderEngineID associated with this viewport
Get the slice information from scroll adaptor for 2D views
return the volumeData associated with tis viewport
globalMouseMoveHandler -- dispatches to the correct mouseMove handler across the entire document
globalMouseReleaseHandler -- dispatches to the correct mouseUp handler across the entire document
initialize the foviaHTMLViewport
Render engine type (defaults to Parallel Rendering)
Callback triggered when an image is returned from the server but allows the applicaiton an opportunity to draw something ontop of the image
This is an asynchronous method that returns a Promise as follows:
Promise .then(void) .catch (err: ReturnCode )
callbackFunc(err: ReturnCode , void)
While this does not provide a return value, it is critical that render operations are not triggered in this component until after the initializtion is complete and the Promise or callback returns.:
mouseDownHandler -- dispatches to the correct mouseDown handler. Note, this comes in on a HTML thread, so the HTMLViewport reference resides in the the private HTML element.
mouseMoveHandler -- dispatches to the correct mouseMove handler. Note, this comes in on a HTML thread, so the HTMLViewport reference resides in the the private HTML element.
mouseReleaseHandler -- dispatches to the correct mouseRelease handler. Note, this comes in on a HTML thread, so the HTMLViewport reference resides in the the private HTML element.
mouseMoveHandler -- dispatches to the correct mouseMove handler. Note, this comes in on a HTML thread, so the HTMLViewport reference resides in the the private HTML element.
paint() write the bytes to the HTML element (either CANVAS or IMG); In this method, the bytes are written to the actual CANVAS or IMG, however the sublcass HTMLDoubleBufferViewport overwrites this method and does rendering on a hidden CANVAS or IMG, which is then rendered onto the real CANVAS or IMG.
processImageFromServer is called when image is ready to be rendered for a render engine. If data.image is null, there was an error, in which case we reset the mouse/touch state.
at this point, there is no knowledge of the canvasID (either in our code, or external), so the mapping between the renderEngineID (data.name) is used to find the correct object, and then its render() method will be called.
internal method called to handline any mouseUp events (either directly, or from another handler)
internal method called to handline any mouseUp events (either directly, or from another handler)
Invokes the native intermediate render() method.
This is a synchronous method and returns ReturnCode.ok on success.
Invokes the native renderFinal() method. It is important that a render() be done before a renderFinal() after the rendeirng state has changed, such as from a setRenderParamters().
This is a synchronous method and returns ReturnCode.ok on success.
render the supplied bytes to the HTML element using paint(), and then update the internal state varaibles. If the mouse adaptor has a postRender step, such as during flythrough, invoke its postRender() method after the rendering is complete so the next frames can be requested.
The renderImageData() method is extended in the subclass HTMLRepaintableViewport to create a duplicate copy of the rendered image from the server, so it is possible to update the viewport without forcing a native renderImageData() if the render parameters have not changed.
TODO: extend this to support postRender for the touch flythrough
Resizes this component and triggers a render() / renderFinal() sequence
Updated width of this viewport
Updated height of this viewport
This is a synchronous method and returns ReturnCode.ok on success.
sendAdaptorData sends useful information about updates from adaptors and the render parameters used to generate the frame being sent it will include current slice, total number of slices from scroll adaptor it will include window level and width from window level adaptor
Applies the specified XML preset to this viewport
path and filename of the XML file to load. This will be relative to the FoviaWebSDK.EXE directory, or can be an absolute path
This is an asynchronous method that returns a Promise as follows:
Promise .then(void) .catch (err: ReturnCode )
callbackFunc(err: ReturnCode , void)
While this does not provide a return value, the application will be notified once the preset has been applied and rendered
Associate a custom mouse adaptor with a given mouse button and keyboard modifier
Associate a custom mouse adaptor with a given mouse button and keyboard modifier
sets default mouse and touch adaptors
Create a mapping between a mouse event and the specified adaptor
Set the orientation for this viewport (typically called when creating MPR viewports)
Install a mouse adaptor that is invokved unconditionally for all mouse events. This allow the application to peek at the event, process it, and stop the propagate.
This is useful when the application is detecting a mouse over event of an annotation or cross-reference lines, and handle that opposed to the current mouse adaptor that would otherwise be triggered.
Install a touch adaptor that is invokved unconditionally for all touch events. This allow the application to peek at the event, process it, and stop the propagate.
This is useful when the application is detecting a touch over event of an annotation or cross-reference lines, and handle that opposed to the current mouse adaptor that would otherwise be triggered.
map between a touch event and specified adaptor
touchEndHandler -- dispatches to the correct touchEnd handler. Note, this comes in on a HTML thread, so the HTMLViewport reference resides in the the private HTML element.
touchMoveHandler -- dispatches to the correct touchMove handler. Note, this comes in on a HTML thread, so the HTMLViewport reference resides in the the private HTML element.
touchStartHandler -- dispatches to the correct touchStart handler. Note, this comes in on a HTML thread, so the HTMLViewport reference resides in the the private HTML element.
retrieve the current "this" or "self" pointer (HTMLViewport) from the HTML element
store the current this pointer (HTMLViewport) into the HTML element (this reference is visible from the browsser)
Generated using TypeDoc
constructs the HTMLViewport object; the initialization is deferred till the init() call rather odd behavior if you attempt to create a Promise inside a constructor since it cannot return a value