Vertex Viewer SDK
    Preparing search index...

    Class RootQuery

    Implements

    • ItemQuery<SingleSceneItemQuery>
    Index

    Constructors

    Methods

    • Specifies that the operation should be performed on all items in the scene.

      Returns AllQuery

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

      // Deselect all items in the scene
      await scene.elements((op) => [op.items.where((q) => q.all()).deselect()]).execute();
    • Specifies that the operation should be performed on all items that do not match any following queries.

      Returns RootQuery

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

      // Hide all items that are not selected
      await scene.elements((op) => [op.items.where((q) => q.not().withSelected()).hide()]).execute();
    • Specifies that the operation should be performed on any item matching the provided ID.

      Parameters

      • id: string

      Returns SingleSceneItemQuery

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

      // Hide the item with the `item-uuid` ID
      await scene.elements((op) => [
      op.items.where((q) => q.withItemId('item-uuid')).hide(),
      ]).execute();
    • Specifies that the operation should be performed on any item matching any one of the provided IDs.

      Parameters

      • ids: string[]

      Returns BulkQuery

      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.elements((op) => [
      op.items.where((q) => q.withItemIds(['item-uuid-1', 'item-uuid-2'])).hide(),
      ]).execute();
    • 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.

      Parameters

      • filter: string
      • keys: string[]
      • exactMatch: boolean
      • OptionalremoveHiddenItems: boolean

      Returns MetadataQuery

      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.elements((op) => [
      op.items.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.elements((op) => [
      op.items.where((q) => q.withMetadata('PartName', ['PART_NAME_KEY'], true)).hide(),
      ]).execute();
    • 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.

      Parameters

      Returns PointQuery

      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.elements((op) => [
      op.items.where((q) => q.withPoint(Point.create(100, 100))).select(),
      ]).execute();
    • Specifies that the operation should be performed on a range within the <vertex-scene-tree> component.

      Parameters

      • range: SceneTreeRange

      Returns SceneTreeRangeQuery

      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.elements((op) => [
      op
      .items.where((q) =>
      q.withSceneTreeRange({
      start: 2,
      end: 5,
      })
      )
      .hide(),
      ]).execute();
    • Specifies that the operation should be performed on any item that has been selected.

      Returns AllSelectedQuery

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

      // Hide all items that are selected
      await scene.elements((op) => [op.items.where((q) => q.withSelected()).hide()]).execute();
    • Specifies that the operation should be performed on any item matching the provided custom supplied ID.

      Parameters

      • id: string

      Returns SingleSceneItemQuery

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

      // Hide the item with the `item-supplied-id` supplied ID
      await scene.elements((op) => [
      op.items.where((q) => q.withSuppliedId('item-supplied-id')).hide(),
      ]).execute();
    • Specifies that the operation should be performed on any item matching any one of the provided custom supplied IDs.

      Parameters

      • ids: string[]

      Returns BulkQuery

      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.elements((op) => [
      op
      .items.where((q) => q.withItemIds(['item-supplied-id-1', 'item-supplied-id-2']))
      .hide(),
      ]).execute();
    • Specifies that the operation should be performed on any item that is visible.

      Returns AllVisibleQuery

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

      // Select all items that are visible
      await scene.elements((op) => [op.items.where((q) => q.withVisible()).select()]).execute();
    • 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.

      Parameters

      Returns VolumeIntersectionQuery

      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.elements((op) => [
      op
      .items.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.elements((op) => [
      op
      .items.where((q) =>
      q.withVolumeIntersection(
      Rectangle.create(100, 100, 100, 100),
      false
      )
      )
      .hide(),
      ]).execute();