ContextAPI

Interface ContextAPI

The ContextAPI combines all functionality which can be applied on the WebvisContext.

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)

Methods

add addCustomNode addToCollection addTopologyToSelection addToSelection anchorXR changeAnnotation changeClippingRoom changeClipPlane changeDrawing changeDrawingPlane changeMaterial changeMeasurement changeSetting changeSnapshot clear clearSelection clearTopologySelection clipOtherParts cloneIntoNewSpace collectRuntimeNodesOfType connectToSession connectXR createAnimationFrames createAnnotation createAttachment createBoxVolume createCapping createCircularArcDescriptor createClippingRoom createClipPlane createCollection createDrawing createDrawingPlane createExplosion createMaterial createMeasurement createNodePathHandles createPointDescriptor createSnapshot createViewer deleteMemberProfileEntry disableCapping disconnectFromSession disconnectXR enableCapping endExplosion enterXRInitMode exportXRInitTemplate fetchAttachmentData getAnnotationData getAnnotations getAttachmentData getAttachmentDataURI getClipPlanes getClipRoom getCollection getCollectionElements getCollectionNodeCount getCoordinateSystemForwardVector getCoordinateSystemMatrix getCoordinateSystemRightVector getCoordinateSystemUpVector getDrawingPlaneData getDrawingPlanes getDrawings getEnabledAuxNodes getEnabledLayerFilters getInteractionMode getMaterialData getMaterials getMeasurements getMemberName getMembers getMetadata getName getProperties getProperty getRegisteredLayerFilters getRootNodeId getSelectedLeafNodes getSelectedNodes getSelectedTopologyHandles getSelection getSessionMemberID getSessionMembers getSessionStateData getShapeHandle getSnapshotData getSnapshots getStatistics getTopologyType getViewer getViewers getXRCapabilities getXRMembers getXRPlaybackProperties getXRPlaybackState getXRState hideXRBackgroundFeed importConfig importSession importXRInitTemplate invertEnabledStates invertSelection isColorComparisonActive isNodeDeletable isNodePartOfEnabledLayers isNodePartOfEnabledVariant isNodeType isOfflineStorageAvailable isSelected isTopologySelected mapInternalToOriginalTopologyHandles mapOriginalToInternalTopologyHandles measureBetween measureNormal measurePointsByDistance measureTangent measureThickness openSpace performExplosion processInteractionInput promoteSessionMember query readSetting registerCustomProperty registerFrameListener registerListener remove removeAnimationFrames removeAnnotation removeAttachment removeCapping removeClippingRoom removeClipPlane removeCollection removeDrawing removeDrawingPlane removeFromCollection removeFromSelection removeMaterial removeMeasurement removeSessionMember removeSnapshot removeTopologyFromSelection removeViewer requestActiveSceneVolume requestAnnotationData requestAuxRootNodeIds requestBoxDescriptor requestClipPlaneData requestClipRoomData requestDrawingData requestFullSceneVolume requestHubVersion requestL3DInformation requestMeasurementData requestMemberActions requestMemberProperties requestNeighboringEdges requestNeighboringFaces requestNodeIdsByBoxVolume requestNodePathHandleMap requestNodePathStrings requestRootNodeIds requestServiceStates requestSnapshotData requestSpaceHandle requestSupportedContentTypes requestSupportedRenderSetups requestTopologyDescriptor requestVariants requestXRDeviceScreenshot requestXRScanshot resetInteractionMode resetProperties resetProperty resetSetting resetUserSettings restoreSession restoreSnapshot searchByVolume seekXRPlayback selectCollection setAttachmentData setAttachmentDataURI setInteractionMode setLayerFilterEnabled setMemberName setMemberProfileEntry setParent setProperty setSelection setTopologyProperty setTopologySelection setVariantEnabled setXRPlaybackBoomerang setXRPlaybackFrameRange setXRPlaybackSource setXRPlaybackSpeed showXRBackgroundFeed shutdownSession startXRPlayback startXRSpectate stopXRPlayback stopXRSpectate storeSession transferSession unanchorXR unregisterFrameListener unregisterListener useMemberAction waitFor

Methods

  • Adds a new node to the instance graph.

    Parameters

    Returns number

    The ID of the added node

  • Parameters

    • dataURI: string

      Specifies the URI to the data resource.

    • OptionalparentID: number

      Specifies the parent Node ID of the added Node.

    • Optionalusage: UsageString

      The usage parameter allows to define how the resource should be inserted in the InstanceGraph.

    • Optionallabel: string

      Specifies a custom label for the added Node.

    • OptionalcontentType: string

      Specifies the MimeType of the data resource.

    • OptionalinitialProperties: InitialNodeProperties

      Specifies initialProperties of the added Node.

    • OptionalcacheStrategy: CacheStrategy

      Specifies the strategy which is used when a data cache is requested from the Hub.

    Returns number

    The ID of added node

    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.

  • 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: AttachmentType

      Specifies the type of the data. Default: "json".

    Returns number

    The ID of the newly created custom node.

  • Parameters

    • collectionID: number

      Specifies to which collection the node should be added

    • nodeID: number

      Specifies which node should be added to the collection

    • Optionalrecursive: boolean

      Specifies if the children of the node should also be added to the collection

    Returns void

    addToCollection is deprecated and will be removed in future versions.

    Adds the node given by nodeID to the collection with id collectionID. If recursive is true, the descendants of the node are also added. Returns the number of nodes in the collection.

  • 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: boolean

      If set to true, no event will be emitted. Default: false

    Returns Promise<ChangeSelectionResult>

    The result of the selection change.

  • Experimental

    Anchors 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: XRAnchorOptions

      An optional object that contains the anchorToSurface property.

    Returns void

  • 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.

  • Parameters

    • annotationID: number

      The ID of the Annotation.

    • Optionallabel: string

      The text of the Annotation.

    • Optionalvisible: boolean

      Indicates 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: boolean

      DEPRECATED

    • Optionaltransform: number[] | Float32Array<ArrayBufferLike>

      The transformation of the Annotation.

    Returns void

    Changes an annotation. Should use a properties object AnnotationProperties as an argument rather than passing individual values.

  • 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

    Returns ClipRoomProperties

    An object containing only the properties that were actually changed

  • Parameters

    • Optionalname: string

      The 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: boolean

      The disabled state of the clip room.

    • Optionalinvisible: boolean

      The invisible state of the clip room.

    Returns ClipRoomProperties

    An object with the changed properties.

    Calling changeClippingRoom with single parameters is deprecated, please use ClipRoomProperties instead.

    Changes one or more properties of the clip room.

  • 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

  • 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: string

      The display name for the clip plane

    • Optionalthickness: number

      The visual thickness of the clip plane

    • Optionaltangent: number[] | Float32Array<ArrayBufferLike>

      The tangent vector for the clip plane

    • Optionaldisabled: boolean

      Whether the clip plane is enabled (false) or disabled (true)

    • Optionalinvisible: boolean

      Whether the clip plane's visual representation is hidden

    • Optionalexclusive: boolean

      Whether the clip plane only affects nodes with the exclusiveClipplanes property

    Returns void

    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.

  • Changes the setting to the given value.

    Type Parameters

    • T extends string

    Parameters

    • setting: T

      A name that specifies a particular setting

    • value: ContextSettingType<T>

      The new value for the setting

    Returns boolean

    A boolean which indicates if the setting has changed

  • 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.

  • 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: string

      The new name of the snapshot.

    • OptionalscreenshotURL: string

      The new screenshot URL of the snapshot.

    • Optionalorder: number

      The order inside the list of snapshots.

    Returns SnapshotProperties

    Calling changeSnapshot with single parameters is deprecated, please use SnapshotProperties instead.

  • Clears the whole Context by removing all Nodes, Snapshots, ClipPlanes, Drawings, Measurements, etc.

    Returns Promise<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

  • Experimental

    Opens a new 3D space by cloning the current space.

    Returns Promise<void>

    A promise that resolves when the new space has been opened.

  • Returns a list of all existing runtime node IDs of a specified type.

    Parameters

    • nodeType: NodeType

      The node type to collect.

    • OptionalsubType: string

      The sub type to collect. Only used for custom nodes. See Property.SUBTYPE.

    Returns number[]

    A list of runtime node IDs of the specified type.

  • Parameters

    • OptionalsessionID: string

      The ID of the Session.

    • Optionalname: string

      The ID of the Session.

    Returns Promise<SessionStateData>

    The whole SessionAPI is under consolidation and will be replaced in a future release.

    Connects to a Session. If the ID does not exist, a new Session will be created.

  • Experimental

    Connect 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, modelTrackingEnabled and autoShowBackgroundFeed will be inferred as true and deviceScreenshotsEnabled as false automatically.

    Note: If a change of configuration is required after being initialized, the user has to disconnectXR and connect with the new configuration.

    Parameters

    • OptionalxrConfiguration: XRConfiguration

      The configuration for the XR system

    Returns Promise<void>

    Returns a Promise which resolved when the operation was successful or rejects in an error case

  • Creates a new Annotation and triggers an AnnotationCreatedEvent.

    Parameters

    Returns number

    The ID of the newly created Annotation.

  • Parameters

    • nodeID: number

      The ID of the node that the Annotation belongs to.

    • label: string

      The text of the Annotation.

    • Optionalvisible: boolean

      Indicates 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.

    Creates a new annotation. Should use a properties object AnnotationProperties as an argument rather than passing individual values.

  • Creates a new BoxVolume object.

    Parameters

    • Optionalmin: [number, number, number]
    • Optionalmax: [number, number, number]

    Returns BoxVolume

    A new Box Volume

  • Experimental

    Generates 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

  • 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: ClipRoomProperties

      Initial properties of the created clip room. Default: {}

    Returns void

  • Parameters

    • Optionalname: string

      The 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: boolean

      The disabled state of the clip room.

    • Optionalinvisible: boolean

      The invisible state of the clip room.

    Returns void

    Calling createClippingRoom with single parameters is deprecated, please use ClipRoomProperties instead.

    Creates a new clip room.

  • 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: ClipPlaneProperties

      Initial properties of the created clip plane. Default: {}

    Returns number

    The ID of the newly created clip plane.

  • 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: string

      The name of the clip plane

    • Optionalthickness: number

      The thickness of the clip plane

    • Optionaltangent: number[] | Float32Array<ArrayBufferLike>

      The tangent of the clip plane

    • Optionaldisabled: boolean

      The state of the clip plane

    • Optionalinvisible: boolean

      Invisible on the UI

    • Optionalexclusive: boolean

      Set the exclusive flag to clip geometry when using exclusiveClipplanes property

    Returns number

    The ID of the newly created clip plane

    Calling createClipPlane with single parameters is deprecated, please use ClipPlaneProperties instead.

    Creates a clip plane defined by the plane's normal, positioned at an optional point (otherwise at the world space origin) and an optional name.

  • Parameters

    • OptionalnodeIDlist: number[]

      An array of node id's from which a new node collection should be created.

    Returns number

    The id of the newly created node collection.

    createCollection is deprecated and will be removed in future versions. Please use a simple array of node IDs instead.

    Returns the id of a new collection containing the nodes from the given list.

  • Returns number

    The id of the newly created collection.

    createCollection is deprecated and will be removed in future versions. Please use a simple array of node IDs instead.

    Creates a new, empty collection and returns its id.

  • Creates an Explosion (around a given point).

    Parameters

    • OptionalcenterNodeID: number

      The nodeID of the node around which center the explosion is created.

    Returns void

  • 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

  • Creates a viewer element.

    Parameters

    • OptionalviewerID: string

      The id of the viewer.

    • Optionalcanvas: HTMLCanvasElement

      The 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

  • Experimental

    Deletes a profile entry of the local member.

    Parameters

    • key: string

      The key of the profile entry to delete.

    Returns Promise<void>

    A promise that resolves when the profile entry has been deleted.

  • Experimental

    Disables 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

  • Returns void

    The whole SessionAPI is under consolidation and will be replaced in a future release.

    Disconnects from a Session.

  • Experimental

    Disconnect from the XR system.

    This method should be called when the AR functionalities are no longer needed.

    Returns Promise<void>

    Returns a Promise which resolved when the operation was successful or rejects in an error case

  • Experimental

    Enables 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

  • Restores the initial transformations of all exploded parts.

    Returns void

  • Experimental

    Enter 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 true which 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: XRInitOptions

      The 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

  • Experimental

    Exports 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.

  • Fetches and returns the attachment data of the specified attachment.

    Parameters

    • attachmentID: number

      Specifies the attachment object.

    Returns Promise<Serializable>

    The attached data.

  • Returns the attachment data URI.

    Parameters

    • attachmentID: number

      Specifies the attachment object.

    Returns string

    The attachment data URI.

  • 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.

  • 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

  • Parameters

    • collectionID: number

      Specifies which collection should be returned

    Returns ICollection

    The collection with the given id

    getCollection is deprecated and will be removed in future versions.

    Returns the collection with the given id.

  • Readonly

    Parameters

    • collectionID: number

      The id of the node collection

    Returns Promise<number[]>

    Array of node IDs representing the node collection

    getCollectionElements is deprecated and will be removed in future versions.

    Returns an array containing the ids of the nodes in the collection. Modifying the returned array results in undefined behavior.

  • Parameters

    • collectionID: number

      The id of the collection

    Returns Promise<number>

    Number of elements in a collection.

    getCollectionNodeCount is deprecated and will be removed in future versions.

    Returns the number of elements inside a collection.

  • Returns the forward vector of the current coordinate system.

    Returns Float32Array<ArrayBufferLike> | [number, number, number]

    The forward vector of the current coordinate system.

  • 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

  • Returns the right vector of the current coordinate system.

    Returns Float32Array<ArrayBufferLike> | [number, number, number]

    The right vector of the current coordinate system.

  • Returns the up vector of the current coordinate system.

    Returns Float32Array<ArrayBufferLike> | [number, number, number]

    The up vector of the current coordinate system.

  • Experimental

    Returns all available DrawingPlane IDs.

    Returns number[]

    An Array of all available DrawingPlane IDs.

  • Returns all available Drawing ids.

    Returns number[]

    An Array of all available Drawing ids.

  • Parameters

    • nodeID: number

      Specifies the entry point of the subtree traversal. Default: 0

    Returns Promise<number[]>

    An Array of all enabled aux node IDs

    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.

  • Returns the currently defined list of enabled layer filters.

    Returns string[]

    An array of strings representing the names of the enabled layer filters.

  • Experimental

    Experimental. 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.

  • Experimental

    Experimental. May be changed in the future without notice.

    Returns the IDs of all material entities in the webvis context.

    Returns number[]

    The IDs of all available materials

  • Experimental

    Gets the name of the local member.

    Returns string

    The name of the local member, or undefined if not set.

  • Experimental

    Gets a list of all member IDs in the current space.

    Returns number[]

    An array of member IDs.

  • Returns a JSON object containing the metadata for the given node ID.

    Parameters

    • nodeID: number

      The ID of a node.

    Returns Promise<{ [key: string]: string }>

    A JSON object containing the requested metadata.

  • Returns string

    The name of the context.

  • Returns the values of the specified properties of the given node.

    Type Parameters

    • T extends string

    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.

  • Returns the value of the specified property of the given node.

    Type Parameters

    • T extends string

    Parameters

    • nodeID: number

      The ID(s) of the node(s) whose property should be read.

    • property: T

      The name of the Property whose value should be read.

    Returns Promise<PropertyType<T>>

    The retrieved value of the node property.

  • Returns the currently defined list of layer filters with their current state.

    Returns { [key: string]: boolean }

    Returns a map of the registered layer filters and their states.

  • Returns the root node ID of the given node or topology element.

    Parameters

    • target: number | TopologyHandle

      Specifies the target node or topology element.

    • OptionalincludeTarget: boolean

      Controls 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.

  • Returns a list of all selected leaf nodes.

    Returns number[]

    An array which contains the IDs of all leaf nodes in the current selection.

  • 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.

  • Returns a list of all selected nodes.

    Returns Promise<number[]>

    An array which contains the IDs of all nodes in the current selection.

    getSelection is deprecated, please use getSelectedNodes instead.

  • Returns number

    The ID of the SessionMember.

    The whole SessionAPI is under consolidation and will be replaced in a future release.

  • Returns Promise<SessionMemberData[]>

    The IDs of all SessionMembers.

    The whole SessionAPI is under consolidation and will be replaced in a future release.

  • Returns SessionStateData

    Information about the Session.

    The whole SessionAPI is under consolidation and will be replaced in a future release.

  • 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.

    getSnapshotData is deprecated. Please use requestSnapshotData instead.

  • Returns the IDs of all available snapshots.

    Returns number[]

    An array of snapshot IDs.

  • Traverses the subtree of a given node ID and collects all statistics (currently only available for AUX nodes).

    Parameters

    • OptionalnodeType: NodeType

      Specifies the target node type. Default: NodeType.ALL

    • OptionalnodeID: number

      Specifies the node ID as the entry point of the subtree traversal. Default: 0

    • Optionalrecursive: boolean

    Returns Promise<any>

    An object of type/count pairs.

  • Parameters

    • Optionalid: string

      The id of the viewer.

    Returns ViewerAPI

    The viewer element by the given id.

  • Experimental

    Returns 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.

  • Experimental

    Get the runtime state of the XR system.

    Returns XRState

    Returns either the current XRState or undefined if the XR system is not connected.

  • 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

  • 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.

  • Experimental

    Imports 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 true is 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

  • 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.2
    

    If the initial selection is only Node 2.1, calling invertSelection will result in the selection including Node 2.2, Node 1.1, Node 1.2, and therefore also Node 1. Node 0 and Node 2 will 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: boolean

      If set to true, no event will be emitted. Default: false

    Returns Promise<ChangeSelectionResult>

    The result of the selection change.

  • Checks if the color comparison mode is active.

    Returns boolean

    true if the color comparison mode is active, otherwise false.

  • Checks if a node is deletable.

    Parameters

    • nodeID: number

    Returns boolean

    true if the node is deletable.

  • 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.

  • Parameters

    • nodeId: number

      The ID of the Node.

    Returns Promise<boolean>

    True, if the Node is Part of an enabled Variant. False otherwise.

  • Checks if a node is a specific type.

    Parameters

    Returns boolean

    true if the node is of the specified type, otherwise false.

  • Returns Promise<boolean>

    A Promise that always resolves to false, as offline storage is not used anymore.

    isOfflineStorageAvailable is deprecated.

    Checks if offline storage is currently available. This functionality is no longer relevant as offline storage is not supported anymore.

  • Checks if the specified node is part of the selection.

    Parameters

    • nodeID: number

      The ID of the node to check for selection status.

    Returns Promise<boolean>

    True if the given node is selected, otherwise false.

  • Experimental

    Attention: 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.

  • 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.

  • Experimental

    Opens 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: string

      The 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.

    requestSpaceHandle to get a space handle.

  • Performs the actual Explosion.

    Parameters

    • explosionFactor: number

      The value by which the parts are expanded.

    Returns void

  • Parameters

    • memberID: number

      The ID of the SessionMember.

    Returns void

    The whole SessionAPI is under consolidation and will be replaced in a future release.

    Promotes a SessionMember to the Role of the Moderator.

  • Returns the value of a setting.

    Type Parameters

    • T extends string

    Parameters

    • setting: T

      The name of the setting that should be read

    Returns ContextSettingType<T>

    The value of the specified setting

  • 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: boolean

      Defines whether the property is recursive. Default: false

    Returns void

  • Registers a frame listener which is executed on every tick of the internal update loop of the webvis context.

    Parameters

    Returns void

  • 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 type property specifies its EventType and determines its structure.

    Several EventTypes are linked to a specific node in the hierarchy. These include all that have a NODE_ or TOPOLOGY_ 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 nodeID and observeSubTree. The observeSubTree flag 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 observeSubTree is false, such that listeners do not receive any events linked to added nodes. To listen to events from all nodes, set nodeID to 0 and observeSubTree to true.

    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: number

      The ID of the node to which the listener should be scoped. Default: 0

    • OptionalobserveSubTree: boolean

      If 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.
  • 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: boolean

      Performs 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.

  • Removes an existing animation sequence.

    Parameters

    • name: string

      Specifies the name of the animation frames.

    Returns void

  • Removes the Annotation from the scene and all related Snapshots and triggers an AnnotationRemovedEvent.

    Parameters

    • annotationId: number

      The ID of the Annotation.

    • Optionalsafe: boolean

      Performs a safe remove which interrupt the removal process if the Annotation is part of one or more Snapshots.

    Returns RemoveState

  • Removes the Attachment from the scene and all related snapshots.

    Triggers an AttachmentRemovedEvent.

    Parameters

    • attachmentID: number

      Specifies the attachment object.

    • Optionalsafe: boolean

      Performs 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.

  • Experimental

    Completely 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

  • 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 safe parameter is set to true and the clip room is referenced by snapshots, the removal will be prevented and the method will return REFERENCED_BY_SNAPSHOT. By default (safe is 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: boolean

      Whether 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

  • 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 safe parameter is set to true and the clip plane is referenced by snapshots, the removal will be prevented and the method will return REFERENCED_BY_SNAPSHOT. By default (safe is 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: boolean

      Whether 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

  • Parameters

    • collectionID: number

      Specifies which collection should be removed

    Returns void

    removeCollection is deprecated and will be removed in future versions.

    Removes the collection with the given id.

  • 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: boolean

      Performs a safe remove which interrupt the removal process if the Drawing is part of one or more Snapshots.

    Returns RemoveState

  • Experimental

    Removes 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: boolean

      Performs a safe remove which interrupt the removal process if the Drawing is part of one or more Snapshots.

    Returns RemoveState

  • Parameters

    • collectionID: number

      Specifies from which collection the node should be removed

    • nodeID: number

      Specifies which node should be removed from the collection

    • Optionalrecursive: boolean

      Specifies whether the children of the node should be removed from the collection too

    Returns void

    removeFromCollection is deprecated and will be removed in future versions.

    Removes a node given by nodeID from the collection with id collectionID. If recursive is true, the descendants of the node are also removed.

  • 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: boolean

      If set to true, no event will be emitted. Default: false

    Returns Promise<ChangeSelectionResult>

    The result of the selection change.

  • Experimental

    Experimental. 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: boolean

      Performs 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.

  • 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: boolean

      Performs 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.

  • Parameters

    • memberID: number

      The ID of the SessionMember.

    Returns void

    The whole SessionAPI is under consolidation and will be replaced in a future release.

    Removes a SessionMember from a Session.

  • Removes a viewer element.

    Parameters

    Returns void

  • Returns a list of all existing AUX root node IDs below the specified subtree.

    Parameters

    • OptionalscopeNodeId: number

      Specifies the top one node ID of the subtree to be searched. Default: 0

    Returns Promise<number[]>

    A list of AUX root node IDs.

  • 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.

  • 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

  • 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

  • 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.

  • Request the current version of the connected instant3Dhub-backend. May return undefined for older versions.

    Returns Promise<string>

    Returns a Promise which contains a string containing the version of the connected backend.

  • Returns the L3D information of the specified node.

    Parameters

    • targetNodeId: number

      Specifies the target node ID.

    Returns Promise<any>

    The L3D information of the specified node

  • Experimental

    Requests 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.

  • Experimental

    Requests 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.

  • 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: boolean

      Specifies whether the result should include nodes which overlap the specified bounding volume as well. Default: false

    • OptionalincludeDisabledNodes: boolean

      Specifies whether the result should include nodes which are disabled as well. Default: false

    • OptionalforceExpand: boolean

      If set to true, L3D instances may be expanded to find their leaf nodes. Default: false

    • OptionalscopeNodeId: number

      Specifies 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.

  • 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

  • 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.

  • Returns a list of all existing root node IDs below the specified subtree.

    Parameters

    • OptionalscopeNodeId: number

      Specifies the top one node ID of the subtree to be searched. Default: 0

    • Optionalrecursive: boolean

      Specifies if the subtree is traversed recursively. Default: false

    Returns Promise<number[]>

    A list of root node IDs.

  • Experimental

    Requests 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: MemberRole

      The 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 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 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.

  • 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

    Returns Promise<TopologyDescriptor>

    A detailed descriptor for the specified topological entity.

  • Experimental

    Request a screenshot of the webview's content inside the native XR device application.

    Returns Promise<string>

    Returns a Promise which contains the base64 encoded image data when the operation was successful or rejects in an error case.

  • Sets the current interaction mode back to the Default mode.

    Parameters

    • OptionalkeepColorCompareActive: boolean

      Specifies if the color comparison mode should stay active. (Default: false)

    Returns 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: boolean

      If set to true, the properties are reset recursively. Default: false

    Returns 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: boolean

      If set to true, the properties are reset recursively. Default: false

    Returns Promise<void>

  • Restores a session for the given access handle from the infrastructure.

    Parameters

    • handle: string

      The access handle of the session to restore.

    Returns Promise<void>

    A Promise that resolves when the session is restored.

  • 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: number

      Restricts 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.

    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.

  • Experimental

    Jump 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

  • Parameters

    • collectionID: number

      The ID of the collection.

    • Optionalsilent: boolean

      If set to true, no event will be emitted. Default: false

    Returns Promise<ChangeSelectionResult>

    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.

  • Sets the attachment data URI.

    Parameters

    • attachmentID: number

      Specifies the attachment object.

    • dataURI: string

      The attachment data URI.

    Returns void

  • Set the current interaction mode.

    Parameters

    • mode: string | string[]

      Specifies the interaction mode you want set.

    • OptionalkeepColorCompareActive: boolean

      Specifies if the color comparison mode should stay active. Default: false

    Returns void

    Calling setInteractionMode with the mode parameter of type string or string[] is deprecated, please use the InteractionMode enum instead.

  • Set the current interaction mode.

    Parameters

    • mode: InteractionMode

      Specifies the interaction mode you want set.

    • OptionalkeepColorCompareActive: boolean

      Specifies if the color comparison mode should stay active. Default: false

    Returns void

  • Experimental

    Sets the name of the local member.

    Parameters

    • name: string

      The new name for the local member.

    Returns void

  • Experimental

    Sets 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.

  • 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

  • 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

    • T extends string

    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: boolean

      The silent flag indicates that no NODE_CHANGED event is fired. Default: false

    Returns Promise<void>

  • 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: boolean

      If set to true, no event will be emitted. Default: false

    Returns Promise<ChangeSelectionResult>

    The result of the selection change.

  • Enables or disables a given Variant.

    Parameters

    • variant: number

      The ID of the Variant.

    • enabled: boolean

      The enabled state.

    Returns Promise<void>

  • Experimental

    Specify 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

  • Experimental

    Sets 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

  • Experimental

    Set the URL pointing to the manifest.json file 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

  • Experimental

    Set 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

  • Returns Promise<void>

    The whole SessionAPI is under consolidation and will be replaced in a future release.

    Shuts down a Session and disconnects all joined SessionMembers.

  • Experimental

    Starts 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

  • Experimental

    Stops spectating the currently spectated XRImage stream of a session member.

    Returns void

  • 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.

  • Experimental

    Parameters

    Returns Promise<string>

    The access handle of the transferred session.

    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.

  • Experimental

    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.

    Returns Promise<string>

    The access handle of the transferred session.

  • Unregisters the event listener with the given ID.

    Parameters

    • listenerID: number

      The ID of the event listener that should be unregistered.

    Returns void

  • Experimental

    Uses an action on a member.

    Type Parameters

    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.

  • 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.




Was this page helpful? Please leave a thumbs up or down.