@inweb/viewer-three 26.9.3 → 26.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/components/AxesHelperComponent.js +23 -22
- package/dist/plugins/components/AxesHelperComponent.js.map +1 -1
- package/dist/plugins/components/AxesHelperComponent.min.js +23 -0
- package/dist/plugins/components/AxesHelperComponent.module.js +31 -9
- package/dist/plugins/components/AxesHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.js +23 -22
- package/dist/plugins/components/ExtentsHelperComponent.js.map +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.min.js +23 -0
- package/dist/plugins/components/ExtentsHelperComponent.module.js +28 -6
- package/dist/plugins/components/ExtentsHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/LightHelperComponent.js +23 -22
- package/dist/plugins/components/LightHelperComponent.js.map +1 -1
- package/dist/plugins/components/LightHelperComponent.min.js +23 -0
- package/dist/plugins/components/LightHelperComponent.module.js +35 -9
- package/dist/plugins/components/LightHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/RoomEnvironmentComponent.js +23 -97
- package/dist/plugins/components/RoomEnvironmentComponent.js.map +1 -1
- package/dist/plugins/components/RoomEnvironmentComponent.min.js +23 -0
- package/dist/plugins/components/RoomEnvironmentComponent.module.js +27 -7
- package/dist/plugins/components/RoomEnvironmentComponent.module.js.map +1 -1
- package/dist/plugins/components/StatsPanelComponent.js +23 -92
- package/dist/plugins/components/StatsPanelComponent.js.map +1 -1
- package/dist/plugins/components/StatsPanelComponent.min.js +23 -0
- package/dist/plugins/components/StatsPanelComponent.module.js +26 -5
- package/dist/plugins/components/StatsPanelComponent.module.js.map +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.js +31 -2515
- package/dist/plugins/loaders/GLTFCloudLoader.js.map +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.min.js +23 -0
- package/dist/plugins/loaders/GLTFCloudLoader.module.js +35 -20
- package/dist/plugins/loaders/GLTFCloudLoader.module.js.map +1 -1
- package/dist/plugins/loaders/IFCXLoader.js +35 -689
- package/dist/plugins/loaders/IFCXLoader.js.map +1 -1
- package/dist/plugins/loaders/IFCXLoader.min.js +23 -0
- package/dist/plugins/loaders/IFCXLoader.module.js +833 -859
- package/dist/plugins/loaders/IFCXLoader.module.js.map +1 -1
- package/dist/plugins/loaders/PotreeLoader.js +26 -70
- package/dist/plugins/loaders/PotreeLoader.js.map +1 -1
- package/dist/plugins/loaders/PotreeLoader.min.js +23 -0
- package/dist/plugins/loaders/PotreeLoader.module.js +37 -15
- package/dist/plugins/loaders/PotreeLoader.module.js.map +1 -1
- package/dist/viewer-three.js +1502 -55140
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +26 -3
- package/dist/viewer-three.module.js +3584 -3660
- package/dist/viewer-three.module.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
1
24
|
(function (global, factory) {
|
|
2
25
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('@inweb/viewer-three')) :
|
|
3
26
|
typeof define === 'function' && define.amd ? define(['@inweb/viewer-three'], factory) :
|
|
@@ -5,193 +28,101 @@
|
|
|
5
28
|
})(this, (function (viewerThree) { 'use strict';
|
|
6
29
|
|
|
7
30
|
var Stats = function () {
|
|
8
|
-
|
|
9
31
|
var mode = 0;
|
|
10
|
-
|
|
11
32
|
var container = document.createElement( 'div' );
|
|
12
33
|
container.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';
|
|
13
34
|
container.addEventListener( 'click', function ( event ) {
|
|
14
|
-
|
|
15
35
|
event.preventDefault();
|
|
16
36
|
showPanel( ++ mode % container.children.length );
|
|
17
|
-
|
|
18
37
|
}, false );
|
|
19
|
-
|
|
20
|
-
//
|
|
21
|
-
|
|
22
38
|
function addPanel( panel ) {
|
|
23
|
-
|
|
24
39
|
container.appendChild( panel.dom );
|
|
25
40
|
return panel;
|
|
26
|
-
|
|
27
41
|
}
|
|
28
|
-
|
|
29
42
|
function showPanel( id ) {
|
|
30
|
-
|
|
31
43
|
for ( var i = 0; i < container.children.length; i ++ ) {
|
|
32
|
-
|
|
33
44
|
container.children[ i ].style.display = i === id ? 'block' : 'none';
|
|
34
|
-
|
|
35
45
|
}
|
|
36
|
-
|
|
37
46
|
mode = id;
|
|
38
|
-
|
|
39
47
|
}
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
|
|
43
48
|
var beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;
|
|
44
|
-
|
|
45
49
|
var fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );
|
|
46
50
|
var msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );
|
|
47
|
-
|
|
48
51
|
if ( self.performance && self.performance.memory ) {
|
|
49
|
-
|
|
50
52
|
var memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );
|
|
51
|
-
|
|
52
53
|
}
|
|
53
|
-
|
|
54
54
|
showPanel( 0 );
|
|
55
|
-
|
|
56
55
|
return {
|
|
57
|
-
|
|
58
56
|
REVISION: 16,
|
|
59
|
-
|
|
60
57
|
dom: container,
|
|
61
|
-
|
|
62
58
|
addPanel: addPanel,
|
|
63
59
|
showPanel: showPanel,
|
|
64
|
-
|
|
65
60
|
begin: function () {
|
|
66
|
-
|
|
67
61
|
beginTime = ( performance || Date ).now();
|
|
68
|
-
|
|
69
62
|
},
|
|
70
|
-
|
|
71
63
|
end: function () {
|
|
72
|
-
|
|
73
64
|
frames ++;
|
|
74
|
-
|
|
75
65
|
var time = ( performance || Date ).now();
|
|
76
|
-
|
|
77
66
|
msPanel.update( time - beginTime, 200 );
|
|
78
|
-
|
|
79
67
|
if ( time >= prevTime + 1000 ) {
|
|
80
|
-
|
|
81
68
|
fpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );
|
|
82
|
-
|
|
83
69
|
prevTime = time;
|
|
84
70
|
frames = 0;
|
|
85
|
-
|
|
86
71
|
if ( memPanel ) {
|
|
87
|
-
|
|
88
72
|
var memory = performance.memory;
|
|
89
73
|
memPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );
|
|
90
|
-
|
|
91
74
|
}
|
|
92
|
-
|
|
93
75
|
}
|
|
94
|
-
|
|
95
76
|
return time;
|
|
96
|
-
|
|
97
77
|
},
|
|
98
|
-
|
|
99
78
|
update: function () {
|
|
100
|
-
|
|
101
79
|
beginTime = this.end();
|
|
102
|
-
|
|
103
80
|
},
|
|
104
|
-
|
|
105
|
-
// Backwards Compatibility
|
|
106
|
-
|
|
107
81
|
domElement: container,
|
|
108
82
|
setMode: showPanel
|
|
109
|
-
|
|
110
83
|
};
|
|
111
|
-
|
|
112
84
|
};
|
|
113
|
-
|
|
114
85
|
Stats.Panel = function ( name, fg, bg ) {
|
|
115
|
-
|
|
116
86
|
var min = Infinity, max = 0, round = Math.round;
|
|
117
87
|
var PR = round( window.devicePixelRatio || 1 );
|
|
118
|
-
|
|
119
88
|
var WIDTH = 80 * PR, HEIGHT = 48 * PR,
|
|
120
89
|
TEXT_X = 3 * PR, TEXT_Y = 2 * PR,
|
|
121
90
|
GRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,
|
|
122
91
|
GRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;
|
|
123
|
-
|
|
124
92
|
var canvas = document.createElement( 'canvas' );
|
|
125
93
|
canvas.width = WIDTH;
|
|
126
94
|
canvas.height = HEIGHT;
|
|
127
95
|
canvas.style.cssText = 'width:80px;height:48px';
|
|
128
|
-
|
|
129
96
|
var context = canvas.getContext( '2d' );
|
|
130
97
|
context.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';
|
|
131
98
|
context.textBaseline = 'top';
|
|
132
|
-
|
|
133
99
|
context.fillStyle = bg;
|
|
134
100
|
context.fillRect( 0, 0, WIDTH, HEIGHT );
|
|
135
|
-
|
|
136
101
|
context.fillStyle = fg;
|
|
137
102
|
context.fillText( name, TEXT_X, TEXT_Y );
|
|
138
103
|
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
|
|
139
|
-
|
|
140
104
|
context.fillStyle = bg;
|
|
141
105
|
context.globalAlpha = 0.9;
|
|
142
106
|
context.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );
|
|
143
|
-
|
|
144
107
|
return {
|
|
145
|
-
|
|
146
108
|
dom: canvas,
|
|
147
|
-
|
|
148
109
|
update: function ( value, maxValue ) {
|
|
149
|
-
|
|
150
110
|
min = Math.min( min, value );
|
|
151
111
|
max = Math.max( max, value );
|
|
152
|
-
|
|
153
112
|
context.fillStyle = bg;
|
|
154
113
|
context.globalAlpha = 1;
|
|
155
114
|
context.fillRect( 0, 0, WIDTH, GRAPH_Y );
|
|
156
115
|
context.fillStyle = fg;
|
|
157
116
|
context.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );
|
|
158
|
-
|
|
159
117
|
context.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );
|
|
160
|
-
|
|
161
118
|
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );
|
|
162
|
-
|
|
163
119
|
context.fillStyle = bg;
|
|
164
120
|
context.globalAlpha = 0.9;
|
|
165
121
|
context.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );
|
|
166
|
-
|
|
167
122
|
}
|
|
168
|
-
|
|
169
123
|
};
|
|
170
|
-
|
|
171
124
|
};
|
|
172
125
|
|
|
173
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
174
|
-
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
175
|
-
// All rights reserved.
|
|
176
|
-
//
|
|
177
|
-
// This software and its documentation and related materials are owned by
|
|
178
|
-
// the Alliance. The software may only be incorporated into application
|
|
179
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
180
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
181
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
182
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
183
|
-
// protected by copyright law and international treaty provisions. Application
|
|
184
|
-
// programs incorporating this software must include the following statement
|
|
185
|
-
// with their copyright notices:
|
|
186
|
-
//
|
|
187
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
188
|
-
// license agreement with Open Design Alliance.
|
|
189
|
-
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
190
|
-
// All rights reserved.
|
|
191
|
-
//
|
|
192
|
-
// By use of this software, its documentation or related materials, you
|
|
193
|
-
// acknowledge and accept the above terms.
|
|
194
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
195
126
|
class StatsPanelComponent {
|
|
196
127
|
constructor(viewer) {
|
|
197
128
|
this.updateStats = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["var Stats = function () {\n\n\tvar mode = 0;\n\n\tvar container = document.createElement( 'div' );\n\tcontainer.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';\n\tcontainer.addEventListener( 'click', function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tshowPanel( ++ mode % container.children.length );\n\n\t}, false );\n\n\t//\n\n\tfunction addPanel( panel ) {\n\n\t\tcontainer.appendChild( panel.dom );\n\t\treturn panel;\n\n\t}\n\n\tfunction showPanel( id ) {\n\n\t\tfor ( var i = 0; i < container.children.length; i ++ ) {\n\n\t\t\tcontainer.children[ i ].style.display = i === id ? 'block' : 'none';\n\n\t\t}\n\n\t\tmode = id;\n\n\t}\n\n\t//\n\n\tvar beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;\n\n\tvar fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );\n\tvar msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );\n\n\tif ( self.performance && self.performance.memory ) {\n\n\t\tvar memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );\n\n\t}\n\n\tshowPanel( 0 );\n\n\treturn {\n\n\t\tREVISION: 16,\n\n\t\tdom: container,\n\n\t\taddPanel: addPanel,\n\t\tshowPanel: showPanel,\n\n\t\tbegin: function () {\n\n\t\t\tbeginTime = ( performance || Date ).now();\n\n\t\t},\n\n\t\tend: function () {\n\n\t\t\tframes ++;\n\n\t\t\tvar time = ( performance || Date ).now();\n\n\t\t\tmsPanel.update( time - beginTime, 200 );\n\n\t\t\tif ( time >= prevTime + 1000 ) {\n\n\t\t\t\tfpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );\n\n\t\t\t\tprevTime = time;\n\t\t\t\tframes = 0;\n\n\t\t\t\tif ( memPanel ) {\n\n\t\t\t\t\tvar memory = performance.memory;\n\t\t\t\t\tmemPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn time;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tbeginTime = this.end();\n\n\t\t},\n\n\t\t// Backwards Compatibility\n\n\t\tdomElement: container,\n\t\tsetMode: showPanel\n\n\t};\n\n};\n\nStats.Panel = function ( name, fg, bg ) {\n\n\tvar min = Infinity, max = 0, round = Math.round;\n\tvar PR = round( window.devicePixelRatio || 1 );\n\n\tvar WIDTH = 80 * PR, HEIGHT = 48 * PR,\n\t\tTEXT_X = 3 * PR, TEXT_Y = 2 * PR,\n\t\tGRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,\n\t\tGRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\tcanvas.style.cssText = 'width:80px;height:48px';\n\n\tvar context = canvas.getContext( '2d' );\n\tcontext.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';\n\tcontext.textBaseline = 'top';\n\n\tcontext.fillStyle = bg;\n\tcontext.fillRect( 0, 0, WIDTH, HEIGHT );\n\n\tcontext.fillStyle = fg;\n\tcontext.fillText( name, TEXT_X, TEXT_Y );\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\tcontext.fillStyle = bg;\n\tcontext.globalAlpha = 0.9;\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\treturn {\n\n\t\tdom: canvas,\n\n\t\tupdate: function ( value, maxValue ) {\n\n\t\t\tmin = Math.min( min, value );\n\t\t\tmax = Math.max( max, value );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 1;\n\t\t\tcontext.fillRect( 0, 0, WIDTH, GRAPH_Y );\n\t\t\tcontext.fillStyle = fg;\n\t\t\tcontext.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );\n\n\t\t\tcontext.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 0.9;\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );\n\n\t\t}\n\n\t};\n\n};\n\nexport default Stats;\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["components"],"mappings":";;;;;;CAAA,IAAI,KAAK,GAAG,YAAY;;CAExB,CAAC,IAAI,IAAI,GAAG,CAAC;;CAEb,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE;CAChD,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,sEAAsE;CACjG,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,WAAW,KAAK,GAAG;;CAEzD,EAAE,KAAK,CAAC,cAAc,EAAE;CACxB,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;;CAElD,CAAC,CAAC,EAAE,KAAK,EAAE;;CAEX;;CAEA,CAAC,SAAS,QAAQ,EAAE,KAAK,GAAG;;CAE5B,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE;CACpC,EAAE,OAAO,KAAK;;CAEd,CAAC;;CAED,CAAC,SAAS,SAAS,EAAE,EAAE,GAAG;;CAE1B,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,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CAAA;CAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;SAgB1B,IAAA,CAAA,WAAW,GAAG,MAAK;aACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;CAC9B,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;CACrB,QAAA,CAAC;CAlBC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE;SACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;CAC1C,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;SACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;KAC7C;KAEA,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;CAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;CACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;KACxB;CAMD;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["var Stats = function () {\n\n\tvar mode = 0;\n\n\tvar container = document.createElement( 'div' );\n\tcontainer.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';\n\tcontainer.addEventListener( 'click', function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tshowPanel( ++ mode % container.children.length );\n\n\t}, false );\n\n\t//\n\n\tfunction addPanel( panel ) {\n\n\t\tcontainer.appendChild( panel.dom );\n\t\treturn panel;\n\n\t}\n\n\tfunction showPanel( id ) {\n\n\t\tfor ( var i = 0; i < container.children.length; i ++ ) {\n\n\t\t\tcontainer.children[ i ].style.display = i === id ? 'block' : 'none';\n\n\t\t}\n\n\t\tmode = id;\n\n\t}\n\n\t//\n\n\tvar beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;\n\n\tvar fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );\n\tvar msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );\n\n\tif ( self.performance && self.performance.memory ) {\n\n\t\tvar memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );\n\n\t}\n\n\tshowPanel( 0 );\n\n\treturn {\n\n\t\tREVISION: 16,\n\n\t\tdom: container,\n\n\t\taddPanel: addPanel,\n\t\tshowPanel: showPanel,\n\n\t\tbegin: function () {\n\n\t\t\tbeginTime = ( performance || Date ).now();\n\n\t\t},\n\n\t\tend: function () {\n\n\t\t\tframes ++;\n\n\t\t\tvar time = ( performance || Date ).now();\n\n\t\t\tmsPanel.update( time - beginTime, 200 );\n\n\t\t\tif ( time >= prevTime + 1000 ) {\n\n\t\t\t\tfpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );\n\n\t\t\t\tprevTime = time;\n\t\t\t\tframes = 0;\n\n\t\t\t\tif ( memPanel ) {\n\n\t\t\t\t\tvar memory = performance.memory;\n\t\t\t\t\tmemPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn time;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tbeginTime = this.end();\n\n\t\t},\n\n\t\t// Backwards Compatibility\n\n\t\tdomElement: container,\n\t\tsetMode: showPanel\n\n\t};\n\n};\n\nStats.Panel = function ( name, fg, bg ) {\n\n\tvar min = Infinity, max = 0, round = Math.round;\n\tvar PR = round( window.devicePixelRatio || 1 );\n\n\tvar WIDTH = 80 * PR, HEIGHT = 48 * PR,\n\t\tTEXT_X = 3 * PR, TEXT_Y = 2 * PR,\n\t\tGRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,\n\t\tGRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\tcanvas.style.cssText = 'width:80px;height:48px';\n\n\tvar context = canvas.getContext( '2d' );\n\tcontext.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';\n\tcontext.textBaseline = 'top';\n\n\tcontext.fillStyle = bg;\n\tcontext.fillRect( 0, 0, WIDTH, HEIGHT );\n\n\tcontext.fillStyle = fg;\n\tcontext.fillText( name, TEXT_X, TEXT_Y );\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\tcontext.fillStyle = bg;\n\tcontext.globalAlpha = 0.9;\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\treturn {\n\n\t\tdom: canvas,\n\n\t\tupdate: function ( value, maxValue ) {\n\n\t\t\tmin = Math.min( min, value );\n\t\t\tmax = Math.max( max, value );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 1;\n\t\t\tcontext.fillRect( 0, 0, WIDTH, GRAPH_Y );\n\t\t\tcontext.fillStyle = fg;\n\t\t\tcontext.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );\n\n\t\t\tcontext.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 0.9;\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );\n\n\t\t}\n\n\t};\n\n};\n\nexport default Stats;\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["components"],"mappings":";;;;;;;;;;;;;;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AG,SAAS;KACxB;CAMD;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1,24 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
1
24
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ODA.Three)}(this,function(e){"use strict";var t=function(){var e=0,n=document.createElement("div");function i(e){return n.appendChild(e.dom),e}function l(t){for(var i=0;i<n.children.length;i++)n.children[i].style.display=i===t?"block":"none";e=t}n.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",n.addEventListener("click",function(t){t.preventDefault(),l(++e%n.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,r=i(new t.Panel("FPS","#0ff","#002")),f=i(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=i(new t.Panel("MB","#f08","#201"));return l(0),{REVISION:16,dom:n,addPanel:i,showPanel:l,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(f.update(e-a,200),e>=o+1e3&&(r.update(1e3*s/(e-o),100),o=e,s=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:n,setMode:l}};t.Panel=function(e,t,n){var i=1/0,l=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,r=48*o,f=3*o,d=2*o,c=3*o,p=15*o,h=74*o,u=30*o,m=document.createElement("canvas");m.width=s,m.height=r,m.style.cssText="width:80px;height:48px";var v=m.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=n,v.fillRect(0,0,s,r),v.fillStyle=t,v.fillText(e,f,d),v.fillRect(c,p,h,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c,p,h,u),{dom:m,update:function(r,w){i=Math.min(i,r),l=Math.max(l,r),v.fillStyle=n,v.globalAlpha=1,v.fillRect(0,0,s,p),v.fillStyle=t,v.fillText(a(r)+" "+e+" ("+a(i)+"-"+a(l)+")",f,d),v.drawImage(m,c+o,p,h-o,u,c,p,h-o,u),v.fillRect(c+h-o,p,o,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c+h-o,p,o,a((1-r/w)*u))}}};class n{constructor(e){this.updateStats=()=>{this.viewer.render(null,!0),this.stats.update()},this.stats=new t,this.stats.dom.style.position="absolute",e.canvas.parentElement.appendChild(this.stats.dom),this.viewer=e,this.viewer.on("animate",this.updateStats)}dispose(){this.viewer.off("animate",this.updateStats),this.stats.dom.remove(),this.stats=void 0}}e.components.registerComponent("StatsPanelComponent",e=>new n(e))});
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
23
|
|
|
3
|
-
import
|
|
24
|
+
import Stats from 'three/examples/jsm/libs/stats.module.js';
|
|
25
|
+
import { components } from '@inweb/viewer-three';
|
|
4
26
|
|
|
5
27
|
class StatsPanelComponent {
|
|
6
28
|
constructor(viewer) {
|
|
@@ -8,7 +30,7 @@ class StatsPanelComponent {
|
|
|
8
30
|
this.viewer.render(null, true);
|
|
9
31
|
this.stats.update();
|
|
10
32
|
};
|
|
11
|
-
this.stats = new Stats;
|
|
33
|
+
this.stats = new Stats();
|
|
12
34
|
this.stats.dom.style.position = "absolute";
|
|
13
35
|
viewer.canvas.parentElement.appendChild(this.stats.dom);
|
|
14
36
|
this.viewer = viewer;
|
|
@@ -20,6 +42,5 @@ class StatsPanelComponent {
|
|
|
20
42
|
this.stats = undefined;
|
|
21
43
|
}
|
|
22
44
|
}
|
|
23
|
-
|
|
24
|
-
components.registerComponent("StatsPanelComponent", viewer => new StatsPanelComponent(viewer));
|
|
45
|
+
components.registerComponent("StatsPanelComponent", (viewer) => new StatsPanelComponent(viewer));
|
|
25
46
|
//# sourceMappingURL=StatsPanelComponent.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":[
|
|
1
|
+
{"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;QAgB1B,IAAA,CAAA,WAAW,GAAG,MAAK;YACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;AAC9B,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACrB,QAAA,CAAC;AAlBC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE;QACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;AAC1C,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;IAC7C;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;AAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;AACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;IACxB;AAMD;AAED,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
|