Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SceneItemOperationsBuilder

A class that is responsible for building operations for a specific scene. This executor requires a query, and expects execute() to be invoked in order for the changes to take effect.

Hierarchy

  • SceneItemOperationsBuilder

Implements

Index

Constructors

Methods

  • Specifies that the items matching the query should have their overridden end item state removed.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Clear the overridden end item state of the item with the `item-uuid` ID
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).clearEndItem(),
    ]);

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should have any overridden material removed.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Clear the overridden material on the item with the `item-uuid` ID
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).clearMaterialOverrides(),
    ]);

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should have their overridden phantom state removed.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Clear the overridden phantom state of the item with the `item-uuid` ID
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).clearPhantom(),
    ]);

    Returns SceneItemOperationsBuilder

  • Clears the rendition of items matching the query, which will revert the item back to the rendition used when creating the item.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Switch the rendition of the given item.
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).clearRendition(),
    ]);

    Returns SceneItemOperationsBuilder

  • Clears the representation for items matching the query.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Switch the rendition of the given item.
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).clearRepresentation(),
    ]);

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should have their overridden transformation matrix removed. The cascade flag determines whether children of the items matching the query should also have their overridden transformation matrix removed, and defaults to true.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Clear the overridden the transformation matrix for the item with the `item-uuid` ID
    // and do not cascade to preserve transformations on children
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).clearTransforms(false),
    ]);

    // Clear the overridden the transformation matrix for the item with the `item-uuid` ID
    // and cascade to clear overridden transformations on children
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).clearTransforms(true),
    ]);

    Parameters

    • cascade: boolean = true

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should be deselected.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Deselect the item with the `item-uuid` ID
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).deselect(),
    ]).execute();

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should be hidden.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Hide the item with the `item-uuid` ID
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).hide(),
    ]).execute();

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should have their default material overridden to match the specified material.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Override the material for the item with the `item-uuid` ID to
    // be red with an opacity of 0.5.
    await scene.items((op) => [
    op
    .where((q) => q.withItemId('item-uuid'))
    .materialOverride(ColorMaterial.create(255, 0, 0, 0.5)),
    ]);

    // Override the material for the item with the `item-uuid` ID to
    // be red with an opacity of 1.
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).materialOverride('#ff0000'),
    ]).execute();

    Parameters

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should be selected.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Select the item with the `item-uuid` ID
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).select(),
    ]).execute();

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should have their end item state overridden to match the specified endItemState flag. If the endItemState flag is not provided, it will default to true.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Mark the item with the `item-uuid` ID as an end item
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).setEndItem(true),
    ]);

    // Unmark the item with the `item-uuid` ID as an end item
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).setEndItem(false),
    ]);
    remarks

    End item states do not propagate to children similar to other states like other operations. I.e. calling setEndItem(false) on an item will cause it to be unmarked as an end item, but any children where setEndItem(true) was called previously will remain as end items.

    Parameters

    • Optional endItemState: boolean

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should have their phantom state overridden to match the specified phantomState flag. If the phantomState flag is not provided, it will default to true.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Mark the item with the `item-uuid` ID as phantom
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).setPhantom(true),
    ]);

    // Unmark the item with the `item-uuid` ID as phantom
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).setPhantom(false),
    ]);

    Parameters

    • Optional phantomState: boolean

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should be shown.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Show the item with the `item-uuid` ID
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).show(),
    ]).execute();

    Returns SceneItemOperationsBuilder

  • Specifies that the items matching the query should have their transformation matrix overridden to match the specified transformation matrix.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Override the transformation matrix for the item with the `item-uuid` ID to
    // move the element along the x-axis
    await scene.items((op) => [
    op
    .where((q) => q.withItemId('item-uuid'))
    .transform(Matrix4.makeTranslation(Vector3.create(100, 0, 0))),
    ]);

    Parameters

    • matrix: number[] | IMatrix4x4f

    Returns SceneItemOperationsBuilder

  • Changes the rendition of items matching the query back to their revision's default rendition. This operation only applies to items that reference a revision.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Switch the rendition of the given item.
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).viewDefaultRendition(),
    ]);

    Returns SceneItemOperationsBuilder

  • Changes the rendition of an item matching the query. This operation only applies to items that reference a revision that contains the given rendition.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Switch the rendition of the matching item.
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).viewRenditionById('rendition-uuid'),
    ]);

    Parameters

    • id: string

    Returns SceneItemOperationsBuilder

  • Changes the rendition of any item matching the query that contains a rendition with the given supplied ID. This operation only applies to items that reference a revision that contain a rendition with a matching supplied ID.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Switch the rendition of the given item.
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).viewRenditionBySuppliedId('rendition-supplied-id'),
    ]);

    Parameters

    • suppliedId: string

    Returns SceneItemOperationsBuilder

  • Changes the representation of items matching a query. This operation only applies to items that reference a rendition with the given representation ID.

    example
    const viewer = document.querySelector('vertex-viewer');
    const scene = await viewer.scene();

    // Switch the rendition of the given item.
    await scene.items((op) => [
    op.where((q) => q.withItemId('item-uuid')).viewRepresentation('rep-id'),
    ]);

    Parameters

    • id: string

    Returns SceneItemOperationsBuilder