Documentation - v20.0.0-dev
    Preparing search index...

    Changes several properties of the given objects at once, one step of the history: any fields of a MeshState (visibility, layer, colours, opacity, x-ray, edges, cutting by the cutting planes, line style…). An object takes the fields of its type: a sprite its visibility and layer. Undoable; update changes some of the fields set, or adds others.

    await new SetObjectsStateCommand(viewer, uuids, {
    visible: true,
    diffuseColor: 0xff0000,
    opacity: 0.5,
    ignoreCuttingPlanes: true,
    }).execute();

    Hierarchy

    Index

    Constructors

    • Parameters

      • viewer: Viewer

        The viewer of the objects.

      • uuids: Iterable<string>

        The objects changed.

      • state: Partial<MeshState>

        The fields set; the others are left as they are.

      Returns SetObjectsStateCommand

    Properties

    _objects: SceneObject[]
    _state: PartialState<TState>
    isUndoable: boolean = true

    Indicates whether the command is undoable and redoable

    isUpdatable: boolean = true

    Indicated whether the command can be updated

    name: "SetObjectsStateCommand" = 'SetObjectsStateCommand'

    Name of the command

    viewer: Viewer

    Accessors

    • get hasBeenExecuted(): boolean

      Returns boolean

    Methods

    • Cleans the command footprint.

      Returns Promise<void>

    • Actions to execute during the execute method

      Returns Promise<Partial<MeshState & RestoreState>>

    • Actions to execute during the undo method

      Returns Promise<void>

    • Sets the given fields, the others set before kept.

      Parameters

      Returns void

    • Parameters

      • cmd: this

      Returns boolean

    • Toggle the command

      Parameters

      Returns Promise<void | Partial<MeshState>>

    • Undo the command

      Parameters

      Returns Promise<void>

    • Update the current state of the command and push the new state in history

      Parameters

      • ...params: Partial<MeshState>[]

        The new values of the command's state

      Returns Promise<void>