Specifies that the operation should be performed on all items that do not match any following queries.
Specifies that the operation should be performed on any item matching the provided ID.
Specifies that the operation should be performed on any item matching any one of the provided IDs.
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.
OptionalremoveHiddenItems: booleanconst 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.
Specifies that the operation should be performed on a range within the <vertex-scene-tree> component.
Specifies that the operation should be performed on any item that has been selected.
Specifies that the operation should be performed on any item matching the provided custom supplied ID.
Specifies that the operation should be performed on any item matching any one of the provided custom supplied IDs.
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.
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.
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();
Specifies that the operation should be performed on all items in the scene.