CallbackMap
-
class
CallbackMap
() Object which maps callback names to functions. Used by [[WebViewer.setCallbacks]].
Properties
XHRonerror
XHRonloadend
XHRonprogress
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
modelSwitchStart
modelSwitched
noteTextCreated
noteTextHidden
noteTextShown
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
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
- errorEvent (
-
-
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
- progressEvent (
-
-
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
- progressEvent (
-
-
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
- cuttingSection (
-
-
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
- id (
-
-
CallbackMap.
bcfRemoved
Type: function optional Triggered after a BCF file has been removed.
-
CallbackMap.
bcfRemoved
(id) Arguments: - id (
number()
) – None
Return type: void
- id (
-
-
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
- cadViewId (
-
-
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
- isIdle (
-
-
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
- nodeId (
-
-
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
- position (
-
-
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
- cuttingSection (
-
-
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
- cuttingSection (
-
-
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
- cuttingSection (
-
-
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
- view (
-
-
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
- magnitude (
-
-
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
- modelRootIds (
-
-
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
- camera (
-
-
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
- eventType (
-
-
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
- eventType (
-
-
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
- eventType (
-
-
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
- infoType (
-
-
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
- line (
-
-
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
- line (
-
-
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
- line (
-
-
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
- measurement (
-
-
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
- measurement (
-
-
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
- measurement (
-
-
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
- measurement (
-
-
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
- measurement (
-
-
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
- measurement (
-
-
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
- modelPath (
-
-
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
- modelName (
-
-
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
- filename (
-
-
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
- clearOnly (
-
-
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
- clearOnly (
-
-
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
- noteText (
-
-
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
- noteText (
-
-
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
- noteText (
-
-
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
- overlayIndex (
-
-
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
- redlineMarkup (
-
-
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
- redlineMarkup (
-
-
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
- redlineMarkup (
-
-
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
- selectionEvents (
-
-
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
- nodeId (
-
-
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
- modelRootIds (
-
-
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
- modelRootIds (
-
-
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
- minutesRemaining (
-
-
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
- view (
-
-
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
- view (
-
-
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
- view (
-
-
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
- view (
-
-
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
- orientation (
-
-
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
- shownBodyIds (
-
-
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
-