gs-bim-air 0.0.3-0.4 → 0.0.3-0.5
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/READMEBETA.md +4 -0
- package/demo//346/250/241/345/236/213/345/212/250/347/224/273//350/267/257/345/276/204/345/271/263/347/247/273/345/212/250/347/224/273.html +2 -4
- package/docs/animation//350/267/257/345/276/204/345/271/263/347/247/273/345/212/250/347/224/273/346/226/207/346/241/243.md +127 -0
- package/docs/classes/PropertyManager.md +7 -0
- package/docs/classes/SegmentObject.md +37 -37
- package/docs/classes/Viewer.md +33 -4
- package/lib/BimAir.common-report.html +2 -2
- package/lib/BimAir.common.js +543 -580
- package/lib/BimAir.umd-report.html +2 -2
- package/lib/BimAir.umd.js +543 -580
- package/lib/BimAir.umd.min-report.html +2 -2
- package/lib/BimAir.umd.min.js +543 -580
- package/package.json +1 -1
- package/public/js/longan/longan.js +4 -4
- package/public/js/longan/longan.wasm +0 -0
- package/public/js/longanWithoutShareArrayBuffer/longan.js +2 -2
- package/public/js/longanWithoutShareArrayBuffer/longan.wasm +0 -0
- package/demo//346/250/241/345/236/213/346/223/215/344/275/234//346/211/271/351/207/217/350/256/276/347/275/256/346/236/204/344/273/266/351/242/234/350/211/262.html +0 -66
package/READMEBETA.md
CHANGED
|
@@ -61,8 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
// 动画移动的对象
|
|
63
63
|
let moveObjId = "QMD+M+4G+HYD+XDRA01+EL002";
|
|
64
|
-
let
|
|
65
|
-
let moveSegmentObject = new BimAir.SegmentObject(viewer, key);
|
|
64
|
+
let moveSegmentObject = moveModel.getComponent(moveObjId);
|
|
66
65
|
|
|
67
66
|
let bb = viewer.computeViewBoundingBox(moveSegmentObject.segment);
|
|
68
67
|
let center = new Float64Array([
|
|
@@ -108,8 +107,7 @@
|
|
|
108
107
|
setTimeout(() => {
|
|
109
108
|
let moveObjId = "QMD+M+4G+HYD+XDRA01+EL001";
|
|
110
109
|
// 动画2移动的对象
|
|
111
|
-
let
|
|
112
|
-
let moveSegmentObject = new BimAir.SegmentObject(viewer, key);
|
|
110
|
+
let moveSegmentObject = moveModel.getComponent(moveObjId);
|
|
113
111
|
|
|
114
112
|
let bb = viewer.computeViewBoundingBox(moveSegmentObject.segment);
|
|
115
113
|
let center = new Float64Array([
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# 快速上手
|
|
2
|
+
|
|
3
|
+
// 动画移动的对象
|
|
4
|
+
|
|
5
|
+
viewer
|
|
6
|
+
.loadModels([
|
|
7
|
+
{ id: modelId, version: 0 },
|
|
8
|
+
{ id: carObjId, version: 0 },
|
|
9
|
+
])
|
|
10
|
+
.then((lightModels) => {
|
|
11
|
+
console.log("roam Test");
|
|
12
|
+
this.modelName = viewer.renderObject.name;
|
|
13
|
+
|
|
14
|
+
let model1 = lightModels[0];
|
|
15
|
+
//肘管
|
|
16
|
+
let moveModel = lightModels[1];
|
|
17
|
+
|
|
18
|
+
// 动画移动的对象
|
|
19
|
+
let moveObjId = "QMD+M+4G+HYD+XDRA01+EL002";
|
|
20
|
+
let moveSegmentObject = moveModel.getComponent(moveObjId);
|
|
21
|
+
|
|
22
|
+
let bb = viewer.computeViewBoundingBox(moveSegmentObject.segment);
|
|
23
|
+
let center = new Float64Array([
|
|
24
|
+
(bb[0] + bb[3]) / 2,
|
|
25
|
+
(bb[1] + bb[4]) / 2,
|
|
26
|
+
(bb[2] + bb[5]) / 2,
|
|
27
|
+
])
|
|
28
|
+
|
|
29
|
+
let p0 = new BimAir.Longan.Point();
|
|
30
|
+
p0[0] = 380022.3124998525;
|
|
31
|
+
p0[1] = 39384.624999855165;
|
|
32
|
+
p0[2] = 3072.023193359375;
|
|
33
|
+
|
|
34
|
+
let p1 = new BimAir.Longan.Point();
|
|
35
|
+
p1[0] = center[0];
|
|
36
|
+
p1[1] = center[1];
|
|
37
|
+
p1[2] = center[2];
|
|
38
|
+
|
|
39
|
+
let p2 = new BimAir.Longan.Point();
|
|
40
|
+
p2[0] = 380022.3124998525;
|
|
41
|
+
p2[1] = 39484.624999855165;
|
|
42
|
+
p2[2] = 3072.023193359375;
|
|
43
|
+
|
|
44
|
+
let points = new Array();
|
|
45
|
+
points.push(p0);
|
|
46
|
+
points.push(p1);
|
|
47
|
+
points.push(p2);
|
|
48
|
+
|
|
49
|
+
// 绘制路径点线段(用来看的).
|
|
50
|
+
viewer.process.animationManager.drawStraight(viewer, points);
|
|
51
|
+
|
|
52
|
+
// 漫游时长
|
|
53
|
+
let roamTime = 10;
|
|
54
|
+
// 添加路径动画并返回动画事件的Id.
|
|
55
|
+
// 添加动画1
|
|
56
|
+
let animationId1 = viewer.process.animationManager.objectRoamWithoutRotate(viewer, moveSegmentObject, points, roamTime, PathType.Straight, () => {
|
|
57
|
+
console.log("finish1");
|
|
58
|
+
});
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
//播放动画1
|
|
63
|
+
|
|
64
|
+
viewer.process.animationManager.run([animationId]);
|
|
65
|
+
|
|
66
|
+
### 添加动画并返回动画Id
|
|
67
|
+
```
|
|
68
|
+
viewer: 模型所在的viewer
|
|
69
|
+
moveSegmentObject: 移动对对象
|
|
70
|
+
points: 路径点列表
|
|
71
|
+
roamTime: 动画时长
|
|
72
|
+
PathType.Straight: 直线
|
|
73
|
+
() => {console.log("finish1");}: 结束事件
|
|
74
|
+
|
|
75
|
+
let animationId1 = viewer.process.animationManager.objectRoamWithoutRotate(viewer, moveSegmentObject, points, roamTime, PathType.Straight, () => {
|
|
76
|
+
console.log("finish1");
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 播放动画
|
|
81
|
+
```
|
|
82
|
+
// 播放全部动画.
|
|
83
|
+
viewer.process.animationManager.run();
|
|
84
|
+
// 播放多段动画.
|
|
85
|
+
viewer.process.animationManager.run([animationId]);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### 暂停动画(保留当前播放进度),并返回当前播放进度(0-1)
|
|
89
|
+
```
|
|
90
|
+
// 重新执行animationManager.run([id])会从当前进度开始.
|
|
91
|
+
|
|
92
|
+
let palyingPercent = viewer.process.animationManager.pauseAnime(animationId);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### 停止动画(播放进度归0),
|
|
96
|
+
```
|
|
97
|
+
//重新执行重新执行animationManager.run([id])会从头开始.
|
|
98
|
+
|
|
99
|
+
viewer.process.animationManager.stopAnime(animationId);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### 停止动画并将对应物体复位
|
|
103
|
+
```
|
|
104
|
+
viewer.process.animationManager.stopAnime(animationId, true);
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### 播放暂停的动画
|
|
108
|
+
```html
|
|
109
|
+
viewer.process.animationManager.run([animationId]);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### 从头开始播放动画
|
|
113
|
+
```html
|
|
114
|
+
viewer.process.animationManager.restartAnime(animationId);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 复位所有进行过的动画的物体.
|
|
118
|
+
```html
|
|
119
|
+
viewer.process.animationManager.resetAnimationItems(viewer);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 删除动画
|
|
123
|
+
```
|
|
124
|
+
viewer.process.animationManager.removeAnime(animationId);
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
### Properties
|
|
18
18
|
|
|
19
|
+
- [currentProperties](PropertyManager.md#currentproperties)
|
|
19
20
|
- [opGroup](PropertyManager.md#opgroup)
|
|
20
21
|
|
|
21
22
|
### Accessors
|
|
@@ -52,6 +53,12 @@ ViewerManagerBase.constructor
|
|
|
52
53
|
|
|
53
54
|
## Properties
|
|
54
55
|
|
|
56
|
+
### currentProperties
|
|
57
|
+
|
|
58
|
+
• **currentProperties**: `any`[] = `[]`
|
|
59
|
+
|
|
60
|
+
___
|
|
61
|
+
|
|
55
62
|
### opGroup
|
|
56
63
|
|
|
57
64
|
• **opGroup**: `PropertyOp`[] = `[]`
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
|
|
25
25
|
### Methods
|
|
26
26
|
|
|
27
|
-
- [
|
|
27
|
+
- [copy](SegmentObject.md#copy)
|
|
28
28
|
- [delete](SegmentObject.md#delete)
|
|
29
29
|
- [equals](SegmentObject.md#equals)
|
|
30
|
-
- [removeAllMaterial](SegmentObject.md#removeallmaterial)
|
|
31
|
-
- [removeMaterial](SegmentObject.md#removematerial)
|
|
32
|
-
- [removeMaterialAt](SegmentObject.md#removematerialat)
|
|
33
|
-
- [removeMaterialByLevel](SegmentObject.md#removematerialbylevel)
|
|
34
30
|
- [rename](SegmentObject.md#rename)
|
|
35
31
|
- [setCutting](SegmentObject.md#setcutting)
|
|
32
|
+
- [setHighlight](SegmentObject.md#sethighlight)
|
|
33
|
+
- [setIsolation](SegmentObject.md#setisolation)
|
|
34
|
+
- [setMaterial](SegmentObject.md#setmaterial)
|
|
35
|
+
- [setVisible](SegmentObject.md#setvisible)
|
|
36
36
|
- [unsetCutting](SegmentObject.md#unsetcutting)
|
|
37
37
|
- [convertToTreeNodeObjects](SegmentObject.md#converttotreenodeobjects)
|
|
38
38
|
- [subtraction](SegmentObject.md#subtraction)
|
|
@@ -166,19 +166,13 @@ ___
|
|
|
166
166
|
|
|
167
167
|
## Methods
|
|
168
168
|
|
|
169
|
-
###
|
|
169
|
+
### copy
|
|
170
170
|
|
|
171
|
-
▸ **
|
|
172
|
-
|
|
173
|
-
#### Parameters
|
|
174
|
-
|
|
175
|
-
| Name | Type |
|
|
176
|
-
| :------ | :------ |
|
|
177
|
-
| `material` | [`Material`](Material.md) |
|
|
171
|
+
▸ **copy**(): [`SegmentObject`](SegmentObject.md)
|
|
178
172
|
|
|
179
173
|
#### Returns
|
|
180
174
|
|
|
181
|
-
`
|
|
175
|
+
[`SegmentObject`](SegmentObject.md)
|
|
182
176
|
|
|
183
177
|
___
|
|
184
178
|
|
|
@@ -208,9 +202,15 @@ ___
|
|
|
208
202
|
|
|
209
203
|
___
|
|
210
204
|
|
|
211
|
-
###
|
|
205
|
+
### rename
|
|
206
|
+
|
|
207
|
+
▸ **rename**(`name`): `void`
|
|
208
|
+
|
|
209
|
+
#### Parameters
|
|
212
210
|
|
|
213
|
-
|
|
211
|
+
| Name | Type |
|
|
212
|
+
| :------ | :------ |
|
|
213
|
+
| `name` | `any` |
|
|
214
214
|
|
|
215
215
|
#### Returns
|
|
216
216
|
|
|
@@ -218,15 +218,17 @@ ___
|
|
|
218
218
|
|
|
219
219
|
___
|
|
220
220
|
|
|
221
|
-
###
|
|
221
|
+
### setCutting
|
|
222
|
+
|
|
223
|
+
▸ **setCutting**(`cuttingOptions`): `void`
|
|
222
224
|
|
|
223
|
-
|
|
225
|
+
创建剖切,通过剖切选项创建剖切
|
|
224
226
|
|
|
225
227
|
#### Parameters
|
|
226
228
|
|
|
227
|
-
| Name | Type |
|
|
228
|
-
| :------ | :------ |
|
|
229
|
-
| `
|
|
229
|
+
| Name | Type | Description |
|
|
230
|
+
| :------ | :------ | :------ |
|
|
231
|
+
| `cuttingOptions` | [`CuttingOptions`](CuttingOptions.md) | 剖切选项 |
|
|
230
232
|
|
|
231
233
|
#### Returns
|
|
232
234
|
|
|
@@ -234,15 +236,15 @@ ___
|
|
|
234
236
|
|
|
235
237
|
___
|
|
236
238
|
|
|
237
|
-
###
|
|
239
|
+
### setHighlight
|
|
238
240
|
|
|
239
|
-
▸ **
|
|
241
|
+
▸ **setHighlight**(`isHighlight`): `void`
|
|
240
242
|
|
|
241
243
|
#### Parameters
|
|
242
244
|
|
|
243
245
|
| Name | Type |
|
|
244
246
|
| :------ | :------ |
|
|
245
|
-
| `
|
|
247
|
+
| `isHighlight` | `boolean` |
|
|
246
248
|
|
|
247
249
|
#### Returns
|
|
248
250
|
|
|
@@ -250,15 +252,15 @@ ___
|
|
|
250
252
|
|
|
251
253
|
___
|
|
252
254
|
|
|
253
|
-
###
|
|
255
|
+
### setIsolation
|
|
254
256
|
|
|
255
|
-
▸ **
|
|
257
|
+
▸ **setIsolation**(`isIsolation`): `void`
|
|
256
258
|
|
|
257
259
|
#### Parameters
|
|
258
260
|
|
|
259
261
|
| Name | Type |
|
|
260
262
|
| :------ | :------ |
|
|
261
|
-
| `
|
|
263
|
+
| `isIsolation` | `boolean` |
|
|
262
264
|
|
|
263
265
|
#### Returns
|
|
264
266
|
|
|
@@ -266,15 +268,15 @@ ___
|
|
|
266
268
|
|
|
267
269
|
___
|
|
268
270
|
|
|
269
|
-
###
|
|
271
|
+
### setMaterial
|
|
270
272
|
|
|
271
|
-
▸ **
|
|
273
|
+
▸ **setMaterial**(`material?`): `void`
|
|
272
274
|
|
|
273
275
|
#### Parameters
|
|
274
276
|
|
|
275
277
|
| Name | Type |
|
|
276
278
|
| :------ | :------ |
|
|
277
|
-
| `
|
|
279
|
+
| `material?` | [`Material`](Material.md) |
|
|
278
280
|
|
|
279
281
|
#### Returns
|
|
280
282
|
|
|
@@ -282,17 +284,15 @@ ___
|
|
|
282
284
|
|
|
283
285
|
___
|
|
284
286
|
|
|
285
|
-
###
|
|
287
|
+
### setVisible
|
|
286
288
|
|
|
287
|
-
▸ **
|
|
288
|
-
|
|
289
|
-
创建剖切,通过剖切选项创建剖切
|
|
289
|
+
▸ **setVisible**(`visible`): `void`
|
|
290
290
|
|
|
291
291
|
#### Parameters
|
|
292
292
|
|
|
293
|
-
| Name | Type |
|
|
294
|
-
| :------ | :------ |
|
|
295
|
-
| `
|
|
293
|
+
| Name | Type |
|
|
294
|
+
| :------ | :------ |
|
|
295
|
+
| `visible` | `boolean` |
|
|
296
296
|
|
|
297
297
|
#### Returns
|
|
298
298
|
|
package/docs/classes/Viewer.md
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
- [collisionComputing](Viewer.md#collisioncomputing)
|
|
30
30
|
- [componentManager](Viewer.md#componentmanager)
|
|
31
31
|
- [container](Viewer.md#container)
|
|
32
|
+
- [documentChanged](Viewer.md#documentchanged)
|
|
32
33
|
- [geometryItem](Viewer.md#geometryitem)
|
|
33
34
|
- [geometryItems](Viewer.md#geometryitems)
|
|
34
35
|
- [gl](Viewer.md#gl)
|
|
@@ -169,6 +170,7 @@
|
|
|
169
170
|
- [updateDisplay](Viewer.md#updatedisplay)
|
|
170
171
|
- [updateDisplayWithFramerate](Viewer.md#updatedisplaywithframerate)
|
|
171
172
|
- [updateDisplayWithTime](Viewer.md#updatedisplaywithtime)
|
|
173
|
+
- [updateDocument](Viewer.md#updatedocument)
|
|
172
174
|
- [updateSize](Viewer.md#updatesize)
|
|
173
175
|
- [worldPointToPixelPoint](Viewer.md#worldpointtopixelpoint)
|
|
174
176
|
- [zUnitLength](Viewer.md#zunitlength)
|
|
@@ -297,6 +299,16 @@ Longan.Viewer.container
|
|
|
297
299
|
|
|
298
300
|
___
|
|
299
301
|
|
|
302
|
+
### documentChanged
|
|
303
|
+
|
|
304
|
+
• **documentChanged**: `List`<`Function`\>
|
|
305
|
+
|
|
306
|
+
#### Inherited from
|
|
307
|
+
|
|
308
|
+
Longan.Viewer.documentChanged
|
|
309
|
+
|
|
310
|
+
___
|
|
311
|
+
|
|
300
312
|
### geometryItem
|
|
301
313
|
|
|
302
314
|
• **geometryItem**: `List`<`Function`\>
|
|
@@ -2128,13 +2140,16 @@ ___
|
|
|
2128
2140
|
|
|
2129
2141
|
### loadModelByMCA
|
|
2130
2142
|
|
|
2131
|
-
▸ **loadModelByMCA**(`mca`): `Promise`<`RenderObject`\>
|
|
2143
|
+
▸ **loadModelByMCA**(`mca`, `isReplace?`): `Promise`<`RenderObject`\>
|
|
2144
|
+
|
|
2145
|
+
根据MCA加载模型
|
|
2132
2146
|
|
|
2133
2147
|
#### Parameters
|
|
2134
2148
|
|
|
2135
|
-
| Name | Type |
|
|
2136
|
-
| :------ | :------ |
|
|
2137
|
-
| `mca` | `any` |
|
|
2149
|
+
| Name | Type | Default value |
|
|
2150
|
+
| :------ | :------ | :------ |
|
|
2151
|
+
| `mca` | `any` | `undefined` |
|
|
2152
|
+
| `isReplace` | `boolean` | `false` |
|
|
2138
2153
|
|
|
2139
2154
|
#### Returns
|
|
2140
2155
|
|
|
@@ -2498,6 +2513,20 @@ Longan.Viewer.updateDisplayWithTime
|
|
|
2498
2513
|
|
|
2499
2514
|
___
|
|
2500
2515
|
|
|
2516
|
+
### updateDocument
|
|
2517
|
+
|
|
2518
|
+
▸ **updateDocument**(): `void`
|
|
2519
|
+
|
|
2520
|
+
#### Returns
|
|
2521
|
+
|
|
2522
|
+
`void`
|
|
2523
|
+
|
|
2524
|
+
#### Inherited from
|
|
2525
|
+
|
|
2526
|
+
Longan.Viewer.updateDocument
|
|
2527
|
+
|
|
2528
|
+
___
|
|
2529
|
+
|
|
2501
2530
|
### updateSize
|
|
2502
2531
|
|
|
2503
2532
|
▸ **updateSize**(): `void`
|