@inweb/viewer-core 25.3.18 → 25.3.19
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/viewer-core.js +71 -59
- package/dist/viewer-core.js.map +1 -1
- package/dist/viewer-core.module.js +83 -72
- package/dist/viewer-core.module.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/options/IOptions.d.ts +155 -0
- package/lib/options/Options.d.ts +7 -159
- package/lib/options/OptionsEvents.d.ts +2 -2
- package/lib/viewer/IViewer.d.ts +2 -2
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/options/IOptions.ts +224 -0
- package/src/options/Options.ts +49 -239
- package/src/options/OptionsEvents.ts +2 -2
- package/src/viewer/IViewer.ts +2 -2
package/lib/options/Options.d.ts
CHANGED
|
@@ -1,164 +1,12 @@
|
|
|
1
1
|
import { EventEmitter2 } from "@inweb/eventemitter2";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
green: number;
|
|
5
|
-
blue: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* `VisualizeJS` parameters.
|
|
9
|
-
*/
|
|
10
|
-
export interface OptionsData {
|
|
11
|
-
/**
|
|
12
|
-
* Show WCS
|
|
13
|
-
*
|
|
14
|
-
* @defaultValue true
|
|
15
|
-
*/
|
|
16
|
-
showWCS?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Enable camera animation
|
|
19
|
-
*
|
|
20
|
-
* @defaultValue true
|
|
21
|
-
*/
|
|
22
|
-
cameraAnimation?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Enable antialiasing use FXAA
|
|
25
|
-
*
|
|
26
|
-
* @defaultValue true
|
|
27
|
-
*/
|
|
28
|
-
antialiasing?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Enable ground shadows
|
|
31
|
-
*
|
|
32
|
-
* @defaultValue false
|
|
33
|
-
*/
|
|
34
|
-
groundShadow?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Enable shadows
|
|
37
|
-
*
|
|
38
|
-
* @defaultValue false
|
|
39
|
-
*/
|
|
40
|
-
shadows?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Camera speed on X axis
|
|
43
|
-
*
|
|
44
|
-
* @defaultValue 4
|
|
45
|
-
*/
|
|
46
|
-
cameraAxisXSpeed?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Camera speed on Y axis
|
|
49
|
-
*
|
|
50
|
-
* @defaultValue 1
|
|
51
|
-
*/
|
|
52
|
-
cameraAxisYSpeed?: number;
|
|
53
|
-
/**
|
|
54
|
-
* Ambient occlusion
|
|
55
|
-
*
|
|
56
|
-
* @defaultValue false
|
|
57
|
-
*/
|
|
58
|
-
ambientOcclusion?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Enable streaming mode
|
|
61
|
-
*
|
|
62
|
-
* If enableStreamingMode is true then enablePartialMode will be used, otherwise -
|
|
63
|
-
* enablePartialMode will be ignored and file / assembly will be loaded in one go
|
|
64
|
-
*
|
|
65
|
-
* @defaultValue true
|
|
66
|
-
*/
|
|
67
|
-
enableStreamingMode?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Enable partial load mode to be able open large drawing If enablePartialMode enabled, then
|
|
70
|
-
* sceneGraph will be switched off
|
|
71
|
-
*
|
|
72
|
-
* @defaultValue false
|
|
73
|
-
*/
|
|
74
|
-
enablePartialMode?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* The size of the memory buffer that the Viewer can use for graphics data
|
|
77
|
-
*
|
|
78
|
-
* @defaultValue 3294967296
|
|
79
|
-
*/
|
|
80
|
-
memoryLimit?: number;
|
|
81
|
-
/**
|
|
82
|
-
* Cutting plane fill color
|
|
83
|
-
*
|
|
84
|
-
* @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }
|
|
85
|
-
*/
|
|
86
|
-
cuttingPlaneFillColor?: RGB;
|
|
87
|
-
/**
|
|
88
|
-
* Outline edges color in RGB format.
|
|
89
|
-
*/
|
|
90
|
-
edgesColor?: {
|
|
91
|
-
r: number;
|
|
92
|
-
g: number;
|
|
93
|
-
b: number;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Faces color in the RGB format.
|
|
97
|
-
*/
|
|
98
|
-
facesColor?: {
|
|
99
|
-
r: number;
|
|
100
|
-
g: number;
|
|
101
|
-
b: number;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Show or hide edges.
|
|
105
|
-
*/
|
|
106
|
-
edgesVisibility?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Show edges over drawing.
|
|
109
|
-
*/
|
|
110
|
-
edgesOverlap?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Show faces over drawing.
|
|
113
|
-
*/
|
|
114
|
-
facesOverlap?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Faces transparency value from 0 to 255.
|
|
117
|
-
*/
|
|
118
|
-
facesTransparancy?: number;
|
|
119
|
-
/**
|
|
120
|
-
* Enable custom highlight settings.
|
|
121
|
-
*/
|
|
122
|
-
enableCustomHighlight?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Enable or disable scene graph, it increases perfomance improvement, but consumes memory
|
|
125
|
-
* Large drawings can take up a lot of memory. If sceneGraph enabled, then enablePartialMode
|
|
126
|
-
* will be switched off
|
|
127
|
-
*/
|
|
128
|
-
sceneGraph: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Edge display models. No edges is usefull for less memory consumption: `false` - no edges
|
|
131
|
-
* are displayed, `true` - display isolines.
|
|
132
|
-
*/
|
|
133
|
-
edgeModel: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Reverse the mouse wheel direction for zooming: false - moving the wheel up zooms in,
|
|
136
|
-
* moving down zooms out, `true` - moving the wheel up zooms out, moving down zooms in.
|
|
137
|
-
*/
|
|
138
|
-
reverseZoomWheel: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Enable mouse wheel zooming.
|
|
141
|
-
*/
|
|
142
|
-
enableZoomWheel: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Enable touch gestures. This option will be ignored when enableZoomWheel is disabled, since
|
|
145
|
-
* gestures contains touch zoom.
|
|
146
|
-
*/
|
|
147
|
-
enableGestures: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Default file geometry data type. Can be one of:
|
|
150
|
-
*
|
|
151
|
-
* - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.
|
|
152
|
-
* - `gltf` - `glTF`, for opening a file in `Three.js` viewer.
|
|
153
|
-
*/
|
|
154
|
-
geometryType?: string;
|
|
155
|
-
}
|
|
156
|
-
export declare class Options {
|
|
2
|
+
import { IOptions, RGB } from "./IOptions";
|
|
3
|
+
export declare class Options implements IOptions {
|
|
157
4
|
protected _emitter?: EventEmitter2;
|
|
158
|
-
protected _data:
|
|
5
|
+
protected _data: IOptions;
|
|
159
6
|
constructor(emitter?: EventEmitter2);
|
|
160
|
-
static defaults():
|
|
7
|
+
static defaults(): IOptions;
|
|
161
8
|
notifierChangeEvent(): void;
|
|
9
|
+
change(): void;
|
|
162
10
|
saveToStorage(): void;
|
|
163
11
|
loadFromStorage(): void;
|
|
164
12
|
/**
|
|
@@ -167,8 +15,8 @@ export declare class Options {
|
|
|
167
15
|
* @param fields - Name of fields to be reset
|
|
168
16
|
*/
|
|
169
17
|
resetToDefaults(fields?: string[]): void;
|
|
170
|
-
get data():
|
|
171
|
-
set data(value:
|
|
18
|
+
get data(): IOptions;
|
|
19
|
+
set data(value: IOptions);
|
|
172
20
|
get showWCS(): boolean;
|
|
173
21
|
set showWCS(value: boolean);
|
|
174
22
|
get cameraAnimation(): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IOptions } from "./IOptions";
|
|
2
2
|
/**
|
|
3
3
|
* An event that fires when options has been changed.
|
|
4
4
|
*
|
|
@@ -12,7 +12,7 @@ export interface OptionsChangeEvent {
|
|
|
12
12
|
/**
|
|
13
13
|
* New parameters.
|
|
14
14
|
*/
|
|
15
|
-
data:
|
|
15
|
+
data: IOptions;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Options events.
|
package/lib/viewer/IViewer.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IEventEmitter } from "@inweb/eventemitter2";
|
|
2
2
|
import { Assembly, Client, File, Model } from "@inweb/client";
|
|
3
3
|
import { ICommandService } from "../commands/ICommands";
|
|
4
|
-
import {
|
|
4
|
+
import { IOptions } from "../options/IOptions";
|
|
5
5
|
import { IViewpoint } from "./IViewpoint";
|
|
6
6
|
export interface IViewer extends IEventEmitter, ICommandService {
|
|
7
7
|
client: Client | undefined;
|
|
8
|
-
options:
|
|
8
|
+
options: IOptions;
|
|
9
9
|
canvas: HTMLCanvasElement | undefined;
|
|
10
10
|
canvasEvents: string[];
|
|
11
11
|
draggers: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/viewer-core",
|
|
3
|
-
"version": "25.3.
|
|
3
|
+
"version": "25.3.19",
|
|
4
4
|
"description": "3D CAD and BIM data Viewer core",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"test": "karma start karma.conf.js"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "^25.3.
|
|
29
|
+
"@inweb/eventemitter2": "^25.3.18"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@inweb/eventemitter2": "^25.3.
|
|
32
|
+
"@inweb/eventemitter2": "^25.3.18"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
export interface RGB {
|
|
25
|
+
red: number;
|
|
26
|
+
green: number;
|
|
27
|
+
blue: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Viewer parameters.
|
|
32
|
+
*/
|
|
33
|
+
export interface IOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Show WCS
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue true
|
|
38
|
+
*/
|
|
39
|
+
showWCS?: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Enable camera animation
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue true
|
|
45
|
+
*/
|
|
46
|
+
cameraAnimation?: boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Enable antialiasing use FXAA
|
|
50
|
+
*
|
|
51
|
+
* @defaultValue true
|
|
52
|
+
*/
|
|
53
|
+
antialiasing?: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Enable ground shadows
|
|
57
|
+
*
|
|
58
|
+
* @defaultValue false
|
|
59
|
+
*/
|
|
60
|
+
groundShadow?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Enable shadows
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue false
|
|
66
|
+
*/
|
|
67
|
+
shadows?: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Camera speed on X axis
|
|
71
|
+
*
|
|
72
|
+
* @defaultValue 4
|
|
73
|
+
*/
|
|
74
|
+
cameraAxisXSpeed?: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Camera speed on Y axis
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue 1
|
|
80
|
+
*/
|
|
81
|
+
cameraAxisYSpeed?: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Ambient occlusion
|
|
85
|
+
*
|
|
86
|
+
* @defaultValue false
|
|
87
|
+
*/
|
|
88
|
+
ambientOcclusion?: boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Enable streaming of drawings from the server
|
|
92
|
+
*
|
|
93
|
+
* If streaming is disabled, the file/assembly will be loaded in one go. If streaming is
|
|
94
|
+
* enabled, partial download mode may be enabled as well.
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue true
|
|
97
|
+
*/
|
|
98
|
+
enableStreamingMode?: boolean;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Enable partial load mode to be able open large drawing. Only used if streaming is enabled.
|
|
102
|
+
* If partial mode is enabled, then scene graph will be disabled.
|
|
103
|
+
*
|
|
104
|
+
* @defaultValue false
|
|
105
|
+
*/
|
|
106
|
+
enablePartialMode?: boolean;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The size of the memory buffer that the Viewer can use for graphics data
|
|
110
|
+
*
|
|
111
|
+
* @defaultValue 3294967296
|
|
112
|
+
*/
|
|
113
|
+
memoryLimit?: number;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Cutting plane fill color
|
|
117
|
+
*
|
|
118
|
+
* @defaultValue { red: 0xff, green: 0x98, blue: 0x00 }
|
|
119
|
+
*/
|
|
120
|
+
cuttingPlaneFillColor?: RGB;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Outline edges color in RGB format.
|
|
124
|
+
*/
|
|
125
|
+
edgesColor?: { r: number; g: number; b: number };
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Faces color in the RGB format.
|
|
129
|
+
*/
|
|
130
|
+
facesColor?: { r: number; g: number; b: number };
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Show or hide edges.
|
|
134
|
+
*/
|
|
135
|
+
edgesVisibility?: boolean;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Show edges over drawing.
|
|
139
|
+
*/
|
|
140
|
+
edgesOverlap?: boolean;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Show faces over drawing.
|
|
144
|
+
*/
|
|
145
|
+
facesOverlap?: boolean;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Faces transparency value from 0 to 255.
|
|
149
|
+
*/
|
|
150
|
+
facesTransparancy?: number;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Enable custom highlight settings.
|
|
154
|
+
*/
|
|
155
|
+
enableCustomHighlight?: boolean;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Enable or disable scene graph, it increases perfomance improvement, but consumes memory.
|
|
159
|
+
* Large drawings can take up a lot of memory. If sceneGraph enabled, then enablePartialMode
|
|
160
|
+
* will be disabled
|
|
161
|
+
*/
|
|
162
|
+
sceneGraph: boolean;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Edge display models. No edges is usefull for less memory consumption: `false` - no edges
|
|
166
|
+
* are displayed, `true` - display isolines.
|
|
167
|
+
*/
|
|
168
|
+
edgeModel: boolean;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Reverse the mouse wheel direction for zooming: false - moving the wheel up zooms in,
|
|
172
|
+
* moving down zooms out, `true` - moving the wheel up zooms out, moving down zooms in.
|
|
173
|
+
*/
|
|
174
|
+
reverseZoomWheel: boolean;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Enable mouse wheel zooming.
|
|
178
|
+
*/
|
|
179
|
+
enableZoomWheel: boolean;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Enable touch gestures. This option will be ignored when enableZoomWheel is disabled, since
|
|
183
|
+
* gestures contains touch zoom.
|
|
184
|
+
*/
|
|
185
|
+
enableGestures: boolean;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Default file geometry data type. Can be one of:
|
|
189
|
+
*
|
|
190
|
+
* - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.
|
|
191
|
+
* - `gltf` - `glTF`, for opening a file in `Three.js` viewer.
|
|
192
|
+
*/
|
|
193
|
+
geometryType?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function defaultOptions(): IOptions {
|
|
197
|
+
return {
|
|
198
|
+
showWCS: true,
|
|
199
|
+
cameraAnimation: true,
|
|
200
|
+
antialiasing: true,
|
|
201
|
+
groundShadow: false,
|
|
202
|
+
shadows: false,
|
|
203
|
+
cameraAxisXSpeed: 4,
|
|
204
|
+
cameraAxisYSpeed: 1,
|
|
205
|
+
ambientOcclusion: false,
|
|
206
|
+
enableStreamingMode: true,
|
|
207
|
+
enablePartialMode: false,
|
|
208
|
+
memoryLimit: 3294967296,
|
|
209
|
+
cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },
|
|
210
|
+
edgesColor: { r: 0xff, g: 0x98, b: 0x00 },
|
|
211
|
+
facesColor: { r: 0xff, g: 0x98, b: 0x00 },
|
|
212
|
+
edgesVisibility: true,
|
|
213
|
+
edgesOverlap: true,
|
|
214
|
+
facesOverlap: false,
|
|
215
|
+
facesTransparancy: 200,
|
|
216
|
+
enableCustomHighlight: true,
|
|
217
|
+
sceneGraph: false,
|
|
218
|
+
edgeModel: true,
|
|
219
|
+
reverseZoomWheel: false,
|
|
220
|
+
enableZoomWheel: true,
|
|
221
|
+
enableGestures: true,
|
|
222
|
+
geometryType: "vsfx",
|
|
223
|
+
};
|
|
224
|
+
}
|