Options
All
  • Public
Menu

Class HTMLRepaintableViewport

HTMLRepaintableViewport extends base HTMLViewport with a repaint option. This allows the caller to render ontop of a previous created image from the server when the updating is limited to changes on the client side rendering state.

Hierarchy

Index

Constructors

constructor

  • new HTMLRepaintableViewport(htmlElementName: string, width: number, height: number, disableRightClickMenuInBrowser?: boolean): HTMLRepaintableViewport
  • description

    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

    Parameters

    • htmlElementName: string

      name of HTML5 element

    • width: number

      Initial width of this viewport

    • height: number

      Initial height of this viewport

    • Default value disableRightClickMenuInBrowser: boolean = false

    Returns HTMLRepaintableViewport

Properties

Private currentMilliSecs1

currentMilliSecs1: number = new Date().getTime()

Private displayFPSinViewport

displayFPSinViewport: boolean = true

Protected height

height: number

Protected htmlElementName

htmlElementName: string

Private lastImageProcessed

lastImageProcessed: number = new Date().getTime()

Protected onDrawCallback

onDrawCallback: any = null

Private printFPStoConsole

printFPStoConsole: boolean = false

Private repaintHeight

repaintHeight: any

Private repaintImageBuffer

repaintImageBuffer: any

Private repaintWidth

repaintWidth: any

Protected width

width: number

Methods

disableRightClickMenu

  • disableRightClickMenu(disableMenu?: boolean): void
  • turn off the right-click popup menu

    Parameters

    • Default value disableMenu: boolean = true

    Returns void

displayFPS

  • displayFPS(showFPS: boolean): void
  • Display the FPS text in the viewport

    @ param showFPS Set to true to display frames per seoond in the viewport, false to hide it

    Parameters

    • showFPS: boolean

    Returns void

enableGlobalMouseEvents

  • enableGlobalMouseEvents(globalMouseHandlerActive: boolean): void
  • 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.

    Parameters

    • globalMouseHandlerActive: boolean

    Returns void

getHTMLElement

  • getHTMLElement(): any
  • Returns any

    HTML element associated with this viewport

getOrientation

  • getOrientation(): number
  • Get the orientation for this viewport

    Returns number

getPreviousFrameRenderParams

getRenderEngine

Private getRenderEngineID

  • getRenderEngineID(): number
  • return the renderEngineID associated with this viewport

    Returns number

getSliceInformation

  • getSliceInformation(): object
  • Get the slice information from scroll adaptor for 2D views

    Returns object

    • currentSlice: number
    • totalSlice: number

init

  • init(volumeDataInfo: VolumeDataContext, renderEngineType?: RenderType, onDrawCallback?: any, callbackFunc?: any, adaptorListener?: any): Promise<Object>
  • Parameters

    • volumeDataInfo: VolumeDataContext
    • Default value renderEngineType: RenderType = Fovia.RenderType.parallel
    • Optional onDrawCallback: any
    • Optional callbackFunc: any
    • Optional adaptorListener: any

    Returns Promise<Object>

initAndRender

  • initAndRender(volumeDataInfo: VolumeDataContext, renderEngineType?: RenderType, onDrawCallback?: any, callbackFunc?: any, adaptorLisetener?: any): Promise<Object>
  • Parameters

    • volumeDataInfo: VolumeDataContext
    • Default value renderEngineType: RenderType = Fovia.RenderType.parallel
    • Optional onDrawCallback: any
    • Optional callbackFunc: any
    • Optional adaptorLisetener: any

    Returns Promise<Object>

initWithRenderEngine

Protected paint

  • paint(htmlElement: any, bytes: any, width: number, height: number): void
  • 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.

    Parameters

    • htmlElement: any
    • bytes: any
    • width: number
    • height: number

    Returns void

render

  • Invokes the native intermediate render() method.

    Returns ReturnCode

    This is a synchronous method and returns ReturnCode.ok on success.

renderFinal

  • 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().

    Returns ReturnCode

    This is a synchronous method and returns ReturnCode.ok on success.

Protected renderImageData

  • renderImageData(bytes: any, width: number, height: number): void
  • Parameters

    • bytes: any
    • width: number
    • height: number

    Returns void

repaint

  • repaint(): void
  • Returns void

resizeWindow

  • resizeWindow(width: any, height: any): void
  • Resizes this component and triggers a render() / renderFinal() sequence

    Parameters

    • width: any

      Updated width of this viewport

    • height: any

      Updated height of this viewport

    Returns void

    This is a synchronous method and returns ReturnCode.ok on success.

setAndRenderXMLPreset

  • setAndRenderXMLPreset(xmlPresetName: String, callbackFunc?: any): Promise<Object>
  • Applies the specified XML preset to this viewport

    Parameters

    • xmlPresetName: String

      path and filename of the XML file to load. This will be relative to the FoviaWebSDK.EXE directory, or can be an absolute path

    • Optional callbackFunc: any

    Returns Promise<Object>

    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

setCustomMouseAdaptor

  • Associate a custom mouse adaptor with a given mouse button and keyboard modifier

    Parameters

    Returns void

setCustomTouchAdaptor

setMouseAdaptor

  • Create a mapping between a mouse event and the specified adaptor

    Parameters

    Returns void

setOrientation

  • setOrientation(orientation: ViewType): void
  • Set the orientation for this viewport (typically called when creating MPR viewports)

    Parameters

    Returns void

setOverrideMouseAdaptor

  • 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.

    Parameters

    Returns void

setOverrideTouchAdaptor

  • 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.

    Parameters

    Returns void

setTouchAdaptor

  • setTouchAdaptor(touchAdaptorInterface: any, touchEvent: any): void
  • map between a touch event and specified adaptor

    Parameters

    • touchAdaptorInterface: any
    • touchEvent: any

    Returns void

Static Private getHTMLViewportObj

  • retrieve the current "this" or "self" pointer (HTMLViewport) from the HTML element

    Parameters

    • htmlElement: any

    Returns HTMLViewport

Static Private setHTMLViewportObj

  • setHTMLViewportObj(htmlElement: any, foviaHTMLViewportObj: any): void
  • store the current this pointer (HTMLViewport) into the HTML element (this reference is visible from the browsser)

    Parameters

    • htmlElement: any
    • foviaHTMLViewportObj: any

    Returns void

Generated using TypeDoc