# CallbackMap

class `CallbackMap`()

  Object which maps callback names to functions. Used by [[WebViewer.setCallbacks]].

  ## Index

  Properties

  - `addCuttingSection`
  - `assemblyTreeReady`
  - `bcfLoaded`
  - `bcfRemoved`
  - `beginInteraction`
  - `cadViewCreated`
  - `camera`
  - `cappingIdle`
  - `configurationActivated`
  - `contextMenu`
  - `cuttingPlaneDrag`
  - `cuttingPlaneDragEnd`
  - `cuttingPlaneDragStart`
  - `cuttingSectionsLoaded`
  - `endInteraction`
  - `explode`
  - `firstModelLoaded`
  - `frameDrawn`
  - `handleEvent`
  - `handleEventEnd`
  - `handleEventStart`
  - `hwfParseComplete`
  - `incrementalSelectionBatchBegin`
  - `incrementalSelectionBatchEnd`
  - `incrementalSelectionEnd`
  - `info`
  - `lineCreated`
  - `lineDeleted`
  - `lineLoaded`
  - `measurementBegin`
  - `measurementCreated`
  - `measurementDeleted`
  - `measurementHidden`
  - `measurementLoaded`
  - `measurementShown`
  - `measurementValueSet`
  - `missingModel`
  - `modelLoadBegin`
  - `modelLoadFailure`
  - `modelStructureHeaderParsed`
  - `modelStructureReady`
  - `modelSwitched`
  - `modelSwitchStart`
  - `noteTextCreated`
  - `noteTextDeleted`
  - `noteTextHidden`
  - `noteTextShown`
  - `noteTextUpdated`
  - `overlayViewportSet`
  - `redlineCreated`
  - `redlineDeleted`
  - `redlineUpdated`
  - `removeCuttingSection`
  - `sceneReady`
  - `selectionArray`
  - `sheetActivated`
  - `sheetDeactivated`
  - `streamingActivated`
  - `streamingDeactivated`
  - `subtreeDeleted`
  - `subtreeLoaded`
  - `timeout`
  - `timeoutWarning`
  - `transitionBegin`
  - `transitionEnd`
  - `viewAxes`
  - `viewCreated`
  - `viewDeactivated`
  - `viewDeleted`
  - `viewLoaded`
  - `viewOrientation`
  - `visibilityChanged`
  - `walkOperatorActivated`
  - `walkOperatorDeactivated`
  - `webGlContextLost`
  - `websocketConnectionClosed`
  - `XHRonerror`
  - `XHRonloadend`
  - `XHRonprogress`

## Properties

`CallbackMap.``addCuttingSection`

  optional

  addCuttingSection: (cuttingSection: `ICuttingSection`) => void

  Triggered when a cutting section is added to the scene.

`CallbackMap.``assemblyTreeReady`

  optional

  assemblyTreeReady: () => void

  Triggered when methods on the [[Model]] class are allowed to be called.

`CallbackMap.``bcfLoaded`

  optional

  bcfLoaded: (id: number, filename: string) => void

  Triggered after a BCF file has been loaded.

`CallbackMap.``bcfRemoved`

  optional

  bcfRemoved: (id: number) => void

  Triggered after a BCF file has been removed.

`CallbackMap.``beginInteraction`

  optional

  beginInteraction: (view: `IView`) => void

  Triggered on the start of a mouse drag from any of the built-in Communicator operators.

`CallbackMap.``cadViewCreated`

  optional

  cadViewCreated: (cadViewId: number, cadViewName: string) => void

  Triggered when a CAD View is created.

`CallbackMap.``camera`

  optional

  camera: (camera: `Camera`, view: `IView`) => void

  Triggered when the camera changes.

`CallbackMap.``cappingIdle`

  optional

  cappingIdle: (isIdle: boolean, cappedInstanceCount: number) => void

  Triggered when capping geometry generation becomes idle or active.

`CallbackMap.``configurationActivated`

  optional

  configurationActivated: (nodeId: number) => void

  Triggered when a Configuration is activated.

`CallbackMap.``contextMenu`

  optional

  contextMenu: (position: `Point2`, modifiers: `KeyModifiers`) => void

  Triggered when `Ui.Context.ContextMenu` menu is shown or hidden.

  By default, this function is called on right mouse-click events.

`CallbackMap.``cuttingPlaneDrag`

  optional

  cuttingPlaneDrag: (cuttingSection: `ICuttingSection`, planeIndex: number) => void

  Triggered when a cutting plane is dragged.

`CallbackMap.``cuttingPlaneDragEnd`

  optional

  cuttingPlaneDragEnd: (cuttingSection: `ICuttingSection`, planeIndex: number) => void

  Triggered when a cutting plane drag event stops.

`CallbackMap.``cuttingPlaneDragStart`

  optional

  cuttingPlaneDragStart: (cuttingSection: `ICuttingSection`, planeIndex: number) => void

  Triggered when a cutting plane drag event starts.

`CallbackMap.``cuttingSectionsLoaded`

  optional

  cuttingSectionsLoaded: () => void

  Triggered after a batch update to cutting sections, such as when deserializing from JSON data.

  This event may be triggered manually after modifying cutting sections to cause the UI state to be updated.

`CallbackMap.``endInteraction`

  optional

  endInteraction: (view: `IView`) => void

  Triggered at the end of a mouse drag from any of the built-in Communicator operators or if [[Operator.stopInteraction]] gets called for a given operator.

`CallbackMap.``explode`

  optional

  explode: (magnitude: number) => void

  Triggered when the expode magnitude of [[ExplodeManager]] changes.

`CallbackMap.``firstModelLoaded`

  optional

  firstModelLoaded: (modelRootIds: number[], isHwf: boolean) => void

  Triggered when the first model of a scene gets loaded.

  Clearing or switching models allows this to be triggered again.

`CallbackMap.``frameDrawn`

  optional

  frameDrawn: (camera: `Camera`, visiblePoints: number[], viewKey: `ViewKey`) => void

  Triggered when a frame has been drawn.

`CallbackMap.``handleEvent`

  optional

  handleEvent: (eventType: `HandleEventType`, nodeIds: number[], initialMatrices: `Matrix`[], newMatrices: `Matrix`[]) => void

  Triggered when a geometry handle is moved.

`CallbackMap.``handleEventEnd`

  optional

  handleEventEnd: (eventType: `HandleEventType`, nodeIds: number[], initialMatrices: `Matrix`[], newMatrices: `Matrix`[]) => void

  Triggered when a geometry handle is no longer selected.

`CallbackMap.``handleEventStart`

  optional

  handleEventStart: (eventType: `HandleEventType`, nodeIds: number[], initialMatrices: `Matrix`[]) => void

  Triggered when a geometry handle is selected.

`CallbackMap.``hwfParseComplete`

  optional

  hwfParseComplete: () => void

  Triggered when HWF parsing becomes completed.

`CallbackMap.``incrementalSelectionBatchBegin`

  optional

  incrementalSelectionBatchBegin: () => void

  Triggered before a batch of incrementally selected entities is put into the [[SelectionManager]].

  See also:

  - [[SelectionManager.advanceIncrementalSelection]]

`CallbackMap.``incrementalSelectionBatchEnd`

  optional

  incrementalSelectionBatchEnd: () => void

  Triggered after a batch of incrementally selected entities is put into the [[SelectionManager]].

  See also:

  - [[SelectionManager.advanceIncrementalSelection]]

`CallbackMap.``incrementalSelectionEnd`

  optional

  incrementalSelectionEnd: () => void

  Triggered after all batches of incrementally selected entities have been put into the [[SelectionManager]].

  See also:

  - [[SelectionManager.advanceIncrementalSelection]]

`CallbackMap.``info`

  optional

  info: (infoType: `InfoType`, message: string) => void

  Triggered when an info message is generated by the viewer.

`CallbackMap.``lineCreated`

  optional

  lineCreated: (line: `LineMarkup`) => void

  Triggered when a markup line is created.

`CallbackMap.``lineDeleted`

  optional

  lineDeleted: (line: `LineMarkup`) => void

  Triggered when a markup line is deleted.

`CallbackMap.``lineLoaded`

  optional

  lineLoaded: (line: `LineMarkup`) => void

  Triggered when a markup line is loaded.

`CallbackMap.``measurementBegin`

  optional

  measurementBegin: () => void

  Triggered when a measurement operator has begun measuring.

`CallbackMap.``measurementCreated`

  optional

  measurementCreated: (measurement: `MeasureMarkup`) => void

  Triggered when a measurement is fully created.

`CallbackMap.``measurementDeleted`

  optional

  measurementDeleted: (measurement: `MeasureMarkup`) => void

  Triggered when a measurement is deleted by its [[MeasureManager]].

`CallbackMap.``measurementHidden`

  optional

  measurementHidden: (measurement: `MeasureMarkup`) => void

  Triggered when a measurement is hidden by a call to its `setVisibility` method.

`CallbackMap.``measurementLoaded`

  optional

  measurementLoaded: (measurement: `MeasureMarkup`) => void

  Triggered when a measurement loaded by its [[MeasureManager]].

`CallbackMap.``measurementShown`

  optional

  measurementShown: (measurement: `MeasureMarkup`) => void

  Triggered when a measurement is shown by a call to its `setVisibility` method.

`CallbackMap.``measurementValueSet`

  optional

  measurementValueSet: (measurement: `MeasureMarkup`) => void

  Triggered when the measurement value is set but before it is displayed to the user.

  This callback is useful for customizing the display of measurement text by using its `getMeasurementValue` and `setMeasurementText` methods.

`CallbackMap.``missingModel`

  optional

  missingModel: (modelPath: string) => void

  Triggered when a missing model is discovered during a load.

`CallbackMap.``modelLoadBegin`

  optional

  modelLoadBegin: () => void

  Triggered immediately when [[Model.switchToModel]] is called.

`CallbackMap.``modelLoadFailure`

  optional

  modelLoadFailure: (modelName: string, reason: string, error: any) => void

  Triggered when a model could not be loaded.

`CallbackMap.``modelStructureHeaderParsed`

  optional

  modelStructureHeaderParsed: (filename: string, fileType: `FileType`) => void

  Triggered when a model header has been parsed.

`CallbackMap.``modelStructureReady`

  optional

  modelStructureReady: () => void

  Triggered when the model structure has been loaded and is ready to be queried.

  This callback will only be called after the [[assemblyTreeReady]] callback gets triggered.

`CallbackMap.``modelSwitched`

  optional

  modelSwitched: (clearOnly: boolean, modelRootIds: number[]) => void

  Triggered when [[Model.switchToModel]] or [[Model.clear]] is called. This gets triggered after any of the above methods complete.

`CallbackMap.``modelSwitchStart`

  optional

  modelSwitchStart: (clearOnly: boolean) => void

  Triggered when [[Model.switchToModel]] or [[Model.clear]] is called. This gets triggered after any of the above methods begin.

`CallbackMap.``noteTextCreated`

  optional

  noteTextCreated: (noteText: NoteText) => void

  Triggered when note text is created, especially via the note operator.

`CallbackMap.``noteTextDeleted`

  optional

  noteTextDeleted: (noteText: NoteText) => void

  Triggered when note text is deleted.

`CallbackMap.``noteTextHidden`

  optional

  noteTextHidden: (noteText: NoteText) => void

  Triggered when note text is hidden, especially via the note operator.

`CallbackMap.``noteTextShown`

  optional

  noteTextShown: (noteText: NoteText) => void

  Triggered when note text is shown, especially via the note operator.

`CallbackMap.``noteTextUpdated`

  optional

  noteTextUpdated: (noteText: NoteText) => void

  Triggered when note text is updated.

`CallbackMap.``overlayViewportSet`

  optional

  overlayViewportSet: (overlayIndex: number, view: `IView`) => void

  Triggered when an overlay viewport is set.

`CallbackMap.``redlineCreated`

  optional

  redlineCreated: (redlineMarkup: `RedlineItem`) => void

  Triggered when a redline markup item is created.

`CallbackMap.``redlineDeleted`

  optional

  redlineDeleted: (redlineMarkup: `RedlineItem`) => void

  Triggered when a redline markup item is deleted.

`CallbackMap.``redlineUpdated`

  optional

  redlineUpdated: (redlineMarkup: `RedlineItem`) => void

  Triggered when a redline markup item is updated.

  An update is triggered by changes in a redline markup item’s position, size, or text.

`CallbackMap.``removeCuttingSection`

  optional

  removeCuttingSection: () => void

  Triggered when a cutting section is removed.

`CallbackMap.``sceneReady`

  optional

  sceneReady: () => void

  Triggered when the scene is ready to be interacted with.

  [[View]]-related operations such as moving the camera may be invoked. However, operations requiring node IDs should not be called at this time.

`CallbackMap.``selectionArray`

  optional

  selectionArray: (selectionEvents: `NodeSelectionEvent`[], removed: boolean) => void

  Triggered when a selection event occurs.

`CallbackMap.``sheetActivated`

  optional

  sheetActivated: (nodeId: number) => void

  Triggered when a drawing sheet has been activated.

`CallbackMap.``sheetDeactivated`

  optional

  sheetDeactivated: () => void

  Triggered when drawing sheets have been deactivated.

`CallbackMap.``streamingActivated`

  optional

  streamingActivated: () => void

  Triggered when the client begins streaming data from the server.

`CallbackMap.``streamingDeactivated`

  optional

  streamingDeactivated: () => void

  Triggered when streaming from the client has stopped.

`CallbackMap.``subtreeDeleted`

  optional

  subtreeDeleted: (modelRootIds: number[]) => void

  Triggered when a subtree has been deleted.

`CallbackMap.``subtreeLoaded`

  optional

  subtreeLoaded: (modelRootIds: number[], source: `NodeSource`) => void

  Triggered when a subtree has been loaded. This includes loading a model as well as directly creating nodes.

`CallbackMap.``timeout`

  optional

  timeout: () => void

  Triggered when a timeout due to inactivity occurs.

`CallbackMap.``timeoutWarning`

  optional

  timeoutWarning: (minutesRemaining: number) => void

  Triggered when a timeout due to inactivity is about to occur.

`CallbackMap.``transitionBegin`

  optional

  transitionBegin: (duration: number, view: `IView`) => void

  Triggered when a camera transition begins.

`CallbackMap.``transitionEnd`

  optional

  transitionEnd: (view: `IView`) => void

  Triggered when a camera transition ends.

`CallbackMap.``viewAxes`

  optional

  viewAxes: (frontVector: `Point3`, upVector: `Point3`) => void

  Triggered after the view axes have been set.

`CallbackMap.``viewCreated`

  optional

  viewCreated: (view: `MarkupView`) => void

  Triggered when a view is created or by creating a redline item when no view is active.

`CallbackMap.``viewDeactivated`

  optional

  viewDeactivated: (view: `MarkupView`) => void

  Triggered when a view is deactivated.

`CallbackMap.``viewDeleted`

  optional

  viewDeleted: (view: `MarkupView`) => void

  Triggered when a view is deleted.

`CallbackMap.``viewLoaded`

  optional

  viewLoaded: (view: `MarkupView`) => void

  Triggered when a view is loaded from data.

`CallbackMap.``viewOrientation`

  optional

  viewOrientation: (orientation: `ViewOrientation`, view: `IView`) => void

  Triggered after the view orientation has changed.

`CallbackMap.``visibilityChanged`

  optional

  visibilityChanged: (shownBodyIds: number[], hiddenBodyIds: number[]) => void

  Triggered when nodes are shown or hidden. If `shownBodyIds` and `hiddenBodyIds` are both empty, only the visibility of structural nodes (nodes that do not directly contain geometry) changed.

`CallbackMap.``walkOperatorActivated`

  optional

  walkOperatorActivated: () => void

  Triggered when the [[Operator.CameraWalkOperator]] becomes active.

`CallbackMap.``walkOperatorDeactivated`

  optional

  walkOperatorDeactivated: () => void

  triggered when the [[Operator.CameraWalkOperator]] is deactivated.

`CallbackMap.``webGlContextLost`

  optional

  webGlContextLost: () => void

  Triggered when the browser causes the WebGL context to be lost and rendering cannot continue.

`CallbackMap.``websocketConnectionClosed`

  optional

  websocketConnectionClosed: () => void

  Triggered when the browser stream websocket connection is closed.

`CallbackMap.``XHRonerror`

  optional

  XHRonerror: (errorEvent: ErrorEvent) => void

  Triggered during load progress of HTTP requests.

  Happens when an error occurs during the loading of a model via an HTTP request. For some errors (e.g. 404) make sure to check the status of XHRonloadend instead.

`CallbackMap.``XHRonloadend`

  optional

  XHRonloadend: (progressEvent: ProgressEvent, status: number, uri: string) => void

  Triggered when an HTTP request completes.

  A completed HTTP request does not necessarily indicate success. Make sure to check the return status.

`CallbackMap.``XHRonprogress`

  optional

  XHRonprogress: (progressEvent: ProgressEvent) => void

  Triggered during load progress of HTTP requests.

  Happens when loading a model via an HTTP request.

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