@vertexvis/viewer 0.22.1-testing.0 → 0.22.1-testing.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{entities-a0db2d78.js → entities-9fad8808.js} +2 -2
- package/dist/cjs/{entities-a0db2d78.js.map → entities-9fad8808.js.map} +1 -1
- package/dist/cjs/index.cjs.js +5 -4
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mapper-ac34f608.js +27 -0
- package/dist/cjs/mapper-ac34f608.js.map +1 -0
- package/dist/cjs/{queries-d31d23d4.js → queries-ea895dd6.js} +34 -3
- package/dist/cjs/queries-ea895dd6.js.map +1 -0
- package/dist/cjs/{scene_view_api_pb-0c5fdc13.js → scene_view_api_pb-61f663af.js} +605 -1
- package/dist/cjs/scene_view_api_pb-61f663af.js.map +1 -0
- package/dist/cjs/{scene_view_api_pb_service-4f9e3f90.js → scene_view_api_pb_service-bd6f25d0.js} +42 -2
- package/dist/cjs/scene_view_api_pb_service-bd6f25d0.js.map +1 -0
- package/dist/cjs/vertex-viewer-measurement-distance.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-measurement-line_2.cjs.entry.js +1 -1
- package/dist/cjs/vertex-viewer-measurement-precise.cjs.entry.js +3 -3
- package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +2 -2
- package/dist/cjs/vertex-viewer.cjs.entry.js +5 -4
- package/dist/cjs/vertex-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/viewer.cjs.js +1 -1
- package/dist/collection/components/viewer/viewer.js +25 -0
- package/dist/collection/components/viewer/viewer.js.map +1 -1
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/lib/pmi/controller.js +39 -0
- package/dist/collection/lib/pmi/controller.js.map +1 -0
- package/dist/collection/lib/pmi/index.js +6 -0
- package/dist/collection/lib/pmi/index.js.map +1 -0
- package/dist/collection/lib/pmi/mapper.js +9 -0
- package/dist/collection/lib/pmi/mapper.js.map +1 -0
- package/dist/collection/lib/pmi/types.js +5 -0
- package/dist/collection/lib/pmi/types.js.map +1 -0
- package/dist/collection/testing/pmi.js +20 -0
- package/dist/collection/testing/pmi.js.map +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/mapper2.js +7 -3
- package/dist/components/mapper2.js.map +1 -1
- package/dist/components/queries.js +32 -2
- package/dist/components/queries.js.map +1 -1
- package/dist/components/scene_view_api_pb.js +604 -0
- package/dist/components/scene_view_api_pb.js.map +1 -1
- package/dist/components/scene_view_api_pb_service.js +40 -0
- package/dist/components/scene_view_api_pb_service.js.map +1 -1
- package/dist/components/vertex-viewer.js +3 -1
- package/dist/components/vertex-viewer.js.map +1 -1
- package/dist/esm/{entities-632f31f3.js → entities-9d4e336b.js} +2 -2
- package/dist/esm/{entities-632f31f3.js.map → entities-9d4e336b.js.map} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/mapper-b3a6eca5.js +23 -0
- package/dist/esm/mapper-b3a6eca5.js.map +1 -0
- package/dist/esm/{queries-40a25625.js → queries-f2b5a440.js} +34 -4
- package/dist/esm/queries-f2b5a440.js.map +1 -0
- package/dist/esm/{scene_view_api_pb-1d91cc93.js → scene_view_api_pb-c030fd23.js} +605 -1
- package/dist/esm/scene_view_api_pb-c030fd23.js.map +1 -0
- package/dist/esm/{scene_view_api_pb_service-9f20d437.js → scene_view_api_pb_service-65caee11.js} +42 -2
- package/dist/esm/scene_view_api_pb_service-65caee11.js.map +1 -0
- package/dist/esm/vertex-viewer-measurement-distance.entry.js +1 -1
- package/dist/esm/vertex-viewer-measurement-line_2.entry.js +1 -1
- package/dist/esm/vertex-viewer-measurement-precise.entry.js +3 -3
- package/dist/esm/vertex-viewer-pin-group.entry.js +2 -2
- package/dist/esm/vertex-viewer.entry.js +5 -4
- package/dist/esm/vertex-viewer.entry.js.map +1 -1
- package/dist/esm/viewer.js +1 -1
- package/dist/types/components/viewer/viewer.d.ts +7 -0
- package/dist/types/components.d.ts +11 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/pmi/controller.d.ts +16 -0
- package/dist/types/lib/pmi/index.d.ts +2 -0
- package/dist/types/lib/pmi/mapper.d.ts +4 -0
- package/dist/types/lib/pmi/types.d.ts +10 -0
- package/dist/types/testing/pmi.d.ts +5 -0
- package/dist/viewer/index.esm.js +1 -1
- package/dist/viewer/index.esm.js.map +1 -1
- package/dist/viewer/p-187f783f.entry.js +5 -0
- package/dist/viewer/p-187f783f.entry.js.map +1 -0
- package/dist/viewer/p-32bff740.js +5 -0
- package/dist/viewer/p-32bff740.js.map +1 -0
- package/dist/viewer/{p-9d0c84ab.entry.js → p-4b7b629a.entry.js} +2 -2
- package/dist/viewer/p-8af6917b.js +5 -0
- package/dist/viewer/p-8af6917b.js.map +1 -0
- package/dist/viewer/{p-34dce39f.js → p-90bbb5f6.js} +2 -2
- package/dist/viewer/{p-9094c563.entry.js → p-9de90d0e.entry.js} +2 -2
- package/dist/viewer/{p-b9965b9b.entry.js → p-b3257f48.entry.js} +2 -2
- package/dist/viewer/{p-076e9e65.entry.js → p-d10f7459.entry.js} +2 -2
- package/dist/viewer/p-d36d5971.js +5 -0
- package/dist/viewer/p-d36d5971.js.map +1 -0
- package/dist/viewer/p-f0c0cf0b.js +5 -0
- package/dist/viewer/p-f0c0cf0b.js.map +1 -0
- package/dist/viewer/viewer.esm.js +1 -1
- package/dist/viewer/viewer.esm.js.map +1 -1
- package/package.json +8 -8
- package/dist/cjs/mapper-f168a1a5.js +0 -22
- package/dist/cjs/mapper-f168a1a5.js.map +0 -1
- package/dist/cjs/queries-d31d23d4.js.map +0 -1
- package/dist/cjs/scene_view_api_pb-0c5fdc13.js.map +0 -1
- package/dist/cjs/scene_view_api_pb_service-4f9e3f90.js.map +0 -1
- package/dist/esm/mapper-826430a2.js +0 -19
- package/dist/esm/mapper-826430a2.js.map +0 -1
- package/dist/esm/queries-40a25625.js.map +0 -1
- package/dist/esm/scene_view_api_pb-1d91cc93.js.map +0 -1
- package/dist/esm/scene_view_api_pb_service-9f20d437.js.map +0 -1
- package/dist/viewer/p-2800111a.js +0 -5
- package/dist/viewer/p-2800111a.js.map +0 -1
- package/dist/viewer/p-2924ed4a.entry.js +0 -5
- package/dist/viewer/p-2924ed4a.entry.js.map +0 -1
- package/dist/viewer/p-9f190847.js +0 -5
- package/dist/viewer/p-9f190847.js.map +0 -1
- package/dist/viewer/p-a297836a.js +0 -5
- package/dist/viewer/p-a297836a.js.map +0 -1
- package/dist/viewer/p-aeaafe7f.js +0 -5
- package/dist/viewer/p-aeaafe7f.js.map +0 -1
- /package/dist/viewer/{p-9d0c84ab.entry.js.map → p-4b7b629a.entry.js.map} +0 -0
- /package/dist/viewer/{p-34dce39f.js.map → p-90bbb5f6.js.map} +0 -0
- /package/dist/viewer/{p-9094c563.entry.js.map → p-9de90d0e.entry.js.map} +0 -0
- /package/dist/viewer/{p-b9965b9b.entry.js.map → p-b3257f48.entry.js.map} +0 -0
- /package/dist/viewer/{p-076e9e65.entry.js.map → p-d10f7459.entry.js.map} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
const scene_view_api_pb = require('./scene_view_api_pb-
|
|
6
|
+
const scene_view_api_pb = require('./scene_view_api_pb-61f663af.js');
|
|
7
7
|
const wrappers_pb = require('./wrappers_pb-1f2f4854.js');
|
|
8
8
|
const grpc = require('./grpc-c3531bf5.js');
|
|
9
9
|
const mapper = require('./mapper-84dac749.js');
|
|
@@ -155,4 +155,4 @@ class MeasurementEntity {
|
|
|
155
155
|
exports.MeasurementController = MeasurementController;
|
|
156
156
|
exports.MeasurementEntity = MeasurementEntity;
|
|
157
157
|
|
|
158
|
-
//# sourceMappingURL=entities-
|
|
158
|
+
//# sourceMapping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MeasureRequest","mapMeasureResponseOrThrow","ModelEntityUpdate","ModelEntity","BoolValue","UpdateModelEntitiesRequest","Mapper","fromPbVector3f","vertexvis","MeasureEntity","Vector3f"],"sources":["./src/lib/measurement/controller.ts","./src/lib/measurement/entities.ts"],"sourcesContent":["import { ModelEntity } from '@vertexvis/scene-view-protos/core/protos/model_entity_pb';\nimport {\n MeasureRequest,\n MeasureResponse,\n ModelEntityUpdate,\n UpdateModelEntitiesRequest,\n} from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { SceneViewAPIClient } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb_service';\nimport { BoolValue } from 'google-protobuf/google/protobuf/wrappers_pb';\n\nimport { createMetadata, JwtProvider, requestUnary } from '../grpc';\nimport { MeasurementEntity } from './entities';\nimport { mapMeasureResponseOrThrow } from './mapper';\nimport { MeasurementModel } from './model';\nimport { MeasurementOutcome } from './outcomes';\n\n/**\n * The `MeasurementController` is responsible for performing measurements of\n * registered entities, and updating the model with their measurement results.\n */\nexport class MeasurementController {\n private outcome = Promise.resolve<MeasurementOutcome | undefined>(undefined);\n\n public constructor(\n private model: MeasurementModel,\n private client: SceneViewAPIClient,\n private jwtProvider: JwtProvider,\n private deviceId: string | undefined\n ) {}\n\n /**\n * Registers an entity to measure and performs a measurement if this entity\n * has not been previously registered.\n *\n * @param entity The entity to measure.\n * @returns A promise that resolves with the results after registering this\n * entity.\n */\n public addEntity(\n entity: MeasurementEntity\n ): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => this.model.addEntity(entity));\n }\n\n /**\n * Clears all entities and returns a promise that resolves with an empty list\n * of measurement results.\n */\n public clearEntities(): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => {\n this.model.clearEntities();\n this.model.clearOutcome();\n return true;\n });\n }\n\n /**\n * Deregisters an entity and performs a measurement if this entity was\n * removed.\n *\n * @param entity The entity to remove.\n * @returns A promise that resolves with the results after removing this\n * entity.\n */\n public removeEntity(\n entity: MeasurementEntity\n ): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => this.model.removeEntity(entity));\n }\n\n /**\n * Registers a set of entities and performs a measurement\n *\n * @param entities The entities to measure.\n * @returns A promise that resolves with the results after registering these\n * entities.\n */\n public setEntities(\n entities: Set<MeasurementEntity>\n ): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => this.model.setEntities(entities));\n }\n\n private performMeasurement(\n effect: () => boolean\n ): Promise<MeasurementOutcome | undefined> {\n const previous = this.model.getEntities();\n const changed = effect();\n const entities = this.model.getEntities();\n if (changed) {\n this.measureAndUpdateModel(entities);\n this.highlightEntities(previous, entities);\n }\n return this.outcome;\n }\n\n private measureAndUpdateModel(entities: MeasurementEntity[]): void {\n if (entities.length > 0) {\n this.outcome = this.measureEntities(entities).then((outcome) => {\n this.model.setOutcome(outcome);\n return this.model.getOutcome();\n });\n } else {\n this.outcome = Promise.resolve(undefined);\n }\n }\n\n private async measureEntities(\n entities: MeasurementEntity[]\n ): Promise<MeasurementOutcome | undefined> {\n if (entities.length > 0) {\n const res = await requestUnary<MeasureResponse>(async (handler) => {\n const meta = await createMetadata(this.jwtProvider, this.deviceId);\n const req = new MeasureRequest();\n req.setEntitiesList(entities.map((e) => e.toProto()));\n\n this.client.measure(req, meta, handler);\n });\n\n return mapMeasureResponseOrThrow(res.toObject());\n } else {\n return undefined;\n }\n }\n\n private async highlightEntities(\n previous: MeasurementEntity[],\n entities: MeasurementEntity[]\n ): Promise<void> {\n await requestUnary(async (handler) => {\n const meta = await createMetadata(this.jwtProvider, this.deviceId);\n\n const entitySet = new Set(entities);\n const newPrevious = previous.filter((e) => !entitySet.has(e));\n\n const clearEntities = newPrevious.map((e) => {\n const update = new ModelEntityUpdate();\n update.setModelEntity(ModelEntity.deserializeBinary(e.modelEntity));\n update.setHighlight(new BoolValue().setValue(false));\n return update;\n });\n const highlightEntities = entities.map((e) => {\n const update = new ModelEntityUpdate();\n update.setModelEntity(ModelEntity.deserializeBinary(e.modelEntity));\n update.setHighlight(new BoolValue().setValue(true));\n return update;\n });\n\n const req = new UpdateModelEntitiesRequest();\n req.setUpdatesList([...clearEntities, ...highlightEntities]);\n this.client.updateModelEntities(req, meta, handler);\n });\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { Vector3 } from '@vertexvis/geometry';\nimport { Vector3f } from '@vertexvis/scene-view-protos/core/protos/geometry_pb';\nimport { ModelEntity } from '@vertexvis/scene-view-protos/core/protos/model_entity_pb';\nimport { MeasureEntity } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { Mapper } from '@vertexvis/utils';\n\nimport { fromPbVector3f } from '../mappers';\n\nexport class MeasurementEntity {\n public constructor(\n public readonly point: Vector3.Vector3,\n public readonly modelEntity: Uint8Array\n ) {}\n\n public static fromHit(\n hit: vertexvis.protobuf.stream.IHit\n ): MeasurementEntity {\n if (hit.hitPoint != null && hit.modelEntity != null) {\n const hitPoint = Mapper.ifInvalidThrow(fromPbVector3f)(hit.hitPoint);\n const modelEntity = vertexvis.protobuf.core.ModelEntity.encode(\n hit.modelEntity\n ).finish();\n return new MeasurementEntity(hitPoint, modelEntity);\n } else {\n throw new Error(\n 'Cannot create MeasurementEntity from Hit. Hit is missing hit point and model entity'\n );\n }\n }\n\n public toProto(): MeasureEntity {\n const entity = new MeasureEntity();\n\n const point = new Vector3f();\n point.setX(this.point.x);\n point.setY(this.point.y);\n point.setZ(this.point.z);\n entity.setPoint(point);\n\n const modelEntity = ModelEntity.deserializeBinary(this.modelEntity);\n entity.setModelEntity(modelEntity);\n\n return entity;\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"entities-9fad8808.js","mappings":";;;;;;;;;;;;AAgBA;;;;MAIa,qBAAqB;EAGhC,YACU,KAAuB,EACvB,MAA0B,EAC1B,WAAwB,EACxB,QAA4B;IAH5B,UAAK,GAAL,KAAK,CAAkB;IACvB,WAAM,GAAN,MAAM,CAAoB;IAC1B,gBAAW,GA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,CAAC,WAAW,IAAI,IAAI,EAAE;MACnD,MAAM,QAAQ,GAAGC,kBAAM,CAAC,cAAc,CAACC,+BAAc,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;MACrE,MAAM,WAAW,GAAGC,0BAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAC5D,GAAG,CAAC,WAAW,CAChB,CAAC,MAAM,EAAE,CAAC;MACX,OAAO,IAAI,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;KACrD;SAAM;MACL,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF,CAAC;KACH;GACF;EAEM,OAAO;IACZ,MAAM,MAAM,GAAG,IAAIC,iDAAa,EAAE,CAAC;IAEnC,MAAM,KAAK,GAAG,IAAIC,sCAAQ,EAAE,CAAC;IAC7B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEvB,MAAM,WAAW,GAAGP,6CAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpE,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAEnC,OAAO,MAAM,CAAC;GACf;;;;;;","names":["requestUnary","createMetadata","MeasureRequest","mapMeasureResponseOrThrow","ModelEntityUpdate","ModelEntity","BoolValue","UpdateModelEntitiesRequest","Mapper","fromPbVector3f","vertexvis","MeasureEntity","Vector3f"],"sources":["./src/lib/measurement/controller.ts","./src/lib/measurement/entities.ts"],"sourcesContent":["import { ModelEntity } from '@vertexvis/scene-view-protos/core/protos/model_entity_pb';\nimport {\n MeasureRequest,\n MeasureResponse,\n ModelEntityUpdate,\n UpdateModelEntitiesRequest,\n} from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { SceneViewAPIClient } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb_service';\nimport { BoolValue } from 'google-protobuf/google/protobuf/wrappers_pb';\n\nimport { createMetadata, JwtProvider, requestUnary } from '../grpc';\nimport { MeasurementEntity } from './entities';\nimport { mapMeasureResponseOrThrow } from './mapper';\nimport { MeasurementModel } from './model';\nimport { MeasurementOutcome } from './outcomes';\n\n/**\n * The `MeasurementController` is responsible for performing measurements of\n * registered entities, and updating the model with their measurement results.\n */\nexport class MeasurementController {\n private outcome = Promise.resolve<MeasurementOutcome | undefined>(undefined);\n\n public constructor(\n private model: MeasurementModel,\n private client: SceneViewAPIClient,\n private jwtProvider: JwtProvider,\n private deviceId: string | undefined\n ) {}\n\n /**\n * Registers an entity to measure and performs a measurement if this entity\n * has not been previously registered.\n *\n * @param entity The entity to measure.\n * @returns A promise that resolves with the results after registering this\n * entity.\n */\n public addEntity(\n entity: MeasurementEntity\n ): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => this.model.addEntity(entity));\n }\n\n /**\n * Clears all entities and returns a promise that resolves with an empty list\n * of measurement results.\n */\n public clearEntities(): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => {\n this.model.clearEntities();\n this.model.clearOutcome();\n return true;\n });\n }\n\n /**\n * Deregisters an entity and performs a measurement if this entity was\n * removed.\n *\n * @param entity The entity to remove.\n * @returns A promise that resolves with the results after removing this\n * entity.\n */\n public removeEntity(\n entity: MeasurementEntity\n ): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => this.model.removeEntity(entity));\n }\n\n /**\n * Registers a set of entities and performs a measurement\n *\n * @param entities The entities to measure.\n * @returns A promise that resolves with the results after registering these\n * entities.\n */\n public setEntities(\n entities: Set<MeasurementEntity>\n ): Promise<MeasurementOutcome | undefined> {\n return this.performMeasurement(() => this.model.setEntities(entities));\n }\n\n private performMeasurement(\n effect: () => boolean\n ): Promise<MeasurementOutcome | undefined> {\n const previous = this.model.getEntities();\n const changed = effect();\n const entities = this.model.getEntities();\n if (changed) {\n this.measureAndUpdateModel(entities);\n this.highlightEntities(previous, entities);\n }\n return this.outcome;\n }\n\n private measureAndUpdateModel(entities: MeasurementEntity[]): void {\n if (entities.length > 0) {\n this.outcome = this.measureEntities(entities).then((outcome) => {\n this.model.setOutcome(outcome);\n return this.model.getOutcome();\n });\n } else {\n this.outcome = Promise.resolve(undefined);\n }\n }\n\n private async measureEntities(\n entities: MeasurementEntity[]\n ): Promise<MeasurementOutcome | undefined> {\n if (entities.length > 0) {\n const res = await requestUnary<MeasureResponse>(async (handler) => {\n const meta = await createMetadata(this.jwtProvider, this.deviceId);\n const req = new MeasureRequest();\n req.setEntitiesList(entities.map((e) => e.toProto()));\n\n this.client.measure(req, meta, handler);\n });\n\n return mapMeasureResponseOrThrow(res.toObject());\n } else {\n return undefined;\n }\n }\n\n private async highlightEntities(\n previous: MeasurementEntity[],\n entities: MeasurementEntity[]\n ): Promise<void> {\n await requestUnary(async (handler) => {\n const meta = await createMetadata(this.jwtProvider, this.deviceId);\n\n const entitySet = new Set(entities);\n const newPrevious = previous.filter((e) => !entitySet.has(e));\n\n const clearEntities = newPrevious.map((e) => {\n const update = new ModelEntityUpdate();\n update.setModelEntity(ModelEntity.deserializeBinary(e.modelEntity));\n update.setHighlight(new BoolValue().setValue(false));\n return update;\n });\n const highlightEntities = entities.map((e) => {\n const update = new ModelEntityUpdate();\n update.setModelEntity(ModelEntity.deserializeBinary(e.modelEntity));\n update.setHighlight(new BoolValue().setValue(true));\n return update;\n });\n\n const req = new UpdateModelEntitiesRequest();\n req.setUpdatesList([...clearEntities, ...highlightEntities]);\n this.client.updateModelEntities(req, meta, handler);\n });\n }\n}\n","import { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { Vector3 } from '@vertexvis/geometry';\nimport { Vector3f } from '@vertexvis/scene-view-protos/core/protos/geometry_pb';\nimport { ModelEntity } from '@vertexvis/scene-view-protos/core/protos/model_entity_pb';\nimport { MeasureEntity } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { Mapper } from '@vertexvis/utils';\n\nimport { fromPbVector3f } from '../mappers';\n\nexport class MeasurementEntity {\n public constructor(\n public readonly point: Vector3.Vector3,\n public readonly modelEntity: Uint8Array\n ) {}\n\n public static fromHit(\n hit: vertexvis.protobuf.stream.IHit\n ): MeasurementEntity {\n if (hit.hitPoint != null && hit.modelEntity != null) {\n const hitPoint = Mapper.ifInvalidThrow(fromPbVector3f)(hit.hitPoint);\n const modelEntity = vertexvis.protobuf.core.ModelEntity.encode(\n hit.modelEntity\n ).finish();\n return new MeasurementEntity(hitPoint, modelEntity);\n } else {\n throw new Error(\n 'Cannot create MeasurementEntity from Hit. Hit is missing hit point and model entity'\n );\n }\n }\n\n public toProto(): MeasureEntity {\n const entity = new MeasureEntity();\n\n const point = new Vector3f();\n point.setX(this.point.x);\n point.setY(this.point.y);\n point.setZ(this.point.z);\n entity.setPoint(point);\n\n const modelEntity = ModelEntity.deserializeBinary(this.modelEntity);\n entity.setModelEntity(modelEntity);\n\n return entity;\n }\n}\n"],"version":3}
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
|
-
const queries = require('./queries-
|
|
8
|
+
const queries = require('./queries-ea895dd6.js');
|
|
9
9
|
const controller = require('./controller-7da371a2.js');
|
|
10
10
|
const row = require('./row-1dcf2c04.js');
|
|
11
11
|
const cursors = require('./cursors-c6212c17.js');
|
|
12
|
-
const entities$1 = require('./entities-
|
|
12
|
+
const entities$1 = require('./entities-9fad8808.js');
|
|
13
13
|
const model = require('./model-b1705d4f.js');
|
|
14
14
|
const overlays = require('./overlays-1c1d6a76.js');
|
|
15
15
|
const results = require('./results-c67d973f.js');
|
|
@@ -24,9 +24,9 @@ require('./browser.esm-13ce8652.js');
|
|
|
24
24
|
require('./errors-696d9931.js');
|
|
25
25
|
require('./_commonjsHelpers-756e53d6.js');
|
|
26
26
|
require('./wrappers_pb-1f2f4854.js');
|
|
27
|
-
require('./scene_view_api_pb-
|
|
27
|
+
require('./scene_view_api_pb-61f663af.js');
|
|
28
28
|
require('./grpc-c3531bf5.js');
|
|
29
|
-
require('./mapper-
|
|
29
|
+
require('./mapper-ac34f608.js');
|
|
30
30
|
require('./bundle.esm-7a14b751.js');
|
|
31
31
|
require('./mapper-84dac749.js');
|
|
32
32
|
|
|
@@ -107,6 +107,7 @@ exports.ColorMaterial = queries.colorMaterial;
|
|
|
107
107
|
exports.CrossSectioner = queries.CrossSectioner;
|
|
108
108
|
exports.LoadableResource = queries.loadableResource;
|
|
109
109
|
exports.ModelViewController = queries.ModelViewController;
|
|
110
|
+
exports.PmiController = queries.PmiController;
|
|
110
111
|
exports.Raycaster = queries.Raycaster;
|
|
111
112
|
exports.RootQuery = queries.RootQuery;
|
|
112
113
|
exports.Scene = queries.Scene;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,UAAU,GAAG,MAAM,CAAC;AAEjC;;;;;;SAMgB,6BAA6B,CAC3C,IAAqB;EAErB,MAAM,oBAAoB,GAAGA,kBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;EAChE,MAAM,oBAAoB,GAAGA,kBAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;EAEhE,MAAM,YAAY,GAChBA,kBAAO,CAAC,gBAAgB,CAAC,oBAAoB,CAAC;IAC9CA,kBAAO,CAAC,gBAAgB,CAAC,oBAAoB,CAAC;MAC1C,oBAAoB;MACpB,oBA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,EAAE;IAC3B,OAAOA,kBAAO,CAAC,YAAY,EAAE,CAAC;GAC/B;;OAEI;IACH,MAAM,KAAK,GAAGF,kBAAO,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,aAAa,GAAGA,kBAAO,CAAC,SAAS,CAACA,kBAAO,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACzE,OAAOE,kBAAO,CAAC,YAAY,CACzBD,qBAAU,CAAC,aAAa,CAAC,aAAa,EAAE,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,CACzD,CAAC;GACH;AACH,CAAC;AAED;;;;;;;;;;;;;SAagB,0BAA0B,CACxC,OAAwB,EACxB,SAA0B,EAC1B,OAAwB,EACxB,SAA0B;EAE1B,MAAM,cAAc,GAAG,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;EAE/D,MAAM,sBAAsB,GAAGC,kBAAO,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;EAClE,OAAOA,kBAAO,CAAC,QAAQ,CACrBA,kBAAO,CAAC,QAAQ,CAAC,sBAAsB,EAAE,cAAc,CAAC,EACxDA,kBAAO,CAAC,eAAe,CAACF,kBAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CACnD,CAAC;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["Vector3","Quaternion","Matrix4"],"sources":["./src/lib/transforms/transformation-delta.ts"],"sourcesContent":["import { Matrix4, Quaternion, Vector3 } from '@vertexvis/geometry';\n\nexport const ALMOST_ONE = 0.9999;\n\n/**\n * For any single normal vector, there are an infinite number of potential orthogonal vectors. This function will\n * calculate a single vector evaluating the length of two candidates, and picking the one with the higher squared magnitude\n * @param normal\n * @returns\n */\nexport function calculateOrthogonalCoordinate(\n norm: Vector3.Vector3\n): Vector3.Vector3 {\n const orthogonalCandidate0 = Vector3.create(0, norm.z, -norm.y);\n const orthogonalCandidate1 = Vector3.create(-norm.z, 0, norm.x);\n\n const theChosenOne =\n Vector3.magnitudeSquared(orthogonalCandidate0) >\n Vector3.magnitudeSquared(orthogonalCandidate1)\n ? orthogonalCandidate0\n : orthogonalCandidate1;\n\n return Vector3.normalize(Vector3.cross(norm, theChosenOne));\n}\n\n/**\n * Computes the rotation matrix for two normals. If both normals are neither parallel or anti-parallel,\n * this will compute the rotation matrix delta based on the angle from both normals.\n * If the normals are anti-parallel, the identity matrix will be returned, as no rotation is necessary in this case.\n * If the normals are parallel, an axis direction based on a chosen orthogonal vector will be used\n * to compute the rotation matrix to rotate the plane 180 degrees.\n * @param normal1\n * @param normal2\n * @returns an anti-parallel rotation Matrix4 betwen the given normals\n */\nexport function computeRotationMatrix(\n normal1: Vector3.Vector3,\n normal2: Vector3.Vector3\n): Matrix4.Matrix4 {\n const dot = Vector3.dot(normal1, normal2);\n // the angle is almost 0 in this case.\n if (dot > ALMOST_ONE) {\n const axisDirection = calculateOrthogonalCoordinate(normal1);\n\n const quaternion = Quaternion.fromAxisAngle(axisDirection, Math.PI);\n return Matrix4.makeRotation(quaternion);\n }\n // the angle is almost 180 in this case.\n else if (dot <= -ALMOST_ONE) {\n return Matrix4.makeIdentity();\n }\n // the angle is between 0 & 180\n else {\n const angle = Vector3.angleTo(normal2, normal1);\n const axisDirection = Vector3.normalize(Vector3.cross(normal1, normal2));\n return Matrix4.makeRotation(\n Quaternion.fromAxisAngle(axisDirection, angle + Math.PI)\n );\n }\n}\n\n/**\n * Computes the translation & rotation matrix delta between two world positions and two normals.\n * such that the computed translation matrix will be the delta between position 1 and position 2,\n * and the rotation will be rotated to be anti-parallel.\n *\n * @param normal1\n * @param position1\n * @param normal2\n * @param position2\n *\n * @returns Matrix4 translation matrix delta from position1 to\n * position2 & an anti-parallel rotation delta.\n */\nexport function computeTransformationDelta(\n normal1: Vector3.Vector3,\n position1: Vector3.Vector3,\n normal2: Vector3.Vector3,\n position2: Vector3.Vector3\n): Matrix4.Matrix4 {\n const rotationMatrix = computeRotationMatrix(normal1, normal2);\n\n const translationDeltaMatrix = Matrix4.makeTranslation(position2);\n return Matrix4.multiply(\n Matrix4.multiply(translationDeltaMatrix, rotationMatrix),\n Matrix4.makeTranslation(Vector3.negate(position1))\n );\n}\n"],"version":3}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -20,7 +20,7 @@ const defineCustomElements = (win, options) => {
|
|
|
20
20
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
21
21
|
return patchEsm().then(() => {
|
|
22
22
|
appGlobals.globalScripts();
|
|
23
|
-
return index.bootstrapLazy(JSON.parse("[[\"vertex-viewer-pin-tool.cjs\",[[1,\"vertex-viewer-pin-tool\",{\"pinController\":[1040],\"pinModel\":[16],\"viewer\":[16],\"tool\":[1025],\"mode\":[1025],\"primaryColor\":[1025,\"primary-color\"],\"accentColor\":[1025,\"accent-color\"],\"pins\":[32],\"selectedPinId\":[32],\"elementBounds\":[32],\"projectionViewMatrix\":[32]}]]],[\"vertex-scene-tree.cjs\",[[1,\"vertex-scene-tree\",{\"overScanCount\":[2,\"over-scan-count\"],\"viewerSelector\":[1,\"viewer-selector\"],\"viewer\":[1040],\"rowData\":[16],\"config\":[1],\"configEnv\":[1,\"config-env\"],\"controller\":[1040],\"searchOptions\":[1040],\"metadataSearchExactMatch\":[1028,\"metadata-search-exact-match\"],\"metadataSearchKeys\":[1040],\"metadataKeys\":[16],\"rows\":[32],\"totalRows\":[32],\"showLoader\":[32],\"showEmptyResults\":[32],\"stateMap\":[32],\"errorDetails\":[32],\"attemptingRetry\":[32],\"invalidateRows\":[64],\"scrollToIndex\":[64],\"scrollToItem\":[64],\"expandAll\":[64],\"collapseAll\":[64],\"expandItem\":[64],\"collapseItem\":[64],\"toggleExpandItem\":[64],\"toggleItemVisibility\":[64],\"hideItem\":[64],\"showItem\":[64],\"selectItem\":[64],\"deselectItem\":[64],\"getRowAtIndex\":[64],\"getRowForEvent\":[64],\"getRowAtClientY\":[64],\"filterItems\":[64],\"selectFilteredItems\":[64],\"fetchMetadataKeys\":[64]},[[0,\"search\",\"handleSearch\"],[0,\"cellLoaded\",\"handleCellLoaded\"]]]]],[\"vertex-viewer-default-toolbar.cjs\",[[1,\"vertex-viewer-default-toolbar\",{\"viewer\":[16],\"placement\":[1],\"direction\":[1],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"]}]]],[\"vertex-viewer-markup.cjs\",[[1,\"vertex-viewer-markup\",{\"arrowTemplateId\":[1,\"arrow-template-id\"],\"circleTemplateId\":[1,\"circle-template-id\"],\"freeformTemplateId\":[1,\"freeform-template-id\"],\"tool\":[1],\"disabled\":[4],\"viewer\":[16],\"selectedMarkupId\":[1025,\"selected-markup-id\"],\"selectNew\":[4,\"select-new\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"toSelectMarkupId\":[32],\"pointerDownPosition\":[32],\"addMarkup\":[64],\"removeMarkup\":[64],\"getMarkupElements\":[64],\"getMarkupElement\":[64]},[[0,\"markupEnd\",\"handleMarkupEnd\"],[0,\"interactionEnd\",\"handleMarkupUpdated\"],[1,\"pointerdown\",\"handleMarkupPointerDown\"]]]]],[\"vertex-viewer-markup-tool.cjs\",[[1,\"vertex-viewer-markup-tool\",{\"arrowTemplateId\":[1,\"arrow-template-id\"],\"circleTemplateId\":[1,\"circle-template-id\"],\"freeformTemplateId\":[1,\"freeform-template-id\"],\"tool\":[1],\"disabled\":[4],\"viewer\":[16],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"stateMap\":[32],\"reset\":[64]}]]],[\"vertex-viewer-view-cube.cjs\",[[1,\"vertex-viewer-view-cube\",{\"xPositiveLabel\":[1,\"x-positive-label\"],\"xNegativeLabel\":[1,\"x-negative-label\"],\"yPositiveLabel\":[1,\"y-positive-label\"],\"yNegativeLabel\":[1,\"y-negative-label\"],\"zPositiveLabel\":[1,\"z-positive-label\"],\"zNegativeLabel\":[1,\"z-negative-label\"],\"standardViewsOff\":[4,\"standard-views-off\"],\"viewAll\":[4,\"view-all\"],\"animationDuration\":[2,\"animation-duration\"],\"triadOff\":[4,\"triad-off\"],\"worldOrientation\":[1040],\"camera\":[1040],\"viewer\":[16],\"boxLength\":[32],\"triadPosition\":[32]}]]],[\"vertex-viewer-measurement-distance.cjs\",[[1,\"vertex-viewer-measurement-distance\",{\"start\":[1040],\"startJson\":[1,\"start-json\"],\"end\":[1040],\"endJson\":[1,\"end-json\"],\"distance\":[1026],\"showAxisReferenceLines\":[4,\"show-axis-reference-lines\"],\"snapDistance\":[2,\"snap-distance\"],\"units\":[1],\"fractionalDigits\":[2,\"fractional-digits\"],\"labelFormatter\":[16],\"anchorLabelOffset\":[2,\"anchor-label-offset\"],\"lineCapLength\":[2,\"line-cap-length\"],\"mode\":[513],\"interactingAnchor\":[1537,\"interacting-anchor\"],\"invalid\":[1540],\"camera\":[16],\"hitProvider\":[16],\"indicatorPt\":[1040],\"viewer\":[16],\"measurementModel\":[16],\"viewport\":[32],\"elementBounds\":[32],\"interactionCount\":[32],\"internalCamera\":[32],\"invalidateStateCounter\":[32],\"stateMap\":[32],\"measurementUnits\":[32],\"computeElementMetrics\":[64]}]]],[\"vertex-viewer-measurement-precise.cjs\",[[1,\"vertex-viewer-measurement-precise\",{\"measurementModel\":[16],\"measurementOverlays\":[16],\"measurementController\":[1040],\"measurableEntityTypes\":[16],\"viewer\":[16],\"configEnv\":[1,\"config-env\"],\"config\":[1]}]]],[\"vertex-viewer-annotation-callout.cjs\",[[1,\"vertex-viewer-annotation-callout\",{\"data\":[16],\"iconSize\":[1,\"icon-size\"]}]]],[\"vertex-viewer-box-query-tool.cjs\",[[1,\"vertex-viewer-box-query-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"operationType\":[1,\"operation-type\"],\"mode\":[1],\"details\":[32]}]]],[\"vertex-viewer-walk-mode-tool.cjs\",[[1,\"vertex-viewer-walk-mode-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"teleportMode\":[1,\"teleport-mode\"],\"enabled\":[4]}]]],[\"vertex-scene-tree-table-cell.cjs\",[[1,\"vertex-scene-tree-table-cell\",{\"node\":[16],\"tree\":[16],\"value\":[1],\"placeholder\":[1],\"hovered\":[1028],\"isScrolling\":[4,\"is-scrolling\"],\"expandToggle\":[4,\"expand-toggle\"],\"visibilityToggle\":[4,\"visibility-toggle\"],\"selectionHandler\":[16],\"visibilityHandler\":[16],\"expansionHandler\":[16],\"hoverController\":[16]}]]],[\"vertex-scene-tree-table-column.cjs\",[[1,\"vertex-scene-tree-table-column\",{\"initialWidth\":[2,\"initial-width\"],\"minWidth\":[2,\"min-width\"],\"maxWidth\":[2,\"max-width\"]}]]],[\"vertex-scene-tree-table-header.cjs\",[[1,\"vertex-scene-tree-table-header\"]]],[\"vertex-scene-tree-table-resize-divider.cjs\",[[1,\"vertex-scene-tree-table-resize-divider\",{\"dragging\":[32]}]]],[\"vertex-scene-tree-toolbar-group.cjs\",[[1,\"vertex-scene-tree-toolbar-group\"]]],[\"vertex-viewer.cjs\",[[1,\"vertex-viewer\",{\"src\":[1],\"clientId\":[1,\"client-id\"],\"deviceId\":[1025,\"device-id\"],\"config\":[1],\"configEnv\":[1,\"config-env\"],\"resolvedConfig\":[1040],\"cameraControls\":[4,\"camera-controls\"],\"cameraType\":[1537,\"camera-type\"],\"keyboardControls\":[4,\"keyboard-controls\"],\"rotateAroundTapPoint\":[4,\"rotate-around-tap-point\"],\"token\":[1025],\"depthBuffers\":[1,\"depth-buffers\"],\"phantom\":[16],\"noDefaultLights\":[4,\"no-default-lights\"],\"enableTemporalRefinement\":[4,\"enable-temporal-refinement\"],\"experimentalRenderingOptions\":[1,\"experimental-rendering-options\"],\"featureLines\":[16],\"selectionHighlighting\":[16],\"featureHighlighting\":[16],\"sceneComparison\":[16],\"featureMaps\":[1,\"feature-maps\"],\"resizeDebounce\":[2,\"resize-debounce\"],\"frame\":[1040],\"stream\":[1040],\"stencilBuffer\":[1040],\"viewport\":[1040],\"annotations\":[1040],\"modelViews\":[1040],\"dimensions\":[32],\"hostDimensions\":[32],\"errorMessage\":[32],\"cursor\":[32],\"stateMap\":[32],\"dispatchFrameDrawn\":[64],\"registerInteractionHandler\":[64],\"registerTapKeyInteraction\":[64],\"getInteractionTarget_DEPRECATED\":[64],\"addCursor\":[64],\"getInteractionHandlers\":[64],\"getKeyInteractions\":[64],\"getBaseInteractionHandler\":[64],\"getJwt\":[64],\"load\":[64],\"unload\":[64],\"scene\":[64],\"isSceneReady\":[64]},[[0,\"tap\",\"handleTapEvent\"]]]]],[\"vertex-viewer-hit-result-indicator.cjs\",[[1,\"vertex-viewer-hit-result-indicator\",{\"viewer\":[16],\"position\":[1040],\"normal\":[1040]}]]],[\"vertex-viewer-measurement-details.cjs\",[[1,\"vertex-viewer-measurement-details\",{\"measurementModel\":[16],\"measurementOverlays\":[16],\"measurementOutcome\":[1040],\"distanceUnits\":[1,\"distance-units\"],\"angleUnits\":[1,\"angle-units\"],\"fractionalDigits\":[2,\"fractional-digits\"],\"distanceFormatter\":[16],\"angleFormatter\":[16],\"areaFormatter\":[16],\"resultTypes\":[16],\"overlay\":[32],\"distanceMeasurementUnits\":[32],\"angleMeasurementUnits\":[32],\"areaMeasurementUnits\":[32]}]]],[\"vertex-viewer-transform-widget.cjs\",[[1,\"vertex-viewer-transform-widget\",{\"viewer\":[16],\"position\":[1040],\"rotation\":[1040],\"controller\":[1040],\"xRotationDisabled\":[1028,\"x-rotation-disabled\"],\"yRotationDisabled\":[1028,\"y-rotation-disabled\"],\"zRotationDisabled\":[1028,\"z-rotation-disabled\"],\"xTranslationDisabled\":[1028,\"x-translation-disabled\"],\"yTranslationDisabled\":[1028,\"y-translation-disabled\"],\"zTranslationDisabled\":[1028,\"z-translation-disabled\"],\"showInputs\":[4,\"show-inputs\"],\"distanceUnit\":[1,\"distance-unit\"],\"angleUnit\":[1,\"angle-unit\"],\"decimalPlaces\":[2,\"decimal-places\"],\"EXPERIMENTAL_undoKeybindings\":[4,\"e-x-p-e-r-i-m-e-n-t-a-l_undo-keybindings\"],\"hovered\":[1040],\"inputPosition\":[32],\"inputValue\":[32],\"isEndingTransform\":[32],\"inputShouldFocus\":[32],\"EXPERIMENTAL_undo\":[64]}]]],[\"vertex-viewer-pin-group.cjs\",[[0,\"vertex-viewer-pin-group\",{\"pin\":[16],\"matrix\":[1040],\"projectionViewMatrix\":[16],\"elementBounds\":[1040],\"pinModel\":[16],\"pinController\":[16],\"selected\":[4],\"occluded\":[1540],\"detached\":[1540],\"invalidateStateCounter\":[32]},[[0,\"occlusionStateChanged\",\"handleOcclusionStateChanged\"],[0,\"detachedStateChanged\",\"handleDetachedStateChanged\"]]]]],[\"vertex-viewer-dom-group.cjs\",[[6,\"vertex-viewer-dom-group\",{\"position\":[1040],\"positionJson\":[1,\"position\"],\"rotation\":[1040],\"rotationJson\":[1,\"rotation\"],\"quaternion\":[1040],\"quaternionJson\":[1,\"quaternion\"],\"scale\":[1040],\"scaleJson\":[1,\"scale\"],\"matrix\":[1040]}]]],[\"vertex-viewer-teleport-tool.cjs\",[[1,\"vertex-viewer-teleport-tool\",{\"viewer\":[16],\"mode\":[1025],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"],\"controller\":[1040],\"model\":[1040]}]]],[\"vertex-viewer-spinner.cjs\",[[1,\"vertex-viewer-spinner\",{\"size\":[1]}]]],[\"vertex-scene-tree-search_3.cjs\",[[1,\"vertex-scene-tree-search\",{\"debounce\":[2],\"disabled\":[4],\"placeholder\":[1],\"controller\":[16],\"value\":[1025],\"focused\":[32],\"isSearching\":[32],\"setFocus\":[64],\"clear\":[64]}],[1,\"vertex-scene-tree-table-layout\",{\"tree\":[16],\"controller\":[16],\"rows\":[16],\"totalRows\":[2,\"total-rows\"],\"rowHeight\":[1026,\"row-height\"],\"overScanCount\":[2,\"over-scan-count\"],\"rowData\":[16],\"layoutOffset\":[1026,\"layout-offset\"],\"scrollOffset\":[1026,\"scroll-offset\"],\"layoutHeight\":[1026,\"layout-height\"],\"layoutWidth\":[1026,\"layout-width\"],\"viewportStartIndex\":[1026,\"viewport-start-index\"],\"viewportEndIndex\":[1026,\"viewport-end-index\"],\"columnGridLayout\":[32],\"columnGridFixedLayout\":[32],\"isComputingCellHeight\":[32],\"lastDividerPointerPosition\":[32],\"resizingColumnIndex\":[32],\"isScrolling\":[32],\"scrollTimer\":[32],\"stateMap\":[32],\"scrollToPosition\":[64]}],[1,\"vertex-scene-tree-toolbar\"]]],[\"vertex-viewer-layer.cjs\",[[1,\"vertex-viewer-layer\",{\"stretchOff\":[516,\"stretch-off\"]}]]],[\"vertex-viewer-button_3.cjs\",[[1,\"vertex-viewer-toolbar\",{\"placement\":[1],\"direction\":[1]}],[1,\"vertex-viewer-button\"],[1,\"vertex-viewer-toolbar-group\",{\"direction\":[1]}]]],[\"vertex-viewer-pin-label_2.cjs\",[[0,\"vertex-viewer-pin-label\",{\"pin\":[16],\"elementBounds\":[16],\"value\":[1025],\"pinController\":[16],\"focused\":[32],\"computedScreenPosition\":[32],\"textareaRows\":[32],\"contentElBounds\":[32],\"setFocus\":[64],\"submit\":[64]}],[0,\"vertex-viewer-pin-label-line\",{\"pinPoint\":[16],\"labelPoint\":[16],\"pin\":[16]}]]],[\"vertex-viewer-measurement-line_2.cjs\",[[1,\"vertex-viewer-measurement-overlays\",{\"measurementOverlays\":[16],\"camera\":[1040],\"viewer\":[16],\"overlays\":[32]}],[1,\"vertex-viewer-measurement-line\",{\"start\":[16],\"end\":[16],\"capLength\":[2,\"cap-length\"],\"pointerEvents\":[1,\"pointer-events\"]}]]],[\"vertex-viewer-dom-element_2.cjs\",[[6,\"vertex-viewer-dom-renderer\",{\"drawMode\":[1,\"draw-mode\"],\"propagateEventsToViewer\":[4,\"propagate-events-to-viewer\"],\"viewer\":[16],\"camera\":[1040],\"depthBuffer\":[1040],\"viewport\":[32],\"invalidateFrameCounter\":[32],\"interactionDisposables\":[32]},[[0,\"propertyChange\",\"handlePropertyChange\"]]],[1,\"vertex-viewer-dom-element\",{\"position\":[1040],\"positionJson\":[1,\"position\"],\"rotation\":[1040],\"rotationJson\":[1,\"rotation\"],\"quaternion\":[1040],\"quaternionJson\":[1,\"quaternion\"],\"scale\":[1040],\"scaleJson\":[1,\"scale\"],\"matrix\":[1040],\"occlusionOff\":[4,\"occlusion-off\"],\"occluded\":[516],\"detachedOff\":[4,\"detached-off\"],\"detached\":[516],\"billboardOff\":[4,\"billboard-off\"],\"interactionsOff\":[516,\"interactions-off\"]}]]],[\"vertex-viewer-markup-arrow_3.cjs\",[[1,\"vertex-viewer-markup-arrow\",{\"start\":[1040],\"startJson\":[1,\"start\"],\"end\":[1040],\"endJson\":[1,\"end\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"mode\":[513],\"viewer\":[16],\"elementBounds\":[32],\"dispose\":[64]}],[1,\"vertex-viewer-markup-circle\",{\"bounds\":[1040],\"boundsJson\":[1,\"bounds\"],\"mode\":[513],\"viewer\":[16],\"elementBounds\":[32],\"dispose\":[64]}],[1,\"vertex-viewer-markup-freeform\",{\"points\":[1040],\"pointsJson\":[1,\"points\"],\"bounds\":[1040],\"boundsJson\":[1,\"bounds\"],\"mode\":[513],\"viewer\":[16],\"elementBounds\":[32],\"screenPoints\":[32],\"dispose\":[64]}]]],[\"vertex-viewer-icon.cjs\",[[1,\"vertex-viewer-icon\",{\"name\":[1],\"size\":[1]}]]]]"), options);
|
|
23
|
+
return index.bootstrapLazy(JSON.parse("[[\"vertex-viewer-pin-tool.cjs\",[[1,\"vertex-viewer-pin-tool\",{\"pinController\":[1040],\"pinModel\":[16],\"viewer\":[16],\"tool\":[1025],\"mode\":[1025],\"primaryColor\":[1025,\"primary-color\"],\"accentColor\":[1025,\"accent-color\"],\"pins\":[32],\"selectedPinId\":[32],\"elementBounds\":[32],\"projectionViewMatrix\":[32]}]]],[\"vertex-scene-tree.cjs\",[[1,\"vertex-scene-tree\",{\"overScanCount\":[2,\"over-scan-count\"],\"viewerSelector\":[1,\"viewer-selector\"],\"viewer\":[1040],\"rowData\":[16],\"config\":[1],\"configEnv\":[1,\"config-env\"],\"controller\":[1040],\"searchOptions\":[1040],\"metadataSearchExactMatch\":[1028,\"metadata-search-exact-match\"],\"metadataSearchKeys\":[1040],\"metadataKeys\":[16],\"rows\":[32],\"totalRows\":[32],\"showLoader\":[32],\"showEmptyResults\":[32],\"stateMap\":[32],\"errorDetails\":[32],\"attemptingRetry\":[32],\"invalidateRows\":[64],\"scrollToIndex\":[64],\"scrollToItem\":[64],\"expandAll\":[64],\"collapseAll\":[64],\"expandItem\":[64],\"collapseItem\":[64],\"toggleExpandItem\":[64],\"toggleItemVisibility\":[64],\"hideItem\":[64],\"showItem\":[64],\"selectItem\":[64],\"deselectItem\":[64],\"getRowAtIndex\":[64],\"getRowForEvent\":[64],\"getRowAtClientY\":[64],\"filterItems\":[64],\"selectFilteredItems\":[64],\"fetchMetadataKeys\":[64]},[[0,\"search\",\"handleSearch\"],[0,\"cellLoaded\",\"handleCellLoaded\"]]]]],[\"vertex-viewer-default-toolbar.cjs\",[[1,\"vertex-viewer-default-toolbar\",{\"viewer\":[16],\"placement\":[1],\"direction\":[1],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"]}]]],[\"vertex-viewer-markup.cjs\",[[1,\"vertex-viewer-markup\",{\"arrowTemplateId\":[1,\"arrow-template-id\"],\"circleTemplateId\":[1,\"circle-template-id\"],\"freeformTemplateId\":[1,\"freeform-template-id\"],\"tool\":[1],\"disabled\":[4],\"viewer\":[16],\"selectedMarkupId\":[1025,\"selected-markup-id\"],\"selectNew\":[4,\"select-new\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"toSelectMarkupId\":[32],\"pointerDownPosition\":[32],\"addMarkup\":[64],\"removeMarkup\":[64],\"getMarkupElements\":[64],\"getMarkupElement\":[64]},[[0,\"markupEnd\",\"handleMarkupEnd\"],[0,\"interactionEnd\",\"handleMarkupUpdated\"],[1,\"pointerdown\",\"handleMarkupPointerDown\"]]]]],[\"vertex-viewer-markup-tool.cjs\",[[1,\"vertex-viewer-markup-tool\",{\"arrowTemplateId\":[1,\"arrow-template-id\"],\"circleTemplateId\":[1,\"circle-template-id\"],\"freeformTemplateId\":[1,\"freeform-template-id\"],\"tool\":[1],\"disabled\":[4],\"viewer\":[16],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"stateMap\":[32],\"reset\":[64]}]]],[\"vertex-viewer-view-cube.cjs\",[[1,\"vertex-viewer-view-cube\",{\"xPositiveLabel\":[1,\"x-positive-label\"],\"xNegativeLabel\":[1,\"x-negative-label\"],\"yPositiveLabel\":[1,\"y-positive-label\"],\"yNegativeLabel\":[1,\"y-negative-label\"],\"zPositiveLabel\":[1,\"z-positive-label\"],\"zNegativeLabel\":[1,\"z-negative-label\"],\"standardViewsOff\":[4,\"standard-views-off\"],\"viewAll\":[4,\"view-all\"],\"animationDuration\":[2,\"animation-duration\"],\"triadOff\":[4,\"triad-off\"],\"worldOrientation\":[1040],\"camera\":[1040],\"viewer\":[16],\"boxLength\":[32],\"triadPosition\":[32]}]]],[\"vertex-viewer-measurement-distance.cjs\",[[1,\"vertex-viewer-measurement-distance\",{\"start\":[1040],\"startJson\":[1,\"start-json\"],\"end\":[1040],\"endJson\":[1,\"end-json\"],\"distance\":[1026],\"showAxisReferenceLines\":[4,\"show-axis-reference-lines\"],\"snapDistance\":[2,\"snap-distance\"],\"units\":[1],\"fractionalDigits\":[2,\"fractional-digits\"],\"labelFormatter\":[16],\"anchorLabelOffset\":[2,\"anchor-label-offset\"],\"lineCapLength\":[2,\"line-cap-length\"],\"mode\":[513],\"interactingAnchor\":[1537,\"interacting-anchor\"],\"invalid\":[1540],\"camera\":[16],\"hitProvider\":[16],\"indicatorPt\":[1040],\"viewer\":[16],\"measurementModel\":[16],\"viewport\":[32],\"elementBounds\":[32],\"interactionCount\":[32],\"internalCamera\":[32],\"invalidateStateCounter\":[32],\"stateMap\":[32],\"measurementUnits\":[32],\"computeElementMetrics\":[64]}]]],[\"vertex-viewer-measurement-precise.cjs\",[[1,\"vertex-viewer-measurement-precise\",{\"measurementModel\":[16],\"measurementOverlays\":[16],\"measurementController\":[1040],\"measurableEntityTypes\":[16],\"viewer\":[16],\"configEnv\":[1,\"config-env\"],\"config\":[1]}]]],[\"vertex-viewer-annotation-callout.cjs\",[[1,\"vertex-viewer-annotation-callout\",{\"data\":[16],\"iconSize\":[1,\"icon-size\"]}]]],[\"vertex-viewer-box-query-tool.cjs\",[[1,\"vertex-viewer-box-query-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"operationType\":[1,\"operation-type\"],\"mode\":[1],\"details\":[32]}]]],[\"vertex-viewer-walk-mode-tool.cjs\",[[1,\"vertex-viewer-walk-mode-tool\",{\"viewer\":[16],\"controller\":[1040],\"model\":[1040],\"teleportMode\":[1,\"teleport-mode\"],\"enabled\":[4]}]]],[\"vertex-scene-tree-table-cell.cjs\",[[1,\"vertex-scene-tree-table-cell\",{\"node\":[16],\"tree\":[16],\"value\":[1],\"placeholder\":[1],\"hovered\":[1028],\"isScrolling\":[4,\"is-scrolling\"],\"expandToggle\":[4,\"expand-toggle\"],\"visibilityToggle\":[4,\"visibility-toggle\"],\"selectionHandler\":[16],\"visibilityHandler\":[16],\"expansionHandler\":[16],\"hoverController\":[16]}]]],[\"vertex-scene-tree-table-column.cjs\",[[1,\"vertex-scene-tree-table-column\",{\"initialWidth\":[2,\"initial-width\"],\"minWidth\":[2,\"min-width\"],\"maxWidth\":[2,\"max-width\"]}]]],[\"vertex-scene-tree-table-header.cjs\",[[1,\"vertex-scene-tree-table-header\"]]],[\"vertex-scene-tree-table-resize-divider.cjs\",[[1,\"vertex-scene-tree-table-resize-divider\",{\"dragging\":[32]}]]],[\"vertex-scene-tree-toolbar-group.cjs\",[[1,\"vertex-scene-tree-toolbar-group\"]]],[\"vertex-viewer.cjs\",[[1,\"vertex-viewer\",{\"src\":[1],\"clientId\":[1,\"client-id\"],\"deviceId\":[1025,\"device-id\"],\"config\":[1],\"configEnv\":[1,\"config-env\"],\"resolvedConfig\":[1040],\"cameraControls\":[4,\"camera-controls\"],\"cameraType\":[1537,\"camera-type\"],\"keyboardControls\":[4,\"keyboard-controls\"],\"rotateAroundTapPoint\":[4,\"rotate-around-tap-point\"],\"token\":[1025],\"depthBuffers\":[1,\"depth-buffers\"],\"phantom\":[16],\"noDefaultLights\":[4,\"no-default-lights\"],\"enableTemporalRefinement\":[4,\"enable-temporal-refinement\"],\"experimentalRenderingOptions\":[1,\"experimental-rendering-options\"],\"featureLines\":[16],\"selectionHighlighting\":[16],\"featureHighlighting\":[16],\"sceneComparison\":[16],\"featureMaps\":[1,\"feature-maps\"],\"resizeDebounce\":[2,\"resize-debounce\"],\"frame\":[1040],\"stream\":[1040],\"stencilBuffer\":[1040],\"viewport\":[1040],\"annotations\":[1040],\"modelViews\":[1040],\"pmi\":[1040],\"dimensions\":[32],\"hostDimensions\":[32],\"errorMessage\":[32],\"cursor\":[32],\"stateMap\":[32],\"dispatchFrameDrawn\":[64],\"registerInteractionHandler\":[64],\"registerTapKeyInteraction\":[64],\"getInteractionTarget_DEPRECATED\":[64],\"addCursor\":[64],\"getInteractionHandlers\":[64],\"getKeyInteractions\":[64],\"getBaseInteractionHandler\":[64],\"getJwt\":[64],\"load\":[64],\"unload\":[64],\"scene\":[64],\"isSceneReady\":[64]},[[0,\"tap\",\"handleTapEvent\"]]]]],[\"vertex-viewer-hit-result-indicator.cjs\",[[1,\"vertex-viewer-hit-result-indicator\",{\"viewer\":[16],\"position\":[1040],\"normal\":[1040]}]]],[\"vertex-viewer-measurement-details.cjs\",[[1,\"vertex-viewer-measurement-details\",{\"measurementModel\":[16],\"measurementOverlays\":[16],\"measurementOutcome\":[1040],\"distanceUnits\":[1,\"distance-units\"],\"angleUnits\":[1,\"angle-units\"],\"fractionalDigits\":[2,\"fractional-digits\"],\"distanceFormatter\":[16],\"angleFormatter\":[16],\"areaFormatter\":[16],\"resultTypes\":[16],\"overlay\":[32],\"distanceMeasurementUnits\":[32],\"angleMeasurementUnits\":[32],\"areaMeasurementUnits\":[32]}]]],[\"vertex-viewer-transform-widget.cjs\",[[1,\"vertex-viewer-transform-widget\",{\"viewer\":[16],\"position\":[1040],\"rotation\":[1040],\"controller\":[1040],\"xRotationDisabled\":[1028,\"x-rotation-disabled\"],\"yRotationDisabled\":[1028,\"y-rotation-disabled\"],\"zRotationDisabled\":[1028,\"z-rotation-disabled\"],\"xTranslationDisabled\":[1028,\"x-translation-disabled\"],\"yTranslationDisabled\":[1028,\"y-translation-disabled\"],\"zTranslationDisabled\":[1028,\"z-translation-disabled\"],\"showInputs\":[4,\"show-inputs\"],\"distanceUnit\":[1,\"distance-unit\"],\"angleUnit\":[1,\"angle-unit\"],\"decimalPlaces\":[2,\"decimal-places\"],\"EXPERIMENTAL_undoKeybindings\":[4,\"e-x-p-e-r-i-m-e-n-t-a-l_undo-keybindings\"],\"hovered\":[1040],\"inputPosition\":[32],\"inputValue\":[32],\"isEndingTransform\":[32],\"inputShouldFocus\":[32],\"EXPERIMENTAL_undo\":[64]}]]],[\"vertex-viewer-pin-group.cjs\",[[0,\"vertex-viewer-pin-group\",{\"pin\":[16],\"matrix\":[1040],\"projectionViewMatrix\":[16],\"elementBounds\":[1040],\"pinModel\":[16],\"pinController\":[16],\"selected\":[4],\"occluded\":[1540],\"detached\":[1540],\"invalidateStateCounter\":[32]},[[0,\"occlusionStateChanged\",\"handleOcclusionStateChanged\"],[0,\"detachedStateChanged\",\"handleDetachedStateChanged\"]]]]],[\"vertex-viewer-dom-group.cjs\",[[6,\"vertex-viewer-dom-group\",{\"position\":[1040],\"positionJson\":[1,\"position\"],\"rotation\":[1040],\"rotationJson\":[1,\"rotation\"],\"quaternion\":[1040],\"quaternionJson\":[1,\"quaternion\"],\"scale\":[1040],\"scaleJson\":[1,\"scale\"],\"matrix\":[1040]}]]],[\"vertex-viewer-teleport-tool.cjs\",[[1,\"vertex-viewer-teleport-tool\",{\"viewer\":[16],\"mode\":[1025],\"animationsDisabled\":[4,\"animations-disabled\"],\"animationMs\":[2,\"animation-ms\"],\"controller\":[1040],\"model\":[1040]}]]],[\"vertex-viewer-spinner.cjs\",[[1,\"vertex-viewer-spinner\",{\"size\":[1]}]]],[\"vertex-scene-tree-search_3.cjs\",[[1,\"vertex-scene-tree-search\",{\"debounce\":[2],\"disabled\":[4],\"placeholder\":[1],\"controller\":[16],\"value\":[1025],\"focused\":[32],\"isSearching\":[32],\"setFocus\":[64],\"clear\":[64]}],[1,\"vertex-scene-tree-table-layout\",{\"tree\":[16],\"controller\":[16],\"rows\":[16],\"totalRows\":[2,\"total-rows\"],\"rowHeight\":[1026,\"row-height\"],\"overScanCount\":[2,\"over-scan-count\"],\"rowData\":[16],\"layoutOffset\":[1026,\"layout-offset\"],\"scrollOffset\":[1026,\"scroll-offset\"],\"layoutHeight\":[1026,\"layout-height\"],\"layoutWidth\":[1026,\"layout-width\"],\"viewportStartIndex\":[1026,\"viewport-start-index\"],\"viewportEndIndex\":[1026,\"viewport-end-index\"],\"columnGridLayout\":[32],\"columnGridFixedLayout\":[32],\"isComputingCellHeight\":[32],\"lastDividerPointerPosition\":[32],\"resizingColumnIndex\":[32],\"isScrolling\":[32],\"scrollTimer\":[32],\"stateMap\":[32],\"scrollToPosition\":[64]}],[1,\"vertex-scene-tree-toolbar\"]]],[\"vertex-viewer-layer.cjs\",[[1,\"vertex-viewer-layer\",{\"stretchOff\":[516,\"stretch-off\"]}]]],[\"vertex-viewer-button_3.cjs\",[[1,\"vertex-viewer-toolbar\",{\"placement\":[1],\"direction\":[1]}],[1,\"vertex-viewer-button\"],[1,\"vertex-viewer-toolbar-group\",{\"direction\":[1]}]]],[\"vertex-viewer-pin-label_2.cjs\",[[0,\"vertex-viewer-pin-label\",{\"pin\":[16],\"elementBounds\":[16],\"value\":[1025],\"pinController\":[16],\"focused\":[32],\"computedScreenPosition\":[32],\"textareaRows\":[32],\"contentElBounds\":[32],\"setFocus\":[64],\"submit\":[64]}],[0,\"vertex-viewer-pin-label-line\",{\"pinPoint\":[16],\"labelPoint\":[16],\"pin\":[16]}]]],[\"vertex-viewer-measurement-line_2.cjs\",[[1,\"vertex-viewer-measurement-overlays\",{\"measurementOverlays\":[16],\"camera\":[1040],\"viewer\":[16],\"overlays\":[32]}],[1,\"vertex-viewer-measurement-line\",{\"start\":[16],\"end\":[16],\"capLength\":[2,\"cap-length\"],\"pointerEvents\":[1,\"pointer-events\"]}]]],[\"vertex-viewer-dom-element_2.cjs\",[[6,\"vertex-viewer-dom-renderer\",{\"drawMode\":[1,\"draw-mode\"],\"propagateEventsToViewer\":[4,\"propagate-events-to-viewer\"],\"viewer\":[16],\"camera\":[1040],\"depthBuffer\":[1040],\"viewport\":[32],\"invalidateFrameCounter\":[32],\"interactionDisposables\":[32]},[[0,\"propertyChange\",\"handlePropertyChange\"]]],[1,\"vertex-viewer-dom-element\",{\"position\":[1040],\"positionJson\":[1,\"position\"],\"rotation\":[1040],\"rotationJson\":[1,\"rotation\"],\"quaternion\":[1040],\"quaternionJson\":[1,\"quaternion\"],\"scale\":[1040],\"scaleJson\":[1,\"scale\"],\"matrix\":[1040],\"occlusionOff\":[4,\"occlusion-off\"],\"occluded\":[516],\"detachedOff\":[4,\"detached-off\"],\"detached\":[516],\"billboardOff\":[4,\"billboard-off\"],\"interactionsOff\":[516,\"interactions-off\"]}]]],[\"vertex-viewer-markup-arrow_3.cjs\",[[1,\"vertex-viewer-markup-arrow\",{\"start\":[1040],\"startJson\":[1,\"start\"],\"end\":[1040],\"endJson\":[1,\"end\"],\"startLineAnchorStyle\":[1025,\"start-line-anchor-style\"],\"endLineAnchorStyle\":[1025,\"end-line-anchor-style\"],\"mode\":[513],\"viewer\":[16],\"elementBounds\":[32],\"dispose\":[64]}],[1,\"vertex-viewer-markup-circle\",{\"bounds\":[1040],\"boundsJson\":[1,\"bounds\"],\"mode\":[513],\"viewer\":[16],\"elementBounds\":[32],\"dispose\":[64]}],[1,\"vertex-viewer-markup-freeform\",{\"points\":[1040],\"pointsJson\":[1,\"points\"],\"bounds\":[1040],\"boundsJson\":[1,\"bounds\"],\"mode\":[513],\"viewer\":[16],\"elementBounds\":[32],\"screenPoints\":[32],\"dispose\":[64]}]]],[\"vertex-viewer-icon.cjs\",[[1,\"vertex-viewer-icon\",{\"name\":[1],\"size\":[1]}]]]]"), options);
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2024 Vertex Software LLC. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
const browser_esm = require('./browser.esm-13ce8652.js');
|
|
7
|
+
const streamAttributes = require('./streamAttributes-c03bb74e.js');
|
|
8
|
+
|
|
9
|
+
const mapModelView$1 = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapRequiredProp('id', streamAttributes.fromPbUuid2l), browser_esm.mapper.getProp('displayName'), browser_esm.mapper.mapRequiredProp('partRevisionId', streamAttributes.fromPbUuid2l)), ([id, displayName, partRevisionId]) => ({
|
|
10
|
+
id,
|
|
11
|
+
displayName,
|
|
12
|
+
partRevisionId,
|
|
13
|
+
}));
|
|
14
|
+
const mapListItemModelViewsResponse = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('modelViewsList', browser_esm.mapper.mapArray(mapModelView$1)), browser_esm.mapper.mapProp('nextPageCursor', streamAttributes.mapCursor)), ([modelViews, next]) => ({ modelViews, paging: { next } }));
|
|
15
|
+
const mapListItemModelViewsResponseOrThrow = browser_esm.mapper.ifInvalidThrow(mapListItemModelViewsResponse);
|
|
16
|
+
const mapItemModelView = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('modelViewId', streamAttributes.toPbJsUuid2l), browser_esm.mapper.mapProp('sceneItemId', streamAttributes.toPbJsUuid2l)), ([modelViewId, sceneItemId]) => ({ modelViewId, sceneItemId }));
|
|
17
|
+
const mapItemModelViewOrThrow = browser_esm.mapper.ifInvalidThrow(mapItemModelView);
|
|
18
|
+
|
|
19
|
+
const mapModelView = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapRequiredProp('id', streamAttributes.fromPbUuid2l), browser_esm.mapper.getProp('displayName')), ([id, displayName]) => ({ id, displayName }));
|
|
20
|
+
const mapListPmiAnnotationsResponse = browser_esm.mapper.defineMapper(browser_esm.mapper.read(browser_esm.mapper.mapProp('annotationsList', browser_esm.mapper.mapArray(mapModelView)), browser_esm.mapper.mapProp('nextPageCursor', streamAttributes.mapCursor)), ([annotations, next]) => ({ annotations, paging: { next } }));
|
|
21
|
+
const mapListPmiAnnotationsResponseOrThrow = browser_esm.mapper.ifInvalidThrow(mapListPmiAnnotationsResponse);
|
|
22
|
+
|
|
23
|
+
exports.mapItemModelViewOrThrow = mapItemModelViewOrThrow;
|
|
24
|
+
exports.mapListItemModelViewsResponseOrThrow = mapListItemModelViewsResponseOrThrow;
|
|
25
|
+
exports.mapListPmiAnnotationsResponseOrThrow = mapListPmiAnnotationsResponseOrThrow;
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=mapper-ac34f608.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"mapper-ac34f608.js","mappings":";;;;;;;;AAQA,MAAMA,cAAY,GAA4CC,kBAAC,CAAC,YAAY,CAC1EA,kBAAC,CAAC,IAAI,CACJA,kBAAC,CAAC,eAAe,CAAC,IAAI,EAAEC,6BAAY,CAAC,EACrCD,kBAAC,CAAC,OAAO,CA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C,CAAC;AAEJ,MAAM,6BAA6B,GAG/BA,kBAAC,CAAC,YAAY,CAChBA,kBAAC,CAAC,IAAI,CACJA,kBAAC,CAAC,OAAO,CAAC,iBAAiB,EAAEA,kBAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EACtDA,kBAAC,CAAC,OAAO,CAAC,gBAAgB,EAAEE,0BAAS,CAAC,CACvC,EACD,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAC7D,CAAC;MAEW,oCAAoC,GAAGF,kBAAC,CAAC,cAAc,CAClE,6BAA6B;;;;;;","names":["mapModelView","M","fromPbUuid2l","mapCursor","toPbJsUuid2l"],"sources":["./src/lib/model-views/mapper.ts","./src/lib/pmi/mapper.ts"],"sourcesContent":["import type { vertexvis } from '@vertexvis/frame-streaming-protos';\nimport { ModelView as PBModelView } from '@vertexvis/scene-view-protos/core/protos/model_views_pb';\nimport { ListItemModelViewsResponse } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { Mapper as M, UUID } from '@vertexvis/utils';\n\nimport { fromPbUuid2l, mapCursor, toPbJsUuid2l } from '../mappers';\nimport { ModelView, ModelViewListResponse } from './types';\n\nconst mapModelView: M.Func<PBModelView.AsObject, ModelView> = M.defineMapper(\n M.read(\n M.mapRequiredProp('id', fromPbUuid2l),\n M.getProp('displayName'),\n M.mapRequiredProp('partRevisionId', fromPbUuid2l)\n ),\n ([id, displayName, partRevisionId]) => ({\n id,\n displayName,\n partRevisionId,\n })\n);\n\nconst mapListItemModelViewsResponse: M.Func<\n ListItemModelViewsResponse.AsObject,\n ModelViewListResponse\n> = M.defineMapper(\n M.read(\n M.mapProp('modelViewsList', M.mapArray(mapModelView)),\n M.mapProp('nextPageCursor', mapCursor)\n ),\n ([modelViews, next]) => ({ modelViews, paging: { next } })\n);\n\nexport const mapListItemModelViewsResponseOrThrow = M.ifInvalidThrow(\n mapListItemModelViewsResponse\n);\n\nconst mapItemModelView: M.Func<\n { modelViewId: UUID.UUID; sceneItemId: UUID.UUID },\n vertexvis.protobuf.core.IItemModelView\n> = M.defineMapper(\n M.read(\n M.mapProp('modelViewId', toPbJsUuid2l),\n M.mapProp('sceneItemId', toPbJsUuid2l)\n ),\n ([modelViewId, sceneItemId]) => ({ modelViewId, sceneItemId })\n);\n\nexport const mapItemModelViewOrThrow = M.ifInvalidThrow(mapItemModelView);\n","import { PmiAnnotation as PBPmiAnnotation } from '@vertexvis/scene-view-protos/core/protos/model_views_pb';\nimport { ListPmiAnnotationsResponse } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb';\nimport { Mapper as M } from '@vertexvis/utils';\n\nimport { fromPbUuid2l, mapCursor } from '../mappers';\nimport { PmiAnnotation, PmiAnnotationListResponse } from './types';\n\nconst mapModelView: M.Func<PBPmiAnnotation.AsObject, PmiAnnotation> =\n M.defineMapper(\n M.read(M.mapRequiredProp('id', fromPbUuid2l), M.getProp('displayName')),\n ([id, displayName]) => ({ id, displayName })\n );\n\nconst mapListPmiAnnotationsResponse: M.Func<\n ListPmiAnnotationsResponse.AsObject,\n PmiAnnotationListResponse\n> = M.defineMapper(\n M.read(\n M.mapProp('annotationsList', M.mapArray(mapModelView)),\n M.mapProp('nextPageCursor', mapCursor)\n ),\n ([annotations, next]) => ({ annotations, paging: { next } })\n);\n\nexport const mapListPmiAnnotationsResponseOrThrow = M.ifInvalidThrow(\n mapListPmiAnnotationsResponse\n);\n"],"version":3}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
const browser_esm = require('./browser.esm-13ce8652.js');
|
|
7
7
|
const errors = require('./errors-696d9931.js');
|
|
8
|
-
const scene_view_api_pb = require('./scene_view_api_pb-
|
|
8
|
+
const scene_view_api_pb = require('./scene_view_api_pb-61f663af.js');
|
|
9
9
|
const wrappers_pb = require('./wrappers_pb-1f2f4854.js');
|
|
10
10
|
const grpc = require('./grpc-c3531bf5.js');
|
|
11
|
-
const mapper = require('./mapper-
|
|
11
|
+
const mapper = require('./mapper-ac34f608.js');
|
|
12
12
|
const bundle_esm$1 = require('./bundle.esm-b2145e44.js');
|
|
13
13
|
const streamAttributes = require('./streamAttributes-c03bb74e.js');
|
|
14
14
|
require('./entities-551add54.js');
|
|
@@ -293,6 +293,36 @@ class ModelViewController {
|
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
class PmiController {
|
|
297
|
+
constructor(client, jwtProvider, deviceIdProvider) {
|
|
298
|
+
this.client = client;
|
|
299
|
+
this.jwtProvider = jwtProvider;
|
|
300
|
+
this.deviceIdProvider = deviceIdProvider;
|
|
301
|
+
}
|
|
302
|
+
async listAnnotations({ modelViewId, cursor, size = 50, } = {}) {
|
|
303
|
+
const res = await grpc.requestUnary(async (handler) => {
|
|
304
|
+
const deviceId = this.deviceIdProvider();
|
|
305
|
+
const meta = await grpc.createMetadata(this.jwtProvider, deviceId);
|
|
306
|
+
const req = new scene_view_api_pb.scene_view_api_pb.ListPmiAnnotationsRequest();
|
|
307
|
+
if (modelViewId != null) {
|
|
308
|
+
const { msb, lsb } = browser_esm.uuid.toMsbLsb(modelViewId);
|
|
309
|
+
const id = new scene_view_api_pb.uuid_pb.Uuid2l();
|
|
310
|
+
id.setMsb(msb);
|
|
311
|
+
id.setLsb(lsb);
|
|
312
|
+
req.setModelViewId(id);
|
|
313
|
+
}
|
|
314
|
+
const page = new scene_view_api_pb.paging_pb.Pager();
|
|
315
|
+
page.setLimit(size);
|
|
316
|
+
if (cursor != null) {
|
|
317
|
+
page.setCursor(cursor);
|
|
318
|
+
}
|
|
319
|
+
req.setPage(page);
|
|
320
|
+
this.client.listPmiAnnotations(req, meta, handler);
|
|
321
|
+
});
|
|
322
|
+
return mapper.mapListPmiAnnotationsResponseOrThrow(res.toObject());
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
296
326
|
const DEFAULT_TIMEOUT_IN_MS = 1000 * 10;
|
|
297
327
|
class StreamApiEventDispatcher {
|
|
298
328
|
constructor(stream, predicate, transform, timeout = DEFAULT_TIMEOUT_IN_MS) {
|
|
@@ -2443,6 +2473,7 @@ class SceneItemQueryExecutor {
|
|
|
2443
2473
|
exports.Camera = Camera;
|
|
2444
2474
|
exports.CrossSectioner = CrossSectioner;
|
|
2445
2475
|
exports.ModelViewController = ModelViewController;
|
|
2476
|
+
exports.PmiController = PmiController;
|
|
2446
2477
|
exports.Raycaster = Raycaster;
|
|
2447
2478
|
exports.RootQuery = RootQuery;
|
|
2448
2479
|
exports.Scene = Scene;
|
|
@@ -2455,4 +2486,4 @@ exports.fromUrn = fromUrn;
|
|
|
2455
2486
|
exports.loadableResource = loadableResource;
|
|
2456
2487
|
exports.sceneViewStateIdentifier = sceneViewStateIdentifier;
|
|
2457
2488
|
|
|
2458
|
-
//# sourceMappingURL=queries-
|
|
2489
|
+
//# sourceMappingURL=queries-ea895dd6.js.map
|