@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.js
CHANGED
|
@@ -589,17 +589,19 @@ class RoomLabelItem extends internal.SvelteComponent {
|
|
|
589
589
|
|
|
590
590
|
/* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
|
|
591
591
|
|
|
592
|
+
const { Map: Map_1 } = internal.globals;
|
|
593
|
+
|
|
592
594
|
function add_css$l(target) {
|
|
593
595
|
internal.append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
|
|
594
596
|
}
|
|
595
597
|
|
|
596
598
|
function get_each_context$9(ctx, list, i) {
|
|
597
599
|
const child_ctx = ctx.slice();
|
|
598
|
-
child_ctx[
|
|
600
|
+
child_ctx[12] = list[i];
|
|
599
601
|
return child_ctx;
|
|
600
602
|
}
|
|
601
603
|
|
|
602
|
-
// (
|
|
604
|
+
// (82:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
|
|
603
605
|
function create_each_block$9(key_1, ctx) {
|
|
604
606
|
let first;
|
|
605
607
|
let roomlabelitem;
|
|
@@ -607,7 +609,7 @@ function create_each_block$9(key_1, ctx) {
|
|
|
607
609
|
|
|
608
610
|
roomlabelitem = new RoomLabelItem({
|
|
609
611
|
props: {
|
|
610
|
-
roomLabel: /*roomLableItem*/ ctx[
|
|
612
|
+
roomLabel: /*roomLableItem*/ ctx[12],
|
|
611
613
|
five: /*five*/ ctx[1]
|
|
612
614
|
}
|
|
613
615
|
});
|
|
@@ -628,7 +630,7 @@ function create_each_block$9(key_1, ctx) {
|
|
|
628
630
|
p(new_ctx, dirty) {
|
|
629
631
|
ctx = new_ctx;
|
|
630
632
|
const roomlabelitem_changes = {};
|
|
631
|
-
if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[
|
|
633
|
+
if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[12];
|
|
632
634
|
if (dirty & /*five*/ 2) roomlabelitem_changes.five = /*five*/ ctx[1];
|
|
633
635
|
roomlabelitem.$set(roomlabelitem_changes);
|
|
634
636
|
},
|
|
@@ -651,11 +653,11 @@ function create_each_block$9(key_1, ctx) {
|
|
|
651
653
|
function create_fragment$p(ctx) {
|
|
652
654
|
let div;
|
|
653
655
|
let each_blocks = [];
|
|
654
|
-
let each_1_lookup = new
|
|
656
|
+
let each_1_lookup = new Map_1();
|
|
655
657
|
let div_resize_listener;
|
|
656
658
|
let current;
|
|
657
659
|
let each_value = /*roomLabels*/ ctx[0];
|
|
658
|
-
const get_key = ctx => /*roomLableItem*/ ctx[
|
|
660
|
+
const get_key = ctx => /*roomLableItem*/ ctx[12].id;
|
|
659
661
|
|
|
660
662
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
661
663
|
let child_ctx = get_each_context$9(ctx, each_value, i);
|
|
@@ -672,7 +674,7 @@ function create_fragment$p(ctx) {
|
|
|
672
674
|
}
|
|
673
675
|
|
|
674
676
|
internal.attr(div, "class", "room-labels-container svelte-9eg4zi");
|
|
675
|
-
internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[
|
|
677
|
+
internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[6].call(div));
|
|
676
678
|
},
|
|
677
679
|
m(target, anchor) {
|
|
678
680
|
internal.insert(target, div, anchor);
|
|
@@ -681,7 +683,7 @@ function create_fragment$p(ctx) {
|
|
|
681
683
|
each_blocks[i].m(div, null);
|
|
682
684
|
}
|
|
683
685
|
|
|
684
|
-
div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[
|
|
686
|
+
div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[6].bind(div));
|
|
685
687
|
current = true;
|
|
686
688
|
},
|
|
687
689
|
p(ctx, [dirty]) {
|
|
@@ -721,22 +723,17 @@ function create_fragment$p(ctx) {
|
|
|
721
723
|
}
|
|
722
724
|
|
|
723
725
|
function instance$p($$self, $$props, $$invalidate) {
|
|
726
|
+
let rendererSize;
|
|
724
727
|
let { five } = $$props;
|
|
725
728
|
let { roomLabels } = $$props;
|
|
726
729
|
let containerWidth;
|
|
727
730
|
let containerHeight;
|
|
731
|
+
let shownFloor = null;
|
|
728
732
|
|
|
729
|
-
function getLabelVisible(
|
|
730
|
-
// 先看是不是在当前展示的楼层上
|
|
731
|
-
const isLabelInFloor = five.model.shownFloor === null || roomLabelItem.floorIndex === five.model.shownFloor;
|
|
732
|
-
|
|
733
|
-
if (!isLabelInFloor) return false;
|
|
734
|
-
|
|
735
|
-
// 再看是不是被模型遮挡
|
|
733
|
+
function getLabelVisible(item) {
|
|
736
734
|
const raycaster = new THREE.Raycaster();
|
|
737
|
-
|
|
738
735
|
const cameraPosition = five.camera.position.clone();
|
|
739
|
-
const position = new THREE.Vector3(
|
|
736
|
+
const position = new THREE.Vector3(item.position.x, item.position.y, item.position.z);
|
|
740
737
|
const vectorDistance = position.distanceTo(cameraPosition);
|
|
741
738
|
raycaster.set(cameraPosition.clone(), position.clone().sub(cameraPosition).normalize());
|
|
742
739
|
const [intersection] = five.model.intersectRaycaster(raycaster);
|
|
@@ -744,53 +741,60 @@ function instance$p($$self, $$props, $$invalidate) {
|
|
|
744
741
|
return true;
|
|
745
742
|
}
|
|
746
743
|
|
|
747
|
-
function getLabelTransform(
|
|
748
|
-
const position = new THREE.Vector3(
|
|
744
|
+
function getLabelTransform(item, rendererSize) {
|
|
745
|
+
const position = new THREE.Vector3(item.position.x, item.position.y, item.position.z);
|
|
749
746
|
const mouse = position.clone().project(five.camera);
|
|
750
|
-
const xOffset = Math.ceil((mouse.x + 1) / 2 *
|
|
751
|
-
const yOffset = Math.ceil((-mouse.y + 1) / 2 *
|
|
747
|
+
const xOffset = Math.ceil((mouse.x + 1) / 2 * rendererSize.x);
|
|
748
|
+
const yOffset = Math.ceil((-mouse.y + 1) / 2 * rendererSize.y);
|
|
752
749
|
return `translate(${xOffset}px, ${yOffset}px)`;
|
|
753
750
|
}
|
|
754
751
|
|
|
755
|
-
function getFormatedRoomLabels(
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
752
|
+
function getFormatedRoomLabels(rendererSize) {
|
|
753
|
+
// 因为 item distance 需要重复计算,所以缓存一下
|
|
754
|
+
const distanceMap = new Map();
|
|
755
|
+
|
|
756
|
+
function getItemDistance(item) {
|
|
757
|
+
const cacheDistance = distanceMap.get(item.id);
|
|
758
|
+
if (cacheDistance) return cacheDistance;
|
|
759
|
+
const { x, y, z } = item.position;
|
|
760
|
+
const distance = new THREE.Vector3(x, y, z).clone().distanceTo(five.camera.position);
|
|
761
|
+
distanceMap.set(item.id, distance);
|
|
762
|
+
return distance;
|
|
763
|
+
}
|
|
759
764
|
|
|
760
|
-
|
|
765
|
+
const formatedItems = roomLabels.map(item => {
|
|
766
|
+
const visible = getLabelVisible(item);
|
|
761
767
|
|
|
762
|
-
|
|
763
|
-
|
|
768
|
+
const transform = visible
|
|
769
|
+
? getLabelTransform(item, rendererSize)
|
|
770
|
+
: item.transform;
|
|
764
771
|
|
|
765
|
-
|
|
766
|
-
});
|
|
772
|
+
const itemDistance = getItemDistance(item);
|
|
767
773
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
distance: new THREE.Vector3(...Object.values(roomLabelItem.position)).clone().distanceTo(five.camera.position)
|
|
771
|
-
})).sort((a, b) => a.distance - b.distance);
|
|
774
|
+
// visible === true 的 item 中,distance 比自己小的 item 个数
|
|
775
|
+
const minItemLen = roomLabels.filter(item => item.visible && getItemDistance(item) < itemDistance).length;
|
|
772
776
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
if (sortIndex !== undefined) return Object.assign(Object.assign({}, roomLabelItem), { zIndex: sortIndex * 10 });
|
|
776
|
-
return roomLabelItem;
|
|
777
|
+
const zIndex = minItemLen * 10;
|
|
778
|
+
return Object.assign(Object.assign({}, item), { visible, transform, zIndex });
|
|
777
779
|
});
|
|
780
|
+
|
|
781
|
+
return formatedItems;
|
|
778
782
|
}
|
|
779
783
|
|
|
780
784
|
function onFiveCameraUpdate() {
|
|
781
|
-
$$invalidate(0, roomLabels = getFormatedRoomLabels(
|
|
785
|
+
$$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
function onFiveModelShownFloorChange(floorIndex) {
|
|
789
|
+
$$invalidate(4, shownFloor = floorIndex);
|
|
782
790
|
}
|
|
783
791
|
|
|
784
792
|
five.on('cameraUpdate', onFiveCameraUpdate);
|
|
785
|
-
five.on('modelShownFloorChange',
|
|
793
|
+
five.on('modelShownFloorChange', onFiveModelShownFloorChange);
|
|
786
794
|
|
|
787
795
|
svelte.onDestroy(() => {
|
|
788
796
|
five.off('cameraUpdate', onFiveCameraUpdate);
|
|
789
|
-
five.off('modelShownFloorChange',
|
|
790
|
-
});
|
|
791
|
-
|
|
792
|
-
svelte.onMount(() => {
|
|
793
|
-
onFiveCameraUpdate();
|
|
797
|
+
five.off('modelShownFloorChange', onFiveModelShownFloorChange);
|
|
794
798
|
});
|
|
795
799
|
|
|
796
800
|
function div_elementresize_handler() {
|
|
@@ -805,7 +809,39 @@ function instance$p($$self, $$props, $$invalidate) {
|
|
|
805
809
|
if ('roomLabels' in $$props) $$invalidate(0, roomLabels = $$props.roomLabels);
|
|
806
810
|
};
|
|
807
811
|
|
|
808
|
-
|
|
812
|
+
$$self.$$.update = () => {
|
|
813
|
+
if ($$self.$$.dirty & /*containerWidth, containerHeight*/ 12) {
|
|
814
|
+
$$invalidate(5, rendererSize = { x: containerWidth, y: containerHeight });
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
if ($$self.$$.dirty & /*rendererSize*/ 32) {
|
|
818
|
+
{
|
|
819
|
+
// rendererSize 变化时,触发 reRender
|
|
820
|
+
$$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
if ($$self.$$.dirty & /*roomLabels, shownFloor*/ 17) {
|
|
825
|
+
{
|
|
826
|
+
// shownFloor 变化时,更新 item visible
|
|
827
|
+
$$invalidate(0, roomLabels = roomLabels.map(item => {
|
|
828
|
+
const isLabelInFloor = shownFloor === null || item.floorIndex === shownFloor;
|
|
829
|
+
const visible = isLabelInFloor ? item.visible : false;
|
|
830
|
+
return Object.assign(Object.assign({}, item), { visible });
|
|
831
|
+
}));
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
return [
|
|
837
|
+
roomLabels,
|
|
838
|
+
five,
|
|
839
|
+
containerWidth,
|
|
840
|
+
containerHeight,
|
|
841
|
+
shownFloor,
|
|
842
|
+
rendererSize,
|
|
843
|
+
div_elementresize_handler
|
|
844
|
+
];
|
|
809
845
|
}
|
|
810
846
|
|
|
811
847
|
class RoomLabelItems extends internal.SvelteComponent {
|
|
@@ -974,6 +1010,10 @@ class ModelRoomLabelController {
|
|
|
974
1010
|
const ModelRoomLabelPlugin = (five) => {
|
|
975
1011
|
return new ModelRoomLabelController(five);
|
|
976
1012
|
};
|
|
1013
|
+
const modelRoomLabelPluginServerParams = {
|
|
1014
|
+
name: 'ModelRoomLabelPlugin',
|
|
1015
|
+
version: 0,
|
|
1016
|
+
};
|
|
977
1017
|
|
|
978
1018
|
exports.FLOOR_PLAN_ATTACHED_TO = void 0;
|
|
979
1019
|
(function (FLOOR_PLAN_ATTACHED_TO) {
|
|
@@ -6662,20 +6702,20 @@ function tweenProgress$1(duration, easing) {
|
|
|
6662
6702
|
/**
|
|
6663
6703
|
* 运镜效果
|
|
6664
6704
|
*/
|
|
6665
|
-
|
|
6705
|
+
exports.CameraMovementEffect = void 0;
|
|
6666
6706
|
(function (CameraMovementEffect) {
|
|
6667
6707
|
CameraMovementEffect["Move"] = "Move";
|
|
6668
6708
|
CameraMovementEffect["Rotate"] = "Rotate";
|
|
6669
|
-
})(CameraMovementEffect || (CameraMovementEffect = {}));
|
|
6709
|
+
})(exports.CameraMovementEffect || (exports.CameraMovementEffect = {}));
|
|
6670
6710
|
/**
|
|
6671
6711
|
* 旋转类型
|
|
6672
6712
|
*/
|
|
6673
|
-
|
|
6713
|
+
exports.Rotation = void 0;
|
|
6674
6714
|
(function (Rotation) {
|
|
6675
6715
|
Rotation["Clockwise"] = "Clockwise";
|
|
6676
6716
|
Rotation["Anticlockwise"] = "Anticlockwise";
|
|
6677
6717
|
Rotation["Loop"] = "Loop";
|
|
6678
|
-
})(Rotation || (Rotation = {}));
|
|
6718
|
+
})(exports.Rotation || (exports.Rotation = {}));
|
|
6679
6719
|
|
|
6680
6720
|
const PI_2 = Math.PI * 2;
|
|
6681
6721
|
/**
|
|
@@ -6706,18 +6746,18 @@ const getLongitudeParams = (from, to, rotation) => {
|
|
|
6706
6746
|
from = formatLongitude(from);
|
|
6707
6747
|
to = formatLongitude(to);
|
|
6708
6748
|
// 逆时针旋转,初始值必须是较大的值
|
|
6709
|
-
if (rotation === Rotation.Anticlockwise && from < to)
|
|
6749
|
+
if (rotation === exports.Rotation.Anticlockwise && from < to)
|
|
6710
6750
|
from += PI_2;
|
|
6711
6751
|
// 顺时针旋转,结束值必须是较大值
|
|
6712
|
-
if (rotation === Rotation.Clockwise && to < from)
|
|
6752
|
+
if (rotation === exports.Rotation.Clockwise && to < from)
|
|
6713
6753
|
to += PI_2;
|
|
6714
6754
|
// Loop 旋转,找锐角旋转
|
|
6715
6755
|
// 如果 to 比 from 大 180°,逆时针转
|
|
6716
6756
|
// 如果 from 比 to 大 180°,顺时针转
|
|
6717
|
-
if (rotation === Rotation.Loop && to - from > PI)
|
|
6718
|
-
return getLongitudeParams(from, to, Rotation.Anticlockwise);
|
|
6719
|
-
if (rotation === Rotation.Loop && from - to > PI)
|
|
6720
|
-
return getLongitudeParams(from, to, Rotation.Clockwise);
|
|
6757
|
+
if (rotation === exports.Rotation.Loop && to - from > PI)
|
|
6758
|
+
return getLongitudeParams(from, to, exports.Rotation.Anticlockwise);
|
|
6759
|
+
if (rotation === exports.Rotation.Loop && from - to > PI)
|
|
6760
|
+
return getLongitudeParams(from, to, exports.Rotation.Clockwise);
|
|
6721
6761
|
return { from, to };
|
|
6722
6762
|
};
|
|
6723
6763
|
/**
|
|
@@ -6767,7 +6807,7 @@ const CameraMovementPlugin = (five$1) => {
|
|
|
6767
6807
|
const fromLatitude = formatLatitude(currentFiveState.latitude);
|
|
6768
6808
|
const toLatitude = formatLatitude(args.latitude);
|
|
6769
6809
|
// longitude
|
|
6770
|
-
const { from: fromLongitude, to: toLongitude } = getLongitudeParams(currentFiveState.longitude, args.longitude, args.rotation || Rotation.Loop);
|
|
6810
|
+
const { from: fromLongitude, to: toLongitude } = getLongitudeParams(currentFiveState.longitude, args.longitude, args.rotation || exports.Rotation.Loop);
|
|
6771
6811
|
// fov
|
|
6772
6812
|
const fromFov = currentFiveState.fov;
|
|
6773
6813
|
const toFov = args.fov;
|
|
@@ -6825,7 +6865,7 @@ const CameraMovementPlugin = (five$1) => {
|
|
|
6825
6865
|
.onUpdate(onUpdate)
|
|
6826
6866
|
.onComplete(onComplete)
|
|
6827
6867
|
.onDestroy(onDestroy);
|
|
6828
|
-
if (args.rotation === Rotation.Loop) {
|
|
6868
|
+
if (args.rotation === exports.Rotation.Loop) {
|
|
6829
6869
|
tween.repeat(Infinity).yoyo(true);
|
|
6830
6870
|
}
|
|
6831
6871
|
/**
|
|
@@ -7796,6 +7836,11 @@ class PanoCompassController {
|
|
|
7796
7836
|
}
|
|
7797
7837
|
}
|
|
7798
7838
|
|
|
7839
|
+
const panoCompassPluginServerParams = {
|
|
7840
|
+
name: 'PanoCompassPlugin',
|
|
7841
|
+
version: 0,
|
|
7842
|
+
};
|
|
7843
|
+
|
|
7799
7844
|
/** 交换数组元素 */
|
|
7800
7845
|
function exchange(array, index1, index2) {
|
|
7801
7846
|
const value = array[index1];
|
|
@@ -14085,7 +14130,9 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14085
14130
|
}))
|
|
14086
14131
|
continue;
|
|
14087
14132
|
const raycaster = new THREE__namespace.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);
|
|
14088
|
-
const [intersect] = five$1.model.
|
|
14133
|
+
const [intersect] = five$1.model.bvhs.loaded ?
|
|
14134
|
+
five$1.model.intersectRaycaster(raycaster) :
|
|
14135
|
+
raycaster.intersectObjects(five$1.model.children, true);
|
|
14089
14136
|
if (!intersect)
|
|
14090
14137
|
continue;
|
|
14091
14138
|
if (point.distance - intersect.distance < RAY_TOLERANT_DISTANCE) {
|
|
@@ -14126,10 +14173,10 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14126
14173
|
return newTags;
|
|
14127
14174
|
};
|
|
14128
14175
|
/** 标签数据加载
|
|
14129
|
-
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14176
|
+
* @param data.points {Array} 标签数据
|
|
14177
|
+
* @param data.enabled {Boolean} 插件是否启用
|
|
14178
|
+
* @param data.folded {Boolean} 标签是否默认展开
|
|
14179
|
+
*/
|
|
14133
14180
|
const load = (data) => {
|
|
14134
14181
|
state.points = data.points.map(point => {
|
|
14135
14182
|
var _a, _b;
|
|
@@ -14153,16 +14200,16 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14153
14200
|
state.folded = data.folded;
|
|
14154
14201
|
};
|
|
14155
14202
|
/** 标签启用
|
|
14156
|
-
|
|
14157
|
-
|
|
14203
|
+
* 启用插件并重新计算展示标签
|
|
14204
|
+
*/
|
|
14158
14205
|
const enable = () => {
|
|
14159
14206
|
state.enabled = true;
|
|
14160
14207
|
updateTags();
|
|
14161
14208
|
};
|
|
14162
14209
|
/** 插件禁用
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14210
|
+
* 1. 禁用同时会清除已展示的标签
|
|
14211
|
+
* 2. 再次启用时会重新计算展示标签
|
|
14212
|
+
*/
|
|
14166
14213
|
const disable = () => {
|
|
14167
14214
|
state.enabled = false;
|
|
14168
14215
|
origins.$set({ origins: [] });
|
|
@@ -14174,9 +14221,9 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14174
14221
|
state.tags = [];
|
|
14175
14222
|
};
|
|
14176
14223
|
/** 展开所有标签
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14224
|
+
* 1. 展开所有收起的标签
|
|
14225
|
+
* 2. 新标签会默认展开
|
|
14226
|
+
*/
|
|
14180
14227
|
const unfoldAll = () => {
|
|
14181
14228
|
state.folded = false;
|
|
14182
14229
|
state.tags.forEach(tag => {
|
|
@@ -14184,9 +14231,9 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14184
14231
|
});
|
|
14185
14232
|
};
|
|
14186
14233
|
/** 收起所有标签
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
|
|
14234
|
+
* 1. 收起所有展开的标签
|
|
14235
|
+
* 2. 新标签会默认收起
|
|
14236
|
+
*/
|
|
14190
14237
|
const foldAll = () => {
|
|
14191
14238
|
state.folded = true;
|
|
14192
14239
|
state.tags.forEach(tag => {
|
|
@@ -14194,8 +14241,8 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14194
14241
|
});
|
|
14195
14242
|
};
|
|
14196
14243
|
/** 展开单个标签
|
|
14197
|
-
|
|
14198
|
-
|
|
14244
|
+
* @param id {Number | String} 标签ID
|
|
14245
|
+
*/
|
|
14199
14246
|
const unfold = (id) => {
|
|
14200
14247
|
state.tags.forEach(tag => {
|
|
14201
14248
|
if (tag.id === id)
|
|
@@ -14203,8 +14250,8 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14203
14250
|
});
|
|
14204
14251
|
};
|
|
14205
14252
|
/** 收起单个标签
|
|
14206
|
-
|
|
14207
|
-
|
|
14253
|
+
* @param id {Number | String} 标签ID
|
|
14254
|
+
*/
|
|
14208
14255
|
const fold = (id) => {
|
|
14209
14256
|
state.tags.forEach(tag => {
|
|
14210
14257
|
if (tag.id === id)
|
|
@@ -14238,7 +14285,7 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14238
14285
|
five$1.on('cameraUpdate', onCameraUpdate);
|
|
14239
14286
|
}
|
|
14240
14287
|
else {
|
|
14241
|
-
five$1.once('
|
|
14288
|
+
five$1.once('modelLoaded', () => {
|
|
14242
14289
|
if (!wrapper)
|
|
14243
14290
|
wrapper = five$1.getElement().parentElement;
|
|
14244
14291
|
wrapper.appendChild(container);
|
|
@@ -14264,13 +14311,13 @@ const PanoSpatialTagPlugin = (five$1, params) => {
|
|
|
14264
14311
|
};
|
|
14265
14312
|
};
|
|
14266
14313
|
|
|
14267
|
-
|
|
14314
|
+
exports.DISPLAY_STRATEGY_TYPE = void 0;
|
|
14268
14315
|
(function (DISPLAY_STRATEGY_TYPE) {
|
|
14269
14316
|
DISPLAY_STRATEGY_TYPE["SMALL"] = "small";
|
|
14270
14317
|
DISPLAY_STRATEGY_TYPE["MIDLLE"] = "middle";
|
|
14271
14318
|
DISPLAY_STRATEGY_TYPE["LARGE"] = "large";
|
|
14272
14319
|
DISPLAY_STRATEGY_TYPE["EXTRA_LARGE"] = "x-large";
|
|
14273
|
-
})(DISPLAY_STRATEGY_TYPE || (DISPLAY_STRATEGY_TYPE = {}));
|
|
14320
|
+
})(exports.DISPLAY_STRATEGY_TYPE || (exports.DISPLAY_STRATEGY_TYPE = {}));
|
|
14274
14321
|
|
|
14275
14322
|
/* src/ModelItemLabelPlugin/ItemLabelItem.svelte generated by Svelte v3.47.0 */
|
|
14276
14323
|
|
|
@@ -14410,7 +14457,7 @@ function get_each_context(ctx, list, i) {
|
|
|
14410
14457
|
return child_ctx;
|
|
14411
14458
|
}
|
|
14412
14459
|
|
|
14413
|
-
// (
|
|
14460
|
+
// (163:1) {#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
|
|
14414
14461
|
function create_each_block(key_1, ctx) {
|
|
14415
14462
|
let first;
|
|
14416
14463
|
let itemlabelitem;
|
|
@@ -14611,13 +14658,13 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
14611
14658
|
|
|
14612
14659
|
function getStrokeLength(itemSpaceHeight, type) {
|
|
14613
14660
|
switch (type) {
|
|
14614
|
-
case DISPLAY_STRATEGY_TYPE.SMALL:
|
|
14661
|
+
case exports.DISPLAY_STRATEGY_TYPE.SMALL:
|
|
14615
14662
|
return Math.ceil(-27.78 * itemSpaceHeight + 85);
|
|
14616
|
-
case DISPLAY_STRATEGY_TYPE.MIDLLE:
|
|
14663
|
+
case exports.DISPLAY_STRATEGY_TYPE.MIDLLE:
|
|
14617
14664
|
return Math.ceil(-38.9 * itemSpaceHeight + 130);
|
|
14618
|
-
case DISPLAY_STRATEGY_TYPE.LARGE:
|
|
14665
|
+
case exports.DISPLAY_STRATEGY_TYPE.LARGE:
|
|
14619
14666
|
return Math.ceil(-44.44 * itemSpaceHeight + 140);
|
|
14620
|
-
case DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
|
|
14667
|
+
case exports.DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
|
|
14621
14668
|
return Math.ceil(-92.59 * itemSpaceHeight + 300);
|
|
14622
14669
|
}
|
|
14623
14670
|
}
|
|
@@ -14793,7 +14840,7 @@ const ModelItemLabelPlugin = (five$1, params) => {
|
|
|
14793
14840
|
app: undefined,
|
|
14794
14841
|
hooks: new five.Subscribe(),
|
|
14795
14842
|
modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
|
|
14796
|
-
displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : DISPLAY_STRATEGY_TYPE.SMALL,
|
|
14843
|
+
displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : exports.DISPLAY_STRATEGY_TYPE.SMALL,
|
|
14797
14844
|
};
|
|
14798
14845
|
pluginState.container.setAttribute('class', 'model-item-label-plugin-container');
|
|
14799
14846
|
pluginState.container.style.cssText = `
|
|
@@ -14897,13 +14944,18 @@ const ModelItemLabelPlugin = (five$1, params) => {
|
|
|
14897
14944
|
};
|
|
14898
14945
|
};
|
|
14899
14946
|
|
|
14900
|
-
|
|
14947
|
+
const modelItemLabelPluginServerParams = {
|
|
14948
|
+
name: 'ModelItemLabelPlugin',
|
|
14949
|
+
version: 0,
|
|
14950
|
+
};
|
|
14951
|
+
|
|
14952
|
+
exports.DIRECTION = void 0;
|
|
14901
14953
|
(function (DIRECTION) {
|
|
14902
14954
|
DIRECTION["TOP_LEFT"] = "topLeft";
|
|
14903
14955
|
DIRECTION["TOP_RIGHT"] = "topRight";
|
|
14904
14956
|
DIRECTION["BOTTOM_LEFT"] = "bottomLeft";
|
|
14905
14957
|
DIRECTION["BOTTOM_RIGHT"] = "bottomRight";
|
|
14906
|
-
})(DIRECTION || (DIRECTION = {}));
|
|
14958
|
+
})(exports.DIRECTION || (exports.DIRECTION = {}));
|
|
14907
14959
|
|
|
14908
14960
|
function parseModelTVVideoPoints(points) {
|
|
14909
14961
|
if (points.length === 0)
|
|
@@ -14912,7 +14964,7 @@ function parseModelTVVideoPoints(points) {
|
|
|
14912
14964
|
return points;
|
|
14913
14965
|
let newPoints = [];
|
|
14914
14966
|
points.map(point => {
|
|
14915
|
-
const newPoint = [point[DIRECTION.TOP_LEFT], point[DIRECTION.BOTTOM_LEFT], point[DIRECTION.BOTTOM_RIGHT], point[DIRECTION.TOP_RIGHT]];
|
|
14967
|
+
const newPoint = [point[exports.DIRECTION.TOP_LEFT], point[exports.DIRECTION.BOTTOM_LEFT], point[exports.DIRECTION.BOTTOM_RIGHT], point[exports.DIRECTION.TOP_RIGHT]];
|
|
14916
14968
|
newPoints.push(newPoint);
|
|
14917
14969
|
});
|
|
14918
14970
|
return newPoints;
|
|
@@ -15186,3 +15238,6 @@ exports.PanoMeasurePlugin = PanoMeasurePlugin;
|
|
|
15186
15238
|
exports.PanoRulerPlugin = PanoRulerPlugin;
|
|
15187
15239
|
exports.PanoSpatialTagPlugin = PanoSpatialTagPlugin;
|
|
15188
15240
|
exports.TopviewFloorplanPlugin = TopviewFloorplanPlugin;
|
|
15241
|
+
exports.modelItemLabelPluginServerParams = modelItemLabelPluginServerParams;
|
|
15242
|
+
exports.modelRoomLabelPluginServerParams = modelRoomLabelPluginServerParams;
|
|
15243
|
+
exports.panoCompassPluginServerParams = panoCompassPluginServerParams;
|