Viewer class

The viewer is the abstract base class of all viewers. It provides some basic functionalities and common interfaces.


export declare abstract class Viewer 


addInput(input)Add an input method to this viewer, e.g., mouse.
addTool(tool)Add an tool to this viewer. Each tool has a unique name/identifier.
destroy()Stop rendering, destroy the viewer and release all internal resources.
getCanvas()Return the canvas DOM.
getHeight()Return the viewer's height.
getInput(id)Get the input method by its id.
getTool(name)Get the tool instance by tool's name.
getWidth()Return the viewer's width.
invalidate()Invalidate the current rendering and cause rendering to refresh.
pause()Pause the current viewer's internal application update cycle. When paused, the internal update is stopped to save computation. For example, application can call this function when the browser tab is hidden.
removeInput(id)Remove the input method from this viewer.
removeTool(name)Remove the tool object by its name.
resize(width, height)Resize the viewer. This function will be called automatically when browser tab is resized.
resume()Resume the viewer's update cycle.