viral-viewer-2 3.3.8 → 3.4.0
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/LICENSE +57 -57
- package/dist/components/animation/viral-animation.d.ts +1 -0
- package/dist/components/animation/viral-animation.js +26 -2
- package/dist/components/animation/viral-animation.js.map +1 -1
- package/dist/components/camera/viral-camera.d.ts +13 -3
- package/dist/components/camera/viral-camera.js +57 -7
- package/dist/components/camera/viral-camera.js.map +1 -1
- package/dist/components/centralized-event-handler/viral-centralized-event-handler.js +6 -2
- package/dist/components/centralized-event-handler/viral-centralized-event-handler.js.map +1 -1
- package/dist/components/compress/{compress.processor.d.ts → viral-compress.processor.d.ts} +1 -1
- package/dist/components/compress/{compress.processor.js → viral-compress.processor.js} +4 -4
- package/dist/components/compress/viral-compress.processor.js.map +1 -0
- package/dist/components/context-menu/viral-context-menu.js +9 -8
- package/dist/components/context-menu/viral-context-menu.js.map +1 -1
- package/dist/components/keyboard/viral-keyboard.d.ts +11 -1
- package/dist/components/keyboard/viral-keyboard.js +33 -0
- package/dist/components/keyboard/viral-keyboard.js.map +1 -1
- package/dist/components/loader/{viral-viewer-point-cloud.loader.d.ts → viral-point-cloud.loader.d.ts} +1 -1
- package/dist/components/loader/{viral-viewer-point-cloud.loader.js → viral-point-cloud.loader.js} +4 -4
- package/dist/components/loader/viral-point-cloud.loader.js.map +1 -0
- package/dist/components/loader/{viral-viewer-revit.loader.d.ts → viral-revit.loader.d.ts} +1 -3
- package/dist/components/loader/{viral-viewer-revit.loader.js → viral-revit.loader.js} +8 -13
- package/dist/components/loader/viral-revit.loader.js.map +1 -0
- package/dist/components/loader/viral-three.loader.d.ts +11 -0
- package/dist/components/loader/viral-three.loader.js +20 -0
- package/dist/components/loader/viral-three.loader.js.map +1 -0
- package/dist/components/loader/viral.loader.d.ts +11 -0
- package/dist/components/loader/viral.loader.js +16 -0
- package/dist/components/loader/viral.loader.js.map +1 -0
- package/dist/components/mouse/viral-mouse.js +16 -9
- package/dist/components/mouse/viral-mouse.js.map +1 -1
- package/dist/components/scene/viral-scene.d.ts +8 -3
- package/dist/components/scene/viral-scene.js +28 -15
- package/dist/components/scene/viral-scene.js.map +1 -1
- package/dist/components/spinner/viral-spinner.js +159 -159
- package/dist/components/stats/viral-stats.d.ts +7 -0
- package/dist/components/stats/viral-stats.js +16 -0
- package/dist/components/stats/viral-stats.js.map +1 -0
- package/dist/components/worker/viral-viewer-2.worker.d.ts +1 -4
- package/dist/components/worker/viral-viewer-2.worker.js +3 -10
- package/dist/components/worker/viral-viewer-2.worker.js.map +1 -1
- package/dist/components/worker/viral-viewer-3.worker.d.ts +1 -7
- package/dist/components/worker/viral-viewer-3.worker.js +7 -18
- package/dist/components/worker/viral-viewer-3.worker.js.map +1 -1
- package/dist/components/worker-script/threejs.types.js +185 -185
- package/dist/const/colors.d.ts +1 -0
- package/dist/const/colors.js +1 -0
- package/dist/const/colors.js.map +1 -1
- package/dist/models/dictionary.model.d.ts +0 -10
- package/dist/models/dictionary.model.js +0 -41
- package/dist/models/dictionary.model.js.map +1 -1
- package/dist/threejs-addon/gltf-loader.d.ts +17 -0
- package/dist/threejs-addon/gltf-loader.js +2796 -0
- package/dist/threejs-addon/gltf-loader.js.map +1 -0
- package/dist/threejs-addon/transform-control.d.ts +74 -0
- package/dist/threejs-addon/transform-control.js +1033 -0
- package/dist/threejs-addon/transform-control.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.js +48 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/threejs.d.ts +2 -0
- package/dist/utils/threejs.js +10 -1
- package/dist/utils/threejs.js.map +1 -1
- package/dist/viral-viewer-api.d.ts +7 -11
- package/dist/viral-viewer-api.js +10 -14
- package/dist/viral-viewer-api.js.map +1 -1
- package/package.json +30 -29
- package/dist/components/compress/compress.processor.js.map +0 -1
- package/dist/components/loader/viral-viewer-point-cloud.loader.js.map +0 -1
- package/dist/components/loader/viral-viewer-revit.loader.js.map +0 -1
- package/dist/components/worker/test-worker.worker.d.ts +0 -6
- package/dist/components/worker/test-worker.worker.js +0 -21
- package/dist/components/worker/test-worker.worker.js.map +0 -1
- package/dist/components/worker/viral-viewer.worker-pool.d.ts +0 -0
- package/dist/components/worker/viral-viewer.worker-pool.js +0 -61
- package/dist/components/worker/viral-viewer.worker-pool.js.map +0 -1
- package/dist/components/worker/worker-pool.d.ts +0 -21
- package/dist/components/worker/worker-pool.js +0 -47
- package/dist/components/worker/worker-pool.js.map +0 -1
- package/dist/components/worker/worker-thread.d.ts +0 -9
- package/dist/components/worker/worker-thread.js +0 -30
- package/dist/components/worker/worker-thread.js.map +0 -1
- package/dist/components/worker-script/threejs.script.d.ts +0 -1
- package/dist/components/worker-script/threejs.script.js +0 -16
- package/dist/components/worker-script/threejs.script.js.map +0 -1
|
@@ -6,170 +6,170 @@ class ViralSpinner {
|
|
|
6
6
|
constructor(viralViewerApi) {
|
|
7
7
|
this.viralViewerApi = viralViewerApi;
|
|
8
8
|
this.spinner = null;
|
|
9
|
-
this.logo = `<svg
|
|
10
|
-
viewBox="0 0 135.46667 135.46667"
|
|
11
|
-
version="1.1"
|
|
12
|
-
id="svg7238"
|
|
13
|
-
sodipodi:docname="viral2-green.svg"
|
|
14
|
-
inkscape:export-filename="viral2-512.png"
|
|
15
|
-
inkscape:export-xdpi="96"
|
|
16
|
-
inkscape:export-ydpi="96"
|
|
17
|
-
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
|
|
18
|
-
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
19
|
-
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
20
|
-
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
21
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
-
xmlns:svg="http://www.w3.org/2000/svg">
|
|
23
|
-
<sodipodi:namedview
|
|
24
|
-
id="namedview7240"
|
|
25
|
-
pagecolor="#ffffff"
|
|
26
|
-
bordercolor="#000000"
|
|
27
|
-
borderopacity="0.25"
|
|
28
|
-
inkscape:showpageshadow="2"
|
|
29
|
-
inkscape:pageopacity="0.0"
|
|
30
|
-
inkscape:pagecheckerboard="0"
|
|
31
|
-
inkscape:deskcolor="#d1d1d1"
|
|
32
|
-
inkscape:document-units="px"
|
|
33
|
-
showgrid="false"
|
|
34
|
-
showborder="false"
|
|
35
|
-
inkscape:zoom="0.99327643"
|
|
36
|
-
inkscape:cx="-5.53723"
|
|
37
|
-
inkscape:cy="208.4012"
|
|
38
|
-
inkscape:window-width="1920"
|
|
39
|
-
inkscape:window-height="1025"
|
|
40
|
-
inkscape:window-x="-8"
|
|
41
|
-
inkscape:window-y="-8"
|
|
42
|
-
inkscape:window-maximized="1"
|
|
43
|
-
inkscape:current-layer="layer1" />
|
|
44
|
-
<defs
|
|
45
|
-
id="defs7235">
|
|
46
|
-
<linearGradient
|
|
47
|
-
inkscape:collect="always"
|
|
48
|
-
id="linearGradient1616">
|
|
49
|
-
<stop
|
|
50
|
-
style="stop-color:#56674d;stop-opacity:1;"
|
|
51
|
-
offset="0"
|
|
52
|
-
id="stop1612" />
|
|
53
|
-
<stop
|
|
54
|
-
style="stop-color:#ffffff;stop-opacity:0;"
|
|
55
|
-
offset="1"
|
|
56
|
-
id="stop1614" />
|
|
57
|
-
</linearGradient>
|
|
58
|
-
<linearGradient
|
|
59
|
-
inkscape:collect="always"
|
|
60
|
-
xlink:href="#linearGradient15690"
|
|
61
|
-
id="linearGradient18609"
|
|
62
|
-
gradientUnits="userSpaceOnUse"
|
|
63
|
-
gradientTransform="translate(-166.15654,32.013661)"
|
|
64
|
-
x1="307.17484"
|
|
65
|
-
y1="52.350281"
|
|
66
|
-
x2="326.05994"
|
|
67
|
-
y2="54.673866" />
|
|
68
|
-
<linearGradient
|
|
69
|
-
inkscape:collect="always"
|
|
70
|
-
id="linearGradient15690">
|
|
71
|
-
<stop
|
|
72
|
-
style="stop-color:#56674d;stop-opacity:1;"
|
|
73
|
-
offset="0"
|
|
74
|
-
id="stop15686" />
|
|
75
|
-
<stop
|
|
76
|
-
style="stop-color:#496e7c;stop-opacity:0;"
|
|
77
|
-
offset="1"
|
|
78
|
-
id="stop15688" />
|
|
79
|
-
</linearGradient>
|
|
80
|
-
<linearGradient
|
|
81
|
-
inkscape:collect="always"
|
|
82
|
-
xlink:href="#linearGradient15766"
|
|
83
|
-
id="linearGradient16111-2"
|
|
84
|
-
gradientUnits="userSpaceOnUse"
|
|
85
|
-
x1="94.716965"
|
|
86
|
-
y1="77.459938"
|
|
87
|
-
x2="120.0867"
|
|
88
|
-
y2="65.915489" />
|
|
89
|
-
<linearGradient
|
|
90
|
-
inkscape:collect="always"
|
|
91
|
-
id="linearGradient15766">
|
|
92
|
-
<stop
|
|
93
|
-
style="stop-color:#56674d;stop-opacity:1;"
|
|
94
|
-
offset="0"
|
|
95
|
-
id="stop15762" />
|
|
96
|
-
<stop
|
|
97
|
-
style="stop-color:#496e7c;stop-opacity:0;"
|
|
98
|
-
offset="1"
|
|
99
|
-
id="stop15764" />
|
|
100
|
-
</linearGradient>
|
|
101
|
-
<linearGradient
|
|
102
|
-
inkscape:collect="always"
|
|
103
|
-
xlink:href="#linearGradient15924"
|
|
104
|
-
id="linearGradient18611"
|
|
105
|
-
gradientUnits="userSpaceOnUse"
|
|
106
|
-
gradientTransform="translate(-166.15654,32.013661)"
|
|
107
|
-
x1="252.87965"
|
|
108
|
-
y1="104.78405"
|
|
109
|
-
x2="305.49805"
|
|
110
|
-
y2="61.56583" />
|
|
111
|
-
<linearGradient
|
|
112
|
-
inkscape:collect="always"
|
|
113
|
-
id="linearGradient15924">
|
|
114
|
-
<stop
|
|
115
|
-
style="stop-color:#56674d;stop-opacity:1;"
|
|
116
|
-
offset="0"
|
|
117
|
-
id="stop15920" />
|
|
118
|
-
<stop
|
|
119
|
-
style="stop-color:#ffffff;stop-opacity:0;"
|
|
120
|
-
offset="1"
|
|
121
|
-
id="stop15922" />
|
|
122
|
-
</linearGradient>
|
|
123
|
-
<linearGradient
|
|
124
|
-
inkscape:collect="always"
|
|
125
|
-
xlink:href="#linearGradient1616"
|
|
126
|
-
id="linearGradient18613"
|
|
127
|
-
gradientUnits="userSpaceOnUse"
|
|
128
|
-
gradientTransform="translate(-166.15654,32.013661)"
|
|
129
|
-
x1="262.83365"
|
|
130
|
-
y1="98.616089"
|
|
131
|
-
x2="303.40704"
|
|
132
|
-
y2="56.86591" />
|
|
133
|
-
</defs>
|
|
134
|
-
<g
|
|
135
|
-
inkscape:label="Layer 1"
|
|
136
|
-
inkscape:groupmode="layer"
|
|
137
|
-
id="layer1"
|
|
138
|
-
transform="translate(-81.132986,-92.575601)">
|
|
139
|
-
<g
|
|
140
|
-
id="g489"
|
|
141
|
-
transform="matrix(1.5365255,0,0,1.474116,-14.471343,-5.8524295)">
|
|
142
|
-
<path
|
|
143
|
-
id="path11327-0-0-0"
|
|
144
|
-
style="fill:url(#linearGradient18609);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
145
|
-
d="m 130.56075,85.04143 c 0.52476,0.26239 -18.03983,28.95537 -21.66379,32.11329 -3.42113,2.98116 -7.7736,3.69559 -11.21431,3.82302 -3.4407,0.12743 -10.95953,-1.27434 -10.95953,-1.27434 l 9.53171,15.82074 c 10.00038,14.90295 18.17614,-1.81278 29.33516,-18.06246 3.96568,-5.77479 7.78809,-12.47359 12.92015,-21.46123 4.04139,-7.0776 -7.96539,-10.97224 -7.94939,-10.95902 z" />
|
|
146
|
-
<path
|
|
147
|
-
style="fill:url(#linearGradient16111-2);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
148
|
-
d="m 95.83013,56.198256 16.05664,29.946913 c 0,0 -10.06725,0.637171 -12.870796,-1.019467 L 87.652946,64.863746 c 0,0 -2.527248,-8.028321 8.177184,-8.66549 z"
|
|
149
|
-
id="path11425-3-4-8"
|
|
150
|
-
sodipodi:nodetypes="ccccc"
|
|
151
|
-
class="UnoptimicedTransforms"
|
|
152
|
-
transform="translate(-14.07671,30.372343)" />
|
|
153
|
-
<path
|
|
154
|
-
id="path11327-0-5-6-6-4-3"
|
|
155
|
-
style="fill:url(#linearGradient18611);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
156
|
-
d="m 130.56075,85.04143 c -1.47647,3.17228 -18.24916,29.13777 -21.66379,32.11329 -3.42112,2.98116 -7.7736,3.69559 -11.2143,3.82302 -3.4407,0.12743 -10.95954,-1.27434 -10.95954,-1.27434 l 4.7656,7.91063 h 5.2e-4 c 0.002,0.001 10.85017,15.99897 19.37348,5.76286 2.99574,-3.59774 5.15135,-6.65533 6.98187,-9.54746 2.95629,-4.67075 5.06469,-8.90995 8.4947,-14.29586 14.90527,-23.40477 3.86084,-23.27687 4.22146,-24.49214 z"
|
|
157
|
-
sodipodi:nodetypes="csscccsssc" />
|
|
158
|
-
<path
|
|
159
|
-
id="path11327-0-5-6-6-7-5-9"
|
|
160
|
-
style="fill:url(#linearGradient18613);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
161
|
-
d="m 130.56075,85.04143 c -1.47647,3.17228 -18.24916,29.13777 -21.66379,32.11329 -3.42112,2.98116 -7.7736,3.69559 -11.2143,3.82302 -3.4407,0.12743 -10.95954,-1.27434 -10.95954,-1.27434 l 4.7656,7.91063 h 5.2e-4 c 0.002,0.001 12.41225,10.17869 19.50733,-1.0945 10.41305,-16.54503 3.05221,-4.8499 9.84606,-15.81454 14.04378,-22.66534 9.3575,-24.44829 9.71812,-25.66356 z"
|
|
162
|
-
sodipodi:nodetypes="csscccssc" />
|
|
163
|
-
</g>
|
|
164
|
-
</g>
|
|
9
|
+
this.logo = `<svg
|
|
10
|
+
viewBox="0 0 135.46667 135.46667"
|
|
11
|
+
version="1.1"
|
|
12
|
+
id="svg7238"
|
|
13
|
+
sodipodi:docname="viral2-green.svg"
|
|
14
|
+
inkscape:export-filename="viral2-512.png"
|
|
15
|
+
inkscape:export-xdpi="96"
|
|
16
|
+
inkscape:export-ydpi="96"
|
|
17
|
+
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
|
|
18
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
19
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
20
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
21
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
23
|
+
<sodipodi:namedview
|
|
24
|
+
id="namedview7240"
|
|
25
|
+
pagecolor="#ffffff"
|
|
26
|
+
bordercolor="#000000"
|
|
27
|
+
borderopacity="0.25"
|
|
28
|
+
inkscape:showpageshadow="2"
|
|
29
|
+
inkscape:pageopacity="0.0"
|
|
30
|
+
inkscape:pagecheckerboard="0"
|
|
31
|
+
inkscape:deskcolor="#d1d1d1"
|
|
32
|
+
inkscape:document-units="px"
|
|
33
|
+
showgrid="false"
|
|
34
|
+
showborder="false"
|
|
35
|
+
inkscape:zoom="0.99327643"
|
|
36
|
+
inkscape:cx="-5.53723"
|
|
37
|
+
inkscape:cy="208.4012"
|
|
38
|
+
inkscape:window-width="1920"
|
|
39
|
+
inkscape:window-height="1025"
|
|
40
|
+
inkscape:window-x="-8"
|
|
41
|
+
inkscape:window-y="-8"
|
|
42
|
+
inkscape:window-maximized="1"
|
|
43
|
+
inkscape:current-layer="layer1" />
|
|
44
|
+
<defs
|
|
45
|
+
id="defs7235">
|
|
46
|
+
<linearGradient
|
|
47
|
+
inkscape:collect="always"
|
|
48
|
+
id="linearGradient1616">
|
|
49
|
+
<stop
|
|
50
|
+
style="stop-color:#56674d;stop-opacity:1;"
|
|
51
|
+
offset="0"
|
|
52
|
+
id="stop1612" />
|
|
53
|
+
<stop
|
|
54
|
+
style="stop-color:#ffffff;stop-opacity:0;"
|
|
55
|
+
offset="1"
|
|
56
|
+
id="stop1614" />
|
|
57
|
+
</linearGradient>
|
|
58
|
+
<linearGradient
|
|
59
|
+
inkscape:collect="always"
|
|
60
|
+
xlink:href="#linearGradient15690"
|
|
61
|
+
id="linearGradient18609"
|
|
62
|
+
gradientUnits="userSpaceOnUse"
|
|
63
|
+
gradientTransform="translate(-166.15654,32.013661)"
|
|
64
|
+
x1="307.17484"
|
|
65
|
+
y1="52.350281"
|
|
66
|
+
x2="326.05994"
|
|
67
|
+
y2="54.673866" />
|
|
68
|
+
<linearGradient
|
|
69
|
+
inkscape:collect="always"
|
|
70
|
+
id="linearGradient15690">
|
|
71
|
+
<stop
|
|
72
|
+
style="stop-color:#56674d;stop-opacity:1;"
|
|
73
|
+
offset="0"
|
|
74
|
+
id="stop15686" />
|
|
75
|
+
<stop
|
|
76
|
+
style="stop-color:#496e7c;stop-opacity:0;"
|
|
77
|
+
offset="1"
|
|
78
|
+
id="stop15688" />
|
|
79
|
+
</linearGradient>
|
|
80
|
+
<linearGradient
|
|
81
|
+
inkscape:collect="always"
|
|
82
|
+
xlink:href="#linearGradient15766"
|
|
83
|
+
id="linearGradient16111-2"
|
|
84
|
+
gradientUnits="userSpaceOnUse"
|
|
85
|
+
x1="94.716965"
|
|
86
|
+
y1="77.459938"
|
|
87
|
+
x2="120.0867"
|
|
88
|
+
y2="65.915489" />
|
|
89
|
+
<linearGradient
|
|
90
|
+
inkscape:collect="always"
|
|
91
|
+
id="linearGradient15766">
|
|
92
|
+
<stop
|
|
93
|
+
style="stop-color:#56674d;stop-opacity:1;"
|
|
94
|
+
offset="0"
|
|
95
|
+
id="stop15762" />
|
|
96
|
+
<stop
|
|
97
|
+
style="stop-color:#496e7c;stop-opacity:0;"
|
|
98
|
+
offset="1"
|
|
99
|
+
id="stop15764" />
|
|
100
|
+
</linearGradient>
|
|
101
|
+
<linearGradient
|
|
102
|
+
inkscape:collect="always"
|
|
103
|
+
xlink:href="#linearGradient15924"
|
|
104
|
+
id="linearGradient18611"
|
|
105
|
+
gradientUnits="userSpaceOnUse"
|
|
106
|
+
gradientTransform="translate(-166.15654,32.013661)"
|
|
107
|
+
x1="252.87965"
|
|
108
|
+
y1="104.78405"
|
|
109
|
+
x2="305.49805"
|
|
110
|
+
y2="61.56583" />
|
|
111
|
+
<linearGradient
|
|
112
|
+
inkscape:collect="always"
|
|
113
|
+
id="linearGradient15924">
|
|
114
|
+
<stop
|
|
115
|
+
style="stop-color:#56674d;stop-opacity:1;"
|
|
116
|
+
offset="0"
|
|
117
|
+
id="stop15920" />
|
|
118
|
+
<stop
|
|
119
|
+
style="stop-color:#ffffff;stop-opacity:0;"
|
|
120
|
+
offset="1"
|
|
121
|
+
id="stop15922" />
|
|
122
|
+
</linearGradient>
|
|
123
|
+
<linearGradient
|
|
124
|
+
inkscape:collect="always"
|
|
125
|
+
xlink:href="#linearGradient1616"
|
|
126
|
+
id="linearGradient18613"
|
|
127
|
+
gradientUnits="userSpaceOnUse"
|
|
128
|
+
gradientTransform="translate(-166.15654,32.013661)"
|
|
129
|
+
x1="262.83365"
|
|
130
|
+
y1="98.616089"
|
|
131
|
+
x2="303.40704"
|
|
132
|
+
y2="56.86591" />
|
|
133
|
+
</defs>
|
|
134
|
+
<g
|
|
135
|
+
inkscape:label="Layer 1"
|
|
136
|
+
inkscape:groupmode="layer"
|
|
137
|
+
id="layer1"
|
|
138
|
+
transform="translate(-81.132986,-92.575601)">
|
|
139
|
+
<g
|
|
140
|
+
id="g489"
|
|
141
|
+
transform="matrix(1.5365255,0,0,1.474116,-14.471343,-5.8524295)">
|
|
142
|
+
<path
|
|
143
|
+
id="path11327-0-0-0"
|
|
144
|
+
style="fill:url(#linearGradient18609);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
145
|
+
d="m 130.56075,85.04143 c 0.52476,0.26239 -18.03983,28.95537 -21.66379,32.11329 -3.42113,2.98116 -7.7736,3.69559 -11.21431,3.82302 -3.4407,0.12743 -10.95953,-1.27434 -10.95953,-1.27434 l 9.53171,15.82074 c 10.00038,14.90295 18.17614,-1.81278 29.33516,-18.06246 3.96568,-5.77479 7.78809,-12.47359 12.92015,-21.46123 4.04139,-7.0776 -7.96539,-10.97224 -7.94939,-10.95902 z" />
|
|
146
|
+
<path
|
|
147
|
+
style="fill:url(#linearGradient16111-2);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
148
|
+
d="m 95.83013,56.198256 16.05664,29.946913 c 0,0 -10.06725,0.637171 -12.870796,-1.019467 L 87.652946,64.863746 c 0,0 -2.527248,-8.028321 8.177184,-8.66549 z"
|
|
149
|
+
id="path11425-3-4-8"
|
|
150
|
+
sodipodi:nodetypes="ccccc"
|
|
151
|
+
class="UnoptimicedTransforms"
|
|
152
|
+
transform="translate(-14.07671,30.372343)" />
|
|
153
|
+
<path
|
|
154
|
+
id="path11327-0-5-6-6-4-3"
|
|
155
|
+
style="fill:url(#linearGradient18611);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
156
|
+
d="m 130.56075,85.04143 c -1.47647,3.17228 -18.24916,29.13777 -21.66379,32.11329 -3.42112,2.98116 -7.7736,3.69559 -11.2143,3.82302 -3.4407,0.12743 -10.95954,-1.27434 -10.95954,-1.27434 l 4.7656,7.91063 h 5.2e-4 c 0.002,0.001 10.85017,15.99897 19.37348,5.76286 2.99574,-3.59774 5.15135,-6.65533 6.98187,-9.54746 2.95629,-4.67075 5.06469,-8.90995 8.4947,-14.29586 14.90527,-23.40477 3.86084,-23.27687 4.22146,-24.49214 z"
|
|
157
|
+
sodipodi:nodetypes="csscccsssc" />
|
|
158
|
+
<path
|
|
159
|
+
id="path11327-0-5-6-6-7-5-9"
|
|
160
|
+
style="fill:url(#linearGradient18613);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
|
161
|
+
d="m 130.56075,85.04143 c -1.47647,3.17228 -18.24916,29.13777 -21.66379,32.11329 -3.42112,2.98116 -7.7736,3.69559 -11.2143,3.82302 -3.4407,0.12743 -10.95954,-1.27434 -10.95954,-1.27434 l 4.7656,7.91063 h 5.2e-4 c 0.002,0.001 12.41225,10.17869 19.50733,-1.0945 10.41305,-16.54503 3.05221,-4.8499 9.84606,-15.81454 14.04378,-22.66534 9.3575,-24.44829 9.71812,-25.66356 z"
|
|
162
|
+
sodipodi:nodetypes="csscccssc" />
|
|
163
|
+
</g>
|
|
164
|
+
</g>
|
|
165
165
|
</svg>`;
|
|
166
166
|
this.injectSpinner();
|
|
167
167
|
}
|
|
168
168
|
injectSpinner() {
|
|
169
169
|
// Create the @keyframes animation
|
|
170
|
-
const keyframes = `@keyframes spin {
|
|
171
|
-
0% { transform: rotate(0deg); }
|
|
172
|
-
100% { transform: rotate(360deg); }
|
|
170
|
+
const keyframes = `@keyframes spin {
|
|
171
|
+
0% { transform: rotate(0deg); }
|
|
172
|
+
100% { transform: rotate(360deg); }
|
|
173
173
|
}`;
|
|
174
174
|
// Create a style element and append the keyframes animation
|
|
175
175
|
const style = document.createElement('style');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViralStats = void 0;
|
|
4
|
+
class ViralStats {
|
|
5
|
+
constructor(viralViewerApi) {
|
|
6
|
+
this.viralViewerApi = viralViewerApi;
|
|
7
|
+
this.stats = null;
|
|
8
|
+
if (this.viralViewerApi.targetElement) {
|
|
9
|
+
this.stats = new Stats();
|
|
10
|
+
this.stats.showPanel(0);
|
|
11
|
+
this.viralViewerApi.targetElement.appendChild(this.stats.dom);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ViralStats = ViralStats;
|
|
16
|
+
//# sourceMappingURL=viral-stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viral-stats.js","sourceRoot":"","sources":["../../../src/components/stats/viral-stats.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IAEnB,YAAmB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QAD1C,UAAK,GAAiB,IAAI,CAAC;QAE9B,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE;YACnC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAEjE;IACL,CAAC;CACJ;AAVD,gCAUC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
|
-
import { RenderMaterial, ViralViewerRevitNoneStructuralGeometry, ViralViewerRevitStructuralGeometry } from "../../types";
|
|
2
|
+
import { Dictionary, RenderMaterial, ViralViewerRevitNoneStructuralGeometry, ViralViewerRevitStructuralGeometry } from "../../types";
|
|
3
3
|
import { Mesh, MeshPhongMaterial } from "three";
|
|
4
|
-
import { Dictionary } from "../../models/dictionary.model";
|
|
5
4
|
import { WorkerThreadPool } from "./base/worker-pool";
|
|
6
5
|
export declare class ViralViewerWorker2 {
|
|
7
6
|
viralViewerApi: ViralViewerApi;
|
|
@@ -15,6 +14,4 @@ export declare class ViralViewerWorker2 {
|
|
|
15
14
|
initial(materials: RenderMaterial[]): void;
|
|
16
15
|
loadStructuralGeometry(model: ViralViewerRevitStructuralGeometry, callbackOnSuccess?: () => void): void;
|
|
17
16
|
loadNoneStructuralGeometry(model: ViralViewerRevitNoneStructuralGeometry, callbackOnSuccess?: () => void): void;
|
|
18
|
-
rgbToHex(r: number, g: number, b: number): string;
|
|
19
|
-
componentToHex(c: number): string;
|
|
20
17
|
}
|
|
@@ -4,15 +4,15 @@ exports.ViralViewerWorker2 = void 0;
|
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
const three_1 = require("three");
|
|
6
6
|
const load_model_worker_2_script_1 = require("../worker-script/load-model-worker-2.script");
|
|
7
|
-
const dictionary_model_1 = require("../../models/dictionary.model");
|
|
8
7
|
const worker_pool_1 = require("./base/worker-pool");
|
|
9
8
|
const simplify_modifier_1 = require("../../threejs-addon/simplify-modifier");
|
|
9
|
+
const threejs_1 = require("../../utils/threejs");
|
|
10
10
|
class ViralViewerWorker2 {
|
|
11
11
|
constructor(viralViewerApi, scriptUrl = "../worker-script/load-model-worker-2.script.js") {
|
|
12
12
|
this.viralViewerApi = viralViewerApi;
|
|
13
13
|
this.materials = [];
|
|
14
14
|
this.mainModel = null;
|
|
15
|
-
this.threejsMaterials = new
|
|
15
|
+
this.threejsMaterials = new types_1.Dictionary();
|
|
16
16
|
this.maxPolygonPerObject = 1000;
|
|
17
17
|
this.maxPolygonForEdge = 1000;
|
|
18
18
|
// Create a new Blob containing the worker code
|
|
@@ -28,7 +28,7 @@ class ViralViewerWorker2 {
|
|
|
28
28
|
this.viralViewerApi.viralScene.addObject(this.mainModel);
|
|
29
29
|
for (let index = 0; index < materials.length; index++) {
|
|
30
30
|
const material = materials[index];
|
|
31
|
-
let colorString =
|
|
31
|
+
let colorString = (0, threejs_1.rgbToThreejsColor)(material.Red, material.Green, material.Blue);
|
|
32
32
|
let renderMaterial = new three_1.MeshPhongMaterial({
|
|
33
33
|
color: colorString,
|
|
34
34
|
opacity: material.Opacity,
|
|
@@ -122,13 +122,6 @@ class ViralViewerWorker2 {
|
|
|
122
122
|
callbackOnSuccess();
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
rgbToHex(r, g, b) {
|
|
126
|
-
return "#" + this.componentToHex(r) + this.componentToHex(g) + this.componentToHex(b);
|
|
127
|
-
}
|
|
128
|
-
componentToHex(c) {
|
|
129
|
-
var hex = c.toString(16);
|
|
130
|
-
return hex.length == 1 ? "0" + hex : hex;
|
|
131
|
-
}
|
|
132
125
|
}
|
|
133
126
|
exports.ViralViewerWorker2 = ViralViewerWorker2;
|
|
134
127
|
//# sourceMappingURL=viral-viewer-2.worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-viewer-2.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-2.worker.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"viral-viewer-2.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-2.worker.ts"],"names":[],"mappings":";;;AACA,uCAAwL;AACxL,iCAAsN;AACtN,4FAAyE;AACzE,oDAAsD;AACtD,6EAAyE;AACzE,iDAAwD;AAExD,MAAa,kBAAkB;IAO3B,YAAmB,cAA8B,EAAE,YAAoB,gDAAgD;QAApG,mBAAc,GAAd,cAAc,CAAgB;QAL1C,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAC9B,qBAAgB,GAA0C,IAAI,kBAAU,EAA6B,CAAC;QAC5F,wBAAmB,GAAG,IAAI,CAAC;QAC3B,sBAAiB,GAAG,IAAI,CAAC;QAGtC,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,uCAAU,KAAK,CAAC,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,GAAG,CA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AC,CAAC;oBAC9C,MAAM,IAAI,GAAG,IAAI,oBAAY,CACzB,KAAK,EACL,IAAI,yBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAC3D,CAAC;oBACF,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;oBAC3B,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;iBACvB;aAGJ;YACD,IAAI,IAAI,CAAC,SAAS,EAAE;gBAChB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;aACjC;YACD,iBAAiB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAA;IACN,CAAC;CAEJ;AAnID,gDAmIC"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
2
|
import { RenderMaterial, ViralViewerRevitNoneStructuralGeometry, ViralViewerRevitStructuralGeometry } from "../../types";
|
|
3
|
-
import { Mesh
|
|
4
|
-
import { Dictionary } from "../../models/dictionary.model";
|
|
3
|
+
import { Mesh } from "three";
|
|
5
4
|
import { WorkerThreadPool } from "./base/worker-pool";
|
|
6
5
|
export declare class ViralViewerWorker3 {
|
|
7
6
|
viralViewerApi: ViralViewerApi;
|
|
8
7
|
workerPool: WorkerThreadPool;
|
|
9
8
|
materials: RenderMaterial[];
|
|
10
9
|
mainModel: Mesh | null;
|
|
11
|
-
threejsMaterials: Dictionary<number, MeshPhongMaterial>;
|
|
12
|
-
private readonly maxPolygonPerObject;
|
|
13
|
-
private readonly maxPolygonForEdge;
|
|
14
10
|
private threejsLoader;
|
|
15
11
|
constructor(viralViewerApi: ViralViewerApi, scriptUrl?: string);
|
|
16
12
|
initial(materials: RenderMaterial[]): void;
|
|
17
13
|
loadStructuralGeometry(model: ViralViewerRevitStructuralGeometry, callbackOnSuccess?: () => void): void;
|
|
18
14
|
loadNoneStructuralGeometry(model: ViralViewerRevitNoneStructuralGeometry, callbackOnSuccess?: () => void): void;
|
|
19
|
-
rgbToHex(r: number, g: number, b: number): string;
|
|
20
|
-
componentToHex(c: number): string;
|
|
21
15
|
}
|
|
@@ -3,18 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ViralViewerWorker3 = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
const three_1 = require("three");
|
|
6
|
-
// import { workerCode } from "../worker-script/load-model-worker-2.script";
|
|
7
6
|
const threejs_types_1 = require("../worker-script/threejs.types");
|
|
8
|
-
const dictionary_model_1 = require("../../models/dictionary.model");
|
|
9
7
|
const worker_pool_1 = require("./base/worker-pool");
|
|
8
|
+
const threejs_1 = require("../../utils/threejs");
|
|
10
9
|
class ViralViewerWorker3 {
|
|
11
10
|
constructor(viralViewerApi, scriptUrl = "../worker-script/load-model-worker-2.script.js") {
|
|
12
11
|
this.viralViewerApi = viralViewerApi;
|
|
13
12
|
this.materials = [];
|
|
14
13
|
this.mainModel = null;
|
|
15
|
-
this.threejsMaterials = new dictionary_model_1.Dictionary();
|
|
16
|
-
this.maxPolygonPerObject = 1000;
|
|
17
|
-
this.maxPolygonForEdge = 1000;
|
|
18
14
|
this.threejsLoader = new three_1.ObjectLoader();
|
|
19
15
|
// Create a new Blob containing the worker code
|
|
20
16
|
const blob = new Blob([`(${threejs_types_1.workerCode})()`]);
|
|
@@ -29,7 +25,7 @@ class ViralViewerWorker3 {
|
|
|
29
25
|
this.viralViewerApi.viralScene.addModel(this.mainModel);
|
|
30
26
|
for (let index = 0; index < materials.length; index++) {
|
|
31
27
|
const material = materials[index];
|
|
32
|
-
let colorString =
|
|
28
|
+
let colorString = (0, threejs_1.rgbToThreejsColor)(material.Red, material.Green, material.Blue);
|
|
33
29
|
let renderMaterial = new three_1.MeshPhongMaterial({
|
|
34
30
|
color: colorString,
|
|
35
31
|
opacity: material.Opacity,
|
|
@@ -37,7 +33,7 @@ class ViralViewerWorker3 {
|
|
|
37
33
|
// flatShading: true,
|
|
38
34
|
name: material.Name
|
|
39
35
|
});
|
|
40
|
-
this.
|
|
36
|
+
this.viralViewerApi.viralScene.materials.add(index, renderMaterial);
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
39
|
loadStructuralGeometry(model, callbackOnSuccess = () => { }) {
|
|
@@ -45,8 +41,8 @@ class ViralViewerWorker3 {
|
|
|
45
41
|
inputData.Indices = model.Indices;
|
|
46
42
|
inputData.Vertices = model.Vertices;
|
|
47
43
|
this.workerPool.Enqueue(inputData, (data) => {
|
|
48
|
-
let mesh = this.
|
|
49
|
-
mesh.material = this.
|
|
44
|
+
let mesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data);
|
|
45
|
+
mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex);
|
|
50
46
|
mesh.userData.type = "Revit Element";
|
|
51
47
|
if (this.mainModel)
|
|
52
48
|
this.mainModel.add(mesh);
|
|
@@ -56,8 +52,8 @@ class ViralViewerWorker3 {
|
|
|
56
52
|
}
|
|
57
53
|
loadNoneStructuralGeometry(model, callbackOnSuccess = () => { }) {
|
|
58
54
|
this.workerPool.Enqueue(model, (data) => {
|
|
59
|
-
let mesh = this.
|
|
60
|
-
mesh.material = this.
|
|
55
|
+
let mesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data);
|
|
56
|
+
mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex);
|
|
61
57
|
mesh.userData.type = "Revit Element";
|
|
62
58
|
if (this.mainModel)
|
|
63
59
|
this.mainModel.add(mesh);
|
|
@@ -65,13 +61,6 @@ class ViralViewerWorker3 {
|
|
|
65
61
|
callbackOnSuccess();
|
|
66
62
|
});
|
|
67
63
|
}
|
|
68
|
-
rgbToHex(r, g, b) {
|
|
69
|
-
return "#" + this.componentToHex(r) + this.componentToHex(g) + this.componentToHex(b);
|
|
70
|
-
}
|
|
71
|
-
componentToHex(c) {
|
|
72
|
-
var hex = c.toString(16);
|
|
73
|
-
return hex.length == 1 ? "0" + hex : hex;
|
|
74
|
-
}
|
|
75
64
|
}
|
|
76
65
|
exports.ViralViewerWorker3 = ViralViewerWorker3;
|
|
77
66
|
//# sourceMappingURL=viral-viewer-3.worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-viewer-3.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-3.worker.ts"],"names":[],"mappings":";;;AACA,uCAA4K;AAC5K,iCAAsN;AACtN,
|
|
1
|
+
{"version":3,"file":"viral-viewer-3.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-3.worker.ts"],"names":[],"mappings":";;;AACA,uCAA4K;AAC5K,iCAAsN;AACtN,kEAA4D;AAC5D,oDAAsD;AACtD,iDAAwD;AAExD,MAAa,kBAAkB;IAK3B,YAAmB,cAA8B,EAAE,YAAoB,gDAAgD;QAApG,mBAAc,GAAd,cAAc,CAAgB;QAH1C,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAC7B,kBAAa,GAAG,IAAI,oBAAY,EAAE,CAAC;QAGvC,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,0BAAU,KAAK,CAAC,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,oCAAoC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAgB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;IACM,OAAO,CAAC,SAA2B;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,SAAS,GAAG,IAAI,YAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxD,KAAK,IAAI,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