@2112-lab/central-plant 0.1.2 โ 0.1.4
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/bundle/index.js +1 -15498
- package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -366
- package/dist/cjs/node_modules/@2112-lab/pathfinder/dist/index.esm.js +1 -1448
- package/dist/cjs/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -1292
- package/dist/cjs/node_modules/three/examples/jsm/exporters/GLTFExporter.js +1 -0
- package/dist/cjs/node_modules/three/examples/jsm/exporters/OBJExporter.js +1 -0
- package/dist/cjs/node_modules/three/examples/jsm/exporters/PLYExporter.js +1 -0
- package/dist/cjs/node_modules/three/examples/jsm/exporters/STLExporter.js +1 -0
- package/dist/cjs/node_modules/three/examples/jsm/loaders/DRACOLoader.js +1 -0
- package/dist/cjs/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1 -4374
- package/dist/cjs/node_modules/three/examples/jsm/loaders/RGBELoader.js +1 -465
- package/dist/cjs/node_modules/three/examples/jsm/renderers/CSS2DRenderer.js +1 -0
- package/dist/cjs/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +1 -117
- package/dist/cjs/src/analysis/analysis.js +1 -0
- package/dist/cjs/src/analysis/testing.js +1 -0
- package/dist/cjs/src/core/centralPlant.js +1 -0
- package/dist/cjs/src/core/debugLogger.js +1 -0
- package/dist/cjs/src/core/mathUtils.js +1 -0
- package/dist/cjs/src/core/nameUtils.js +1 -0
- package/dist/cjs/src/data/export.js +1 -0
- package/dist/cjs/src/data/import.js +1 -0
- package/dist/cjs/src/data/numerics.js +1 -0
- package/dist/cjs/src/helpers/sceneHelper.js +1 -0
- package/dist/cjs/src/index.js +1 -79
- package/dist/cjs/src/managers/components/animationManager.js +1 -0
- package/dist/cjs/src/managers/components/componentManager.js +1 -0
- package/dist/cjs/src/managers/components/pathfindingManager.js +1 -0
- package/dist/cjs/src/managers/controls/TransformControls.js +1 -0
- package/dist/cjs/src/managers/controls/cameraControlsManager.js +1 -0
- package/dist/cjs/src/managers/controls/dragDropManager.js +1 -0
- package/dist/cjs/src/managers/controls/keyboardControlsManager.js +1 -0
- package/dist/cjs/src/managers/controls/transformControlsManager.js +1 -0
- package/dist/cjs/src/managers/environment/environmentManager.js +1 -0
- package/dist/cjs/src/managers/environment/textureConfig.js +1 -0
- package/dist/cjs/src/managers/scene/sceneExportManager.js +1 -0
- package/dist/cjs/src/managers/scene/sceneInitializationManager.js +1 -0
- package/dist/cjs/src/managers/scene/sceneOperationsManager.js +1 -0
- package/dist/cjs/src/managers/scene/sceneTooltipsManager.js +1 -0
- package/dist/cjs/src/managers/system/disposalManager.js +1 -0
- package/dist/cjs/src/managers/system/hotReloadManager.js +1 -0
- package/dist/cjs/src/managers/system/performanceMonitor.js +1 -0
- package/dist/cjs/src/rendering/modelPreloader.js +1 -0
- package/dist/cjs/src/rendering/rendering2D.js +1 -0
- package/dist/cjs/src/rendering/rendering3D.js +1 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +1 -339
- package/dist/esm/node_modules/@2112-lab/pathfinder/dist/index.esm.js +1 -1444
- package/dist/esm/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -1287
- package/dist/esm/node_modules/three/examples/jsm/exporters/GLTFExporter.js +1 -0
- package/dist/esm/node_modules/three/examples/jsm/exporters/OBJExporter.js +1 -0
- package/dist/esm/node_modules/three/examples/jsm/exporters/PLYExporter.js +1 -0
- package/dist/esm/node_modules/three/examples/jsm/exporters/STLExporter.js +1 -0
- package/dist/esm/node_modules/three/examples/jsm/loaders/DRACOLoader.js +1 -0
- package/dist/esm/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1 -4370
- package/dist/esm/node_modules/three/examples/jsm/loaders/RGBELoader.js +1 -461
- package/dist/esm/node_modules/three/examples/jsm/renderers/CSS2DRenderer.js +1 -0
- package/dist/esm/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +1 -113
- package/dist/esm/src/analysis/analysis.js +1 -0
- package/dist/esm/src/analysis/testing.js +1 -0
- package/dist/esm/src/core/centralPlant.js +1 -0
- package/dist/esm/src/core/debugLogger.js +1 -0
- package/dist/esm/src/core/mathUtils.js +1 -0
- package/dist/esm/src/core/nameUtils.js +1 -0
- package/dist/esm/src/data/export.js +1 -0
- package/dist/esm/src/data/import.js +1 -0
- package/dist/esm/src/data/numerics.js +1 -0
- package/dist/esm/src/helpers/sceneHelper.js +1 -0
- package/dist/esm/src/index.js +1 -70
- package/dist/esm/src/managers/components/animationManager.js +1 -0
- package/dist/esm/src/managers/components/componentManager.js +1 -0
- package/dist/esm/src/managers/components/pathfindingManager.js +1 -0
- package/dist/esm/src/managers/controls/TransformControls.js +1 -0
- package/dist/esm/src/managers/controls/cameraControlsManager.js +1 -0
- package/dist/esm/src/managers/controls/dragDropManager.js +1 -0
- package/dist/esm/src/managers/controls/keyboardControlsManager.js +1 -0
- package/dist/esm/src/managers/controls/transformControlsManager.js +1 -0
- package/dist/esm/src/managers/environment/environmentManager.js +1 -0
- package/dist/esm/src/managers/environment/textureConfig.js +1 -0
- package/dist/esm/src/managers/scene/sceneExportManager.js +1 -0
- package/dist/esm/src/managers/scene/sceneInitializationManager.js +1 -0
- package/dist/esm/src/managers/scene/sceneOperationsManager.js +1 -0
- package/dist/esm/src/managers/scene/sceneTooltipsManager.js +1 -0
- package/dist/esm/src/managers/system/disposalManager.js +1 -0
- package/dist/esm/src/managers/system/hotReloadManager.js +1 -0
- package/dist/esm/src/managers/system/performanceMonitor.js +1 -0
- package/dist/esm/src/rendering/modelPreloader.js +1 -0
- package/dist/esm/src/rendering/rendering2D.js +1 -0
- package/dist/esm/src/rendering/rendering3D.js +1 -0
- package/dist/index.d.ts +52 -255
- package/package.json +3 -6
- package/dist/cjs/node_modules/three/examples/jsm/controls/TransformControls.js +0 -1543
- package/dist/cjs/src/animationManager.js +0 -121
- package/dist/cjs/src/componentManager.js +0 -151
- package/dist/cjs/src/debugLogger.js +0 -176
- package/dist/cjs/src/disposalManager.js +0 -185
- package/dist/cjs/src/environmentManager.js +0 -1308
- package/dist/cjs/src/hotReloadManager.js +0 -252
- package/dist/cjs/src/keyboardControlsManager.js +0 -206
- package/dist/cjs/src/nameUtils.js +0 -106
- package/dist/cjs/src/pathfindingManager.js +0 -503
- package/dist/cjs/src/performanceMonitor.js +0 -718
- package/dist/cjs/src/sceneExportManager.js +0 -292
- package/dist/cjs/src/sceneInitializationManager.js +0 -540
- package/dist/cjs/src/textureConfig.js +0 -624
- package/dist/cjs/src/transformControlsManager.js +0 -851
- package/dist/esm/node_modules/three/examples/jsm/controls/TransformControls.js +0 -1537
- package/dist/esm/src/animationManager.js +0 -112
- package/dist/esm/src/componentManager.js +0 -123
- package/dist/esm/src/debugLogger.js +0 -167
- package/dist/esm/src/disposalManager.js +0 -155
- package/dist/esm/src/environmentManager.js +0 -1282
- package/dist/esm/src/hotReloadManager.js +0 -244
- package/dist/esm/src/keyboardControlsManager.js +0 -196
- package/dist/esm/src/nameUtils.js +0 -99
- package/dist/esm/src/pathfindingManager.js +0 -479
- package/dist/esm/src/performanceMonitor.js +0 -712
- package/dist/esm/src/sceneExportManager.js +0 -286
- package/dist/esm/src/sceneInitializationManager.js +0 -513
- package/dist/esm/src/textureConfig.js +0 -595
- package/dist/esm/src/transformControlsManager.js +0 -827
|
@@ -1,465 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var THREE = require('three');
|
|
6
|
-
|
|
7
|
-
// https://github.com/mrdoob/three.js/issues/5552
|
|
8
|
-
// http://en.wikipedia.org/wiki/RGBE_image_format
|
|
9
|
-
|
|
10
|
-
class RGBELoader extends THREE.DataTextureLoader {
|
|
11
|
-
|
|
12
|
-
constructor( manager ) {
|
|
13
|
-
|
|
14
|
-
super( manager );
|
|
15
|
-
|
|
16
|
-
this.type = THREE.HalfFloatType;
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// adapted from http://www.graphics.cornell.edu/~bjw/rgbe.html
|
|
21
|
-
|
|
22
|
-
parse( buffer ) {
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
/* return codes for rgbe routines */
|
|
26
|
-
//RGBE_RETURN_SUCCESS = 0,
|
|
27
|
-
RGBE_RETURN_FAILURE = - 1,
|
|
28
|
-
|
|
29
|
-
/* default error routine. change this to change error handling */
|
|
30
|
-
rgbe_read_error = 1,
|
|
31
|
-
rgbe_write_error = 2,
|
|
32
|
-
rgbe_format_error = 3,
|
|
33
|
-
rgbe_memory_error = 4,
|
|
34
|
-
rgbe_error = function ( rgbe_error_code, msg ) {
|
|
35
|
-
|
|
36
|
-
switch ( rgbe_error_code ) {
|
|
37
|
-
|
|
38
|
-
case rgbe_read_error: console.error( 'THREE.RGBELoader Read Error: ' + ( msg || '' ) );
|
|
39
|
-
break;
|
|
40
|
-
case rgbe_write_error: console.error( 'THREE.RGBELoader Write Error: ' + ( msg || '' ) );
|
|
41
|
-
break;
|
|
42
|
-
case rgbe_format_error: console.error( 'THREE.RGBELoader Bad File Format: ' + ( msg || '' ) );
|
|
43
|
-
break;
|
|
44
|
-
default:
|
|
45
|
-
case rgbe_memory_error: console.error( 'THREE.RGBELoader: Error: ' + ( msg || '' ) );
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return RGBE_RETURN_FAILURE;
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
/* offsets to red, green, and blue components in a data (float) pixel */
|
|
54
|
-
//RGBE_DATA_RED = 0,
|
|
55
|
-
//RGBE_DATA_GREEN = 1,
|
|
56
|
-
//RGBE_DATA_BLUE = 2,
|
|
57
|
-
|
|
58
|
-
/* number of floats per pixel, use 4 since stored in rgba image format */
|
|
59
|
-
//RGBE_DATA_SIZE = 4,
|
|
60
|
-
|
|
61
|
-
/* flags indicating which fields in an rgbe_header_info are valid */
|
|
62
|
-
RGBE_VALID_PROGRAMTYPE = 1,
|
|
63
|
-
RGBE_VALID_FORMAT = 2,
|
|
64
|
-
RGBE_VALID_DIMENSIONS = 4,
|
|
65
|
-
|
|
66
|
-
NEWLINE = '\n',
|
|
67
|
-
|
|
68
|
-
fgets = function ( buffer, lineLimit, consume ) {
|
|
69
|
-
|
|
70
|
-
const chunkSize = 128;
|
|
71
|
-
|
|
72
|
-
lineLimit = ! lineLimit ? 1024 : lineLimit;
|
|
73
|
-
let p = buffer.pos,
|
|
74
|
-
i = - 1, len = 0, s = '',
|
|
75
|
-
chunk = String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
|
|
76
|
-
|
|
77
|
-
while ( ( 0 > ( i = chunk.indexOf( NEWLINE ) ) ) && ( len < lineLimit ) && ( p < buffer.byteLength ) ) {
|
|
78
|
-
|
|
79
|
-
s += chunk; len += chunk.length;
|
|
80
|
-
p += chunkSize;
|
|
81
|
-
chunk += String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if ( - 1 < i ) {
|
|
86
|
-
|
|
87
|
-
/*for (i=l-1; i>=0; i--) {
|
|
88
|
-
byteCode = m.charCodeAt(i);
|
|
89
|
-
if (byteCode > 0x7f && byteCode <= 0x7ff) byteLen++;
|
|
90
|
-
else if (byteCode > 0x7ff && byteCode <= 0xffff) byteLen += 2;
|
|
91
|
-
if (byteCode >= 0xDC00 && byteCode <= 0xDFFF) i--; //trail surrogate
|
|
92
|
-
}*/
|
|
93
|
-
if ( false !== consume ) buffer.pos += len + i + 1;
|
|
94
|
-
return s + chunk.slice( 0, i );
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return false;
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
/* minimal header reading. modify if you want to parse more information */
|
|
103
|
-
RGBE_ReadHeader = function ( buffer ) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// regexes to parse header info fields
|
|
107
|
-
const magic_token_re = /^#\?(\S+)/,
|
|
108
|
-
gamma_re = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,
|
|
109
|
-
exposure_re = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,
|
|
110
|
-
format_re = /^\s*FORMAT=(\S+)\s*$/,
|
|
111
|
-
dimensions_re = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,
|
|
112
|
-
|
|
113
|
-
// RGBE format header struct
|
|
114
|
-
header = {
|
|
115
|
-
|
|
116
|
-
valid: 0, /* indicate which fields are valid */
|
|
117
|
-
|
|
118
|
-
string: '', /* the actual header string */
|
|
119
|
-
|
|
120
|
-
comments: '', /* comments found in header */
|
|
121
|
-
|
|
122
|
-
programtype: 'RGBE', /* listed at beginning of file to identify it after "#?". defaults to "RGBE" */
|
|
123
|
-
|
|
124
|
-
format: '', /* RGBE format, default 32-bit_rle_rgbe */
|
|
125
|
-
|
|
126
|
-
gamma: 1.0, /* image has already been gamma corrected with given gamma. defaults to 1.0 (no correction) */
|
|
127
|
-
|
|
128
|
-
exposure: 1.0, /* a value of 1.0 in an image corresponds to <exposure> watts/steradian/m^2. defaults to 1.0 */
|
|
129
|
-
|
|
130
|
-
width: 0, height: 0 /* image dimensions, width/height */
|
|
131
|
-
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
let line, match;
|
|
135
|
-
|
|
136
|
-
if ( buffer.pos >= buffer.byteLength || ! ( line = fgets( buffer ) ) ) {
|
|
137
|
-
|
|
138
|
-
return rgbe_error( rgbe_read_error, 'no header found' );
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/* if you want to require the magic token then uncomment the next line */
|
|
143
|
-
if ( ! ( match = line.match( magic_token_re ) ) ) {
|
|
144
|
-
|
|
145
|
-
return rgbe_error( rgbe_format_error, 'bad initial token' );
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
header.valid |= RGBE_VALID_PROGRAMTYPE;
|
|
150
|
-
header.programtype = match[ 1 ];
|
|
151
|
-
header.string += line + '\n';
|
|
152
|
-
|
|
153
|
-
while ( true ) {
|
|
154
|
-
|
|
155
|
-
line = fgets( buffer );
|
|
156
|
-
if ( false === line ) break;
|
|
157
|
-
header.string += line + '\n';
|
|
158
|
-
|
|
159
|
-
if ( '#' === line.charAt( 0 ) ) {
|
|
160
|
-
|
|
161
|
-
header.comments += line + '\n';
|
|
162
|
-
continue; // comment line
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if ( match = line.match( gamma_re ) ) {
|
|
167
|
-
|
|
168
|
-
header.gamma = parseFloat( match[ 1 ] );
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if ( match = line.match( exposure_re ) ) {
|
|
173
|
-
|
|
174
|
-
header.exposure = parseFloat( match[ 1 ] );
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if ( match = line.match( format_re ) ) {
|
|
179
|
-
|
|
180
|
-
header.valid |= RGBE_VALID_FORMAT;
|
|
181
|
-
header.format = match[ 1 ];//'32-bit_rle_rgbe';
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if ( match = line.match( dimensions_re ) ) {
|
|
186
|
-
|
|
187
|
-
header.valid |= RGBE_VALID_DIMENSIONS;
|
|
188
|
-
header.height = parseInt( match[ 1 ], 10 );
|
|
189
|
-
header.width = parseInt( match[ 2 ], 10 );
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if ( ( header.valid & RGBE_VALID_FORMAT ) && ( header.valid & RGBE_VALID_DIMENSIONS ) ) break;
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if ( ! ( header.valid & RGBE_VALID_FORMAT ) ) {
|
|
198
|
-
|
|
199
|
-
return rgbe_error( rgbe_format_error, 'missing format specifier' );
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
if ( ! ( header.valid & RGBE_VALID_DIMENSIONS ) ) {
|
|
204
|
-
|
|
205
|
-
return rgbe_error( rgbe_format_error, 'missing image size specifier' );
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return header;
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
RGBE_ReadPixels_RLE = function ( buffer, w, h ) {
|
|
214
|
-
|
|
215
|
-
const scanline_width = w;
|
|
216
|
-
|
|
217
|
-
if (
|
|
218
|
-
// run length encoding is not allowed so read flat
|
|
219
|
-
( ( scanline_width < 8 ) || ( scanline_width > 0x7fff ) ) ||
|
|
220
|
-
// this file is not run length encoded
|
|
221
|
-
( ( 2 !== buffer[ 0 ] ) || ( 2 !== buffer[ 1 ] ) || ( buffer[ 2 ] & 0x80 ) )
|
|
222
|
-
) {
|
|
223
|
-
|
|
224
|
-
// return the flat buffer
|
|
225
|
-
return new Uint8Array( buffer );
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if ( scanline_width !== ( ( buffer[ 2 ] << 8 ) | buffer[ 3 ] ) ) {
|
|
230
|
-
|
|
231
|
-
return rgbe_error( rgbe_format_error, 'wrong scanline width' );
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
const data_rgba = new Uint8Array( 4 * w * h );
|
|
236
|
-
|
|
237
|
-
if ( ! data_rgba.length ) {
|
|
238
|
-
|
|
239
|
-
return rgbe_error( rgbe_memory_error, 'unable to allocate buffer space' );
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
let offset = 0, pos = 0;
|
|
244
|
-
|
|
245
|
-
const ptr_end = 4 * scanline_width;
|
|
246
|
-
const rgbeStart = new Uint8Array( 4 );
|
|
247
|
-
const scanline_buffer = new Uint8Array( ptr_end );
|
|
248
|
-
let num_scanlines = h;
|
|
249
|
-
|
|
250
|
-
// read in each successive scanline
|
|
251
|
-
while ( ( num_scanlines > 0 ) && ( pos < buffer.byteLength ) ) {
|
|
252
|
-
|
|
253
|
-
if ( pos + 4 > buffer.byteLength ) {
|
|
254
|
-
|
|
255
|
-
return rgbe_error( rgbe_read_error );
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
rgbeStart[ 0 ] = buffer[ pos ++ ];
|
|
260
|
-
rgbeStart[ 1 ] = buffer[ pos ++ ];
|
|
261
|
-
rgbeStart[ 2 ] = buffer[ pos ++ ];
|
|
262
|
-
rgbeStart[ 3 ] = buffer[ pos ++ ];
|
|
263
|
-
|
|
264
|
-
if ( ( 2 != rgbeStart[ 0 ] ) || ( 2 != rgbeStart[ 1 ] ) || ( ( ( rgbeStart[ 2 ] << 8 ) | rgbeStart[ 3 ] ) != scanline_width ) ) {
|
|
265
|
-
|
|
266
|
-
return rgbe_error( rgbe_format_error, 'bad rgbe scanline format' );
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
// read each of the four channels for the scanline into the buffer
|
|
271
|
-
// first red, then green, then blue, then exponent
|
|
272
|
-
let ptr = 0, count;
|
|
273
|
-
|
|
274
|
-
while ( ( ptr < ptr_end ) && ( pos < buffer.byteLength ) ) {
|
|
275
|
-
|
|
276
|
-
count = buffer[ pos ++ ];
|
|
277
|
-
const isEncodedRun = count > 128;
|
|
278
|
-
if ( isEncodedRun ) count -= 128;
|
|
279
|
-
|
|
280
|
-
if ( ( 0 === count ) || ( ptr + count > ptr_end ) ) {
|
|
281
|
-
|
|
282
|
-
return rgbe_error( rgbe_format_error, 'bad scanline data' );
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if ( isEncodedRun ) {
|
|
287
|
-
|
|
288
|
-
// a (encoded) run of the same value
|
|
289
|
-
const byteValue = buffer[ pos ++ ];
|
|
290
|
-
for ( let i = 0; i < count; i ++ ) {
|
|
291
|
-
|
|
292
|
-
scanline_buffer[ ptr ++ ] = byteValue;
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
//ptr += count;
|
|
296
|
-
|
|
297
|
-
} else {
|
|
298
|
-
|
|
299
|
-
// a literal-run
|
|
300
|
-
scanline_buffer.set( buffer.subarray( pos, pos + count ), ptr );
|
|
301
|
-
ptr += count; pos += count;
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
// now convert data from buffer into rgba
|
|
309
|
-
// first red, then green, then blue, then exponent (alpha)
|
|
310
|
-
const l = scanline_width; //scanline_buffer.byteLength;
|
|
311
|
-
for ( let i = 0; i < l; i ++ ) {
|
|
312
|
-
|
|
313
|
-
let off = 0;
|
|
314
|
-
data_rgba[ offset ] = scanline_buffer[ i + off ];
|
|
315
|
-
off += scanline_width; //1;
|
|
316
|
-
data_rgba[ offset + 1 ] = scanline_buffer[ i + off ];
|
|
317
|
-
off += scanline_width; //1;
|
|
318
|
-
data_rgba[ offset + 2 ] = scanline_buffer[ i + off ];
|
|
319
|
-
off += scanline_width; //1;
|
|
320
|
-
data_rgba[ offset + 3 ] = scanline_buffer[ i + off ];
|
|
321
|
-
offset += 4;
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
num_scanlines --;
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
return data_rgba;
|
|
330
|
-
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
const RGBEByteToRGBFloat = function ( sourceArray, sourceOffset, destArray, destOffset ) {
|
|
334
|
-
|
|
335
|
-
const e = sourceArray[ sourceOffset + 3 ];
|
|
336
|
-
const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
|
|
337
|
-
|
|
338
|
-
destArray[ destOffset + 0 ] = sourceArray[ sourceOffset + 0 ] * scale;
|
|
339
|
-
destArray[ destOffset + 1 ] = sourceArray[ sourceOffset + 1 ] * scale;
|
|
340
|
-
destArray[ destOffset + 2 ] = sourceArray[ sourceOffset + 2 ] * scale;
|
|
341
|
-
destArray[ destOffset + 3 ] = 1;
|
|
342
|
-
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
const RGBEByteToRGBHalf = function ( sourceArray, sourceOffset, destArray, destOffset ) {
|
|
346
|
-
|
|
347
|
-
const e = sourceArray[ sourceOffset + 3 ];
|
|
348
|
-
const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
|
|
349
|
-
|
|
350
|
-
// clamping to 65504, the maximum representable value in float16
|
|
351
|
-
destArray[ destOffset + 0 ] = THREE.DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 0 ] * scale, 65504 ) );
|
|
352
|
-
destArray[ destOffset + 1 ] = THREE.DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 1 ] * scale, 65504 ) );
|
|
353
|
-
destArray[ destOffset + 2 ] = THREE.DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 2 ] * scale, 65504 ) );
|
|
354
|
-
destArray[ destOffset + 3 ] = THREE.DataUtils.toHalfFloat( 1 );
|
|
355
|
-
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
const byteArray = new Uint8Array( buffer );
|
|
359
|
-
byteArray.pos = 0;
|
|
360
|
-
const rgbe_header_info = RGBE_ReadHeader( byteArray );
|
|
361
|
-
|
|
362
|
-
if ( RGBE_RETURN_FAILURE !== rgbe_header_info ) {
|
|
363
|
-
|
|
364
|
-
const w = rgbe_header_info.width,
|
|
365
|
-
h = rgbe_header_info.height,
|
|
366
|
-
image_rgba_data = RGBE_ReadPixels_RLE( byteArray.subarray( byteArray.pos ), w, h );
|
|
367
|
-
|
|
368
|
-
if ( RGBE_RETURN_FAILURE !== image_rgba_data ) {
|
|
369
|
-
|
|
370
|
-
let data, type;
|
|
371
|
-
let numElements;
|
|
372
|
-
|
|
373
|
-
switch ( this.type ) {
|
|
374
|
-
|
|
375
|
-
case THREE.FloatType:
|
|
376
|
-
|
|
377
|
-
numElements = image_rgba_data.length / 4;
|
|
378
|
-
const floatArray = new Float32Array( numElements * 4 );
|
|
379
|
-
|
|
380
|
-
for ( let j = 0; j < numElements; j ++ ) {
|
|
381
|
-
|
|
382
|
-
RGBEByteToRGBFloat( image_rgba_data, j * 4, floatArray, j * 4 );
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
data = floatArray;
|
|
387
|
-
type = THREE.FloatType;
|
|
388
|
-
break;
|
|
389
|
-
|
|
390
|
-
case THREE.HalfFloatType:
|
|
391
|
-
|
|
392
|
-
numElements = image_rgba_data.length / 4;
|
|
393
|
-
const halfArray = new Uint16Array( numElements * 4 );
|
|
394
|
-
|
|
395
|
-
for ( let j = 0; j < numElements; j ++ ) {
|
|
396
|
-
|
|
397
|
-
RGBEByteToRGBHalf( image_rgba_data, j * 4, halfArray, j * 4 );
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
data = halfArray;
|
|
402
|
-
type = THREE.HalfFloatType;
|
|
403
|
-
break;
|
|
404
|
-
|
|
405
|
-
default:
|
|
406
|
-
|
|
407
|
-
console.error( 'THREE.RGBELoader: unsupported type: ', this.type );
|
|
408
|
-
break;
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
return {
|
|
413
|
-
width: w, height: h,
|
|
414
|
-
data: data,
|
|
415
|
-
header: rgbe_header_info.string,
|
|
416
|
-
gamma: rgbe_header_info.gamma,
|
|
417
|
-
exposure: rgbe_header_info.exposure,
|
|
418
|
-
type: type
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
return null;
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
setDataType( value ) {
|
|
430
|
-
|
|
431
|
-
this.type = value;
|
|
432
|
-
return this;
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
load( url, onLoad, onProgress, onError ) {
|
|
437
|
-
|
|
438
|
-
function onLoadCallback( texture, texData ) {
|
|
439
|
-
|
|
440
|
-
switch ( texture.type ) {
|
|
441
|
-
|
|
442
|
-
case THREE.FloatType:
|
|
443
|
-
case THREE.HalfFloatType:
|
|
444
|
-
|
|
445
|
-
texture.encoding = THREE.LinearEncoding;
|
|
446
|
-
texture.minFilter = THREE.LinearFilter;
|
|
447
|
-
texture.magFilter = THREE.LinearFilter;
|
|
448
|
-
texture.generateMipmaps = false;
|
|
449
|
-
texture.flipY = true;
|
|
450
|
-
|
|
451
|
-
break;
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
if ( onLoad ) onLoad( texture, texData );
|
|
456
|
-
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
return super.load( url, onLoadCallback, onProgress, onError );
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
exports.RGBELoader = RGBELoader;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"t",{value:!0});var r=require("three");class e extends r.DataTextureLoader{constructor(e){super(e),this.type=r.HalfFloatType}parse(e){const t=function(r,e){switch(r){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(e||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(e||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(e||""));default:throw new Error("THREE.RGBELoader: Memory Error: "+(e||""))}},n=function(r,e,t){e=e||1024;let n=r.pos,s=-1,a=0,o="",i=String.fromCharCode.apply(null,new Uint16Array(r.subarray(n,n+128)));for(;0>(s=i.indexOf("\n"))&&a<e&&n<r.byteLength;)o+=i,a+=i.length,n+=128,i+=String.fromCharCode.apply(null,new Uint16Array(r.subarray(n,n+128)));return-1<s&&(!1!==t&&(r.pos+=a+s+1),o+i.slice(0,s))},s=function(r,e,t,n){const s=r[e+3],a=Math.pow(2,s-128)/255;t[n+0]=r[e+0]*a,t[n+1]=r[e+1]*a,t[n+2]=r[e+2]*a,t[n+3]=1},a=function(e,t,n,s){const a=e[t+3],o=Math.pow(2,a-128)/255;n[s+0]=r.DataUtils.toHalfFloat(Math.min(e[t+0]*o,65504)),n[s+1]=r.DataUtils.toHalfFloat(Math.min(e[t+1]*o,65504)),n[s+2]=r.DataUtils.toHalfFloat(Math.min(e[t+2]*o,65504)),n[s+3]=r.DataUtils.toHalfFloat(1)},o=new Uint8Array(e);o.pos=0;const i=function(r){const e=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,a=/^\s*FORMAT=(\S+)\s*$/,o=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,i={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let c,l;for((r.pos>=r.byteLength||!(c=n(r)))&&t(1,"no header found"),(l=c.match(/^#\?(\S+)/))||t(3,"bad initial token"),i.valid|=1,i.programtype=l[1],i.string+=c+"\n";c=n(r),!1!==c;)if(i.string+=c+"\n","#"!==c.charAt(0)){if((l=c.match(e))&&(i.gamma=parseFloat(l[1])),(l=c.match(s))&&(i.exposure=parseFloat(l[1])),(l=c.match(a))&&(i.valid|=2,i.format=l[1]),(l=c.match(o))&&(i.valid|=4,i.height=parseInt(l[1],10),i.width=parseInt(l[2],10)),2&i.valid&&4&i.valid)break}else i.comments+=c+"\n";return 2&i.valid||t(3,"missing format specifier"),4&i.valid||t(3,"missing image size specifier"),i}(o),c=i.width,l=i.height,d=function(r,e,n){const s=e;if(s<8||s>32767||2!==r[0]||2!==r[1]||128&r[2])return new Uint8Array(r);s!==(r[2]<<8|r[3])&&t(3,"wrong scanline width");const a=new Uint8Array(4*e*n);a.length||t(4,"unable to allocate buffer space");let o=0,i=0;const c=4*s,l=new Uint8Array(4),d=new Uint8Array(c);let u=n;for(;u>0&&i<r.byteLength;){i+4>r.byteLength&&t(1),l[0]=r[i++],l[1]=r[i++],l[2]=r[i++],l[3]=r[i++],2==l[0]&&2==l[1]&&(l[2]<<8|l[3])==s||t(3,"bad rgbe scanline format");let e,n=0;for(;n<c&&i<r.byteLength;){e=r[i++];const s=e>128;if(s&&(e-=128),(0===e||n+e>c)&&t(3,"bad scanline data"),s){const t=r[i++];for(let r=0;r<e;r++)d[n++]=t}else d.set(r.subarray(i,i+e),n),n+=e,i+=e}const f=s;for(let r=0;r<f;r++){let e=0;a[o]=d[r+e],e+=s,a[o+1]=d[r+e],e+=s,a[o+2]=d[r+e],e+=s,a[o+3]=d[r+e],o+=4}u--}return a}(o.subarray(o.pos),c,l);let u,f,h;switch(this.type){case r.FloatType:h=d.length/4;const e=new Float32Array(4*h);for(let r=0;r<h;r++)s(d,4*r,e,4*r);u=e,f=r.FloatType;break;case r.HalfFloatType:h=d.length/4;const t=new Uint16Array(4*h);for(let r=0;r<h;r++)a(d,4*r,t,4*r);u=t,f=r.HalfFloatType;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:c,height:l,data:u,header:i.string,gamma:i.gamma,exposure:i.exposure,type:f}}setDataType(r){return this.type=r,this}load(e,t,n,s){return super.load(e,function(e,n){switch(e.type){case r.FloatType:case r.HalfFloatType:e.colorSpace=r.LinearSRGBColorSpace,e.minFilter=r.LinearFilter,e.magFilter=r.LinearFilter,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)},n,s)}}exports.RGBELoader=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"t",{value:!0});var t=require("three");class n extends t.Object3D{constructor(n=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=n,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new t.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof t.element.ownerDocument.defaultView.Element&&null!==t.element.parentNode&&t.element.remove()})})}copy(t,n){return super.copy(t,n),this.element=t.element.cloneNode(!0),this.center=t.center,this}}const e=new t.Vector3,s=new t.Matrix4,o=new t.Matrix4,i=new t.Vector3,r=new t.Vector3;exports.CSS2DObject=n,exports.CSS2DRenderer=class{constructor(t={}){const n=this;let c,u,h,f;const a={objects:new WeakMap},l=void 0!==t.element?t.element:document.createElement("div");function d(t){t.isCSS2DObject&&(t.element.style.display="none");for(let n=0,e=t.children.length;n<e;n++)d(t.children[n])}function p(t,s,i){if(!1!==t.visible){if(t.isCSS2DObject){e.setFromMatrixPosition(t.matrixWorld),e.applyMatrix4(o);const r=e.z>=-1&&e.z<=1&&!0===t.layers.test(i.layers),c=t.element;c.style.display=!0===r?"":"none",!0===r&&(t.onBeforeRender(n,s,i),c.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(e.x*h+h)+"px,"+(-e.y*f+f)+"px)",c.parentNode!==l&&l.appendChild(c),t.onAfterRender(n,s,i));const u={distanceToCameraSquared:w(i,t)};a.objects.set(t,u)}for(let n=0,e=t.children.length;n<e;n++)p(t.children[n],s,i)}else d(t)}function w(t,n){return i.setFromMatrixPosition(t.matrixWorld),r.setFromMatrixPosition(n.matrixWorld),i.distanceToSquared(r)}l.style.overflow="hidden",this.domElement=l,this.getSize=function(){return{width:c,height:u}},this.render=function(t,n){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===n.parent&&!0===n.matrixWorldAutoUpdate&&n.updateMatrixWorld(),s.copy(n.matrixWorldInverse),o.multiplyMatrices(n.projectionMatrix,s),p(t,t,n),function(t){const n=function(t){const n=[];return t.traverseVisible(function(t){t.isCSS2DObject&&n.push(t)}),n}(t).sort(function(t,n){if(t.renderOrder!==n.renderOrder)return n.renderOrder-t.renderOrder;return a.objects.get(t).distanceToCameraSquared-a.objects.get(n).distanceToCameraSquared}),e=n.length;for(let t=0,s=n.length;t<s;t++)n[t].element.style.zIndex=e-t}(t)},this.setSize=function(t,n){c=t,u=n,h=c/2,f=u/2,l.style.width=t+"px",l.style.height=n+"px"}}};
|
|
@@ -1,117 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var THREE = require('three');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @param {BufferGeometry} geometry
|
|
9
|
-
* @param {number} drawMode
|
|
10
|
-
* @return {BufferGeometry}
|
|
11
|
-
*/
|
|
12
|
-
function toTrianglesDrawMode( geometry, drawMode ) {
|
|
13
|
-
|
|
14
|
-
if ( drawMode === THREE.TrianglesDrawMode ) {
|
|
15
|
-
|
|
16
|
-
console.warn( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.' );
|
|
17
|
-
return geometry;
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if ( drawMode === THREE.TriangleFanDrawMode || drawMode === THREE.TriangleStripDrawMode ) {
|
|
22
|
-
|
|
23
|
-
let index = geometry.getIndex();
|
|
24
|
-
|
|
25
|
-
// generate index if not present
|
|
26
|
-
|
|
27
|
-
if ( index === null ) {
|
|
28
|
-
|
|
29
|
-
const indices = [];
|
|
30
|
-
|
|
31
|
-
const position = geometry.getAttribute( 'position' );
|
|
32
|
-
|
|
33
|
-
if ( position !== undefined ) {
|
|
34
|
-
|
|
35
|
-
for ( let i = 0; i < position.count; i ++ ) {
|
|
36
|
-
|
|
37
|
-
indices.push( i );
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
geometry.setIndex( indices );
|
|
42
|
-
index = geometry.getIndex();
|
|
43
|
-
|
|
44
|
-
} else {
|
|
45
|
-
|
|
46
|
-
console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );
|
|
47
|
-
return geometry;
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
const numberOfTriangles = index.count - 2;
|
|
56
|
-
const newIndices = [];
|
|
57
|
-
|
|
58
|
-
if ( drawMode === THREE.TriangleFanDrawMode ) {
|
|
59
|
-
|
|
60
|
-
// gl.TRIANGLE_FAN
|
|
61
|
-
|
|
62
|
-
for ( let i = 1; i <= numberOfTriangles; i ++ ) {
|
|
63
|
-
|
|
64
|
-
newIndices.push( index.getX( 0 ) );
|
|
65
|
-
newIndices.push( index.getX( i ) );
|
|
66
|
-
newIndices.push( index.getX( i + 1 ) );
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
} else {
|
|
71
|
-
|
|
72
|
-
// gl.TRIANGLE_STRIP
|
|
73
|
-
|
|
74
|
-
for ( let i = 0; i < numberOfTriangles; i ++ ) {
|
|
75
|
-
|
|
76
|
-
if ( i % 2 === 0 ) {
|
|
77
|
-
|
|
78
|
-
newIndices.push( index.getX( i ) );
|
|
79
|
-
newIndices.push( index.getX( i + 1 ) );
|
|
80
|
-
newIndices.push( index.getX( i + 2 ) );
|
|
81
|
-
|
|
82
|
-
} else {
|
|
83
|
-
|
|
84
|
-
newIndices.push( index.getX( i + 2 ) );
|
|
85
|
-
newIndices.push( index.getX( i + 1 ) );
|
|
86
|
-
newIndices.push( index.getX( i ) );
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if ( ( newIndices.length / 3 ) !== numberOfTriangles ) {
|
|
95
|
-
|
|
96
|
-
console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// build final geometry
|
|
101
|
-
|
|
102
|
-
const newGeometry = geometry.clone();
|
|
103
|
-
newGeometry.setIndex( newIndices );
|
|
104
|
-
newGeometry.clearGroups();
|
|
105
|
-
|
|
106
|
-
return newGeometry;
|
|
107
|
-
|
|
108
|
-
} else {
|
|
109
|
-
|
|
110
|
-
console.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:', drawMode );
|
|
111
|
-
return geometry;
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
exports.toTrianglesDrawMode = toTrianglesDrawMode;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("three");exports.toTrianglesDrawMode=function(t,r){if(r===e.TrianglesDrawMode)return t;if(r===e.TriangleFanDrawMode||r===e.TriangleStripDrawMode){let o=t.getIndex();if(null===o){const e=[],r=t.getAttribute("position");if(void 0===r)return t;for(let t=0;t<r.count;t++)e.push(t);t.setIndex(e),o=t.getIndex()}const i=o.count-2,n=[];if(r===e.TriangleFanDrawMode)for(let e=1;e<=i;e++)n.push(o.getX(0)),n.push(o.getX(e)),n.push(o.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(n.push(o.getX(e)),n.push(o.getX(e+1)),n.push(o.getX(e+2))):(n.push(o.getX(e+2)),n.push(o.getX(e+1)),n.push(o.getX(e)));n.length;const s=t.clone();return s.setIndex(n),s.clearGroups(),s}return t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("three"),n=require("../core/debugLogger.js");function i(e){if(e&&e.t)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var a=i(t),r=function(){return e.createClass(function t(){e.classCallCheck(this,t),this.analysisHistory=[],this.validationRules=new Map,this.adjustmentStrategies=new Map,this.initializeDefaultRules()},[{key:"initializeDefaultRules",value:function(){this.addValidationRule("component_bounds",{check:function(e){var t=(new a.Box3).setFromObject(e);return!t.isEmpty()&&t.getSize(new a.Vector3).length()>0},message:"Component has invalid bounding box"}),this.addValidationRule("component_position",{check:function(e){var t=e.position;return!isNaN(t.x)&&!isNaN(t.y)&&!isNaN(t.z)&&isFinite(t.x)&&isFinite(t.y)&&isFinite(t.z)},message:"Component has invalid position values"}),this.addValidationRule("component_scale",{check:function(e){var t=e.scale;return t.x>0&&t.y>0&&t.z>0&&t.x<1e3&&t.y<1e3&&t.z<1e3},message:"Component has invalid scale values"}),this.addValidationRule("scene_complexity",{check:function(e){var t=0;return e.traverse(function(e){e.isMesh&&t++}),t<1e4},message:"Scene complexity too high (too many meshes)"})}},{key:"addValidationRule",value:function(e,t){this.validationRules.set(e,t)}},{key:"addAdjustmentStrategy",value:function(e,t){this.adjustmentStrategies.set(e,t)}},{key:"analyzeScene",value:function(e){var t=performance.now();n.logger.info("๐ Starting scene analysis...");var i={timestamp:(new Date).toISOString(),performance:{},structure:{},quality:{},recommendations:[]},a=0,r=0,s=0,o=0,u=new Set,c=new Set;e.traverse(function(e){if(e.isMesh){if(a++,e.geometry){r++;var t=e.geometry.getAttribute("position");t&&(s+=t.count,e.geometry.index?o+=e.geometry.index.count/3:o+=t.count/3)}if(e.material)if(Array.isArray(e.material))e.material.forEach(function(e){return u.add(e.uuid)});else{u.add(e.material.uuid);var n=e.material;Object.keys(n).forEach(function(e){n[e]&&n[e].isTexture&&c.add(n[e].uuid)})}}}),i.performance={meshCount:a,geometryCount:r,materialCount:u.size,textureCount:c.size,vertexCount:s,triangleCount:o,memoryEstimate:this.estimateMemoryUsage(s,u.size,c.size)},i.structure=this.analyzeSceneStructure(e),i.quality=this.analyzeQuality(e),i.recommendations=this.generateRecommendations(i);var l=performance.now();return i.performance.analysisTime=l-t,n.logger.info("โ
Scene analysis complete in ".concat(i.performance.analysisTime.toFixed(2),"ms")),this.analysisHistory.push(i),i}},{key:"analyzeSceneStructure",value:function(e){var t={depth:0,branches:0,emptyNodes:0,namedObjects:0,groups:0},n=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.depth=Math.max(t.depth,i),e.children.length>0&&t.branches++,0!==e.children.length||e.isMesh||e.isLight||e.isCamera||t.emptyNodes++,e.name&&""!==e.name.trim()&&t.namedObjects++,e.isGroup&&t.groups++,e.children.forEach(function(e){return n(e,i+1)})};return n(e),t}},{key:"analyzeQuality",value:function(e){var t=this,n={duplicateMaterials:0,unusedMaterials:0,missingTextures:0,invalidTransforms:0,memoryLeaks:[],optimization:{mergeable:[],instancingCandidates:[]}},i=new Map,a=new Map;return e.traverse(function(e){if(e.material){var r=t.getMaterialSignature(e.material);i.has(r)?n.duplicateMaterials++:i.set(r,e.material)}if(e.geometry){var s=t.getGeometrySignature(e.geometry);a.has(s)||a.set(s,[]),a.get(s).push(e)}!e.position||isFinite(e.position.x)&&isFinite(e.position.y)&&isFinite(e.position.z)||n.invalidTransforms++}),a.forEach(function(e,t){e.length>1&&n.optimization.instancingCandidates.push({geometry:t,count:e.length,objects:e.map(function(e){return e.uuid})})}),n}},{key:"generateRecommendations",value:function(e){var t=[];return e.performance.triangleCount>5e5&&t.push({type:"performance",priority:"high",message:"Consider using Level of Detail (LOD) for high polygon models",action:"implement_lod"}),e.performance.materialCount>50&&t.push({type:"performance",priority:"medium",message:"High material count detected. Consider material atlasing",action:"optimize_materials"}),e.quality.duplicateMaterials>10&&t.push({type:"optimization",priority:"medium",message:"Duplicate materials found. Consider material sharing",action:"merge_materials"}),e.quality.optimization.instancingCandidates.length>0&&t.push({type:"optimization",priority:"high",message:"Instancing opportunities detected for repeated geometries",action:"implement_instancing"}),t}},{key:"validateScene",value:function(e){var t=this;n.logger.info("๐ Validating scene components...");var i={passed:[],failed:[],warnings:[]};return this.validationRules.forEach(function(t,n){try{t.check(e)?i.passed.push({rule:n,target:"scene"}):i.failed.push({rule:n,target:"scene",message:t.message})}catch(e){i.warnings.push({rule:n,target:"scene",message:"Validation error: ".concat(e.message)})}}),e.traverse(function(e){e.isMesh&&t.validationRules.forEach(function(t,n){try{t.check(e)?i.passed.push({rule:n,target:e.uuid}):i.failed.push({rule:n,target:e.uuid,message:t.message,objectName:e.name||"Unnamed Object"})}catch(t){i.warnings.push({rule:n,target:e.uuid,message:"Validation error: ".concat(t.message),objectName:e.name||"Unnamed Object"})}})}),n.logger.info("โ
Validation complete: ".concat(i.passed.length," passed, ").concat(i.failed.length," failed, ").concat(i.warnings.length," warnings")),i}},{key:"applyAdjustments",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.logger.info("๐ง Applying scene adjustments...");var a={applied:[],failed:[],skipped:[]};return i.forEach(function(n){var i=t.adjustmentStrategies.get(n.type);if(i)try{var r=i(e,n.options||{});a.applied.push({adjustment:n.type,result:r})}catch(e){a.failed.push({adjustment:n.type,error:e.message})}else a.skipped.push({adjustment:n.type,reason:"No strategy found"})}),n.logger.info("โ
Adjustments complete: ".concat(a.applied.length," applied, ").concat(a.failed.length," failed, ").concat(a.skipped.length," skipped")),a}},{key:"getMaterialSignature",value:function(e){var t={type:e.type,color:e.color?e.color.getHex():null,metalness:e.metalness,roughness:e.roughness,transparent:e.transparent,opacity:e.opacity};return JSON.stringify(t)}},{key:"getGeometrySignature",value:function(e){var t,n=Object.keys(e.attributes),i=(null===(t=e.getAttribute("position"))||void 0===t?void 0:t.count)||0,a=!!e.index;return"".concat(e.type,"_").concat(i,"_").concat(a,"_").concat(n.join(","))}},{key:"estimateMemoryUsage",value:function(e,t,n){var i=32*e,a=1024*t,r=1048576*n,s=i+a+r;return{geometry:this.formatBytes(i),materials:this.formatBytes(a),textures:this.formatBytes(r),total:this.formatBytes(s),totalBytes:s}}},{key:"formatBytes",value:function(e){if(0===e)return"0 Bytes";var t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]}},{key:"getAnalysisHistory",value:function(){return this.analysisHistory}},{key:"clearHistory",value:function(){this.analysisHistory=[]}},{key:"dispose",value:function(){this.clearHistory(),this.validationRules.clear(),this.adjustmentStrategies.clear(),n.logger.info("Analysis disposed")}}])}();exports.Analysis=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("../core/debugLogger.js"),n=function(){return e.createClass(function n(){var r,s=this;e.classCallCheck(this,n),e.defineProperty(this,"mock",{create:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.objectSpread2({calls:[],callCount:0},t);return Object.keys(t).forEach(function(e){var r=t[e];n[e]=function(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];return n.calls.push({method:e,args:s,timestamp:Date.now()}),n.callCount++,r.apply(void 0,s)}}),n},spy:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.calls.push({args:r,timestamp:Date.now()}),t.callCount++,void 0!==t.returnValue?t.returnValue:e.apply(void 0,r)};return t.calls=[],t.callCount=0,t.returnValue=void 0,t.returns=function(e){return t.returnValue=e,t},t.throws=function(e){return t.throwError=e,t},t},three:{vector3:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{x:e,y:t,z:n,set:function(r,s,i){e=r,t=s,n=i},clone:function(){return{x:e,y:t,z:n}},add:function(r){return{x:e+r.x,y:t+r.y,z:n+r.z}},sub:function(r){return{x:e-r.x,y:t-r.y,z:n-r.z}},length:function(){return Math.sqrt(e*e+t*t+n*n)},normalize:function(){var r=Math.sqrt(e*e+t*t+n*n);return{x:e/r,y:t/r,z:n/r}}}},object3D:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},children:[],parent:null,name:e.name||"",uuid:e.uuid||Math.random().toString(36),add:function(e){this.children.push(e),e.parent=this},remove:function(e){var t=this.children.indexOf(e);t>-1&&this.children.splice(t,1)},traverse:function(e){e(this),this.children.forEach(function(t){return t.traverse(e)})}}},scene:function(){return e.objectSpread2(e.objectSpread2({},s.mock.three.object3D()),{},{background:null,environment:null,fog:null,type:"Scene"})}}}),e.defineProperty(this,"benchmark",{run:(r=e.asyncToGenerator(e.regenerator().m(function n(r,i){var o,a,u,c,f,h,d,l,p,m,v,w,E,g,b,y,k,x,T,M=arguments;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:a=(o=M.length>2&&void 0!==M[2]?M[2]:{}).iterations,u=void 0===a?1e3:a,c=o.warmupIterations,f=void 0===c?10:c,h=o.timeout,d=void 0===h?5e3:h,t.logger.info("โฑ๏ธ Running benchmark: ".concat(r)),l=0;case 1:if(!(l<f)){e.n=3;break}return e.n=2,i();case 2:l++,e.n=1;break;case 3:p=[],m=performance.now(),v=0;case 4:if(!(v<u)){e.n=7;break}return w=performance.now(),e.n=5,i();case 5:if(E=performance.now(),p.push(E-w),!(performance.now()-m>d)){e.n=6;break}return t.logger.warn('โ ๏ธ Benchmark "'.concat(r,'" timed out after ').concat(v+1," iterations")),e.a(3,7);case 6:v++,e.n=4;break;case 7:return g=performance.now()-m,b=p.reduce(function(e,t){return e+t},0)/p.length,y=Math.min.apply(Math,p),k=Math.max.apply(Math,p),x=p.sort()[Math.floor(p.length/2)],T={name:r,iterations:p.length,totalTime:g,avgTime:b,minTime:y,maxTime:k,medianTime:x,opsPerSecond:1e3/b},s.benchmarks.set(r,T),t.logger.info('โ
Benchmark "'.concat(r,'" completed: ').concat(T.opsPerSecond.toFixed(2)," ops/sec")),e.a(2,T)}},n)})),function(e,t){return r.apply(this,arguments)}),compare:function(e){var t=e.map(function(e){return s.benchmarks.get(e)}).filter(Boolean);if(t.length<2)throw new Error("Need at least 2 benchmarks to compare");var n=t.reduce(function(e,t){return e.opsPerSecond>t.opsPerSecond?e:t}),r=t.map(function(e){return{name:e.name,opsPerSecond:e.opsPerSecond,relativeSpeed:e.opsPerSecond/n.opsPerSecond,slower:n.opsPerSecond/e.opsPerSecond}});return{fastest:n.name,comparison:r}}}),this.testSuites=new Map,this.testResults=[],this.mockData=new Map,this.assertions=new Map,this.benchmarks=new Map,this.setupDefaultAssertions()},[{key:"setupDefaultAssertions",value:function(){this.addAssertion("equals",function(e,t,n){if(e!==t)throw new Error(n||"Expected ".concat(t,", got ").concat(e))}),this.addAssertion("notEquals",function(e,t,n){if(e===t)throw new Error(n||"Expected not ".concat(t,", got ").concat(e))}),this.addAssertion("deepEquals",function(e,t,n){if(JSON.stringify(e)!==JSON.stringify(t))throw new Error(n||"Deep equality failed")}),this.addAssertion("true",function(e,t){if(!0!==e)throw new Error(t||"Expected true, got ".concat(e))}),this.addAssertion("false",function(e,t){if(!1!==e)throw new Error(t||"Expected false, got ".concat(e))}),this.addAssertion("truthy",function(e,t){if(!e)throw new Error(t||"Expected truthy value, got ".concat(e))}),this.addAssertion("falsy",function(e,t){if(e)throw new Error(t||"Expected falsy value, got ".concat(e))}),this.addAssertion("null",function(e,t){if(null!==e)throw new Error(t||"Expected null, got ".concat(e))}),this.addAssertion("undefined",function(e,t){if(void 0!==e)throw new Error(t||"Expected undefined, got ".concat(e))}),this.addAssertion("defined",function(e,t){if(void 0===e)throw new Error(t||"Expected defined value, got undefined")}),this.addAssertion("instanceOf",function(t,n,r){if(!(t instanceof n))throw new Error(r||"Expected instance of ".concat(n.name,", got ").concat(e.typeof(t)))}),this.addAssertion("typeof",function(t,n,r){if(e.typeof(t)!==n)throw new Error(r||"Expected type ".concat(n,", got ").concat(e.typeof(t)))}),this.addAssertion("greaterThan",function(e,t,n){if(e<=t)throw new Error(n||"Expected ".concat(e," > ").concat(t))}),this.addAssertion("lessThan",function(e,t,n){if(e>=t)throw new Error(n||"Expected ".concat(e," < ").concat(t))}),this.addAssertion("greaterThanOrEqual",function(e,t,n){if(e<t)throw new Error(n||"Expected ".concat(e," >= ").concat(t))}),this.addAssertion("lessThanOrEqual",function(e,t,n){if(e>t)throw new Error(n||"Expected ".concat(e," <= ").concat(t))}),this.addAssertion("approximately",function(e,t,n,r){if(Math.abs(e-t)>n)throw new Error(r||"Expected ".concat(e," โ ").concat(t," (ยฑ").concat(n,")"))}),this.addAssertion("includes",function(e,t,n){if(!e.includes(t))throw new Error(n||'Expected "'.concat(e,'" to include "').concat(t,'"'))}),this.addAssertion("startsWith",function(e,t,n){if(!e.startsWith(t))throw new Error(n||'Expected "'.concat(e,'" to start with "').concat(t,'"'))}),this.addAssertion("endsWith",function(e,t,n){if(!e.endsWith(t))throw new Error(n||'Expected "'.concat(e,'" to end with "').concat(t,'"'))}),this.addAssertion("matches",function(e,t,n){if(!t.test(e))throw new Error(n||'Expected "'.concat(e,'" to match pattern ').concat(t))}),this.addAssertion("hasLength",function(e,t,n){if(e.length!==t)throw new Error(n||"Expected length ".concat(t,", got ").concat(e.length))}),this.addAssertion("isEmpty",function(e,t){if(0!==e.length)throw new Error(t||"Expected empty array/string, got length ".concat(e.length))}),this.addAssertion("isNotEmpty",function(e,t){if(0===e.length)throw new Error(t||"Expected non-empty array/string")}),this.addAssertion("hasProperty",function(e,t,n){if(!e.hasOwnProperty(t))throw new Error(n||'Expected object to have property "'.concat(t,'"'))}),this.addAssertion("hasMethod",function(e,t,n){if("function"!=typeof e[t])throw new Error(n||'Expected object to have method "'.concat(t,'"'))}),this.addAssertion("resolves",function(){var t=e.asyncToGenerator(e.regenerator().m(function t(n,r){var s;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,e.n=1,n;case 1:e.n=3;break;case 2:throw e.p=2,s=e.v,new Error(r||"Expected promise to resolve, but it rejected: ".concat(s.message));case 3:return e.a(2)}},t,null,[[0,2]])}));return function(e,n){return t.apply(this,arguments)}}()),this.addAssertion("rejects",function(){var t=e.asyncToGenerator(e.regenerator().m(function t(n,r){return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.p=0,e.n=1,n;case 1:throw new Error(r||"Expected promise to reject, but it resolved");case 2:e.p=2,e.v;case 3:return e.a(2)}},t,null,[[0,2]])}));return function(e,n){return t.apply(this,arguments)}}()),this.addAssertion("throws",function(e,t){try{throw e(),new Error(t||"Expected function to throw, but it didn't")}catch(e){}})}},{key:"addAssertion",value:function(e,t){this.assertions.set(e,t)}},{key:"createTestSuite",value:function(e){var t=this,n={name:e,tests:[],beforeEach:null,afterEach:null,beforeAll:null,afterAll:null,setup:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null};return this.testSuites.set(e,n),{test:function(n,r){return t.addTest(e,n,r)},beforeEach:function(e){n.beforeEach=e},afterEach:function(e){n.afterEach=e},beforeAll:function(e){n.beforeAll=e},afterAll:function(e){n.afterAll=e}}}},{key:"addTest",value:function(e,t,n){var r=this.testSuites.get(e);if(!r)throw new Error('Test suite "'.concat(e,'" not found'));r.tests.push({name:t,fn:n,skip:!1,only:!1})}},{key:"runAllTests",value:(s=e.asyncToGenerator(e.regenerator().m(function n(){var r,s,i,o,a,u,c,f;return e.regenerator().w(function(n){for(;;)switch(n.n){case 0:t.logger.info("๐งช Running all test suites..."),r=performance.now(),s={suites:[],totalTests:0,passedTests:0,failedTests:0,skippedTests:0,duration:0},i=e.createForOfIteratorHelper(this.testSuites),n.p=1,i.s();case 2:if((o=i.n()).done){n.n=5;break}return a=e.slicedToArray(o.value,2),u=a[0],a[1],n.n=3,this.runTestSuite(u);case 3:c=n.v,s.suites.push(c),s.totalTests+=c.totalTests,s.passedTests+=c.passedTests,s.failedTests+=c.failedTests,s.skippedTests+=c.skippedTests;case 4:n.n=2;break;case 5:n.n=7;break;case 6:n.p=6,f=n.v,i.e(f);case 7:return n.p=7,i.f(),n.f(7);case 8:return s.duration=performance.now()-r,t.logger.info("โ
All tests completed: ".concat(s.passedTests,"/").concat(s.totalTests," passed in ").concat(s.duration.toFixed(2),"ms")),this.testResults.push(s),n.a(2,s)}},n,this,[[1,6,7,8]])})),function(){return s.apply(this,arguments)})},{key:"runTestSuite",value:(r=e.asyncToGenerator(e.regenerator().m(function n(r){var s,i,o,a,u,c,f,h,d;return e.regenerator().w(function(n){for(;;)switch(n.n){case 0:if(s=this.testSuites.get(r)){n.n=1;break}throw new Error('Test suite "'.concat(r,'" not found'));case 1:if(t.logger.info("๐งช Running test suite: ".concat(r)),i=performance.now(),o={name:r,tests:[],totalTests:s.tests.length,passedTests:0,failedTests:0,skippedTests:0,duration:0},n.p=2,!s.setup){n.n=3;break}return n.n=3,s.setup();case 3:if(!s.beforeAll){n.n=4;break}return n.n=4,s.beforeAll();case 4:a=e.createForOfIteratorHelper(s.tests),n.p=5,a.s();case 6:if((u=a.n()).done){n.n=9;break}return c=u.value,n.n=7,this.runTest(s,c);case 7:f=n.v,o.tests.push(f),"passed"===f.status?o.passedTests++:"failed"===f.status?o.failedTests++:"skipped"===f.status&&o.skippedTests++;case 8:n.n=6;break;case 9:n.n=11;break;case 10:n.p=10,h=n.v,a.e(h);case 11:return n.p=11,a.f(),n.f(11);case 12:if(!s.afterAll){n.n=13;break}return n.n=13,s.afterAll();case 13:n.n=15;break;case 14:n.p=14,d=n.v,t.logger.error('โ Test suite "'.concat(r,'" setup failed:'),d);case 15:return o.duration=performance.now()-i,t.logger.info('โ
Suite "'.concat(r,'" completed: ').concat(o.passedTests,"/").concat(o.totalTests," passed")),n.a(2,o)}},n,this,[[5,10,11,12],[2,14]])})),function(e){return r.apply(this,arguments)})},{key:"runTest",value:(n=e.asyncToGenerator(e.regenerator().m(function n(r,s){var i,o,a,u;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(!s.skip){e.n=1;break}return e.a(2,{name:s.name,status:"skipped",duration:0,error:null});case 1:if(i=performance.now(),o={name:s.name,status:"passed",duration:0,error:null},e.p=2,!r.beforeEach){e.n=3;break}return e.n=3,r.beforeEach();case 3:return a=this.createAssertionContext(),e.n=4,s.fn(a);case 4:if(!r.afterEach){e.n=5;break}return e.n=5,r.afterEach();case 5:e.n=7;break;case 6:e.p=6,u=e.v,o.status="failed",o.error={message:u.message,stack:u.stack},t.logger.error('โ Test "'.concat(s.name,'" failed:'),u.message);case 7:return o.duration=performance.now()-i,e.a(2,o)}},n,this,[[2,6]])})),function(e,t){return n.apply(this,arguments)})},{key:"createAssertionContext",value:function(){var t,n={},r=e.createForOfIteratorHelper(this.assertions);try{for(r.s();!(t=r.n()).done;){var s=e.slicedToArray(t.value,2),i=s[0],o=s[1];n[i]=o}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"generateReport",value:function(e){var t=(e.passedTests/e.totalTests*100).toFixed(1),n='\n<!DOCTYPE html>\n<html>\n<head>\n <title>Test Report</title>\n <style>\n body { font-family: Arial, sans-serif; margin: 20px; }\n .summary { background: #f5f5f5; padding: 15px; border-radius: 5px; margin-bottom: 20px; }\n .suite { margin-bottom: 20px; border: 1px solid #ddd; border-radius: 5px; }\n .suite-header { background: #e9e9e9; padding: 10px; font-weight: bold; }\n .test { padding: 10px; border-bottom: 1px solid #eee; }\n .test:last-child { border-bottom: none; }\n .passed { color: green; }\n .failed { color: red; }\n .skipped { color: orange; }\n .error { background: #ffe6e6; padding: 10px; margin-top: 5px; border-radius: 3px; }\n </style>\n</head>\n<body>\n <h1>Test Report</h1>\n \n <div class="summary">\n <h2>Summary</h2>\n <p><strong>Total Tests:</strong> '.concat(e.totalTests,'</p>\n <p><strong>Passed:</strong> <span class="passed">').concat(e.passedTests,'</span></p>\n <p><strong>Failed:</strong> <span class="failed">').concat(e.failedTests,'</span></p>\n <p><strong>Skipped:</strong> <span class="skipped">').concat(e.skippedTests,"</span></p>\n <p><strong>Pass Rate:</strong> ").concat(t,"%</p>\n <p><strong>Duration:</strong> ").concat(e.duration.toFixed(2),"ms</p>\n </div>\n \n <h2>Test Suites</h2>\n");return e.suites.forEach(function(e){n+='\n <div class="suite">\n <div class="suite-header">\n '.concat(e.name," (").concat(e.passedTests,"/").concat(e.totalTests," passed)\n </div>\n"),e.tests.forEach(function(e){n+='\n <div class="test">\n <span class="'.concat(e.status,'">').concat(e.status.toUpperCase(),"</span>\n <strong>").concat(e.name,"</strong>\n <small>(").concat(e.duration.toFixed(2),"ms)</small>\n"),e.error&&(n+='\n <div class="error">\n <strong>Error:</strong> '.concat(e.error.message,"\n </div>\n")),n+=" </div>"}),n+=" </div>"}),n+="\n</body>\n</html>\n"}},{key:"clearResults",value:function(){this.testResults=[]}},{key:"getResults",value:function(){return this.testResults}},{key:"getBenchmarks",value:function(){return this.benchmarks}},{key:"dispose",value:function(){this.testSuites.clear(),this.clearResults(),this.mockData.clear(),this.benchmarks.clear(),t.logger.info("Testing disposed")}}]);var n,r,s}();exports.Testing=n;
|