@nebula-spatial/cad-loader 0.2.4 → 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/CHANGELOG.md +5 -0
- package/dist/core/index.js +2 -1
- package/dist/core/parser/types.d.ts +2 -1
- package/dist/core/types.d.ts +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +775 -741
- package/dist/loader/internal/geo-node.d.ts +4 -0
- package/dist/render-resource/cad-render-node.d.ts +9 -0
- package/dist/session/cad-document-session.d.ts +8 -1
- package/dist/workers/geo-prepare.worker.js +2 -1
- package/package.json +1 -1
|
@@ -115,6 +115,10 @@ export declare class GeoNode extends Group {
|
|
|
115
115
|
onChange(listener: GeoNodeChangeListener): () => void;
|
|
116
116
|
_notifyStructureChange(): void;
|
|
117
117
|
setLayerVisible(layerIndex: number, visible: boolean): void;
|
|
118
|
+
setLayerVisibleBatch(changes: ReadonlyArray<{
|
|
119
|
+
layerIndex: number;
|
|
120
|
+
visible: boolean;
|
|
121
|
+
}>): number;
|
|
118
122
|
setAnnotationOverlayVisible(visible: boolean): void;
|
|
119
123
|
setDisplayTheme(themeName: ViewerThemeName, options?: {
|
|
120
124
|
enhanceContrast?: boolean;
|
|
@@ -41,6 +41,10 @@ export interface CadInsertVisibilityChange {
|
|
|
41
41
|
readonly insertId: string;
|
|
42
42
|
readonly visible: boolean;
|
|
43
43
|
}
|
|
44
|
+
export interface CadLayerVisibilityChange {
|
|
45
|
+
readonly layerIndex: number;
|
|
46
|
+
readonly visible: boolean;
|
|
47
|
+
}
|
|
44
48
|
/**
|
|
45
49
|
* Read-only CAD render resource. Editing methods belong to legacy GeoNode and
|
|
46
50
|
* must not appear on this type.
|
|
@@ -54,6 +58,11 @@ export interface CadRenderNode {
|
|
|
54
58
|
appendContent(chunk: CadRenderContentChunk): boolean;
|
|
55
59
|
setDisplayContext(context: CadDisplayContext): void;
|
|
56
60
|
setLayerVisible(layerIndex: number, visible: boolean): void;
|
|
61
|
+
/**
|
|
62
|
+
* Applies layer visibility changes as one render-resource transaction. This
|
|
63
|
+
* avoids rebuilding the viewport INSERT presenter once per changed layer.
|
|
64
|
+
*/
|
|
65
|
+
setLayerVisibleBatch(changes: ReadonlyArray<CadLayerVisibilityChange>): void;
|
|
57
66
|
setLayerColorOverride(layerIndex: number, color: number | null): void;
|
|
58
67
|
setInsertVisible(insertId: string, visible: boolean): void;
|
|
59
68
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CadInsertDetails, CadInsertSelectionId } from '../selection/cad-insert-selection';
|
|
2
|
-
import type { CadTextSelection } from '../selection/cad-text-selection';
|
|
2
|
+
import type { CadTextDetails, CadTextSelection, CadTextSelectionId } from '../selection/cad-text-selection';
|
|
3
3
|
import type { ResolveTextFont } from '../shared/text-font';
|
|
4
4
|
import type { CadTextWarmupOptions } from './cad-text-warmup';
|
|
5
5
|
import type { ViewportRect } from '../core';
|
|
@@ -31,6 +31,11 @@ export interface CadLayerMeta {
|
|
|
31
31
|
readonly color: readonly [number, number, number];
|
|
32
32
|
readonly visible: boolean;
|
|
33
33
|
}
|
|
34
|
+
/** Source units carried by a generated CAD pack when available. */
|
|
35
|
+
export interface CadDocumentUnits {
|
|
36
|
+
readonly source: string;
|
|
37
|
+
readonly scaleToMeters?: number;
|
|
38
|
+
}
|
|
34
39
|
export interface CadVisibilityFilter {
|
|
35
40
|
readonly layerVisible?: ReadonlyMap<number, boolean> | ((layerIndex: number) => boolean);
|
|
36
41
|
readonly insertVisible?: ReadonlySet<string> | ((insertId: string) => boolean);
|
|
@@ -61,6 +66,7 @@ export interface CadDocumentHeader {
|
|
|
61
66
|
readonly sourceFingerprint: string;
|
|
62
67
|
readonly format: string;
|
|
63
68
|
readonly filename: string | null;
|
|
69
|
+
readonly units?: CadDocumentUnits;
|
|
64
70
|
}
|
|
65
71
|
export interface CadInsertSelection {
|
|
66
72
|
readonly documentKey: string | null;
|
|
@@ -154,6 +160,7 @@ export interface CadDocumentSession {
|
|
|
154
160
|
getLayers(): readonly CadLayerMeta[];
|
|
155
161
|
listInsertUsages(): readonly CadInsertUsageSummary[];
|
|
156
162
|
getBlockDetails(id: string): CadInsertDetails | null;
|
|
163
|
+
getTextDetails?(id: CadTextSelectionId): CadTextDetails | null;
|
|
157
164
|
pickInsertAtPoint(point: CadWorldPoint, viewport: ViewportRect): CadInsertSelection | null;
|
|
158
165
|
/** Optional for compatibility with pre-text-picking session adapters. */
|
|
159
166
|
pickTextAtPoint?(point: CadWorldPoint): CadTextSelection | null;
|