API Search || Global Search
API Reference   >   Viewing   >   HOOPS Web Viewer
Communicator.CallbackMap

 CallbackMap

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

Properties

Optional XHRonerror

XHRonerror: function

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.

param

Describes the error.

Type declaration

    • (errorEvent: ErrorEvent): void
    • Parameters

      • errorEvent: ErrorEvent

      Returns void

Optional XHRonloadend

XHRonloadend: function

Triggered when an HTTP request completes.

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

param

Describes the progress of the completed load.

param

The status of the request.

param

The URI of the request.

See also:

Type declaration

    • (progressEvent: ProgressEvent, status: number, uri: string): void
    • Parameters

      • progressEvent: ProgressEvent
      • status: number
      • uri: string

      Returns void

Optional XHRonprogress

XHRonprogress: function

Triggered during load progress of HTTP requests.

Happens when loading a model via an HTTP request.

param

Describes the progress of the load.

Type declaration

    • (progressEvent: ProgressEvent): void
    • Parameters

      • progressEvent: ProgressEvent

      Returns void

Optional addCuttingSection

addCuttingSection: function

Triggered when a cutting section is added to the scene.

param

The cutting section added.

Type declaration

Optional assemblyTreeReady

assemblyTreeReady: function

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

Type declaration

    • (): void
    • Returns void

Optional bcfLoaded

bcfLoaded: function

Triggered after a BCF file has been loaded.

param

index associated with the bcf file.

param

associated with the bcf file.

Type declaration

    • (id: number, filename: BCFName): void
    • Parameters

      Returns void

Optional bcfRemoved

bcfRemoved: function

Triggered after a BCF file has been removed.

Type declaration

    • (id: number): void
    • Parameters

      • id: number

      Returns void

Optional beginInteraction

beginInteraction: function

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

Type declaration

    • (): void
    • Returns void

Optional cadViewCreated

cadViewCreated: function

Triggered when a CAD View is created.

param

The CadViewId of the CAD View.

param

The name of the CAD View.

Type declaration

    • (cadViewId: CadViewId, cadViewName: string): void
    • Parameters

      Returns void

Optional camera

camera: function

Triggered when the camera changes.

Type declaration

    • The changed camera.

      Parameters

      Returns void

Optional cappingIdle

cappingIdle: function

Triggered when capping geometry generation becomes idle or active.

param

true if becoming idle. false if becoming active.

param

The number of geometry instances with capped faces.

Type declaration

    • (isIdle: boolean, cappedInstanceCount: number): void
    • Parameters

      • isIdle: boolean
      • cappedInstanceCount: number

      Returns void

Optional configurationActivated

configurationActivated: function

Triggered when a Configuration is activated.

param

The NodeId of the activated Configuration.

Type declaration

    • Parameters

      Returns void

Optional contextMenu

contextMenu: function

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

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

param

The window position of the mouse at the time of trigger.

param

The active key modifiers at the time of trigger.

Type declaration

Optional cuttingPlaneDrag

cuttingPlaneDrag: function

Triggered when a cutting plane is dragged.

param

The cutting section containing the cutting plane.

param

The index of the cutting plane in the cutting section.

Type declaration

Optional cuttingPlaneDragEnd

cuttingPlaneDragEnd: function

Triggered when a cutting plane drag event stops.

param

The cutting section containing the cutting plane.

param

The index of the cutting plane in the cutting section.

Type declaration

Optional cuttingPlaneDragStart

cuttingPlaneDragStart: function

Triggered when a cutting plane drag event starts.

param

The cutting section containing the cutting plane.

param

The index of the cutting plane in the cutting section.

Type declaration

Optional deprecated

deprecated: function

Triggered when a function marked (@deprecated) is called.

param

The name of the class owning the deprecated function.

param

The name of the called deprecated function.

Type declaration

    • (classNameOfDeprecatedFunction: string, deprecatedFunctionName: string): void
    • Parameters

      • classNameOfDeprecatedFunction: string
      • deprecatedFunctionName: string

      Returns void

Optional endInteraction

endInteraction: function

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.

Type declaration

    • (): void
    • Returns void

Optional explode

explode: function

Triggered when the expode magnitude of ExplodeManager changes.

param

The new explosion magnitude.

Type declaration

    • (magnitude: number): void
    • Parameters

      • magnitude: number

      Returns void

Optional firstModelLoaded

firstModelLoaded: function

Triggered when the first model of a scene gets loaded.

Clearing or switching models clears allows this to be triggered again.

param

The root node IDs of the loaded model.

Type declaration

    • (modelRootIds: NodeId[]): void
    • Parameters

      • modelRootIds: NodeId[]

      Returns void

Optional frameDrawn

frameDrawn: function

Triggered when a frame has been drawn.

Type declaration

    • (): void
    • Returns void

Optional handleEvent

handleEvent: function

Triggered when a geometry handle is moved.

param

The type of the handle event.

param

The node IDs bound to the handle.

param

The initial matrices for each of the supplied nodeIds.

param

The new matrices for each of the supplied nodeIds.

Type declaration

    • (eventType: HandleEventType, nodeIds: NodeId[], initialMatrices: Matrix[], newMatrices: Matrix[]): void
    • Parameters

      • eventType: HandleEventType
      • nodeIds: NodeId[]
      • initialMatrices: Matrix[]
      • newMatrices: Matrix[]

      Returns void

Optional handleEventEnd

handleEventEnd: function

Triggered when a geometry handle is no longer selected.

param

The type of the handle event.

param

The node IDs bound to the handle.

param

The initial matrices for each of the supplied nodeIds.

param

The new matrices for each of the supplied nodeIds.

Type declaration

    • (eventType: HandleEventType, nodeIds: NodeId[], initialMatrices: Matrix[], newMatrices: Matrix[]): void
    • Parameters

      • eventType: HandleEventType
      • nodeIds: NodeId[]
      • initialMatrices: Matrix[]
      • newMatrices: Matrix[]

      Returns void

Optional handleEventStart

handleEventStart: function

Triggered when a geometry handle is selected.

param

The type of the handle event.

param

The node IDs bound to the handle.

param

The initial matrices for each of the supplied nodeIds.

Type declaration

    • (eventType: HandleEventType, nodeIds: NodeId[], initialMatrices: Matrix[]): void
    • Parameters

      Returns void

Optional hwfParseComplete

hwfParseComplete: function

Triggered when HWF parsing becomes completed.

Type declaration

    • (): void
    • Returns void

Optional incrementalSelectionBatchBegin

incrementalSelectionBatchBegin: function

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

See also:

Type declaration

    • (): void
    • Returns void

Optional incrementalSelectionBatchEnd

incrementalSelectionBatchEnd: function

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

See also:

Type declaration

    • (): void
    • Returns void

Optional incrementalSelectionEnd

incrementalSelectionEnd: function

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

See also:

Type declaration

    • (): void
    • Returns void

Optional info

info: function

Triggered when an info message is generated by the viewer.

param

The type of the message.

param

The message.

Type declaration

    • (infoType: InfoType, message: string): void
    • Parameters

      Returns void

Optional lineCreated

lineCreated: function

Triggered when a markup line is created.

param

The created markup line.

Type declaration

Optional lineDeleted

lineDeleted: function

Triggered when a markup line is deleted.

param

The deleted markup line.

Type declaration

Optional lineLoaded

lineLoaded: function

Triggered when a markup line is loaded.

param

The loaded markup line.

Type declaration

Optional measurement    [deprecated]

measurement: function

Type declaration

Optional measurementBegin

measurementBegin: function

Triggered when a measurement operator has begun measuring.

Type declaration

    • (): void
    • Returns void

Optional measurementCreated

measurementCreated: function

Triggered when a measurement is fully created.

param

The created measurement.

Type declaration

Optional measurementDeleted

measurementDeleted: function

Triggered when a measurement is deleted by its MeasureManager.

param

The deleted measurement.

See also:

Type declaration

Optional measurementHidden

measurementHidden: function

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

param

The hidden measurement.

See also:

Type declaration

Optional measurementLoaded

measurementLoaded: function

Triggered when a measurement loaded by its MeasureManager.

param

The loaded measurement.

See also:

Type declaration

Optional measurementShown

measurementShown: function

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

param

The shown measurement.

See also:

Type declaration

Optional measurementValueSet

measurementValueSet: function

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.

param

The modified measurement.

Type declaration

Optional missingModel

missingModel: function

Triggered when a missing model is discovered during a load.

param

The path of the missing model.

Type declaration

    • (modelPath: string): void
    • Parameters

      • modelPath: string

      Returns void

Optional modelLoadBegin

modelLoadBegin: function

Triggered immediately when Model.switchToModel is called.

Type declaration

    • (): void
    • Returns void

Optional modelLoadFailure

modelLoadFailure: function

Triggered when a model could not be loaded.

param

The name of the model that failed to load.

param

The reason the model failed to load.

param

The error object thrown when the load failed, if available.

Type declaration

    • (modelName: ScModelName, reason: string, error?: any): void
    • Parameters

      • modelName: ScModelName
      • reason: string
      • Optional error: any

      Returns void

Optional modelLoaded    [deprecated]

modelLoaded: function
deprecated

Use subtreeLoaded instead.

Type declaration

    • (modelRootIds: NodeId[], source: NodeSource): void
    • Parameters

      Returns void

Optional modelStructureHeaderParsed

modelStructureHeaderParsed: function

Triggered when a model header has been parsed.

param

The name of the original model file.

param

The type of the original model file.

Type declaration

    • (filename: string, fileType: FileType): void
    • Parameters

      Returns void

Optional modelStructureLoadBegin    [deprecated]

modelStructureLoadBegin: function
deprecated

Type declaration

    • (): void
    • Returns void

Optional modelStructureLoadEnd    [deprecated]

modelStructureLoadEnd: function
deprecated

Type declaration

    • (): void
    • Returns void

Optional modelStructureParseBegin    [deprecated]

modelStructureParseBegin: function
deprecated

Type declaration

    • (): void
    • Returns void

Optional modelStructureReady

modelStructureReady: function

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.

Type declaration

    • (): void
    • Returns void

Optional modelSwitchStart

modelSwitchStart: function

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

param

true if the callback was triggered by Model.clear. false otherwise.

Type declaration

    • (clearOnly: boolean): void
    • Parameters

      • clearOnly: boolean

      Returns void

Optional modelSwitched

modelSwitched: function

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

param

true if the callback was triggered by Model.clear. false otherwise.

param

The root IDs of the newly loaded assembly tree nodes.

Type declaration

    • (clearOnly: boolean, modelRootIds: NodeId[]): void
    • Parameters

      • clearOnly: boolean
      • modelRootIds: NodeId[]

      Returns void

Optional partsVisibilityHidden    [deprecated]

partsVisibilityHidden: function

Triggered when parts are hidden.

param

The node IDs containing the bodies that were hidden.

deprecated

Use visibilityChanged instead.

Type declaration

    • (nodeIds: NodeId[]): void
    • Parameters

      • nodeIds: NodeId[]

      Returns void

Optional partsVisibilityShown    [deprecated]

partsVisibilityShown: function

Triggered when parts are shown.

param

The node IDs containing the bodies that were shown.

deprecated

Use visibilityChanged instead.

Type declaration

    • (nodeIds: NodeId[]): void
    • Parameters

      • nodeIds: NodeId[]

      Returns void

Optional redlineCreated

redlineCreated: function

Triggered when a redline markup item is created.

param

The created redline.

Type declaration

Optional redlineDeleted

redlineDeleted: function

Triggered when a redline markup item is deleted.

param

The deleted redline.

Type declaration

Optional redlineUpdated

redlineUpdated: function

Triggered when a redline markup item is updated.

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

param

The deleted redline.

Type declaration

Optional removeCuttingSection

removeCuttingSection: function

Triggered when a cutting section is removed.

Type declaration

    • (): void
    • Returns void

Optional sceneReady

sceneReady: function

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.

Type declaration

    • (): void
    • Returns void

Optional sceneRendered    [deprecated]

sceneRendered: function
deprecated

Use frameDrawn instead.

Triggered when a frame has been drawn.

Type declaration

    • (): void
    • Returns void

Optional selection    [deprecated]

selection: function
deprecated

Use selectionArray instead.

Triggered when a selection event occurs.

param

A list of selection events.

Type declaration

    • (...selectionEvents: NodeSelectionEvent[]): void
    • Parameters

      • Rest ...selectionEvents: NodeSelectionEvent[]

      Returns void

Optional selectionArray

selectionArray: function

Triggered when a selection event occurs.

param

A list of selection events.

param

true if the selection items have been removed from the selection set. false otherwise.

Type declaration

    • (selectionEvents: NodeSelectionEvent[], removed: boolean): void
    • Parameters

      • selectionEvents: NodeSelectionEvent[]
      • removed: boolean

      Returns void

Optional shatteredXmlStructureReady    [deprecated]

shatteredXmlStructureReady: function
deprecated

Triggered when the node structure parsed directly from the XML file of a shattered model is parsed.

param

The node ID of a model root node in the shattered XML file

Type declaration

    • Parameters

      Returns void

Optional sheetActivated

sheetActivated: function

Triggered when a drawing sheet has been activated.

param

The node ID of the activated sheet.

Type declaration

Optional sheetDeactivated

sheetDeactivated: function

Triggered when drawing sheets have been deactivated.

Type declaration

    • (): void
    • Returns void

Optional streamingActivated

streamingActivated: function

Triggered when the client begins streaming data from the server.

Type declaration

    • (): void
    • Returns void

Optional streamingDeactivated

streamingDeactivated: function

Triggered when streaming from the client has stopped.

Type declaration

    • (): void
    • Returns void

Optional subtreeDeleted

subtreeDeleted: function

Triggered when a subtree has been deleted.

param

A list of deleted subtree roots.

Type declaration

    • (modelRootIds: NodeId[]): void
    • Parameters

      • modelRootIds: NodeId[]

      Returns void

Optional subtreeLoaded

subtreeLoaded: function

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

param

A list of loaded subtree roots.

Type declaration

    • (modelRootIds: NodeId[], source: NodeSource): void
    • Parameters

      Returns void

Optional timeout

timeout: function

Triggered when a timeout due to inactivity occurs.

Type declaration

    • (): void
    • Returns void

Optional timeoutWarning

timeoutWarning: function

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

param

The remaining time until the timeout callback gets triggered.

Type declaration

    • (minutesRemaining: number): void
    • Parameters

      • minutesRemaining: number

      Returns void

Optional transitionBegin

transitionBegin: function

Triggered when a camera transition begins.

param

The duration of the transition in milliseconds.

Type declaration

    • (duration: number): void
    • Parameters

      • duration: number

      Returns void

Optional transitionEnd

transitionEnd: function

Triggered when a camera transition ends.

Type declaration

    • (): void
    • Returns void

Optional viewAxes

viewAxes: function

Triggered after the view axes have been set.

param

The front vector of the view.

param

The up vector of the view.

Type declaration

Optional viewCreated

viewCreated: function

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

param

The created markup view.

See also:

Type declaration

Optional viewDeactivated

viewDeactivated: function

Triggered when a view is deactivated.

param

The deactivated markup view.

See also:

Type declaration

Optional viewDeleted

viewDeleted: function

Triggered when a view is deleted.

param

The deleted markup view.

See also:

Type declaration

Optional viewLoaded

viewLoaded: function

Triggered when a view is loaded from data.

param

The loaded markup view.

See also:

Type declaration

Optional viewOrientation

viewOrientation: function

Triggered after the view orientation has changed.

param

The new view orientation.

See also:

Type declaration

Optional visibilityChanged

visibilityChanged: function

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.

param

IDs of Body nodes that were shown.

param

IDs of Body nodes that were hidden.

Type declaration

    • (shownBodyIds: BodyId[], hiddenBodyIds: BodyId[]): void
    • Parameters

      • shownBodyIds: BodyId[]
      • hiddenBodyIds: BodyId[]

      Returns void

Optional volumeSelectionBatchBegin    [deprecated]

volumeSelectionBatchBegin: function
deprecated

Use incrementalSelectionBatchBegin instead.

Triggered before another batch of selected entities is put into the SelectionManager.

Type declaration

    • (): void
    • Returns void

Optional volumeSelectionBatchEnd    [deprecated]

volumeSelectionBatchEnd: function
deprecated

Use incrementalSelectionBatchEnd instead.

Triggered after another batch of selected entities is put into the SelectionManager.

Type declaration

    • (): void
    • Returns void

Optional volumeSelectionEnd    [deprecated]

volumeSelectionEnd: function
deprecated

Use incrementalSelectionEnd instead.

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

Type declaration

    • (): void
    • Returns void

Optional walkOperatorActivated

walkOperatorActivated: function

Triggered when the Operator.CameraWalkOperator becomes active.

Type declaration

    • (): void
    • Returns void

Optional webGlContextLost

webGlContextLost: function

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

Type declaration

    • (): void
    • Returns void

Optional websocketConnectionClosed

websocketConnectionClosed: function

Triggered when the browser stream websocket connection is closed.

Type declaration

    • (): void
    • Returns void