Viewer
    Preparing search index...

    Interface IOutputApi

    The api for an output of a corresponding [session]ISessionApi.

    Outputs represent the channels through which data is output from the model represented by a session. They are computed as part of customizations (see customize).

    Outputs contain static properties which do not depend on parameter values, these are:

    • id
    • uid
    • name
    • material
    • chunks
    • dependency
    • order
    • tooltip
    • displayname
    • hidden

    The remaining properties are dynamic and may change depending on parameter values. Specifically the content property refers to output assets and embedded data.

    Each output has a corresponding node in the [scene tree]ITree which represents the data that got output from the model for the parameter values stored in IParameterApi.sessionValue.

    An output's content can be updated manually by calling the updateOutputContent method. Using the freeze property the output's content can be frozen, which means subsequent customize calls will not update the output.

    interface IOutputApi {
        dependency: string[];
        format: string[];
        freeze: boolean;
        hidden: boolean;
        id: string;
        name: string;
        updateCallback:
            | ((newNode?: ITreeNode, oldNode?: ITreeNode) => void | Promise<void>)
            | null;
        version: string;
        updateOutputContent(
            content: ShapeDiverResponseOutputContent[],
            preventUpdate?: boolean,
        ): Promise<ITreeNode | undefined>;
        bbmax?: number[];
        bbmin?: number[];
        chunks?: ShapeDiverResponseOutputChunkBackend[];
        content?: ShapeDiverResponseOutputContentBackend[];
        delay?: number;
        displayname?: string;
        group?: CommonsGroup;
        material?: string;
        msg?: string;
        node?: ITreeNode;
        order?: number;
        status_collect?: ResComputationStatus;
        status_computation?: ResComputationStatus;
        tooltip?: string;
        typeId?: string;
        typeName?: string;
        uid?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    dependency: string[]
    format: string[]

    The format of the items in the content array.

    freeze: boolean

    The freeze flag. When set to true, calls to the following functions will not update the output:

    hidden: boolean
    id: string
    name: string
    updateCallback:
        | ((newNode?: ITreeNode, oldNode?: ITreeNode) => void | Promise<void>)
        | null

    A callback that is executed whenever an output's node is to be replaced due to an update of the output's content. Provides the new scene tree node and the old one, so that data can be carried over. If the callback is a promise it will be awaited in the execution chain.

    version: string
    bbmax?: number[]
    bbmin?: number[]
    delay?: number
    displayname?: string
    group?: CommonsGroup
    material?: string
    msg?: string
    node?: ITreeNode

    The node corresponding to the output in the [scene tree]ITree.

    order?: number
    status_collect?: ResComputationStatus
    status_computation?: ResComputationStatus
    tooltip?: string
    typeId?: string
    typeName?: string
    uid?: string

    Methods

    • Update the output's content, effectively overriding the content which was output from the model.

      This can be used to override the content which was output from the model (e.g. materials). In case you want the override content to persist further calls to ISessionApi.customize, await the call to this function and then set freeze to true.

      Parameters

      Returns Promise<ITreeNode | undefined>

      {@type ShapeDiverViewerError}