Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IOutputApi

The api for an output of a corresponding session.

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

Hierarchy

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: null | ((newNode?: ITreeNode, oldNode?: ITreeNode) => void | Promise<void>)

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?: ResOutputDefinitionGroup
material?: string
msg?: string
node?: ITreeNode

The node corresponding to the output in the scene tree.

order?: number
status_collect?: ResComputationStatus
status_computation?: ResComputationStatus
tooltip?: 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.

    throws

    {@type ShapeDiverViewerError}

    Parameters

    Returns Promise<undefined | ITreeNode>