@cadview/core 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -3
- package/dist/index.cjs +422 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +133 -3
- package/dist/index.d.ts +133 -3
- package/dist/index.js +422 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -301,6 +301,50 @@ interface ThemeConfig {
|
|
|
301
301
|
}
|
|
302
302
|
declare const THEMES: Record<Theme, ThemeConfig>;
|
|
303
303
|
|
|
304
|
+
interface RenderStats {
|
|
305
|
+
entitiesDrawn: number;
|
|
306
|
+
entitiesSkipped: number;
|
|
307
|
+
drawCalls: number;
|
|
308
|
+
byType: Record<string, number>;
|
|
309
|
+
}
|
|
310
|
+
interface DebugOptions {
|
|
311
|
+
showFps?: boolean;
|
|
312
|
+
showRenderStats?: boolean;
|
|
313
|
+
showDocumentInfo?: boolean;
|
|
314
|
+
showTimings?: boolean;
|
|
315
|
+
showCamera?: boolean;
|
|
316
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
317
|
+
}
|
|
318
|
+
interface DebugStats {
|
|
319
|
+
fps: number;
|
|
320
|
+
frameTime: number;
|
|
321
|
+
renderStats: RenderStats;
|
|
322
|
+
entityCount: number;
|
|
323
|
+
layerCount: number;
|
|
324
|
+
visibleLayerCount: number;
|
|
325
|
+
blockCount: number;
|
|
326
|
+
parseTime: number;
|
|
327
|
+
spatialIndexBuildTime: number;
|
|
328
|
+
totalLoadTime: number;
|
|
329
|
+
zoom: number;
|
|
330
|
+
pixelSize: number;
|
|
331
|
+
viewportBounds: {
|
|
332
|
+
minX: number;
|
|
333
|
+
minY: number;
|
|
334
|
+
maxX: number;
|
|
335
|
+
maxY: number;
|
|
336
|
+
};
|
|
337
|
+
fileName: string | null;
|
|
338
|
+
fileSize: number;
|
|
339
|
+
dxfVersion: string | null;
|
|
340
|
+
}
|
|
341
|
+
type ResolvedDebugOptions = Required<DebugOptions>;
|
|
342
|
+
/**
|
|
343
|
+
* Render a debug overlay panel on the canvas in screen space.
|
|
344
|
+
* Follows the same pattern as renderMeasureOverlay — resets transform to screen space.
|
|
345
|
+
*/
|
|
346
|
+
declare function renderDebugOverlay(ctx: CanvasRenderingContext2D, stats: DebugStats, theme: Theme, options: ResolvedDebugOptions, canvasWidth: number, canvasHeight: number): void;
|
|
347
|
+
|
|
304
348
|
/**
|
|
305
349
|
* Resolve the display color for an entity.
|
|
306
350
|
*
|
|
@@ -325,12 +369,12 @@ declare class CanvasRenderer {
|
|
|
325
369
|
getWidth(): number;
|
|
326
370
|
getHeight(): number;
|
|
327
371
|
updateSize(): void;
|
|
328
|
-
render(doc: DxfDocument, vt: ViewTransform, theme: Theme, visibleLayers: Set<string>, selectedEntityIndex: number):
|
|
372
|
+
render(doc: DxfDocument, vt: ViewTransform, theme: Theme, visibleLayers: Set<string>, selectedEntityIndex: number): RenderStats;
|
|
329
373
|
renderEmpty(theme: Theme): void;
|
|
330
374
|
destroy(): void;
|
|
331
375
|
}
|
|
332
376
|
|
|
333
|
-
declare function drawEntity(ctx: CanvasRenderingContext2D, entity: DxfEntity, doc: DxfDocument, vt: ViewTransform, theme: Theme, pixelSize: number): void;
|
|
377
|
+
declare function drawEntity(ctx: CanvasRenderingContext2D, entity: DxfEntity, doc: DxfDocument, vt: ViewTransform, theme: Theme, pixelSize: number, stats?: RenderStats): void;
|
|
334
378
|
|
|
335
379
|
interface SelectEvent {
|
|
336
380
|
entity: DxfEntity;
|
|
@@ -359,6 +403,24 @@ declare class EventEmitter<T extends Record<string, any> = Record<string, any>>
|
|
|
359
403
|
}
|
|
360
404
|
|
|
361
405
|
type Tool = 'pan' | 'select' | 'measure';
|
|
406
|
+
/**
|
|
407
|
+
* Interface for registering custom file format converters.
|
|
408
|
+
* Converters are checked in order during `loadFile()` and `loadBuffer()`.
|
|
409
|
+
* The first converter whose `detect()` returns true will be used.
|
|
410
|
+
*/
|
|
411
|
+
interface FormatConverter {
|
|
412
|
+
/**
|
|
413
|
+
* Return true if the buffer is in this format.
|
|
414
|
+
* Implementations should check magic bytes, not file extensions.
|
|
415
|
+
* Must not throw — return false on any error.
|
|
416
|
+
*/
|
|
417
|
+
detect(buffer: ArrayBuffer): boolean;
|
|
418
|
+
/**
|
|
419
|
+
* Convert the buffer to a DXF string.
|
|
420
|
+
* The returned string must be valid DXF parseable by `parseDxf()`.
|
|
421
|
+
*/
|
|
422
|
+
convert(buffer: ArrayBuffer): Promise<string>;
|
|
423
|
+
}
|
|
362
424
|
interface CadViewerOptions {
|
|
363
425
|
theme?: Theme;
|
|
364
426
|
backgroundColor?: string;
|
|
@@ -367,6 +429,13 @@ interface CadViewerOptions {
|
|
|
367
429
|
maxZoom?: number;
|
|
368
430
|
zoomSpeed?: number;
|
|
369
431
|
initialTool?: Tool;
|
|
432
|
+
/** Format converters for non-DXF file formats (e.g. DWG via @cadview/dwg). */
|
|
433
|
+
formatConverters?: FormatConverter[];
|
|
434
|
+
/**
|
|
435
|
+
* Enable a debug overlay showing FPS, render stats, document info, timing, and camera data.
|
|
436
|
+
* Pass `true` for defaults, or an object for granular control.
|
|
437
|
+
*/
|
|
438
|
+
debug?: boolean | DebugOptions;
|
|
370
439
|
}
|
|
371
440
|
declare class CadViewer {
|
|
372
441
|
private canvas;
|
|
@@ -381,14 +450,62 @@ declare class CadViewer {
|
|
|
381
450
|
private currentTool;
|
|
382
451
|
private inputHandler;
|
|
383
452
|
private resizeObserver;
|
|
453
|
+
private formatConverters;
|
|
384
454
|
private selectedEntityIndex;
|
|
385
455
|
private renderPending;
|
|
386
456
|
private destroyed;
|
|
457
|
+
private loadGeneration;
|
|
387
458
|
private mouseScreenX;
|
|
388
459
|
private mouseScreenY;
|
|
460
|
+
private debugEnabled;
|
|
461
|
+
private debugOptions;
|
|
462
|
+
private lastRenderStats;
|
|
463
|
+
private lastDebugStats;
|
|
464
|
+
private frameTimestamps;
|
|
465
|
+
private lastDoRenderTime;
|
|
466
|
+
private lastFrameTime;
|
|
467
|
+
private parseTime;
|
|
468
|
+
private spatialIndexBuildTime;
|
|
469
|
+
private loadedFileName;
|
|
470
|
+
private loadedFileSize;
|
|
471
|
+
private debugRafId;
|
|
389
472
|
constructor(canvas: HTMLCanvasElement, options?: CadViewerOptions);
|
|
473
|
+
/**
|
|
474
|
+
* Throws if the viewer has been destroyed.
|
|
475
|
+
* Call at the start of any public method that mutates state.
|
|
476
|
+
*/
|
|
477
|
+
private guardDestroyed;
|
|
478
|
+
/**
|
|
479
|
+
* Run registered format converters on a buffer.
|
|
480
|
+
* Returns the converted DXF string if a converter matched, or null otherwise.
|
|
481
|
+
* Each converter's detect() is wrapped in try/catch — a throwing detect() is skipped.
|
|
482
|
+
*/
|
|
483
|
+
private runConverters;
|
|
484
|
+
/**
|
|
485
|
+
* Load a CAD file from a browser File object.
|
|
486
|
+
* Automatically detects the format using registered converters (e.g. DWG).
|
|
487
|
+
* Falls back to DXF parsing if no converter matches.
|
|
488
|
+
*/
|
|
390
489
|
loadFile(file: File): Promise<void>;
|
|
490
|
+
/**
|
|
491
|
+
* Load a CAD file from an ArrayBuffer with format converter support.
|
|
492
|
+
* Unlike `loadArrayBuffer()` (sync, DXF-only), this method is async and
|
|
493
|
+
* checks registered FormatConverters for non-DXF formats.
|
|
494
|
+
*/
|
|
495
|
+
loadBuffer(buffer: ArrayBuffer): Promise<void>;
|
|
496
|
+
/**
|
|
497
|
+
* Load a pre-parsed DxfDocument directly, bypassing the parser.
|
|
498
|
+
* Useful for custom parsers or pre-processed documents.
|
|
499
|
+
*/
|
|
500
|
+
loadDocument(doc: DxfDocument): void;
|
|
501
|
+
/**
|
|
502
|
+
* Load a DXF string directly (synchronous, no format conversion).
|
|
503
|
+
*/
|
|
391
504
|
loadString(dxf: string): void;
|
|
505
|
+
/**
|
|
506
|
+
* Load a DXF file from an ArrayBuffer (synchronous, no format conversion).
|
|
507
|
+
* For format conversion support (e.g. DWG), use `loadFile()` or `loadBuffer()` instead.
|
|
508
|
+
*/
|
|
392
509
|
loadArrayBuffer(buffer: ArrayBuffer): void;
|
|
393
510
|
/**
|
|
394
511
|
* Clear the current document and reset all state without destroying the viewer.
|
|
@@ -419,6 +536,19 @@ declare class CadViewer {
|
|
|
419
536
|
/** @internal */
|
|
420
537
|
requestRender(): void;
|
|
421
538
|
private doRender;
|
|
539
|
+
/**
|
|
540
|
+
* Enable or disable the debug overlay.
|
|
541
|
+
* Pass `true` for defaults, `false` to disable, or an object for granular control.
|
|
542
|
+
*/
|
|
543
|
+
setDebug(debug: boolean | DebugOptions): void;
|
|
544
|
+
private startDebugLoop;
|
|
545
|
+
private stopDebugLoop;
|
|
546
|
+
/**
|
|
547
|
+
* Get the latest debug stats snapshot, or null if debug mode is off.
|
|
548
|
+
*/
|
|
549
|
+
getDebugStats(): DebugStats | null;
|
|
550
|
+
private buildDebugStats;
|
|
551
|
+
private computeViewportBounds;
|
|
422
552
|
/** @internal */
|
|
423
553
|
handlePan(dx: number, dy: number): void;
|
|
424
554
|
/** @internal */
|
|
@@ -507,4 +637,4 @@ interface BBox {
|
|
|
507
637
|
declare function computeEntitiesBounds(entities: DxfEntity[]): BBox | null;
|
|
508
638
|
declare function computeEntityBBox(entity: DxfEntity): BBox | null;
|
|
509
639
|
|
|
510
|
-
export { type BBox, CadViewer, type CadViewerEventMap, type CadViewerOptions, Camera, CanvasRenderer, type DxfArcEntity, type DxfAttrib, type DxfBlock, type DxfCircleEntity, type DxfDimensionEntity, type DxfDocument, type DxfEllipseEntity, type DxfEntity, type DxfEntityBase, type DxfHatchBoundaryPath, type DxfHatchEdge, type DxfHatchEntity, type DxfHeader, type DxfInsertEntity, type DxfLayer, type DxfLineEntity, type DxfLineType, type DxfLwPolylineEntity, type DxfLwPolylineVertex, type DxfMTextEntity, DxfParseError, type DxfPointEntity, type DxfPolylineEntity, type DxfSplineEntity, type DxfStyle, type DxfTextEntity, EventEmitter, LayerManager, type MeasureEvent, type MeasureState, MeasureTool, type Point2D, type Point3D, type SelectEvent, type SnapResult, type SnapType, SpatialIndex, THEMES, type Theme, type ThemeConfig, type Tool, type ViewTransform, aciToDisplayColor, aciToHex, applyTransform, computeEntitiesBounds, computeEntityBBox, drawEntity, findSnaps, fitToView, hitTest, parseDxf, renderMeasureOverlay, resolveEntityColor, screenToWorld, trueColorToHex, worldToScreen, zoomAtPoint };
|
|
640
|
+
export { type BBox, CadViewer, type CadViewerEventMap, type CadViewerOptions, Camera, CanvasRenderer, type DebugOptions, type DebugStats, type DxfArcEntity, type DxfAttrib, type DxfBlock, type DxfCircleEntity, type DxfDimensionEntity, type DxfDocument, type DxfEllipseEntity, type DxfEntity, type DxfEntityBase, type DxfHatchBoundaryPath, type DxfHatchEdge, type DxfHatchEntity, type DxfHeader, type DxfInsertEntity, type DxfLayer, type DxfLineEntity, type DxfLineType, type DxfLwPolylineEntity, type DxfLwPolylineVertex, type DxfMTextEntity, DxfParseError, type DxfPointEntity, type DxfPolylineEntity, type DxfSplineEntity, type DxfStyle, type DxfTextEntity, EventEmitter, type FormatConverter, LayerManager, type MeasureEvent, type MeasureState, MeasureTool, type Point2D, type Point3D, type RenderStats, type SelectEvent, type SnapResult, type SnapType, SpatialIndex, THEMES, type Theme, type ThemeConfig, type Tool, type ViewTransform, aciToDisplayColor, aciToHex, applyTransform, computeEntitiesBounds, computeEntityBBox, drawEntity, findSnaps, fitToView, hitTest, parseDxf, renderDebugOverlay, renderMeasureOverlay, resolveEntityColor, screenToWorld, trueColorToHex, worldToScreen, zoomAtPoint };
|
package/dist/index.d.ts
CHANGED
|
@@ -301,6 +301,50 @@ interface ThemeConfig {
|
|
|
301
301
|
}
|
|
302
302
|
declare const THEMES: Record<Theme, ThemeConfig>;
|
|
303
303
|
|
|
304
|
+
interface RenderStats {
|
|
305
|
+
entitiesDrawn: number;
|
|
306
|
+
entitiesSkipped: number;
|
|
307
|
+
drawCalls: number;
|
|
308
|
+
byType: Record<string, number>;
|
|
309
|
+
}
|
|
310
|
+
interface DebugOptions {
|
|
311
|
+
showFps?: boolean;
|
|
312
|
+
showRenderStats?: boolean;
|
|
313
|
+
showDocumentInfo?: boolean;
|
|
314
|
+
showTimings?: boolean;
|
|
315
|
+
showCamera?: boolean;
|
|
316
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
317
|
+
}
|
|
318
|
+
interface DebugStats {
|
|
319
|
+
fps: number;
|
|
320
|
+
frameTime: number;
|
|
321
|
+
renderStats: RenderStats;
|
|
322
|
+
entityCount: number;
|
|
323
|
+
layerCount: number;
|
|
324
|
+
visibleLayerCount: number;
|
|
325
|
+
blockCount: number;
|
|
326
|
+
parseTime: number;
|
|
327
|
+
spatialIndexBuildTime: number;
|
|
328
|
+
totalLoadTime: number;
|
|
329
|
+
zoom: number;
|
|
330
|
+
pixelSize: number;
|
|
331
|
+
viewportBounds: {
|
|
332
|
+
minX: number;
|
|
333
|
+
minY: number;
|
|
334
|
+
maxX: number;
|
|
335
|
+
maxY: number;
|
|
336
|
+
};
|
|
337
|
+
fileName: string | null;
|
|
338
|
+
fileSize: number;
|
|
339
|
+
dxfVersion: string | null;
|
|
340
|
+
}
|
|
341
|
+
type ResolvedDebugOptions = Required<DebugOptions>;
|
|
342
|
+
/**
|
|
343
|
+
* Render a debug overlay panel on the canvas in screen space.
|
|
344
|
+
* Follows the same pattern as renderMeasureOverlay — resets transform to screen space.
|
|
345
|
+
*/
|
|
346
|
+
declare function renderDebugOverlay(ctx: CanvasRenderingContext2D, stats: DebugStats, theme: Theme, options: ResolvedDebugOptions, canvasWidth: number, canvasHeight: number): void;
|
|
347
|
+
|
|
304
348
|
/**
|
|
305
349
|
* Resolve the display color for an entity.
|
|
306
350
|
*
|
|
@@ -325,12 +369,12 @@ declare class CanvasRenderer {
|
|
|
325
369
|
getWidth(): number;
|
|
326
370
|
getHeight(): number;
|
|
327
371
|
updateSize(): void;
|
|
328
|
-
render(doc: DxfDocument, vt: ViewTransform, theme: Theme, visibleLayers: Set<string>, selectedEntityIndex: number):
|
|
372
|
+
render(doc: DxfDocument, vt: ViewTransform, theme: Theme, visibleLayers: Set<string>, selectedEntityIndex: number): RenderStats;
|
|
329
373
|
renderEmpty(theme: Theme): void;
|
|
330
374
|
destroy(): void;
|
|
331
375
|
}
|
|
332
376
|
|
|
333
|
-
declare function drawEntity(ctx: CanvasRenderingContext2D, entity: DxfEntity, doc: DxfDocument, vt: ViewTransform, theme: Theme, pixelSize: number): void;
|
|
377
|
+
declare function drawEntity(ctx: CanvasRenderingContext2D, entity: DxfEntity, doc: DxfDocument, vt: ViewTransform, theme: Theme, pixelSize: number, stats?: RenderStats): void;
|
|
334
378
|
|
|
335
379
|
interface SelectEvent {
|
|
336
380
|
entity: DxfEntity;
|
|
@@ -359,6 +403,24 @@ declare class EventEmitter<T extends Record<string, any> = Record<string, any>>
|
|
|
359
403
|
}
|
|
360
404
|
|
|
361
405
|
type Tool = 'pan' | 'select' | 'measure';
|
|
406
|
+
/**
|
|
407
|
+
* Interface for registering custom file format converters.
|
|
408
|
+
* Converters are checked in order during `loadFile()` and `loadBuffer()`.
|
|
409
|
+
* The first converter whose `detect()` returns true will be used.
|
|
410
|
+
*/
|
|
411
|
+
interface FormatConverter {
|
|
412
|
+
/**
|
|
413
|
+
* Return true if the buffer is in this format.
|
|
414
|
+
* Implementations should check magic bytes, not file extensions.
|
|
415
|
+
* Must not throw — return false on any error.
|
|
416
|
+
*/
|
|
417
|
+
detect(buffer: ArrayBuffer): boolean;
|
|
418
|
+
/**
|
|
419
|
+
* Convert the buffer to a DXF string.
|
|
420
|
+
* The returned string must be valid DXF parseable by `parseDxf()`.
|
|
421
|
+
*/
|
|
422
|
+
convert(buffer: ArrayBuffer): Promise<string>;
|
|
423
|
+
}
|
|
362
424
|
interface CadViewerOptions {
|
|
363
425
|
theme?: Theme;
|
|
364
426
|
backgroundColor?: string;
|
|
@@ -367,6 +429,13 @@ interface CadViewerOptions {
|
|
|
367
429
|
maxZoom?: number;
|
|
368
430
|
zoomSpeed?: number;
|
|
369
431
|
initialTool?: Tool;
|
|
432
|
+
/** Format converters for non-DXF file formats (e.g. DWG via @cadview/dwg). */
|
|
433
|
+
formatConverters?: FormatConverter[];
|
|
434
|
+
/**
|
|
435
|
+
* Enable a debug overlay showing FPS, render stats, document info, timing, and camera data.
|
|
436
|
+
* Pass `true` for defaults, or an object for granular control.
|
|
437
|
+
*/
|
|
438
|
+
debug?: boolean | DebugOptions;
|
|
370
439
|
}
|
|
371
440
|
declare class CadViewer {
|
|
372
441
|
private canvas;
|
|
@@ -381,14 +450,62 @@ declare class CadViewer {
|
|
|
381
450
|
private currentTool;
|
|
382
451
|
private inputHandler;
|
|
383
452
|
private resizeObserver;
|
|
453
|
+
private formatConverters;
|
|
384
454
|
private selectedEntityIndex;
|
|
385
455
|
private renderPending;
|
|
386
456
|
private destroyed;
|
|
457
|
+
private loadGeneration;
|
|
387
458
|
private mouseScreenX;
|
|
388
459
|
private mouseScreenY;
|
|
460
|
+
private debugEnabled;
|
|
461
|
+
private debugOptions;
|
|
462
|
+
private lastRenderStats;
|
|
463
|
+
private lastDebugStats;
|
|
464
|
+
private frameTimestamps;
|
|
465
|
+
private lastDoRenderTime;
|
|
466
|
+
private lastFrameTime;
|
|
467
|
+
private parseTime;
|
|
468
|
+
private spatialIndexBuildTime;
|
|
469
|
+
private loadedFileName;
|
|
470
|
+
private loadedFileSize;
|
|
471
|
+
private debugRafId;
|
|
389
472
|
constructor(canvas: HTMLCanvasElement, options?: CadViewerOptions);
|
|
473
|
+
/**
|
|
474
|
+
* Throws if the viewer has been destroyed.
|
|
475
|
+
* Call at the start of any public method that mutates state.
|
|
476
|
+
*/
|
|
477
|
+
private guardDestroyed;
|
|
478
|
+
/**
|
|
479
|
+
* Run registered format converters on a buffer.
|
|
480
|
+
* Returns the converted DXF string if a converter matched, or null otherwise.
|
|
481
|
+
* Each converter's detect() is wrapped in try/catch — a throwing detect() is skipped.
|
|
482
|
+
*/
|
|
483
|
+
private runConverters;
|
|
484
|
+
/**
|
|
485
|
+
* Load a CAD file from a browser File object.
|
|
486
|
+
* Automatically detects the format using registered converters (e.g. DWG).
|
|
487
|
+
* Falls back to DXF parsing if no converter matches.
|
|
488
|
+
*/
|
|
390
489
|
loadFile(file: File): Promise<void>;
|
|
490
|
+
/**
|
|
491
|
+
* Load a CAD file from an ArrayBuffer with format converter support.
|
|
492
|
+
* Unlike `loadArrayBuffer()` (sync, DXF-only), this method is async and
|
|
493
|
+
* checks registered FormatConverters for non-DXF formats.
|
|
494
|
+
*/
|
|
495
|
+
loadBuffer(buffer: ArrayBuffer): Promise<void>;
|
|
496
|
+
/**
|
|
497
|
+
* Load a pre-parsed DxfDocument directly, bypassing the parser.
|
|
498
|
+
* Useful for custom parsers or pre-processed documents.
|
|
499
|
+
*/
|
|
500
|
+
loadDocument(doc: DxfDocument): void;
|
|
501
|
+
/**
|
|
502
|
+
* Load a DXF string directly (synchronous, no format conversion).
|
|
503
|
+
*/
|
|
391
504
|
loadString(dxf: string): void;
|
|
505
|
+
/**
|
|
506
|
+
* Load a DXF file from an ArrayBuffer (synchronous, no format conversion).
|
|
507
|
+
* For format conversion support (e.g. DWG), use `loadFile()` or `loadBuffer()` instead.
|
|
508
|
+
*/
|
|
392
509
|
loadArrayBuffer(buffer: ArrayBuffer): void;
|
|
393
510
|
/**
|
|
394
511
|
* Clear the current document and reset all state without destroying the viewer.
|
|
@@ -419,6 +536,19 @@ declare class CadViewer {
|
|
|
419
536
|
/** @internal */
|
|
420
537
|
requestRender(): void;
|
|
421
538
|
private doRender;
|
|
539
|
+
/**
|
|
540
|
+
* Enable or disable the debug overlay.
|
|
541
|
+
* Pass `true` for defaults, `false` to disable, or an object for granular control.
|
|
542
|
+
*/
|
|
543
|
+
setDebug(debug: boolean | DebugOptions): void;
|
|
544
|
+
private startDebugLoop;
|
|
545
|
+
private stopDebugLoop;
|
|
546
|
+
/**
|
|
547
|
+
* Get the latest debug stats snapshot, or null if debug mode is off.
|
|
548
|
+
*/
|
|
549
|
+
getDebugStats(): DebugStats | null;
|
|
550
|
+
private buildDebugStats;
|
|
551
|
+
private computeViewportBounds;
|
|
422
552
|
/** @internal */
|
|
423
553
|
handlePan(dx: number, dy: number): void;
|
|
424
554
|
/** @internal */
|
|
@@ -507,4 +637,4 @@ interface BBox {
|
|
|
507
637
|
declare function computeEntitiesBounds(entities: DxfEntity[]): BBox | null;
|
|
508
638
|
declare function computeEntityBBox(entity: DxfEntity): BBox | null;
|
|
509
639
|
|
|
510
|
-
export { type BBox, CadViewer, type CadViewerEventMap, type CadViewerOptions, Camera, CanvasRenderer, type DxfArcEntity, type DxfAttrib, type DxfBlock, type DxfCircleEntity, type DxfDimensionEntity, type DxfDocument, type DxfEllipseEntity, type DxfEntity, type DxfEntityBase, type DxfHatchBoundaryPath, type DxfHatchEdge, type DxfHatchEntity, type DxfHeader, type DxfInsertEntity, type DxfLayer, type DxfLineEntity, type DxfLineType, type DxfLwPolylineEntity, type DxfLwPolylineVertex, type DxfMTextEntity, DxfParseError, type DxfPointEntity, type DxfPolylineEntity, type DxfSplineEntity, type DxfStyle, type DxfTextEntity, EventEmitter, LayerManager, type MeasureEvent, type MeasureState, MeasureTool, type Point2D, type Point3D, type SelectEvent, type SnapResult, type SnapType, SpatialIndex, THEMES, type Theme, type ThemeConfig, type Tool, type ViewTransform, aciToDisplayColor, aciToHex, applyTransform, computeEntitiesBounds, computeEntityBBox, drawEntity, findSnaps, fitToView, hitTest, parseDxf, renderMeasureOverlay, resolveEntityColor, screenToWorld, trueColorToHex, worldToScreen, zoomAtPoint };
|
|
640
|
+
export { type BBox, CadViewer, type CadViewerEventMap, type CadViewerOptions, Camera, CanvasRenderer, type DebugOptions, type DebugStats, type DxfArcEntity, type DxfAttrib, type DxfBlock, type DxfCircleEntity, type DxfDimensionEntity, type DxfDocument, type DxfEllipseEntity, type DxfEntity, type DxfEntityBase, type DxfHatchBoundaryPath, type DxfHatchEdge, type DxfHatchEntity, type DxfHeader, type DxfInsertEntity, type DxfLayer, type DxfLineEntity, type DxfLineType, type DxfLwPolylineEntity, type DxfLwPolylineVertex, type DxfMTextEntity, DxfParseError, type DxfPointEntity, type DxfPolylineEntity, type DxfSplineEntity, type DxfStyle, type DxfTextEntity, EventEmitter, type FormatConverter, LayerManager, type MeasureEvent, type MeasureState, MeasureTool, type Point2D, type Point3D, type RenderStats, type SelectEvent, type SnapResult, type SnapType, SpatialIndex, THEMES, type Theme, type ThemeConfig, type Tool, type ViewTransform, aciToDisplayColor, aciToHex, applyTransform, computeEntitiesBounds, computeEntityBBox, drawEntity, findSnaps, fitToView, hitTest, parseDxf, renderDebugOverlay, renderMeasureOverlay, resolveEntityColor, screenToWorld, trueColorToHex, worldToScreen, zoomAtPoint };
|