CallbackMap
- class CallbackMap()
Object which maps callback names to functions. Used by [[WebViewer.setCallbacks]].
Properties
Properties
- CallbackMap.XHRonerror
- Type
function optional
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.XHRonerror(errorEvent)
- Arguments
errorEvent (
ErrorEvent()
) – Describes the error.
- Return type
void
- CallbackMap.XHRonloadend
- Type
function optional
Triggered when an HTTP request completes.
A completed HTTP request does not necessarily indicate success. Make sure to check the return status.
- CallbackMap.XHRonloadend(progressEvent, status, uri)
- Arguments
progressEvent (
ProgressEvent
) – Describes the progress of the completed load.status (
number()
) – The status of the request.uri (
string()
) – The URI of the request. See also: - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
- Return type
void
- CallbackMap.XHRonprogress
- Type
function optional
Triggered during load progress of HTTP requests.
Happens when loading a model via an HTTP request.
- CallbackMap.XHRonprogress(progressEvent)
- Arguments
progressEvent (
ProgressEvent
) – Describes the progress of the load.
- Return type
void
- CallbackMap.addCuttingSection
- Type
function optional
Triggered when a cutting section is added to the scene.
- CallbackMap.addCuttingSection(cuttingSection)
- Arguments
cuttingSection (
CuttingSection()
) – The cutting section added.
- 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.
- CallbackMap.bcfLoaded(id, filename)
- Arguments
id (
number()
) – index associated with the bcf file.filename (
string()
) – associated with the bcf file.
- Return type
void
- CallbackMap.bcfRemoved
- Type
function optional
Triggered after a BCF file has been removed.
- CallbackMap.bcfRemoved(id)
- Arguments
id (
number()
) – None
- Return type
void
- CallbackMap.cadViewCreated
- Type
function optional
Triggered when a CAD View is created.
- CallbackMap.cadViewCreated(cadViewId, cadViewName)
- Arguments
cadViewId (
number()
) – The [[CadViewId]] of the CAD View.cadViewName (
string()
) – The name of the CAD View.
- Return type
void
- CallbackMap.cappingIdle
- Type
function optional
Triggered when capping geometry generation becomes idle or active.
- CallbackMap.cappingIdle(isIdle, cappedInstanceCount)
- Arguments
isIdle (
boolean()
) –true
if becoming idle.false
if becoming active.cappedInstanceCount (
number()
) – The number of geometry instances with capped faces.
- Return type
void
- CallbackMap.configurationActivated
- Type
function optional
Triggered when a Configuration is activated.
- CallbackMap.configurationActivated(nodeId)
- Arguments
nodeId (
number()
) – The [[NodeId]] of the activated Configuration.
- 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.
- CallbackMap.contextMenu(position, modifiers)
- Arguments
position (
Point2()
) – The window position of the mouse at the time of trigger.modifiers (
KeyModifiers()
) – The active key modifiers at the time of trigger.
- Return type
void
- CallbackMap.cuttingPlaneDrag
- Type
function optional
Triggered when a cutting plane is dragged.
- CallbackMap.cuttingPlaneDrag(cuttingSection, planeIndex)
- Arguments
cuttingSection (
CuttingSection()
) – The cutting section containing the cutting plane.planeIndex (
number()
) – The index of the cutting plane in the cutting section.
- Return type
void
- CallbackMap.cuttingPlaneDragEnd
- Type
function optional
Triggered when a cutting plane drag event stops.
- CallbackMap.cuttingPlaneDragEnd(cuttingSection, planeIndex)
- Arguments
cuttingSection (
CuttingSection()
) – The cutting section containing the cutting plane.planeIndex (
number()
) – The index of the cutting plane in the cutting section.
- Return type
void
- CallbackMap.cuttingPlaneDragStart
- Type
function optional
Triggered when a cutting plane drag event starts.
- CallbackMap.cuttingPlaneDragStart(cuttingSection, planeIndex)
- Arguments
cuttingSection (
CuttingSection()
) – The cutting section containing the cutting plane.planeIndex (
number()
) – The index of the cutting plane in the cutting section.
- 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.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(view)
- Arguments
view (
View()
) – the View the interaction has ended in.
- Return type
void
- CallbackMap.explode
- Type
function optional
Triggered when the expode magnitude of [[ExplodeManager]] changes.
- CallbackMap.explode(magnitude)
- Arguments
magnitude (
number()
) – The new explosion magnitude.
- 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.
- CallbackMap.firstModelLoaded(modelRootIds, isHwf)
- Arguments
modelRootIds (
[number]()
) – The root node IDs of the loaded model.isHwf (
boolean()
) – True if the model is an HWF model, false otherwise.
- Return type
void
- CallbackMap.frameDrawn
- Type
function optional
Triggered when a frame has been drawn.
- CallbackMap.frameDrawn(camera, visiblePoints, viewKey)
- Arguments
camera (
Camera()
) – The camera used when the frame was drawn.visiblePoints (
[number]()
) – A list of indices of points passed to [[View.setPointVisibilityTest]].viewKey (
ViewKey()
) – The key of the View the frame was drawn in.
- Return type
void
- CallbackMap.handleEvent
- Type
function optional
Triggered when a geometry handle is moved.
- CallbackMap.handleEvent(eventType, nodeIds, initialMatrices, newMatrices)
- Arguments
eventType (
HandleEventType()
) – The type of the handle event.nodeIds (
[number]()
) – The node IDs bound to the handle.initialMatrices (
[Matrix]()
) – The initial matrices for each of the suppliednodeIds
.newMatrices (
[Matrix]()
) – The new matrices for each of the suppliednodeIds
.
- Return type
void
- CallbackMap.handleEventEnd
- Type
function optional
Triggered when a geometry handle is no longer selected.
- CallbackMap.handleEventEnd(eventType, nodeIds, initialMatrices, newMatrices)
- Arguments
eventType (
HandleEventType()
) – The type of the handle event.nodeIds (
[number]()
) – The node IDs bound to the handle.initialMatrices (
[Matrix]()
) – The initial matrices for each of the suppliednodeIds
.newMatrices (
[Matrix]()
) – The new matrices for each of the suppliednodeIds
.
- Return type
void
- CallbackMap.handleEventStart
- Type
function optional
Triggered when a geometry handle is selected.
- CallbackMap.handleEventStart(eventType, nodeIds, initialMatrices)
- Arguments
eventType (
HandleEventType()
) – The type of the handle event.nodeIds (
[number]()
) – The node IDs bound to the handle.initialMatrices (
[Matrix]()
) – The initial matrices for each of the suppliednodeIds
.
- 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.
- CallbackMap.info(infoType, message)
- Arguments
infoType (
InfoType()
) – The type of the message.message (
string()
) – The message.
- Return type
void
- CallbackMap.lineCreated
- Type
function optional
Triggered when a markup line is created.
- CallbackMap.lineCreated(line)
- Arguments
line (
LineMarkup()
) – The created markup line.
- Return type
void
- CallbackMap.lineDeleted
- Type
function optional
Triggered when a markup line is deleted.
- CallbackMap.lineDeleted(line)
- Arguments
line (
LineMarkup()
) – The deleted markup line.
- Return type
void
- CallbackMap.lineLoaded
- Type
function optional
Triggered when a markup line is loaded.
- CallbackMap.lineLoaded(line)
- Arguments
line (
LineMarkup()
) – The loaded markup line.
- 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.
- CallbackMap.measurementCreated(measurement)
- Arguments
measurement (
MeasureMarkup()
) – The created measurement.
- Return type
void
- CallbackMap.measurementDeleted
- Type
function optional
Triggered when a measurement is deleted by its [[MeasureManager]].
- CallbackMap.measurementDeleted(measurement)
- Arguments
measurement (
MeasureMarkup()
) – The deleted measurement. See also: - [[MeasureManager.removeMeasurement]] - [[MeasureManager.removeAllMeasurements]]
- Return type
void
- CallbackMap.measurementHidden
- Type
function optional
Triggered when a measurement is hidden by a call to its
setVisibility
method.- CallbackMap.measurementHidden(measurement)
- Arguments
measurement (
MeasureMarkup()
) – The hidden measurement. See also: - [[MeasureMarkup.setVisibility]]
- Return type
void
- CallbackMap.measurementLoaded
- Type
function optional
Triggered when a measurement loaded by its [[MeasureManager]].
- CallbackMap.measurementLoaded(measurement)
- Arguments
measurement (
MeasureMarkup()
) – The loaded measurement. See also: - [[MeasureManager.loadData]]
- Return type
void
- CallbackMap.measurementShown
- Type
function optional
Triggered when a measurement is shown by a call to its
setVisibility
method.- CallbackMap.measurementShown(measurement)
- Arguments
measurement (
MeasureMarkup()
) – The shown measurement. See also: - [[MeasureMarkup.setVisibility]]
- 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
andsetMeasurementText
methods.- CallbackMap.measurementValueSet(measurement)
- Arguments
measurement (
MeasureMarkup()
) – The modified measurement.
- Return type
void
- CallbackMap.missingModel
- Type
function optional
Triggered when a missing model is discovered during a load.
- CallbackMap.missingModel(modelPath)
- Arguments
modelPath (
string()
) – The path of the missing model.
- 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.
- CallbackMap.modelLoadFailure(modelName, reason[, error])
- Arguments
modelName (
string()
) – The name of the model that failed to load.reason (
string()
) – The reason the model failed to load.error (
any()
) – optional The error object thrown when the load failed, if available.
- Return type
void
- CallbackMap.modelStructureHeaderParsed
- Type
function optional
Triggered when a model header has been parsed.
- CallbackMap.modelStructureHeaderParsed(filename, fileType)
- Arguments
filename (
string()
) – The name of the original model file.fileType (
FileType()
) – None
- 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.
- CallbackMap.modelSwitchStart(clearOnly)
- Arguments
clearOnly (
boolean()
) –true
if the callback was triggered by [[Model.clear]].false
otherwise.
- 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.
- CallbackMap.modelSwitched(clearOnly, modelRootIds)
- Arguments
clearOnly (
boolean()
) –true
if the callback was triggered by [[Model.clear]].false
otherwise.modelRootIds (
[number]()
) – The root IDs of the newly loaded assembly tree nodes.
- Return type
void
- CallbackMap.noteTextCreated
- Type
function optional
Triggered when note text is created, especially via the note operator.
- CallbackMap.noteTextCreated(noteText)
- Arguments
noteText (
NoteText()
) – The note text that was created.
- Return type
void
- CallbackMap.noteTextHidden
- Type
function optional
Triggered when note text is hidden, especially via the note operator.
- CallbackMap.noteTextHidden(noteText)
- Arguments
noteText (
NoteText()
) – The note text that was hidden.
- Return type
void
- CallbackMap.noteTextShown
- Type
function optional
Triggered when note text is shown, especially via the note operator.
- CallbackMap.noteTextShown(noteText)
- Arguments
noteText (
NoteText()
) – The note text that was shown.
- Return type
void
- CallbackMap.overlayViewportSet
- Type
function optional
Triggered when an overlay viewport is set.
- CallbackMap.overlayViewportSet(overlayIndex, view)
- Arguments
overlayIndex (
number()
) – The index of the overlay that had its viewport set.view (
View()
) – The View the overlay was set in.
- Return type
void
- CallbackMap.redlineCreated
- Type
function optional
Triggered when a redline markup item is created.
- CallbackMap.redlineCreated(redlineMarkup)
- Arguments
redlineMarkup (
RedlineItem()
) – The created redline.
- Return type
void
- CallbackMap.redlineDeleted
- Type
function optional
Triggered when a redline markup item is deleted.
- CallbackMap.redlineDeleted(redlineMarkup)
- Arguments
redlineMarkup (
RedlineItem()
) – The deleted redline.
- 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.
- CallbackMap.redlineUpdated(redlineMarkup)
- Arguments
redlineMarkup (
RedlineItem()
) – The deleted redline.
- 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]]-related 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.selectionArray
- Type
function optional
Triggered when a selection event occurs.
- CallbackMap.selectionArray(selectionEvents, removed)
- Arguments
selectionEvents (
[NodeSelectionEvent]()
) – A list of selection events.removed (
boolean()
) –true
if the selection items have been removed from the selection set.false
otherwise.
- Return type
void
- CallbackMap.sheetActivated
- Type
function optional
Triggered when a drawing sheet has been activated.
- CallbackMap.sheetActivated(nodeId)
- Arguments
nodeId (
number()
) – The node ID of the activated sheet.
- 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.
- CallbackMap.subtreeDeleted(modelRootIds)
- Arguments
modelRootIds (
[number]()
) – A list of deleted subtree roots.
- 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.
- CallbackMap.subtreeLoaded(modelRootIds, source)
- Arguments
modelRootIds (
[number]()
) – A list of loaded subtree roots.source (
NodeSource()
) – None
- 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.
- CallbackMap.timeoutWarning(minutesRemaining)
- Arguments
minutesRemaining (
number()
) – The remaining time until the [[timeout]] callback gets triggered.
- 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.
- CallbackMap.viewCreated(view)
- Arguments
view (
MarkupView()
) – The created markup view. See also: - [[MarkupManager.createMarkupView]]
- Return type
void
- CallbackMap.viewDeactivated
- Type
function optional
Triggered when a view is deactivated.
- CallbackMap.viewDeactivated(view)
- Arguments
view (
MarkupView()
) – The deactivated markup view. See also: - [[MarkupManager.activateMarkupView]] - [[MarkupManager.deleteMarkupView]]
- Return type
void
- CallbackMap.viewDeleted
- Type
function optional
Triggered when a view is deleted.
- CallbackMap.viewDeleted(view)
- Arguments
view (
MarkupView()
) – The deleted markup view. See also: - [[MarkupManager.deleteMarkupView]]
- Return type
void
- CallbackMap.viewLoaded
- Type
function optional
Triggered when a view is loaded from data.
- CallbackMap.viewLoaded(view)
- Arguments
view (
MarkupView()
) – The loaded markup view. See also: - [[MarkupManager.loadMarkupData]]
- Return type
void
- CallbackMap.viewOrientation
- Type
function optional
Triggered after the view orientation has changed.
- CallbackMap.viewOrientation(orientation, view)
- Arguments
orientation (
ViewOrientation()
) – The new view orientation.view (
View()
) – the View the orientation was set for. See also: - [[View.setViewOrientation]]
- Return type
void
- CallbackMap.visibilityChanged
- Type
function optional
Triggered when nodes are shown or hidden. If
shownBodyIds
andhiddenBodyIds
are both empty, only the visibility of structural nodes (nodes that do not directly contain geometry) changed.- CallbackMap.visibilityChanged(shownBodyIds, hiddenBodyIds)
- Arguments
shownBodyIds (
[number]()
) – IDs ofBody
nodes that were shown.hiddenBodyIds (
[number]()
) – IDs ofBody
nodes that were hidden.
- 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