CallbackMap

class Communicator.CallbackMap()

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

Properties


Properties

CallbackMap.XHRonerror
Type

function optional

Deprecated

Use fetchOnError instead. Triggered during load progress of HTTP requests.

Param errorEvent

Describes the error.

CallbackMap.XHRonerror(errorEvent)
Arguments
  • errorEvent (ErrorEvent()) –

Return type

void

CallbackMap.XHRonloadend
Type

function optional

Deprecated

Use fetchOnLoadEnd instead. Triggered when an HTTP request completes.

Param progressEvent

Describes the progress of the completed load.

Param status

The status of the request.

Param uri

The URI of the request.

CallbackMap.XHRonloadend(progressEvent, status, uri)
Arguments
  • progressEvent (ProgressEvent()) –

  • status (number()) –

  • uri (string()) –

Return type

void

CallbackMap.XHRonprogress
Type

function optional

Deprecated

Use fetchOnProgress instead. Triggered during load progress of HTTP requests.

Param progressEvent

Describes the progress of the load.

CallbackMap.XHRonprogress(progressEvent)
Arguments
  • progressEvent (ProgressEvent()) –

Return type

void

CallbackMap.addCuttingSection
Type

function optional

Triggered when a cutting section is added to the scene.

Param cuttingSection

The cutting section added.

CallbackMap.addCuttingSection(cuttingSection)
Arguments
Return type

void

CallbackMap.assemblyTreeReady
Type

function optional

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

CallbackMap.assemblyTreeReady()
Return type

void

CallbackMap.bcfLoaded
Type

function optional

Triggered after a BCF file has been loaded.

Param id

index associated with the bcf file.

Param filename

associated with the bcf file.

CallbackMap.bcfLoaded(id, filename)
Arguments
  • id (number()) –

  • filename (BCFName) –

Return type

void

CallbackMap.bcfRemoved
Type

function optional

Triggered after a BCF file has been removed.

CallbackMap.bcfRemoved(id)
Arguments
  • id (number()) –

Return type

void

CallbackMap.beginInteraction
Type

function optional

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

CallbackMap.beginInteraction()
Return type

void

CallbackMap.cadViewCreated
Type

function optional

Triggered when a CAD View is created.

Param cadViewId

The CadViewId of the CAD View.

Param cadViewName

The name of the CAD View.

CallbackMap.cadViewCreated(cadViewId, cadViewName)
Arguments
  • cadViewId (CadViewId) –

  • cadViewName (string()) –

Return type

void

CallbackMap.camera
Type

function optional

Triggered when the camera changes.

CallbackMap.camera(camera)

The changed camera.

Arguments
Return type

void

The changed camera.

CallbackMap.cappingIdle
Type

function optional

Triggered when capping geometry generation becomes idle or active.

Param isIdle

true if becoming idle. false if becoming active.

Param cappedInstanceCount

The number of geometry instances with capped faces.

CallbackMap.cappingIdle(isIdle, cappedInstanceCount)
Arguments
  • isIdle (boolean()) –

  • cappedInstanceCount (number()) –

Return type

void

CallbackMap.configurationActivated
Type

function optional

Triggered when a Configuration is activated.

Param nodeId

The NodeId of the activated Configuration.

CallbackMap.configurationActivated(nodeId)
Arguments
Return type

void

CallbackMap.contextMenu
Type

function optional

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

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

Param position

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

Param modifiers

The active key modifiers at the time of trigger.

CallbackMap.contextMenu(position, modifiers)
Arguments
Return type

void

CallbackMap.cuttingPlaneDrag
Type

function optional

Triggered when a cutting plane is dragged.

Param cuttingSection

The cutting section containing the cutting plane.

Param planeIndex

The index of the cutting plane in the cutting section.

CallbackMap.cuttingPlaneDrag(cuttingSection, planeIndex)
Arguments
Return type

void

CallbackMap.cuttingPlaneDragEnd
Type

function optional

Triggered when a cutting plane drag event stops.

Param cuttingSection

The cutting section containing the cutting plane.

Param planeIndex

The index of the cutting plane in the cutting section.

CallbackMap.cuttingPlaneDragEnd(cuttingSection, planeIndex)
Arguments
Return type

void

CallbackMap.cuttingPlaneDragStart
Type

function optional

Triggered when a cutting plane drag event starts.

Param cuttingSection

The cutting section containing the cutting plane.

Param planeIndex

The index of the cutting plane in the cutting section.

CallbackMap.cuttingPlaneDragStart(cuttingSection, planeIndex)
Arguments
Return type

void

CallbackMap.cuttingSectionsLoaded
Type

function optional

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.cuttingSectionsLoaded()
Return type

void

CallbackMap.deprecated
Type

function optional

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

Param classNameOfDeprecatedFunction

The name of the class owning the deprecated function.

Param deprecatedFunctionName

The name of the called deprecated function.

CallbackMap.deprecated(classNameOfDeprecatedFunction, deprecatedFunctionName)
Arguments
  • classNameOfDeprecatedFunction (string()) –

  • deprecatedFunctionName (string()) –

Return type

void

CallbackMap.endInteraction
Type

function optional

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.endInteraction()
Return type

void

CallbackMap.explode
Type

function optional

Triggered when the expode magnitude of ExplodeManager changes.

Param magnitude

The new explosion magnitude.

CallbackMap.explode(magnitude)
Arguments
  • magnitude (number()) –

Return type

void

CallbackMap.fetchOnError
Type

function optional

Triggered during load progress of HTTP requests sent via Fetch API.

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

Param errorEvent

Describes the error.

CallbackMap.fetchOnError(errorEvent)
Arguments
  • errorEvent (ErrorEvent()) –

Return type

void

CallbackMap.fetchOnLoadEnd
Type

function optional

Triggered when an HTTP request sent via Fetch API completes.

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

Param progressEvent

Describes the progress of the completed load.

Param status

The status of the request.

Param uri

The URI of the request.

CallbackMap.fetchOnLoadEnd(progressEvent, status, uri)
Arguments
  • progressEvent (ProgressEvent()) –

  • status (number()) –

  • uri (string()) –

Return type

void

CallbackMap.fetchOnProgress
Type

function optional

Triggered during load progress of HTTP requests via Fetch API.

Happens when loading a model via an HTTP request via Fetch API.

Param progressEvent

Describes the progress of the load.

CallbackMap.fetchOnProgress(progressEvent)
Arguments
  • progressEvent (ProgressEvent()) –

Return type

void

CallbackMap.firstModelLoaded
Type

function optional

Triggered when the first model of a scene gets loaded.

Clearing or switching models allows this to be triggered again.

Param modelRootIds

The root node IDs of the loaded model.

Param isHwf

True if the model is an HWF model, false otherwise.

CallbackMap.firstModelLoaded(modelRootIds, isHwf)
Arguments
  • modelRootIds ([NodeId]) –

  • isHwf (boolean()) –

Return type

void

CallbackMap.frameDrawn
Type

function optional

Triggered when a frame has been drawn.

Param camera

The camera used when the frame was drawn.

Param visiblePoints

A list of indices of points passed to View.setPointVisibilityTest

CallbackMap.frameDrawn(camera, visiblePoints)
Arguments
  • camera (Camera()) –

  • visiblePoints ([number]()) –

Return type

void

CallbackMap.handleEvent
Type

function optional

Triggered when a geometry handle is moved.

Param eventType

The type of the handle event.

Param nodeIds

The node IDs bound to the handle.

Param initialMatrices

The initial matrices for each of the supplied nodeIds.

Param newMatrices

The new matrices for each of the supplied nodeIds.

CallbackMap.handleEvent(eventType, nodeIds, initialMatrices, newMatrices)
Arguments
Return type

void

CallbackMap.handleEventEnd
Type

function optional

Triggered when a geometry handle is no longer selected.

Param eventType

The type of the handle event.

Param nodeIds

The node IDs bound to the handle.

Param initialMatrices

The initial matrices for each of the supplied nodeIds.

Param newMatrices

The new matrices for each of the supplied nodeIds.

CallbackMap.handleEventEnd(eventType, nodeIds, initialMatrices, newMatrices)
Arguments
Return type

void

CallbackMap.handleEventStart
Type

function optional

Triggered when a geometry handle is selected.

Param eventType

The type of the handle event.

Param nodeIds

The node IDs bound to the handle.

Param initialMatrices

The initial matrices for each of the supplied nodeIds.

CallbackMap.handleEventStart(eventType, nodeIds, initialMatrices)
Arguments
Return type

void

CallbackMap.hwfParseComplete
Type

function optional

Triggered when HWF parsing becomes completed.

CallbackMap.hwfParseComplete()
Return type

void

CallbackMap.incrementalSelectionBatchBegin
Type

function optional

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

See also: - SelectionManager.advanceIncrementalSelection

CallbackMap.incrementalSelectionBatchBegin()
Return type

void

CallbackMap.incrementalSelectionBatchEnd
Type

function optional

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

See also: - SelectionManager.advanceIncrementalSelection

CallbackMap.incrementalSelectionBatchEnd()
Return type

void

CallbackMap.incrementalSelectionEnd
Type

function optional

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

See also: - SelectionManager.advanceIncrementalSelection

CallbackMap.incrementalSelectionEnd()
Return type

void

CallbackMap.info
Type

function optional

Triggered when an info message is generated by the viewer.

Param infoType

The type of the message.

Param message

The message.

CallbackMap.info(infoType, message)
Arguments
  • infoType (InfoType) –

  • message (string()) –

Return type

void

CallbackMap.lineCreated
Type

function optional

Triggered when a markup line is created.

Param line

The created markup line.

CallbackMap.lineCreated(line)
Arguments
Return type

void

CallbackMap.lineDeleted
Type

function optional

Triggered when a markup line is deleted.

Param line

The deleted markup line.

CallbackMap.lineDeleted(line)
Arguments
Return type

void

CallbackMap.lineLoaded
Type

function optional

Triggered when a markup line is loaded.

Param line

The loaded markup line.

CallbackMap.lineLoaded(line)
Arguments
Return type

void

CallbackMap.measurement
Type

function optional

Deprecated

Use any of the specific measurement callbacks instead: - measurementBegin - measurementCreated - measurementDeleted - measurementHidden - measurementLoaded - measurementShown - measurementValueSet

CallbackMap.measurement(measurement)
Arguments
Return type

void

CallbackMap.measurementBegin
Type

function optional

Triggered when a measurement operator has begun measuring.

CallbackMap.measurementBegin()
Return type

void

CallbackMap.measurementCreated
Type

function optional

Triggered when a measurement is fully created.

Param measurement

The created measurement.

CallbackMap.measurementCreated(measurement)
Arguments
Return type

void

CallbackMap.measurementDeleted
Type

function optional

Triggered when a measurement is deleted by its MeasureManager

Param measurement

The deleted measurement.

CallbackMap.measurementDeleted(measurement)
Arguments
Return type

void

CallbackMap.measurementHidden
Type

function optional

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

Param measurement

The hidden measurement.

CallbackMap.measurementHidden(measurement)
Arguments
Return type

void

CallbackMap.measurementLoaded
Type

function optional

Triggered when a measurement loaded by its MeasureManager

Param measurement

The loaded measurement.

CallbackMap.measurementLoaded(measurement)
Arguments
Return type

void

CallbackMap.measurementShown
Type

function optional

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

Param measurement

The shown measurement.

CallbackMap.measurementShown(measurement)
Arguments
Return type

void

CallbackMap.measurementValueSet
Type

function optional

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 measurement

The modified measurement.

CallbackMap.measurementValueSet(measurement)
Arguments
Return type

void

CallbackMap.missingModel
Type

function optional

Triggered when a missing model is discovered during a load.

Param modelPath

The path of the missing model.

CallbackMap.missingModel(modelPath)
Arguments
  • modelPath (string()) –

Return type

void

CallbackMap.modelLoadBegin
Type

function optional

Triggered immediately when Model.switchToModel is called.

CallbackMap.modelLoadBegin()
Return type

void

CallbackMap.modelLoadFailure
Type

function optional

Triggered when a model could not be loaded.

Param modelName

The name of the model that failed to load.

Param reason

The reason the model failed to load.

Param error

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

CallbackMap.modelLoadFailure(modelName, reason[, error])
Arguments
  • modelName (ScModelName) –

  • reason (string()) –

  • error (any()) – optional

Return type

void

CallbackMap.modelLoaded
Type

function optional

Deprecated

Use subtreeLoaded instead.

CallbackMap.modelLoaded(modelRootIds, source)
Arguments
Return type

void

CallbackMap.modelStructureHeaderParsed
Type

function optional

Triggered when a model header has been parsed.

Param filename

The name of the original model file.

Param filetype

The type of the original model file.

CallbackMap.modelStructureHeaderParsed(filename, fileType)
Arguments
  • filename (string()) –

  • fileType (FileType) –

Return type

void

CallbackMap.modelStructureLoadBegin
Type

function optional

Deprecated

CallbackMap.modelStructureLoadBegin()
Return type

void

CallbackMap.modelStructureLoadEnd
Type

function optional

Deprecated

CallbackMap.modelStructureLoadEnd()
Return type

void

CallbackMap.modelStructureParseBegin
Type

function optional

Deprecated

CallbackMap.modelStructureParseBegin()
Return type

void

CallbackMap.modelStructureReady
Type

function optional

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.modelStructureReady()
Return type

void

CallbackMap.modelSwitchStart
Type

function optional

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

Param clearOnly

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

CallbackMap.modelSwitchStart(clearOnly)
Arguments
  • clearOnly (boolean()) –

Return type

void

CallbackMap.modelSwitched
Type

function optional

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

Param clearOnly

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

Param modelRootIds

The root IDs of the newly loaded assembly tree nodes.

CallbackMap.modelSwitched(clearOnly, modelRootIds)
Arguments
  • clearOnly (boolean()) –

  • modelRootIds ([NodeId]) –

Return type

void

CallbackMap.noteTextCreated
Type

function optional

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

Param noteText

The note text that was created.

CallbackMap.noteTextCreated(noteText)
Arguments
  • noteText (NoteText()) –

Return type

void

CallbackMap.noteTextHidden
Type

function optional

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

Param noteText

The note text that was hidden.

CallbackMap.noteTextHidden(noteText)
Arguments
  • noteText (NoteText()) –

Return type

void

CallbackMap.noteTextShown
Type

function optional

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

Param noteText

The note text that was shown.

CallbackMap.noteTextShown(noteText)
Arguments
  • noteText (NoteText()) –

Return type

void

CallbackMap.overlayViewportSet
Type

function optional

Triggered when an overlay viewport is set.

Param overlayIndex

The index of the overlay that had its viewport set.

CallbackMap.overlayViewportSet(overlayIndex)
Arguments
Return type

void

CallbackMap.partsVisibilityHidden
Type

function optional

Triggered when parts are hidden.

Param nodeIds

The node IDs containing the bodies that were hidden.

Deprecated

Use visibilityChanged instead.

CallbackMap.partsVisibilityHidden(nodeIds)
Arguments
Return type

void

CallbackMap.partsVisibilityShown
Type

function optional

Triggered when parts are shown.

Param nodeIds

The node IDs containing the bodies that were shown.

Deprecated

Use visibilityChanged instead.

CallbackMap.partsVisibilityShown(nodeIds)
Arguments
Return type

void

CallbackMap.redlineCreated
Type

function optional

Triggered when a redline markup item is created.

Param redlineMarkup

The created redline.

CallbackMap.redlineCreated(redlineMarkup)
Arguments
Return type

void

CallbackMap.redlineDeleted
Type

function optional

Triggered when a redline markup item is deleted.

Param redlineMarkup

The deleted redline.

CallbackMap.redlineDeleted(redlineMarkup)
Arguments
Return type

void

CallbackMap.redlineUpdated
Type

function optional

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 redlineMarkup

The deleted redline.

CallbackMap.redlineUpdated(redlineMarkup)
Arguments
Return type

void

CallbackMap.removeCuttingSection
Type

function optional

Triggered when a cutting section is removed.

CallbackMap.removeCuttingSection()
Return type

void

CallbackMap.sceneReady
Type

function optional

Triggered when the scene is ready to be interacted with.

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

CallbackMap.sceneReady()
Return type

void

CallbackMap.sceneRendered
Type

function optional

Deprecated

Use frameDrawn instead.

CallbackMap.sceneRendered()
Return type

void

CallbackMap.selection
Type

function optional

Deprecated

Use selectionArray instead.

Param selectionEvents

A list of selection events.

CallbackMap.selection(selectionEvents)
Arguments
Return type

void

CallbackMap.selectionArray
Type

function optional

Triggered when a selection event occurs.

Param selectionEvents

A list of selection events.

Param removed

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

CallbackMap.selectionArray(selectionEvents, removed)
Arguments
Return type

void

CallbackMap.shatteredXmlStructureReady
Type

function optional

Deprecated

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

Param nodeId

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

CallbackMap.shatteredXmlStructureReady(nodeId)
Arguments
Return type

void

CallbackMap.sheetActivated
Type

function optional

Triggered when a drawing sheet has been activated.

Param nodeId

The node ID of the activated sheet.

CallbackMap.sheetActivated(nodeId)
Arguments
Return type

void

CallbackMap.sheetDeactivated
Type

function optional

Triggered when drawing sheets have been deactivated.

CallbackMap.sheetDeactivated()
Return type

void

CallbackMap.streamingActivated
Type

function optional

Triggered when the client begins streaming data from the server.

CallbackMap.streamingActivated()
Return type

void

CallbackMap.streamingDeactivated
Type

function optional

Triggered when streaming from the client has stopped.

CallbackMap.streamingDeactivated()
Return type

void

CallbackMap.subtreeDeleted
Type

function optional

Triggered when a subtree has been deleted.

Param modelRootIds

A list of deleted subtree roots.

CallbackMap.subtreeDeleted(modelRootIds)
Arguments
Return type

void

CallbackMap.subtreeLoaded
Type

function optional

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

Param modelRootIds

A list of loaded subtree roots.

CallbackMap.subtreeLoaded(modelRootIds, source)
Arguments
Return type

void

CallbackMap.timeout
Type

function optional

Triggered when a timeout due to inactivity occurs.

CallbackMap.timeout()
Return type

void

CallbackMap.timeoutWarning
Type

function optional

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

Param minutesRemaining

The remaining time until the timeout callback gets triggered.

CallbackMap.timeoutWarning(minutesRemaining)
Arguments
  • minutesRemaining (number()) –

Return type

void

CallbackMap.transitionBegin
Type

function optional

Triggered when a camera transition begins.

Param duration

The duration of the transition in milliseconds.

CallbackMap.transitionBegin(duration)
Arguments
  • duration (number()) –

Return type

void

CallbackMap.transitionEnd
Type

function optional

Triggered when a camera transition ends.

CallbackMap.transitionEnd()
Return type

void

CallbackMap.viewAxes
Type

function optional

Triggered after the view axes have been set.

Param frontVector

The front vector of the view.

Param upVector

The up vector of the view.

CallbackMap.viewAxes(frontVector, upVector)
Arguments
Return type

void

CallbackMap.viewCreated
Type

function optional

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

Param view

The created markup view.

CallbackMap.viewCreated(view)
Arguments
Return type

void

CallbackMap.viewDeactivated
Type

function optional

Triggered when a view is deactivated.

Param view

The deactivated markup view.

CallbackMap.viewDeactivated(view)
Arguments
Return type

void

CallbackMap.viewDeleted
Type

function optional

Triggered when a view is deleted.

Param view

The deleted markup view.

CallbackMap.viewDeleted(view)
Arguments
Return type

void

CallbackMap.viewLoaded
Type

function optional

Triggered when a view is loaded from data.

Param view

The loaded markup view.

CallbackMap.viewLoaded(view)
Arguments
Return type

void

CallbackMap.viewOrientation
Type

function optional

Triggered after the view orientation has changed.

Param orientation

The new view orientation.

CallbackMap.viewOrientation(orientation)
Arguments
Return type

void

CallbackMap.visibilityChanged
Type

function optional

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 shownBodyIds

IDs of Body nodes that were shown.

Param hiddenBodyIds

IDs of Body nodes that were hidden.

CallbackMap.visibilityChanged(shownBodyIds, hiddenBodyIds)
Arguments
Return type

void

CallbackMap.volumeSelectionBatchBegin
Type

function optional

Deprecated

Use incrementalSelectionBatchBegin instead.

CallbackMap.volumeSelectionBatchBegin()
Return type

void

CallbackMap.volumeSelectionBatchEnd
Type

function optional

Deprecated

Use incrementalSelectionBatchEnd instead.

CallbackMap.volumeSelectionBatchEnd()
Return type

void

CallbackMap.volumeSelectionEnd
Type

function optional

Deprecated

Use incrementalSelectionEnd instead.

CallbackMap.volumeSelectionEnd()
Return type

void

CallbackMap.walkOperatorActivated
Type

function optional

Triggered when the Operator.CameraWalkOperator becomes active.

CallbackMap.walkOperatorActivated()
Return type

void

CallbackMap.walkOperatorDeactivated
Type

function optional

triggered when the Operator.CameraWalkOperator is deactivated.

CallbackMap.walkOperatorDeactivated()
Return type

void

CallbackMap.webGlContextLost
Type

function optional

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

CallbackMap.webGlContextLost()
Return type

void

CallbackMap.websocketConnectionClosed
Type

function optional

Triggered when the browser stream websocket connection is closed.

CallbackMap.websocketConnectionClosed()
Return type

void