# Migration Guide
# 2.18.16 β 2.19.1
- Added
tasOnly
as a parameter in allintersect
variants. - The existing
firstHitOnly
option onRaycaster
now stops on first intersected TAS, asa well as first intersected BAS from that TAS (iftasOnly
is not set)
# 2.18.15 β 2.18.16
Vector3Like
replacesVectorLike
in the arguments oftransformTRS
inBatchObject
SpeckleLoader
no longer takes apriority
argument in itβs constructoraddRenderTree
fromSpeckleRenderer
now takes aRenderTree
as an argument instead of aRenderTree
idgetRenderTree
is now overloaded with a version with no arguments that never returns nullintersect
andintersectRay
arguments have been moved around and both are now overloaded
# 2.18.14 β 2.18.15
- Asset now has a mandatory
id
field getEnvironment
andgetTexture
fromAssets
now only acceptAsset
as argument- The concept of
Providers
has been removed entirely CameraProvider
has been replaced bySpeckleCamera
CameraControllerEvent
renamed toCameraEvent
# 2.18 β 2.18.14
updateClippingPlanes
inSpeckleRenderer
does not take an optionalPlane[]
argument anymoresetOptions
fromSelectionExtension
has changed to an accessordisplayOn
anddisplayOff
fromSectionTool
are replaced byvisible
accessor
# 2.x β 2.18
The introduction of viewer API 2.0 into our stable channel. The changes to the API itself are extensive and there is no point for a step by step guide, as what was previously known as API 2.0 will become the single supported viewer API moving forward.
API 1.0 Backwards Compatibility:
For backwards compatibility reasons we provide a built-in legacy implementation that emulates the old API precisely. Please note that this is meant as a temporary measure which will eventually become naturally obsolete. For this purpose, this migration guide entry will describe moving from any older viewer version to 2.18 while using the legacy implementation
Viewer
orDebugViewer
instances are replaced byLegacyViewer
The
hits
field fromSelectionEvent
now holds the hit node and hit point.type SelectionEvent = { multiple: boolean event?: PointerEvent hits: Array<{ node: TreeNode point: Vector3 }> }
1
2
3
4
5
6
7
8The synchronous
loadObject
was removed. Please useloadObjectAsync
which works the same way
API 1.0 Full Migration:
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:
A lot of existing viewer functionality has been transferred over to modular 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
const cameraController = this.createExtension(CameraController)
const selection = this.createExtension(LegacySelectionExtension)
const sections = this.createExtension(SectionTool)
const sectionOutlines = this.createExtension(SectionOutlines)
const measurements = this.createExtension(MeasurementsExtension)
const filtering = this.createExtension(FilteringExtension)
const explodeExtension = this.createExtension(ExplodeExtension)
const diffExtension = this.createExtension(DiffExtension)
2
3
4
5
6
7
8
General:
ViewerParams
no longer has akeepGeometryData
property. Redundant geometry data is by default removed and cannot be keptSectionBoxChanged
andSectionBoxUpdated
removed fromViewerEvent
and replaced bySectionToolEvent.Updated
inSectionTool
extensionSelectionEvent.hits
changed toArray<{node: TreeNode, point: Vector3}>
requestRender
fromViewer
now takes optionalUpdateFlags
getObjects
removed fromViewer
. Similar functionality exists withgetObject
inSpeckleRenderer
explode
removed fromViewer
and replaced by having anExplodeExtension
active. Explode time is now controller viasetExplode
inExplodeExtension
getDataTree
andDataTree
type still exist, but are deprecated and will be soon removed completely. Any functionality can now be replicated withWorldTree
cameraHandler
removed fromViewer
and replaced bycontrols
accessor inCameraController
.
Section Box:
setSectionBox
removed fromViewer
and replaced bysetBox
inSectionTool
getSectionBoxFromObjects
removed fromViewer
and replaced byboxFromObjects
fromSpeckleRenderer
getCurrentSectionBox
removed fromViewer
and replace bygetCurrentBox
inSectionTool
toggleSectionBox
removed fromViewer
and replaced bytoggle
inSectionTool
sectionBoxOff
andsectionBoxOn
removed fromViewer
and replaced by theenabled
accessor inSectionTool
Camera:
zoom
removed fromViewer
and replaced bysetCameraView
inCameraController
extensiontoggleCameraProjection
removed fromViewer
and replaced bytoggleCameras
inCameraController
extensionsetView
removed fromViewer
and replaced bysetCameraView
inCameraController
extensionloadObject
signature changed toloadObject(loader: Loader, zoomToObject?: boolean)
and itβs now asynchronousloadObjectAsync
removed fromViewer
Diffing:
diff
removed fromViewer
and replaced bydiff
inDiffExtension
undiff
removed fromViewer
and replaced byundiff
inDiffExtension
setDiffTime
andsetVisualDiffMode
removed fromViewer
and replaced byupdateVisualDiff
inDiffExtension
Filtering and Selection:
applyFilter
removed fromViewer
getObjectProperties
is now asynchronousshowObjects
andhideObjects
are removed fromViewer
and moved toFilteringExtension
isolateObjects
andunIsolateObjects
are removed fromViewer
and moved toFilterinExtension
selectObjects
is removed fromViewer
and replaced byselectObjects
inSelectionExtension
resetSelection
is removed fromViewer
and replaced byclearSelection
inSelectionExtension
highlightObjects
andresetHighlight
are removed fromViewer
setColorFilter
ansremoveColorFilter
are removed fromViewer
and replaced bysetColorFilter
andremoveColorFilter
inFilteringExtension
setUserObjectColors
is remove fromViewer
and replaced bysetUserObjectColors
inSelectionExtension
but usage is discouraged since paradigm no longer appliesresetFilters
is removed fromViewer
and replaced byresetFilters
inSelectionExtension
Measurements:
enableMeasurements
removed fromViewer
and replaced by having aMeasurementsExtension
active and itβsenabled
accessor setsetMeasurementOptions
removed fromViewer
and replaced by theoptions
accessor inMeasurementsExtension
removeMeasurement
removed fromViewer
and replaced byremoveMeasurement
inMeasurementsExtension
β Loaders AccelerationStructure β