@smarterplan/ngx-smarterplan-core 1.4.19 → 1.4.21

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.
Files changed (29) hide show
  1. package/esm2022/lib/helpers.service.mjs +28 -2
  2. package/esm2022/lib/matterport-extensions/security-camera/SecurityCamera.mjs +28 -7
  3. package/esm2022/lib/services/filter.service.mjs +8 -3
  4. package/esm2022/lib/services/matterport-object3d.service.mjs +657 -133
  5. package/esm2022/lib/services/matterport.service.mjs +330 -9
  6. package/esm2022/lib/services/models/base-object.service.mjs +10 -9
  7. package/esm2022/lib/services/models/equipment.service.mjs +27 -2
  8. package/esm2022/lib/services/models/feature.service.mjs +14 -1
  9. package/esm2022/lib/services/models/measurement.service.mjs +17 -1
  10. package/esm2022/lib/services/sweep-locator.service.mjs +114 -0
  11. package/esm2022/lib/services/threejs.service.mjs +840 -35
  12. package/esm2022/lib/services/utils/matterport-framing.util.mjs +63 -0
  13. package/esm2022/lib/services/viewer.service.mjs +193 -10
  14. package/esm2022/lib/types.service.mjs +3 -1
  15. package/esm2022/public-api.mjs +2 -1
  16. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs +2886 -776
  17. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
  18. package/lib/helpers.service.d.ts +17 -0
  19. package/lib/services/matterport-object3d.service.d.ts +125 -5
  20. package/lib/services/matterport.service.d.ts +106 -7
  21. package/lib/services/models/base-object.service.d.ts +3 -4
  22. package/lib/services/models/measurement.service.d.ts +1 -0
  23. package/lib/services/sweep-locator.service.d.ts +54 -0
  24. package/lib/services/threejs.service.d.ts +304 -10
  25. package/lib/services/utils/matterport-framing.util.d.ts +40 -0
  26. package/lib/services/viewer.service.d.ts +87 -2
  27. package/lib/types.service.d.ts +42 -1
  28. package/package.json +1 -1
  29. package/public-api.d.ts +1 -0
@@ -22,6 +22,21 @@ export interface ThreeJsAlignment {
22
22
  };
23
23
  scale?: number;
24
24
  }
25
+ /**
26
+ * Where a POI placed in a Three.js model says it was placed, or null for any other POI.
27
+ *
28
+ * `frame` is 'model' when its coordinates are in that model's own space - it was placed before the
29
+ * model was calibrated - rather than in the space tags share with the other visits.
30
+ */
31
+ export declare function getThreeJsPoiOrigin(poi: {
32
+ metadata?: string | null;
33
+ } | null | undefined): {
34
+ captureID: string;
35
+ frame: "model" | null;
36
+ } | null;
37
+ /** Which of a model's own axes points up, for a model whose file has it the other way. */
38
+ export type ThreeJsModelUp = "x" | "y" | "z" | "-x" | "-y" | "-z";
39
+ export declare const THREEJS_MODEL_UP_OPTIONS: ThreeJsModelUp[];
25
40
  /** Where the camera starts when a Three.js visit is opened. */
26
41
  export interface ThreeJsPlacement {
27
42
  cameraPosition?: {
@@ -35,6 +50,8 @@ export interface ThreeJsPlacement {
35
50
  z: number;
36
51
  };
37
52
  alignment?: ThreeJsAlignment;
53
+ /** Set once someone has chosen the vertical axis by hand; absent means "work it out". */
54
+ up?: ThreeJsModelUp;
38
55
  }
39
56
  /**
40
57
  * Parses the placement stored in a Three.js capture's metadata, or null when there is none.
@@ -1,4 +1,5 @@
1
- import { IObject3D, PoiType, POI, DbObjectType } from '../types.service';
1
+ import { Subject } from 'rxjs';
2
+ import { IObject3D, PoiType, POI, DbObjectType, GizmoMode, GizmoSnap, Object3DBoundingBox, Object3DTransform, Object3DTransformChange, Point3D } from '../types.service';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class MatterportObject3DService {
4
5
  dictionnaryObjects3D: Map<string, any>;
@@ -9,22 +10,141 @@ export declare class MatterportObject3DService {
9
10
  azimuthalCrown: any;
10
11
  threeJSScene: any;
11
12
  noLightForObjects: boolean;
13
+ /** Max time (ms) to wait for a model to be loaded by the SDK */
14
+ loadTimeoutMs: number;
15
+ /** Max distance (m) an object can travel from where a translate drag started */
16
+ maxDragDistance: number;
17
+ /** Max vertical travel (m, up and down) during a translate drag, so an object cannot jump to another floor */
18
+ maxDragHeight: number;
19
+ /** Emits on every gizmo change and on setObject3DTransform */
20
+ readonly object3DTransformChanged$: Subject<Object3DTransformChange>;
21
+ /** Security camera animators by object uuid (`securityCameraAnimator` stays the last loaded one) */
22
+ securityCameraAnimators: Map<string, any>;
23
+ private viewFrustumVisible;
24
+ private lastSecurityCameraUuid;
25
+ /** Loader component of each model (outputs.objectRoot is set once loaded) */
26
+ private loaderComponents;
27
+ private gizmos;
28
+ private activeGizmoUuid;
29
+ private gizmoSnap;
30
+ /** Sweeps disabled by setNavigationLocked(true), re-enabled on unlock */
31
+ private sweepsDisabledByLock;
32
+ /** Sweeps re-enabled by the last unlock (the SDK may still report them disabled for a moment) */
33
+ private sweepsEnabledByUnlock;
34
+ private readonly tmpBox;
12
35
  constructor();
13
36
  init3DObjectViewer(sdk: any): Promise<void>;
14
- add3DObject(sdk: any, obj: IObject3D, mode?: 'translate' | 'rotate'): Promise<any>;
37
+ /** SDK loader component name for a model format, null when the format is not supported */
38
+ private getLoaderComponentName;
39
+ /** Resolves once the loader component has produced its objectRoot, rejects after `timeoutMs` */
40
+ private waitForModelLoaded;
41
+ /**
42
+ * Adds a 3D model to the scene.
43
+ * The promise resolves with the three.js object once the model is actually loaded, and rejects
44
+ * (after cleaning the scene) when the format is unknown or the load times out.
45
+ * The position / rotation / scale of `obj` are applied to the model origin, as stored in DB.
46
+ */
47
+ add3DObject(sdk: any, obj: IObject3D, mode?: GizmoMode): Promise<any>;
48
+ /**
49
+ * Removes a 3D object for good: detaches its gizmo, stops its scene object and forgets it.
50
+ */
15
51
  deleteObject3D(uuid: string): Promise<void>;
16
52
  getObject3DModelNodeFromDictionnary(uuid: string): any;
17
53
  toggleObjectVisibility(objectId: any): void;
18
54
  isObjectVisible(objectId: any): boolean;
55
+ /** Shows / hides a model (used by the placement preview) */
56
+ setObject3DVisible(uuid: string, visible: boolean): void;
57
+ /** Enables / disables the pointer collider of a model (disabled while it follows the cursor) */
58
+ setObject3DColliderEnabled(uuid: string, enabled: boolean): void;
59
+ /**
60
+ * Moves the camera next to a 3D object by creating a temporary tag on the object centre.
61
+ * @returns false when the object is unknown or no tag could be reached
62
+ */
19
63
  pointCameraTo3DObject(sdk: any, objectId: any, createTagCallback: (tagType: PoiType, object: DbObjectType, poi: POI) => Promise<any>, goToTagCallback: (sid: string) => Promise<any>, deleteLastTagCallback: () => void, getTagFromElementId: (id: string) => {
20
64
  tag: string;
21
65
  sweep: string;
22
- }): Promise<void>;
66
+ }): Promise<boolean>;
23
67
  getSceneNodeFromObject3DId(uuid: string): any;
24
68
  displayAzimutalCrown(poseCamera: any): Promise<void>;
25
- attachGizmoControlTo3DObject(sdk: any, modelNode: any, sceneObject: any, mode: 'translate' | 'rotate' | 'scale', visible: boolean, isNewObject: boolean): Promise<any>;
69
+ private toPoint;
70
+ /**
71
+ * Geometry of the model itself (the loader output): the node also holds the helpers added by other
72
+ * components, like the view frustum of a security camera, which must not count in its size.
73
+ */
74
+ private modelRoot;
75
+ /** World-space bounding box of the model, null when unknown or when nothing is loaded yet */
76
+ getObject3DBoundingBox(uuid: string): Object3DBoundingBox | null;
77
+ /**
78
+ * Real dimensions of the model in meters (width x, height y, depth z), scale included but not
79
+ * its rotation: the world bounding box of a rotated object is larger than the object itself.
80
+ */
81
+ getObject3DDimensions(uuid: string): Point3D | null;
82
+ /**
83
+ * Uniform scale so that the largest bounding box dimension equals `targetSizeMeters`.
84
+ * The node position is untouched, so call placeObject3DOnSurface afterwards.
85
+ * @returns the new scale, null when the object is unknown / not loaded / `targetSizeMeters` invalid
86
+ */
87
+ normalizeObject3DSize(uuid: string, targetSizeMeters: number): Point3D | null;
88
+ /**
89
+ * Places the model on a surface point without touching its pivot: the node position is
90
+ * adjusted so that the bounding box bottom-center lies on `point`.
91
+ * - floor (normal pointing up, or no normal): bottom-center on the point
92
+ * - wall (mostly horizontal normal): model turned around Y so its +Z faces away from the wall,
93
+ * and pushed along the normal by half its depth so it does not cut the wall
94
+ * - ceiling (normal pointing down): the model hangs, top-center on the point
95
+ * @returns the new transform, null when the object is unknown or not loaded
96
+ */
97
+ /**
98
+ * @param frontYawOffset rotation (radians, around Y) that turns the front of the model toward its +Z
99
+ * axis, for models whose front is another axis (e.g. -PI/2 when it is +X)
100
+ */
101
+ placeObject3DOnSurface(uuid: string, point: Point3D, normal?: Point3D, frontYawOffset?: number): Object3DTransform | null;
102
+ getObject3DTransform(uuid: string): Object3DTransform | null;
103
+ /** Applies a (partial) transform. Rotation is in radians. */
104
+ setObject3DTransform(uuid: string, transform: Partial<Object3DTransform>): boolean;
105
+ private emitTransformChanged;
106
+ /** Creates the mp.transformControls node of a model and wires it (events, snap) */
107
+ private createGizmo;
108
+ /** Keeps a translate drag within maxDragDistance / maxDragHeight of where it started, then notifies */
109
+ private onGizmoObjectChange;
110
+ private applySnap;
111
+ /**
112
+ * Shows the transform gizmo on an object (any previous gizmo is detached first).
113
+ * Re-attaching to the object that already has the gizmo only changes its mode.
114
+ */
115
+ attachGizmo(uuid: string, mode: GizmoMode, sdk?: any): Promise<boolean>;
116
+ /** Switches the active gizmo between translate / rotate / scale without re-attaching it */
117
+ setGizmoMode(mode: GizmoMode): void;
118
+ /** Really removes the gizmo from the scene (default: the active one) */
119
+ detachGizmo(uuid?: string): void;
120
+ isGizmoAttached(uuid?: string): boolean;
121
+ /** Snap steps for all gizmos (null / missing value = no snap) */
122
+ setGizmoSnap(snap: GizmoSnap | null): void;
123
+ setGizmoMaxDragDistance(maxDistance: number, maxHeight?: number): void;
124
+ /**
125
+ * Prevents camera navigation to other sweeps while a gizmo is edited.
126
+ * The SDK has no "freeze camera" switch, so every enabled sweep except the current one is
127
+ * disabled (Sweep.disable); exactly those sweeps are re-enabled on unlock. Sweeps already
128
+ * disabled (forbidden sweeps, edit mode) are never touched, and `keepDisabled` lists sweeps
129
+ * that must stay disabled on unlock.
130
+ * @returns false when the lock could not be applied (SDK without Sweep.disable, unknown current sweep)
131
+ */
132
+ setNavigationLocked(sdk: any, locked: boolean, sweepCollection?: Record<string, any> | null, currentSweepId?: string | null, keepDisabled?: string[]): Promise<boolean>;
133
+ isNavigationLocked(): boolean;
134
+ /** Sweeps currently disabled by the navigation lock */
135
+ getSweepsDisabledByLock(): string[];
136
+ /**
137
+ * Legacy API: attaches a gizmo to a model node. Prefer attachGizmo(uuid, mode).
138
+ */
139
+ attachGizmoControlTo3DObject(sdk: any, modelNode: any, sceneObject: any, mode: GizmoMode, visible: boolean, isNewObject: boolean): Promise<any>;
140
+ /** Removes the gizmo of the last added / edited object */
26
141
  removeGizmoFromLastObject(): void;
27
- toggleViewFrustum(): void;
142
+ private applyViewFrustum;
143
+ /** Shows / hides the view frustum of the security camera `uuid` */
144
+ setViewFrustum(uuid: string, visible: boolean): boolean;
145
+ isViewFrustumVisible(uuid: string): boolean;
146
+ /** Toggles the frustum of `uuid`, or of the last loaded security camera when omitted */
147
+ toggleViewFrustum(uuid?: string): void;
28
148
  clear(): void;
29
149
  static ɵfac: i0.ɵɵFactoryDeclaration<MatterportObject3DService, never>;
30
150
  static ɵprov: i0.ɵɵInjectableDeclaration<MatterportObject3DService>;
@@ -1,8 +1,8 @@
1
- import { NgZone } from '@angular/core';
1
+ import { NgZone, OnDestroy } from '@angular/core';
2
2
  import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { Subject } from 'rxjs';
4
4
  import { MattertagData } from '../mattertagData';
5
- import { DbObjectType, IObject3D, MattertagActionMode, MatterportView, POI, PoiType, SpModule } from '../types.service';
5
+ import { DbObjectType, GizmoMode, GizmoSnap, IObject3D, MattertagActionMode, MatterportView, Object3DBoundingBox, Object3DPlacementResult, Object3DTransform, Object3DTransformChange, POI, PoiType, Point3D, SpModule } from '../types.service';
6
6
  import { BaseTagService } from './tag.service';
7
7
  import { BaseVisibilityService } from './baseVisibility.service';
8
8
  import { Config } from '../config';
@@ -42,7 +42,7 @@ declare global {
42
42
  };
43
43
  }
44
44
  }
45
- export declare class MatterportService {
45
+ export declare class MatterportService implements OnDestroy {
46
46
  private readonly sdkKey;
47
47
  private router;
48
48
  private activeRoute;
@@ -65,6 +65,18 @@ export declare class MatterportService {
65
65
  private isMeasureModeOn;
66
66
  private interactionMode;
67
67
  private cameraMode;
68
+ /** Emitted when a placement (tag following the cursor, or 3D object preview) is cancelled by right click or Escape */
69
+ readonly placementCancelled$: Subject<void>;
70
+ /** Pending interactive placement of a 3D object (see startObject3DPlacement) */
71
+ private object3DPlacement;
72
+ /** Sweeps snapshot taken when navigation is locked (disabled sweeps vanish from Sweep.data) */
73
+ private lockedSweepsSnapshot;
74
+ /**
75
+ * Every sweep seen in Sweep.data. After an unlock the SDK re-emits the re-enabled sweeps little by
76
+ * little: a lock asked meanwhile must still know all of them (it found nothing to disable).
77
+ */
78
+ private knownSweeps;
79
+ private keydownTargets;
68
80
  get mattertagIDs(): Array<string>;
69
81
  set mattertagIDs(value: Array<string>);
70
82
  get dictionnaryTags(): Map<string, MattertagData>;
@@ -414,15 +426,102 @@ export declare class MatterportService {
414
426
  clearAll(): Promise<void>;
415
427
  removeForbiddenSweeps(forbiddenSweeps: string[]): Promise<void>;
416
428
  init3DObjectViewer(): Promise<void>;
417
- add3DObject(obj: IObject3D, mode?: 'translate' | 'rotate'): Promise<any>;
429
+ /**
430
+ * Adds a 3D model; resolves once it is loaded, rejects on unknown format or load timeout (~15 s).
431
+ */
432
+ add3DObject(obj: IObject3D, mode?: GizmoMode): Promise<any>;
418
433
  toggleObjectVisibility(objectId: any): void;
419
434
  isObjectVisible(objectId: any): boolean;
420
- pointCameraTo3DObject(objectId: any): Promise<void>;
435
+ /** Moves the camera to the object (centered on its bounding box). Resolves false when the object is unknown. */
436
+ /**
437
+ * Moves the camera to the sweep closest to a 3D object and turns it toward the object.
438
+ * @param visibleArea client X bounds of the part of the viewer not covered by other panels
439
+ * (the lateral menu covers the right of the viewer): the object is centered there.
440
+ * Falls back to the temporary tag navigation when no sweep can be used.
441
+ */
442
+ pointCameraTo3DObject(objectId: any, visibleArea?: {
443
+ left: number;
444
+ right: number;
445
+ }): Promise<boolean>;
421
446
  getSceneNodeFromObject3DId(uuid: string): any;
422
447
  displayAzimutalCrown(): Promise<void>;
423
- attachGizmoControlTo3DObject(modelNode: any, sceneObject: any, mode: 'translate' | 'rotate' | 'scale', visible: boolean, isNewObject: boolean): Promise<any>;
448
+ attachGizmoControlTo3DObject(modelNode: any, sceneObject: any, mode: GizmoMode, visible: boolean, isNewObject: boolean): Promise<any>;
424
449
  removeGizmoFromLastObject(): void;
425
- toggleViewFrustum(): void;
450
+ /** Toggles the frustum of the security camera `uuid` (default: the last loaded one) */
451
+ toggleViewFrustum(uuid?: string): void;
452
+ setViewFrustum(uuid: string, visible: boolean): boolean;
453
+ isViewFrustumVisible(uuid: string): boolean;
454
+ /** Emits on gizmo changes and on setObject3DTransform / placeObject3DOnSurface / normalizeObject3DSize */
455
+ get object3DTransformChanged$(): Subject<Object3DTransformChange>;
456
+ /** World-space bounding box, null when the object is unknown or not loaded */
457
+ getObject3DBoundingBox(uuid: string): Object3DBoundingBox | null;
458
+ /** Dimensions of the model in meters, without its rotation */
459
+ getObject3DDimensions(uuid: string): Point3D | null;
460
+ /** Uniform scale so the largest dimension equals `targetSizeMeters`; returns the new scale or null */
461
+ normalizeObject3DSize(uuid: string, targetSizeMeters: number): Point3D | null;
462
+ /** Moves the object so its bounding box bottom-center (top-center on a ceiling) lies on `point` */
463
+ placeObject3DOnSurface(uuid: string, point: Point3D, normal?: Point3D, frontYawOffset?: number): Object3DTransform | null;
464
+ getObject3DTransform(uuid: string): Object3DTransform | null;
465
+ /** Rotation in radians */
466
+ setObject3DTransform(uuid: string, transform: Partial<Object3DTransform>): boolean;
467
+ attachGizmo(uuid: string, mode: GizmoMode): Promise<boolean>;
468
+ setGizmoMode(mode: GizmoMode): void;
469
+ detachGizmo(uuid?: string): void;
470
+ isGizmoAttached(uuid?: string): boolean;
471
+ /** null disables snapping (default) */
472
+ setGizmoSnap(snap: GizmoSnap | null): void;
473
+ /** Limits of a translate drag from its start (default 2 m, +/- 1.5 m vertically) */
474
+ setGizmoMaxDragDistance(maxDistance: number, maxHeight?: number): void;
475
+ /**
476
+ * Locks / unlocks camera navigation to other sweeps while a gizmo is edited: every enabled sweep
477
+ * except the current one is disabled, and exactly those are re-enabled on unlock.
478
+ * @returns false when the lock could not be applied (SDK not ready, current sweep unknown)
479
+ */
480
+ setNavigationLocked(locked: boolean): Promise<boolean>;
481
+ isNavigationLocked(): boolean;
482
+ /**
483
+ * Makes an already loaded model follow the cursor on the surfaces of the visit.
484
+ * Left click resolves with the surface point / normal under the cursor (read the object origin
485
+ * with getObject3DTransform); right click or Escape hides the model and resolves null
486
+ * (deleting it is up to the caller). Resolves null right away if another interaction is running.
487
+ */
488
+ startObject3DPlacement(uuid: string, options?: {
489
+ frontYawOffset?: number;
490
+ }): Promise<Object3DPlacementResult | null>;
491
+ isPlacingObject3D(): boolean;
492
+ /** Cancels the running object placement (model hidden, promise resolves null) */
493
+ cancelObject3DPlacement(): void;
494
+ /**
495
+ * Drops the object where it is previewed (same as a left click). Touch screens have no hover: each
496
+ * tap moves the preview, and the app confirms with a button.
497
+ * @returns false when no surface was pointed yet
498
+ */
499
+ confirmObject3DPlacement(): boolean;
500
+ /** True once the preview stands on a surface (the placement can be confirmed) */
501
+ hasObject3DPlacementPoint(): boolean;
502
+ private validateObject3DPlacement;
503
+ private endObject3DPlacement;
504
+ private updateObject3DPlacementPreview;
505
+ /** Token for the pointer trick: truthy while something follows the cursor (tag or 3D object) */
506
+ private getFollowTarget;
507
+ /**
508
+ * Cancels whatever follows the cursor (right click / Escape): the 3D object preview, or the tag.
509
+ * Emits placementCancelled$ when something was actually running.
510
+ */
511
+ private cancelCurrentPlacement;
512
+ /** Escape cancels any placement. Listens on the page and on the (same-origin) Showcase iframe, which takes the focus on click. */
513
+ private registerEscapeListener;
514
+ private removeEscapeListener;
515
+ ngOnDestroy(): void;
516
+ /**
517
+ * Closest enabled sweep to a world position (for instance to re-assign the zone of a moved object).
518
+ * `sweepId` is the DB-format id (like currentSweep), `sid` the SDK id. null when no sweep is known.
519
+ */
520
+ findNearestSweep(position: Point3D): {
521
+ sweepId: string;
522
+ sid: string;
523
+ floorSequence: number | null;
524
+ } | null;
426
525
  static ɵfac: i0.ɵɵFactoryDeclaration<MatterportService, never>;
427
526
  static ɵprov: i0.ɵɵInjectableDeclaration<MatterportService>;
428
527
  }
@@ -17,11 +17,10 @@ export declare class BaseObjectService {
17
17
  };
18
18
  } | void>;
19
19
  /**
20
- * The space's 3D visit, or null when it has none.
20
+ * The 3D visit to show a POI in, or null when the space has none.
21
21
  *
22
- * Takes the first one the database returns. That is not the space's chosen default - the
23
- * default ordering lives in SpaceService, which cannot be injected here. The POI does not record
24
- * which capture it was placed in, so with several 3D models this is a guess either way.
22
+ * The one the POI was placed in, when it says. Older POIs do not, and for those it is the first
23
+ * 3D visit the database returns - a guess, when the space has several.
25
24
  */
26
25
  private getThreeJsVisitForSpace;
27
26
  updateIconForAllObjects(objects: Ticket[] | Feature[] | Equipment[], tagIcon: string): Promise<POI[]>;
@@ -42,6 +42,7 @@ export declare class MeasurementService {
42
42
  createMeasurementForSpace(commentInput: Comment, dataMeasurements: {
43
43
  measure: any[];
44
44
  sweep: string;
45
+ metadata?: string;
45
46
  }, screenshot: any, spaceID: string): Promise<Measurement>;
46
47
  getModel3DForMeasurement(measurement: Measurement): Promise<string>;
47
48
  getMeasurementsForSpaceForUser(spaceID: string): Promise<Measurement[]>;
@@ -0,0 +1,54 @@
1
+ import { CaptureService } from './models/capture.service';
2
+ import { NavigationService } from './models/navigation.service';
3
+ import * as i0 from "@angular/core";
4
+ interface SweepPosition {
5
+ sweepID: string;
6
+ x: number;
7
+ y: number;
8
+ z: number;
9
+ }
10
+ /**
11
+ * Finds the Matterport sweep a point in a space sits closest to.
12
+ *
13
+ * A tag placed in Matterport is recorded with the sweep it was placed from, and much of the
14
+ * Matterport side keys on that: which floor plan draws the tag, which zone it belongs to, which
15
+ * floor it shows on. A tag placed in the Three.js viewer has no sweep, so it was missing from all
16
+ * of them. Resolving the nearest one at creation - what the tag copy tool already does for copied
17
+ * tags - lets every one of those readers work unchanged instead of each growing its own exception.
18
+ */
19
+ export declare class SweepLocatorService {
20
+ private captureService;
21
+ private navigationService;
22
+ /**
23
+ * Sweeps sit a few metres apart, so a point on a scanned surface always has one nearby. Anything
24
+ * further means the coordinates are not in the Matterport capture's space - a model that was
25
+ * never calibrated - and a sweep picked from that far would file the tag under an arbitrary
26
+ * floor. Leaving it without one is the honest answer there.
27
+ */
28
+ private static readonly MAX_DISTANCE_METRES;
29
+ /** Sweep positions per space. They only change on import, so one load per session is enough. */
30
+ private readonly sweepsBySpace;
31
+ constructor(captureService: CaptureService, navigationService: NavigationService);
32
+ /**
33
+ * The sweep nearest to a point, or null when the space has none within reach.
34
+ *
35
+ * Never throws: this only refines where a tag is filed, and a tag that cannot be filed is still
36
+ * better saved without a sweep than not saved at all.
37
+ */
38
+ findNearestSweep(point: {
39
+ x: number;
40
+ y: number;
41
+ z: number;
42
+ }, spaceID: string): Promise<string | null>;
43
+ /** The sweep closest to a point, or null when none is within reach. */
44
+ nearestSweep(point: {
45
+ x: number;
46
+ y: number;
47
+ z: number;
48
+ }, sweeps: SweepPosition[]): string | null;
49
+ private loadSweeps;
50
+ private fetchSweeps;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<SweepLocatorService, never>;
52
+ static ɵprov: i0.ɵɵInjectableDeclaration<SweepLocatorService>;
53
+ }
54
+ export {};