@smarterplan/ngx-smarterplan-core 1.4.28 → 1.4.30
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/README.md +24 -24
- package/esm2022/lib/components/checkbox-slider/checkbox-slider.component.mjs +3 -3
- package/esm2022/lib/components/csv-export/csv-export.component.mjs +3 -3
- package/esm2022/lib/components/inventory-runs/inventory-files.component.mjs +168 -81
- package/esm2022/lib/components/inventory-runs/inventory-launch.component.mjs +301 -25
- package/esm2022/lib/components/inventory-runs/inventory-runs.component.mjs +14 -3
- package/esm2022/lib/components/loader/loader.component.mjs +3 -3
- package/esm2022/lib/components/menu-bar/avatar/avatar.component.mjs +1 -1
- package/esm2022/lib/components/menu-bar/menu-bar.component.mjs +3 -3
- package/esm2022/lib/components/menu-bar/navigation-bar/navigation-bar.component.mjs +3 -3
- package/esm2022/lib/components/modal-switch-visit/modal-switch-visit.component.mjs +3 -3
- package/esm2022/lib/components/search-bar/search-bar.component.mjs +3 -3
- package/esm2022/lib/components/splat-viewer/splat-viewer.component.mjs +1 -1
- package/esm2022/lib/components/support-modal/support-modal.component.mjs +3 -3
- package/esm2022/lib/config.mjs +1 -1
- package/esm2022/lib/helpers.service.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasImage.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasRenderer.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/NestThermostat.mjs +1 -1
- package/esm2022/lib/matterport-extensions/nest-thermostat/PlaneRenderer.mjs +1 -1
- package/esm2022/lib/matterport-extensions/scene-component/SceneComponent.mjs +1 -1
- package/esm2022/lib/matterport-extensions/security-camera/SecurityCamera.mjs +22 -22
- package/esm2022/lib/matterport-extensions/tv-player/TvPlayer.mjs +1 -1
- package/esm2022/lib/matterport-extensions/view-frustum-mesh/ViewFrustumMesh.mjs +22 -22
- package/esm2022/lib/mattertagData.mjs +1 -1
- package/esm2022/lib/ngx-smarterplan-core.module.mjs +1 -1
- package/esm2022/lib/ngx-smarterplan-core.service.mjs +1 -1
- package/esm2022/lib/pipes/duration-to-string.pipe.mjs +1 -1
- package/esm2022/lib/pipes/format-date-number-to-digits.pipe.mjs +1 -1
- package/esm2022/lib/pipes/hashtag-from-id.pipe.mjs +1 -1
- package/esm2022/lib/pipes/safe-url.pipe.mjs +1 -1
- package/esm2022/lib/pipes/time-date-to-local-string.pipe.mjs +1 -1
- package/esm2022/lib/pipes/username-from-id.pipe.mjs +1 -1
- package/esm2022/lib/services/amplify-cache.service.mjs +1 -1
- package/esm2022/lib/services/base-tab.service.mjs +1 -1
- package/esm2022/lib/services/baseVisibility.service.mjs +1 -1
- package/esm2022/lib/services/content.service.mjs +1 -1
- package/esm2022/lib/services/filter.service.mjs +1 -1
- package/esm2022/lib/services/intervention.service.mjs +1 -1
- package/esm2022/lib/services/locale.service.mjs +1 -1
- package/esm2022/lib/services/matterport-import.service.mjs +1 -1
- package/esm2022/lib/services/matterport-measurement.service.mjs +1 -1
- package/esm2022/lib/services/matterport-navigation.service.mjs +1 -1
- package/esm2022/lib/services/matterport-object3d.service.mjs +1 -1
- package/esm2022/lib/services/matterport-pointer.service.mjs +6 -6
- package/esm2022/lib/services/matterport-tag-copy.service.mjs +930 -138
- package/esm2022/lib/services/matterport-tag.service.mjs +1 -1
- package/esm2022/lib/services/matterport.service.mjs +17 -17
- package/esm2022/lib/services/models/affectation.service.mjs +1 -1
- package/esm2022/lib/services/models/base-object.service.mjs +1 -1
- package/esm2022/lib/services/models/capture.service.mjs +1 -1
- package/esm2022/lib/services/models/comment.service.mjs +1 -1
- package/esm2022/lib/services/models/domain.service.mjs +1 -1
- package/esm2022/lib/services/models/equipment.service.mjs +30 -23
- package/esm2022/lib/services/models/event.service.mjs +1 -1
- package/esm2022/lib/services/models/feature.service.mjs +1 -1
- package/esm2022/lib/services/models/hashtag.service.mjs +1 -1
- package/esm2022/lib/services/models/inventory-storage.mjs +21 -0
- package/esm2022/lib/services/models/inventory.service.mjs +52 -5
- package/esm2022/lib/services/models/layer.service.mjs +1 -1
- package/esm2022/lib/services/models/measurement.service.mjs +1 -1
- package/esm2022/lib/services/models/mission.service.mjs +1 -1
- package/esm2022/lib/services/models/navigation.service.mjs +1 -1
- package/esm2022/lib/services/models/node.service.mjs +1 -1
- package/esm2022/lib/services/models/object3D.service.mjs +1 -1
- package/esm2022/lib/services/models/operation.service.mjs +19 -5
- package/esm2022/lib/services/models/organisation.service.mjs +1 -1
- package/esm2022/lib/services/models/plan.service.mjs +1 -1
- package/esm2022/lib/services/models/poi.service.mjs +27 -27
- package/esm2022/lib/services/models/profile.service.mjs +1 -1
- package/esm2022/lib/services/models/property.service.mjs +1 -1
- package/esm2022/lib/services/models/space.service.mjs +1 -1
- package/esm2022/lib/services/models/template.service.mjs +1 -1
- package/esm2022/lib/services/models/ticket.service.mjs +1 -1
- package/esm2022/lib/services/models/visit.service.mjs +1 -1
- package/esm2022/lib/services/models/zone.service.mjs +1 -1
- package/esm2022/lib/services/navigator.service.mjs +1 -1
- package/esm2022/lib/services/obj-to-glb.mjs +1 -1
- package/esm2022/lib/services/retry-when-throttled.mjs +31 -0
- package/esm2022/lib/services/s3.service.mjs +22 -5
- package/esm2022/lib/services/search.service.mjs +1 -1
- package/esm2022/lib/services/support.service.mjs +1 -1
- package/esm2022/lib/services/sweep-locator.service.mjs +1 -1
- package/esm2022/lib/services/tag.service.mjs +16 -16
- package/esm2022/lib/services/threejs-import.service.mjs +1 -1
- package/esm2022/lib/services/threejs.service.mjs +1 -1
- package/esm2022/lib/services/user.service.mjs +1 -1
- package/esm2022/lib/services/utils/matterport-framing.util.mjs +1 -1
- package/esm2022/lib/services/utils/matterport-transform.util.mjs +26 -1
- package/esm2022/lib/services/utils/object3d-model.util.mjs +155 -0
- package/esm2022/lib/services/utils/tag-archive.util.mjs +89 -0
- package/esm2022/lib/services/validators.service.mjs +1 -1
- package/esm2022/lib/services/viewer.service.mjs +1 -1
- package/esm2022/lib/services/zone-drawer.service.mjs +1 -1
- package/esm2022/lib/services/zoneChange.service.mjs +1 -1
- package/esm2022/lib/tokens/matterport-sdk-key.token.mjs +1 -1
- package/esm2022/lib/tokens/object3d-model-upload.token.mjs +14 -0
- package/esm2022/lib/types.service.mjs +1 -1
- package/esm2022/lib/validators/email.directive.mjs +1 -1
- package/esm2022/lib/validators/no-empty.directive.mjs +1 -1
- package/esm2022/lib/validators/number.directive.mjs +1 -1
- package/esm2022/lib/validators/text.directive.mjs +1 -1
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/smarterplan-ngx-smarterplan-core.mjs +1965 -390
- package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/lib/components/inventory-runs/inventory-files.component.d.ts +37 -8
- package/lib/components/inventory-runs/inventory-launch.component.d.ts +69 -2
- package/lib/components/inventory-runs/inventory-runs.component.d.ts +7 -0
- package/lib/services/matterport-tag-copy.service.d.ts +233 -13
- package/lib/services/models/equipment.service.d.ts +9 -1
- package/lib/services/models/inventory-storage.d.ts +9 -0
- package/lib/services/models/inventory.service.d.ts +14 -2
- package/lib/services/models/operation.service.d.ts +10 -0
- package/lib/services/retry-when-throttled.d.ts +5 -0
- package/lib/services/s3.service.d.ts +15 -0
- package/lib/services/utils/matterport-transform.util.d.ts +14 -0
- package/lib/services/utils/object3d-model.util.d.ts +58 -0
- package/lib/services/utils/tag-archive.util.d.ts +97 -0
- package/lib/tokens/object3d-model-upload.token.d.ts +10 -0
- package/package.json +2 -1
- package/public-api.d.ts +3 -0
- package/src/assets/viewers/splat/convert.html +11 -11
- package/src/assets/viewers/splat/index.html +90 -90
- package/src/assets/viewers/splat/webp.wasm +0 -0
- package/src/assets/vs-app.json +67 -67
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Folder of the library models, as stored in Object3D.path. */
|
|
2
|
+
export declare const OBJECT3D_LIBRARY_FOLDER = "3DObjects/objects/";
|
|
3
|
+
/** Folder the application serves the library models from (see MatterportObject3DService). */
|
|
4
|
+
export declare const OBJECT3D_LIBRARY_ASSET_FOLDER = "assets/3Dobjects/objects/";
|
|
5
|
+
/** Largest model file a user may upload. */
|
|
6
|
+
export declare const OBJECT3D_UPLOAD_MAX_BYTES: number;
|
|
7
|
+
/** S3 folder of the uploaded models; one sub-folder per space. */
|
|
8
|
+
export declare const OBJECT3D_S3_FOLDER = "objects3D/";
|
|
9
|
+
/** Model formats the 3D loaders handle (an S3 model copied between locations keeps its own). */
|
|
10
|
+
export declare const OBJECT3D_MODEL_EXTENSIONS: string[];
|
|
11
|
+
/** Content type the uploaded models are stored with. */
|
|
12
|
+
export declare const GLB_CONTENT_TYPE = "model/gltf-binary";
|
|
13
|
+
/**
|
|
14
|
+
* Why a model file is refused. The values are translation keys of the application, written
|
|
15
|
+
* in English like its other keys.
|
|
16
|
+
*/
|
|
17
|
+
export type Object3dUploadError = 'Only .glb files can be uploaded.' | 'The file is too large (50 MB maximum).' | 'The file is empty.' | 'This file is not a valid .glb model.' | 'This model refers to external files: export it as a single .glb file with embedded textures.';
|
|
18
|
+
/** Where the model of an Object3D is loaded from. */
|
|
19
|
+
export interface Object3DModelSource {
|
|
20
|
+
/** file name without extension */
|
|
21
|
+
object: string;
|
|
22
|
+
/** extension, lower case, without the dot */
|
|
23
|
+
format: string;
|
|
24
|
+
/** url to load; absent for a library model (the loader builds it from object + format) */
|
|
25
|
+
url?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Checks that a file is a self-contained binary glTF 2.0 model, small enough to be uploaded:
|
|
29
|
+
* - name ending in .glb, size between 1 byte and OBJECT3D_UPLOAD_MAX_BYTES;
|
|
30
|
+
* - glb header: magic "glTF", version 2, declared length equal to the file size;
|
|
31
|
+
* - first chunk of type JSON, holding a parseable glTF document of version 2.x;
|
|
32
|
+
* - no buffer nor image pointing at another file or url (only embedded data): such a
|
|
33
|
+
* reference cannot be resolved next to a signed S3 url, and would make the viewer fetch
|
|
34
|
+
* an arbitrary address.
|
|
35
|
+
* The content is only read, never executed. Returns the error, or null when the file is valid.
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateGlbFile(file: Blob & {
|
|
38
|
+
name?: string;
|
|
39
|
+
}): Promise<Object3dUploadError | null>;
|
|
40
|
+
/**
|
|
41
|
+
* S3 key of an uploaded model: under the space's folder, with a file name reduced to safe
|
|
42
|
+
* characters, followed by the upload time (UTC, to the millisecond) and a short random suffix.
|
|
43
|
+
* S3 overwrites an existing key without warning, and a model may be used by several objects
|
|
44
|
+
* (duplicates, copies, imports): two uploads of the same file name must never share a key.
|
|
45
|
+
* The user's file name never decides the folder.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildObject3DModelKey(spaceId: string, fileName: string, now?: Date): string;
|
|
48
|
+
/** File name of a library model ("3DObjects/objects/chair.glb" gives "chair.glb"), null otherwise. */
|
|
49
|
+
export declare function getObject3DLibraryFile(path: string | null | undefined): string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Where to load the model of an Object3D from (see the header of this file). A model uploaded
|
|
52
|
+
* to S3 gets a signed url, valid for a limited time: resolve it when loading, never store it.
|
|
53
|
+
* Null when the path is unusable.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveObject3DModelSource(object3D: {
|
|
56
|
+
path?: string | null;
|
|
57
|
+
s3Bucket?: boolean | null;
|
|
58
|
+
}): Promise<Object3DModelSource | null>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { SpModule } from '../../types.service';
|
|
2
|
+
import { Vec3 } from './matterport-transform.util';
|
|
3
|
+
export declare const TAG_ARCHIVE_FORMAT = "smarterplan-tags";
|
|
4
|
+
/** Bumped on any change of the manifest that an older import could misread. */
|
|
5
|
+
export declare const TAG_ARCHIVE_VERSION = 1;
|
|
6
|
+
export declare const TAG_ARCHIVE_MANIFEST = "manifest.json";
|
|
7
|
+
export declare const TAG_ARCHIVE_FILES_FOLDER = "files/";
|
|
8
|
+
/** Where an archive comes from: shown before the import and written in the import log. */
|
|
9
|
+
export interface TagArchiveOrigin {
|
|
10
|
+
/** origin (scheme + host) of the application that exported: tells the environment apart */
|
|
11
|
+
environment: string;
|
|
12
|
+
/** module of the application that exported: only an application of the same module can import */
|
|
13
|
+
module: SpModule;
|
|
14
|
+
spaceId: string;
|
|
15
|
+
spaceName: string;
|
|
16
|
+
/** ISO date */
|
|
17
|
+
exportedAt: string;
|
|
18
|
+
exportedBy: {
|
|
19
|
+
userID: string | null;
|
|
20
|
+
name: string | null;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** A virtual visit of the exported location, offered as source visit when placing landmarks. */
|
|
24
|
+
export interface TagArchiveVisit {
|
|
25
|
+
name: string;
|
|
26
|
+
model3d: string;
|
|
27
|
+
viewer?: string | null;
|
|
28
|
+
}
|
|
29
|
+
/** Index entry of an S3 file referenced by the data, keyed by its raw S3 key. */
|
|
30
|
+
export interface TagArchiveFileEntry {
|
|
31
|
+
/** path of the file inside the archive; null when it could not be exported */
|
|
32
|
+
path: string | null;
|
|
33
|
+
contentType?: string | null;
|
|
34
|
+
size?: number;
|
|
35
|
+
/** the file did not exist (orphan reference) or could not be downloaded */
|
|
36
|
+
missing?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** One link between a ticket and an equipment (Operation record). */
|
|
39
|
+
export interface TagArchiveOperation {
|
|
40
|
+
ticketID: string;
|
|
41
|
+
equipmentID: string;
|
|
42
|
+
}
|
|
43
|
+
/** Raw records of the exported location. */
|
|
44
|
+
export interface TagArchiveData {
|
|
45
|
+
tickets: any[];
|
|
46
|
+
/** ticket id -> its attachments (Comments) */
|
|
47
|
+
ticketComments: Record<string, any[]>;
|
|
48
|
+
operations: TagArchiveOperation[];
|
|
49
|
+
equipments: any[];
|
|
50
|
+
objects3D: any[];
|
|
51
|
+
features: any[];
|
|
52
|
+
/** feature id -> its media set (Comments) */
|
|
53
|
+
featureComments: Record<string, any[]>;
|
|
54
|
+
measurements: any[];
|
|
55
|
+
/** every POI placed on the sweeps of the location */
|
|
56
|
+
pois: any[];
|
|
57
|
+
/** sweep id -> position, to find the closest sweep of the target visit */
|
|
58
|
+
sweepPositions: Record<string, Vec3>;
|
|
59
|
+
/** hashtag id -> name */
|
|
60
|
+
hashtags: Record<string, string>;
|
|
61
|
+
/** the categories referenced by the records, with their ancestors */
|
|
62
|
+
domains: any[];
|
|
63
|
+
}
|
|
64
|
+
export interface TagArchiveManifest {
|
|
65
|
+
format: string;
|
|
66
|
+
version: number;
|
|
67
|
+
origin: TagArchiveOrigin;
|
|
68
|
+
visits: TagArchiveVisit[];
|
|
69
|
+
/** number of records per kind, displayed before importing */
|
|
70
|
+
counts: Record<string, number>;
|
|
71
|
+
data: TagArchiveData;
|
|
72
|
+
/** raw S3 key -> file of the archive */
|
|
73
|
+
files: Record<string, TagArchiveFileEntry>;
|
|
74
|
+
}
|
|
75
|
+
/** An archive read in memory: its manifest and the bytes of its files, by archive path. */
|
|
76
|
+
export interface TagArchive {
|
|
77
|
+
manifest: TagArchiveManifest;
|
|
78
|
+
files: Record<string, Uint8Array>;
|
|
79
|
+
}
|
|
80
|
+
/** Why an archive cannot be read. `code` is the end of a `matterportCopy.*` translation key. */
|
|
81
|
+
export declare class TagArchiveError extends Error {
|
|
82
|
+
readonly code: string;
|
|
83
|
+
readonly params: Record<string, any>;
|
|
84
|
+
constructor(code: string, params?: Record<string, any>);
|
|
85
|
+
}
|
|
86
|
+
/** Archive path of the n-th exported file. The original name is kept for readability only. */
|
|
87
|
+
export declare function tagArchiveFilePath(index: number, s3Key: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Packs a manifest and its files into a ZIP. Media files are stored without compression:
|
|
90
|
+
* images, videos and models are already compressed, recompressing them only costs time.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildTagArchive(manifest: TagArchiveManifest, files: Record<string, Uint8Array>): Uint8Array;
|
|
93
|
+
/**
|
|
94
|
+
* Reads a ZIP produced by buildTagArchive(). Checks the format and the version, not the
|
|
95
|
+
* module: see MatterportTagCopyService.readTagArchive().
|
|
96
|
+
*/
|
|
97
|
+
export declare function readTagArchive(bytes: Uint8Array): TagArchive;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Whether this application may write 3D model files to S3: a model uploaded by the operator,
|
|
4
|
+
* a library model restored from a tag archive, a model copied with a 3D object.
|
|
5
|
+
*
|
|
6
|
+
* True by default. An application not ready for it yet provides false (see the app.module.ts
|
|
7
|
+
* of smarterplan-museum): tag copies and imports then never create a model file — a 3D object
|
|
8
|
+
* whose model would need one is reported in the log instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare const OBJECT3D_MODEL_UPLOAD_ENABLED: InjectionToken<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smarterplan/ngx-smarterplan-core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.30",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.5.0"
|
|
6
6
|
},
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"@ngx-translate/core": "^17.0.0",
|
|
16
16
|
"@types/hls.js": "^0.12.5",
|
|
17
17
|
"aws-amplify": "^5.0.9",
|
|
18
|
+
"fflate": "^0.7.3",
|
|
18
19
|
"file-saver": "^2.0.5",
|
|
19
20
|
"hls.js": "^0.13.2",
|
|
20
21
|
"js-levenshtein": "^1.1.6",
|
package/public-api.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export * from './lib/services/obj-to-glb';
|
|
|
25
25
|
export * from './lib/services/matterport-tag-copy.service';
|
|
26
26
|
export * from './lib/mattertagData';
|
|
27
27
|
export * from './lib/services/utils/matterport-transform.util';
|
|
28
|
+
export * from './lib/services/utils/tag-archive.util';
|
|
29
|
+
export * from './lib/services/utils/object3d-model.util';
|
|
28
30
|
export * from './lib/services/models/profile.service';
|
|
29
31
|
export * from './lib/services/models/zone.service';
|
|
30
32
|
export * from './lib/services/models/mission.service';
|
|
@@ -75,3 +77,4 @@ export * from './lib/validators/no-empty.directive';
|
|
|
75
77
|
export * from './lib/validators/text.directive';
|
|
76
78
|
export * from './lib/validators/number.directive';
|
|
77
79
|
export * from './lib/tokens/matterport-sdk-key.token';
|
|
80
|
+
export * from './lib/tokens/object3d-model-upload.token';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>SmarterPlan splat converter</title>
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<!-- Opened unseen by the app's 3D models form, which hands it a splat file to turn into .sog. -->
|
|
9
|
-
<script type="module" src="convert-AJMRDWU6.js"></script>
|
|
10
|
-
</body>
|
|
11
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>SmarterPlan splat converter</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<!-- Opened unseen by the app's 3D models form, which hands it a splat file to turn into .sog. -->
|
|
9
|
+
<script type="module" src="convert-AJMRDWU6.js"></script>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<title>SmarterPlan splat viewer</title>
|
|
7
|
-
<!-- SuperSplat's viewer builds its controls inside #viewer; this is their stylesheet. -->
|
|
8
|
-
<link rel="stylesheet" href="viewer.css">
|
|
9
|
-
<style>
|
|
10
|
-
/* The app's colours, which main.ts sets from those the page is opened with; these, the SmarterPlan
|
|
11
|
-
app's, when it is not. The background is also the scene's where there are no splats. */
|
|
12
|
-
:root { --app-accent: rgb(83, 182, 187); --app-background: #e0f7ff; }
|
|
13
|
-
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--app-background); }
|
|
14
|
-
/* SuperSplat's controls in the app's colour rather than its orange. */
|
|
15
|
-
:root .sse-viewer { --sse-accent: var(--app-accent); --sse-grip: color-mix(in srgb, var(--app-accent), white 15%); }
|
|
16
|
-
#viewer { position: absolute; inset: 0; }
|
|
17
|
-
/* The app's tags, over the scene, as Matterport draws them: a disc at the end of a stem standing
|
|
18
|
-
out of the surface, and the tag's name in a bubble on hover. Only the discs take the pointer. */
|
|
19
|
-
#tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
|
|
20
|
-
#stems { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
|
|
21
|
-
#stems line { stroke: #fff; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6)); }
|
|
22
|
-
.tag { position: absolute; left: 0; top: 0; width: 0; height: 0; display: none; }
|
|
23
|
-
.disc {
|
|
24
|
-
position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; padding: 0;
|
|
25
|
-
border: 2px solid #fff; border-radius: 50%; cursor: pointer; pointer-events: auto;
|
|
26
|
-
background-size: 70%; background-position: center; background-repeat: no-repeat;
|
|
27
|
-
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transition: transform 0.15s ease-out;
|
|
28
|
-
}
|
|
29
|
-
.tag:hover .disc { transform: scale(1.3); }
|
|
30
|
-
.bubble {
|
|
31
|
-
position: absolute; bottom: 24px; left: 0; transform: translate(-50%, 6px); opacity: 0;
|
|
32
|
-
padding: 6px 10px; border-radius: 6px; background: #fff; color: #222; font: 13px/1.3 sans-serif;
|
|
33
|
-
white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); pointer-events: none;
|
|
34
|
-
transition: opacity 0.15s ease-out, transform 0.15s ease-out;
|
|
35
|
-
}
|
|
36
|
-
.bubble::after {
|
|
37
|
-
content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px;
|
|
38
|
-
border: 6px solid transparent; border-top-color: #fff;
|
|
39
|
-
}
|
|
40
|
-
.bubble:empty { display: none; }
|
|
41
|
-
.tag:hover .bubble { opacity: 1; transform: translate(-50%, 0); }
|
|
42
|
-
.tag.pointed .disc { animation: pointed 0.6s ease-in-out 3; }
|
|
43
|
-
/* The tag following the pointer while one is placed: where a click would put it. */
|
|
44
|
-
.tag.ghost { opacity: 0.75; }
|
|
45
|
-
.tag.ghost .disc { pointer-events: none; background-color: #fff; border-color: #1E88E5; }
|
|
46
|
-
#stems line.ghost { stroke-dasharray: 4 3; }
|
|
47
|
-
/* While a tag is placed: over the whole scene, taking the click that picks its spot. */
|
|
48
|
-
#placing { position: absolute; inset: 0; z-index: 6; display: none; cursor: crosshair; }
|
|
49
|
-
/* The app shows how loading goes, as for its other viewers: the viewer's own bar would be a second one. */
|
|
50
|
-
.sse-viewer .sse-loadingWrap { display: none !important; }
|
|
51
|
-
#placing.missed { cursor: not-allowed; }
|
|
52
|
-
/* A calibration, in the app's 3D viewer's colours: a green numbered pin where each matched tag
|
|
53
|
-
really is, with a line to it from the tag, faded; and an amber ring round the tag being matched. */
|
|
54
|
-
.pin {
|
|
55
|
-
position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; box-sizing: border-box;
|
|
56
|
-
display: none; border: 2px solid #fff; border-radius: 50%; background: #1E9E5A; color: #fff;
|
|
57
|
-
font: bold 13px/20px sans-serif; text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
|
58
|
-
pointer-events: none; z-index: 1000001;
|
|
59
|
-
}
|
|
60
|
-
#stems line.link { stroke: #1E9E5A; stroke-opacity: 0.75; stroke-dasharray: none; }
|
|
61
|
-
.tag.matched, #stems line.matched { opacity: 0.4; }
|
|
62
|
-
.tag.selected .disc { box-shadow: 0 0 0 4px #FFB103, 0 1px 4px rgba(0, 0, 0, 0.5); }
|
|
63
|
-
/* A measurement, in the app's 3D viewer's colours: amber points and segments, each length on a dark label. */
|
|
64
|
-
.measure-point {
|
|
65
|
-
position: absolute; left: 0; top: 0; width: 12px; height: 12px; box-sizing: border-box; display: none;
|
|
66
|
-
border: 2px solid #fff; border-radius: 50%; background: #FFB103; pointer-events: none; z-index: 1000002;
|
|
67
|
-
}
|
|
68
|
-
#stems line.measure { stroke: #FFB103; stroke-width: 3; filter: none; }
|
|
69
|
-
#stems line.measure.rubber { stroke-opacity: 0.6; }
|
|
70
|
-
.measure-label {
|
|
71
|
-
position: absolute; left: 0; top: 0; display: none; padding: 3px 8px; border-radius: 9px;
|
|
72
|
-
background: rgba(0, 0, 0, 0.78); color: #fff; font: bold 13px/18px sans-serif; white-space: nowrap;
|
|
73
|
-
pointer-events: none; z-index: 1000003;
|
|
74
|
-
}
|
|
75
|
-
.measure-label.rubber { opacity: 0.85; }
|
|
76
|
-
.tag.ghost.measure-ghost .disc { left: -6px; top: -6px; width: 12px; height: 12px; box-sizing: border-box; background: #FFB103; border-color: #fff; }
|
|
77
|
-
.tag.ghost.pin-ghost .disc {
|
|
78
|
-
left: -12px; top: -12px; width: 24px; height: 24px; box-sizing: border-box;
|
|
79
|
-
background: #1E9E5A; border-color: #fff; color: #fff; font: bold 13px/20px sans-serif; text-align: center;
|
|
80
|
-
}
|
|
81
|
-
@keyframes pointed { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.6); } }
|
|
82
|
-
</style>
|
|
83
|
-
</head>
|
|
84
|
-
<body>
|
|
85
|
-
<div id="viewer"></div>
|
|
86
|
-
<div id="tags"><svg id="stems"></svg></div>
|
|
87
|
-
<div id="placing"></div>
|
|
88
|
-
<script type="module" src="viewer-QLWW4L3N.js"></script>
|
|
89
|
-
</body>
|
|
90
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>SmarterPlan splat viewer</title>
|
|
7
|
+
<!-- SuperSplat's viewer builds its controls inside #viewer; this is their stylesheet. -->
|
|
8
|
+
<link rel="stylesheet" href="viewer.css">
|
|
9
|
+
<style>
|
|
10
|
+
/* The app's colours, which main.ts sets from those the page is opened with; these, the SmarterPlan
|
|
11
|
+
app's, when it is not. The background is also the scene's where there are no splats. */
|
|
12
|
+
:root { --app-accent: rgb(83, 182, 187); --app-background: #e0f7ff; }
|
|
13
|
+
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--app-background); }
|
|
14
|
+
/* SuperSplat's controls in the app's colour rather than its orange. */
|
|
15
|
+
:root .sse-viewer { --sse-accent: var(--app-accent); --sse-grip: color-mix(in srgb, var(--app-accent), white 15%); }
|
|
16
|
+
#viewer { position: absolute; inset: 0; }
|
|
17
|
+
/* The app's tags, over the scene, as Matterport draws them: a disc at the end of a stem standing
|
|
18
|
+
out of the surface, and the tag's name in a bubble on hover. Only the discs take the pointer. */
|
|
19
|
+
#tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
|
|
20
|
+
#stems { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
|
|
21
|
+
#stems line { stroke: #fff; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6)); }
|
|
22
|
+
.tag { position: absolute; left: 0; top: 0; width: 0; height: 0; display: none; }
|
|
23
|
+
.disc {
|
|
24
|
+
position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; padding: 0;
|
|
25
|
+
border: 2px solid #fff; border-radius: 50%; cursor: pointer; pointer-events: auto;
|
|
26
|
+
background-size: 70%; background-position: center; background-repeat: no-repeat;
|
|
27
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transition: transform 0.15s ease-out;
|
|
28
|
+
}
|
|
29
|
+
.tag:hover .disc { transform: scale(1.3); }
|
|
30
|
+
.bubble {
|
|
31
|
+
position: absolute; bottom: 24px; left: 0; transform: translate(-50%, 6px); opacity: 0;
|
|
32
|
+
padding: 6px 10px; border-radius: 6px; background: #fff; color: #222; font: 13px/1.3 sans-serif;
|
|
33
|
+
white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); pointer-events: none;
|
|
34
|
+
transition: opacity 0.15s ease-out, transform 0.15s ease-out;
|
|
35
|
+
}
|
|
36
|
+
.bubble::after {
|
|
37
|
+
content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px;
|
|
38
|
+
border: 6px solid transparent; border-top-color: #fff;
|
|
39
|
+
}
|
|
40
|
+
.bubble:empty { display: none; }
|
|
41
|
+
.tag:hover .bubble { opacity: 1; transform: translate(-50%, 0); }
|
|
42
|
+
.tag.pointed .disc { animation: pointed 0.6s ease-in-out 3; }
|
|
43
|
+
/* The tag following the pointer while one is placed: where a click would put it. */
|
|
44
|
+
.tag.ghost { opacity: 0.75; }
|
|
45
|
+
.tag.ghost .disc { pointer-events: none; background-color: #fff; border-color: #1E88E5; }
|
|
46
|
+
#stems line.ghost { stroke-dasharray: 4 3; }
|
|
47
|
+
/* While a tag is placed: over the whole scene, taking the click that picks its spot. */
|
|
48
|
+
#placing { position: absolute; inset: 0; z-index: 6; display: none; cursor: crosshair; }
|
|
49
|
+
/* The app shows how loading goes, as for its other viewers: the viewer's own bar would be a second one. */
|
|
50
|
+
.sse-viewer .sse-loadingWrap { display: none !important; }
|
|
51
|
+
#placing.missed { cursor: not-allowed; }
|
|
52
|
+
/* A calibration, in the app's 3D viewer's colours: a green numbered pin where each matched tag
|
|
53
|
+
really is, with a line to it from the tag, faded; and an amber ring round the tag being matched. */
|
|
54
|
+
.pin {
|
|
55
|
+
position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; box-sizing: border-box;
|
|
56
|
+
display: none; border: 2px solid #fff; border-radius: 50%; background: #1E9E5A; color: #fff;
|
|
57
|
+
font: bold 13px/20px sans-serif; text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
|
58
|
+
pointer-events: none; z-index: 1000001;
|
|
59
|
+
}
|
|
60
|
+
#stems line.link { stroke: #1E9E5A; stroke-opacity: 0.75; stroke-dasharray: none; }
|
|
61
|
+
.tag.matched, #stems line.matched { opacity: 0.4; }
|
|
62
|
+
.tag.selected .disc { box-shadow: 0 0 0 4px #FFB103, 0 1px 4px rgba(0, 0, 0, 0.5); }
|
|
63
|
+
/* A measurement, in the app's 3D viewer's colours: amber points and segments, each length on a dark label. */
|
|
64
|
+
.measure-point {
|
|
65
|
+
position: absolute; left: 0; top: 0; width: 12px; height: 12px; box-sizing: border-box; display: none;
|
|
66
|
+
border: 2px solid #fff; border-radius: 50%; background: #FFB103; pointer-events: none; z-index: 1000002;
|
|
67
|
+
}
|
|
68
|
+
#stems line.measure { stroke: #FFB103; stroke-width: 3; filter: none; }
|
|
69
|
+
#stems line.measure.rubber { stroke-opacity: 0.6; }
|
|
70
|
+
.measure-label {
|
|
71
|
+
position: absolute; left: 0; top: 0; display: none; padding: 3px 8px; border-radius: 9px;
|
|
72
|
+
background: rgba(0, 0, 0, 0.78); color: #fff; font: bold 13px/18px sans-serif; white-space: nowrap;
|
|
73
|
+
pointer-events: none; z-index: 1000003;
|
|
74
|
+
}
|
|
75
|
+
.measure-label.rubber { opacity: 0.85; }
|
|
76
|
+
.tag.ghost.measure-ghost .disc { left: -6px; top: -6px; width: 12px; height: 12px; box-sizing: border-box; background: #FFB103; border-color: #fff; }
|
|
77
|
+
.tag.ghost.pin-ghost .disc {
|
|
78
|
+
left: -12px; top: -12px; width: 24px; height: 24px; box-sizing: border-box;
|
|
79
|
+
background: #1E9E5A; border-color: #fff; color: #fff; font: bold 13px/20px sans-serif; text-align: center;
|
|
80
|
+
}
|
|
81
|
+
@keyframes pointed { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.6); } }
|
|
82
|
+
</style>
|
|
83
|
+
</head>
|
|
84
|
+
<body>
|
|
85
|
+
<div id="viewer"></div>
|
|
86
|
+
<div id="tags"><svg id="stems"></svg></div>
|
|
87
|
+
<div id="placing"></div>
|
|
88
|
+
<script type="module" src="viewer-QLWW4L3N.js"></script>
|
|
89
|
+
</body>
|
|
90
|
+
</html>
|
|
File without changes
|
package/src/assets/vs-app.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.0",
|
|
3
|
-
"payload": {
|
|
4
|
-
"objects": [
|
|
5
|
-
{
|
|
6
|
-
"name": "slot_camera",
|
|
7
|
-
"position": {
|
|
8
|
-
"x": 2.8,
|
|
9
|
-
"y": 2.4,
|
|
10
|
-
"z": 10.71
|
|
11
|
-
},
|
|
12
|
-
"rotation": {
|
|
13
|
-
"x": 0,
|
|
14
|
-
"y": -22,
|
|
15
|
-
"z": 0
|
|
16
|
-
},
|
|
17
|
-
"scale": {
|
|
18
|
-
"x": 1,
|
|
19
|
-
"y": 1,
|
|
20
|
-
"z": 1
|
|
21
|
-
},
|
|
22
|
-
"components": [
|
|
23
|
-
{
|
|
24
|
-
"type": "mp.gltfLoader",
|
|
25
|
-
"inputs": {
|
|
26
|
-
"url": "https://static.matterport.com/showcase-sdk/examples/assets-1.0-2-g6b74572/assets/models/camera-1/scene.gltf",
|
|
27
|
-
"localScale": { "x": 0.0008, "y": 0.0008, "z": 0.0008 },
|
|
28
|
-
"localRotation": { "x": 0, "y": 90, "z": 0 }
|
|
29
|
-
},
|
|
30
|
-
"events": {
|
|
31
|
-
"INTERACTION.CLICK": false,
|
|
32
|
-
"INTERACTION.HOVER": false,
|
|
33
|
-
"INTERACTION.DRAG": false
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"type": "mp.securityCamera",
|
|
38
|
-
"inputs": {
|
|
39
|
-
"nearPlane": 0.1,
|
|
40
|
-
"farPlane": 10,
|
|
41
|
-
"horizontalFOV": 52,
|
|
42
|
-
"aspect": 1.7777777777777777,
|
|
43
|
-
"localPosition": {
|
|
44
|
-
"x": 0,
|
|
45
|
-
"y": 0.18,
|
|
46
|
-
"z": -0.3
|
|
47
|
-
},
|
|
48
|
-
"localRotation": {
|
|
49
|
-
"x": -15,
|
|
50
|
-
"y": 0,
|
|
51
|
-
"z": 0
|
|
52
|
-
},
|
|
53
|
-
"color": 65280,
|
|
54
|
-
"panPeriod": 5,
|
|
55
|
-
"panAngle": -45
|
|
56
|
-
},
|
|
57
|
-
"events": {
|
|
58
|
-
"INTERACTION.CLICK": false,
|
|
59
|
-
"INTERACTION.HOVER": false,
|
|
60
|
-
"INTERACTION.DRAG": false
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"payload": {
|
|
4
|
+
"objects": [
|
|
5
|
+
{
|
|
6
|
+
"name": "slot_camera",
|
|
7
|
+
"position": {
|
|
8
|
+
"x": 2.8,
|
|
9
|
+
"y": 2.4,
|
|
10
|
+
"z": 10.71
|
|
11
|
+
},
|
|
12
|
+
"rotation": {
|
|
13
|
+
"x": 0,
|
|
14
|
+
"y": -22,
|
|
15
|
+
"z": 0
|
|
16
|
+
},
|
|
17
|
+
"scale": {
|
|
18
|
+
"x": 1,
|
|
19
|
+
"y": 1,
|
|
20
|
+
"z": 1
|
|
21
|
+
},
|
|
22
|
+
"components": [
|
|
23
|
+
{
|
|
24
|
+
"type": "mp.gltfLoader",
|
|
25
|
+
"inputs": {
|
|
26
|
+
"url": "https://static.matterport.com/showcase-sdk/examples/assets-1.0-2-g6b74572/assets/models/camera-1/scene.gltf",
|
|
27
|
+
"localScale": { "x": 0.0008, "y": 0.0008, "z": 0.0008 },
|
|
28
|
+
"localRotation": { "x": 0, "y": 90, "z": 0 }
|
|
29
|
+
},
|
|
30
|
+
"events": {
|
|
31
|
+
"INTERACTION.CLICK": false,
|
|
32
|
+
"INTERACTION.HOVER": false,
|
|
33
|
+
"INTERACTION.DRAG": false
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "mp.securityCamera",
|
|
38
|
+
"inputs": {
|
|
39
|
+
"nearPlane": 0.1,
|
|
40
|
+
"farPlane": 10,
|
|
41
|
+
"horizontalFOV": 52,
|
|
42
|
+
"aspect": 1.7777777777777777,
|
|
43
|
+
"localPosition": {
|
|
44
|
+
"x": 0,
|
|
45
|
+
"y": 0.18,
|
|
46
|
+
"z": -0.3
|
|
47
|
+
},
|
|
48
|
+
"localRotation": {
|
|
49
|
+
"x": -15,
|
|
50
|
+
"y": 0,
|
|
51
|
+
"z": 0
|
|
52
|
+
},
|
|
53
|
+
"color": 65280,
|
|
54
|
+
"panPeriod": 5,
|
|
55
|
+
"panAngle": -45
|
|
56
|
+
},
|
|
57
|
+
"events": {
|
|
58
|
+
"INTERACTION.CLICK": false,
|
|
59
|
+
"INTERACTION.HOVER": false,
|
|
60
|
+
"INTERACTION.DRAG": false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|