# ModelExplosion

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

模型爆炸工具集

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

Author:
  - 基础平台-周凌风

### Methods

#### explosionByField(layers, options)
MapGIS/Tools/ModelExplosion.js 562

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

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

`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 926

多图层-轴向爆炸-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(layers, options)
MapGIS/Tools/ModelExplosion.js 935

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

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

`options`

Object

附加参数

Name | Type | Default | Description
--- | --- | --- | ---
`moveDirection` | Cartesian3 | `new Cartesian3(1, 0, 0)` | optional 爆炸方向
`expDistance` | Number | `1` | optional 爆炸间距

#### multiLayerAxisExplosionWithAnimate(layerList)
MapGIS/Tools/ModelExplosion.js 472

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

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

#### multiLayerCenterExplosionNoAnimate(layers, options)
MapGIS/Tools/ModelExplosion.js 1086

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

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

`options`

Object

附加属性

Name | Type | Default | Description
--- | --- | --- | ---
`center` | Cartesian3 |  | 中心点坐标
`expDistance` | Number | `1` | optional 爆炸间隔距离

#### multiLayerCenterExplosionWithAnimate(layers, options)
MapGIS/Tools/ModelExplosion.js 1050

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

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

`options`

Object

附加属性

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

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

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

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

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

移除爆炸

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

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

还原爆炸

#### singleLayerAxisExplosionNoAnimate(layer, options)
MapGIS/Tools/ModelExplosion.js 369

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

Name | Type | Description
--- | --- | ---
`layer` | Object | 图层

`options`

Object

附加参数

Name | Type | Default | Description
--- | --- | --- | ---
`direction` | Cartesian3 | `new Cartesian3(0,0,1)` | optional 爆炸方向
`expDistance` | Number | `100` | optional 爆炸间距

#### singleLayerAxisExplosionWithAnimate(layer, options)
MapGIS/Tools/ModelExplosion.js 313

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

Name | Type | Description
--- | --- | ---
`layer` | Object | 图层

`options`

Object

附加参数

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

#### singleLayerCenterExplosionNoAnimate(layer, options)
MapGIS/Tools/ModelExplosion.js 270

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

Name | Type | Description
--- | --- | ---
`layer` | Object | 图层

`options`

Object

附加参数

Name | Type | Default | Description
--- | --- | --- | ---
`center` | Cartesian3 |  | 中心点坐标
`expDistance` | Number | `1` | optional 爆炸间隔距离

#### singleLayerCenterExplosionWithAnimate(layer, options)
MapGIS/Tools/ModelExplosion.js 219

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

Name | Type | Description
--- | --- | ---
`layer` | Object | 图层

`options`

Object

附加参数

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

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

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

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