# IWebViewer

class `IWebViewer`()

  ## Index

  Properties

  - `_views`
  - `animationManager`
  - `BCFManager`
  - `cuttingManager`
  - `explodeManager`
  - `floorplanManager`
  - `lineManager`
  - `markupManager`
  - `measureManager`
  - `model`
  - `noteTextManager`
  - `operatorManager`
  - `overlayManager`
  - `selectionManager`
  - `sheetManager`
  - `view`
  - `views`

  Methods

  - `addView`
  - `advanceExportToSvg`
  - `applyFilter`
  - `beginExportToSvg`
  - `closeConnection`
  - `delayCapping`
  - `endExportToSvg`
  - `exportToSvg`
  - `fitWorld`
  - `focusInput`
  - `getAllowHighDpi`
  - `getContextMenuStatus`
  - `getFormatVersionString`
  - `getMinimumFramerate`
  - `getModelReady`
  - `getRendererType`
  - `getSceneReady`
  - `getStatistics`
  - `getStreamCutoffScale`
  - `getStreamingMode`
  - `getView`
  - `getViewElement`
  - `getViewerVersionString`
  - `moveToWindow`
  - `pauseRendering`
  - `redraw`
  - `registerCustomOperator`
  - `removeView`
  - `reset`
  - `resetClientTimeout`
  - `resizeCanvas`
  - `resumeRendering`
  - `selectPart`
  - `setAllowHighDpi`
  - `setCallbacks`
  - `setClientTimeout`
  - `setContextMenuStatus`
  - `setMinimumFramerate`
  - `setServerRenderQuality`
  - `setStreamCutoffScale`
  - `setViewOrientation`
  - `shutdown`
  - `start`
  - `takeSnapshot`
  - `trigger`
  - `unregisterCustomOperator`
  - `unsetCallbacks`
  - `waitForIdle`

## Properties

`IWebViewer.``_views`
  _views: `IView`[]

`IWebViewer.``animationManager`

  readonly

  animationManager: `Manager`

`IWebViewer.``BCFManager`

  readonly

  BCFManager: BCFManager

`IWebViewer.``cuttingManager`

  readonly

  cuttingManager: `ICuttingManager`

`IWebViewer.``explodeManager`

  readonly

  explodeManager: `ExplodeManager`

`IWebViewer.``floorplanManager`

  deprecated

  floorplanManager: `FloorplanManager`

  Deprecated

  > FloorplanManagers are now properties of Views.

`IWebViewer.``lineManager`

  readonly

  lineManager: `LineManager`

`IWebViewer.``markupManager`

  readonly

  markupManager: `MarkupManager`

`IWebViewer.``measureManager`

  readonly

  measureManager: `MeasureManager`

`IWebViewer.``model`

  readonly

  model: `IModel`

`IWebViewer.``noteTextManager`

  readonly

  noteTextManager: `NoteTextManager`

`IWebViewer.``operatorManager`

  deprecated

  operatorManager: `OperatorManager`

  Deprecated

  > OperatorManagers are now properties of Views.

`IWebViewer.``overlayManager`

  deprecated

  overlayManager: `OverlayManager`

  Deprecated

  > OverlayManagers are now properties of Views.

`IWebViewer.``selectionManager`

  readonly

  selectionManager: `SelectionManager`

`IWebViewer.``sheetManager`

  readonly

  sheetManager: `SheetManager`

`IWebViewer.``view`
  view: `IView`

`IWebViewer.``views`
  views: `IView`[]

## Methods

`IWebViewer.``addView`()
  addView(config: `ViewConfig`): Promise

  Adds another 3D view of the scene to the page.

  Parameters

  > config: `ViewConfig`

  > > configuration to be used for the new view.

  Returns: Promise

  > A promise with the created View.

`IWebViewer.``advanceExportToSvg`()
  advanceExportToSvg(): Promise

  Get the next chunk of the SVG code

  Returns: Promise

  > A promise that resolves to a string containing the next chunk or undefined on completed..

`IWebViewer.``applyFilter`()
  applyFilter(filterId: `FilterId`): void

  Parameters

  > filterId: `FilterId`

  Returns: void

`IWebViewer.``beginExportToSvg`()
  beginExportToSvg(config: `SvgConfig`): Promise

  Setup the env to export the current scene to a two-dimensional SVG representation through stream.

  Parameters

  > config: `SvgConfig`

  > > Allows customization of the resultant SVG.

  Returns: Promise

  > A promise that resolves to void when the env is ready.

`IWebViewer.``closeConnection`()
  closeConnection(): void

  Disconnects the network connection when in CSR mode.

  Returns: void

`IWebViewer.``delayCapping`()
  delayCapping(): void

  Delays capping processing by a fixed time interval.

  Returns: void

`IWebViewer.``endExportToSvg`()
  endExportToSvg(): Promise

  Reset the env after SVG stream export.

  Returns: Promise

  > A promise that resolves to void when the env is reset.

`IWebViewer.``exportToSvg`()
  exportToSvg(config: `SvgConfig`): Promise

  Exports the current scene to a two-dimensional SVG representation.

  Parameters

  > config: `SvgConfig`

  > > Allows customization of the resultant SVG.

  Returns: Promise

  > A promise that resolves to the created SVG string.

`IWebViewer.``fitWorld`()
  fitWorld(duration: number): Promise

  Parameters

  > duration: number

  Returns: Promise

`IWebViewer.``focusInput`()
  focusInput(focus: boolean): void

  Sets whether keyboard input should be directed to this Web Viewer.

  Parameters

  > focus: boolean

  > > if true, the Web Viewer will be focused and accept keyboard input, otherwise it will be blurred and not accept keyboard input

  Returns: void

`IWebViewer.``getAllowHighDpi`()
  getAllowHighDpi(): boolean

  Gets the current value for high DPI rendering

  Returns: boolean

  > current high DPI setting

`IWebViewer.``getContextMenuStatus`()
  getContextMenuStatus(): boolean

  Returns: boolean

  > boolean true if the context menu is active, false otherwise

`IWebViewer.``getFormatVersionString`()
  getFormatVersionString(): string

  Returns the format version string.

  Returns: string

  > string containing version information for the format.

`IWebViewer.``getMinimumFramerate`()
  getMinimumFramerate(): Promise

  Gets the minimum framerate that will be maintained by the viewer. The viewer will use various culling techniques in order to maintain the value returned.

  Deprecated

  > Views can have independent framerates. This should be set using `View.getMinimumFramerate`.

  Returns: Promise

  > Promise that is resolved when the operation has completed.

`IWebViewer.``getModelReady`()
  getModelReady(): boolean

  Returns: boolean

`IWebViewer.``getRendererType`()
  getRendererType(): `RendererType`

  Gets the RendererType this viewer was created with.

  Returns: `RendererType`

  > the render mode.

`IWebViewer.``getSceneReady`()
  getSceneReady(): boolean

  Returns: boolean

`IWebViewer.``getStatistics`()
  getStatistics(calculateTotals: boolean): Promise

  Gets viewer statistics for the current rendered frame. Statistics marked with a (*) below must be calculated and will not be included in the results unless the calculateTotals parameter is true. The values of these items will be cached and only updated during the next call to this method with calculateTotals set to true.

  Parameters

  > calculateTotals: boolean

  > > Forces an update of the total count elements. Please note that repeatedly calculating these items can cause a performance impact.

  Returns: Promise

  > an object containing informational key/value pairs

`IWebViewer.``getStreamCutoffScale`()
  getStreamCutoffScale(): number

  Returns the scale factor that will be applied to the streaming size cutoff. An object whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff. A value of 0 disables the cutoff.

  Returns: number

`IWebViewer.``getStreamingMode`()
  getStreamingMode(): `StreamingMode`

  Gets the streaming mode this viewer was created with.

  Returns: `StreamingMode`

  > the streaming mode.

`IWebViewer.``getView`()
  getView(viewKey: `ViewKey`): (undefined | `IView`)

  Gets a view with the provided key.

  Parameters

  > viewKey: `ViewKey`

  > > The key of the view to be returned.

  Returns: (undefined | `IView`)

  > The view, or undefined if it doesn’t exist.

`IWebViewer.``getViewElement`()
  getViewElement(): HTMLDivElement

  Gets the view element for this viewer. This element contains the canvas

  Returns: HTMLDivElement

  > the view element

`IWebViewer.``getViewerVersionString`()
  getViewerVersionString(): string

  Returns the viewer version string.

  Returns: string

  > string containing version information for the viewer.

`IWebViewer.``moveToWindow`()
  moveToWindow(win: Window): void

  This method should be called when the viewer is being moved to a new window. An example use case would be opening a new pop up window.

  Parameters

  > win: Window

  > > the new document that this viewer will be associated with.

  Returns: void

`IWebViewer.``pauseRendering`()
  pauseRendering(callback: () => void): Promise

  Pauses rendering updates for all views. This function is useful when performing large batches of updates and you would like the result to appear all at once.

  Parameters

  > callback: () => void

  > > If provided, rendering will be paused, the callback will be called, and then rendering will be resumed once the callback returns or throws an exception.

  Returns: Promise

`IWebViewer.``redraw`()
  redraw(callback: () => void): void

  Forces the viewer to perform a full redraw of all views.

  Parameters

  > callback: () => void

  > > A function to be called once the draw is complete. This is provided instead of a `Promise` to ensure the callback is called before the start of another redraw.

  Returns: void

`IWebViewer.``registerCustomOperator`()
  registerCustomOperator(operator: `Operator`): `OperatorId`

  Associates a custom operator object with a system generated operatorId.

  Parameters

  > operator: `Operator`

  Returns: `OperatorId`

  > an operatorId to be used for this operator.

`IWebViewer.``removeView`()
  removeView(view: `IView`): void

  Removes an existing view from the page. Note that the default view cannot be removed.

  Parameters

  > view: `IView`

  > > The view to remove.

  Returns: void

`IWebViewer.``reset`()
  reset(durationCameraTransition: number): Promise

  Reset the camera, visibility, and transforms to their default state

  Parameters

  > durationCameraTransition: number

  Returns: Promise

  > Promise that resolves when the operation has completed.

`IWebViewer.``resetClientTimeout`()
  resetClientTimeout(): void

  Resets the client timeout to the duration set with setClientTimeout.

  Returns: void

`IWebViewer.``resizeCanvas`()
  resizeCanvas(): void

  This method should be called after the container element is moved or resized.

  Returns: void

`IWebViewer.``resumeRendering`()
  resumeRendering(): Promise

  Resumes rendering for all views.

  Returns: Promise

`IWebViewer.``selectPart`()
  selectPart(nodeId: (None | number), selectionMode: `SelectionMode`): `SelectionType`

  Selects a part with the given Id.

  Parameters

  > nodeId: (None | number)

  > > nodeId of the part to select. Pass null to clear the selection.

  > selectionMode: `SelectionMode`

  Returns: `SelectionType`

`IWebViewer.``setAllowHighDpi`()
  setAllowHighDpi(allow: boolean): void

  Controls rendering on high DPI displays. If true, the image will be rendered at full resolution when a high-DPI display is detected. If false, the image may be rendered at a lower resolution. The default value is false. This method may be called any time during or after the sceneReady callback has triggered.

  Parameters

  > allow: boolean

  > > controls the high DPI Setting.

  Returns: void

`IWebViewer.``setCallbacks`()
  setCallbacks(callbacks: `CallbackMap`): void

  Registers callbacks that will be called when their corresponding events occur.

  Parameters

  > callbacks: `CallbackMap`

  > > object with property names set to corresponding functions to be called when the event occurs.

  Returns: void

`IWebViewer.``setClientTimeout`()
  setClientTimeout(timeoutDuration: number, warningTime: number): boolean

  Sets the parameters for client driven timeout monitoring. If no input is recorded for the the duration, the viewer will disconnect and free server resources. Calling this method will reset any pending timeout duration. No timeout will occur when viewing SCS Files. The default value is to disconnect after 15 minutes, with a warning issued after 14 minutes of inactivity. <br><br> <strong>Please note:</strong> Both parameters are required.

  Parameters

  > timeoutDuration: number

  > > the total time in minutes of inactivity that is allowed before a timeout event occurs

  > warningTime: number

  > > the number of minutes before issuing a timeoutWarning event

  Returns: boolean

  > boolean value indicating whether the timeout values were sucessfully updated

`IWebViewer.``setContextMenuStatus`()
  setContextMenuStatus(isActive: boolean): void

  Sets a boolean with the status of the context menu

  Parameters

  > isActive: boolean

  Returns: void

`IWebViewer.``setMinimumFramerate`()
  setMinimumFramerate(value: number): Promise

  Sets a minimum frame rate that will be maintained by all views. Views will use various culling techniques in order to maintain the value passed in.

  Passing `0` will cause the entire scene to be drawn for every frame.

  Parameters

  > value: number

  > > The frame rate for the views to maintain.

  Returns: Promise

  > Promise that is resolved when the operation has completed.

`IWebViewer.``setServerRenderQuality`()
  setServerRenderQuality(jpegQualityLow: number, jpegQualityHigh: number, scaleLow: number, scaleHigh: number): void

  Sets the image quality settings for the high quality and low quality server side render. The low quality settings will be applied during model interaction (camera changes, selection, etc)

  Parameters

  > jpegQualityLow: number

  > > The JPEG quality of the low quality render frame

  > jpegQualityHigh: number

  > > The JPEG quality of the high quality render frame

  > scaleLow: number

  > > The scale factor for the low quality render frame

  > scaleHigh: number

  > > The scale factor for the high quality render frame

  Returns: void

`IWebViewer.``setStreamCutoffScale`()
  setStreamCutoffScale(value: number): Promise

  Specifies a scale factor that will be applied to the streaming size cutoff. An object whose projected size is lower than the cutoff will not be streamed until its projected size reaches the cutoff.

  This value may also be set for file-based sessions. In that case, when loading an SCS file based assembly via XML, projected size will be calculated on a per-file basis using the bounding information provided in the XML. For additional information, refer to [[Model.loadSubtreeFromXmlBuffer]].

  A value of 0 will disable the cutoff. The value should be in the interval of [0.0, 2.0].

  Parameters

  > value: number

  Returns: Promise

`IWebViewer.``setViewOrientation`()
  setViewOrientation(orientation: `ViewOrientation`, duration: number): Promise

  Sets the orientation of the current model view.

  Parameters

  > orientation: `ViewOrientation`

  > > a [[ViewOrientation]] object specifying back, front, top, etc.

  > duration: number

  > > the time in milliseconds for the model to transition to the new view orientation.

  Returns: Promise

`IWebViewer.``shutdown`()
  shutdown(): void

  Releases the resources used by the viewer. This method should be called when the viewer is no longer needed but the page is not being reloaded.

  Returns: void

`IWebViewer.``start`()
  start(): boolean

  Starts the viewer and begins the loading process

  Returns: boolean

`IWebViewer.``takeSnapshot`()
  takeSnapshot(config: `SnapshotConfig`): Promise

  Creates an Image of the current canvas

  Parameters

  > config: `SnapshotConfig`

  Returns: Promise

`IWebViewer.``trigger`()
  trigger(name: “bcfLoaded”, id: number, filename: string): void

  Parameters

  > name: “bcfLoaded”

  > id: number

  > filename: string

  Returns: void

  trigger(name: “bcfRemoved”, id: number): void

  Parameters

  > name: “bcfRemoved”

  > id: number

  Returns: void

  trigger(name: “handleEvent”, eventType: `HandleEventType`, nodeIds: number[], initialMatrices: `Matrix`[], newMatrices: `Matrix`[]): void

  Parameters

  > name: “handleEvent”

  > eventType: `HandleEventType`

  > nodeIds: number[]

  > initialMatrices: `Matrix`[]

  > newMatrices: `Matrix`[]

  Returns: void

  trigger(name: “handleEventEnd”, eventType: `HandleEventType`, nodeIds: number[], initialMatrices: `Matrix`[], newMatrices: `Matrix`[]): void

  Parameters

  > name: “handleEventEnd”

  > eventType: `HandleEventType`

  > nodeIds: number[]

  > initialMatrices: `Matrix`[]

  > newMatrices: `Matrix`[]

  Returns: void

  trigger(name: “handleEventStart”, eventType: `HandleEventType`, nodeIds: number[], initialMatrices: `Matrix`[]): void

  Parameters

  > name: “handleEventStart”

  > eventType: `HandleEventType`

  > nodeIds: number[]

  > initialMatrices: `Matrix`[]

  Returns: void

  trigger(name: “cuttingPlaneDragStart”, cuttingSection: `ICuttingSection`, planeIndex: number): void

  Parameters

  > name: “cuttingPlaneDragStart”

  > cuttingSection: `ICuttingSection`

  > planeIndex: number

  Returns: void

  trigger(name: “cuttingPlaneDrag”, cuttingSection: `ICuttingSection`, planeIndex: number): void

  Parameters

  > name: “cuttingPlaneDrag”

  > cuttingSection: `ICuttingSection`

  > planeIndex: number

  Returns: void

  trigger(name: “cuttingPlaneDragEnd”, cuttingSection: `ICuttingSection`, planeIndex: number): void

  Parameters

  > name: “cuttingPlaneDragEnd”

  > cuttingSection: `ICuttingSection`

  > planeIndex: number

  Returns: void

  trigger(name: “cuttingSectionsLoaded”): void

  Parameters

  > name: “cuttingSectionsLoaded”

  Returns: void

  trigger(name: “redlineCreated”, redlineMarkup: `RedlineItem`): void

  Parameters

  > name: “redlineCreated”

  > redlineMarkup: `RedlineItem`

  Returns: void

  trigger(name: “redlineDeleted”, redlineMarkup: `RedlineItem`): void

  Parameters

  > name: “redlineDeleted”

  > redlineMarkup: `RedlineItem`

  Returns: void

  trigger(name: “redlineUpdated”, redlineMarkup: `RedlineItem`): void

  Parameters

  > name: “redlineUpdated”

  > redlineMarkup: `RedlineItem`

  Returns: void

  trigger(name: “measurementBegin”): void

  Parameters

  > name: “measurementBegin”

  Returns: void

  trigger(name: “measurementCreated”, measurement: `MeasureMarkup`): void

  Parameters

  > name: “measurementCreated”

  > measurement: `MeasureMarkup`

  Returns: void

  trigger(name: “measurementDeleted”, measurement: `MeasureMarkup`): void

  Parameters

  > name: “measurementDeleted”

  > measurement: `MeasureMarkup`

  Returns: void

  trigger(name: “measurementValueSet”, measurement: `MeasureMarkup`): void

  Parameters

  > name: “measurementValueSet”

  > measurement: `MeasureMarkup`

  Returns: void

  trigger(name: “measurementShown”, measurement: `MeasureMarkup`): void

  Parameters

  > name: “measurementShown”

  > measurement: `MeasureMarkup`

  Returns: void

  trigger(name: “measurementHidden”, measurement: `MeasureMarkup`): void

  Parameters

  > name: “measurementHidden”

  > measurement: `MeasureMarkup`

  Returns: void

  trigger(name: “noteTextCreated”, noteText: NoteText): void

  Parameters

  > name: “noteTextCreated”

  > noteText: NoteText

  Returns: void

  trigger(name: “noteTextDeleted”, noteText: NoteText): void

  Parameters

  > name: “noteTextDeleted”

  > noteText: NoteText

  Returns: void

  trigger(name: “noteTextUpdated”, noteText: NoteText): void

  Parameters

  > name: “noteTextUpdated”

  > noteText: NoteText

  Returns: void

  trigger(name: “noteTextHidden”, noteText: NoteText): void

  Parameters

  > name: “noteTextHidden”

  > noteText: NoteText

  Returns: void

  trigger(name: “noteTextShown”, noteText: NoteText): void

  Parameters

  > name: “noteTextShown”

  > noteText: NoteText

  Returns: void

  trigger(name: “walkOperatorActivated”): void

  Parameters

  > name: “walkOperatorActivated”

  Returns: void

  trigger(name: “walkOperatorDeactivated”): void

  Parameters

  > name: “walkOperatorDeactivated”

  Returns: void

  trigger(name: “viewCreated”, view: `MarkupView`): void

  Parameters

  > name: “viewCreated”

  > view: `MarkupView`

  Returns: void

  trigger(name: “viewDeleted”, view: `MarkupView`): void

  Parameters

  > name: “viewDeleted”

  > view: `MarkupView`

  Returns: void

  trigger(name: “viewLoaded”, view: `MarkupView`): void

  Parameters

  > name: “viewLoaded”

  > view: `MarkupView`

  Returns: void

  trigger(name: “contextMenu”, position: `Point2`, modifiers: `KeyModifiers`): void

  Parameters

  > name: “contextMenu”

  > position: `Point2`

  > modifiers: `KeyModifiers`

  Returns: void

  trigger(name: “beginInteraction”): void

  Parameters

  > name: “beginInteraction”

  Returns: void

  trigger(name: “endInteraction”): void

  Parameters

  > name: “endInteraction”

  Returns: void

  trigger(name: keyof `CallbackMap`, args: any[]): void

  Used to trigger Web Viewer events from operators. Refer to the overloaded method signatures for acceptable invocations of this method. Refer to [[CallbackMap]] for additional details for each event.

  Parameters

  > name: keyof `CallbackMap`

  > args: any[]

  Returns: void

`IWebViewer.``unregisterCustomOperator`()
  unregisterCustomOperator(operatorId: `OperatorId`): void

  Removes a previously registered custom operator from the system.

  Parameters

  > operatorId: `OperatorId`

  > > the ID of the operator that is to be unregistered

  Returns: void

`IWebViewer.``unsetCallbacks`()
  unsetCallbacks(callbacks: `CallbackMap`): void

  Unregisters callbacks from the system. Note the actual function object passed in must be the same as the one that was registered using setCallbacks.

  Parameters

  > callbacks: `CallbackMap`

  > > object with property names set to corresponding functions to be unregistered.

  Returns: void

`IWebViewer.``waitForIdle`()
  waitForIdle(config: { redraw: boolean }): Promise

  Returns a Promise that will resolve after streaming and associated asynchronous operations complete and the scene is fully drawn.

  Parameters

  > config: { redraw: boolean }

  Returns: Promise

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Visualize Web or choose a sample question below to start a conversation:

What is HOOPS Visualize Web?
What are the latest release notes for HOOPS Visualize Web?
How do I start evaluating HOOPS Visualize Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...