Create a new Viewer2d
The ObjectStateManager manages all object related state such as visibility, color and selection
Optional
settings: Viewer2dSettingsOptional settings, will use default settings when not provided
This method will get called when objects have been added to the selection.
Iterable<@bimworks/jssdk!Qid> that provides the @bimworks/jssdk!Qids of the objects added to the selection set.
Objects were added to the set of visible objects
An Iterable
This method can return a Promise, if it does, subsequent listeners will only be notified after the returned Promise has resolved
Called when the color of the given objects has been reset
The Qids of the objects for which the color has been reset
Called then the given object is not being hovered on anymore
The Qid of the object that is not being hovered over anymore
Called then the given object is being hovered on
The Qid of the object being hovered over
The Qid of the previous objects that was being hovered over
The screenspace location of the hover event. This can be useful to for example place a popup/tooltip at that location. Screenspace location is x, y coordinate between 0, 0 and canvas width,height
The primary selection has changed
The Qid of the newly selected primary object or null if primary selection was unselected
Objects have been removed from the selection set
The Qids of the objects that have been removed from the selection set
Objects were removed from the set of visible objects
An Iterable
This method can return a Promise, if it does, subsequent listeners will only be notified after the returned Promise has resolved
Will take a screenshot of the contents of the Viewer2d.
Optional
options: ScreenshotOptionsOptional options object
A Blob
This method will get called when the set of selected objects has been
Iterable<@bimworks/jssdk!Qid> that provides the @bimworks/jssdk!Qids of the objects added to the selection set.
Stops the viewer. When the viewer is stopped, the view is not updated anymore. Any changes to the viewer will be accumulated and become visible as soon as the viewer is started again The main reason for stopping the viewer would be for performance, for example when the viewer is currently hidden
Toggle whether (generated) door openings are rendered. This only works for models that have been processed when the repository setting features.generate_door_openings
had been enabled.
Some models contains door opening direction geometry as IFC lines, in those cases it's best to disabled rendering generated door openings.
True when enabled
Fit the given object into view.
The Qids of the objects to fit
Optional
options: ViewFitOptionsTo provide a buffer around the objects. A percentage, where 0 means no buffer and 100 means only buffer
Fit the given models into view.
The models to fit
Optional
options: ViewFitOptionsTo provide a buffer around the objects. A percentage, where 0 means no buffer and 100 means only buffer
2D viewer based on WebGL.