gs-bim-air 0.0.3-0.2 → 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 CHANGED
@@ -5,4 +5,8 @@
5
5
  - 添加获取与修改Viewer相机信息的接口 (Viewer.camera)
6
6
  - 添加设置右键菜单默认显示隐藏的开关配置 (Options.components.contextMenu.visible)
7
7
  - 更新了路径平移动画的功能,添加了对应的demo和说明文档.
8
+
9
+ ### 0.0.30.5
10
+ - 修复双屏窗口updateSize问题
11
+ - 修复多viewer及加载相同模型时路径动画的问题
8
12
 
@@ -61,8 +61,7 @@
61
61
 
62
62
  // 动画移动的对象
63
63
  let moveObjId = "QMD+M+4G+HYD+XDRA01+EL002";
64
- let key = JS_Show_Key_By_Id(moveObjId);
65
- let moveSegmentObject = new 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 key = JS_Show_Key_By_Id(moveObjId);
112
- let moveSegmentObject = new 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`[] = `[]`
@@ -127,7 +134,7 @@ ___
127
134
 
128
135
  ### getProperty
129
136
 
130
- ▸ **getProperty**(`segmentObject`): `Promise`<`any`\>
137
+ ▸ **getProperty**(`segmentObject`): `Promise`<`any`[]\>
131
138
 
132
139
  #### Parameters
133
140
 
@@ -137,7 +144,7 @@ ___
137
144
 
138
145
  #### Returns
139
146
 
140
- `Promise`<`any`\>
147
+ `Promise`<`any`[]\>
141
148
 
142
149
  ___
143
150
 
@@ -24,15 +24,15 @@
24
24
 
25
25
  ### Methods
26
26
 
27
- - [addMaterial](SegmentObject.md#addmaterial)
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
- ### addMaterial
169
+ ### copy
170
170
 
171
- ▸ **addMaterial**(`material`): `void`
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
- `void`
175
+ [`SegmentObject`](SegmentObject.md)
182
176
 
183
177
  ___
184
178
 
@@ -208,9 +202,15 @@ ___
208
202
 
209
203
  ___
210
204
 
211
- ### removeAllMaterial
205
+ ### rename
206
+
207
+ ▸ **rename**(`name`): `void`
208
+
209
+ #### Parameters
212
210
 
213
- **removeAllMaterial**(): `void`
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
- ### removeMaterial
221
+ ### setCutting
222
+
223
+ ▸ **setCutting**(`cuttingOptions`): `void`
222
224
 
223
- ▸ **removeMaterial**(`material`): `void`
225
+ 创建剖切,通过剖切选项创建剖切
224
226
 
225
227
  #### Parameters
226
228
 
227
- | Name | Type |
228
- | :------ | :------ |
229
- | `material` | [`Material`](Material.md) |
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
- ### removeMaterialAt
239
+ ### setHighlight
238
240
 
239
- ▸ **removeMaterialAt**(`index`): `void`
241
+ ▸ **setHighlight**(`isHighlight`): `void`
240
242
 
241
243
  #### Parameters
242
244
 
243
245
  | Name | Type |
244
246
  | :------ | :------ |
245
- | `index` | `number` |
247
+ | `isHighlight` | `boolean` |
246
248
 
247
249
  #### Returns
248
250
 
@@ -250,15 +252,15 @@ ___
250
252
 
251
253
  ___
252
254
 
253
- ### removeMaterialByLevel
255
+ ### setIsolation
254
256
 
255
- ▸ **removeMaterialByLevel**(`level`): `void`
257
+ ▸ **setIsolation**(`isIsolation`): `void`
256
258
 
257
259
  #### Parameters
258
260
 
259
261
  | Name | Type |
260
262
  | :------ | :------ |
261
- | `level` | `number` |
263
+ | `isIsolation` | `boolean` |
262
264
 
263
265
  #### Returns
264
266
 
@@ -266,15 +268,15 @@ ___
266
268
 
267
269
  ___
268
270
 
269
- ### rename
271
+ ### setMaterial
270
272
 
271
- ▸ **rename**(`name`): `void`
273
+ ▸ **setMaterial**(`material?`): `void`
272
274
 
273
275
  #### Parameters
274
276
 
275
277
  | Name | Type |
276
278
  | :------ | :------ |
277
- | `name` | `any` |
279
+ | `material?` | [`Material`](Material.md) |
278
280
 
279
281
  #### Returns
280
282
 
@@ -282,17 +284,15 @@ ___
282
284
 
283
285
  ___
284
286
 
285
- ### setCutting
287
+ ### setVisible
286
288
 
287
- ▸ **setCutting**(`cuttingOptions`): `void`
288
-
289
- 创建剖切,通过剖切选项创建剖切
289
+ ▸ **setVisible**(`visible`): `void`
290
290
 
291
291
  #### Parameters
292
292
 
293
- | Name | Type | Description |
294
- | :------ | :------ | :------ |
295
- | `cuttingOptions` | [`CuttingOptions`](CuttingOptions.md) | 剖切选项 |
293
+ | Name | Type |
294
+ | :------ | :------ |
295
+ | `visible` | `boolean` |
296
296
 
297
297
  #### Returns
298
298
 
@@ -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)
@@ -149,6 +150,7 @@
149
150
  - [initManagers](Viewer.md#initmanagers)
150
151
  - [instantiateRenderObject](Viewer.md#instantiaterenderobject)
151
152
  - [loadLocalModel](Viewer.md#loadlocalmodel)
153
+ - [loadModelByMCA](Viewer.md#loadmodelbymca)
152
154
  - [loadModels](Viewer.md#loadmodels)
153
155
  - [locateObject](Viewer.md#locateobject)
154
156
  - [locatePoint](Viewer.md#locatepoint)
@@ -168,6 +170,7 @@
168
170
  - [updateDisplay](Viewer.md#updatedisplay)
169
171
  - [updateDisplayWithFramerate](Viewer.md#updatedisplaywithframerate)
170
172
  - [updateDisplayWithTime](Viewer.md#updatedisplaywithtime)
173
+ - [updateDocument](Viewer.md#updatedocument)
171
174
  - [updateSize](Viewer.md#updatesize)
172
175
  - [worldPointToPixelPoint](Viewer.md#worldpointtopixelpoint)
173
176
  - [zUnitLength](Viewer.md#zunitlength)
@@ -296,6 +299,16 @@ Longan.Viewer.container
296
299
 
297
300
  ___
298
301
 
302
+ ### documentChanged
303
+
304
+ • **documentChanged**: `List`<`Function`\>
305
+
306
+ #### Inherited from
307
+
308
+ Longan.Viewer.documentChanged
309
+
310
+ ___
311
+
299
312
  ### geometryItem
300
313
 
301
314
  • **geometryItem**: `List`<`Function`\>
@@ -2106,7 +2119,7 @@ ___
2106
2119
 
2107
2120
  ### loadLocalModel
2108
2121
 
2109
- ▸ **loadLocalModel**(`path`, `name`): `Promise`<[`LightModel`](LightModel.md)\>
2122
+ ▸ **loadLocalModel**(`path`, `name`): `Promise`<`RenderObject`\>
2110
2123
 
2111
2124
  加载本地gsl文件
2112
2125
 
@@ -2119,12 +2132,31 @@ ___
2119
2132
 
2120
2133
  #### Returns
2121
2134
 
2122
- `Promise`<[`LightModel`](LightModel.md)\>
2135
+ `Promise`<`RenderObject`\>
2123
2136
 
2124
2137
  模型
2125
2138
 
2126
2139
  ___
2127
2140
 
2141
+ ### loadModelByMCA
2142
+
2143
+ ▸ **loadModelByMCA**(`mca`, `isReplace?`): `Promise`<`RenderObject`\>
2144
+
2145
+ 根据MCA加载模型
2146
+
2147
+ #### Parameters
2148
+
2149
+ | Name | Type | Default value |
2150
+ | :------ | :------ | :------ |
2151
+ | `mca` | `any` | `undefined` |
2152
+ | `isReplace` | `boolean` | `false` |
2153
+
2154
+ #### Returns
2155
+
2156
+ `Promise`<`RenderObject`\>
2157
+
2158
+ ___
2159
+
2128
2160
  ### loadModels
2129
2161
 
2130
2162
  ▸ **loadModels**(`modelIds`, `isReplace?`, `isSingleModel?`): `Promise`<[`LightModel`](LightModel.md)[]\>
@@ -2481,6 +2513,20 @@ Longan.Viewer.updateDisplayWithTime
2481
2513
 
2482
2514
  ___
2483
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
+
2484
2530
  ### updateSize
2485
2531
 
2486
2532
  ▸ **updateSize**(): `void`