#### # new VisiblityAnalysis(options)

通视分析

#### 参数:

名称 | 类型 | 默认值 | 描述
--- | --- | --- | ---
`options` | Object |  | 附加参数
`scene` | Scene |  | Cesium 场景对象
`visibleColor` | Cesium.Color | new Cesium.Color(0, 1, 0, 0.5) | 设置可视段颜色
`unvisibleColor` | Cesium.Color | new Cesium.Color(1, 0, 0, 0.5) | 设置不可视段颜色
`exHeight` | Number | 0 | 设置视点附加高度
`fanColor` | Cesium.Color | new Cesium.Color(79 / 255, 238 / 255, 215 / 255, 0.2) | 环型通视分析视窗颜色
`fanGridColor` | Cesium.Color | Cesium.Color.WHITE | 环型通视分析视窗网格颜色

##### 示例

    // ES5引入方式
    const { VisiblityAnalysis } = zondy.cesium
    // ES6引入方式
    import { VisiblityAnalysis } from "@mapgis/webclient-cesium-plugin"

    // 1. 给定观察点与目标点进行通视分析
    var visiblity = new VisiblityAnalysis({ scene: scene });
    scene.visualAnalysisManager.add(visiblity);
    visiblity.viewPosition = new Cesium.Cartesian3(6378138.905101178, 22.20128910645181, 16.69161471354458);
    visiblity.targetPosition = new Cesium.Cartesian3(6378158.153515804, 47.68794749465568, 34.93181937554349);

    // 2. 监听鼠标事件进行通视分析
    var visiblityAction = true;
    var visiblitying = false;
    var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
    // 左键开始
    handler.setInputAction(function (movement) {
        if (visiblity !== undefined) {
            if (visiblityAction) {
                var cartesian = viewer.scene.pickPosition(movement.position);
                var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
                cartographic.height += 1.0; //避免埋入模型中
                cartesian = Cesium.Cartographic.toCartesian(cartographic);
                if (cartesian !== undefined && !visiblitying) {
                    visiblity.viewPosition = cartesian;
                } else {
                    visiblity.targetPosition = cartesian;
                    visiblityAction = false;
                }
                visiblitying = true;
            }
            console.log(visiblity.viewPosition);
        }
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
    //鼠标右键结束
    handler.setInputAction(function (movement) {
        if (visiblitying) {
            var cartesian = viewer.scene.pickPosition(movement.position);
            if (cartesian !== undefined) {
                visiblity.targetPosition = cartesian;
            }
            visiblityAction = false;
            visiblitying = false;
        }
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
    handler.setInputAction(function (movement) {
        if (visiblitying) {
            var cartesian = viewer.scene.pickPosition(movement.endPosition);
            if (cartesian) {
                visiblity.targetPosition = cartesian;
            }
        }
    }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

    // 3. 创建环形通视分析
    var drawElement = new zondy.cesium.DrawElement(viewer);
    drawElement.startDrawingCircle({
        color: new Cesium.Color(0.2, 0.4, 0.3, 1.0),
        callback: function (result) {
            drawElement.stopDrawing();
            visiblity.lookAroundAnalysis({
                viewPosition: result.center,
                radius: result.radius,
                percentCallback: function (percent) {
                    console.log(percent);
                }
            });
        }
    });

    // 4. 移除通视分析
    scene.visualAnalysisManager.remove(visiblity);
    visiblity.destroy();

### 成员变量

类型: Number

#### # exHeight

设置视点附加高度，需要在分析前设置

类型: Cesium.Color

#### # fanColor

设置环型通视分析视窗颜色

类型: Cesium.Color

#### # fanGridColor

设置环型通视分析视窗网格颜色

类型: Boolean

#### # isVisible

获取当前是否可见

类型: Cesium.Cartesian3

#### # targetPosition

目标点

类型: Cesium.Color

#### # unvisibleColor

设置不可视段颜色

类型: Cesium.Cartesian3

#### # unVisiblityPosition

遮挡点

类型: Cesium.Cartesian3

#### # viewPosition

观察点

类型: Cesium.Color

#### # visibleColor

设置可视段颜色

类型: Number

#### # width

通视线的宽度

### 方法

#### # getVisibilityResult(viewPosition, targetPosition)

根据两点坐标判断两点之间是否可视，返回结果

#### 参数:

名称 | 类型 | 描述
--- | --- | ---
`viewPosition` | Cesium.Cartesian3 | 视点
`targetPosition` | Cesium.Cartesian3 | 目标点

返回值:

visible 两点之间是否可视

类型: Boolean

#### # lookAroundAnalysis(options)

环形通视分析

#### 参数:

名称 | 类型 | 默认值 | 描述
--- | --- | --- | ---
`options` | Object |  |
`viewPosition` | Cesium.Cartesian3 |  | 视点
`radius` | Number |  | 环形通视分析半径
`verticalAngle` | Number | 60 | 垂直视角，默认为60°
`divideAngle` | Number | 10 | 等分角度，默认为10°
`percentCallback` | function |  | 计算进度回调