@x-viewer/core 0.21.12 → 0.21.14
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/chunks/{libredwg-web-C9tIOt6T.js → libredwg-web-CpP0NVF7.js} +2 -2
- package/dist/index.esm.js +968 -964
- package/dist/types/core/controls/TransformControls.d.ts +292 -0
- package/dist/types/core/controls/TransformGizmo.d.ts +92 -0
- package/dist/types/core/controls/index.d.ts +2 -0
- package/dist/types/core/dxf/DxfLoader.d.ts +0 -11
- package/dist/types/core/dxf-parser/DxfParser.d.ts +2 -423
- package/dist/types/core/model/Model3d.d.ts +5 -0
- package/dist/types/core/utils/TextureUtils.d.ts +9 -0
- package/dist/types/core/viewers/BaseViewer.d.ts +4 -42
- package/dist/types/core/viewers/BimTilesViewer.d.ts +7 -0
- package/dist/types/core/viewers/Viewer2d.d.ts +0 -42
- package/dist/types/core/viewers/Viewer3d.d.ts +43 -4
- package/package.json +1 -1
|
@@ -1,118 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { IClass, IObjectParser } from "./objects/common";
|
|
4
|
-
import { IDictionaryObject } from "./objects/dictionary";
|
|
5
|
-
import { IImageDefObject } from "./objects/imagedef";
|
|
6
|
-
import { ILayoutObject } from "./objects/layout";
|
|
7
|
-
import { ISortEntsTableObject } from "./objects/sortentstable";
|
|
8
|
-
import { ISpatialFilterObject } from "./objects/spatialfilter";
|
|
9
|
-
import { IXRecord } from "./objects/xrecord";
|
|
10
|
-
/**
|
|
11
|
-
* Definition of a block. Which contains entities, name, handle, etc.
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
export interface IBlock {
|
|
15
|
-
entities: IEntity[];
|
|
16
|
-
ownerHandle: string;
|
|
17
|
-
xrefPath: string;
|
|
18
|
-
name: string;
|
|
19
|
-
name2: string;
|
|
20
|
-
handle: string;
|
|
21
|
-
layer: string;
|
|
22
|
-
position: IPoint;
|
|
23
|
-
paperSpace: boolean;
|
|
24
|
-
blockType: BlockTypeFlags;
|
|
25
|
-
description?: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Definition of a viewport.
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
export interface IViewport {
|
|
32
|
-
name: string;
|
|
33
|
-
handle?: string;
|
|
34
|
-
lowerLeftCorner: IPoint;
|
|
35
|
-
upperRightCorner: IPoint;
|
|
36
|
-
center: IPoint;
|
|
37
|
-
snapBasePoint: IPoint;
|
|
38
|
-
snapSpacing: IPoint;
|
|
39
|
-
gridSpacing: IPoint;
|
|
40
|
-
viewDirectionFromTarget: IPoint;
|
|
41
|
-
viewTarget: IPoint;
|
|
42
|
-
aspectRatio: number;
|
|
43
|
-
lensLength: number;
|
|
44
|
-
frontClippingPlane: string | number | boolean;
|
|
45
|
-
backClippingPlane: string | number | boolean;
|
|
46
|
-
viewHeight: number;
|
|
47
|
-
snapRotationAngle: number;
|
|
48
|
-
viewTwistAngle: number;
|
|
49
|
-
orthographicType: number;
|
|
50
|
-
ucsOrigin: IPoint;
|
|
51
|
-
ucsXAxis: IPoint;
|
|
52
|
-
ucsYAxis: IPoint;
|
|
53
|
-
renderMode: string;
|
|
54
|
-
defaultLightingType: number;
|
|
55
|
-
defaultLightingOn: boolean;
|
|
56
|
-
ownerHandle: string;
|
|
57
|
-
ambientColor: number;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Viewport table definition.
|
|
61
|
-
* @hidden
|
|
62
|
-
*/
|
|
63
|
-
export interface IViewportTableDefinition {
|
|
64
|
-
dxfSymbolName: "VPORT";
|
|
65
|
-
parseTableRecords(): IViewport[];
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Reference to DwgLineTypeElement
|
|
69
|
-
*/
|
|
70
|
-
export interface LineTypeElement {
|
|
71
|
-
elementLength: number;
|
|
72
|
-
/**
|
|
73
|
-
* 0: Dash
|
|
74
|
-
* 1: Element is a shape (a vector glyph from a compiled .SHX file)
|
|
75
|
-
* 2: Element is a text string
|
|
76
|
-
* 3: Reserved
|
|
77
|
-
*/
|
|
78
|
-
elementTypeFlag: number;
|
|
79
|
-
/**
|
|
80
|
-
* Index of the shape inside the .SHX file defined by styleObjectId.
|
|
81
|
-
* It should be useful when elementTypeFlag is 1.
|
|
82
|
-
*/
|
|
83
|
-
shapeNumber?: number;
|
|
84
|
-
styleObjectId?: string;
|
|
85
|
-
scale?: number;
|
|
86
|
-
rotation?: number;
|
|
87
|
-
offsetX?: number;
|
|
88
|
-
offsetY?: number;
|
|
89
|
-
text?: string;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Line type.
|
|
93
|
-
* @hidden
|
|
94
|
-
*/
|
|
95
|
-
export interface ILineType {
|
|
96
|
-
/**
|
|
97
|
-
* AutoCAD entity handle as hex string
|
|
98
|
-
*/
|
|
99
|
-
handle?: string;
|
|
100
|
-
name: string;
|
|
101
|
-
description: string;
|
|
102
|
-
pattern: LineTypeElement[];
|
|
103
|
-
/**
|
|
104
|
-
* The sum length of each pattern segment.
|
|
105
|
-
*/
|
|
106
|
-
patternLength: number;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Line type table definition.
|
|
110
|
-
* @hidden
|
|
111
|
-
*/
|
|
112
|
-
export interface ILineTypeTableDefinition {
|
|
113
|
-
dxfSymbolName: "LTYPE";
|
|
114
|
-
parseTableRecords(): Record<string, ILineType>;
|
|
115
|
-
}
|
|
1
|
+
import IGeometry from "./entities/geomtry";
|
|
2
|
+
import { IObjectParser } from "./objects/common";
|
|
116
3
|
/**
|
|
117
4
|
* Definition of a layer.
|
|
118
5
|
*/
|
|
@@ -152,301 +39,6 @@ export interface ILayer {
|
|
|
152
39
|
*/
|
|
153
40
|
lineweight: 0 | 5 | 9 | 13 | 15 | 18 | 20 | 25 | 30 | 35 | 40 | 50 | 53 | 60 | 70 | 80 | 90 | 100 | 106 | 120 | 140 | 158 | 200 | 211 | -3 | -2 | -1;
|
|
154
41
|
}
|
|
155
|
-
/**
|
|
156
|
-
* Layer table definition.
|
|
157
|
-
* @hidden
|
|
158
|
-
*/
|
|
159
|
-
export interface ILayerTableDefinition {
|
|
160
|
-
dxfSymbolName: "LAYER";
|
|
161
|
-
parseTableRecords(): Record<string, ILayer>;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* BlockRecord
|
|
165
|
-
* @hidden
|
|
166
|
-
*/
|
|
167
|
-
export interface IBlockRecord {
|
|
168
|
-
handle: string;
|
|
169
|
-
ownerHandle: string;
|
|
170
|
-
blockName: string;
|
|
171
|
-
layoutHandle: string;
|
|
172
|
-
blockInsertUnits: number;
|
|
173
|
-
blockExplodability: number;
|
|
174
|
-
blockScalability: number;
|
|
175
|
-
bitmap?: string;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* @hidden
|
|
179
|
-
*/
|
|
180
|
-
export interface IBlockRecordTableDefinition {
|
|
181
|
-
dxfSymbolName: "BLOCK_RECORD";
|
|
182
|
-
parseTableRecords(): Record<string, IBlockRecord>;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Definition of a style.
|
|
186
|
-
* @hidden
|
|
187
|
-
*/
|
|
188
|
-
export interface IStyle {
|
|
189
|
-
handle: string;
|
|
190
|
-
ownerHandle: string;
|
|
191
|
-
styleName: string;
|
|
192
|
-
priorTextHeight: number;
|
|
193
|
-
textHeight: number;
|
|
194
|
-
xScale: number;
|
|
195
|
-
rotation: number;
|
|
196
|
-
mirrorType: number;
|
|
197
|
-
fontFile: string;
|
|
198
|
-
bigFontFile: string;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Style table definition.
|
|
202
|
-
* @hidden
|
|
203
|
-
*/
|
|
204
|
-
export interface IStyleTableDefinition {
|
|
205
|
-
dxfSymbolName: "STYLE";
|
|
206
|
-
parseTableRecords(): Record<string, IStyle>;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Dim style.
|
|
210
|
-
* @hidden
|
|
211
|
-
*/
|
|
212
|
-
export interface IDimStyle {
|
|
213
|
-
/**
|
|
214
|
-
* AutoCAD entity handle as hex string
|
|
215
|
-
*/
|
|
216
|
-
handle?: string;
|
|
217
|
-
styleName: string;
|
|
218
|
-
DIMSCALE: number;
|
|
219
|
-
DIMASZ: number;
|
|
220
|
-
DIMEXO: string;
|
|
221
|
-
DIMEXE: string;
|
|
222
|
-
DIMSE1: string;
|
|
223
|
-
DIMSE2: string;
|
|
224
|
-
DIMTAD: string;
|
|
225
|
-
DIMTXT: string;
|
|
226
|
-
DIMGAP: number;
|
|
227
|
-
DIMCLRD: number;
|
|
228
|
-
DIMCLRT: number;
|
|
229
|
-
DIMLFAC: number;
|
|
230
|
-
DIMDEC: string;
|
|
231
|
-
DIMLDRBLK: string;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Dim style table definition
|
|
235
|
-
* @hidden
|
|
236
|
-
*/
|
|
237
|
-
export interface IDimStyleTableDefinition {
|
|
238
|
-
dxfSymbolName: "DIMSTYLE";
|
|
239
|
-
parseTableRecords(): Record<string, IDimStyle>;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Table definitions.
|
|
243
|
-
* @hidden
|
|
244
|
-
*/
|
|
245
|
-
export interface ITableDefinitions {
|
|
246
|
-
VPORT: IViewportTableDefinition;
|
|
247
|
-
LTYPE: ILineTypeTableDefinition;
|
|
248
|
-
LAYER: ILayerTableDefinition;
|
|
249
|
-
BLOCK_RECORD: IBlockRecordTableDefinition;
|
|
250
|
-
STYLE: IStyleTableDefinition;
|
|
251
|
-
DIMSTYLE: IDimStyleTableDefinition;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Base table
|
|
255
|
-
* @hidden
|
|
256
|
-
*/
|
|
257
|
-
export interface IBaseTable {
|
|
258
|
-
handle: string;
|
|
259
|
-
ownerHandle: string;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Viewport table
|
|
263
|
-
* @hidden
|
|
264
|
-
*/
|
|
265
|
-
export interface IViewportTable extends IBaseTable {
|
|
266
|
-
entries: IViewport[];
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* @hidden
|
|
270
|
-
*/
|
|
271
|
-
export interface ILayerTypesTable extends IBaseTable {
|
|
272
|
-
entries: Record<string, ILineType>;
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* @hidden
|
|
276
|
-
*/
|
|
277
|
-
export interface ILayersTable extends IBaseTable {
|
|
278
|
-
entries: Record<string, ILayer>;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* @hidden
|
|
282
|
-
*/
|
|
283
|
-
export interface IStylesTable extends IBaseTable {
|
|
284
|
-
entries: Record<string, IStyle>;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* @hidden
|
|
288
|
-
*/
|
|
289
|
-
export interface IDimStyleTable extends IBaseTable {
|
|
290
|
-
entries: Record<string, IDimStyle>;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Block records table containing metadata for all blocks defined in the DXF file.
|
|
294
|
-
* Each block record provides information about a block, including:
|
|
295
|
-
* - Block name and handle
|
|
296
|
-
* - Associated layout handle (for model space and paper space blocks)
|
|
297
|
-
* - Block insertion units, explodability, and scalability
|
|
298
|
-
* - Preview bitmap (if available)
|
|
299
|
-
*
|
|
300
|
-
* Block records are used to link blocks with their corresponding layouts and provide
|
|
301
|
-
* additional metadata beyond what is stored in the blocks themselves.
|
|
302
|
-
*
|
|
303
|
-
* @hidden
|
|
304
|
-
*/
|
|
305
|
-
export interface IBlockRecordsTable extends IBaseTable {
|
|
306
|
-
/**
|
|
307
|
-
* Block record entries, keyed by block record handle (hex string).
|
|
308
|
-
* Each entry corresponds to a block definition in the DXF file.
|
|
309
|
-
*/
|
|
310
|
-
entries: Record<string, IBlockRecord>;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Collection of all DXF tables.
|
|
314
|
-
* DXF tables are used to define named resources that can be referenced by entities.
|
|
315
|
-
* Each table contains entries that define reusable objects with specific properties.
|
|
316
|
-
* @hidden
|
|
317
|
-
*/
|
|
318
|
-
export interface ITables {
|
|
319
|
-
/**
|
|
320
|
-
* Viewport table containing viewport configurations.
|
|
321
|
-
* Viewports define how the drawing is displayed, including view direction,
|
|
322
|
-
* zoom level, and clipping planes.
|
|
323
|
-
*/
|
|
324
|
-
VPORT: IViewportTable;
|
|
325
|
-
/**
|
|
326
|
-
* Linetype table containing line pattern definitions.
|
|
327
|
-
* Linetypes define how lines are drawn (solid, dashed, dotted, etc.).
|
|
328
|
-
* Common linetypes include "CONTINUOUS", "DASHED", "DOTTED", and custom patterns.
|
|
329
|
-
*/
|
|
330
|
-
LTYPE: ILayerTypesTable;
|
|
331
|
-
/**
|
|
332
|
-
* Layer table containing layer definitions.
|
|
333
|
-
* Layers organize entities and control their visibility, color, linetype, and other properties.
|
|
334
|
-
* Every entity in a DXF file belongs to a layer.
|
|
335
|
-
*/
|
|
336
|
-
LAYER: ILayersTable;
|
|
337
|
-
/**
|
|
338
|
-
* Block records table containing block metadata.
|
|
339
|
-
* Block records provide information about blocks and link them to layouts.
|
|
340
|
-
* This table is essential for understanding the relationship between blocks and layouts.
|
|
341
|
-
*/
|
|
342
|
-
BLOCK_RECORD: IBlockRecordsTable;
|
|
343
|
-
/**
|
|
344
|
-
* Text style table containing font and text formatting definitions.
|
|
345
|
-
* Text styles define how text entities are displayed, including font file,
|
|
346
|
-
* height, width factor, and rotation.
|
|
347
|
-
*/
|
|
348
|
-
STYLE: IStylesTable;
|
|
349
|
-
/**
|
|
350
|
-
* Dimension style table containing dimension formatting definitions.
|
|
351
|
-
* Dimension styles control how dimensions are displayed, including arrow types,
|
|
352
|
-
* text placement, precision, and colors.
|
|
353
|
-
*/
|
|
354
|
-
DIMSTYLE: IDimStyleTable;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Collection of all DXF objects.
|
|
358
|
-
* Provides typed access to common object arrays so callers don't need to use string keys like "LAYOUT" or "DICTIONARY".
|
|
359
|
-
* @hidden
|
|
360
|
-
*/
|
|
361
|
-
export interface IObjects {
|
|
362
|
-
LAYOUT?: ILayoutObject[];
|
|
363
|
-
DICTIONARY?: IDictionaryObject[];
|
|
364
|
-
IMAGEDEF?: IImageDefObject[];
|
|
365
|
-
SORTENTSTABLE?: ISortEntsTableObject[];
|
|
366
|
-
SPATIAL_FILTER?: ISpatialFilterObject[];
|
|
367
|
-
XRECORD?: IXRecord[];
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Union type representing any DXF table.
|
|
371
|
-
* This type can be used when a function or method needs to accept any table type
|
|
372
|
-
* without being specific about which table it is.
|
|
373
|
-
*
|
|
374
|
-
* @hidden
|
|
375
|
-
*/
|
|
376
|
-
export type ITable = IViewportTable | ILayerTypesTable | ILayersTable | IBlockRecordsTable | IStylesTable | IDimStyleTable;
|
|
377
|
-
/**
|
|
378
|
-
* Represents the complete structure of a DXF (Drawing Exchange Format) file.
|
|
379
|
-
* A DXF file is organized into several sections: HEADER, ENTITIES, BLOCKS, TABLES, OBJECTS, and CLASSES.
|
|
380
|
-
*
|
|
381
|
-
* @hidden
|
|
382
|
-
*/
|
|
383
|
-
export interface IDxf {
|
|
384
|
-
/**
|
|
385
|
-
* Header section containing system variables.
|
|
386
|
-
* These variables control various drawing settings such as:
|
|
387
|
-
* - `$ACADVER`: AutoCAD version (e.g., "AC1032" for AutoCAD 2018)
|
|
388
|
-
* - `$CLAYER`: Current layer name
|
|
389
|
-
* - `$LTSCALE`: Global linetype scale
|
|
390
|
-
* - `$INSUNITS`: Units for insertion
|
|
391
|
-
* - And many other system variables
|
|
392
|
-
* Values can be points (IPoint), numbers, or strings.
|
|
393
|
-
*/
|
|
394
|
-
header: Record<string, IPoint | number | string>;
|
|
395
|
-
/**
|
|
396
|
-
* Entities section containing all drawing entities.
|
|
397
|
-
* This includes geometric objects such as:
|
|
398
|
-
* - Lines, arcs, circles, ellipses
|
|
399
|
-
* - Polylines, splines, hatches
|
|
400
|
-
* - Text, dimensions, leaders
|
|
401
|
-
* - Blocks (inserts), images, viewports
|
|
402
|
-
* - And other entity types
|
|
403
|
-
* Note that, it should include entities in model space and paper space.
|
|
404
|
-
* But it should not include entities in blocks.
|
|
405
|
-
*/
|
|
406
|
-
entities: IEntity[];
|
|
407
|
-
/**
|
|
408
|
-
* Blocks section containing block definitions.
|
|
409
|
-
* The key is the block name (e.g., "*Model_Space", "*Paper_Space", or user-defined block names).
|
|
410
|
-
* Each block contains a collection of entities that can be inserted multiple times via INSERT entities.
|
|
411
|
-
* Blocks can represent:
|
|
412
|
-
* - Model space and paper space definitions
|
|
413
|
-
* - User-defined reusable components
|
|
414
|
-
* - Dimension blocks
|
|
415
|
-
*/
|
|
416
|
-
blocks: Record<string, IBlock>;
|
|
417
|
-
/**
|
|
418
|
-
* Tables section containing various DXF tables.
|
|
419
|
-
* Includes:
|
|
420
|
-
* - `VPORT`: Viewport table (view configurations)
|
|
421
|
-
* - `LTYPE`: Linetype table (line pattern definitions)
|
|
422
|
-
* - `LAYER`: Layer table (layer definitions with properties)
|
|
423
|
-
* - `BLOCK_RECORD`: Block record table (block metadata)
|
|
424
|
-
* - `STYLE`: Text style table (font and text formatting)
|
|
425
|
-
* - `DIMSTYLE`: Dimension style table (dimension formatting)
|
|
426
|
-
*/
|
|
427
|
-
tables: ITables;
|
|
428
|
-
/**
|
|
429
|
-
* Objects section containing non-graphical objects.
|
|
430
|
-
* The key is the object type name (e.g., "LAYOUT", "DICTIONARY", "XRECORD").
|
|
431
|
-
* Common object types include:
|
|
432
|
-
* - `LAYOUT`: Layout definitions (Model space and paper space layouts)
|
|
433
|
-
* - `DICTIONARY`: Named object dictionaries
|
|
434
|
-
* - `XRECORD`: Extended record objects
|
|
435
|
-
* - `MATERIAL`: Material definitions
|
|
436
|
-
* - And other application-specific objects
|
|
437
|
-
*/
|
|
438
|
-
objects: IObjects;
|
|
439
|
-
/**
|
|
440
|
-
* Classes section containing application-defined class definitions.
|
|
441
|
-
* Classes define custom entity types or objects that may be used by specific applications.
|
|
442
|
-
* Each class entry describes:
|
|
443
|
-
* - Application name
|
|
444
|
-
* - Class name and C++ class name
|
|
445
|
-
* - DXF name
|
|
446
|
-
* - Capabilities and proxy information
|
|
447
|
-
*/
|
|
448
|
-
classes: IClass[];
|
|
449
|
-
}
|
|
450
42
|
export default class DxfParser {
|
|
451
43
|
constructor(encoding?: string);
|
|
452
44
|
parse(source: string | ArrayBuffer): IDxf | undefined;
|
|
@@ -457,17 +49,4 @@ export default class DxfParser {
|
|
|
457
49
|
parseAsync(source: string | ArrayBuffer): Promise<IDxf | undefined>;
|
|
458
50
|
registerEntityHandler(handlerType: new () => IGeometry): void;
|
|
459
51
|
registerObjectHandler(handlerType: new () => IObjectParser): void;
|
|
460
|
-
/**
|
|
461
|
-
* Loads libredwg if needed, then returns raw convertEx() output plus version/codepage.
|
|
462
|
-
* Used by dwg_json_viewer and debugging tools.
|
|
463
|
-
*/
|
|
464
|
-
libredwgConvertExAsync(data: ArrayBuffer): Promise<{
|
|
465
|
-
version: string;
|
|
466
|
-
codepage: string;
|
|
467
|
-
database: DwgDatabase;
|
|
468
|
-
stats: {
|
|
469
|
-
unknownEntityCount: number;
|
|
470
|
-
};
|
|
471
|
-
} | undefined>;
|
|
472
|
-
private parseDwgDb;
|
|
473
52
|
}
|
|
@@ -37,6 +37,11 @@ export declare class Model3d extends Model {
|
|
|
37
37
|
* Gets the THREE.Object3D of this model.
|
|
38
38
|
*/
|
|
39
39
|
getModelObject(): THREE.Object3D;
|
|
40
|
+
/**
|
|
41
|
+
* Clears cached bounds so the next {@link getBBox} recomputes from the scene graph
|
|
42
|
+
* (e.g. after transform gizmo edits).
|
|
43
|
+
*/
|
|
44
|
+
invalidateBBox(): void;
|
|
40
45
|
/**
|
|
41
46
|
* Gets the bounding box of this model.
|
|
42
47
|
*/
|
|
@@ -12,5 +12,14 @@ export declare class TextureUtils {
|
|
|
12
12
|
* Creates default environment texture
|
|
13
13
|
*/
|
|
14
14
|
static createEnvTextureFromDataArray(pmremGenerator: THREE.PMREMGenerator | undefined, data?: Uint16Array, width?: number, height?: number): Promise<THREE.Texture>;
|
|
15
|
+
private static readonly MISSING_MAP_KEYS;
|
|
16
|
+
private static fallbackGrayMaterial?;
|
|
17
|
+
private static getFallbackGrayMaterial;
|
|
18
|
+
/**
|
|
19
|
+
* If any 2D map on a mesh material failed to load, replace the whole material with a shared gray MeshStandardMaterial.
|
|
20
|
+
*/
|
|
21
|
+
static replaceBrokenMaterialMaps(root: THREE.Object3D): void;
|
|
22
|
+
private static materialHasBroken2DMap;
|
|
23
|
+
private static isTextureImageInvalid;
|
|
15
24
|
private static readonly HDR_CITY_STREET_64x32;
|
|
16
25
|
}
|
|
@@ -3,17 +3,16 @@ import { CSS2DRenderer } from "three/examples/jsm/renderers/CSS2DRenderer.js";
|
|
|
3
3
|
import { ViewerName } from "./Constants";
|
|
4
4
|
import type { Plugin } from "./Plugin";
|
|
5
5
|
import { ViewerEvent } from "./ViewerEvent";
|
|
6
|
-
import {
|
|
6
|
+
import { Spinner } from "../components";
|
|
7
7
|
import { BaseViewerConfig, CameraInfo, CameraProjection, ModelConfig, Viewpoint } from "../../core/Configs";
|
|
8
8
|
import { CameraManager } from "../../core/camera";
|
|
9
9
|
import { CanvasRender } from "../../core/canvas";
|
|
10
10
|
import { Container } from "../../core/components/Container";
|
|
11
11
|
import { EffectManager } from "../../core/effect";
|
|
12
12
|
import { FontManager } from "../../core/font";
|
|
13
|
-
import { ZoomToRectHelper } from "../../core/helpers";
|
|
14
13
|
import { InputManager } from "../../core/input-manager";
|
|
15
14
|
import { Interaction } from "../../core/interactions/Interaction";
|
|
16
|
-
import { BaseModelLoader
|
|
15
|
+
import { BaseModelLoader } from "../../core/loaders";
|
|
17
16
|
import { Model } from "../../core/model";
|
|
18
17
|
import { PickManager } from "../../core/pick";
|
|
19
18
|
import { SceneManager } from "../../core/scene/SceneManager";
|
|
@@ -24,30 +23,12 @@ type ViewerEvents = {
|
|
|
24
23
|
};
|
|
25
24
|
export declare abstract class BaseViewer<BaseViewerEvents extends ViewerEvents = Record<ViewerEvent, any>> extends Event<BaseViewerEvents> {
|
|
26
25
|
name: ViewerName;
|
|
27
|
-
|
|
28
|
-
protected targetMaxFps: number;
|
|
29
|
-
protected timeStamp: number;
|
|
26
|
+
container: Container;
|
|
30
27
|
/**
|
|
31
|
-
*
|
|
28
|
+
* A map to store model file and id.
|
|
32
29
|
*/
|
|
33
|
-
protected requestAnimationFrameHandle?: number;
|
|
34
|
-
container: Container;
|
|
35
|
-
protected plugins: Plugin[];
|
|
36
30
|
loadedModels: Model[];
|
|
37
|
-
protected homeView?: Viewpoint;
|
|
38
31
|
protected inputManager: InputManager;
|
|
39
|
-
protected cameraManager: CameraManager;
|
|
40
|
-
protected sceneManager: SceneManager;
|
|
41
|
-
protected fontManager?: FontManager;
|
|
42
|
-
protected pickManager: PickManager;
|
|
43
|
-
protected undoManager: UndoManager;
|
|
44
|
-
protected overlayRender: CanvasRender;
|
|
45
|
-
protected css2dRenderer: CSS2DRenderer;
|
|
46
|
-
protected spinner: Spinner;
|
|
47
|
-
protected progressBar?: ProgressBar;
|
|
48
|
-
protected loaderManager: ModelLoaderManager;
|
|
49
|
-
protected zoomToRectHelper?: ZoomToRectHelper;
|
|
50
|
-
protected interaction?: Interaction;
|
|
51
32
|
/**
|
|
52
33
|
* Enables selecting an object
|
|
53
34
|
*/
|
|
@@ -86,11 +67,6 @@ export declare abstract class BaseViewer<BaseViewerEvents extends ViewerEvents =
|
|
|
86
67
|
abstract clearHighlight(): void;
|
|
87
68
|
getRaycaster(): THREE.Raycaster;
|
|
88
69
|
getPickManager(): PickManager;
|
|
89
|
-
/**
|
|
90
|
-
* Post-processing (GLSL watermark, optional FXAA/SSAO, …). Shared by 2D and 3D viewers.
|
|
91
|
-
* Created on first access so construction never runs before {@link BaseViewer.cameraManager} exists.
|
|
92
|
-
*/
|
|
93
|
-
protected get effect(): EffectManager;
|
|
94
70
|
/** Visual effects / composer (same instance as {@link BaseViewer.effect}). */
|
|
95
71
|
get effectManager(): EffectManager;
|
|
96
72
|
getViewerConfig(): BaseViewerConfig;
|
|
@@ -107,13 +83,7 @@ export declare abstract class BaseViewer<BaseViewerEvents extends ViewerEvents =
|
|
|
107
83
|
* @hidden
|
|
108
84
|
*/
|
|
109
85
|
enableRender: (time?: number) => void;
|
|
110
|
-
protected animate(timeStamp?: number): void;
|
|
111
86
|
resize(): void;
|
|
112
|
-
/**
|
|
113
|
-
* @deprecated use GltfLoader.setDracoDecoderPath instead
|
|
114
|
-
* @hidden
|
|
115
|
-
*/
|
|
116
|
-
setDracoDecoderPath(path: string): void;
|
|
117
87
|
abstract loadModel(modelCfg: ModelConfig, onProgress?: (event: ProgressEvent) => void): Promise<void>;
|
|
118
88
|
addModel(model: Model): void;
|
|
119
89
|
removeModelById(modelId: string): void;
|
|
@@ -139,14 +109,6 @@ export declare abstract class BaseViewer<BaseViewerEvents extends ViewerEvents =
|
|
|
139
109
|
* ```
|
|
140
110
|
*/
|
|
141
111
|
zoomToRect(): void;
|
|
142
|
-
/**
|
|
143
|
-
* @hidden
|
|
144
|
-
*/
|
|
145
|
-
deactivateZoomRect(): void;
|
|
146
|
-
/**
|
|
147
|
-
* Gets an unique modelId in case the expected id is duplicated.
|
|
148
|
-
*/
|
|
149
|
-
protected getUniqueModelId(expectedModelId: string): string;
|
|
150
112
|
/**
|
|
151
113
|
* Gets all objects' bounding box.
|
|
152
114
|
*/
|
|
@@ -53,6 +53,8 @@ export declare class BimTilesViewer extends BaseViewer {
|
|
|
53
53
|
setDoubleSidedMaterials(): void;
|
|
54
54
|
revertDoubleSidedMaterials(): void;
|
|
55
55
|
clearSelection(): void;
|
|
56
|
+
/** True when the user has an active tile pick selection (independent of the current cursor hit). */
|
|
57
|
+
hasSelectedObject(): boolean;
|
|
56
58
|
/**
|
|
57
59
|
* Gets if selection is enabled.
|
|
58
60
|
*/
|
|
@@ -112,6 +114,11 @@ export declare class BimTilesViewer extends BaseViewer {
|
|
|
112
114
|
* First get the object through the gpu, and then get the specific intersection point
|
|
113
115
|
*/
|
|
114
116
|
pickObjects(mousePosition: THREE.Vector2, layerChannels?: number[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[];
|
|
117
|
+
/**
|
|
118
|
+
* GPU pick on the BimTiles compositing pass (same as pointer interaction). Call before reading picking buffer.
|
|
119
|
+
* @returns `{ tilesetId, userId }` when a tile was hit, otherwise `undefined`.
|
|
120
|
+
*/
|
|
121
|
+
pickTileObject(mousePosition: THREE.Vector2): TileObject | undefined;
|
|
115
122
|
/**
|
|
116
123
|
* `errorTarget` refers to The target screenspace error in pixels to target when updating the geometry.
|
|
117
124
|
* It represents the maximum acceptable error in pixels for the tiles' geometry.
|
|
@@ -3,7 +3,6 @@ import { BaseViewer } from "./BaseViewer";
|
|
|
3
3
|
import { ViewerName } from "./Constants";
|
|
4
4
|
import { Model2dConfig, Viewer2dConfig } from "../../core/Configs";
|
|
5
5
|
import { DxfData, DxfLayer } from "../../core/dxf";
|
|
6
|
-
import { EventInfo } from "../../core/input-manager/InputManager";
|
|
7
6
|
import { Model2d } from "../../core/model";
|
|
8
7
|
export interface EntityData {
|
|
9
8
|
modelId: string;
|
|
@@ -157,10 +156,6 @@ export declare const GroundPlaneRenderOrder = -1000;
|
|
|
157
156
|
export declare class Viewer2d extends BaseViewer {
|
|
158
157
|
name: ViewerName;
|
|
159
158
|
loadedModels: Model2d[];
|
|
160
|
-
/**
|
|
161
|
-
* @hidden
|
|
162
|
-
*/
|
|
163
|
-
masterModelId: string;
|
|
164
159
|
groundPlane?: THREE.Mesh;
|
|
165
160
|
raycastableObjects?: THREE.Object3D[];
|
|
166
161
|
constructor(viewerCfg: Viewer2dConfig);
|
|
@@ -260,21 +255,6 @@ export declare class Viewer2d extends BaseViewer {
|
|
|
260
255
|
* Upper right coordinate: (1, 1)
|
|
261
256
|
*/
|
|
262
257
|
protected getHitResultByNdcCoordinate(coord: THREE.Vector2): THREE.Vector2 | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* Gets mouse hit result in world coordinate
|
|
265
|
-
* @example
|
|
266
|
-
* ``` typescript
|
|
267
|
-
* document.addEventListener("click", (event) => {
|
|
268
|
-
* const result = viewer.getHitResult(event);
|
|
269
|
-
* const loc = result?.location;
|
|
270
|
-
* if (loc) {
|
|
271
|
-
* console.log(`Clicked at x: ${loc[0]}, y: ${loc[1]}`);
|
|
272
|
-
* }
|
|
273
|
-
* });
|
|
274
|
-
* ```
|
|
275
|
-
* @hidden
|
|
276
|
-
*/
|
|
277
|
-
getHitResult(event: MouseEvent | PointerEvent | EventInfo): THREE.Vector2 | undefined;
|
|
278
258
|
/**
|
|
279
259
|
* Returns the active layout name, or undefined if none.
|
|
280
260
|
* @example
|
|
@@ -299,12 +279,6 @@ export declare class Viewer2d extends BaseViewer {
|
|
|
299
279
|
* ```
|
|
300
280
|
*/
|
|
301
281
|
getLayers(): (DxfLayers | PdfLayers)[];
|
|
302
|
-
/**
|
|
303
|
-
* Sets model's (aka, a dxf file) visibility.
|
|
304
|
-
* @throws Throws exception if modelId doesn't exist.
|
|
305
|
-
* @hidden
|
|
306
|
-
*/
|
|
307
|
-
setModelVisibility(modelId: string, visible: boolean): void;
|
|
308
282
|
/**
|
|
309
283
|
* Sets visibility of a layer by name.
|
|
310
284
|
* @param layerName Layer to show or hide.
|
|
@@ -318,22 +292,6 @@ export declare class Viewer2d extends BaseViewer {
|
|
|
318
292
|
* ```
|
|
319
293
|
*/
|
|
320
294
|
setLayerVisibility(layerName: string, visible: boolean, modelId?: string): void;
|
|
321
|
-
/**
|
|
322
|
-
* Sets layer's opacity
|
|
323
|
-
* @hidden
|
|
324
|
-
*/
|
|
325
|
-
setLayerOpacity(layerName: string, opacity: number, modelId?: string): void;
|
|
326
|
-
/**
|
|
327
|
-
* Sets layer's color
|
|
328
|
-
* @throws Throws exception if layer doesn't exist.
|
|
329
|
-
* @hidden
|
|
330
|
-
*/
|
|
331
|
-
setLayerColor(layerName: string, color: number, modelId?: string): void;
|
|
332
|
-
/**
|
|
333
|
-
* Resets a layer's color.
|
|
334
|
-
* @hidden
|
|
335
|
-
*/
|
|
336
|
-
resetLayerColor(layerName: string, modelId?: string): void;
|
|
337
295
|
/**
|
|
338
296
|
* Enables small feature culling in order to improve performance.
|
|
339
297
|
*/
|