@realsee/dnalogel 2.0.0-alpha.26-beta → 2.0.0-alpha.28-beta
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/CHANGELOG.md +10 -0
- package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
- package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +4 -6
- package/dist/CameraMovementPlugin/index.js +12 -12
- package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/dist/ModelEntryDoorGuidePlugin/index.js +0 -5
- package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +8 -3
- package/dist/ModelItemLabelPlugin/index.js +14 -8
- package/dist/ModelRoomLabelPlugin/index.js +82 -46
- package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +4 -3
- package/dist/ModelTVVideoPlugin/index.js +3 -3
- package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
- package/dist/ModelViewPlugin/index.d.ts +3 -16
- package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/dist/PanoCompassPlugin/index.d.ts +4 -47
- package/dist/PanoCompassPlugin/index.js +5 -4
- package/dist/PanoMeasurePlugin/index.d.ts +1 -1
- package/dist/PanoMeasurePlugin/index.js +4 -1
- package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.d.ts +4 -30
- package/dist/PanoRulerPlugin/index.js +0 -5
- package/dist/PanoSpatialTagPlugin/Plugin.d.ts +33 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +4 -32
- package/dist/PanoSpatialTagPlugin/index.js +23 -21
- package/dist/_index.d.ts +30 -0
- package/dist/index.d.ts +16 -29
- package/dist/index.es.js +122 -70
- package/dist/index.js +145 -90
- package/dist/index.umd.js +145 -90
- package/docs/assets/search.js +1 -1
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/classes/PanoFloorplanRadarPluginController.html +3 -0
- package/docs/enums/CameraMovementEffect.html +3 -0
- package/docs/enums/DIRECTION.html +1 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/enums/Rotation.html +3 -0
- package/docs/index.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
- 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/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
- package/docs/interfaces/Point.html +1 -0
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -0
- package/docs/interfaces/RoomInfo.html +1 -0
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +8 -8
- package/docs/modules.html +20 -12
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
- package/libs/CSS3DRenderPlugin/index.js +2 -181
- package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
- package/libs/CameraMovementPlugin/index.d.ts +4 -6
- package/libs/CameraMovementPlugin/index.js +3 -158
- package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/libs/ModelChassisCompassPlugin/Plugin.js +75 -0
- package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/libs/ModelChassisCompassPlugin/index.js +2 -74
- package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -139
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +1 -1
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +8 -3
- package/libs/ModelItemLabelPlugin/index.js +7 -119
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -47
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
- package/libs/ModelTVVideoPlugin/index.d.ts +4 -3
- package/libs/ModelTVVideoPlugin/index.js +3 -253
- package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
- package/libs/ModelViewPlugin/Plugin.js +160 -0
- package/libs/ModelViewPlugin/index.d.ts +3 -16
- package/libs/ModelViewPlugin/index.js +2 -159
- package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/libs/PanoCompassPlugin/Plugin.js +249 -0
- package/libs/PanoCompassPlugin/index.d.ts +4 -47
- package/libs/PanoCompassPlugin/index.js +3 -249
- package/libs/PanoMeasurePlugin/index.d.ts +1 -1
- package/libs/PanoMeasurePlugin/index.js +1 -1
- package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/libs/PanoRulerPlugin/Plugin.js +402 -0
- package/libs/PanoRulerPlugin/index.d.ts +4 -30
- package/libs/PanoRulerPlugin/index.js +2 -401
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +33 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +415 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +4 -32
- package/libs/PanoSpatialTagPlugin/index.js +4 -412
- package/libs/_index.d.ts +30 -0
- package/libs/_index.js +18 -0
- package/libs/index.d.ts +16 -29
- package/libs/index.js +25 -16
- package/package.json +6 -5
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as THREE from 'three';
|
|
|
2
2
|
import { Vector3, Scene, Group, Raycaster, MeshBasicMaterial, CanvasTexture, AnimationMixer, Vector2, Color, TextureLoader, PlaneGeometry, sRGBEncoding, Mesh, CurvePath, LineCurve3, TubeGeometry, DoubleSide, SphereGeometry } from 'three';
|
|
3
3
|
import { CSS3DRenderer, CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
4
4
|
import { Line as Line$1 } from '@realsee/five/line';
|
|
5
|
-
import { SvelteComponent, init, safe_not_equal, append_styles, element, text, space, attr, set_style, toggle_class, insert, append, listen, set_data, noop, detach, empty, create_component, mount_component, transition_in, transition_out, destroy_component, add_render_callback, add_resize_listener, group_outros, update_keyed_each, outro_and_destroy_block, check_outros, src_url_equal, HtmlTag, get_spread_update, assign, destroy_block, destroy_each, svg_element, null_to_empty, create_in_transition, binding_callbacks } from 'svelte/internal';
|
|
5
|
+
import { SvelteComponent, init, safe_not_equal, append_styles, element, text, space, attr, set_style, toggle_class, insert, append, listen, set_data, noop, detach, empty, create_component, mount_component, transition_in, transition_out, destroy_component, add_render_callback, add_resize_listener, group_outros, update_keyed_each, outro_and_destroy_block, check_outros, globals, src_url_equal, HtmlTag, get_spread_update, assign, destroy_block, destroy_each, svg_element, null_to_empty, create_in_transition, binding_callbacks } from 'svelte/internal';
|
|
6
6
|
import { onDestroy, onMount, afterUpdate, beforeUpdate } from 'svelte';
|
|
7
7
|
import { linear } from 'svelte/easing';
|
|
8
8
|
import { fade } from 'svelte/transition';
|
|
@@ -562,17 +562,19 @@ class RoomLabelItem extends SvelteComponent {
|
|
|
562
562
|
|
|
563
563
|
/* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
|
|
564
564
|
|
|
565
|
+
const { Map: Map_1 } = globals;
|
|
566
|
+
|
|
565
567
|
function add_css$l(target) {
|
|
566
568
|
append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
|
|
567
569
|
}
|
|
568
570
|
|
|
569
571
|
function get_each_context$9(ctx, list, i) {
|
|
570
572
|
const child_ctx = ctx.slice();
|
|
571
|
-
child_ctx[
|
|
573
|
+
child_ctx[12] = list[i];
|
|
572
574
|
return child_ctx;
|
|
573
575
|
}
|
|
574
576
|
|
|
575
|
-
// (
|
|
577
|
+
// (82:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
|
|
576
578
|
function create_each_block$9(key_1, ctx) {
|
|
577
579
|
let first;
|
|
578
580
|
let roomlabelitem;
|
|
@@ -580,7 +582,7 @@ function create_each_block$9(key_1, ctx) {
|
|
|
580
582
|
|
|
581
583
|
roomlabelitem = new RoomLabelItem({
|
|
582
584
|
props: {
|
|
583
|
-
roomLabel: /*roomLableItem*/ ctx[
|
|
585
|
+
roomLabel: /*roomLableItem*/ ctx[12],
|
|
584
586
|
five: /*five*/ ctx[1]
|
|
585
587
|
}
|
|
586
588
|
});
|
|
@@ -601,7 +603,7 @@ function create_each_block$9(key_1, ctx) {
|
|
|
601
603
|
p(new_ctx, dirty) {
|
|
602
604
|
ctx = new_ctx;
|
|
603
605
|
const roomlabelitem_changes = {};
|
|
604
|
-
if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[
|
|
606
|
+
if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[12];
|
|
605
607
|
if (dirty & /*five*/ 2) roomlabelitem_changes.five = /*five*/ ctx[1];
|
|
606
608
|
roomlabelitem.$set(roomlabelitem_changes);
|
|
607
609
|
},
|
|
@@ -624,11 +626,11 @@ function create_each_block$9(key_1, ctx) {
|
|
|
624
626
|
function create_fragment$p(ctx) {
|
|
625
627
|
let div;
|
|
626
628
|
let each_blocks = [];
|
|
627
|
-
let each_1_lookup = new
|
|
629
|
+
let each_1_lookup = new Map_1();
|
|
628
630
|
let div_resize_listener;
|
|
629
631
|
let current;
|
|
630
632
|
let each_value = /*roomLabels*/ ctx[0];
|
|
631
|
-
const get_key = ctx => /*roomLableItem*/ ctx[
|
|
633
|
+
const get_key = ctx => /*roomLableItem*/ ctx[12].id;
|
|
632
634
|
|
|
633
635
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
634
636
|
let child_ctx = get_each_context$9(ctx, each_value, i);
|
|
@@ -645,7 +647,7 @@ function create_fragment$p(ctx) {
|
|
|
645
647
|
}
|
|
646
648
|
|
|
647
649
|
attr(div, "class", "room-labels-container svelte-9eg4zi");
|
|
648
|
-
add_render_callback(() => /*div_elementresize_handler*/ ctx[
|
|
650
|
+
add_render_callback(() => /*div_elementresize_handler*/ ctx[6].call(div));
|
|
649
651
|
},
|
|
650
652
|
m(target, anchor) {
|
|
651
653
|
insert(target, div, anchor);
|
|
@@ -654,7 +656,7 @@ function create_fragment$p(ctx) {
|
|
|
654
656
|
each_blocks[i].m(div, null);
|
|
655
657
|
}
|
|
656
658
|
|
|
657
|
-
div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[
|
|
659
|
+
div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[6].bind(div));
|
|
658
660
|
current = true;
|
|
659
661
|
},
|
|
660
662
|
p(ctx, [dirty]) {
|
|
@@ -694,22 +696,17 @@ function create_fragment$p(ctx) {
|
|
|
694
696
|
}
|
|
695
697
|
|
|
696
698
|
function instance$p($$self, $$props, $$invalidate) {
|
|
699
|
+
let rendererSize;
|
|
697
700
|
let { five } = $$props;
|
|
698
701
|
let { roomLabels } = $$props;
|
|
699
702
|
let containerWidth;
|
|
700
703
|
let containerHeight;
|
|
704
|
+
let shownFloor = null;
|
|
701
705
|
|
|
702
|
-
function getLabelVisible(
|
|
703
|
-
// 先看是不是在当前展示的楼层上
|
|
704
|
-
const isLabelInFloor = five.model.shownFloor === null || roomLabelItem.floorIndex === five.model.shownFloor;
|
|
705
|
-
|
|
706
|
-
if (!isLabelInFloor) return false;
|
|
707
|
-
|
|
708
|
-
// 再看是不是被模型遮挡
|
|
706
|
+
function getLabelVisible(item) {
|
|
709
707
|
const raycaster = new Raycaster();
|
|
710
|
-
|
|
711
708
|
const cameraPosition = five.camera.position.clone();
|
|
712
|
-
const position = new Vector3(
|
|
709
|
+
const position = new Vector3(item.position.x, item.position.y, item.position.z);
|
|
713
710
|
const vectorDistance = position.distanceTo(cameraPosition);
|
|
714
711
|
raycaster.set(cameraPosition.clone(), position.clone().sub(cameraPosition).normalize());
|
|
715
712
|
const [intersection] = five.model.intersectRaycaster(raycaster);
|
|
@@ -717,53 +714,60 @@ function instance$p($$self, $$props, $$invalidate) {
|
|
|
717
714
|
return true;
|
|
718
715
|
}
|
|
719
716
|
|
|
720
|
-
function getLabelTransform(
|
|
721
|
-
const position = new Vector3(
|
|
717
|
+
function getLabelTransform(item, rendererSize) {
|
|
718
|
+
const position = new Vector3(item.position.x, item.position.y, item.position.z);
|
|
722
719
|
const mouse = position.clone().project(five.camera);
|
|
723
|
-
const xOffset = Math.ceil((mouse.x + 1) / 2 *
|
|
724
|
-
const yOffset = Math.ceil((-mouse.y + 1) / 2 *
|
|
720
|
+
const xOffset = Math.ceil((mouse.x + 1) / 2 * rendererSize.x);
|
|
721
|
+
const yOffset = Math.ceil((-mouse.y + 1) / 2 * rendererSize.y);
|
|
725
722
|
return `translate(${xOffset}px, ${yOffset}px)`;
|
|
726
723
|
}
|
|
727
724
|
|
|
728
|
-
function getFormatedRoomLabels(
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
725
|
+
function getFormatedRoomLabels(rendererSize) {
|
|
726
|
+
// 因为 item distance 需要重复计算,所以缓存一下
|
|
727
|
+
const distanceMap = new Map();
|
|
728
|
+
|
|
729
|
+
function getItemDistance(item) {
|
|
730
|
+
const cacheDistance = distanceMap.get(item.id);
|
|
731
|
+
if (cacheDistance) return cacheDistance;
|
|
732
|
+
const { x, y, z } = item.position;
|
|
733
|
+
const distance = new Vector3(x, y, z).clone().distanceTo(five.camera.position);
|
|
734
|
+
distanceMap.set(item.id, distance);
|
|
735
|
+
return distance;
|
|
736
|
+
}
|
|
732
737
|
|
|
733
|
-
|
|
738
|
+
const formatedItems = roomLabels.map(item => {
|
|
739
|
+
const visible = getLabelVisible(item);
|
|
734
740
|
|
|
735
|
-
|
|
736
|
-
|
|
741
|
+
const transform = visible
|
|
742
|
+
? getLabelTransform(item, rendererSize)
|
|
743
|
+
: item.transform;
|
|
737
744
|
|
|
738
|
-
|
|
739
|
-
});
|
|
745
|
+
const itemDistance = getItemDistance(item);
|
|
740
746
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
distance: new Vector3(...Object.values(roomLabelItem.position)).clone().distanceTo(five.camera.position)
|
|
744
|
-
})).sort((a, b) => a.distance - b.distance);
|
|
747
|
+
// visible === true 的 item 中,distance 比自己小的 item 个数
|
|
748
|
+
const minItemLen = roomLabels.filter(item => item.visible && getItemDistance(item) < itemDistance).length;
|
|
745
749
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
if (sortIndex !== undefined) return Object.assign(Object.assign({}, roomLabelItem), { zIndex: sortIndex * 10 });
|
|
749
|
-
return roomLabelItem;
|
|
750
|
+
const zIndex = minItemLen * 10;
|
|
751
|
+
return Object.assign(Object.assign({}, item), { visible, transform, zIndex });
|
|
750
752
|
});
|
|
753
|
+
|
|
754
|
+
return formatedItems;
|
|
751
755
|
}
|
|
752
756
|
|
|
753
757
|
function onFiveCameraUpdate() {
|
|
754
|
-
$$invalidate(0, roomLabels = getFormatedRoomLabels(
|
|
758
|
+
$$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
function onFiveModelShownFloorChange(floorIndex) {
|
|
762
|
+
$$invalidate(4, shownFloor = floorIndex);
|
|
755
763
|
}
|
|
756
764
|
|
|
757
765
|
five.on('cameraUpdate', onFiveCameraUpdate);
|
|
758
|
-
five.on('modelShownFloorChange',
|
|
766
|
+
five.on('modelShownFloorChange', onFiveModelShownFloorChange);
|
|
759
767
|
|
|
760
768
|
onDestroy(() => {
|
|
761
769
|
five.off('cameraUpdate', onFiveCameraUpdate);
|
|
762
|
-
five.off('modelShownFloorChange',
|
|
763
|
-
});
|
|
764
|
-
|
|
765
|
-
onMount(() => {
|
|
766
|
-
onFiveCameraUpdate();
|
|
770
|
+
five.off('modelShownFloorChange', onFiveModelShownFloorChange);
|
|
767
771
|
});
|
|
768
772
|
|
|
769
773
|
function div_elementresize_handler() {
|
|
@@ -778,7 +782,39 @@ function instance$p($$self, $$props, $$invalidate) {
|
|
|
778
782
|
if ('roomLabels' in $$props) $$invalidate(0, roomLabels = $$props.roomLabels);
|
|
779
783
|
};
|
|
780
784
|
|
|
781
|
-
|
|
785
|
+
$$self.$$.update = () => {
|
|
786
|
+
if ($$self.$$.dirty & /*containerWidth, containerHeight*/ 12) {
|
|
787
|
+
$$invalidate(5, rendererSize = { x: containerWidth, y: containerHeight });
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
if ($$self.$$.dirty & /*rendererSize*/ 32) {
|
|
791
|
+
{
|
|
792
|
+
// rendererSize 变化时,触发 reRender
|
|
793
|
+
$$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
if ($$self.$$.dirty & /*roomLabels, shownFloor*/ 17) {
|
|
798
|
+
{
|
|
799
|
+
// shownFloor 变化时,更新 item visible
|
|
800
|
+
$$invalidate(0, roomLabels = roomLabels.map(item => {
|
|
801
|
+
const isLabelInFloor = shownFloor === null || item.floorIndex === shownFloor;
|
|
802
|
+
const visible = isLabelInFloor ? item.visible : false;
|
|
803
|
+
return Object.assign(Object.assign({}, item), { visible });
|
|
804
|
+
}));
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
return [
|
|
810
|
+
roomLabels,
|
|
811
|
+
five,
|
|
812
|
+
containerWidth,
|
|
813
|
+
containerHeight,
|
|
814
|
+
shownFloor,
|
|
815
|
+
rendererSize,
|
|
816
|
+
div_elementresize_handler
|
|
817
|
+
];
|
|
782
818
|
}
|
|
783
819
|
|
|
784
820
|
class RoomLabelItems extends SvelteComponent {
|
|
@@ -947,6 +983,10 @@ class ModelRoomLabelController {
|
|
|
947
983
|
const ModelRoomLabelPlugin = (five) => {
|
|
948
984
|
return new ModelRoomLabelController(five);
|
|
949
985
|
};
|
|
986
|
+
const modelRoomLabelPluginServerParams = {
|
|
987
|
+
name: 'ModelRoomLabelPlugin',
|
|
988
|
+
version: 0,
|
|
989
|
+
};
|
|
950
990
|
|
|
951
991
|
var FLOOR_PLAN_ATTACHED_TO;
|
|
952
992
|
(function (FLOOR_PLAN_ATTACHED_TO) {
|
|
@@ -7769,6 +7809,11 @@ class PanoCompassController {
|
|
|
7769
7809
|
}
|
|
7770
7810
|
}
|
|
7771
7811
|
|
|
7812
|
+
const panoCompassPluginServerParams = {
|
|
7813
|
+
name: 'PanoCompassPlugin',
|
|
7814
|
+
version: 0,
|
|
7815
|
+
};
|
|
7816
|
+
|
|
7772
7817
|
/** 交换数组元素 */
|
|
7773
7818
|
function exchange(array, index1, index2) {
|
|
7774
7819
|
const value = array[index1];
|
|
@@ -14058,7 +14103,9 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14058
14103
|
}))
|
|
14059
14104
|
continue;
|
|
14060
14105
|
const raycaster = new THREE.Raycaster(camera.position.clone().setY(RAY_ORIGIN_Y), point.position.clone().sub(camera.position.clone().setY(RAY_ORIGIN_Y)).normalize(), 0, point.distance + RAY_TOLERANT_DISTANCE);
|
|
14061
|
-
const [intersect] = five.model.
|
|
14106
|
+
const [intersect] = five.model.bvhs.loaded ?
|
|
14107
|
+
five.model.intersectRaycaster(raycaster) :
|
|
14108
|
+
raycaster.intersectObjects(five.model.children, true);
|
|
14062
14109
|
if (!intersect)
|
|
14063
14110
|
continue;
|
|
14064
14111
|
if (point.distance - intersect.distance < RAY_TOLERANT_DISTANCE) {
|
|
@@ -14099,10 +14146,10 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14099
14146
|
return newTags;
|
|
14100
14147
|
};
|
|
14101
14148
|
/** 标签数据加载
|
|
14102
|
-
|
|
14103
|
-
|
|
14104
|
-
|
|
14105
|
-
|
|
14149
|
+
* @param data.points {Array} 标签数据
|
|
14150
|
+
* @param data.enabled {Boolean} 插件是否启用
|
|
14151
|
+
* @param data.folded {Boolean} 标签是否默认展开
|
|
14152
|
+
*/
|
|
14106
14153
|
const load = (data) => {
|
|
14107
14154
|
state.points = data.points.map(point => {
|
|
14108
14155
|
var _a, _b;
|
|
@@ -14126,16 +14173,16 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14126
14173
|
state.folded = data.folded;
|
|
14127
14174
|
};
|
|
14128
14175
|
/** 标签启用
|
|
14129
|
-
|
|
14130
|
-
|
|
14176
|
+
* 启用插件并重新计算展示标签
|
|
14177
|
+
*/
|
|
14131
14178
|
const enable = () => {
|
|
14132
14179
|
state.enabled = true;
|
|
14133
14180
|
updateTags();
|
|
14134
14181
|
};
|
|
14135
14182
|
/** 插件禁用
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14183
|
+
* 1. 禁用同时会清除已展示的标签
|
|
14184
|
+
* 2. 再次启用时会重新计算展示标签
|
|
14185
|
+
*/
|
|
14139
14186
|
const disable = () => {
|
|
14140
14187
|
state.enabled = false;
|
|
14141
14188
|
origins.$set({ origins: [] });
|
|
@@ -14147,9 +14194,9 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14147
14194
|
state.tags = [];
|
|
14148
14195
|
};
|
|
14149
14196
|
/** 展开所有标签
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14197
|
+
* 1. 展开所有收起的标签
|
|
14198
|
+
* 2. 新标签会默认展开
|
|
14199
|
+
*/
|
|
14153
14200
|
const unfoldAll = () => {
|
|
14154
14201
|
state.folded = false;
|
|
14155
14202
|
state.tags.forEach(tag => {
|
|
@@ -14157,9 +14204,9 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14157
14204
|
});
|
|
14158
14205
|
};
|
|
14159
14206
|
/** 收起所有标签
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14207
|
+
* 1. 收起所有展开的标签
|
|
14208
|
+
* 2. 新标签会默认收起
|
|
14209
|
+
*/
|
|
14163
14210
|
const foldAll = () => {
|
|
14164
14211
|
state.folded = true;
|
|
14165
14212
|
state.tags.forEach(tag => {
|
|
@@ -14167,8 +14214,8 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14167
14214
|
});
|
|
14168
14215
|
};
|
|
14169
14216
|
/** 展开单个标签
|
|
14170
|
-
|
|
14171
|
-
|
|
14217
|
+
* @param id {Number | String} 标签ID
|
|
14218
|
+
*/
|
|
14172
14219
|
const unfold = (id) => {
|
|
14173
14220
|
state.tags.forEach(tag => {
|
|
14174
14221
|
if (tag.id === id)
|
|
@@ -14176,8 +14223,8 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14176
14223
|
});
|
|
14177
14224
|
};
|
|
14178
14225
|
/** 收起单个标签
|
|
14179
|
-
|
|
14180
|
-
|
|
14226
|
+
* @param id {Number | String} 标签ID
|
|
14227
|
+
*/
|
|
14181
14228
|
const fold = (id) => {
|
|
14182
14229
|
state.tags.forEach(tag => {
|
|
14183
14230
|
if (tag.id === id)
|
|
@@ -14211,7 +14258,7 @@ const PanoSpatialTagPlugin = (five, params) => {
|
|
|
14211
14258
|
five.on('cameraUpdate', onCameraUpdate);
|
|
14212
14259
|
}
|
|
14213
14260
|
else {
|
|
14214
|
-
five.once('
|
|
14261
|
+
five.once('modelLoaded', () => {
|
|
14215
14262
|
if (!wrapper)
|
|
14216
14263
|
wrapper = five.getElement().parentElement;
|
|
14217
14264
|
wrapper.appendChild(container);
|
|
@@ -14383,7 +14430,7 @@ function get_each_context(ctx, list, i) {
|
|
|
14383
14430
|
return child_ctx;
|
|
14384
14431
|
}
|
|
14385
14432
|
|
|
14386
|
-
// (
|
|
14433
|
+
// (163:1) {#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
|
|
14387
14434
|
function create_each_block(key_1, ctx) {
|
|
14388
14435
|
let first;
|
|
14389
14436
|
let itemlabelitem;
|
|
@@ -14870,6 +14917,11 @@ const ModelItemLabelPlugin = (five, params) => {
|
|
|
14870
14917
|
};
|
|
14871
14918
|
};
|
|
14872
14919
|
|
|
14920
|
+
const modelItemLabelPluginServerParams = {
|
|
14921
|
+
name: 'ModelItemLabelPlugin',
|
|
14922
|
+
version: 0,
|
|
14923
|
+
};
|
|
14924
|
+
|
|
14873
14925
|
var DIRECTION;
|
|
14874
14926
|
(function (DIRECTION) {
|
|
14875
14927
|
DIRECTION["TOP_LEFT"] = "topLeft";
|
|
@@ -15143,4 +15195,4 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
|
|
|
15143
15195
|
return { enable, disable, load, dispose };
|
|
15144
15196
|
};
|
|
15145
15197
|
|
|
15146
|
-
export { CSS3DRenderPlugin, CameraMovementPlugin, FLOOR_PLAN_ATTACHED_TO, ModelChassisCompassPlugin, ModelEntryDoorGuidePlugin, ModelFloorplanPlugin, ModelItemLabelPlugin, ModelRoomLabelPlugin, ModelTVVideoPlugin, ModelViewPlugin, PanoCompassPlugin, PanoCursorRaycasterPlugin, PanoFloorplanRadarPlugin, PanoMeasurePlugin, PanoRulerPlugin, PanoSpatialTagPlugin, TopviewFloorplanPlugin };
|
|
15198
|
+
export { CSS3DRenderPlugin, CameraMovementEffect, CameraMovementPlugin, DIRECTION, DISPLAY_STRATEGY_TYPE, FLOOR_PLAN_ATTACHED_TO, ModelChassisCompassPlugin, ModelEntryDoorGuidePlugin, ModelFloorplanPlugin, ModelItemLabelPlugin, ModelRoomLabelPlugin, ModelTVVideoPlugin, ModelViewPlugin, PanoCompassPlugin, PanoCursorRaycasterPlugin, PanoFloorplanRadarPlugin, PanoMeasurePlugin, PanoRulerPlugin, PanoSpatialTagPlugin, Rotation, TopviewFloorplanPlugin, modelItemLabelPluginServerParams, modelRoomLabelPluginServerParams, panoCompassPluginServerParams };
|