# ModelExplosion

#### new Cesium.ModelExplosion(viewer)
MapGIS/Tools/ModelExplosion.js 20

模型爆炸工具集

Name | Type | Description
--- | --- | ---
`viewer` | Viewer | 场景视图

Author:
  - 基础平台-周凌风

### Methods

#### explosionByField(M3DSets, options)
MapGIS/Tools/ModelExplosion.js 699

根据图层的属性，进行模型爆炸，1.0模型仅支持针对oid的属性爆炸，2.0的模型可支持模型的任意自带属性

Name | Type | Description
--- | --- | ---
`M3DSets` | Array.<MapGISM3DSet> | M3DSet数组
`options` | Object | 附加参数
Name | Type | Default | Description
--- | --- | --- | ---
`moveDirection` | Cartesian3 | `new Cartesian3(1, 0, 0)` | optional 爆炸方向，可以任意设置
`field` | String | `'oid'` | optional 过滤字段名，默认oid
`valueGroups` | Object | `[]` | optional 爆炸过滤参数
`type` | String | `unique` | optional 过滤方式，unique：单值，range：分段，contain：包含
`singleDirection` | Boolean | `true` | optional 是否单向爆炸，true：单向爆炸，false：多向爆炸
`enableFrameFunction` | Boolean | `false` | optional 启用帧函数，即每一帧执行过滤操作，针对lod的模型实时过滤

#### modelExplosion(layers, options)
MapGIS/Tools/ModelExplosion.js 1132

多图层-轴向爆炸-ID爆炸

Name | Type | Description
--- | --- | ---
`layers` | Array | 图层数组
`options` | Object | 附加参数
Name | Type | Default | Description
--- | --- | --- | ---
`moveDirection` | Cartesian3 | `new Cartesian3(1, 0, 0)` | optional 爆炸方向
`expDistance` | Number | `1` | optional 爆炸间距
`isSingleLayer` | Number | `false` | optional 是否是单图层
`version` | Number | `1.0` | optional 模型版本号

#### multiLayerAxisExplosionNoAnimate(M3DSets, options)
MapGIS/Tools/ModelExplosion.js 1141

多图层-轴向爆炸-无动画

Name | Type | Description
--- | --- | ---
`M3DSets` | Array.<MapGISM3DSet> | M3DSet数组
`options` | Object | 附加参数
Name | Type | Default | Description
--- | --- | --- | ---
`moveDirection` | Cartesian3 | `new Cartesian3(1, 0, 0)` | optional 爆炸方向
`expDistance` | Number | `1` | optional 爆炸间距

#### multiLayerAxisExplosionWithAnimate(M3DSets)
MapGIS/Tools/ModelExplosion.js 475

多图层-轴向爆炸-有动画

Name | Type | Default | Description
--- | --- | --- | ---
`M3DSets` | Array.<MapGISM3DSet> |  | M3DSet数组
`options.moveDirection` | Cartesian3 | `new Cartesian3(1, 0, 0)` | optional 爆炸方向
`options.expDistance` | Number | `1` | optional 爆炸间距
`options.speed` | Number | `1` | optional 爆炸动画速度

#### multiLayerCenterExplosionNoAnimate(M3DSets, options)
MapGIS/Tools/ModelExplosion.js 1294

多图层-中心点爆炸-无动画

Name | Type | Description
--- | --- | ---
`M3DSets` | Array.<MapGISM3DSet> | M3DSet数组
`options` | Object | 附加属性
Name | Type | Default | Description
--- | --- | --- | ---
`center` | Cartesian3 |  | 中心点坐标
`expDistance` | Number | `1` | optional 爆炸间隔距离

#### multiLayerCenterExplosionWithAnimate(M3DSets, options)
MapGIS/Tools/ModelExplosion.js 1256

多图层-中心点爆炸-有动画

Name | Type | Description
--- | --- | ---
`M3DSets` | Array.<MapGISM3DSet> | M3DSet数组
`options` | Object | 附加属性
Name | Type | Default | Description
--- | --- | --- | ---
`center` | Cartesian3 |  | 中心点坐标
`expDistance` | Number | `1` | optional 爆炸间隔距离
`speed` | Number | `1` | optional 动画中移动速度

#### recover(layers)
MapGIS/Tools/ModelExplosion.js 1344

将mapgism3d的modelExplosion属性修改为false，确保不对其他功能造成性能影响

Name | Type | Description
--- | --- | ---
`layers` | Array | 图层数组

#### removeModelExplosion(layers)
MapGIS/Tools/ModelExplosion.js 1330

移除爆炸

Name | Type | Description
--- | --- | ---
`layers` | Array | 图层数组

#### resetExplosionByField()
MapGIS/Tools/ModelExplosion.js 1390

还原爆炸

#### singleLayerAxisExplosionNoAnimate(MapGISM3DSet, options)
MapGIS/Tools/ModelExplosion.js 372

单图层-轴向爆炸-无动画

Name | Type | Description
--- | --- | ---
`MapGISM3DSet` | MapGISM3DSet |
`options` | Object | 附加参数
Name | Type | Default | Description
--- | --- | --- | ---
`direction` | Cartesian3 | `new Cartesian3(0,0,1)` | optional 爆炸方向
`expDistance` | Number | `100` | optional 爆炸间距

#### singleLayerAxisExplosionWithAnimate(MapGISM3DSet, options)
MapGIS/Tools/ModelExplosion.js 316

单图层-轴向爆炸-有动画

Name | Type | Description
--- | --- | ---
`MapGISM3DSet` | MapGISM3DSet |
`options` | Object | 附加参数
Name | Type | Default | Description
--- | --- | --- | ---
`direction` | Cartesian3 | `new Cartesian3(0,0,1)` | optional 爆炸方向
`expDistance` | Number | `1` | optional 爆炸间距
`speed` | Number | `1` | optional 动画中移动速度

#### singleLayerCenterExplosionNoAnimate(MapGISM3DSet, options)
MapGIS/Tools/ModelExplosion.js 273

单图层-中心点爆炸-无动画

Name | Type | Description
--- | --- | ---
`MapGISM3DSet` | MapGISM3DSet |
`options` | Object | 附加参数
Name | Type | Default | Description
--- | --- | --- | ---
`center` | Cartesian3 |  | 中心点坐标
`expDistance` | Number | `1` | optional 爆炸间隔距离

#### singleLayerCenterExplosionWithAnimate(MapGISM3DSet, options)
MapGIS/Tools/ModelExplosion.js 222

单图层-中心点爆炸-有动画

Name | Type | Description
--- | --- | ---
`MapGISM3DSet` | MapGISM3DSet |
`options` | Object | 附加参数
Name | Type | Default | Description
--- | --- | --- | ---
`center` | Cartesian3 |  | 中心点坐标
`expDistance` | Number | `1` | optional 爆炸间隔距离
`speed` | Number | `1` | optional 动画中移动速度

#### transformTileset(tileset, options)
MapGIS/Tools/ModelExplosion.js 1215

特别注意这个函数不能被多图层的爆照循环调用 原因在于单个图层的局部坐标系是由偏移，如果各自按照各自的远原点来爆炸不会是想象中的那么整齐 必须通过第一个图层的原点作为整个合并空间的原点才好控制量纲

Name | Type | Description
--- | --- | ---
`tileset` | * |
`options` | * |