ContextAPI¶
Interface ContextAPI
add(options: AddNodeOptions): number;
add(
dataURI: string,
parentID?: number,
usage?: UsageString,
label?: string,
contentType?: string,
initialProperties?: InitialNodeProperties,
cacheStrategy?: CacheStrategy,
): number;
addCustomNode(
customNodeType: string,
data: any,
dataType?: AttachmentType,
): number;
addToCollection(
collectionID: number,
nodeID: number,
recursive?: boolean,
): void;
addTopologyToSelection(
handle: TopologyHandle | TopologyHandle[],
): Promise<void>;
addToSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult>;
anchorXR(xrAnchorOptions?: XRAnchorOptions): void;
changeAnnotation(
annotationId: number,
properties: AnnotationProperties,
): AnnotationProperties;
changeAnnotation(
annotationID: number,
label?: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelPosition?: number[] | Float32Array<ArrayBufferLike>,
active?: boolean,
transform?: number[] | Float32Array<ArrayBufferLike>,
): void;
changeClippingRoom(properties?: ClipRoomProperties): ClipRoomProperties;
changeClippingRoom(
name?: string,
size?: number[] | Float32Array<ArrayBufferLike>,
transformation?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
): ClipRoomProperties;
changeClipPlane(
clipPlaneId: number,
properties: ClipPlaneProperties,
): ClipPlaneProperties;
changeClipPlane(
clipPlaneID: number,
normal?: number[] | Float32Array<ArrayBufferLike>,
point?: number[] | Float32Array<ArrayBufferLike>,
name?: string,
thickness?: number,
tangent?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
exclusive?: boolean,
): void;
changeDrawing(
drawingId: number,
properties: DrawingProperties,
): DrawingProperties;
changeDrawingPlane(
drawingPlaneId: number,
properties: DrawingPlaneProperties,
): DrawingPlaneProperties;
changeMaterial(
materialId: number,
properties: MaterialProperties,
): MaterialProperties;
changeMeasurement(
measurementID: number,
properties: MeasurementProperties,
): MeasurementProperties;
changeSetting<T extends string>(
setting: T,
value: ContextSettingType<T>,
): boolean;
changeSnapshot(
snapshotID: number,
properties: SnapshotProperties,
): SnapshotProperties;
changeSnapshot(
snapshotID: number,
name?: string,
screenshotURL?: string,
order?: number,
): SnapshotProperties;
clear(): Promise<void>;
clearSelection(silent?: boolean): Promise<ChangeSelectionResult>;
clearTopologySelection(): Promise<void>;
clipOtherParts(target: number | number[]): void;
cloneIntoNewSpace(): Promise<void>;
collectRuntimeNodesOfType(nodeType: NodeType, subType?: string): number[];
connectToSession(
sessionID?: string,
name?: string,
): Promise<SessionStateData>;
connectXR(xrConfiguration?: XRConfiguration): Promise<void>;
createAnimationFrames(name: string, frames: AnimationFrame[]): void;
createAnnotation(properties?: AnnotationProperties): number;
createAnnotation(
nodeID: number,
label: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelOffset?: number[] | Float32Array<ArrayBufferLike>,
): number;
createAttachment(dataType: AttachmentType): number;
createBoxVolume(
min?: [number, number, number],
max?: [number, number, number],
): BoxVolume;
createCapping(clipPlaneId: number): Promise<void>;
createCircularArcDescriptor(
point0: [number, number, number],
point1: [number, number, number],
point2: [number, number, number],
): { descriptor: TopologyCircularArcDescriptor; type: CIRCULAR_ARC };
createClippingRoom(properties?: ClipRoomProperties): void;
createClippingRoom(
name?: string,
size?: number[] | Float32Array<ArrayBufferLike>,
transformation?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
): void;
createClipPlane(properties?: ClipPlaneProperties): number;
createClipPlane(
normal?: number[] | Float32Array<ArrayBufferLike>,
point?: number[] | Float32Array<ArrayBufferLike>,
name?: string,
thickness?: number,
tangent?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
exclusive?: boolean,
): number;
createCollection(nodeIDlist?: number[]): number;
createCollection(): number;
createDrawing(
data: ViewerDrawingResult,
properties?: DrawingProperties,
): number;
createDrawingPlane(properties?: DrawingPlaneProperties): number;
createExplosion(centerNodeID?: number): void;
createMaterial(properties?: MaterialProperties): number;
createMeasurement<T extends keyof MeasurementTypeToTargetMap>(
type: T,
targets: MeasurementTypeToTargetMap[T],
properties?: MeasurementProperties,
): number;
createNodePathHandles(targets: number[]): Promise<NodePathHandle[]>;
createPointDescriptor(
point: [number, number, number],
): { descriptor: TopologyPointDescriptor; type: POINT };
createSnapshot(
name?: string,
options?: SnapshotCreationOptions,
): Promise<number>;
createViewer(
viewerID?: string,
canvas?: HTMLCanvasElement,
settings?: {
aaSetting?: any;
backgroundColor?: any;
cappingEffectEdgeColor?: any;
cappingEffectEnabled?: any;
cappingEffectInnerColor?: any;
colorComparisonFirstColor?: any;
colorComparisonMatchingColor?: any;
colorComparisonSecondColor?: any;
colorizeEffect?: any;
coordSys?: any;
defaultFieldOfView?: any;
disableSpecularHighlights?: any;
doubleClickAnimationVolumeScale?: any;
doubleClickTimeWindow?: any;
drawingArrowheadEnd?: any;
drawingArrowheadStart?: any;
drawingColor?: any;
drawingMode?: any;
drawingSize?: any;
dynamicAuxContrastEnabled?: any;
dynamicClippingDistance?: any;
dynamicClippingEnabled?: any;
dynamicCOREnabled?: any;
expandOnViewerSelection?: any;
faceHighlightColor?: any;
faceSelectionColor?: any;
fitViewFactor?: any;
flyNavigationSpeed?: any;
flyToOnDoubleClick?: any;
focusOnDoubleClick?: any;
frustumCulling?: any;
ghostedSceneOpacity?: any;
gizmoScalingFactor?: any;
gizmosEnabled?: any;
gpuMemoryReleaseFactor?: any;
hoverColor?: any;
initialFit?: any;
initialFitDirection?: any;
initView?: any;
lightingEnvironment?: any;
lineHighlightColor?: any;
lineSelectionColor?: any;
maxDynamicClipDistance?: any;
maxGPUMemory?: any;
maxSRCCPUMemory?: any;
mouseInvertZoomingDirection?: any;
navigationMode?: any;
navigationSampling?: any;
navigationSpeedFactor?: any;
navigationSpeedThrottleFactor?: any;
outlineColor?: any;
outlineColorOccluded?: any;
outlineInnerRadius?: any;
outlineOuterRadius?: any;
preSelectionColor?: any;
projectionType?: any;
renderAuxOnTop?: any;
renderMode?: any;
renderSetup?: any;
sceneOpacity?: any;
screenSpaceCoverageCalculationMethod?: any;
selectionColor?: any;
showAuxOnNavigation?: any;
silhouetteEffect?: any;
silhouetteEffectColor?: any;
silhouetteEffectExclusiveEnabled?: any;
smallFeatureCulling?: any;
smallFeaturePixelThreshold?: any;
soc?: any;
spacemouseMultiplier?: any;
ssaoEnabled?: any;
taaEnabled?: any;
topoGeometryColor?: any;
topoGeometrySecondaryColor?: any;
topoPointsEnabled?: any;
transparencyMode?: any;
turntableLowerVerticalLimit?: any;
turntableUpperVerticalLimit?: any;
turntableVerticalLimitsEnabled?: any;
useDevicePixelRatio?: any;
vertexColorsEnabled?: any;
viewPerspective?: any;
webglPreserveDrawingbuffer?: any;
},
): ViewerAPI;
deleteMemberProfileEntry(key: string): Promise<void>;
disableCapping(clipPlaneId: number): Promise<void>;
disconnectFromSession(): void;
disconnectXR(): Promise<void>;
enableCapping(clipPlaneId: number): Promise<void>;
endExplosion(): void;
enterXRInitMode(xrInitOptions?: XRInitOptions): Promise<void>;
exportXRInitTemplate(): Promise<string>;
fetchAttachmentData(attachmentID: number): Promise<Serializable>;
getAnnotationData(annotationId: number): AnnotationData;
getAnnotations(): number[];
getAttachmentData(attachmentID: number): Serializable;
getAttachmentDataURI(attachmentID: number): string;
getClipPlanes(): number[];
getClipRoom(): number;
getCollection(collectionID: number): ICollection;
getCollectionElements(collectionID: number): Promise<number[]>;
getCollectionNodeCount(collectionID: number): Promise<number>;
getCoordinateSystemForwardVector(): | Float32Array<ArrayBufferLike>
| [number, number, number];
getCoordinateSystemMatrix(): | Float32Array<ArrayBufferLike>
| [
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
];
getCoordinateSystemRightVector(): | Float32Array<ArrayBufferLike>
| [number, number, number];
getCoordinateSystemUpVector(): | Float32Array<ArrayBufferLike>
| [number, number, number];
getDrawingPlaneData(drawingPlaneId: number): DrawingPlaneProperties;
getDrawingPlanes(): number[];
getDrawings(): number[];
getEnabledAuxNodes(nodeID: number): Promise<number[]>;
getEnabledLayerFilters(): string[];
getInteractionMode(): InteractionMode;
getMaterialData(materialId: number): MaterialProperties;
getMaterials(): number[];
getMeasurements(): number[];
getMemberName(): string;
getMembers(): number[];
getMetadata(nodeID: number): Promise<{ [key: string]: string }>;
getName(): string;
getProperties<T extends string>(
nodeID: number,
properties: T[],
): Promise<PropertyType<T>[]>;
getProperty<T extends string>(
nodeID: number,
property: T,
): Promise<PropertyType<T>>;
getRegisteredLayerFilters(): { [key: string]: boolean };
getRootNodeId(
target: number | TopologyHandle,
includeTarget?: boolean,
): number;
getSelectedLeafNodes(): number[];
getSelectedNodes(): number[];
getSelectedTopologyHandles(): TopologyHandle[];
getSelection(): Promise<number[]>;
getSessionMemberID(): number;
getSessionMembers(): Promise<SessionMemberData[]>;
getSessionStateData(): SessionStateData;
getShapeHandle(handle: TopologyHandle): TopologyHandle;
getSnapshotData(
snapshotID: number,
): { attachmentID: number; name: string; order: number };
getSnapshots(): number[];
getStatistics(
nodeType?: NodeType,
nodeID?: number,
recursive?: boolean,
): Promise<any>;
getTopologyType(handle: TopologyHandle): TopologyType;
getViewer(id?: string): ViewerAPI;
getViewers(): ViewerAPI[];
getXRCapabilities(): XRCapability[];
getXRMembers(): number[];
getXRPlaybackProperties(): XRPlaybackProperties;
getXRPlaybackState(): XRPlaybackState;
getXRState(): XRState;
hideXRBackgroundFeed(): Promise<void>;
importConfig(
config: {
aaSetting?: any;
additionalCookies?: any;
additionalRequestHeaders?: any;
additionalWSQueryParameters?: any;
applicationIdentifier?: any;
auxModeRecursiveSearch?: any;
auxModeUncolorFacesOnLeave?: any;
backgroundColor?: any;
batchedQueries?: any;
boosterURL?: any;
cappingEffectEdgeColor?: any;
cappingEffectEnabled?: any;
cappingEffectInnerColor?: any;
cappingGeometryColor?: any;
colorComparisonFirstColor?: any;
colorComparisonMatchingColor?: any;
colorComparisonSecondColor?: any;
colorizeEffect?: any;
contextMenuFunction?: any;
coordSys?: any;
defaultFieldOfView?: any;
defaultQueryLinkDepth?: any;
disableDefaultInteraction?: any;
disableSpecularHighlights?: any;
doubleClickAnimationVolumeScale?: any;
doubleClickTimeWindow?: any;
drawingArrowheadEnd?: any;
drawingArrowheadStart?: any;
drawingColor?: any;
drawingMode?: any;
drawingSize?: any;
dynamicAuxContrastEnabled?: any;
dynamicClippingDistance?: any;
dynamicClippingEnabled?: any;
dynamicCOREnabled?: any;
expandOnViewerSelection?: any;
faceHighlightColor?: any;
faceSelectionColor?: any;
fitViewFactor?: any;
flyNavigationSpeed?: any;
flyToOnDoubleClick?: any;
focusOnDoubleClick?: any;
frontPlaneAxis?: any;
frustumCulling?: any;
ghostedSceneOpacity?: any;
gizmoScalingFactor?: any;
gizmosEnabled?: any;
gpuMemoryReleaseFactor?: any;
hoverColor?: any;
hubURL?: any;
initialFit?: any;
initialFitDirection?: any;
initialStateActivation?: any;
initView?: any;
lightingEnvironment?: any;
lineHighlightColor?: any;
lineSelectionColor?: any;
loadRemoteConfigFile?: any;
logLevel?: any;
maxActiveSceneVolumeDiameter?: any;
maxConcurrentDownloads?: any;
maxDynamicClipDistance?: any;
maxGPUMemory?: any;
maxSRCCPUMemory?: any;
measurementAngularTolerance?: any;
measurementMaterialDensities?: any;
mouseInvertZoomingDirection?: any;
navigationMode?: any;
navigationSampling?: any;
navigationSpeedFactor?: any;
navigationSpeedThrottleFactor?: any;
notificationLogLevels?: any;
outlineColor?: any;
outlineColorOccluded?: any;
outlineInnerRadius?: any;
outlineOuterRadius?: any;
parentSelectEnabled?: any;
preferXHRWithCredentials?: any;
preSelectionColor?: any;
projectionType?: any;
renderAuxOnTop?: any;
renderMode?: any;
renderSetup?: any;
sceneOpacity?: any;
screenSpaceCoverageCalculationMethod?: any;
selectionColor?: any;
sessionDeviceTags?: any;
sessionForwardUrl?: any;
sessionInteractions?: any;
sessionMemberName?: any;
showAuxOnNavigation?: any;
silhouetteEffect?: any;
silhouetteEffectColor?: any;
silhouetteEffectExclusiveEnabled?: any;
skipSslVerify?: any;
smallFeatureCulling?: any;
smallFeaturePixelThreshold?: any;
snapshotContentSelection?: any;
soc?: any;
spacemouseMultiplier?: any;
ssaoEnabled?: any;
taaEnabled?: any;
topoGeometryColor?: any;
topoGeometrySecondaryColor?: any;
topoPointsEnabled?: any;
transparencyMode?: any;
turntableLowerVerticalLimit?: any;
turntableUpperVerticalLimit?: any;
turntableVerticalLimitsEnabled?: any;
uriMap?: any;
usageGroup?: any;
useDevicePixelRatio?: any;
vertexColorsEnabled?: any;
viewPerspective?: any;
webglPreserveDrawingbuffer?: any;
xrEnableDebugImages?: any;
xrFusionMode?: any;
xrImageCompressionQuality?: any;
xrImageResolutionProfile?: any;
xrModelTrackerQualityThreshold?: any;
xrModelTrackerSmoothingFactor?: any;
},
): void;
importSession(data: any, format?: "xscn"): Promise<any>;
importXRInitTemplate(template: string): Promise<void>;
invertEnabledStates(): void;
invertSelection(silent?: boolean): Promise<ChangeSelectionResult>;
isColorComparisonActive(): boolean;
isNodeDeletable(nodeID: number): boolean;
isNodePartOfEnabledLayers(nodeID: number): Promise<boolean>;
isNodePartOfEnabledVariant(nodeId: number): Promise<boolean>;
isNodeType(nodeID: number, nodeType: NodeType): boolean;
isOfflineStorageAvailable(): Promise<boolean>;
isSelected(nodeID: number): Promise<boolean>;
isTopologySelected(handle: TopologyHandle): boolean;
mapInternalToOriginalTopologyHandles(
handles: TopologyHandle[],
): Promise<OriginalTopologyHandle[]>;
mapOriginalToInternalTopologyHandles(
nodeID: number,
handles: OriginalTopologyHandle[],
): Promise<TopologyHandle[]>;
measureBetween(
target0: MeasurementTarget,
target1: MeasurementTarget,
): Promise<BetweenMeasurementResult>;
measureNormal(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<NormalMeasurementResult>;
measurePointsByDistance(
searchCurve: {
class: CURVE;
value: [[number, number, number], [number, number, number]][];
},
distanceCurves: { class: TOPOLOGY; value: TopologyHandle }[],
distance: number,
): Promise<DistanceConstraintMatch[]>;
measureTangent(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<TangentMeasurementResult>;
measureThickness(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<ThicknessMeasurementResult>;
openSpace(spaceHandle?: string): Promise<void>;
performExplosion(explosionFactor: number): void;
processInteractionInput(interactionData: InteractionData): void;
promoteSessionMember(memberID: number): void;
query(query: string | Query, nodeID?: number): Promise<QueryResult>;
readSetting<T extends string>(setting: T): ContextSettingType<T>;
registerCustomProperty(
name: string,
defaultValue: any,
recursive?: boolean,
): void;
registerFrameListener(listener: FrameListener): void;
registerListener<T extends WebVisEvent = WebVisEvent>(
eventTypes: EventType[],
listener: IEventListener<T>,
nodeID?: number,
observeSubTree?: boolean,
): number;
remove(nodeID?: number | number[], safe?: boolean): Promise<RemoveState>;
removeAnimationFrames(name: string): void;
removeAnnotation(annotationId: number, safe?: boolean): RemoveState;
removeAttachment(attachmentID: number, safe?: boolean): RemoveState;
removeCapping(clipPlaneId: number): Promise<void>;
removeClippingRoom(safe?: boolean): RemoveState;
removeClipPlane(clipPlaneId: number, safe?: boolean): RemoveState;
removeCollection(collectionID: number): void;
removeDrawing(drawingId: number, safe?: boolean): RemoveState;
removeDrawingPlane(drawingPlaneId: number, safe?: boolean): RemoveState;
removeFromCollection(
collectionID: number,
nodeID: number,
recursive?: boolean,
): void;
removeFromSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult>;
removeMaterial(materialId: number, safe?: boolean): RemoveState;
removeMeasurement(measurementID: number, safe?: boolean): RemoveState;
removeSessionMember(memberID: number): void;
removeSnapshot(snapshotID: number): void;
removeTopologyFromSelection(
handle: TopologyHandle | TopologyHandle[],
): Promise<void>;
removeViewer(viewer: ViewerAPI): void;
requestActiveSceneVolume(): Promise<BoxVolume>;
requestAnnotationData(annotationId: number): Promise<AnnotationProperties>;
requestAuxRootNodeIds(scopeNodeId?: number): Promise<number[]>;
requestBoxDescriptor(
nodeIds: number[],
): Promise<{ descriptor: TopologyBoxDescriptor; type: BOX }>;
requestClipPlaneData(clipPlaneId: number): Promise<ClipPlaneProperties>;
requestClipRoomData(): Promise<ClipRoomProperties>;
requestDrawingData(drawingId: number): Promise<DrawingData>;
requestFullSceneVolume(): Promise<BoxVolume>;
requestHubVersion(): Promise<string>;
requestL3DInformation(targetNodeId: number): Promise<any>;
requestMeasurementData(
measurementID: number,
): Promise<MeasurementProperties>;
requestMemberActions(memberId: number): Promise<MemberAction[]>;
requestMemberProperties(id: number): Promise<MemberProperties>;
requestNeighboringEdges(handle: TopologyHandle): Promise<TopologyHandle[]>;
requestNeighboringFaces(handle: TopologyHandle): Promise<TopologyHandle[]>;
requestNodeIdsByBoxVolume(
boxVolume: BoxVolume,
includeOverlappingNodes?: boolean,
includeDisabledNodes?: boolean,
forceExpand?: boolean,
scopeNodeId?: number,
): Promise<number[]>;
requestNodePathHandleMap(
paths: string[],
scope?: number,
): Promise<NodePathHandleMap>;
requestNodePathStrings(
handles: NodePathHandle[],
scope?: number,
typePriorities?: NodePathFragmentType[],
): Promise<string[]>;
requestRootNodeIds(
scopeNodeId?: number,
recursive?: boolean,
): Promise<number[]>;
requestServiceStates(): Promise<Map<ServiceType, ServiceState>>;
requestSnapshotData(snapshotID: number): Promise<SnapshotProperties>;
requestSpaceHandle(role?: MemberRole): Promise<string>;
requestSupportedContentTypes(): Promise<ContentType[]>;
requestSupportedRenderSetups(): Promise<{ name: string; value: string }[]>;
requestTopologyDescriptor(
handle: TopologyHandle,
): Promise<TopologyDescriptor>;
requestVariants(nodeId: number): Promise<VariantProperties[]>;
requestXRDeviceScreenshot(): Promise<string>;
requestXRScanshot(): Promise<XRScanshot>;
resetInteractionMode(keepColorCompareActive?: boolean): void;
resetProperties(
nodeID: number,
properties: string[],
recursive?: boolean,
): Promise<void>;
resetProperty(
nodeID: number,
property: string,
recursive?: boolean,
): Promise<void>;
resetSetting(setting: ViewerSettingStrings | SettingStrings): void;
resetUserSettings(): void;
restoreSession(handle: string): Promise<void>;
restoreSnapshot(
snapshotID: number,
options?: SnapshotRestoreOptions,
): Promise<void>;
searchByVolume(
selectionBox: BoxVolume,
includeOverlappingNodes: boolean,
rootNodeID?: number,
): Promise<number>;
seekXRPlayback(frameIndex: number): Promise<void>;
selectCollection(
collectionID: number,
silent?: boolean,
): Promise<ChangeSelectionResult>;
setAttachmentData(attachmentID: number, data: Serializable): void;
setAttachmentDataURI(attachmentID: number, dataURI: string): void;
setInteractionMode(
mode: string | string[],
keepColorCompareActive?: boolean,
): void;
setInteractionMode(
mode: InteractionMode,
keepColorCompareActive?: boolean,
): void;
setLayerFilterEnabled(
name: string,
enabled: boolean,
): SetLayerFilterEnabledResult;
setMemberName(name: string): void;
setMemberProfileEntry(key: string, value: Serializable): Promise<void>;
setParent(nodeID: number, newParentID: number): void;
setProperty<T extends string>(
nodeID: number | number[],
property: T,
value: PropertyType<T>,
silent?: boolean,
): Promise<void>;
setSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult>;
setTopologyProperty<T extends keyof TopologyPropertyTypeMap>(
handle: TopologyHandle | TopologyHandle[],
property: T,
value: TopologyPropertyTypeMap[T],
): Promise<PromiseSettledResult<void>[]>;
setTopologySelection(
handle: TopologyHandle | TopologyHandle[],
): Promise<void>;
setVariantEnabled(variant: number, enabled: boolean): Promise<void>;
setXRPlaybackBoomerang(boomerang: boolean): Promise<void>;
setXRPlaybackFrameRange(
startFrame: number,
endFrame: number,
): Promise<number>;
setXRPlaybackSource(url: string): Promise<number>;
setXRPlaybackSpeed(speed: number): void;
showXRBackgroundFeed(): Promise<void>;
shutdownSession(): Promise<void>;
startXRPlayback(): void;
startXRSpectate(sessionMemberId: number): Promise<void>;
stopXRPlayback(): void;
stopXRSpectate(): void;
storeSession(): Promise<string>;
transferSession(
progressCallback: StoreSessionProgressCallback,
): Promise<string>;
transferSession(): Promise<string>;
unanchorXR(): void;
unregisterFrameListener(listener: FrameListener): void;
unregisterListener(listenerID: number): void;
useMemberAction<A extends MemberAction>(
memberId: number,
action: A,
options?: MemberActionsToOptionsMap[A],
): Promise<void>;
waitFor(state: ContextState): Promise<void>;
}
Hierarchy (View Summary)
- AnnotationAPI
- ClipPlaneAPI
- CollectionAPI
- ContextStateAPI
- ExplosionAPI
- FrameAPI
- HubAPI
- InstanceGraphAPI
- InteractionAPI
- LayerFilterAPI
- EventAPI
- MeasurementAPI
- DrawingAPI
- DrawingPlaneAPI
- QueryAPI
- SelectionAPI
- SessionAPI
- SettingsAPI
- SessionStorageAPI
- UtilityAPI
- AttachmentAPI
- AnimationAPI
- NodePathAPI
- RealityAPI
- TopologyAPI
- VariantsAPI
- CoordinateSystemAPI
- MaterialAPI
- MemberAPI
- SpaceAPI
- ContextAPI
Index
Methods
Methods
add
- add(options: AddNodeOptions): number
Adds a new node to the instance graph.
Parameters
- options: AddNodeOptions
Specifies the options for the new Node.
Returns number
The ID of the added node
- options: AddNodeOptions
- add(
dataURI: string,
parentID?: number,
usage?: UsageString,
label?: string,
contentType?: string,
initialProperties?: InitialNodeProperties,
cacheStrategy?: CacheStrategy,
): number Parameters
- dataURI: string
Specifies the URI to the data resource.
OptionalparentID: numberSpecifies the parent Node ID of the added Node.
Optionalusage: UsageStringThe usage parameter allows to define how the resource should be inserted in the InstanceGraph.
Optionallabel: stringSpecifies a custom label for the added Node.
OptionalcontentType: stringSpecifies the MimeType of the data resource.
OptionalinitialProperties: InitialNodePropertiesSpecifies initialProperties of the added Node.
OptionalcacheStrategy: CacheStrategySpecifies the strategy which is used when a data cache is requested from the Hub.
Returns number
The ID of added node
Deprecated
This function will no longer be available in future webvis releases. Please use the add function with AddNodeOptions instead.
Adds a new Node to the InstanceGraph.
Triggers a NodeAddedEvent. In case of an error, a NodeErrorEvent is triggered.
- dataURI: string
add Custom Node
- addCustomNode(
customNodeType: string,
data: any,
dataType?: AttachmentType,
): number Creates a custom node along with custom data which is stored in an attachment.
The attached data can be accessed via the Property.ATTACHMENT property of the node.
Triggers a NodeAddedEvent. In case of an error, a NodeErrorEvent is triggered.
Parameters
- customNodeType: string
Specifies the custom node type.
- data: any
Specifies the data of the custom node.
OptionaldataType: AttachmentTypeSpecifies the type of the data. Default: "json".
Returns number
The ID of the newly created custom node.
- customNodeType: string
add To Collection
- addToCollection(collectionID: number, nodeID: number, recursive?: boolean): void
Parameters
- collectionID: number
Specifies to which collection the node should be added
- nodeID: number
Specifies which node should be added to the collection
Optionalrecursive: booleanSpecifies if the children of the node should also be added to the collection
Returns void
- collectionID: number
add Topology To Selection
- addTopologyToSelection(handle: TopologyHandle | TopologyHandle[]): Promise<void>
Adds one or more topological entities to the current selection.
Parameters
- handle: TopologyHandle | TopologyHandle[]
The topological entity or array of topological entities which should be added to the current selection.
Returns Promise<void>
A promise which resolves when the operation is completed.
- handle: TopologyHandle | TopologyHandle[]
add To Selection
- addToSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult> Adds the specified nodes to the current selection.
Triggers a SelectionChangedEvent if silent is set to false.
Parameters
- nodeID: number | number[]
The ID or array of IDs of the nodes to add to the selection.
Optionalsilent: booleanIf set to true, no event will be emitted. Default: false
Returns Promise<ChangeSelectionResult>
The result of the selection change.
- nodeID: number | number[]
anchorXR
- anchorXR(xrAnchorOptions?: XRAnchorOptions): void
ExperimentalAnchors the model at the current 3D pose. Visually, this will have the effect that the model will stay at the current position and orientation in the real world.
Please note, that in a model-based tracking scenario, the model will get anchored automatically when the alignment of the model with the real world object is high enough that tracking can be performed (model is snapped).
This will trigger a XRStateChangedEvent with XRState.anchored set to
true.The optional parameter XRAnchorOptions, in conjunction with XRAnchorOptions.anchorToSurface, can be used to anchor the model on a detected surface. By default, this is set to false, and the model is anchored at the current 3D pose of the device, as described above.
However, if set to true, and if the device running webvis supports XR and ray casting, a mathematical ray will be cast from the device into the real world. If this ray intersects with a detected surface, the scene will be transformed and anchored to this surface at the intersection point, with the Y axis alined orthogonally to the surface. On occasion, the model may need to be offset, so it does not appear to be imbedded in the surface it is anchored to. In order to achieve this, an optional parameter can be set in the XRAnchorOptions, by updating the XRAnchorOptions.xrAnchorOffsetTransform matrix.
Parameters
OptionalxrAnchorOptions: XRAnchorOptionsAn optional object that contains the anchorToSurface property.
Returns void
change Annotation
- changeAnnotation(
annotationId: number,
properties: AnnotationProperties,
): AnnotationProperties Changes one or more properties of an Annotation with the specified ID and triggers an AnnotationChangedEvent.
Parameters
- annotationId: number
The ID of the Annotation you want to change.
- properties: AnnotationProperties
The properties of the Annotation you want change.
Returns AnnotationProperties
An Object with the changed Properties.
- annotationId: number
- changeAnnotation(
annotationID: number,
label?: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelPosition?: number[] | Float32Array<ArrayBufferLike>,
active?: boolean,
transform?: number[] | Float32Array<ArrayBufferLike>,
): void Parameters
- annotationID: number
The ID of the Annotation.
Optionallabel: stringThe text of the Annotation.
Optionalvisible: booleanIndicates if the Annotation should be visible or hidden.
OptionalanchorPosition: number[] | Float32Array<ArrayBufferLike>Anchor position in world space coordinates.
OptionallabelPosition: number[] | Float32Array<ArrayBufferLike>The position of the label.
Optionalactive: booleanDEPRECATED
Optionaltransform: number[] | Float32Array<ArrayBufferLike>The transformation of the Annotation.
Returns void
Deprecated
Changes an annotation. Should use a properties object AnnotationProperties as an argument rather than passing individual values.
- annotationID: number
change Clipping Room
- changeClippingRoom(properties?: ClipRoomProperties): ClipRoomProperties
Changes one or more properties of an existing clip room.
Allows modifying various aspects of the clip room such as size, position, orientation (via transform matrix), visibility, and enabled state. Only the properties specified in the properties object will be changed.
Since WebVis only supports a single clip room at a time, there's no need to specify a clip room ID. If no clip room exists when this method is called, it will create one.
Triggers a ClippingRoomChangedEvent when properties are modified.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Change the size and position of a clip room const updatedProps = context.changeClippingRoom({ size: [20, 15, 10], // Resize the clip room transform: [ // Move to new position with rotation 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 5, 2, 3, 1 // Translation component ], invisible: true // Hide the visual representation }); // Disable the clip room temporarily without removing it context.changeClippingRoom({ enabled: false });Parameters
Optionalproperties: ClipRoomPropertiesProperties to change on the clip room
Returns ClipRoomProperties
An object containing only the properties that were actually changed
- changeClippingRoom(
name?: string,
size?: number[] | Float32Array<ArrayBufferLike>,
transformation?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
): ClipRoomProperties Parameters
Optionalname: stringThe name of the clip room.
Optionalsize: number[] | Float32Array<ArrayBufferLike>The size of the clip room.
Optionaltransformation: number[] | Float32Array<ArrayBufferLike>The transformation of the clip room.
Optionaldisabled: booleanThe disabled state of the clip room.
Optionalinvisible: booleanThe invisible state of the clip room.
Returns ClipRoomProperties
An object with the changed properties.
change Clip Plane
- changeClipPlane(
clipPlaneId: number,
properties: ClipPlaneProperties,
): ClipPlaneProperties Changes one or more properties of an existing clip plane .
Allows modifying various aspects of a clip plane such as orientation, position, visibility, and selection of which nodes are affected. Only the properties specified in the properties object will be changed.
Triggers a ClipPlaneChangedEvent when properties are modified.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Change the position and orientation of a clip plane const updatedProps = context.changeClipPlane(clipPlaneId, { normal: [0, 1, 0], // Update to Y-axis normal position: [0, 0, 5], // Move to new position invisible: true // Hide the visual plane representation }); // Exclude certain components from being clipped context.changeClipPlane(clipPlaneId, { excludedNodes: [1234, 5678] // These nodes won't be affected by the clip plane });Parameters
- clipPlaneId: number
The ID of the clip plane to modify
- properties: ClipPlaneProperties
Properties to change on the clip plane
Returns ClipPlaneProperties
An object containing only the properties that were actually changed
- clipPlaneId: number
- changeClipPlane(
clipPlaneID: number,
normal?: number[] | Float32Array<ArrayBufferLike>,
point?: number[] | Float32Array<ArrayBufferLike>,
name?: string,
thickness?: number,
tangent?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
exclusive?: boolean,
): void Parameters
- clipPlaneID: number
The ID of the clip plane to modify
Optionalnormal: number[] | Float32Array<ArrayBufferLike>The new normal vector for the clip plane
Optionalpoint: number[] | Float32Array<ArrayBufferLike>A point in space that lies on the clip plane
Optionalname: stringThe display name for the clip plane
Optionalthickness: numberThe visual thickness of the clip plane
Optionaltangent: number[] | Float32Array<ArrayBufferLike>The tangent vector for the clip plane
Optionaldisabled: booleanWhether the clip plane is enabled (false) or disabled (true)
Optionalinvisible: booleanWhether the clip plane's visual representation is hidden
Optionalexclusive: booleanWhether the clip plane only affects nodes with the exclusiveClipplanes property
Returns void
Deprecated
Calling changeClipPlane with single parameters is deprecated, please use the version with ClipPlaneProperties instead.
Changes properties of an existing clip plane using individual parameters.
Triggers a ClipPlaneChangedEvent when properties are modified.
- clipPlaneID: number
change Drawing
- changeDrawing(
drawingId: number,
properties: DrawingProperties,
): DrawingProperties Changes one or more properties of a Drawing with the specified id.
Parameters
- drawingId: number
The id of the Drawing.
- properties: DrawingProperties
The properties of the Drawing.
Returns DrawingProperties
An object with the changed properties.
- drawingId: number
change Drawing Plane
- changeDrawingPlane(
drawingPlaneId: number,
properties: DrawingPlaneProperties,
): DrawingPlaneProperties ExperimentalChanges one or more properties of a DrawingPlane with the specified ID.
Parameters
- drawingPlaneId: number
The ID of the DrawingPlane you want to change.
- properties: DrawingPlaneProperties
The properties of the DrawingPlane you want change.
Returns DrawingPlaneProperties
An Object with the changed Properties.
- drawingPlaneId: number
change Material
- changeMaterial(
materialId: number,
properties: MaterialProperties,
): MaterialProperties ExperimentalExperimental. May be changed in the future without notice.
Changes one or more properties of a material with the specified ID and triggers a MaterialChangedEvent.
Parameters
- materialId: number
The ID of the material you want to change.
- properties: MaterialProperties
The properties of the material you want change.
Returns MaterialProperties
An object with the changed properties.
- materialId: number
change Measurement
- changeMeasurement(
measurementID: number,
properties: MeasurementProperties,
): MeasurementProperties Changes one or more properties of the measurement entity with the specified ID.
Triggers a MeasurementChangedEvent when the measurement entity has been changed.
Parameters
- measurementID: number
The ID of the measurement entity that should be changed.
- properties: MeasurementProperties
The properties that should be changed.
Returns MeasurementProperties
An object with the changed properties.
- measurementID: number
change Setting
change Snapshot
- changeSnapshot(
snapshotID: number,
properties: SnapshotProperties,
): SnapshotProperties Changes one or more properties of a snapshot with the specified ID.
Triggers a SnapshotChangedEvent.
Parameters
- snapshotID: number
The ID of the snapshot to change.
- properties: SnapshotProperties
The properties of the snapshot to change.
Returns SnapshotProperties
An object with the changed properties.
- snapshotID: number
- changeSnapshot(
snapshotID: number,
name?: string,
screenshotURL?: string,
order?: number,
): SnapshotProperties Changes the textual description of the snapshot with the specified ID to the value of text.
Triggers a SnapshotChangedEvent.
Parameters
- snapshotID: number
The ID of the snapshot to change.
Optionalname: stringThe new name of the snapshot.
OptionalscreenshotURL: stringThe new screenshot URL of the snapshot.
Optionalorder: numberThe order inside the list of snapshots.
Returns SnapshotProperties
- snapshotID: number
clear
clear Selection
- clearSelection(silent?: boolean): Promise<ChangeSelectionResult>
Clears the current selection.
Triggers a SelectionChangedEvent if silent is set to false.
Parameters
Optionalsilent: booleanIf set to true, no event will be emitted. Default: false
Returns Promise<ChangeSelectionResult>
The result of the selection change.
clear Topology Selection
clip Other Parts
- clipOtherParts(target: number | number[]): void
Creates a clip room that encompasses the selected node(s).
This method automatically calculates a bounding box around the specified target node(s) and creates a clip room with the exact dimensions of that box. It's an easy way to isolate specific components for closer examination by clipping away all surrounding geometry.
The created clip room replaces any existing clip room .
Example usage:
// Get the webvis context const context = webvis.getContext(); // Create a clip room around a single component context.clipOtherParts(4567); // Create a clip room around multiple components context.clipOtherParts([1234, 5678, 9012]); // Create a clip room around the currently selected components const selectedNodes = context.getSelectedNodes(); if (selectedNodes.length > 0) { context.clipOtherParts(selectedNodes); }Parameters
- target: number | number[]
ID or array of IDs of the nodes to create a clip room around
Returns void
- target: number | number[]
clone Into New Space
collect Runtime Nodes Of Type
- collectRuntimeNodesOfType(nodeType: NodeType, subType?: string): number[]
Returns a list of all existing runtime node IDs of a specified type.
Parameters
- nodeType: NodeType
The node type to collect.
OptionalsubType: stringThe sub type to collect. Only used for custom nodes. See Property.SUBTYPE.
Returns number[]
A list of runtime node IDs of the specified type.
- nodeType: NodeType
connect To Session
connectXR
- connectXR(xrConfiguration?: XRConfiguration): Promise<void>
ExperimentalConnect to the XR system with the given XRConfiguration. The configuration determines what parts of the API are desired to be used.
By default, XR will be connected with the following configuration:
const defaultXRConfiguration = { imageSourceConfig: { type: XRImageSource.DEVICE } }If unspecified,
modelTrackingEnabledandautoShowBackgroundFeedwill be inferred astrueanddeviceScreenshotsEnabledasfalseautomatically.Note: If a change of configuration is required after being initialized, the user has to disconnectXR and connect with the new configuration.
Parameters
OptionalxrConfiguration: XRConfigurationThe configuration for the XR system
Returns Promise<void>
Returns a Promise which resolved when the operation was successful or rejects in an error case
create Animation Frames
- createAnimationFrames(name: string, frames: AnimationFrame[]): void
Creates a new keyframe-based animation sequence.
Parameters
- name: string
The name of the animation sequence.
- frames: AnimationFrame[]
The keyframes of the animation sequence.
Returns void
- name: string
create Annotation
- createAnnotation(properties?: AnnotationProperties): number
Creates a new Annotation and triggers an AnnotationCreatedEvent.
Parameters
Optionalproperties: AnnotationPropertiesInitial properties of the created Annotation.
Returns number
The ID of the newly created Annotation.
- createAnnotation(
nodeID: number,
label: string,
visible?: boolean,
anchorPosition?: number[] | Float32Array<ArrayBufferLike>,
labelOffset?: number[] | Float32Array<ArrayBufferLike>,
): number Parameters
- nodeID: number
The ID of the node that the Annotation belongs to.
- label: string
The text of the Annotation.
Optionalvisible: booleanIndicates if the Annotation should be visible or hidden.
OptionalanchorPosition: number[] | Float32Array<ArrayBufferLike>Anchor position in world space coordinates.
OptionallabelOffset: number[] | Float32Array<ArrayBufferLike>The offset between anchorPosition and where the label should be displayed.
Returns number
The ID of the new annotation.
Deprecated
Creates a new annotation. Should use a properties object AnnotationProperties as an argument rather than passing individual values.
- nodeID: number
create Attachment
- createAttachment(dataType: AttachmentType): number
Creates a new attachment.
Triggers an AttachmentCreatedEvent.
Parameters
- dataType: AttachmentType
Specifies the attachment data type.
Returns number
The ID of the created attachment.
- dataType: AttachmentType
create Box Volume
create Capping
- createCapping(clipPlaneId: number): Promise<void>
ExperimentalGenerates capping geometry for the surface that is cut by a clip plane.
This method creates visible geometry at the intersection of the clip plane and the model, allowing you to see and interact with the cut surface. The generated capping geometry supports measurements and all other operations that can be performed on regular geometry.
Once generated, capping geometry can be enabled, disabled, or removed using the corresponding methods.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Create a clip plane const clipPlaneId = context.createClipPlane({ normal: [0, 0, 1], position: [0, 0, 0] }); // Generate capping geometry for the cut surface await context.createCapping(clipPlaneId); // Later, disable the capping when not needed await context.disableCapping(clipPlaneId);Parameters
- clipPlaneId: number
The ID of the clip plane to create capping geometry for
Returns Promise<void>
Promise that resolves when the capping geometry has been created
- clipPlaneId: number
create Circular Arc Descriptor
- createCircularArcDescriptor(
point0: [number, number, number],
point1: [number, number, number],
point2: [number, number, number],
): { descriptor: TopologyCircularArcDescriptor; type: CIRCULAR_ARC } Creates a circular arc descriptor based on three points.
Parameters
- point0: [number, number, number]
The first point.
- point1: [number, number, number]
The second point.
- point2: [number, number, number]
The third point.
Returns { descriptor: TopologyCircularArcDescriptor; type: CIRCULAR_ARC }
A circular arc descriptor.
descriptor: TopologyCircularArcDescriptor
The attributes of the topological entity.
type: CIRCULAR_ARC
The subtype of the topological entity.
- point0: [number, number, number]
create Clipping Room
- createClippingRoom(properties?: ClipRoomProperties): void
Creates a new clip room.
A clip room consists of six orthogonal planes forming a box that clips any geometry outside of it. This is useful for examining internal structures of complex models or focusing on specific regions of interest.
Clip rooms can be positioned and sized using the properties object, and can be made invisible (for clipping without showing the room boundaries) or disabled temporarily without removing them.
Triggers a ClippingRoomCreatedEvent when the clip room is created.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Create a basic clip room at the origin context.createClippingRoom({ size: [10, 10, 10], // Size along X, Y, and Z axes name: "Engine Section" }); // Create a positioned and rotated clip room context.createClippingRoom({ size: [5, 5, 5], // Matrix including rotation and translation transform: [ 0.866, 0.5, 0, 0, // First row (rotation + scale) -0.5, 0.866, 0, 0, // Second row (rotation + scale) 0, 0, 1, 0, // Third row (rotation + scale) 10, 5, 3, 1 // Fourth row (translation + w) ] });Parameters
Optionalproperties: ClipRoomPropertiesInitial properties of the created clip room. Default: {}
Returns void
- createClippingRoom(
name?: string,
size?: number[] | Float32Array<ArrayBufferLike>,
transformation?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
): void Parameters
Optionalname: stringThe name of the clip room.
Optionalsize: number[] | Float32Array<ArrayBufferLike>The size of the clip room.
Optionaltransformation: number[] | Float32Array<ArrayBufferLike>The transformation of the clip room.
Optionaldisabled: booleanThe disabled state of the clip room.
Optionalinvisible: booleanThe invisible state of the clip room.
Returns void
create Clip Plane
- createClipPlane(properties?: ClipPlaneProperties): number
Creates a new clip plane.
Clip planes create a visual cut through 3D models, allowing examination of internal structures by hiding geometry on one side of the plane. The orientation and position of the plane are defined by its normal vector and a point on the plane.
A clip plane can be configured to exclude specific nodes from clipping or to clip only specific nodes, using the excludedNodes and clippedNodes properties respectively.
Triggers a ClipPlaneCreatedEvent when the clip plane is created.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Create a clip plane aligned with the XY plane const clipPlaneId = context.createClipPlane({ normal: [0, 0, 1], // Z-axis normal position: [0.04, -0.03, -0.15], // Passing through a specific point name: "Section View" }); // Create a clip plane with excluded nodes const clipPlaneId = context.createClipPlane({ normal: [1, 0, 0], excludedNodes: [1234, 5678], // These nodes won't be clipped invisible: true // Hide the visual representation of the plane });Parameters
Optionalproperties: ClipPlanePropertiesInitial properties of the created clip plane. Default: {}
Returns number
The ID of the newly created clip plane.
- createClipPlane(
normal?: number[] | Float32Array<ArrayBufferLike>,
point?: number[] | Float32Array<ArrayBufferLike>,
name?: string,
thickness?: number,
tangent?: number[] | Float32Array<ArrayBufferLike>,
disabled?: boolean,
invisible?: boolean,
exclusive?: boolean,
): number Parameters
Optionalnormal: number[] | Float32Array<ArrayBufferLike>The normal of the clip plane
Optionalpoint: number[] | Float32Array<ArrayBufferLike>An arbitrary point in space which lies on the clip plane
Optionalname: stringThe name of the clip plane
Optionalthickness: numberThe thickness of the clip plane
Optionaltangent: number[] | Float32Array<ArrayBufferLike>The tangent of the clip plane
Optionaldisabled: booleanThe state of the clip plane
Optionalinvisible: booleanInvisible on the UI
Optionalexclusive: booleanSet the exclusive flag to clip geometry when using exclusiveClipplanes property
Returns number
The ID of the newly created clip plane
create Collection
create Drawing
- createDrawing(data: ViewerDrawingResult, properties?: DrawingProperties): number
Creates a new Drawing from the Output of the ViewerDrawingAPI.
Parameters
- data: ViewerDrawingResult
The data generated with the help of the ViewerDrawingAPI.
Optionalproperties: DrawingPropertiesInitial properties of the created Drawing.
Returns number
The id of the newly created Drawing.
- data: ViewerDrawingResult
create Drawing Plane
- createDrawingPlane(properties?: DrawingPlaneProperties): number
ExperimentalCreates a new DrawingPlane with the specified properties.
Parameters
Optionalproperties: DrawingPlanePropertiesInitial properties of the created Drawing.
Returns number
The ID of the newly created Drawing.
create Explosion
create Material
- createMaterial(properties?: MaterialProperties): number
ExperimentalExperimental. May be changed in the future without notice.
Creates a new material and triggers a MaterialCreatedEvent.
Parameters
Optionalproperties: MaterialPropertiesInitial properties of the created material.
Returns number
The ID of the newly created material.
create Measurement
- createMeasurement<T extends keyof MeasurementTypeToTargetMap>(
type: T,
targets: MeasurementTypeToTargetMap[T],
properties?: MeasurementProperties,
): number Performs a measurement and creates a corresponding measurement entity in the webvis context. The different kinds of measurements that this function can perform are defined in the MeasurementType enum. Depending on the measurement type, different targets are required.
Triggers a MeasurementCreatedEvent when the measurement entity has been created, followed by a MeasurementChangedEvent when processing is complete and the result is available.
Type Parameters
- T extends keyof MeasurementTypeToTargetMap
The MeasurementType.
Parameters
- type: T
The type of the measurement, given as a MeasurementType.
- targets: MeasurementTypeToTargetMap[T]
The MeasurementTargets, as defined by the MeasurementType.
Optionalproperties: MeasurementPropertiesAdditional properties of the measurement entity. These include the enabled state and positioning information.
Returns number
The ID of the created measurement.
- T extends keyof MeasurementTypeToTargetMap
create Node Path Handles
- createNodePathHandles(targets: number[]): Promise<NodePathHandle[]>
createNodePathHandles Creates and returns handles for the target node ids or topology selectors.
Parameters
- targets: number[]
{Array
} Array of target node ids to create the handles for
Returns Promise<NodePathHandle[]>
The array of handles
- targets: number[]
create Point Descriptor
- createPointDescriptor(
point: [number, number, number],
): { descriptor: TopologyPointDescriptor; type: POINT } Creates a point descriptor for the specified point.
Parameters
- point: [number, number, number]
The point.
Returns { descriptor: TopologyPointDescriptor; type: POINT }
A point descriptor.
descriptor: TopologyPointDescriptor
The attributes of the topological entity.
type: POINT
The subtype of the topological entity.
- point: [number, number, number]
create Snapshot
- createSnapshot(
name?: string,
options?: SnapshotCreationOptions,
): Promise<number> Creates a snapshot of the current session state.
Triggers a SnapshotCreationStartedEvent and, if successful, a SnapshotCreatedEvent.
Parameters
Optionalname: stringThe name of the snapshot.
Optionaloptions: SnapshotCreationOptionsOptions used for the snapshot creation.
Returns Promise<number>
The ID of the created snapshot.
create Viewer
- createViewer(
viewerID?: string,
canvas?: HTMLCanvasElement,
settings?: {
aaSetting?: any;
backgroundColor?: any;
cappingEffectEdgeColor?: any;
cappingEffectEnabled?: any;
cappingEffectInnerColor?: any;
colorComparisonFirstColor?: any;
colorComparisonMatchingColor?: any;
colorComparisonSecondColor?: any;
colorizeEffect?: any;
coordSys?: any;
defaultFieldOfView?: any;
disableSpecularHighlights?: any;
doubleClickAnimationVolumeScale?: any;
doubleClickTimeWindow?: any;
drawingArrowheadEnd?: any;
drawingArrowheadStart?: any;
drawingColor?: any;
drawingMode?: any;
drawingSize?: any;
dynamicAuxContrastEnabled?: any;
dynamicClippingDistance?: any;
dynamicClippingEnabled?: any;
dynamicCOREnabled?: any;
expandOnViewerSelection?: any;
faceHighlightColor?: any;
faceSelectionColor?: any;
fitViewFactor?: any;
flyNavigationSpeed?: any;
flyToOnDoubleClick?: any;
focusOnDoubleClick?: any;
frustumCulling?: any;
ghostedSceneOpacity?: any;
gizmoScalingFactor?: any;
gizmosEnabled?: any;
gpuMemoryReleaseFactor?: any;
hoverColor?: any;
initialFit?: any;
initialFitDirection?: any;
initView?: any;
lightingEnvironment?: any;
lineHighlightColor?: any;
lineSelectionColor?: any;
maxDynamicClipDistance?: any;
maxGPUMemory?: any;
maxSRCCPUMemory?: any;
mouseInvertZoomingDirection?: any;
navigationMode?: any;
navigationSampling?: any;
navigationSpeedFactor?: any;
navigationSpeedThrottleFactor?: any;
outlineColor?: any;
outlineColorOccluded?: any;
outlineInnerRadius?: any;
outlineOuterRadius?: any;
preSelectionColor?: any;
projectionType?: any;
renderAuxOnTop?: any;
renderMode?: any;
renderSetup?: any;
sceneOpacity?: any;
screenSpaceCoverageCalculationMethod?: any;
selectionColor?: any;
showAuxOnNavigation?: any;
silhouetteEffect?: any;
silhouetteEffectColor?: any;
silhouetteEffectExclusiveEnabled?: any;
smallFeatureCulling?: any;
smallFeaturePixelThreshold?: any;
soc?: any;
spacemouseMultiplier?: any;
ssaoEnabled?: any;
taaEnabled?: any;
topoGeometryColor?: any;
topoGeometrySecondaryColor?: any;
topoPointsEnabled?: any;
transparencyMode?: any;
turntableLowerVerticalLimit?: any;
turntableUpperVerticalLimit?: any;
turntableVerticalLimitsEnabled?: any;
useDevicePixelRatio?: any;
vertexColorsEnabled?: any;
viewPerspective?: any;
webglPreserveDrawingbuffer?: any;
},
): ViewerAPI Creates a viewer element.
Parameters
OptionalviewerID: stringThe id of the viewer.
Optionalcanvas: HTMLCanvasElementThe canvas which is attached to the viewer.
Optionalsettings: {
aaSetting?: any;
backgroundColor?: any;
cappingEffectEdgeColor?: any;
cappingEffectEnabled?: any;
cappingEffectInnerColor?: any;
colorComparisonFirstColor?: any;
colorComparisonMatchingColor?: any;
colorComparisonSecondColor?: any;
colorizeEffect?: any;
coordSys?: any;
defaultFieldOfView?: any;
disableSpecularHighlights?: any;
doubleClickAnimationVolumeScale?: any;
doubleClickTimeWindow?: any;
drawingArrowheadEnd?: any;
drawingArrowheadStart?: any;
drawingColor?: any;
drawingMode?: any;
drawingSize?: any;
dynamicAuxContrastEnabled?: any;
dynamicClippingDistance?: any;
dynamicClippingEnabled?: any;
dynamicCOREnabled?: any;
expandOnViewerSelection?: any;
faceHighlightColor?: any;
faceSelectionColor?: any;
fitViewFactor?: any;
flyNavigationSpeed?: any;
flyToOnDoubleClick?: any;
focusOnDoubleClick?: any;
frustumCulling?: any;
ghostedSceneOpacity?: any;
gizmoScalingFactor?: any;
gizmosEnabled?: any;
gpuMemoryReleaseFactor?: any;
hoverColor?: any;
initialFit?: any;
initialFitDirection?: any;
initView?: any;
lightingEnvironment?: any;
lineHighlightColor?: any;
lineSelectionColor?: any;
maxDynamicClipDistance?: any;
maxGPUMemory?: any;
maxSRCCPUMemory?: any;
mouseInvertZoomingDirection?: any;
navigationMode?: any;
navigationSampling?: any;
navigationSpeedFactor?: any;
navigationSpeedThrottleFactor?: any;
outlineColor?: any;
outlineColorOccluded?: any;
outlineInnerRadius?: any;
outlineOuterRadius?: any;
preSelectionColor?: any;
projectionType?: any;
renderAuxOnTop?: any;
renderMode?: any;
renderSetup?: any;
sceneOpacity?: any;
screenSpaceCoverageCalculationMethod?: any;
selectionColor?: any;
showAuxOnNavigation?: any;
silhouetteEffect?: any;
silhouetteEffectColor?: any;
silhouetteEffectExclusiveEnabled?: any;
smallFeatureCulling?: any;
smallFeaturePixelThreshold?: any;
soc?: any;
spacemouseMultiplier?: any;
ssaoEnabled?: any;
taaEnabled?: any;
topoGeometryColor?: any;
topoGeometrySecondaryColor?: any;
topoPointsEnabled?: any;
transparencyMode?: any;
turntableLowerVerticalLimit?: any;
turntableUpperVerticalLimit?: any;
turntableVerticalLimitsEnabled?: any;
useDevicePixelRatio?: any;
vertexColorsEnabled?: any;
viewPerspective?: any;
webglPreserveDrawingbuffer?: any;
}ViewerSettings
Returns ViewerAPI
delete Member Profile Entry
disable Capping
- disableCapping(clipPlaneId: number): Promise<void>
ExperimentalDisables the generated capping geometry for a clip plane.
This method temporarily hides the capping geometry without removing it from the scene. The capping geometry can be made visible again using enableCapping. This is useful when you need to switch between seeing the cut surface and seeing through to the interior of the model.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Create a clip plane and generate capping geometry const clipPlaneId = context.createClipPlane({ normal: [0, 0, 1], position: [0, 0, 0] }); await context.createCapping(clipPlaneId); // Hide the capping geometry temporarily await context.disableCapping(clipPlaneId); // Show it again later await context.enableCapping(clipPlaneId);Parameters
- clipPlaneId: number
The ID of the clip plane whose capping geometry should be disabled
Returns Promise<void>
Promise that resolves when the capping geometry has been disabled
- clipPlaneId: number
disconnect From Session
disconnectXR
enable Capping
- enableCapping(clipPlaneId: number): Promise<void>
ExperimentalEnables the generated capping geometry for a clip plane.
After capping geometry has been created for a clip plane, this method makes it visible . The capping geometry represents the intersection between the clip plane and the model, allowing visualization and interaction with the cut surface.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Create a clip plane and generate capping geometry const clipPlaneId = context.createClipPlane({ normal: [0, 0, 1], position: [0, 0, 0] }); await context.createCapping(clipPlaneId); // Later disable capping and then re-enable it await context.disableCapping(clipPlaneId); // ... await context.enableCapping(clipPlaneId);Parameters
- clipPlaneId: number
The ID of the clip plane whose capping geometry should be enabled
Returns Promise<void>
Promise that resolves when the capping geometry has been enabled
- clipPlaneId: number
end Explosion
enterXRInit Mode
- enterXRInitMode(xrInitOptions?: XRInitOptions): Promise<void>
ExperimentalEnter the XR initialization mode. The initialization mode is used as an entry point for model-based tracking. It unanchors any previously anchored model and starts the model-based tracking process. In this mode, the user can align the model with the real object (snapping). When the model is snapped, the XRState.anchored value will be set to
truewhich will trigger a XRStateChangedEvent. By that, the init mode gets exited and the model is anchored to the real object. The model now gets tracked and moves with the device.Please note, that this method should only be called if the XR system has the XRCapability.SUPPORTS_MODEL_TRACKING capability.
Parameters
OptionalxrInitOptions: XRInitOptionsThe options for the XR initialization mode
Returns Promise<void>
Returns a Promise which resolved when the operation was successful or rejects in an error case
exportXRInit Template
- exportXRInitTemplate(): Promise<string>
ExperimentalExports an initialization template for model-based tracking.
In a model-based tracking scenario, after a successful tracking session, the learned initialization data can be exported with this function and stored as a template for later.
This method is only available if the XR system has the XRCapability.SUPPORTS_MODEL_TRACKING capability.
The acquired data can be imported via importXRInitTemplate function.
Returns Promise<string>
Returns a Promise which contains the base64 encoded initialization template data when the operation was successful or rejects in an error case.
fetch Attachment Data
- fetchAttachmentData(attachmentID: number): Promise<Serializable>
Fetches and returns the attachment data of the specified attachment.
Parameters
- attachmentID: number
Specifies the attachment object.
Returns Promise<Serializable>
The attached data.
- attachmentID: number
get Annotation Data
- getAnnotationData(annotationId: number): AnnotationData
Parameters
- annotationId: number
The ID of the Annotation.
Returns AnnotationData
The content and properties of an annotation.
- annotationId: number
get Annotations
get Attachment Data
- getAttachmentData(attachmentID: number): Serializable
Returns the attachment data.
Parameters
- attachmentID: number
Specifies the attachment object.
Returns Serializable
The attached data
Deprecated
getAttachmentData is deprecated, please use fetchAttachmentData instead.
- attachmentID: number
get Attachment DataURI
get Clip Planes
- getClipPlanes(): number[]
Returns the IDs of all clip planes.
This method provides a list of all clip plane IDs that can be used with other ClipPlaneAPI methods like changeClipPlane, removeClipPlane, or requestClipPlaneData.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Get all clip planes and print their properties const clipPlaneIds = context.getClipPlanes(); clipPlaneIds.forEach(async (id) => { const properties = await context.requestClipPlaneData(id); console.log(`Clip plane ${id}: ${properties.name || 'unnamed'}`); });Returns number[]
An array of clip plane IDs. Empty array if no clip planes exist.
get Clip Room
- getClipRoom(): number
Returns the ID of the current clip room.
Since WebVis only supports a single clip room at a time, this method returns a single ID value rather than an array. The ID can be used with other clip room methods like requestClipRoomData.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Get the current clip room ID and retrieve its properties const clipRoomId = context.getClipRoom(); if (clipRoomId !== undefined) { const properties = await context.requestClipRoomData(); console.log(`Clip room size: [${properties.size}]`); } else { console.log("No clip room exists in the scene"); }Returns number
The ID of the current clip room, or undefined if no clip room exists
get Collection
- getCollection(collectionID: number): ICollection
Parameters
- collectionID: number
Specifies which collection should be returned
Returns ICollection
The collection with the given id
- collectionID: number
get Collection Elements
get Collection Node Count
get Coordinate System Forward Vector
get Coordinate System Matrix
- getCoordinateSystemMatrix(): | Float32Array<ArrayBufferLike>
| [
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
] This function returns a 4x4 transformation matrix that transforms the default right-handed coordinate system, where the x-axis points right, the y-axis points up, and the z-axis points forward (towards the viewer), to a custom coordinate system defined by the front plane axis setting.
Returns
| Float32Array<ArrayBufferLike>
| [
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
]The 4x4 coordinate system matrix
get Coordinate System Right Vector
get Coordinate System Up Vector
get Drawing Plane Data
- getDrawingPlaneData(drawingPlaneId: number): DrawingPlaneProperties
ExperimentalReturns the DrawingPlane properties for the specified DrawingPlane ID.
Parameters
- drawingPlaneId: number
The ID of the DrawingPlane you want to get the Data for.
Returns DrawingPlaneProperties
The requested DrawingPlane properties.
- drawingPlaneId: number
get Drawing Planes
get Drawings
get Enabled Aux Nodes
- getEnabledAuxNodes(nodeID: number): Promise<number[]>
Parameters
- nodeID: number
Specifies the entry point of the subtree traversal. Default: 0
Returns Promise<number[]>
An Array of all enabled aux node IDs
Deprecated
This function will no longer be available in future webvis releases. Use the QueryAPI instead.
Traverses the subtree of a given node ID and collects all enabled aux nodes.
- nodeID: number
get Enabled Layer Filters
get Interaction Mode
- getInteractionMode(): InteractionMode
Returns the current Interaction mode.
Returns InteractionMode
The current Interaction mode.
get Material Data
- getMaterialData(materialId: number): MaterialProperties
ExperimentalExperimental. May be changed in the future without notice.
Returns the properties of the material entity with the specified ID.
Parameters
- materialId: number
The ID of the material entity.
Returns MaterialProperties
The properties of the material entity.
- materialId: number
get Materials
get Measurements
get Member Name
get Members
- getMembers(): number[]
ExperimentalGets a list of all member IDs in the current space.
Returns number[]
An array of member IDs.
get Metadata
get Name
get Properties
- getProperties<T extends string>(
nodeID: number,
properties: T[],
): Promise<PropertyType<T>[]> Returns the values of the specified properties of the given node.
Type Parameters
Parameters
- nodeID: number
The ID of the node whose properties should be read.
- properties: T[]
The names of the Properties whose values should be read.
Returns Promise<PropertyType<T>[]>
The retrieved values of the node's properties.
- nodeID: number
get Property
- getProperty<T extends string>(
nodeID: number,
property: T,
): Promise<PropertyType<T>> Returns the value of the specified property of the given node.
Type Parameters
Parameters
Returns Promise<PropertyType<T>>
The retrieved value of the node property.
get Registered Layer Filters
get Root Node Id
- getRootNodeId(target: number | TopologyHandle, includeTarget?: boolean): number
Returns the root node ID of the given node or topology element.
Parameters
- target: number | TopologyHandle
Specifies the target node or topology element.
OptionalincludeTarget: booleanControls if the target node itself can be returned as root node. If set to false and a root node ID is passed in, it returns the next higher root node ID. Default: true
Returns number
The root node ID of the given node ID or topology handle.
- target: number | TopologyHandle
get Selected Leaf Nodes
get Selected Nodes
- getSelectedNodes(): number[]
Returns a list of all selected nodes. When a whole subtree is selected, only the parent node will be included in the returned array. To get the selected leaf nodes of the subtree, use getSelectedLeafNodes instead.
Returns number[]
An array which contains the IDs of all nodes in the current selection.
get Selected Topology Handles
- getSelectedTopologyHandles(): TopologyHandle[]
Returns all selected topological entities.
Returns TopologyHandle[]
All selected topological entities.
get Selection
- getSelection(): Promise<number[]>
Returns a list of all selected nodes.
Returns Promise<number[]>
An array which contains the IDs of all nodes in the current selection.
Deprecated
getSelection is deprecated, please use getSelectedNodes instead.
get Session MemberID
get Session Members
get Session State Data
get Shape Handle
- getShapeHandle(handle: TopologyHandle): TopologyHandle
Returns a handle for the shape that contains the given topological entity.
Parameters
- handle: TopologyHandle
The topology handle.
Returns TopologyHandle
A handle for the shape that contains the given topological entity.
- handle: TopologyHandle
get Snapshot Data
- getSnapshotData(
snapshotID: number,
): { attachmentID: number; name: string; order: number } Parameters
- snapshotID: number
The ID of the snapshot to request data for.
Returns { attachmentID: number; name: string; order: number }
The data of the specified snapshot.
Deprecated
getSnapshotData is deprecated. Please use requestSnapshotData instead.
- snapshotID: number
get Snapshots
get Statistics
- getStatistics(
nodeType?: NodeType,
nodeID?: number,
recursive?: boolean,
): Promise<any> Traverses the subtree of a given node ID and collects all statistics (currently only available for AUX nodes).
Parameters
OptionalnodeType: NodeTypeSpecifies the target node type. Default: NodeType.ALL
OptionalnodeID: numberSpecifies the node ID as the entry point of the subtree traversal. Default: 0
Optionalrecursive: boolean
Returns Promise<any>
An object of type/count pairs.
get Topology Type
- getTopologyType(handle: TopologyHandle): TopologyType
Returns the type of the given topological entity.
Parameters
- handle: TopologyHandle
The topology handle.
Returns TopologyType
The type of the given topological entity.
- handle: TopologyHandle
get Viewer
get Viewers
getXRCapabilities
- getXRCapabilities(): XRCapability[]
ExperimentalGet the array of XRCapability. The array of capabilities determines what parts of the API can be used. The capabilities are mostly defined by the used device.
Returns XRCapability[]
Returns an Array<XRCapability> containing the XR system's capabilities.
getXRMembers
- getXRMembers(): number[]
ExperimentalReturns an array of member IDs of those session members which are currently using an XR device and are currently publishing an XRImage stream.
The array will not contain the session member ID of the own session member. Will return an empty array, if
- the session is not connected.
- the session is connected, but no session member currently publishes an XRImage stream.
Returns number[]
The array of member IDs of those session members that are currently publishing an XRImage stream.
getXRPlayback Properties
- getXRPlaybackProperties(): XRPlaybackProperties
ExperimentalGet static information about the playback sequence.
Returns XRPlaybackProperties
The current XRPlaybackProperties
getXRPlayback State
- getXRPlaybackState(): XRPlaybackState
ExperimentalGet real-time information about the current state of the playback.
Returns XRPlaybackState
The current XRPlaybackState
getXRState
hideXRBackground Feed
- hideXRBackgroundFeed(): Promise<void>
ExperimentalStops putting the image feed into the viewer's background. Also see showXRBackgroundFeed.
This will trigger a XRStateChangedEvent with XRState.backgroundFeedVisible set to
false.Returns Promise<void>
Returns a Promise which resolved when the operation was successful or rejects in an error case
import Config
- importConfig(
config: {
aaSetting?: any;
additionalCookies?: any;
additionalRequestHeaders?: any;
additionalWSQueryParameters?: any;
applicationIdentifier?: any;
auxModeRecursiveSearch?: any;
auxModeUncolorFacesOnLeave?: any;
backgroundColor?: any;
batchedQueries?: any;
boosterURL?: any;
cappingEffectEdgeColor?: any;
cappingEffectEnabled?: any;
cappingEffectInnerColor?: any;
cappingGeometryColor?: any;
colorComparisonFirstColor?: any;
colorComparisonMatchingColor?: any;
colorComparisonSecondColor?: any;
colorizeEffect?: any;
contextMenuFunction?: any;
coordSys?: any;
defaultFieldOfView?: any;
defaultQueryLinkDepth?: any;
disableDefaultInteraction?: any;
disableSpecularHighlights?: any;
doubleClickAnimationVolumeScale?: any;
doubleClickTimeWindow?: any;
drawingArrowheadEnd?: any;
drawingArrowheadStart?: any;
drawingColor?: any;
drawingMode?: any;
drawingSize?: any;
dynamicAuxContrastEnabled?: any;
dynamicClippingDistance?: any;
dynamicClippingEnabled?: any;
dynamicCOREnabled?: any;
expandOnViewerSelection?: any;
faceHighlightColor?: any;
faceSelectionColor?: any;
fitViewFactor?: any;
flyNavigationSpeed?: any;
flyToOnDoubleClick?: any;
focusOnDoubleClick?: any;
frontPlaneAxis?: any;
frustumCulling?: any;
ghostedSceneOpacity?: any;
gizmoScalingFactor?: any;
gizmosEnabled?: any;
gpuMemoryReleaseFactor?: any;
hoverColor?: any;
hubURL?: any;
initialFit?: any;
initialFitDirection?: any;
initialStateActivation?: any;
initView?: any;
lightingEnvironment?: any;
lineHighlightColor?: any;
lineSelectionColor?: any;
loadRemoteConfigFile?: any;
logLevel?: any;
maxActiveSceneVolumeDiameter?: any;
maxConcurrentDownloads?: any;
maxDynamicClipDistance?: any;
maxGPUMemory?: any;
maxSRCCPUMemory?: any;
measurementAngularTolerance?: any;
measurementMaterialDensities?: any;
mouseInvertZoomingDirection?: any;
navigationMode?: any;
navigationSampling?: any;
navigationSpeedFactor?: any;
navigationSpeedThrottleFactor?: any;
notificationLogLevels?: any;
outlineColor?: any;
outlineColorOccluded?: any;
outlineInnerRadius?: any;
outlineOuterRadius?: any;
parentSelectEnabled?: any;
preferXHRWithCredentials?: any;
preSelectionColor?: any;
projectionType?: any;
renderAuxOnTop?: any;
renderMode?: any;
renderSetup?: any;
sceneOpacity?: any;
screenSpaceCoverageCalculationMethod?: any;
selectionColor?: any;
sessionDeviceTags?: any;
sessionForwardUrl?: any;
sessionInteractions?: any;
sessionMemberName?: any;
showAuxOnNavigation?: any;
silhouetteEffect?: any;
silhouetteEffectColor?: any;
silhouetteEffectExclusiveEnabled?: any;
skipSslVerify?: any;
smallFeatureCulling?: any;
smallFeaturePixelThreshold?: any;
snapshotContentSelection?: any;
soc?: any;
spacemouseMultiplier?: any;
ssaoEnabled?: any;
taaEnabled?: any;
topoGeometryColor?: any;
topoGeometrySecondaryColor?: any;
topoPointsEnabled?: any;
transparencyMode?: any;
turntableLowerVerticalLimit?: any;
turntableUpperVerticalLimit?: any;
turntableVerticalLimitsEnabled?: any;
uriMap?: any;
usageGroup?: any;
useDevicePixelRatio?: any;
vertexColorsEnabled?: any;
viewPerspective?: any;
webglPreserveDrawingbuffer?: any;
xrEnableDebugImages?: any;
xrFusionMode?: any;
xrImageCompressionQuality?: any;
xrImageResolutionProfile?: any;
xrModelTrackerQualityThreshold?: any;
xrModelTrackerSmoothingFactor?: any;
},
): void Applies the specified set of settings to the context.
Parameters
- config: {
aaSetting?: any;
additionalCookies?: any;
additionalRequestHeaders?: any;
additionalWSQueryParameters?: any;
applicationIdentifier?: any;
auxModeRecursiveSearch?: any;
auxModeUncolorFacesOnLeave?: any;
backgroundColor?: any;
batchedQueries?: any;
boosterURL?: any;
cappingEffectEdgeColor?: any;
cappingEffectEnabled?: any;
cappingEffectInnerColor?: any;
cappingGeometryColor?: any;
colorComparisonFirstColor?: any;
colorComparisonMatchingColor?: any;
colorComparisonSecondColor?: any;
colorizeEffect?: any;
contextMenuFunction?: any;
coordSys?: any;
defaultFieldOfView?: any;
defaultQueryLinkDepth?: any;
disableDefaultInteraction?: any;
disableSpecularHighlights?: any;
doubleClickAnimationVolumeScale?: any;
doubleClickTimeWindow?: any;
drawingArrowheadEnd?: any;
drawingArrowheadStart?: any;
drawingColor?: any;
drawingMode?: any;
drawingSize?: any;
dynamicAuxContrastEnabled?: any;
dynamicClippingDistance?: any;
dynamicClippingEnabled?: any;
dynamicCOREnabled?: any;
expandOnViewerSelection?: any;
faceHighlightColor?: any;
faceSelectionColor?: any;
fitViewFactor?: any;
flyNavigationSpeed?: any;
flyToOnDoubleClick?: any;
focusOnDoubleClick?: any;
frontPlaneAxis?: any;
frustumCulling?: any;
ghostedSceneOpacity?: any;
gizmoScalingFactor?: any;
gizmosEnabled?: any;
gpuMemoryReleaseFactor?: any;
hoverColor?: any;
hubURL?: any;
initialFit?: any;
initialFitDirection?: any;
initialStateActivation?: any;
initView?: any;
lightingEnvironment?: any;
lineHighlightColor?: any;
lineSelectionColor?: any;
loadRemoteConfigFile?: any;
logLevel?: any;
maxActiveSceneVolumeDiameter?: any;
maxConcurrentDownloads?: any;
maxDynamicClipDistance?: any;
maxGPUMemory?: any;
maxSRCCPUMemory?: any;
measurementAngularTolerance?: any;
measurementMaterialDensities?: any;
mouseInvertZoomingDirection?: any;
navigationMode?: any;
navigationSampling?: any;
navigationSpeedFactor?: any;
navigationSpeedThrottleFactor?: any;
notificationLogLevels?: any;
outlineColor?: any;
outlineColorOccluded?: any;
outlineInnerRadius?: any;
outlineOuterRadius?: any;
parentSelectEnabled?: any;
preferXHRWithCredentials?: any;
preSelectionColor?: any;
projectionType?: any;
renderAuxOnTop?: any;
renderMode?: any;
renderSetup?: any;
sceneOpacity?: any;
screenSpaceCoverageCalculationMethod?: any;
selectionColor?: any;
sessionDeviceTags?: any;
sessionForwardUrl?: any;
sessionInteractions?: any;
sessionMemberName?: any;
showAuxOnNavigation?: any;
silhouetteEffect?: any;
silhouetteEffectColor?: any;
silhouetteEffectExclusiveEnabled?: any;
skipSslVerify?: any;
smallFeatureCulling?: any;
smallFeaturePixelThreshold?: any;
snapshotContentSelection?: any;
soc?: any;
spacemouseMultiplier?: any;
ssaoEnabled?: any;
taaEnabled?: any;
topoGeometryColor?: any;
topoGeometrySecondaryColor?: any;
topoPointsEnabled?: any;
transparencyMode?: any;
turntableLowerVerticalLimit?: any;
turntableUpperVerticalLimit?: any;
turntableVerticalLimitsEnabled?: any;
uriMap?: any;
usageGroup?: any;
useDevicePixelRatio?: any;
vertexColorsEnabled?: any;
viewPerspective?: any;
webglPreserveDrawingbuffer?: any;
xrEnableDebugImages?: any;
xrFusionMode?: any;
xrImageCompressionQuality?: any;
xrImageResolutionProfile?: any;
xrModelTrackerQualityThreshold?: any;
xrModelTrackerSmoothingFactor?: any;
}Settings to import
Returns void
- config: {
import Session
- importSession(data: any, format?: "xscn"): Promise<any>
Imports a session from the given data string in the specified format.
Supported formats: xscn.
Parameters
- data: any
The content of the session file.
Optionalformat: "xscn"The format of the session file. Default: "xscn".
Returns Promise<any>
A Promise that resolves when the session is imported.
- data: any
importXRInit Template
- importXRInitTemplate(template: string): Promise<void>
ExperimentalImports an initialization template for model-based tracking.
In a model-based tracking scenario, initialization templates are captured during the tracking process. This initialization data is linked to previously visited viewpoints along the traveled camera path. Once the tracking is lost the templates are used to quickly reinitialize from similar viewpoints without the user having to align the line model with the real object.
Once the initialization template data is imported, it will persist until enterXRInitMode with XRInitOptions.resetInitTemplate set to
trueis called.This method is only available if the XR system has the XRCapability.SUPPORTS_MODEL_TRACKING capability.
The input data can be aquired via the exportXRInitTemplate method.
Parameters
- template: string
The base64 encoded initialization template data
Returns Promise<void>
Returns a Promise which resolved when the operation was successful or rejects in an error case
- template: string
invert Enabled States
- invertEnabledStates(): void
Inverts all enabled states.
Triggers a NodeChangedEvent.
Returns void
invert Selection
- invertSelection(silent?: boolean): Promise<ChangeSelectionResult>
Inverts the current selection.
Selected nodes will be unselected, and then all previously unselected leaf nodes will be selected. When all child nodes of a parent are selected, the selection moves up the hierarchy as usual.
For example, consider the following hierarchy:
Node 0 |- Node 1 |- Node 1.1 |- Node 1.2 |- Node 2 |- Node 2.1 |- Node 2.2If the initial selection is only
Node 2.1, callinginvertSelectionwill result in the selection includingNode 2.2,Node 1.1,Node 1.2, and therefore alsoNode 1.Node 0andNode 2will not become selected, even though they were not selected initially. If getSelectedNodes is called at this point, it will return[Node 1, Node 2.2].Triggers a SelectionChangedEvent if silent is set to false.
Parameters
Optionalsilent: booleanIf set to true, no event will be emitted. Default: false
Returns Promise<ChangeSelectionResult>
The result of the selection change.
is Color Comparison Active
is Node Deletable
is Node Part Of Enabled Layers
- isNodePartOfEnabledLayers(nodeID: number): Promise<boolean>
Returns true if the specified node ID is part of an enabled layer.
Parameters
- nodeID: number
The node ID which should be checked.
Returns Promise<boolean>
Returns a promise that resolves to true if the node is part of an enabled layer, false otherwise.
- nodeID: number
is Node Part Of Enabled Variant
is Node Type
is Offline Storage Available
is Selected
is Topology Selected
- isTopologySelected(handle: TopologyHandle): boolean
Returns true if the specified topological entity is selected, false otherwise.
Parameters
- handle: TopologyHandle
The topology handle.
Returns boolean
True if the specified topological entity is selected, false otherwise.
- handle: TopologyHandle
map Internal To Original Topology Handles
- mapInternalToOriginalTopologyHandles(
handles: TopologyHandle[],
): Promise<OriginalTopologyHandle[]> Maps the given webvis topology handles to the corresponding original topology handles.
Parameters
- handles: TopologyHandle[]
The webvis topology handles to be mapped.
Returns Promise<OriginalTopologyHandle[]>
The corresponding original topology handles.
- handles: TopologyHandle[]
map Original To Internal Topology Handles
- mapOriginalToInternalTopologyHandles(
nodeID: number,
handles: OriginalTopologyHandle[],
): Promise<TopologyHandle[]> Maps the given original topology handles to the corresponding webvis topology handles.
Parameters
- nodeID: number
The node which represents the part that contains the topological entities.
- handles: OriginalTopologyHandle[]
The original topology handles to be mapped.
Returns Promise<TopologyHandle[]>
The corresponding webvis topology handles.
- nodeID: number
measure Between
- measureBetween(
target0: MeasurementTarget,
target1: MeasurementTarget,
): Promise<BetweenMeasurementResult> Measures the distance and, if applicable, the angle between two measurement targets. The result also includes the corresponding closest points on the targets.
If the targets intersect, the result will contain a representation of the intersection. Note that the intersection is not available for measurements involving target classes TOPOLOGY or NODE, except for the cases plane-face and face-face.
Parameters
- target0: MeasurementTarget
The first measurement target.
- target1: MeasurementTarget
The second measurement target.
Returns Promise<BetweenMeasurementResult>
The result of the measurement.
- target0: MeasurementTarget
measure Normal
- measureNormal(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<NormalMeasurementResult> Measures the normal of a face at a given point. The face is specified by a measurement target that points to a corresponding TopologyHandle. If the point does not lie on the face, the closest point on the face is used.
Parameters
- topology: { class: TOPOLOGY; value: TopologyHandle }
The measurement target representing the face via a TopologyHandle.
- point: { class: POINT; value: [number, number, number] }
The point at which the normal should be measured.
Returns Promise<NormalMeasurementResult>
The result of the normal measurement.
- topology: { class: TOPOLOGY; value: TopologyHandle }
measure Points By Distance
- measurePointsByDistance(
searchCurve: {
class: CURVE;
value: [[number, number, number], [number, number, number]][];
},
distanceCurves: { class: TOPOLOGY; value: TopologyHandle }[],
distance: number,
): Promise<DistanceConstraintMatch[]> ExperimentalAttention: This function is experimental and may be changed or removed in future versions.
Returns points from a search space that have the specified distance to a set of measurement targets. The search space is defined by a measurement target. Currently only supports a search space that is defined by a curve and edges as distance targets.
Parameters
- searchCurve: { class: CURVE; value: [[number, number, number], [number, number, number]][] }
The curve on which to search.
- distanceCurves: { class: TOPOLOGY; value: TopologyHandle }[]
The targets from which the distance is measured.
- distance: number
The distance.
Returns Promise<DistanceConstraintMatch[]>
An array of points that match the distance constraint.
- searchCurve: { class: CURVE; value: [[number, number, number], [number, number, number]][] }
measure Tangent
- measureTangent(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<TangentMeasurementResult> Measures the tangent of an edge at a given point. The edge is specified by a measurement target that points to a corresponding TopologyHandle. If the point does not lie on the edge, the closest point on the edge is used.
Parameters
- topology: { class: TOPOLOGY; value: TopologyHandle }
The measurement target representing the edge via a TopologyHandle.
- point: { class: POINT; value: [number, number, number] }
The point at which the tangent should be measured.
Returns Promise<TangentMeasurementResult>
The result of the tangent measurement.
- topology: { class: TOPOLOGY; value: TopologyHandle }
measure Thickness
- measureThickness(
topology: { class: TOPOLOGY; value: TopologyHandle },
point: { class: POINT; value: [number, number, number] },
): Promise<ThicknessMeasurementResult> Measures the thickness of a shape at a given point. The shape is specified by a measurement target that points to a corresponding TopologyHandle. If the point does not lie on the shape, the closest point on the shape is used. The thickness is measured along the line defined by the normal of the shape at the given point.
Parameters
- topology: { class: TOPOLOGY; value: TopologyHandle }
The measurement target representing the shape via a TopologyHandle.
- point: { class: POINT; value: [number, number, number] }
The point at which the thickness should be measured.
Returns Promise<ThicknessMeasurementResult>
The result of the thickness measurement.
- topology: { class: TOPOLOGY; value: TopologyHandle }
open Space
- openSpace(spaceHandle?: string): Promise<void>
ExperimentalOpens a 3D space.
If a space handle is specified and it exists, switches to the 3D space referenced by the handle. If a space handle is specified and it does not exist, throws an error. If no space handle is specified, creates a new 3D space and clears the content.
Parameters
OptionalspaceHandle: stringThe handle of the space to open. If undefined, a new space is created.
Returns Promise<void>
A promise that resolves when the space has been opened.
See
requestSpaceHandle to get a space handle.
perform Explosion
process Interaction Input
- processInteractionInput(interactionData: InteractionData): void
Triggers an interaction on the current active interaction mode.
Parameters
- interactionData: InteractionData
Definition of the triggered Interaction.
Returns void
- interactionData: InteractionData
promote Session Member
query
- query(query: string | Query, nodeID?: number): Promise<QueryResult>
Executes the query on the specified subtree
Parameters
- query: string | Query
OptionalnodeID: number
Returns Promise<QueryResult>
read Setting
register Custom Property
- registerCustomProperty(
name: string,
defaultValue: any,
recursive?: boolean,
): void Registers a new custom node property.
Custom properties allow developers to hook into the node hierarchy with custom data. This enables the creation of custom behaviors and interactions that can benefit from the NODE_* events, like the NodeChangedEvent, emitted by the InstanceGraphAPI.
Triggers a CustomPropertyRegisteredEvent
Parameters
- name: string
The name of the new property.
- defaultValue: any
Specifies the default value.
Optionalrecursive: booleanDefines whether the property is recursive. Default: false
Returns void
- name: string
register Frame Listener
- registerFrameListener(listener: FrameListener): void
Registers a frame listener which is executed on every tick of the internal update loop of the webvis context.
Parameters
- listener: FrameListener
The listener to register.
Returns void
- listener: FrameListener
register Listener
- registerListener<T extends WebVisEvent = WebVisEvent>(
eventTypes: EventType[],
listener: IEventListener<T>,
nodeID?: number,
observeSubTree?: boolean,
): number Registers a listener for a set of EventTypes. If the given event types array is empty, the listener will react to all event types. The listener must implement the IEventListener interface. It will be called with events that extend the WebVisEvent base class. An event's
typeproperty specifies its EventType and determines its structure.Scoping listeners in the node hierarchy
Several EventTypes are linked to a specific node in the hierarchy. These include all that have a
NODE_orTOPOLOGY_prefix, as well as several animation-related event types.When registering a listener for these event types, a listening scope must be specified in the node hierarchy. This is done by setting the optional parameters
nodeIDandobserveSubTree. TheobserveSubTreeflag determines whether the listener is scoped to only the specified node or the entire subtree under the node.By default, listeners are scoped to the global root node and
observeSubTreeisfalse, such that listeners do not receive any events linked to added nodes. To listen to events from all nodes, setnodeIDto0andobserveSubTreetotrue.There are a few things to note when scoping listeners:
- NODE_ADDED events are linked to the parent node of the added node.
- NODE_CHANGED events behave differently depending on the node property that has changed. When the node property is recursive, the event is passed to all listeners in the subtree. When the change to the node property affects the node's ancestors, events will also be triggered for the ancestors.
Type Parameters
- T extends WebVisEvent = WebVisEvent
The type of event that the listener listens to. This can also be a union of multiple event types.
Parameters
- eventTypes: EventType[]
The types of events that the listener listens to. If an empty array is passed, the listener will listen to all event types.
- listener: IEventListener<T>
The event listener.
OptionalnodeID: numberThe ID of the node to which the listener should be scoped. Default:
0OptionalobserveSubTree: booleanIf set to true, the listener will be scoped to the whole subtree under the specified node. Default:
false
Returns number
- The ID of the event listener.
remove
- remove(nodeID?: number | number[], safe?: boolean): Promise<RemoveState>
Removes the node for the given node ID from the scene and all related snapshots. If no node ID is supplied, all nodes are deleted.
Triggers a NodeRemovedEvent.
Parameters
OptionalnodeID: number | number[]The ID of the node that should be removed or undefined to remove all nodes.
Optionalsafe: booleanPerforms a safe remove which interrupt the removal process if the node is part of one or more snapshots. Default: false.
Returns Promise<RemoveState>
A promise that resolves with the RemoveState once the operation is complete.
remove Animation Frames
remove Annotation
- removeAnnotation(annotationId: number, safe?: boolean): RemoveState
Removes the Annotation from the scene and all related Snapshots and triggers an AnnotationRemovedEvent.
Parameters
- annotationId: number
The ID of the Annotation.
Optionalsafe: booleanPerforms a safe remove which interrupt the removal process if the Annotation is part of one or more Snapshots.
Returns RemoveState
- annotationId: number
remove Attachment
- removeAttachment(attachmentID: number, safe?: boolean): RemoveState
Removes the Attachment from the scene and all related snapshots.
Triggers an AttachmentRemovedEvent.
Parameters
- attachmentID: number
Specifies the attachment object.
Optionalsafe: booleanPerforms a safe remove which interrupt the removal process if the attachment is part of one or more snapshots. If no safe remove, a snapshot could link to missing data. Default: false.
Returns RemoveState
The state of the removal process.
- attachmentID: number
remove Capping
- removeCapping(clipPlaneId: number): Promise<void>
ExperimentalCompletely removes the generated capping geometry for a clip plane.
This method permanently deletes any capping geometry that was previously created for the specified clip plane. Unlike disableCapping, which merely hides the geometry, this method removes it entirely from the scene.
If you later want to see capping geometry again, you'll need to call createCapping to regenerate it.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Create a clip plane and generate capping geometry const clipPlaneId = context.createClipPlane({ normal: [0, 0, 1], position: [0, 0, 0] }); await context.createCapping(clipPlaneId); // Later, permanently remove the capping geometry await context.removeCapping(clipPlaneId);Parameters
- clipPlaneId: number
The ID of the clip plane whose capping geometry should be removed
Returns Promise<void>
Promise that resolves when the capping geometry has been removed
- clipPlaneId: number
remove Clipping Room
- removeClippingRoom(safe?: boolean): RemoveState
Removes the clip room from the scene.
This method completely removes the clip room and disables its clipping effect. Only one clip room can exist at a time, so there's no need to specify an ID.
When the
safeparameter is set to true and the clip room is referenced by snapshots, the removal will be prevented and the method will returnREFERENCED_BY_SNAPSHOT. By default (safeis false), the clip room will be forcibly removed even if it's referenced by snapshots.Triggers a ClippingRoomRemovedEvent when the clip room is successfully removed.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Safe remove - will fail if referenced by snapshots const removeResult = context.removeClippingRoom(true); if (removeResult === webvis.RemoveState.REFERENCED_BY_SNAPSHOT) { console.log("Cannot remove clip room - it's referenced by a snapshot"); } else if (removeResult === webvis.RemoveState.OK) { console.log("Clip room successfully removed"); } // Force remove even if referenced by snapshots (default behavior) context.removeClippingRoom();Parameters
Optionalsafe: booleanWhether to prevent removal if the clip room is referenced by snapshots. Default: false
Returns RemoveState
A RemoveState value indicating the result of the removal operation
remove Clip Plane
- removeClipPlane(clipPlaneId: number, safe?: boolean): RemoveState
Removes a clip plane from the scene.
This method completely removes the specified clip plane from the scene. Any capping geometry associated with the clip plane will also be removed.
When the
safeparameter is set to true and the clip plane is referenced by snapshots, the removal will be prevented and the method will returnREFERENCED_BY_SNAPSHOT. By default (safeis false), clip planes will be forcibly removed even if they're referenced by snapshots.Triggers a ClipPlaneRemovedEvent when the clip plane is successfully removed.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Safe remove - will fail if referenced by snapshots const removeResult = context.removeClipPlane(clipPlaneId, true); if (removeResult === webvis.RemoveState.REFERENCED_BY_SNAPSHOT) { console.log("Cannot remove clip plane - it's referenced by a snapshot"); } else if (removeResult === webvis.RemoveState.OK) { console.log("Clip plane successfully removed"); } // Force remove even if referenced by snapshots (default behavior) context.removeClipPlane(clipPlaneId);Parameters
- clipPlaneId: number
The ID of the clip plane to remove
Optionalsafe: booleanWhether to prevent removal if the clip plane is referenced by snapshots. Default: false
Returns RemoveState
A RemoveState value indicating the result of the removal operation
- clipPlaneId: number
remove Collection
remove Drawing
- removeDrawing(drawingId: number, safe?: boolean): RemoveState
Removes a Drawing with the specified id. If a Drawing is part of a Snapshot the removal will fail with the State RemoveState.REFERENCED_BY_SNAPSHOT
Parameters
- drawingId: number
The id of the to be removed Drawing.
Optionalsafe: booleanPerforms a safe remove which interrupt the removal process if the Drawing is part of one or more Snapshots.
Returns RemoveState
- drawingId: number
remove Drawing Plane
- removeDrawingPlane(drawingPlaneId: number, safe?: boolean): RemoveState
ExperimentalRemoves a DrawingPlane with the specified ID. If a DrawingPlane is part of a Snapshot the removal will fail with the State RemoveState.REFERENCED_BY_SNAPSHOT.
Parameters
- drawingPlaneId: number
The ID of the Drawing you want to remove.
Optionalsafe: booleanPerforms a safe remove which interrupt the removal process if the Drawing is part of one or more Snapshots.
Returns RemoveState
- drawingPlaneId: number
remove From Collection
- removeFromCollection(
collectionID: number,
nodeID: number,
recursive?: boolean,
): void Parameters
- collectionID: number
Specifies from which collection the node should be removed
- nodeID: number
Specifies which node should be removed from the collection
Optionalrecursive: booleanSpecifies whether the children of the node should be removed from the collection too
Returns void
- collectionID: number
remove From Selection
- removeFromSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult> Removes the specified nodes from the current selection.
Triggers a SelectionChangedEvent if silent is set to false.
Parameters
- nodeID: number | number[]
The ID or array of IDs of the nodes to remove from the selection.
Optionalsilent: booleanIf set to true, no event will be emitted. Default: false
Returns Promise<ChangeSelectionResult>
The result of the selection change.
- nodeID: number | number[]
remove Material
- removeMaterial(materialId: number, safe?: boolean): RemoveState
ExperimentalExperimental. May be changed in the future without notice.
Removes the material from the scene and all related snapshots and triggers a MaterialRemovedEvent.
Parameters
- materialId: number
The ID of the material.
Optionalsafe: booleanPerforms a safe remove which interrupts the removal process if the material is part of one or more Snapshots. Default: false
Returns RemoveState
The resulting state of the removal process.
- materialId: number
remove Measurement
- removeMeasurement(measurementID: number, safe?: boolean): RemoveState
Removes the measurement entity with the specified ID from the webvis context and all related snapshots.
Triggers a MeasurementRemovedEvent when the measurement entity has been removed.
Parameters
- measurementID: number
The ID of the measurement entity that should be removed.
Optionalsafe: booleanPerforms a safe remove which interrupts the removal process if the measurement is part of one or more snapshots. Default: false
Returns RemoveState
The resulting state of the removal process.
- measurementID: number
remove Session Member
remove Snapshot
- removeSnapshot(snapshotID: number): void
Deletes the snapshot for the given snapshot ID.
Triggers a SnapshotRemovedEvent.
Parameters
- snapshotID: number
The ID of the snapshot to delete.
Returns void
- snapshotID: number
remove Topology From Selection
- removeTopologyFromSelection(
handle: TopologyHandle | TopologyHandle[],
): Promise<void> Removes one or more topological entities from the current selection.
Parameters
- handle: TopologyHandle | TopologyHandle[]
The topological entity or array of topological entities which should be removed from the current selection.
Returns Promise<void>
A promise which resolves when the operation is completed.
- handle: TopologyHandle | TopologyHandle[]
remove Viewer
request Active Scene Volume
request Annotation Data
- requestAnnotationData(annotationId: number): Promise<AnnotationProperties>
Returns the AnnotationData for the specified Annotation ID.
Parameters
- annotationId: number
The ID of the Annotation you want to request the data for.
Returns Promise<AnnotationProperties>
The requested Annotation data.
- annotationId: number
request Aux Root Node Ids
- requestAuxRootNodeIds(scopeNodeId?: number): Promise<number[]>
Returns a list of all existing AUX root node IDs below the specified subtree.
Parameters
OptionalscopeNodeId: numberSpecifies the top one node ID of the subtree to be searched. Default: 0
Returns Promise<number[]>
A list of AUX root node IDs.
request Box Descriptor
- requestBoxDescriptor(
nodeIds: number[],
): Promise<{ descriptor: TopologyBoxDescriptor; type: BOX }> Returns a box descriptor for the combined bounding box of the specified nodes.
Parameters
- nodeIds: number[]
The nodes for which the box descriptor should be created.
Returns Promise<{ descriptor: TopologyBoxDescriptor; type: BOX }>
The box descriptor for the combined bounding box of the specified nodes.
- nodeIds: number[]
request Clip Plane Data
- requestClipPlaneData(clipPlaneId: number): Promise<ClipPlaneProperties>
Retrieves the properties of a specific clip plane.
This method asynchronously fetches the current configuration of a clip plane, including its position, orientation, visibility settings, and any node exclusions. The data is returned as a ClipPlaneProperties object that can be inspected or used to create a similar clip plane.
Example usage:
// Get the webvis context const context = webvis.getContext(); const properties = await context.requestClipPlaneData(clipPlaneId); console.log(`Clip plane position: [${properties.position}]`); console.log(`Clip plane normal: [${properties.normal}]`); // Use the properties to create a similar clip plane const newClipPlaneId = context.createClipPlane({ ...properties, name: properties.name + " (copy)" });Parameters
- clipPlaneId: number
The ID of the clip plane to get data for
Returns Promise<ClipPlaneProperties>
Promise resolving to the clip plane's properties
- clipPlaneId: number
request Clip Room Data
- requestClipRoomData(): Promise<ClipRoomProperties>
Retrieves the properties of the current clip room.
This method asynchronously fetches the current configuration of the clip room, including its size, position, transformation matrix, and visibility settings. The data is returned as a ClipRoomProperties object that can be inspected or used to create a similar clip room after the current one is removed.
Example usage:
// Get the webvis context const context = webvis.getContext(); // Get the clip room properties and display information const properties = await context.requestClipRoomData(); console.log(`Clip room size: [${properties.size}]`); console.log(`Clip room transform: [${properties.transform}]`); // Use the properties to create a similar clip room after removing the current one context.removeClippingRoom(); context.createClippingRoom({ ...properties, size: [properties.size[0] * 1.5, properties.size[1] * 1.5, properties.size[2] * 1.5], name: properties.name ? properties.name + " (enlarged)" : "Enlarged Room" });Returns Promise<ClipRoomProperties>
Promise resolving to the clip room's properties
request Drawing Data
- requestDrawingData(drawingId: number): Promise<DrawingData>
Returns the DrawingData for the specified Drawing id.
Parameters
- drawingId: number
The id of the Drawing from which the data is requested.
Returns Promise<DrawingData>
The requested Drawing data.
- drawingId: number
request Full Scene Volume
- requestFullSceneVolume(): Promise<BoxVolume>
Returns the full volume of the current scene. It is the smallest volume that contains all nodes of the scene, regardless of their Property.ENABLED state.
Returns Promise<BoxVolume>
request Hub Version
request L3DInformation
request Measurement Data
- requestMeasurementData(measurementID: number): Promise<MeasurementProperties>
Returns the properties of the measurement entity with the specified ID. These include the result of the measurement, as well as its type and targets.
Parameters
- measurementID: number
The ID of the measurement entity.
Returns Promise<MeasurementProperties>
The properties of the measurement entity.
- measurementID: number
request Member Actions
- requestMemberActions(memberId: number): Promise<MemberAction[]>
ExperimentalRequests the actions available on a member.
Parameters
- memberId: number
The ID of the member to request actions for.
Returns Promise<MemberAction[]>
A promise that resolves to an array of member actions.
- memberId: number
request Member Properties
- requestMemberProperties(id: number): Promise<MemberProperties>
ExperimentalRequests the properties of a member.
Parameters
- id: number
The ID of the member to request the properties for.
Returns Promise<MemberProperties>
A promise that resolves to the member properties, or undefined if the member does not exist.
- id: number
request Neighboring Edges
- requestNeighboringEdges(handle: TopologyHandle): Promise<TopologyHandle[]>
Returns the neighboring edges of the specified topological entity.
Parameters
- handle: TopologyHandle
The topological entity for which the neighboring edges should be requested.
Returns Promise<TopologyHandle[]>
The neighboring edges of the specified topological entity.
- handle: TopologyHandle
request Neighboring Faces
- requestNeighboringFaces(handle: TopologyHandle): Promise<TopologyHandle[]>
Returns the neighboring faces of the specified topological entity.
Parameters
- handle: TopologyHandle
The topological entity for which the neighboring faces should be requested.
Returns Promise<TopologyHandle[]>
The neighboring faces of the specified topological entity.
- handle: TopologyHandle
request Node Ids By Box Volume
- requestNodeIdsByBoxVolume(
boxVolume: BoxVolume,
includeOverlappingNodes?: boolean,
includeDisabledNodes?: boolean,
forceExpand?: boolean,
scopeNodeId?: number,
): Promise<number[]> Returns a list of all node IDs that are included in or overlapped by the specified bounding volume.
Parameters
- boxVolume: BoxVolume
Specifies the bounding volume.
OptionalincludeOverlappingNodes: booleanSpecifies whether the result should include nodes which overlap the specified bounding volume as well. Default: false
OptionalincludeDisabledNodes: booleanSpecifies whether the result should include nodes which are disabled as well. Default: false
OptionalforceExpand: booleanIf set to true, L3D instances may be expanded to find their leaf nodes. Default: false
OptionalscopeNodeId: numberSpecifies the top one node ID of the subtree to be searched. Default: 0
Returns Promise<number[]>
List of all node IDs which are included or overlapped by the specified bounding volume.
- boxVolume: BoxVolume
request Node Path Handle Map
- requestNodePathHandleMap(
paths: string[],
scope?: number,
): Promise<NodePathHandleMap> requestNodePathHandleMap Returns an object mapping from input paths to the respective handles.
Parameters
- paths: string[]
{Array<string | NodePathHandle>} The array of node path strings or handles.
Optionalscope: number{number} [scope=0] nodeID specifying the scope as starting point for the paths
Returns Promise<NodePathHandleMap>
The resulting object mapping paths to handles
- paths: string[]
request Node Path Strings
- requestNodePathStrings(
handles: NodePathHandle[],
scope?: number,
typePriorities?: NodePathFragmentType[],
): Promise<string[]> requestNodePathStrings Returns string representations for the respective node path handles.
Parameters
- handles: NodePathHandle[]
{Array
} Optionalscope: number{number} nodeID specifying the scope as starting point for the path resolution
OptionaltypePriorities: NodePathFragmentType[]{Array
} Array of priorities to control the fragments for the path string assembly.
Returns Promise<string[]>
String representation of the node path for the respective scope.
- handles: NodePathHandle[]
request Root Node Ids
- requestRootNodeIds(scopeNodeId?: number, recursive?: boolean): Promise<number[]>
Returns a list of all existing root node IDs below the specified subtree.
Parameters
OptionalscopeNodeId: numberSpecifies the top one node ID of the subtree to be searched. Default: 0
Optionalrecursive: booleanSpecifies if the subtree is traversed recursively. Default: false
Returns Promise<number[]>
A list of root node IDs.
request Service States
- requestServiceStates(): Promise<Map<ServiceType, ServiceState>>
Requests all available services of the backend and their current state.
Returns Promise<Map<ServiceType, ServiceState>>
Returns a Promise which contains a map of all available services and their states.
request Snapshot Data
- requestSnapshotData(snapshotID: number): Promise<SnapshotProperties>
Requests the data of the specified snapshot.
Parameters
- snapshotID: number
The ID of the snapshot to request data for.
Returns Promise<SnapshotProperties>
The data of the specified snapshot.
- snapshotID: number
request Space Handle
- requestSpaceHandle(role?: MemberRole): Promise<string>
ExperimentalRequests a shareable space handle for the current 3D space.
A space handle is a URL that can be used to open the current 3D space. It has the following format:
<HUB_URL>/api/space/v2/<SPACE_ID>if no role is specified.<HUB_URL>/api/space/v2/<SPACE_ID>?token=<TOKEN>if a role is specified. where<HUB_URL>is the URL of the hub,<SPACE_ID>is the ID of the current space, and<TOKEN>is the access token for the specified role.
Parameters
Optionalrole: MemberRoleThe role to assign when the space is opened via the handle. If undefined, the MemberRole.VIEWER role will be assigned when opening the space via the handle.
Returns Promise<string>
A promise that resolves to the space handle.
request Supported Content Types
- requestSupportedContentTypes(): Promise<ContentType[]>
Request a list of (model) data formats which are supported by the connected instance3Dhub-backend. If requested before the connection to the Hub is established, it will return the local list of content types.
Returns Promise<ContentType[]>
Returns a Promise which contains the list of all supported data formats.
request Supported Render Setups
- requestSupportedRenderSetups(): Promise<{ name: string; value: string }[]>
Request all supported render setups if one or more are available. The render setup is a key value pair where the key is the name of the render setup and the value could be used as an input value for the ViewerSettingStrings.RENDER_SETUP setting.
Returns Promise<{ name: string; value: string }[]>
Returns a Promise which contains the list of supported render setups.
request Topology Descriptor
- requestTopologyDescriptor(handle: TopologyHandle): Promise<TopologyDescriptor>
Returns a detailed descriptor for the specified topological entity. The descriptor contains the subtype and an object with a series of known attributes of the topological entity. For example, a descriptor for a circle includes the center and radius of the circle.
Parameters
- handle: TopologyHandle
The topological entity.
Returns Promise<TopologyDescriptor>
A detailed descriptor for the specified topological entity.
- handle: TopologyHandle
request Variants
- requestVariants(nodeId: number): Promise<VariantProperties[]>
Parameters
- nodeId: number
The ID of the Node.
Returns Promise<VariantProperties[]>
The Variant(s) for a given nodeID.
- nodeId: number
requestXRDevice Screenshot
requestXRScanshot
- requestXRScanshot(): Promise<XRScanshot>
ExperimentalRequests a scanshot of the current view in the XR environment.
Returns Promise<XRScanshot>
The scanshot data.
reset Interaction Mode
reset Properties
- resetProperties(
nodeID: number,
properties: string[],
recursive?: boolean,
): Promise<void> Resets the value of the specified properties of the given node.
Triggers a NodePropertiesResetEvent. If the property has changed, this will additionally trigger a NodeChangedEvent.
Parameters
- nodeID: number
The ID of the node whose Property should be reset.
- properties: string[]
List of properties which should be reset.
Optionalrecursive: booleanIf set to true, the properties are reset recursively. Default: false
Returns Promise<void>
- nodeID: number
reset Property
- resetProperty(
nodeID: number,
property: string,
recursive?: boolean,
): Promise<void> Resets the value of the specified property of the given node.
Triggers a NodePropertiesResetEvent. If the property has changed, this will additionally trigger a NodeChangedEvent.
Parameters
- nodeID: number
The ID of the node whose Property should be reset.
- property: string
The Property that should be reset.
Optionalrecursive: booleanIf set to true, the properties are reset recursively. Default: false
Returns Promise<void>
- nodeID: number
reset Setting
- resetSetting(setting: ViewerSettingStrings | SettingStrings): void
Resets the value of a setting to the installation default.
Parameters
- setting: ViewerSettingStrings | SettingStrings
The name of the setting that should be reset.
Returns void
- setting: ViewerSettingStrings | SettingStrings
reset User Settings
restore Session
restore Snapshot
- restoreSnapshot(
snapshotID: number,
options?: SnapshotRestoreOptions,
): Promise<void> Restores the snapshot for the given snapshot ID.
Triggers a SnapshotRestoreStartedEvent and, if successful, a SnapshotRestoredEvent.
Parameters
- snapshotID: number
The ID of the snapshot to restore.
Optionaloptions: SnapshotRestoreOptionsOptions to control the subset of snapshot data to restore.
Returns Promise<void>
A Promise that resolves when the snapshot is restored.
- snapshotID: number
search By Volume
- searchByVolume(
selectionBox: BoxVolume,
includeOverlappingNodes: boolean,
rootNodeID?: number,
): Promise<number> Parameters
- selectionBox: BoxVolume
3-dimensional search volume.
- includeOverlappingNodes: boolean
Specifies whether the search result contains only those nodes which lie entirely in the search volume or if overlapping nodes are also included.
OptionalrootNodeID: numberRestricts the search to a subtree of a node with the given id.
Returns Promise<number>
A the id of the created collection of nodes that are fitting the given search criteria.
Deprecated
searchByVolume is deprecated and will be removed in future versions. Please use InstanceGraphAPI.requestNodeIdsByBoxVolume instead.
Finds nodes within the given BoxVolume (created using the createBoxVolume() function). If includeOverlappingNodes is false, only nodes fully contained by the box volume are returned. The rootNodeID specifies the node from which the subtree is searched.
- selectionBox: BoxVolume
seekXRPlayback
- seekXRPlayback(frameIndex: number): Promise<void>
ExperimentalJump to the frame with the specified index in the playback sequence. To get the total amount of frames in the sequence, see XRPlaybackProperties and getXRPlaybackProperties method.
Triggers a XRPlaybackStateChangedEvent.
Parameters
- frameIndex: number
The index of the frame to jump to
Returns Promise<void>
Returns a Promise which reports wether the operation was successful or not
- frameIndex: number
select Collection
- selectCollection(
collectionID: number,
silent?: boolean,
): Promise<ChangeSelectionResult> Parameters
- collectionID: number
The ID of the collection.
Optionalsilent: booleanIf set to true, no event will be emitted. Default: false
Returns Promise<ChangeSelectionResult>
Deprecated
selectCollection is deprecated, please use setSelection instead.
Replaces the current selection with the nodes from the given collection.
Triggers a SelectionChangedEvent if silent is set to false.
- collectionID: number
set Attachment Data
- setAttachmentData(attachmentID: number, data: Serializable): void
Sets the attachment data.
Triggers an AttachmentDataChangedEvent.
Parameters
- attachmentID: number
Specifies the attachment object.
- data: Serializable
The new attachment data.
Returns void
- attachmentID: number
set Attachment DataURI
set Interaction Mode
- setInteractionMode(
mode: string | string[],
keepColorCompareActive?: boolean,
): void Set the current interaction mode.
Parameters
- mode: string | string[]
Specifies the interaction mode you want set.
OptionalkeepColorCompareActive: booleanSpecifies if the color comparison mode should stay active. Default: false
Returns void
- mode: string | string[]
- setInteractionMode(
mode: InteractionMode,
keepColorCompareActive?: boolean,
): void Set the current interaction mode.
Parameters
- mode: InteractionMode
Specifies the interaction mode you want set.
OptionalkeepColorCompareActive: booleanSpecifies if the color comparison mode should stay active. Default: false
Returns void
- mode: InteractionMode
set Layer Filter Enabled
- setLayerFilterEnabled(
name: string,
enabled: boolean,
): SetLayerFilterEnabledResult Sets the enabled state of a single layer filter.
Triggers a LayerFilterChangedEvent.
Parameters
- name: string
The name of the layer filter
- enabled: boolean
The new enabled state.
Returns SetLayerFilterEnabledResult
The result of the operation.
- name: string
set Member Name
set Member Profile Entry
- setMemberProfileEntry(key: string, value: Serializable): Promise<void>
ExperimentalSets a profile entry of the local member.
Parameters
- key: string
The key of the profile entry to set.
- value: Serializable
The value to set for the profile entry.
Returns Promise<void>
A promise that resolves when the profile entry has been set.
- key: string
set Parent
- setParent(nodeID: number, newParentID: number): void
Sets a new parent for a given node ID.
Triggers a NodeChangedEvent.
Parameters
- nodeID: number
The ID of the node whose parent should be set.
- newParentID: number
The ID of the new parent node.
Returns void
- nodeID: number
set Property
- setProperty<T extends string>(
nodeID: number | number[],
property: T,
value: PropertyType<T>,
silent?: boolean,
): Promise<void> Sets the specified property to the given value on the node(s) with the specified ID(s).
Triggers a NodeChangedEvent. Depending on the property it can trigger additional events, e.g. ActiveSceneVolumeChangedEvent.
Type Parameters
Parameters
- nodeID: number | number[]
The ID(s) of the node(s) whose property has to be set.
- property: T
The name of the Property that has to be set.
- value: PropertyType<T>
The new value of the specified property.
Optionalsilent: booleanThe silent flag indicates that no NODE_CHANGED event is fired. Default: false
Returns Promise<void>
- nodeID: number | number[]
set Selection
- setSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult> Replaces the current selection with the specified nodes.
Triggers a SelectionChangedEvent if silent is set to false.
Parameters
- nodeID: number | number[]
The ID or array of IDs of the nodes to select.
Optionalsilent: booleanIf set to true, no event will be emitted. Default: false
Returns Promise<ChangeSelectionResult>
The result of the selection change.
- nodeID: number | number[]
set Topology Property
- setTopologyProperty<T extends keyof TopologyPropertyTypeMap>(
handle: TopologyHandle | TopologyHandle[],
property: T,
value: TopologyPropertyTypeMap[T],
): Promise<PromiseSettledResult<void>[]> Sets a property of one or more topological entities.
Type Parameters
- T extends keyof TopologyPropertyTypeMap
The property which should be set.
Parameters
- handle: TopologyHandle | TopologyHandle[]
The topological entity or array of topological entities which should be modified.
- property: T
The property which should be set.
- value: TopologyPropertyTypeMap[T]
The new value of the property.
Returns Promise<PromiseSettledResult<void>[]>
A promise which resolves when the operation is completed.
- T extends keyof TopologyPropertyTypeMap
set Topology Selection
- setTopologySelection(handle: TopologyHandle | TopologyHandle[]): Promise<void>
Sets the current selection to the specified topological entities.
Parameters
- handle: TopologyHandle | TopologyHandle[]
One or more topological entities that should be selected.
Returns Promise<void>
A promise which resolves when the operation is completed.
- handle: TopologyHandle | TopologyHandle[]
set Variant Enabled
setXRPlayback Boomerang
- setXRPlaybackBoomerang(boomerang: boolean): Promise<void>
ExperimentalSpecify whether the playback should "boomerang" (play forward and backward in a loop). This is useful for creating a seamless transition at the end of a sequence in terms of pose updates.
Parameters
- boomerang: boolean
Whether the playback should boomerang or not
Returns Promise<void>
Returns a Promise which reports whether the operation was successful or not
- boomerang: boolean
setXRPlayback Frame Range
- setXRPlaybackFrameRange(startFrame: number, endFrame: number): Promise<number>
ExperimentalSets the frame range to play back. The total amount of frames in a sequence can be found in the XRPlaybackProperties.
Triggers a XRPlaybackStateChangedEvent.
Parameters
- startFrame: number
The index of the first frame to play back
- endFrame: number
The index of the last frame to play back
Returns Promise<number>
Returns a Promise which resolves with the new amount of frames in the playback if successful and rejects otherwise
- startFrame: number
setXRPlayback Source
- setXRPlaybackSource(url: string): Promise<number>
ExperimentalSet the URL pointing to the
manifest.jsonfile of the frame sequence to be played back.Triggers a XRPlaybackStateChangedEvent.
Parameters
- url: string
The URL of the frame sequence
Returns Promise<number>
Returns a Promise which resolves with the amount of frames in the playback if successful and rejects otherwise
- url: string
setXRPlayback Speed
- setXRPlaybackSpeed(speed: number): void
ExperimentalSet the desired playback speed. The specified speed must be a value between 0 and 1. It gives the playback speed as a fraction of the original FPS which is stored in the XRPlaybackProperties.
Triggers a XRPlaybackStateChangedEvent.
Parameters
- speed: number
The desired playback speed. Must be a value between 0 and 1.
Returns void
- speed: number
showXRBackground Feed
- showXRBackgroundFeed(): Promise<void>
ExperimentalStarts putting the image feed into the viewer's background. Also see hideXRBackgroundFeed.
This will trigger a XRStateChangedEvent with XRState.backgroundFeedVisible set to
true.Returns Promise<void>
Returns a Promise which resolved when the operation was successful or rejects in an error case
shutdown Session
startXRPlayback
- startXRPlayback(): void
ExperimentalStart the XR playback.
Make sure to set the playback source before starting the playback. Triggers a XRPlaybackStateChangedEvent.
Returns void
startXRSpectate
- startXRSpectate(sessionMemberId: number): Promise<void>
ExperimentalStarts spectating the XRImage stream published by the session member with the specified ID within a shared session. This will also hide any other background feed that is currently shown.
Parameters
- sessionMemberId: number
The session member id of the member to spectate
Returns Promise<void>
Returns a promise which resolves when the operation was successful or rejects in an error case
- sessionMemberId: number
stopXRPlayback
- stopXRPlayback(): void
ExperimentalStop the XR playback.
Triggers a XRPlaybackStateChangedEvent.
Returns void
stopXRSpectate
store Session
- storeSession(): Promise<string>
Temporarily stores the session in the connected hub instance and returns an access handle.
This function does not transfer caches of referenced resources to the hub instance. For transferring caches, see transferSession.
Returns Promise<string>
The access handle of the stored session.
transfer Session
- transferSession(progressCallback: StoreSessionProgressCallback): Promise<string>
ExperimentalParameters
- progressCallback: StoreSessionProgressCallback
Can be used to track the progress of the transfer.
Returns Promise<string>
The access handle of the transferred session.
Deprecated
transferSession with progress callback is deprecated. Please use transferSession without parameters and utilize the returned promise instead!
Transfers the session to the connected hub instance and returns an access handle.
Transfers caches of referenced resources to the hub instance if they are not already present.
- progressCallback: StoreSessionProgressCallback
- transferSession(): Promise<string>
ExperimentalTransfers the session to the connected hub instance and returns an access handle.
Transfers caches of referenced resources to the hub instance if they are not already present.
Returns Promise<string>
The access handle of the transferred session.
unanchorXR
- unanchorXR(): void
ExperimentalUnanchors the model. This will have the effect that the model will no longer be anchored to the real world.
This will trigger a XRStateChangedEvent with XRState.anchored set to
false.Returns void
unregister Frame Listener
- unregisterFrameListener(listener: FrameListener): void
Unregisters a frame listener which has previously been registered via registerFrameListener.
Parameters
- listener: FrameListener
The listener to unregister.
Returns void
- listener: FrameListener
unregister Listener
use Member Action
- useMemberAction<A extends MemberAction>(
memberId: number,
action: A,
options?: MemberActionsToOptionsMap[A],
): Promise<void> ExperimentalUses an action on a member.
Type Parameters
- A extends MemberAction
Parameters
- memberId: number
The ID of the member to use the action on.
- action: A
The action to use.
Optionaloptions: MemberActionsToOptionsMap[A]Optional parameters for the action.
Returns Promise<void>
A promise that resolves when the action has been used.
wait For
- waitFor(state: ContextState): Promise<void>
Register a callback to a specific state. The callback is executed once when the state is reached. If webVis is already in that state the callback is triggered immediately.
Parameters
- state: ContextState
The state for which a callback is registered
Returns Promise<void>
A promise which throws an error if the requested state is invalid
The following states are allowed as target
init- Is reached when webVis is fully configured and set up.
resourceStateUpdated- Is reached when there is state information available for all resources (This information can also be "still transcoding").
resourceProcessed- This is triggered when all resources are done transcoding.
renderingFinished- This is triggered when webVis is done with rendering. So no more image changes are imminent.- state: ContextState
Was this page helpful? Please leave a thumbs up or down.
The ContextAPI combines all functionality which can be applied on the WebvisContext.