@realsee/dnalogel 2.0.0-alpha.36 → 2.0.0-alpha.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/ItemLabelPlugin/index.js +60 -36
  2. package/dist/ItemLabelPlugin/typings.d.ts +4 -0
  3. package/dist/ModelViewPlugin/Plugin.d.ts +4 -4
  4. package/dist/ModelViewPlugin/index.js +2 -3
  5. package/dist/PanoRulerProPlugin/Controller.d.ts +15 -0
  6. package/dist/PanoRulerProPlugin/index.d.ts +8 -0
  7. package/dist/PanoRulerProPlugin/index.js +1006 -0
  8. package/dist/PanoRulerProPlugin/typings.d.ts +46 -0
  9. package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -1
  10. package/dist/floorplan/ModelFloorplanPlugin/index.js +8 -1
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.es.js +1036 -243
  13. package/dist/index.js +1037 -242
  14. package/dist/index.umd.js +1037 -242
  15. package/dist/shared-utils/logger.d.ts +16 -0
  16. package/docs/assets/search.js +1 -1
  17. package/docs/classes/Magnifier.html +4 -4
  18. package/docs/classes/ModelRoomLabelController.html +4 -4
  19. package/docs/enums/CameraMovementEffect.html +2 -2
  20. package/docs/enums/DIRECTION.html +1 -1
  21. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  22. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  23. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  24. package/docs/enums/Rotation.html +2 -2
  25. package/docs/index.html +2 -2
  26. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  27. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  28. package/docs/interfaces/FloorplanBounding.html +4 -4
  29. package/docs/interfaces/FloorplanData.html +2 -2
  30. package/docs/interfaces/FloorplanEntrance.html +7 -7
  31. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  32. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  33. package/docs/interfaces/FloorplanFloorData.html +2 -2
  34. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  35. package/docs/interfaces/FloorplanObserver.html +2 -2
  36. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  37. package/docs/interfaces/FloorplanPosition.html +2 -2
  38. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  39. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  40. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  41. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  42. package/docs/interfaces/FloorplanServerData.html +2 -2
  43. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  44. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  45. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  46. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  47. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  48. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  49. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  50. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  51. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  52. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  53. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  54. package/docs/interfaces/LineJson.html +1 -1
  55. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  56. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  57. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  58. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  59. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  60. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  61. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  62. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  63. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  64. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  65. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  66. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  67. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  68. package/docs/interfaces/OpenParameter.html +2 -2
  69. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  70. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  71. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  72. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  73. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  74. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  75. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  76. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  77. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -0
  78. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -0
  79. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -0
  80. package/docs/interfaces/PanoRulerProPluginState.html +1 -0
  81. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  82. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  83. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  84. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  85. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  86. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  87. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  89. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  90. package/docs/interfaces/Point.html +1 -1
  91. package/docs/interfaces/PointJson.html +1 -1
  92. package/docs/interfaces/Room.html +1 -1
  93. package/docs/interfaces/RoomInfo.html +1 -1
  94. package/docs/interfaces/RoomLabel.html +7 -7
  95. package/docs/interfaces/RoomRules.html +1 -1
  96. package/docs/interfaces/Rooms.html +1 -1
  97. package/docs/modules.html +19 -17
  98. package/libs/ItemLabelPlugin/ItemLabelComponent.js +34 -21
  99. package/libs/ItemLabelPlugin/Plugin.js +16 -10
  100. package/libs/ItemLabelPlugin/typings.d.ts +4 -0
  101. package/libs/ItemLabelPlugin/utils/parseData.js +1 -1
  102. package/libs/ModelViewPlugin/Plugin.d.ts +4 -4
  103. package/libs/ModelViewPlugin/Plugin.js +2 -3
  104. package/libs/PanoRulerProPlugin/Controller.d.ts +15 -0
  105. package/libs/PanoRulerProPlugin/Controller.js +110 -0
  106. package/libs/PanoRulerProPlugin/RulerItem.js +314 -0
  107. package/libs/PanoRulerProPlugin/RulerItems.js +377 -0
  108. package/libs/PanoRulerProPlugin/index.d.ts +8 -0
  109. package/libs/PanoRulerProPlugin/index.js +8 -0
  110. package/libs/PanoRulerProPlugin/typings.d.ts +46 -0
  111. package/libs/PanoRulerProPlugin/typings.js +1 -0
  112. package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +2 -1
  113. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +8 -1
  114. package/libs/index.d.ts +2 -0
  115. package/libs/index.js +3 -0
  116. package/libs/shared-utils/logger.d.ts +16 -0
  117. package/libs/shared-utils/logger.js +47 -0
  118. package/package.json +1 -1
@@ -0,0 +1,314 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ add_render_callback,
5
+ add_resize_listener,
6
+ append,
7
+ append_styles,
8
+ attr,
9
+ destroy_each,
10
+ detach,
11
+ element,
12
+ init,
13
+ insert,
14
+ noop,
15
+ null_to_empty,
16
+ safe_not_equal,
17
+ set_data,
18
+ set_style,
19
+ space,
20
+ text
21
+ } from "svelte/internal";
22
+
23
+ function add_css(target) {
24
+ append_styles(target, "svelte-xuljmc", ".PanoRulerPlugin-rule-line.svelte-xuljmc.svelte-xuljmc{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-xuljmc.svelte-xuljmc::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-xuljmc-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-xuljmc.svelte-xuljmc::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-xuljmc-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-xuljmc em.svelte-xuljmc{display:block;height:0.0625rem;animation:svelte-xuljmc-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-xuljmc.svelte-xuljmc{display:flex;height:0.0625rem;animation:svelte-xuljmc-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-xuljmc.svelte-xuljmc{height:100%;background:#ffffff}.em-dotted.svelte-xuljmc.svelte-xuljmc{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-xuljmc.svelte-xuljmc{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-xuljmc.svelte-xuljmc{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;-webkit-animation:svelte-xuljmc-viewport-rule-label 0.25s ease 1s;animation:svelte-xuljmc-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-xuljmc-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-xuljmc-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-xuljmc-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}");
25
+ }
26
+
27
+ function get_each_context(ctx, list, i) {
28
+ const child_ctx = ctx.slice();
29
+ child_ctx[6] = list[i];
30
+ return child_ctx;
31
+ }
32
+
33
+ // (28:2) {:else}
34
+ function create_else_block(ctx) {
35
+ let div;
36
+ let each_value = /*rulerItemProp*/ ctx[0].children;
37
+ let each_blocks = [];
38
+
39
+ for (let i = 0; i < each_value.length; i += 1) {
40
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
41
+ }
42
+
43
+ return {
44
+ c() {
45
+ div = element("div");
46
+
47
+ for (let i = 0; i < each_blocks.length; i += 1) {
48
+ each_blocks[i].c();
49
+ }
50
+
51
+ attr(div, "class", "rule-mixed-line svelte-xuljmc");
52
+ },
53
+ m(target, anchor) {
54
+ insert(target, div, anchor);
55
+
56
+ for (let i = 0; i < each_blocks.length; i += 1) {
57
+ each_blocks[i].m(div, null);
58
+ }
59
+ },
60
+ p(ctx, dirty) {
61
+ if (dirty & /*rulerItemProp, vars*/ 9) {
62
+ each_value = /*rulerItemProp*/ ctx[0].children;
63
+ let i;
64
+
65
+ for (i = 0; i < each_value.length; i += 1) {
66
+ const child_ctx = get_each_context(ctx, each_value, i);
67
+
68
+ if (each_blocks[i]) {
69
+ each_blocks[i].p(child_ctx, dirty);
70
+ } else {
71
+ each_blocks[i] = create_each_block(child_ctx);
72
+ each_blocks[i].c();
73
+ each_blocks[i].m(div, null);
74
+ }
75
+ }
76
+
77
+ for (; i < each_blocks.length; i += 1) {
78
+ each_blocks[i].d(1);
79
+ }
80
+
81
+ each_blocks.length = each_value.length;
82
+ }
83
+ },
84
+ d(detaching) {
85
+ if (detaching) detach(div);
86
+ destroy_each(each_blocks, detaching);
87
+ }
88
+ };
89
+ }
90
+
91
+ // (26:2) {#if rulerItemProp.children.length === 0}
92
+ function create_if_block(ctx) {
93
+ let em;
94
+ let em_class_value;
95
+
96
+ return {
97
+ c() {
98
+ em = element("em");
99
+
100
+ attr(em, "class", em_class_value = "" + (null_to_empty(/*rulerItemProp*/ ctx[0].state
101
+ ? 'em-solid'
102
+ : 'em-dotted') + " svelte-xuljmc"));
103
+
104
+ attr(em, "style", /*vars*/ ctx[3]);
105
+ },
106
+ m(target, anchor) {
107
+ insert(target, em, anchor);
108
+ },
109
+ p(ctx, dirty) {
110
+ if (dirty & /*rulerItemProp*/ 1 && em_class_value !== (em_class_value = "" + (null_to_empty(/*rulerItemProp*/ ctx[0].state
111
+ ? 'em-solid'
112
+ : 'em-dotted') + " svelte-xuljmc"))) {
113
+ attr(em, "class", em_class_value);
114
+ }
115
+
116
+ if (dirty & /*vars*/ 8) {
117
+ attr(em, "style", /*vars*/ ctx[3]);
118
+ }
119
+ },
120
+ d(detaching) {
121
+ if (detaching) detach(em);
122
+ }
123
+ };
124
+ }
125
+
126
+ // (30:6) {#each rulerItemProp.children as child}
127
+ function create_each_block(ctx) {
128
+ let div;
129
+ let div_class_value;
130
+ let style_width = `${/*child*/ ctx[6].width}px`;
131
+
132
+ return {
133
+ c() {
134
+ div = element("div");
135
+ attr(div, "class", div_class_value = "" + (null_to_empty(/*child*/ ctx[6].state ? 'em-solid' : 'em-dotted') + " svelte-xuljmc"));
136
+ attr(div, "style", /*vars*/ ctx[3]);
137
+ set_style(div, "width", style_width, false);
138
+ },
139
+ m(target, anchor) {
140
+ insert(target, div, anchor);
141
+ },
142
+ p(ctx, dirty) {
143
+ if (dirty & /*rulerItemProp*/ 1 && div_class_value !== (div_class_value = "" + (null_to_empty(/*child*/ ctx[6].state ? 'em-solid' : 'em-dotted') + " svelte-xuljmc"))) {
144
+ attr(div, "class", div_class_value);
145
+ }
146
+
147
+ if (dirty & /*vars*/ 8) {
148
+ attr(div, "style", /*vars*/ ctx[3]);
149
+ }
150
+
151
+ if (dirty & /*rulerItemProp*/ 1 && style_width !== (style_width = `${/*child*/ ctx[6].width}px`)) {
152
+ set_style(div, "width", style_width, false);
153
+ }
154
+ },
155
+ d(detaching) {
156
+ if (detaching) detach(div);
157
+ }
158
+ };
159
+ }
160
+
161
+ function create_fragment(ctx) {
162
+ let div2;
163
+ let t0;
164
+ let div1;
165
+ let div0;
166
+ let t1_value = /*rulerItemProp*/ ctx[0].labelElement + "";
167
+ let t1;
168
+ let div0_resize_listener;
169
+ let style_left = `${/*rulerItemProp*/ ctx[0].labelOffset}%`;
170
+ let style_width = `${/*rulerItemProp*/ ctx[0].width}px`;
171
+ let style_left_1 = `${/*rulerItemProp*/ ctx[0].left}px`;
172
+ let style_top = `${/*rulerItemProp*/ ctx[0].top}px`;
173
+ let style_transform = `rotate(${/*rulerItemProp*/ ctx[0].rotateDeg}deg)`;
174
+
175
+ function select_block_type(ctx, dirty) {
176
+ if (/*rulerItemProp*/ ctx[0].children.length === 0) return create_if_block;
177
+ return create_else_block;
178
+ }
179
+
180
+ let current_block_type = select_block_type(ctx, -1);
181
+ let if_block = current_block_type(ctx);
182
+
183
+ return {
184
+ c() {
185
+ div2 = element("div");
186
+ if_block.c();
187
+ t0 = space();
188
+ div1 = element("div");
189
+ div0 = element("div");
190
+ t1 = text(t1_value);
191
+ attr(div0, "class", "PanoRulerPlugin-rule-label-name svelte-xuljmc");
192
+ add_render_callback(() => /*div0_elementresize_handler*/ ctx[4].call(div0));
193
+ attr(div1, "class", "PanoRulerPlugin-rule-label svelte-xuljmc");
194
+ set_style(div1, "left", style_left, false);
195
+ attr(div2, "class", "PanoRulerPlugin-rule-line svelte-xuljmc");
196
+ set_style(div2, "width", style_width, false);
197
+ set_style(div2, "left", style_left_1, false);
198
+ set_style(div2, "top", style_top, false);
199
+ set_style(div2, "transform", style_transform, false);
200
+
201
+ set_style(
202
+ div2,
203
+ "display",
204
+ /*rulerItemProp*/ ctx[0].visible && /*_visible*/ ctx[2]
205
+ ? 'block'
206
+ : 'none',
207
+ false
208
+ );
209
+ },
210
+ m(target, anchor) {
211
+ insert(target, div2, anchor);
212
+ if_block.m(div2, null);
213
+ append(div2, t0);
214
+ append(div2, div1);
215
+ append(div1, div0);
216
+ append(div0, t1);
217
+ div0_resize_listener = add_resize_listener(div0, /*div0_elementresize_handler*/ ctx[4].bind(div0));
218
+ },
219
+ p(ctx, [dirty]) {
220
+ if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block) {
221
+ if_block.p(ctx, dirty);
222
+ } else {
223
+ if_block.d(1);
224
+ if_block = current_block_type(ctx);
225
+
226
+ if (if_block) {
227
+ if_block.c();
228
+ if_block.m(div2, t0);
229
+ }
230
+ }
231
+
232
+ if (dirty & /*rulerItemProp*/ 1 && t1_value !== (t1_value = /*rulerItemProp*/ ctx[0].labelElement + "")) set_data(t1, t1_value);
233
+
234
+ if (dirty & /*rulerItemProp*/ 1 && style_left !== (style_left = `${/*rulerItemProp*/ ctx[0].labelOffset}%`)) {
235
+ set_style(div1, "left", style_left, false);
236
+ }
237
+
238
+ if (dirty & /*rulerItemProp*/ 1 && style_width !== (style_width = `${/*rulerItemProp*/ ctx[0].width}px`)) {
239
+ set_style(div2, "width", style_width, false);
240
+ }
241
+
242
+ if (dirty & /*rulerItemProp*/ 1 && style_left_1 !== (style_left_1 = `${/*rulerItemProp*/ ctx[0].left}px`)) {
243
+ set_style(div2, "left", style_left_1, false);
244
+ }
245
+
246
+ if (dirty & /*rulerItemProp*/ 1 && style_top !== (style_top = `${/*rulerItemProp*/ ctx[0].top}px`)) {
247
+ set_style(div2, "top", style_top, false);
248
+ }
249
+
250
+ if (dirty & /*rulerItemProp*/ 1 && style_transform !== (style_transform = `rotate(${/*rulerItemProp*/ ctx[0].rotateDeg}deg)`)) {
251
+ set_style(div2, "transform", style_transform, false);
252
+ }
253
+
254
+ if (dirty & /*rulerItemProp, _visible*/ 5) {
255
+ set_style(
256
+ div2,
257
+ "display",
258
+ /*rulerItemProp*/ ctx[0].visible && /*_visible*/ ctx[2]
259
+ ? 'block'
260
+ : 'none',
261
+ false
262
+ );
263
+ }
264
+ },
265
+ i: noop,
266
+ o: noop,
267
+ d(detaching) {
268
+ if (detaching) detach(div2);
269
+ if_block.d();
270
+ div0_resize_listener();
271
+ }
272
+ };
273
+ }
274
+
275
+ function instance($$self, $$props, $$invalidate) {
276
+ let vars;
277
+ let { rulerItemProp } = $$props;
278
+ let _visible = true;
279
+ let labelWidth;
280
+ let EM_DOTTED_BG = `data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=`;
281
+
282
+ function div0_elementresize_handler() {
283
+ labelWidth = this.offsetWidth;
284
+ $$invalidate(1, labelWidth);
285
+ }
286
+
287
+ $$self.$$set = $$props => {
288
+ if ('rulerItemProp' in $$props) $$invalidate(0, rulerItemProp = $$props.rulerItemProp);
289
+ };
290
+
291
+ $$self.$$.update = () => {
292
+ if ($$self.$$.dirty & /*labelWidth, rulerItemProp*/ 3) {
293
+ $: {
294
+ if (labelWidth >= rulerItemProp.width || labelWidth / 2 >= rulerItemProp.labelOffset / 100 * rulerItemProp.width || labelWidth / 2 >= (1 - rulerItemProp.labelOffset / 100) * rulerItemProp.width) {
295
+ $$invalidate(2, _visible = false);
296
+ } else {
297
+ $$invalidate(2, _visible = true);
298
+ }
299
+ }
300
+ }
301
+ };
302
+
303
+ $: $$invalidate(3, vars = `--background-image: url(${EM_DOTTED_BG})`);
304
+ return [rulerItemProp, labelWidth, _visible, vars, div0_elementresize_handler];
305
+ }
306
+
307
+ class Component extends SvelteComponent {
308
+ constructor(options) {
309
+ super();
310
+ init(this, options, instance, create_fragment, safe_not_equal, { rulerItemProp: 0 }, add_css);
311
+ }
312
+ }
313
+
314
+ export default Component;
@@ -0,0 +1,377 @@
1
+ /* generated by Svelte v3.47.0 */
2
+ import {
3
+ SvelteComponent,
4
+ check_outros,
5
+ create_component,
6
+ destroy_component,
7
+ destroy_each,
8
+ detach,
9
+ element,
10
+ group_outros,
11
+ init,
12
+ insert,
13
+ mount_component,
14
+ safe_not_equal,
15
+ transition_in,
16
+ transition_out
17
+ } from "svelte/internal";
18
+
19
+ import { Five } from '@realsee/five';
20
+ import { nextFrame } from '../shared-utils/animationFrame';
21
+ import equal from '../shared-utils/equal';
22
+ import { intersectionOfLine } from '../shared-utils/math/planimetry';
23
+ import throttle from '../shared-utils/throttle';
24
+ import { onDestroy, onMount } from 'svelte';
25
+ import { Vector3 } from 'three';
26
+ import RulerItem from './RulerItem';
27
+
28
+ function get_each_context(ctx, list, i) {
29
+ const child_ctx = ctx.slice();
30
+ child_ctx[16] = list[i];
31
+ return child_ctx;
32
+ }
33
+
34
+ // (206:2) {#each rulerItemProp as itemData}
35
+ function create_each_block(ctx) {
36
+ let ruleritem;
37
+ let current;
38
+
39
+ ruleritem = new RulerItem({
40
+ props: { rulerItemProp: /*itemData*/ ctx[16] }
41
+ });
42
+
43
+ return {
44
+ c() {
45
+ create_component(ruleritem.$$.fragment);
46
+ },
47
+ m(target, anchor) {
48
+ mount_component(ruleritem, target, anchor);
49
+ current = true;
50
+ },
51
+ p(ctx, dirty) {
52
+ const ruleritem_changes = {};
53
+ if (dirty & /*rulerItemProp*/ 1) ruleritem_changes.rulerItemProp = /*itemData*/ ctx[16];
54
+ ruleritem.$set(ruleritem_changes);
55
+ },
56
+ i(local) {
57
+ if (current) return;
58
+ transition_in(ruleritem.$$.fragment, local);
59
+ current = true;
60
+ },
61
+ o(local) {
62
+ transition_out(ruleritem.$$.fragment, local);
63
+ current = false;
64
+ },
65
+ d(detaching) {
66
+ destroy_component(ruleritem, detaching);
67
+ }
68
+ };
69
+ }
70
+
71
+ function create_fragment(ctx) {
72
+ let div;
73
+ let current;
74
+ let each_value = /*rulerItemProp*/ ctx[0];
75
+ let each_blocks = [];
76
+
77
+ for (let i = 0; i < each_value.length; i += 1) {
78
+ each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
79
+ }
80
+
81
+ const out = i => transition_out(each_blocks[i], 1, 1, () => {
82
+ each_blocks[i] = null;
83
+ });
84
+
85
+ return {
86
+ c() {
87
+ div = element("div");
88
+
89
+ for (let i = 0; i < each_blocks.length; i += 1) {
90
+ each_blocks[i].c();
91
+ }
92
+ },
93
+ m(target, anchor) {
94
+ insert(target, div, anchor);
95
+
96
+ for (let i = 0; i < each_blocks.length; i += 1) {
97
+ each_blocks[i].m(div, null);
98
+ }
99
+
100
+ current = true;
101
+ },
102
+ p(ctx, [dirty]) {
103
+ if (dirty & /*rulerItemProp*/ 1) {
104
+ each_value = /*rulerItemProp*/ ctx[0];
105
+ let i;
106
+
107
+ for (i = 0; i < each_value.length; i += 1) {
108
+ const child_ctx = get_each_context(ctx, each_value, i);
109
+
110
+ if (each_blocks[i]) {
111
+ each_blocks[i].p(child_ctx, dirty);
112
+ transition_in(each_blocks[i], 1);
113
+ } else {
114
+ each_blocks[i] = create_each_block(child_ctx);
115
+ each_blocks[i].c();
116
+ transition_in(each_blocks[i], 1);
117
+ each_blocks[i].m(div, null);
118
+ }
119
+ }
120
+
121
+ group_outros();
122
+
123
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
124
+ out(i);
125
+ }
126
+
127
+ check_outros();
128
+ }
129
+ },
130
+ i(local) {
131
+ if (current) return;
132
+
133
+ for (let i = 0; i < each_value.length; i += 1) {
134
+ transition_in(each_blocks[i]);
135
+ }
136
+
137
+ current = true;
138
+ },
139
+ o(local) {
140
+ each_blocks = each_blocks.filter(Boolean);
141
+
142
+ for (let i = 0; i < each_blocks.length; i += 1) {
143
+ transition_out(each_blocks[i]);
144
+ }
145
+
146
+ current = false;
147
+ },
148
+ d(detaching) {
149
+ if (detaching) detach(div);
150
+ destroy_each(each_blocks, detaching);
151
+ }
152
+ };
153
+ }
154
+
155
+ function instance($$self, $$props, $$invalidate) {
156
+ var _a, _b, _c, _d;
157
+ let { five } = $$props;
158
+ let { rulerDatas } = $$props;
159
+ let { options } = $$props;
160
+ let rulerItemProp = [];
161
+
162
+ const canvasWidth = ((_b = (_a = five.getElement()) === null || _a === void 0
163
+ ? void 0
164
+ : _a.parentElement) === null || _b === void 0
165
+ ? void 0
166
+ : _b.clientWidth) || 0;
167
+
168
+ const canvasHeight = ((_d = (_c = five.getElement()) === null || _c === void 0
169
+ ? void 0
170
+ : _c.parentElement) === null || _d === void 0
171
+ ? void 0
172
+ : _d.clientHeight) || 0;
173
+
174
+ const getRuleScreenIntr = (startPoint, endPoint) => {
175
+ const screenLines = [
176
+ [{ x: 0, y: 0 }, { x: canvasWidth, y: 0 }],
177
+ [{ x: 0, y: 0 }, { x: 0, y: canvasHeight }],
178
+ [{ x: canvasWidth, y: 0 }, { x: canvasWidth, y: canvasHeight }],
179
+ [{ x: 0, y: canvasHeight }, { x: canvasWidth, y: canvasHeight }]
180
+ ];
181
+
182
+ const intr = [];
183
+
184
+ for (let i = 0; i < screenLines.length; i++) {
185
+ const result = intersectionOfLine([startPoint, endPoint], [screenLines[i][0], screenLines[i][1]], true);
186
+ if (result) intr.push(result);
187
+ }
188
+
189
+ if (intr.length === 0) return false; else {
190
+ return intr;
191
+ }
192
+ };
193
+
194
+ const getPosition = (start, end) => {
195
+ const startPoint = start.clone().project(five.camera);
196
+ const startLeft = (startPoint.x + 1) / 2 * canvasWidth;
197
+ const startTop = (-startPoint.y + 1) / 2 * canvasHeight;
198
+ const endPoint = end.clone().project(five.camera);
199
+ const endLeft = (endPoint.x + 1) / 2 * canvasWidth;
200
+ const endTop = (-endPoint.y + 1) / 2 * canvasHeight;
201
+ const distance = Math.sqrt(Math.pow(endLeft - startLeft, 2) + Math.pow(endTop - startTop, 2));
202
+
203
+ return {
204
+ startLeft,
205
+ startTop,
206
+ endLeft,
207
+ endTop,
208
+ distance
209
+ };
210
+ };
211
+
212
+ const getPositionAndVisible = (start, end, visibleOrigin) => {
213
+ const cameraPosition = five.camera.position;
214
+ const cameraDirection = five.camera.getWorldDirection(new Vector3());
215
+ const startAngle = start.clone().sub(cameraPosition).normalize().angleTo(cameraDirection);
216
+ const endAngle = end.clone().sub(cameraPosition).normalize().angleTo(cameraDirection);
217
+ const ruleLength = start.distanceTo(end);
218
+ const midPoint = end.clone().sub(end.clone().sub(start).divide(new Vector3(2, 2, 2)));
219
+ const disFromCameraToMid = midPoint.distanceTo(cameraPosition);
220
+ const { startLeft, startTop, endLeft, endTop, distance } = getPosition(start, end);
221
+ const rad = Math.PI / 2 - Math.atan2(endLeft - startLeft, startTop - endTop);
222
+ const deg = -(rad / Math.PI) * 180;
223
+ let visible = true;
224
+ if (!visibleOrigin) visible = false;
225
+
226
+ // 只显示拐点相连的线
227
+ if (!equal(start, visibleOrigin) && !equal(end, visibleOrigin)) {
228
+ visible = false;
229
+ }
230
+
231
+ // 线小于0.3m隐藏
232
+ if (ruleLength < 0.3) {
233
+ visible = false;
234
+ }
235
+
236
+ if (startAngle > Math.PI / 2) {
237
+ visible = false;
238
+ }
239
+
240
+ if (endAngle > Math.PI / 2) {
241
+ visible = false;
242
+ }
243
+
244
+ if (disFromCameraToMid / ruleLength > 8) {
245
+ visible = false;
246
+ }
247
+
248
+ let labelOffset = 50;
249
+ let visibleLength = distance;
250
+ const intr = getRuleScreenIntr({ x: ~~startLeft, y: ~~startTop }, { x: ~~endLeft, y: ~~endTop });
251
+
252
+ if (intr && intr.length === 1) {
253
+ if (equal(start, visibleOrigin)) {
254
+ visibleLength = Math.sqrt(Math.pow(intr[0].x - startLeft, 2) + Math.pow(intr[0].y - startTop, 2));
255
+ labelOffset = visibleLength / distance * 50;
256
+ } else if (equal(end, visibleOrigin)) {
257
+ visibleLength = Math.sqrt(Math.pow(intr[0].x - endLeft, 2) + Math.pow(intr[0].y - endTop, 2));
258
+ labelOffset = 100 - visibleLength / distance * 50;
259
+ }
260
+ }
261
+
262
+ if (intr && intr.length === 2) {
263
+ const middlePoint = {
264
+ x: (intr[0].x + intr[1].x) / 2,
265
+ y: (intr[0].y + intr[1].y) / 2
266
+ };
267
+
268
+ const distanceFromStart = Math.sqrt(Math.pow(middlePoint.x - startLeft, 2) + Math.pow(middlePoint.y - startTop, 2));
269
+ labelOffset = distanceFromStart / distance * 100;
270
+ }
271
+
272
+ return {
273
+ startLeft,
274
+ startTop,
275
+ distance,
276
+ deg,
277
+ visible,
278
+ labelOffset,
279
+ ruleLength
280
+ };
281
+ };
282
+
283
+ const updatePanoRulerData = () => {
284
+ const panoIndex = five.panoIndex;
285
+ const rulerData = rulerDatas.find(data => data.panoIndex === panoIndex);
286
+ if (!rulerData) return $$invalidate(0, rulerItemProp = []);
287
+
288
+ // 非全景模式下隐藏所有标尺
289
+ if (five.currentMode !== Five.Mode.Panorama) return $$invalidate(0, rulerItemProp = []);
290
+
291
+ const cameraPosition = five.camera.position;
292
+ const cameraDirection = five.camera.getWorldDirection(new Vector3());
293
+ const startPoints = rulerData.lines.map(v => new Vector3(v.start[0], -v.start[1], -v.start[2]));
294
+ const endPoints = rulerData.lines.map(v => new Vector3(v.end[0], -v.end[1], -v.end[2]));
295
+
296
+ // 可以看到的角度最小的拐点
297
+ const [visibleOrigin] = startPoints.concat(endPoints).sort((pointA, pointB) => {
298
+ const angleA = pointA.clone().setY(0).sub(cameraPosition).normalize().angleTo(cameraDirection.clone().setY(0));
299
+ const angleB = pointB.clone().setY(0).sub(cameraPosition).normalize().angleTo(cameraDirection.clone().setY(0));
300
+ return angleA - angleB;
301
+ });
302
+
303
+ const data = rulerData.lines.map(line => {
304
+ var _a, _b;
305
+ const start = line.start;
306
+ const end = line.end;
307
+ const { startLeft, startTop, distance, deg, visible, labelOffset, ruleLength } = getPositionAndVisible(new Vector3(start[0], -start[1], -start[2]), new Vector3(end[0], -end[1], -end[2]), visibleOrigin);
308
+ const children = [];
309
+
310
+ if (line.children && ((_a = line.children) === null || _a === void 0
311
+ ? void 0
312
+ : _a.length) > 0) {
313
+ (_b = line.children) === null || _b === void 0
314
+ ? void 0
315
+ : _b.forEach(l => {
316
+ const start = l.start;
317
+ const end = l.end;
318
+ const { distance } = getPosition(new Vector3(start[0], -start[1], -start[2]), new Vector3(end[0], -end[1], -end[2]));
319
+ children.push({ width: distance, state: l.state });
320
+ });
321
+ }
322
+
323
+ return {
324
+ width: distance,
325
+ left: startLeft,
326
+ top: startTop,
327
+ rotateDeg: deg,
328
+ state: line.state,
329
+ children,
330
+ labelOffset,
331
+ visible,
332
+ labelElement: options.distanceText(ruleLength)
333
+ };
334
+ });
335
+
336
+ $$invalidate(0, rulerItemProp = data);
337
+ };
338
+
339
+ const nextFrameFreshRule = () => nextFrame(updatePanoRulerData);
340
+ const throttleFreshRule = throttle(updatePanoRulerData, 80);
341
+
342
+ onMount(() => {
343
+ updatePanoRulerData();
344
+ five.on('panoArrived', updatePanoRulerData);
345
+ five.on('modeChange', updatePanoRulerData);
346
+ five.on('cameraDirectionUpdate', nextFrameFreshRule);
347
+ five.on('movingToPano', nextFrameFreshRule);
348
+ five.on('mouseWheel', () => throttleFreshRule());
349
+ five.on('pinchGesture', () => throttleFreshRule());
350
+ });
351
+
352
+ onDestroy(() => {
353
+ five.off('panoArrived', updatePanoRulerData);
354
+ five.off('modeChange', updatePanoRulerData);
355
+ five.off('cameraDirectionUpdate', nextFrameFreshRule);
356
+ five.off('movingToPano', nextFrameFreshRule);
357
+ five.off('mouseWheel', () => throttleFreshRule());
358
+ five.off('pinchGesture', () => throttleFreshRule());
359
+ });
360
+
361
+ $$self.$$set = $$props => {
362
+ if ('five' in $$props) $$invalidate(1, five = $$props.five);
363
+ if ('rulerDatas' in $$props) $$invalidate(2, rulerDatas = $$props.rulerDatas);
364
+ if ('options' in $$props) $$invalidate(3, options = $$props.options);
365
+ };
366
+
367
+ return [rulerItemProp, five, rulerDatas, options];
368
+ }
369
+
370
+ class Component extends SvelteComponent {
371
+ constructor(options) {
372
+ super();
373
+ init(this, options, instance, create_fragment, safe_not_equal, { five: 1, rulerDatas: 2, options: 3 });
374
+ }
375
+ }
376
+
377
+ export default Component;
@@ -0,0 +1,8 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import type { PanoRulerProPluginParameterType, PanoRulerProPluginExportType } from './typings';
3
+ /**
4
+ * 全景标尺插件
5
+ */
6
+ export declare const PanoRulerProPlugin: FivePlugin<PanoRulerProPluginParameterType, PanoRulerProPluginExportType>;
7
+ export default PanoRulerProPlugin;
8
+ export type { PanoRulerProPluginParameterType, PanoRulerProPluginExportType, PanoRulerProPluginOptions, PanoRulerProPluginState, } from './typings';
@@ -0,0 +1,8 @@
1
+ import Controller from './Controller';
2
+ /**
3
+ * 全景标尺插件
4
+ */
5
+ export const PanoRulerProPlugin = (five, params) => {
6
+ return new Controller(five, params);
7
+ };
8
+ export default PanoRulerProPlugin;