Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RootQuery

Implements

  • ItemQuery<SingleQuery>

Index

Constructors

Methods

  • all(): AllQuery
  • Specifies that the operation should be performed on all items in the scene.

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

    // Deselect all items in the scene
    await scene.items((op) => [op.where((q) => q.all()).deselect()]).execute();

    Returns AllQuery

  • Specifies that the operation should be performed on all items that do not match any following queries.

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

    // Hide all items that are not selected
    await scene.items((op) => [op.where((q) => q.not().withSelected()).hide()]).execute();

    Returns RootQuery

  • withItemId(id: string): SingleQuery
  • Specifies that the operation should be performed on any item matching the provided ID.

    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();

    Parameters

    • id: string

    Returns SingleQuery

  • withItemIds(ids: string[]): BulkQuery
  • Specifies that the operation should be performed on any item matching any one of the provided IDs.

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

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

    Parameters

    • ids: string[]

    Returns BulkQuery

  • withMetadata(filter: string, keys: string[], exactMatch: boolean, removeHiddenItems?: boolean): MetadataQuery
  • Specifies that the operation should be performed on any item that has a metadata value matching the filter provided for any of the keys specified. Can optionally be set to perform an exactMatch, which will require that the filter matches the value exactly.

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

    // Hide all items where the `PART_NAME_KEY` includes a value of `PartName`
    await scene.items((op) => [
    op.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'])).hide(),
    ]).execute();

    // Hide all items where the `PART_NAME_KEY` has exactly a value of `PartName`
    await scene.items((op) => [
    op.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'], true)).hide(),
    ]).execute();

    Parameters

    • filter: string
    • keys: string[]
    • exactMatch: boolean
    • Optional removeHiddenItems: boolean

    Returns MetadataQuery

  • withPoint(point: Point): PointQuery
  • Specifies that the operation should be performed on any item present at the provided point in the image. This query operates on the item found at that point similar to using withItemId in combination with raycaster.hitItems, which can be useful if the additional metadata from the raycaster.hitItems method is not needed to eliminate a network request.

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

    // Select the item present at the [100, 100] coordinate of the image
    await scene.items((op) => [
    op.where((q) => q.withPoint(Point.create(100, 100))).select(),
    ]).execute();

    Parameters

    • point: Point

    Returns PointQuery

  • withSceneTreeRange(range: SceneTreeRange): SceneTreeRangeQuery
  • Specifies that the operation should be performed on a range within the <vertex-scene-tree> component.

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

    // Hide all items from the 2nd row to the 5th row of the scene-tree
    await scene.items((op) => [
    op
    .where((q) =>
    q.withSceneTreeRange({
    start: 2,
    end: 5,
    })
    )
    .hide(),
    ]).execute();

    Parameters

    • range: SceneTreeRange

    Returns SceneTreeRangeQuery

  • withSelected(): AllSelectedQuery
  • Specifies that the operation should be performed on any item that has been selected.

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

    // Hide all items that are selected
    await scene.items((op) => [op.where((q) => q.withSelected()).hide()]).execute();

    Returns AllSelectedQuery

  • withSuppliedId(id: string): SingleQuery
  • Specifies that the operation should be performed on any item matching the provided custom supplied ID.

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

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

    Parameters

    • id: string

    Returns SingleQuery

  • withSuppliedIds(ids: string[]): BulkQuery
  • Specifies that the operation should be performed on any item matching any one of the provided custom supplied IDs.

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

    // Hide the item with the `item-supplied-id-1` supplied ID
    // and the `item-supplied-id-2` supplied ID
    await scene.items((op) => [
    op
    .where((q) => q.withItemIds(['item-supplied-id-1', 'item-supplied-id-2']))
    .hide(),
    ]).execute();

    Parameters

    • ids: string[]

    Returns BulkQuery

  • withVisible(): AllVisibleQuery
  • Specifies that the operation should be performed on any item that is visible.

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

    // Select all items that are visible
    await scene.items((op) => [op.where((q) => q.withVisible()).select()]).execute();

    Returns AllVisibleQuery

  • withVolumeIntersection(rectangle: Rectangle, exclusive?: boolean): VolumeIntersectionQuery
  • Specifies that the operation should be performed on items within the specified rectangle boundary within the Viewer. The exclusive flag here determines whether items that intersect with the rectangle, but are not contained should be included in the result.

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

    // Select all items within the specified 100x100 region of the image
    // excluding any elements that are not fully contained by the region
    await scene.items((op) => [
    op
    .where((q) =>
    q.withVolumeIntersection(
    Rectangle.create(100, 100, 100, 100),
    true
    )
    )
    .hide(),
    ]).execute();

    // Select all items within the specified 100x100 region of the image
    // including any elements that intersect with the region
    await scene.items((op) => [
    op
    .where((q) =>
    q.withVolumeIntersection(
    Rectangle.create(100, 100, 100, 100),
    false
    )
    )
    .hide(),
    ]).execute();

    Parameters

    • rectangle: Rectangle
    • Optional exclusive: boolean

    Returns VolumeIntersectionQuery