# VoxelPrimitive

#### new Cesium.VoxelPrimitive(url, options)
MapGIS/Scene/VoxelPrimitive.js 42

栅格体元数据图元

Name | Type | Description
--- | --- | ---
`url` | String |
`options` | Object |
Name | Type | Default | Description
--- | --- | --- | ---
`show` | Boolean | `true` | optional 是否显示
`minThreshold` | Number | `0` | optional 属性过滤最小阈值
`maxThreshold` | Number | `1` | optional 属性过滤最大阈值
`opacity` | Number | `1` | optional 不透明度
`steps` | Number | `200` | optional 采样步长
`heightScale` | Number | `1` | optional 高度缩放
`colorScheme` | HTMLCanvasElement |  | optional 配色方案
`loaded` | function |  | optional 加载完成回调函数

##### Example:

    var volxel = new Cesium.VoxelPrimitive(url, {
        heightScale : 100,
        loaded : function() {}
    });

### Members

#### heightScale : Number
MapGIS/Scene/VoxelPrimitive.js 165

高度缩放

#### opacity : Number
MapGIS/Scene/VoxelPrimitive.js 137

不透明度

#### show : Boolean
MapGIS/Scene/VoxelPrimitive.js 179

是否显示

#### steps : Number
MapGIS/Scene/VoxelPrimitive.js 151

步长

### Methods

#### queryPropertyValue(screenCoordinates) → Object
MapGIS/Scene/VoxelPrimitive.js 263

属性值查询

Name | Type | Description
--- | --- | ---
`screenCoordinates` | Cartesian2 |

##### Returns:

#### setColorScheme(canvas2d)
MapGIS/Scene/VoxelPrimitive.js 208

设置配色方案

Name | Type | Description
--- | --- | ---
`canvas2d` | HTMLCanvasElement |

##### Example:

    var canvas2d = document.createElement('canvas');
    canvas2d.width = 100;
    canvas2d.height = 1;
    var ctx = canvas2d.getContext("2d");
    var gradient = ctx.createLinearGradient(0, 0, canvas2d.width, 0);
    gradient.addColorStop(0, "rgba(254, 35, 10, 1)");
    gradient.addColorStop(0.33, "rgba(242, 254, 30, 1)");
    gradient.addColorStop(0.67, "rgba(22, 253, 255, 1)");
    gradient.addColorStop(1, "rgba(92, 9, 252, 1)");
    ctx.fillStyle = gradient;
    ctx.fillRect(0, 0, canvas2d.width, canvas2d.height);
    volxel.setColorScheme(canvas2d);

#### setFilterRange(minValue, maxValue)
MapGIS/Scene/VoxelPrimitive.js 222

设置过滤范围

Name | Type | Description
--- | --- | ---
`minValue` | Number | 最小值
`maxValue` | Number | optional 最大值

#### setPlaybackFrame(frameIndex)
MapGIS/Scene/VoxelPrimitive.js 242

设置播放帧

Name | Type | Description
--- | --- | ---
`frameIndex` | Number | 数据的帧索引