Create a new Viewer2d
The ObjectStateManager manages all object related state such as visibility, color and selection
Optionalsettings: 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
The pose (eye, pivot, target) of a camera has been updated
A reference to the viewer that initiated the change, this can be used to detect self-calling
The new Camera pose
Called when the color of the given objects has been reset
The Qids of the objects for which the color has been reset
Destroys the viewer and any (heavy) resources associated with it. As long as there is a reference to the Viewer2d instance it won't be completely destroyed.
Get access to the Control object for programmatic viewer manipulation
Get the height of the viewer in pixels
The ModelManager connected to this viewer
Get the width of the viewer in pixels
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
This method must be called before loading any of the models. Keep in mind that this method is async, and models can only be loaded after the returned Promise has resolved.
Whether rendering of generated door opening directions is currently enabled
Whether face rendering is currently enabled
Whether IFC line rendering is currently enabled
Whether wireframe rendering is currently enabled
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
TODO: write description
Will take a screenshot of the contents of the Viewer2d.
Optionaloptions: ScreenshotOptionsOptional options object
A Blob
Set the depth of the camera cone, default is 250px
The depth in pixels
Toggle whether the cone indicating where the 3D camera is (in a Viewer3d) should be visible, default is visible
Whether it should be visible
Switch how the synced 3D camera indicator behaves inside the 2D viewer. "MAP" keeps the map fixed and lets the cone move through it. "FOLLOW" keeps the cone centered while moving the map, clamping manual interaction so the cone stays inside the viewport.
The camera tracking mode
To be called whenever the rendering state has changed and updates need to become visible
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.
The set of visible objects has been replaced to the given set
This method can return a Promise, if it does, subsequent listeners will only be notified after the returned Promise has resolved
Starts the viewer. The viewer will only redraw when needed.
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
Toggle whether faces are rendered.
True when enabled
Toggle whether ifc lines are rendered. IFC Lines are all lines that have been defined in the original IFC file, such as Axis and FootPrint representations.
True when enabled
Toggles whether the text labels are shown
Toggle whether user panning (by mouse or touch device) is enabled or disabled. It is enabled by default
Whether it should be enabled
Toggle whether user rotate (by mouse or touch device) is enabled or disabled. It is enabled by default
Whether it should be enabled
Toggle whether user selection (by mouse or touch device) is enabled or disabled. It is enabled by default
Whether it should be enabled
Toggle whether user zooming (by mouse wheel or touch device) is enabled or disabled. It is enabled by default. Changing this settings also enabled/disabled zoom on double-click
Whether it should be enabled
Toggle whether wireframes are rendered. Wireframes are usually drawn to emphesize the edges and generally make the model look better
True when enabled
Fit the given object into view.
The Qids of the objects to fit
Optionaloptions: 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
Optionaloptions: ViewFitOptionsTo provide a buffer around the objects. A percentage, where 0 means no buffer and 100 means only buffer
2D viewer based on WebGL.