Optionalsettings: ObjectStateManagerSettingsReadonlymodelThe ModelManager this ObjectStateManager was created with, the same as ObjectStateManager.getModelManager
Add a single annotation. When adding large sets of annotations, use addAnnotations
The annotation to add
Add a layer of template annotations to every viewer of this object state manager: one BQL query fetched in one batch and/or rows of your own, drawn by a template (Viewer3D/docs/rich-annotations-design.md §5.3). Returns at once; AnnotationLayer.ready settles when the query's rows are in. clearAnnotations() removes layers too.
Registers for annotations and annotation layers; annotationLayerAdded is called at once for every existing layer
Add multiple annotations.
An Iterable of the annotations to add
Listens to colour changes of several colours at once (changeColorMulti)
Listen to ghost set changes: addedToGhostSet and removedFromGhostSet of ObjectStateListener
Registers the listener for every ObjectStateListenerType
Listen to no-shadow set changes: addedToNoShadowSet and removedFromNoShadowSet of ObjectStateListener
Listen to on-top set changes: addedToOnTopSet and removedFromOnTopSet of ObjectStateListener
Objects whose cut surfaces section planes close with end caps (all objects are by default); resetAll does not change it
Optionalforce: booleanOptionaltype: stringGhost objects (docs/clash-detection-ui-design.md §9.9 item 1): the viewers draw them only with the x-ray overlay (the current XRayVisualization), not in the normal pass, so they show where they are without hiding what is behind them, and they cannot be picked. Ghosting hides the visible ones through the visible set (which deselects them); an object that was hidden already stays hidden and is not drawn as a ghost. Unlike the rest of the x-ray set, a ghost is drawn while hidden.
Either a query or Iterable of Qid
Optionaltype: stringAlways "BIM"
Add objects to the no-shadow set: the 3D viewer leaves them out of its sun shadows, even when shown. Viewer3d fills it with the non-physical types of the models it loads (spaces, openings, virtual elements, spatial zones, annotations, grids).
Either a query or Iterable of Qid
Optionalforce: booleanNotify listeners even for objects that were already in the set
Optionaltype: stringAlways "BIM"
Add objects to the on-top set (BVL ON_TOP). The 3D viewer draws them in front of every other object, in their own colours, and picks them first. Among each other they are still depth-tested, so their own shape reads normally. A hidden object stays in the set.
Either a query or Iterable of Qid
Optionalforce: booleanNotify listeners even for objects that were already in the set
Optionaltype: stringAlways "BIM"
Add the provided objects to the currently pickable set of objects
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Add a set of objects to the selected set
Optionaltype: stringAdd objects to the soft-occluder set. Soft occluders (typically walls, roofs and slabs) gradually fade out - and become pick-through - as the camera approaches them, so users can look inside a building without hiding objects manually.
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Add the provided objects to the currently visible set of objects *
Either a query or Iterable of Qid *
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled *
Optionaltype: stringAlways "BIM"
Add objects to the x-ray set. The 3D viewer draws these objects with the x-ray overlay: translucent faces and edges drawn through everything in front of them, so hidden interiors (a duct above a ceiling, a column inside a wall) show. The set is independent of selection. The objects keep their normal appearance underneath, keep their pickability, and are clipped by section planes. A hidden object stays in the set but is not drawn until it is shown again. The look is set with Viewer3d.setXRayVisualization. The 2D viewer ignores the set.
Either a query or Iterable of Qid
Optionalforce: booleanNotify listeners even for objects that were already in the set
Optionaltype: stringAlways "BIM"
Announces a viewer to the ViewerListeners; the Viewer2d announces itself once its models are in
Registers for viewers announcing themselves (addViewer)
Listen for wireframe resets when BVL results or resetAll restore defaults.
Listen to x-ray set changes: addedToXRaySet, removedFromXRaySet and setXRaySet of ObjectStateListener
The object state as it is now, as a value to give back to restoreObjectState later: the loaded models, which objects are visible, the colour overrides, the on-top set, the objects section planes do not cut and the objects that cannot be picked (with whether pickability is on), and the x-ray set. Not the selection, the labels or the annotations. A tool that takes the view over for a while (a check, the clash view) captures it when it starts and restores it when it ends.
A new value: copies, not the live sets
Whether the given object casts sun shadows (true unless it is in the no-shadow set)
Change the color of a given set of objects. When changing the colors of multiple sets of objects, use the more efficient changeColorMulti method.
A Promise that triggers when all connected listeners have applied the change
Change the colors of a given set of objects.
A ColorChangeMap that contains color change information potentialle for many different colors/qids
OptionalcolorQueries: Map<string, unknown> | nullThe queries behind the colours (hex8 colour → query), passed on to the listeners' colorChangedMulti
OptionalautoDispose: booleanWhether to dispose changes once applied, default true
A Promise that triggers when all connected listeners have applied the change
Removes all annotations and annotation layers, in every viewer
Optionaloptions: unknownEmpties the ghost set, bringing back the visibility ghosting took
Optionaltype: stringEmpty the on-top set
Optionaltype: stringClear the current selection
Optionaltype: stringEmpty the x-ray set
Optionaltype: stringThe annotation layers, in the order they were added
The objects that get end caps. The returned Set must be treated as read-only.
The objects in the ghost set (live, do not modify)
A Set of the QIDS that are currently invisible. The returned Set must be treated as read-only.
A copy of the last pose set with setCameraPose
The ModelManager connected to this ObjectStateManager
The objects that cast no sun shadow (live, do not modify)
The objects in the on-top set (live, do not modify)
The pickable objects, which picking honours only while pickability is on (while it is off every visible object is pickable). The returned Set must be treated as read-only.
The objects section planes cut. The returned Set must be treated as read-only.
A Set of the QIDS that are currently selected. The returned Set must be treated as read-only.
A Set of the QIDS that are currently visible. The returned Set must be treated as read-only.
The objects in the x-ray set (live, do not modify)
Highlight certain objects
This will be removed in the future, as it is to opinionated and can easily be constructed using the changeColorMulti method.
Change the state of the given qid to not being hovered on anymore. In the Viewer3d tis will fade out the green glow over time.
The Qid of the object not being hovered over anymore
Change the state of the given qid to being hovered on. In the Viewer3d this will give the object a green glow
Whether picking honours the pickable set (settings.pickability)
Replays the object states (visible, sectionable, end caps, pickable, OBB, soft occluder, x-ray, on-top, no-shadow) of objects whose geometry just arrived to the listeners, with StateChangeOptions.streaming. A viewer calls it as a model's geometry streams in, so states set before the geometry was there are applied to it
The model the geometry belongs to
The objects whose geometry arrived
Remove a layer from every viewer; the same as layer.remove()
Takes objects out of the ghost set: the ones ghosting hid are shown again, so clearing the set brings back the visibility they had; the others keep theirs. An object someone showed or hid meanwhile keeps that.
Optionaltype: stringRemove objects from the set of pickable objects
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Remove the provided objects from the current selection
Optionaltype: stringRemove objects from the soft-occluder set
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Remove objects from the set of visible objects. Any of these objects that are currently selected are also deselected, before the visibility listeners are notified. The returned promise resolves after both have completed.
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Remove objects from the x-ray set
Either a query or Iterable of Qid
Optionalforce: booleanNotify listeners even for objects that were not in the set
Optionaltype: stringAlways "BIM"
For internal use by a viewer: the state of these objects of a loaded version (what pushState replays,
plus the selection and the colour overrides), to listener alone. A viewer that shows a model another viewer on
the ModelManager loaded is brought up to date with it
Resets the internal ObjectStateManager state to the default state, which means:
All of these changes trigger the regular listeners and therefore the connected viewers.
A query or iterable of Qids, the objects to reset color
A Promise that triggers when all connected listeners have applied the change
Removes all labels set with ObjectStateManager.setLabels
Brings a captured object state back, notifying the listeners of what changes only. Objects of models that were not loaded at the capture, or are not loaded now, are left alone: a model loaded since keeps its own state.
Optionaloptions: { keepColorsOf?: Iterable<Qid, any, any>; keepVisibility?: boolean }keepVisibility: leave the visible set as it is; keepColorsOf: leave the colours of these objects as they are (what a tool about to take over colours itself, so switching does not flash the model in between)
Resolves when the listeners have applied the changes
Tells the camera pose listeners (the 2D view's camera cone) about this pose; sourceViewer is the viewer the
pose comes from. It does not move 3D cameras: link those with Viewer3d.linkCamera
Makes the ghost set exactly these objects: the others leave it (removeFromGhostSet), the new ones are ghosted
Optionaltype: stringChange the labels of objects. Depending on the viewer labels are visualized differently.
An array of Label
Switch pickability on or off at runtime. While it is off, every visible object is pickable and add/remove/setPickableSet are ignored. Switching off makes the unpickable objects pickable again. A BVL result with PICKABLE/UNPICKABLE switches it on by itself, until the next result is shown.
Update the set of pickable objects, replacing any previous pickable state
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Sets the primary selection, the object whose details the application shows
Update the soft-occluder set, replacing any previous soft-occluder state
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Update the set of visible objects, replacing any previous visibily state. Objects that become hidden as a result are also deselected, before the visibility listeners are notified. The returned promise resolves after both have completed.
Either a query or Iterable of Qid
Optionalforce: booleanWhether to force this change, when forced, any viewer-specific settings are overruled
Optionaltype: stringAlways "BIM"
Replace the x-ray set; listeners receive only the objects that were added and removed
Either a query or Iterable of Qid
Optionalforce: booleanNotify listeners even when nothing changed
Optionaltype: stringAlways "BIM"
Removes the listener from every type it is registered for, however it was added
Calling this method will update all connected viewers in a way that all of them are afterwards showing at least all of the queried objects.
A query or iterable of Qids, the objects to reset color
Fits the viewers' cameras on the given models
Optionaloptions: ViewFitOptions
An instance of ObjectStateManager keeps track of all the viewer-related state and distributes this state to other components, usually viewers. This state includes:
Most applications will have one ObjectStateManager, but you can have more. The most common scenatio is to have one ObjectStateManager, one Viewer3d and one Viewer2d. Both viewers being connected to the same ObjectStateManager so that the state is kept in sync.