@realsee/dnalogel 2.0.0-alpha.10 → 2.0.0-alpha.13
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/CSS3DRenderPlugin/index.js +17 -14
- package/dist/CameraMovementPlugin/index.js +40 -15
- package/dist/ModelChassisCompassPlugin/index.js +32 -6
- package/dist/ModelEntryDoorGuidePlugin/index.js +48 -18
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/index.js +679 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +55 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/index.js +71 -28
- package/dist/PanoCompassPlugin/index.js +311 -164
- package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
- package/dist/PanoMeasurePlugin/index.js +1337 -583
- package/dist/PanoRulerPlugin/index.js +32 -5
- package/dist/PanoSpatialTagPlugin/index.js +73 -38
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +678 -439
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +164 -72
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +403 -230
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +3596 -1612
- package/dist/index.js +3602 -1616
- package/dist/index.umd.js +3605 -1620
- package/docs/assets/main.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
- package/docs/modules.html +12 -12
- package/libs/CSS3DRenderPlugin/index.js +16 -13
- package/libs/CameraMovementPlugin/index.js +24 -15
- package/libs/ModelChassisCompassPlugin/index.js +14 -5
- package/libs/ModelEntryDoorGuidePlugin/index.js +24 -12
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +422 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/index.js +172 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +55 -0
- package/libs/ModelItemLabelPlugin/typings.js +6 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +64 -23
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +7 -5
- package/libs/PanoCompassPlugin/index.js +225 -128
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +68 -13
- package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +234 -152
- package/libs/PanoMeasurePlugin/Controller/index.js +131 -47
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.js +60 -10
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +59 -14
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +60 -10
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +83 -37
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +61 -30
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +3 -2
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoRulerPlugin/index.js +16 -5
- package/libs/PanoSpatialTagPlugin/Components/tag.js +9 -9
- package/libs/PanoSpatialTagPlugin/index.js +11 -9
- package/libs/floorplan/Components/BaseImage.js +10 -5
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +5 -6
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +24 -11
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +77 -69
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +3 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +1 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +457 -273
- package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +33 -22
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +97 -36
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +232 -108
- package/libs/floorplan/utils/formatData.js +43 -28
- package/libs/floorplan/utils/formatPosition.js +1 -1
- package/libs/index.d.ts +1 -0
- package/libs/index.js +2 -0
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/five/changeMode.js +23 -12
- package/libs/shared-utils/getPxmm.js +1 -1
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/three/loadFbxObj.js +20 -9
- package/libs/shared-utils/three/loadTexture.js +17 -6
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.js +36 -6
- package/libs/shared-utils/to.js +21 -10
- package/libs/shared-utils/useDebounce.js +1 -1
- package/libs/shared-utils/useThrottle.js +2 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -34
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import ItemLabelComponent from './ItemLabelComponent.svelte';
|
|
2
|
+
import type { Subscribe } from "@realsee/five";
|
|
3
|
+
import { PluginEvent } from "./events.type";
|
|
4
|
+
export declare enum DISPLAY_STRATEGY_TYPE {
|
|
5
|
+
SMALL = "small",
|
|
6
|
+
MIDLLE = "middle",
|
|
7
|
+
LARGE = "large"
|
|
8
|
+
}
|
|
9
|
+
export interface ModelItemLabelPluginParametersType {
|
|
10
|
+
modelOcclusionEnable?: boolean;
|
|
11
|
+
displayStrategyType?: Partial<DISPLAY_STRATEGY_TYPE>;
|
|
12
|
+
}
|
|
13
|
+
export interface ModelItemLabelPluginData {
|
|
14
|
+
model_item_labels: Readonly<{
|
|
15
|
+
id: string;
|
|
16
|
+
library: string;
|
|
17
|
+
name: string;
|
|
18
|
+
size: [number, number, number];
|
|
19
|
+
center: [number, number, number];
|
|
20
|
+
position: [number, number, number];
|
|
21
|
+
type: string[];
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}>[];
|
|
24
|
+
}
|
|
25
|
+
export interface ItemLabel {
|
|
26
|
+
id: string;
|
|
27
|
+
library: string;
|
|
28
|
+
name: string;
|
|
29
|
+
size: [number, number, number];
|
|
30
|
+
center: [number, number, number];
|
|
31
|
+
position: [number, number, number];
|
|
32
|
+
type: string[];
|
|
33
|
+
modelPosition: [number, number, number];
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
36
|
+
export interface ModelItemLabelPluginExportReturnsType {
|
|
37
|
+
appendTo: (wrapper: Element) => void;
|
|
38
|
+
load: (data: ModelItemLabelPluginData) => void;
|
|
39
|
+
disable: () => void;
|
|
40
|
+
enable: () => void;
|
|
41
|
+
dispose: () => void;
|
|
42
|
+
hooks: Subscribe<PluginEvent>;
|
|
43
|
+
}
|
|
44
|
+
export interface ModelItemLabelPluginState {
|
|
45
|
+
container: HTMLDivElement;
|
|
46
|
+
data: ModelItemLabelPluginData | null;
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
itemLabels: ItemLabel[];
|
|
49
|
+
wrapper: HTMLElement | null;
|
|
50
|
+
fiveModeEnabled: boolean;
|
|
51
|
+
app?: ItemLabelComponent | undefined;
|
|
52
|
+
hooks: Subscribe<PluginEvent>;
|
|
53
|
+
modelOcclusionEnable: boolean;
|
|
54
|
+
displayStrategyType: Partial<DISPLAY_STRATEGY_TYPE>;
|
|
55
|
+
}
|
|
@@ -120,7 +120,7 @@ function get_each_context(ctx, list, i) {
|
|
|
120
120
|
return child_ctx;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
// (
|
|
123
|
+
// (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
|
|
124
124
|
function create_each_block(key_1, ctx) {
|
|
125
125
|
let first;
|
|
126
126
|
let roomlabelitem;
|
|
@@ -275,15 +275,15 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
275
275
|
|
|
276
276
|
function getFormatedRoomLabels(five, labels) {
|
|
277
277
|
const newLabels = labels.map(roomLabelItem => {
|
|
278
|
-
//
|
|
278
|
+
// 计算是否可见,如果不可见,不会更新位置
|
|
279
279
|
const visible = getLabelVisible(five, roomLabelItem);
|
|
280
280
|
|
|
281
|
-
if (!visible) return {
|
|
281
|
+
if (!visible) return Object.assign(Object.assign({}, roomLabelItem), { visible });
|
|
282
282
|
|
|
283
283
|
// 更新位置
|
|
284
284
|
const transform = getLabelTransform(five, roomLabelItem);
|
|
285
285
|
|
|
286
|
-
return {
|
|
286
|
+
return Object.assign(Object.assign({}, roomLabelItem), { visible, transform });
|
|
287
287
|
});
|
|
288
288
|
|
|
289
289
|
const sortedRoomLabelItems = newLabels.filter(({ visible }) => visible).map(roomLabelItem => ({
|
|
@@ -293,7 +293,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
293
293
|
|
|
294
294
|
return newLabels.map(roomLabelItem => {
|
|
295
295
|
const sortIndex = sortedRoomLabelItems.findIndex(item => item.roomLabelItem.id === roomLabelItem.id);
|
|
296
|
-
if (sortIndex !== undefined) return {
|
|
296
|
+
if (sortIndex !== undefined) return Object.assign(Object.assign({}, roomLabelItem), { zIndex: sortIndex * 10 });
|
|
297
297
|
return roomLabelItem;
|
|
298
298
|
});
|
|
299
299
|
}
|
|
@@ -303,9 +303,11 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
five.on('cameraUpdate', onFiveCameraUpdate);
|
|
306
|
+
five.on('modelShownFloorChange', onFiveCameraUpdate);
|
|
306
307
|
|
|
307
308
|
svelte.onDestroy(() => {
|
|
308
309
|
five.off('cameraUpdate', onFiveCameraUpdate);
|
|
310
|
+
five.off('modelShownFloorChange', onFiveCameraUpdate);
|
|
309
311
|
});
|
|
310
312
|
|
|
311
313
|
svelte.onMount(() => {
|
|
@@ -350,14 +352,69 @@ function parseModelRoomLabelPluginData(data) {
|
|
|
350
352
|
}
|
|
351
353
|
|
|
352
354
|
class ModelRoomLabelController {
|
|
353
|
-
five;
|
|
354
|
-
enabled = true;
|
|
355
|
-
fiveModeEnabled;
|
|
356
|
-
app = undefined;
|
|
357
|
-
wrapper;
|
|
358
|
-
roomLabels = [];
|
|
359
|
-
container = document.createElement('div');
|
|
360
355
|
constructor(five) {
|
|
356
|
+
Object.defineProperty(this, "five", {
|
|
357
|
+
enumerable: true,
|
|
358
|
+
configurable: true,
|
|
359
|
+
writable: true,
|
|
360
|
+
value: void 0
|
|
361
|
+
});
|
|
362
|
+
Object.defineProperty(this, "enabled", {
|
|
363
|
+
enumerable: true,
|
|
364
|
+
configurable: true,
|
|
365
|
+
writable: true,
|
|
366
|
+
value: true
|
|
367
|
+
});
|
|
368
|
+
Object.defineProperty(this, "fiveModeEnabled", {
|
|
369
|
+
enumerable: true,
|
|
370
|
+
configurable: true,
|
|
371
|
+
writable: true,
|
|
372
|
+
value: void 0
|
|
373
|
+
});
|
|
374
|
+
Object.defineProperty(this, "app", {
|
|
375
|
+
enumerable: true,
|
|
376
|
+
configurable: true,
|
|
377
|
+
writable: true,
|
|
378
|
+
value: undefined
|
|
379
|
+
});
|
|
380
|
+
Object.defineProperty(this, "wrapper", {
|
|
381
|
+
enumerable: true,
|
|
382
|
+
configurable: true,
|
|
383
|
+
writable: true,
|
|
384
|
+
value: void 0
|
|
385
|
+
});
|
|
386
|
+
Object.defineProperty(this, "roomLabels", {
|
|
387
|
+
enumerable: true,
|
|
388
|
+
configurable: true,
|
|
389
|
+
writable: true,
|
|
390
|
+
value: []
|
|
391
|
+
});
|
|
392
|
+
Object.defineProperty(this, "container", {
|
|
393
|
+
enumerable: true,
|
|
394
|
+
configurable: true,
|
|
395
|
+
writable: true,
|
|
396
|
+
value: document.createElement('div')
|
|
397
|
+
});
|
|
398
|
+
/** 监听 Five Mode 变化
|
|
399
|
+
* @description
|
|
400
|
+
* Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
|
|
401
|
+
*/
|
|
402
|
+
Object.defineProperty(this, "onFiveModeChange", {
|
|
403
|
+
enumerable: true,
|
|
404
|
+
configurable: true,
|
|
405
|
+
writable: true,
|
|
406
|
+
value: (mode) => {
|
|
407
|
+
if (mode !== 'Floorplan') {
|
|
408
|
+
this.fiveModeEnabled = false;
|
|
409
|
+
this.render();
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
this.five.once('initAnimationEnded', () => {
|
|
413
|
+
this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
|
|
414
|
+
this.render();
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
});
|
|
361
418
|
this.five = five;
|
|
362
419
|
this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
|
|
363
420
|
// init container style
|
|
@@ -410,26 +467,12 @@ class ModelRoomLabelController {
|
|
|
410
467
|
this.render();
|
|
411
468
|
return this;
|
|
412
469
|
}
|
|
413
|
-
/** 监听 Five Mode 变化
|
|
414
|
-
* @description
|
|
415
|
-
* Mode 不符合要求时,立刻消失,满足要求时,需要等待动画结束再展示
|
|
416
|
-
*/
|
|
417
|
-
onFiveModeChange = (mode) => {
|
|
418
|
-
if (mode !== 'Floorplan') {
|
|
419
|
-
this.fiveModeEnabled = false;
|
|
420
|
-
this.render();
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
this.five.once('initAnimationEnded', () => {
|
|
424
|
-
this.fiveModeEnabled = this.five.currentMode === 'Floorplan';
|
|
425
|
-
this.render();
|
|
426
|
-
});
|
|
427
|
-
};
|
|
428
470
|
render() {
|
|
471
|
+
var _a;
|
|
429
472
|
if (!this.wrapper)
|
|
430
473
|
return;
|
|
431
474
|
if (!this.enabled || !this.fiveModeEnabled) {
|
|
432
|
-
this.app
|
|
475
|
+
(_a = this.app) === null || _a === void 0 ? void 0 : _a.$destroy();
|
|
433
476
|
this.app = undefined;
|
|
434
477
|
return;
|
|
435
478
|
}
|