The encouraged way, is to conform to the new API as soon as possible. The following guide will attempt to help with the initial migration from the old API to the new one.
Extensions
.
In order to continue to make use of this functionality, the viewer clients now need to
explicitly enable extensions by calling createExtension
with the extension’s constructor
as the argument. For example, the complete functionality set requires all the extensions
enabled.
ViewerParams
no longer has a keepGeometryData
property. Redundant geometry
data is by default removed and cannot be keptSectionBoxChanged
and SectionBoxUpdated
removed from ViewerEvent
and replaced
by SectionToolEvent.Updated
in SectionTool
extensionSelectionEvent.hits
changed to Array<{node: TreeNode, point: Vector3}>
requestRender
from Viewer
now takes optional UpdateFlags
getObjects
removed from Viewer
. Similar functionality exists with getObject
in SpeckleRenderer
explode
removed from Viewer
and replaced by having an ExplodeExtension
active.
Explode time is now controller via setExplode
in ExplodeExtension
getDataTree
and DataTree
type still exist, but are deprecated and will be
soon removed completely. Any functionality can now be replicated with WorldTree
cameraHandler
removed from Viewer
and replaced by controls
accessor in CameraController
.setSectionBox
removed from Viewer
and replaced by setBox
inSectionTool
getSectionBoxFromObjects
removed from Viewer
and replaced by boxFromObjects
from SpeckleRenderer
getCurrentSectionBox
removed from Viewer
and replace by getCurrentBox
inSectionTool
toggleSectionBox
removed from Viewer
and replaced by toggle
in SectionTool
sectionBoxOff
and sectionBoxOn
removed from Viewer
and replaced by the enabled
accessor in SectionTool
zoom
removed from Viewer
and replaced by setCameraView
in CameraController
extensiontoggleCameraProjection
removed from Viewer
and replaced by toggleCameras
in
CameraController
extensionsetView
removed from Viewer
and replaced by setCameraView
in CameraController
extensionloadObject
signature changed to loadObject(loader: Loader, zoomToObject?: boolean)
and it’s now asynchronousloadObjectAsync
removed from Viewer
diff
removed from Viewer
and replaced by diff
in DiffExtension
undiff
removed from Viewer
and replaced by undiff
in DiffExtension
setDiffTime
and setVisualDiffMode
removed from Viewer
and replaced by
updateVisualDiff
in DiffExtension
applyFilter
removed from Viewer
getObjectProperties
is now asynchronousshowObjects
and hideObjects
are removed from Viewer
and moved to FilteringExtension
isolateObjects
and unIsolateObjects
are removed from Viewer
and moved to FilterinExtension
selectObjects
is removed from Viewer
and replaced by selectObjects
in SelectionExtension
resetSelection
is removed from Viewer
and replaced by clearSelection
in SelectionExtension
highlightObjects
and resetHighlight
are removed from Viewer
setColorFilter
ans removeColorFilter
are removed from Viewer
and replaced
by setColorFilter
and removeColorFilter
in FilteringExtension
setUserObjectColors
is remove from Viewer
and replaced by setUserObjectColors
in SelectionExtension
but usage is discouraged since paradigm no longer appliesresetFilters
is removed from Viewer
and replaced by resetFilters
in SelectionExtension
enableMeasurements
removed from Viewer
and replaced by having a
MeasurementsExtension
active and it’s enabled
accessor setsetMeasurementOptions
removed from Viewer
and replaced by the options
accessor in MeasurementsExtension
removeMeasurement
removed from Viewer
and replaced by removeMeasurement
in MeasurementsExtension