bimplus-renderer 1.6.72 → 1.6.73
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 +3 -0
- package/bin/processPartitionVertices.js +2 -2
- package/dist/bimplus-renderer.js +1 -1
- package/package.json +2 -1
- package/types/bimplus-renderer.d.ts +266 -0
package/package.json
CHANGED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
declare module 'bimplus-renderer' {
|
|
2
|
+
|
|
3
|
+
import * as WebSdk from 'bimplus-websdk';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
|
|
6
|
+
export type Radian = number;
|
|
7
|
+
export type HexColor = string;
|
|
8
|
+
|
|
9
|
+
export class Background {
|
|
10
|
+
static BackgroundType_None: number = 0;
|
|
11
|
+
static BackgroundType_Color: number = 1;
|
|
12
|
+
static BackgroundType_LinearGradient: number = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ColorStop {
|
|
16
|
+
offset: number;
|
|
17
|
+
color: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface BackgroundParams {
|
|
21
|
+
alpha: number;
|
|
22
|
+
colorStops: ColorStop[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class Diagnostics {
|
|
26
|
+
|
|
27
|
+
dumpObjects(longInfo: boolean): void;
|
|
28
|
+
dumpObjectSets(longInfo: boolean): void;
|
|
29
|
+
dumpScene(): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class MeasurementUnits {
|
|
33
|
+
weight?: Measurement;
|
|
34
|
+
length?: Measurement;
|
|
35
|
+
width?: Measurement;
|
|
36
|
+
height?: Measurement;
|
|
37
|
+
area?: Measurement;
|
|
38
|
+
volume?: Measurement;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class Measurement {
|
|
42
|
+
multiplicator: number;
|
|
43
|
+
precision: number;
|
|
44
|
+
unit: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export class ModelViewStateLayer {
|
|
48
|
+
id: WebSdk.LayerId;
|
|
49
|
+
background: boolean;
|
|
50
|
+
visible: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class ModelViewState {
|
|
54
|
+
layers: Array<ModelViewStateLayer>;
|
|
55
|
+
setLayersVisible(visible: boolean): void;
|
|
56
|
+
setLeafNodesVisible(visible: boolean): void;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface Attribute {
|
|
60
|
+
id: string,
|
|
61
|
+
}
|
|
62
|
+
export interface StringAttribute extends Attribute {
|
|
63
|
+
value: string,
|
|
64
|
+
}
|
|
65
|
+
export interface NumberAttribute extends Attribute {
|
|
66
|
+
value: number,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class ObjectSets {
|
|
70
|
+
// An array of selected object references
|
|
71
|
+
selectedObjects: VisualObject[];
|
|
72
|
+
|
|
73
|
+
// An array of hidden object references
|
|
74
|
+
hiddenObjects: VisualObject[];
|
|
75
|
+
|
|
76
|
+
// An array of object references on isolated set
|
|
77
|
+
workingObjects: VisualObject[];
|
|
78
|
+
|
|
79
|
+
// An array of colored object references
|
|
80
|
+
coloredObjects: VisualObject[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export class ProjectContent {
|
|
84
|
+
id: string | null;
|
|
85
|
+
forEachModel(func: (model: ProjectModel) => void): void;
|
|
86
|
+
getModels(): ProjectModel[];
|
|
87
|
+
getModel(id: string): ProjectModel | null;
|
|
88
|
+
getObjectsContainer(): ObjectsContainer | null;
|
|
89
|
+
unloadModel(model: ProjectModel, revisionNumber: number, onlyObjects: boolean): void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export class ProjectLayer {
|
|
93
|
+
id: WebSdk.LayerId;
|
|
94
|
+
name: string;
|
|
95
|
+
currentRevision: number;
|
|
96
|
+
parentModel?: ProjectModel;
|
|
97
|
+
opacity: number;
|
|
98
|
+
userColor: THREE.Color | null;
|
|
99
|
+
userOpacity: number | null;
|
|
100
|
+
|
|
101
|
+
isExternal(): boolean;
|
|
102
|
+
isInternal(): boolean;
|
|
103
|
+
|
|
104
|
+
setVisible(value: boolean): void;
|
|
105
|
+
isVisible(): boolean;
|
|
106
|
+
|
|
107
|
+
setBackground(value: boolean): void;
|
|
108
|
+
isBackground(): boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export class ProjectTopologyNode {
|
|
112
|
+
id: WebSdk.Guid;
|
|
113
|
+
isVisible(): boolean;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export class ProjectModel {
|
|
117
|
+
|
|
118
|
+
constructor(id: WebSdk.ModelId, visible: boolean);
|
|
119
|
+
|
|
120
|
+
id: WebSdk.ModelId;
|
|
121
|
+
name: string;
|
|
122
|
+
visible: boolean;
|
|
123
|
+
divisionTopologyId: WebSdk.DivisionTopologyId;
|
|
124
|
+
layers: Array<ProjectLayer> | null;
|
|
125
|
+
|
|
126
|
+
revisions: Array<number>;
|
|
127
|
+
releasedRevisions: Array<number>;
|
|
128
|
+
currentRevision: number;
|
|
129
|
+
parentProject?: ProjectContent;
|
|
130
|
+
objectsLoaded: boolean;
|
|
131
|
+
|
|
132
|
+
// Define other properties and methods of the ProjectModel class here if needed
|
|
133
|
+
setCurrentRevision(rev: number): void;
|
|
134
|
+
getCurrentRevision(): number;
|
|
135
|
+
getLatestRevision(): number;
|
|
136
|
+
|
|
137
|
+
forEachLayer(func: (layer: ProjectLayer) => void): void;
|
|
138
|
+
getLayerArray(): ProjectLayer[];
|
|
139
|
+
|
|
140
|
+
setVisible(isVisible: boolean);
|
|
141
|
+
isVisible(): boolean;
|
|
142
|
+
forEachTopologyLeafNode(func: (node: ProjectTopologyNode) => void): void;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export class ContentLoader {
|
|
146
|
+
async checkAndRefreshProject(project: ProjectContent, models: ProjectModel[]): Promise<boolean>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface ProjectLoaderSettings {
|
|
150
|
+
onlyModelsFromOwnGroups?: boolean,
|
|
151
|
+
modelsFor?: string[],
|
|
152
|
+
filterPrivateDisciplines?: boolean
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export class ProjectViewer {
|
|
156
|
+
constructor(api: WebSdk.Api, viewport?: Viewport3D, concurrentModelLoadingLimit?: number, includeIfcLoader?: boolean);
|
|
157
|
+
|
|
158
|
+
async loadProject(projectId: WebSdk.ProjectId, settings: ProjectLoaderSettings | undefined = undefined): Promise<ProjectContent | null>;
|
|
159
|
+
async reloadProjectDetails(): Promise<boolean>;
|
|
160
|
+
async checkModelModified(modelId: WebSdk.ModelId, clearResponseStore: boolean = true, clearNodeStore: boolean = true): Promise<boolean>;
|
|
161
|
+
getProject(): ProjectContent;
|
|
162
|
+
getContentLoader(): ContentLoader;
|
|
163
|
+
async loadModelStructure(model: ProjectModel): Promise<void>;
|
|
164
|
+
async reloadModelGeometry(modelId: WebSdk.ModelId): Promise<void>;
|
|
165
|
+
getModelViewState(modelId: WebSdk.ModelId): ModelViewState;
|
|
166
|
+
async setModelViewState(modelState: ModelViewState | undefined, viewStateStructureChangedCallback?: () => void);
|
|
167
|
+
draw(): void;
|
|
168
|
+
_mainViewport?: Viewport3D;
|
|
169
|
+
_viewports: Array<Viewport3D>;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export class AmbientOcclusionSettings {
|
|
173
|
+
usage: boolean;
|
|
174
|
+
usageForInteraction: boolean;
|
|
175
|
+
useShadows: boolean;
|
|
176
|
+
useShadowsForInteraction: boolean;
|
|
177
|
+
lightColor: THREE.Color;
|
|
178
|
+
ambientLightColor: THREE.Color;
|
|
179
|
+
lightRotation: Radian;
|
|
180
|
+
lightElevation: Radian;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface ColorizeObject {
|
|
184
|
+
id: WebSdk.VisualObjectId,
|
|
185
|
+
color: HexColor,
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export class Viewport3D {
|
|
189
|
+
constructor(options: {
|
|
190
|
+
settings: ViewportSettings;
|
|
191
|
+
units: MeasurementUnits;
|
|
192
|
+
domElementId: string;
|
|
193
|
+
GPUPick: boolean;
|
|
194
|
+
api: WebSdk.Api;
|
|
195
|
+
name: string;
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
domElement: HTMLElement;
|
|
199
|
+
objectSets: ObjectSets;
|
|
200
|
+
diagnostics: Diagnostics;
|
|
201
|
+
|
|
202
|
+
// Define other properties and methods of the Viewport3D class here
|
|
203
|
+
setViewportSize(width?: number, height?: number): void;
|
|
204
|
+
|
|
205
|
+
// Define functions for setting up the viewport renderer
|
|
206
|
+
setAmbientOcclusionOptions(settings: AmbientOcclusionSettings);
|
|
207
|
+
setBackground(type: BackgroundType, params: BackgroundParams)
|
|
208
|
+
setUseHoverEffect(useHoverEffect: boolean);
|
|
209
|
+
|
|
210
|
+
restoreViewbox(): Promise<void>;
|
|
211
|
+
resetClashScene(): void;
|
|
212
|
+
setRotationCenter(c: THREE.Vector3 | null): void;
|
|
213
|
+
setCameraResetAxis(a: string, fly?: boolean): void;
|
|
214
|
+
setSectionAxis(a?: string): void;
|
|
215
|
+
resetViewport(): void;
|
|
216
|
+
draw(): void;
|
|
217
|
+
async dispose(): void;
|
|
218
|
+
setSelectionMode(mode: string): void;
|
|
219
|
+
checkSelectionMode(mode: string): boolean;
|
|
220
|
+
resetSelectionMode(): void;
|
|
221
|
+
setShowHiddenObjectsTransparent(showTransparent: boolean): void;
|
|
222
|
+
resetSelectedObjects(): void;
|
|
223
|
+
resetHiddenObjects(): void;
|
|
224
|
+
resetWorkingObjects(): void;
|
|
225
|
+
resetColoredObjects(): void;
|
|
226
|
+
resetAllObjectSets(): void;
|
|
227
|
+
makeColoredSet(objects: Array<ColorizeObject>): void;
|
|
228
|
+
zoomToObjects(objectIdList: string[]): void;
|
|
229
|
+
subscribeToSelectionModeChanges(handler: (selectionMode: string) => void): void;
|
|
230
|
+
subscribeToConnectionElementSelected(handler: (
|
|
231
|
+
object: Renderer.VisualObject | null,
|
|
232
|
+
mousePos: THREE.Vector2 | null,
|
|
233
|
+
attributes: Record<string, Renderer.Attribute> | null,
|
|
234
|
+
) => void): void;
|
|
235
|
+
highlightObjects(ids: string[], multiselect: boolean, skipBubbleUp: boolean): void;
|
|
236
|
+
hoverObject(id: string): void;
|
|
237
|
+
resetHoveredObject(): void;
|
|
238
|
+
setupProjectView(): void;
|
|
239
|
+
toggleProjectionMode(viewport: Viewport3D): void;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export class ViewportSettings {
|
|
243
|
+
defaultOpacity: number;
|
|
244
|
+
disciplineOpacity: number;
|
|
245
|
+
pinSizeScaleFactor: number;
|
|
246
|
+
maxWebGLBufferSize: number;
|
|
247
|
+
mixedModelMode: boolean;
|
|
248
|
+
pinFlyToDistance: number;
|
|
249
|
+
nearClippingPlane: number;
|
|
250
|
+
slideThmbSize: number[]; // [number, number];
|
|
251
|
+
units: {
|
|
252
|
+
mm?: MeasurementUnits;
|
|
253
|
+
inch?: MeasurementUnits;
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export class VisualObject {
|
|
258
|
+
id: WebSdk.VisualObjectId;
|
|
259
|
+
name: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export class ObjectsContainer {
|
|
263
|
+
getObjects(ids: string[]): VisualObject[];
|
|
264
|
+
getObjectsArray(): VisualObject[];
|
|
265
|
+
}
|
|
266
|
+
}
|