
const Cesium = (window as any).Cesium
const SuperMap = (window as any).SuperMap
/********************************************模块公用方法*********************************************/
//保留小数位数
export function roundFun(value, n) {
    return Math.round(setNullAndUndefinedEmpty(value) * Math.pow(10, n)) / Math.pow(10, n)
}
//精度减法
export function subtraction(a, b) {
    var c, d, e
    try {
        c = a.toString().split('.')[1].length
    } catch (f) {
        c = 0
    }
    try {
        d = b.toString().split('.')[1].length
    } catch (f) {
        d = 0
    }
    function mul(a, b) {
        var c = 0,
            d = a.toString(),
            e = b.toString()
        try {
            c += d.split('.')[1].length
        } catch (f) { }
        try {
            c += e.split('.')[1].length
        } catch (f) { }
        return (Number(d.replace('.', '')) * Number(e.replace('.', ''))) / Math.pow(10, c)
    }
    return (e = Math.pow(10, Math.max(c, d))), (mul(a, e) - mul(b, e)) / e
}
//数据检查公共方法(针对数字)
export function setNullAndUndefinedEmpty(input) {
    if (
        input === 'Null' ||
        input === 'null' ||
        input === 'NULL' ||
        input === null ||
        input === undefined ||
        input === '' ||
        input === Infinity ||
        Object.is(input, NaN)
    ) {
        return 0
    } else {
        return input
    }
}
//数据检查公共方法(针对文本)
export function setNullAndUndefined(input, type?) {
    if (input === null && type === 'user') return "本系统创建";
    if (input === null || input === undefined || input === "" || (input + "").toLowerCase() ===
        "null" || (input + "").toLowerCase() === "undefined") {
        return "/"
    } else {
        return input
    }
}
//图表字体自适配函数
export function fontSize(res) {
    let docEl = document.documentElement,
        clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
    if (!clientWidth) return
    // 此处的1920 为设计稿的宽度，记得修改！
    let fontSize = clientWidth / 1920
    return res * fontSize
}
//获取场景里的点的经纬度（模型上的点）
export function getLatAndLon(viewer, movement) {
    let cartesian = viewer.scene.pickPosition(movement.position)
    let cartographic = Cesium.Cartographic.fromCartesian(cartesian)
    let lng = Cesium.Math.toDegrees(cartographic.longitude) // 经度
    let lat = Cesium.Math.toDegrees(cartographic.latitude) // 纬度
    let alt = cartographic.height // 高度
    let coordinate = {
        longitude: Number(lng.toFixed(6)),
        latitude: Number(lat.toFixed(6)),
        altitude: Number(alt.toFixed(2))
    }
    return coordinate
}
/********************************************部件查看公用方法*********************************************/
//创建提示工具
export const createTooltip = function (frameDiv) {

    let tooltip = function (frameDiv) {

        let div = document.createElement('DIV');
        div.className = "twipsy right";

        let arrow = document.createElement('DIV');
        arrow.className = "twipsy-arrow";
        div.appendChild(arrow);

        let title = document.createElement('DIV');
        title.className = "twipsy-inner";
        div.appendChild(title);

        this._div = div;
        this._title = title;
        this.message = '';

        // add to frame div and display coordinates
        frameDiv.appendChild(div);
        let that = this;
        div.onmousemove = function (evt) {
            that.showAt({
                x: evt.clientX,
                y: evt.clientY
            }, that.message);
        };
    };

    tooltip.prototype.setVisible = function (visible) {
        this._div.style.display = visible ? 'block' : 'none';
    };

    tooltip.prototype.showAt = function (position, message) {
        if (position && message) {
            this.setVisible(true);
            this._title.innerHTML = message;
            this._div.style.left = position.x + 30 + "px";
            this._div.style.top = (position.y - this._div.clientHeight) + "px";
            this.message = message;
        }
    };

    tooltip.prototype.remove = function () {
        frameDiv.removeChild(this._div)
    };

    return new tooltip(frameDiv);
}
/**
 * 该方法用于将cesium三维面缓冲区转换为iserver查询需使用的面图形
 * @param ellipseBuffer 缓冲区
 */
export const converCesiumToSuperMapEllipse = function (ellipseBuffer) {
    if (!Cesium.defined(ellipseBuffer)) {
        throw undefined;
    }
    const ellipse = ellipseBuffer.ellipse;
    const time = Cesium.JulianDate.now();
    const positions = Cesium.EllipseGeometryLibrary.computeEllipsePositions({
        center: ellipseBuffer.position.getValue(time),
        semiMajorAxis: ellipse.semiMajorAxis.getValue(time),
        semiMinorAxis: ellipse.semiMinorAxis.getValue(time),
        rotation: 0.0,
        granularity: 0.005
    }, false, true);
    const positionFlat = positions.outerPositions;
    const length = positions.outerPositions.length / 3;
    const posArray = [];
    for (let i = 0; i < length; i++) {
        posArray[i] = Cesium.Cartesian3.fromArray(positionFlat, i * 3);
    }
    return {
        positions: posArray
    };
}
//Cesium对象转换为SuperMap点、线、面对象
export const CesiumToSuperMap = {
    convertPoint: function (Cesium, SuperMap, point) {
        if (!Cesium || !SuperMap || !point) {
            return undefined;
        }
        let lonlatPoint = Cesium.Cartographic.fromCartesian(point);
        let x = Cesium.Math.toDegrees(lonlatPoint.longitude);
        let y = Cesium.Math.toDegrees(lonlatPoint.latitude);
        if (x && y) {
            return new SuperMap.Geometry.Point(x, y);
        }
        return undefined;
    },
    convertPolyline: function (Cesium, SuperMap, polyline) {
        if (!Cesium || !SuperMap || !polyline) {
            throw undefined;
        }
        let points = polyline.positions;
        if (points && points instanceof Array && points.length >= 2) {
            let arr = [];
            for (let i = 0, j = points.length; i < j; i++) {
                let point = this.convertPoint(Cesium, SuperMap, points[i]);
                if (point) {
                    arr.push(point);
                }
            }
            return new SuperMap.Geometry.LineString(arr);
        }
        return undefined;
    },
    convertPolygon: function (Cesium, SuperMap, polygon) {
        if (!Cesium || !SuperMap || !polygon) {
            throw undefined;
        }
        let points = polygon.positions;
        if (points && points instanceof Array && points.length >= 3) {
            let arr = [];
            for (let i = 0, j = points.length; i < j; i++) {
                let point = this.convertPoint(Cesium, SuperMap, points[i]);
                if (point) {
                    arr.push(point);
                }
            }
            let linearRing = new SuperMap.Geometry.LinearRing(arr);
            return new SuperMap.Geometry.Polygon(linearRing);
        }
        return undefined;
    },
    convertDirPolygon: function (Cesium, SuperMap, polygon) {
        if (!Cesium || !SuperMap || !polygon) {
            throw undefined;
        }
        let points = polygon.positions;
        if (points && points instanceof Array && points.length >= 3) {
            let arr = [];
            for (let i = 0, j = points.length; i < j; i++) {
                let point = new SuperMap.Geometry.Point(points[i][0], points[i][1]);
                if (point) {
                    arr.push(point);
                }
            }
            let linearRing = new SuperMap.Geometry.LinearRing(arr);
            return new SuperMap.Geometry.Polygon(linearRing);
        }
        return undefined;
    }
}
/**
 * 画矩形
 * @param callback 回调函数
 */
export const drawRect = function (container, viewer = Cesium.Viewer, callback) {
    const scene = viewer.scene;
    const tooltip = createTooltip(container);
    const _selectedObjs = null;
    function DrawRectHandler(dom) {
        let startPoint,
            self = this,
            isShiftAndLeftDown = false,
            handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas),
            removalFunctions = [],
            rect = new Rect(dom);
        this.isDestroyed = false;
        this.activeEvt = new Cesium.Event();
        this.cancelEvt = new Cesium.Event();
        this.movingEvt = new Cesium.Event();
        this.drawEvt = new Cesium.Event();

        // div框
        function Rect(parentDom) {
            this.rect = document.createElement('div');
            this.rect.style.visibility = 'hidden';
            parentDom.appendChild(this.rect);
            this.leftTopPoint = new Cesium.Cartesian2();
            this.rightBottomPoint = new Cesium.Cartesian2();
            this.leftBottomPoint = new Cesium.Cartesian2();
            this.rightTopPoint = new Cesium.Cartesian2();
            Rect.prototype.setPosition = function (startPoint, endPosition) {
                let w = endPosition.x - startPoint.x;
                let h = endPosition.y - startPoint.y;
                let left, top, width, height;
                if (w < 0) {
                    left = endPosition.x;
                    width = -w;
                } else {
                    left = startPoint.x;
                    width = w;
                }
                if (h < 0) {
                    top = endPosition.y;
                    height = -h;
                } else {
                    top = startPoint.y;
                    height = h;
                }
                this.leftTopPoint = new Cesium.Cartesian2(left, top);
                this.rightBottomPoint = new Cesium.Cartesian2(left + width, top + height);
                this.leftBottomPoint = new Cesium.Cartesian2(left, top + height);
                this.rightTopPoint = new Cesium.Cartesian2(left + width, top);
                this.rect.style = `position:absolute;top:${top}px;left:${left}px;width:${width}px;height:${height}px;border:2px dashed #0ea7ff;`;
                this.setVisible(true);
            }
            Rect.prototype.setVisible = function (isVisible) {
                this.rect.style.visibility = isVisible ? 'visible' : 'hidden';
            }
            Rect.prototype.getRectPoint = function () {
                return {
                    leftTopPoint: this.leftTopPoint,
                    rightBottomPoint: this.rightBottomPoint,
                    leftBottomPoint: this.leftBottomPoint,
                    rightTopPoint: this.rightTopPoint
                }
            }
            Rect.prototype.destroy = function () {
                dom.removeChild(rect);
                this.rect = null;
            }
        }
        // 开关相机控制
        function setCameraCtrl(isActive) {
            let cameraCtrl = scene.screenSpaceCameraController;
            cameraCtrl.enableInputs = isActive;
        }
        // 鼠标cursor控制
        function toggleCursorStyle(isActive) {
            if (isActive) {
                viewer.enableCursorStyle = false;
                viewer._element.style.cursor = '';
                dom.style.cursor = 'default';
            } else {
                viewer.enableCursorStyle = true;
            }
        }
        // 初始化事件处理
        function initEvent() {
            handler.setInputAction(function (e) {
                isShiftAndLeftDown = true;
                startPoint = new Cesium.Cartesian2(e.position.x, e.position.y);
            }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
            handler.setInputAction(function (e) {

                let endPosition = e.endPosition;
                self.activeEvt.raiseEvent(endPosition);
                if (!isShiftAndLeftDown) return;
                rect.setPosition(startPoint, endPosition);
                rect.setVisible(true);
                self.movingEvt.raiseEvent(rect.getRectPoint());
            }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
            handler.setInputAction(function (e) {
                isShiftAndLeftDown = false;
                rect.setVisible(false);
                self.drawEvt.raiseEvent(rect.getRectPoint());
            }, Cesium.ScreenSpaceEventType.LEFT_UP);
            handler.setInputAction(function (e) {
                rect.setVisible(false);
                self.deactivate();
            }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
        }

        // 移除事件监听
        function removeEvent() {
            handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
            handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
            handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
        }

        DrawRectHandler.prototype.destroy = function () {
            if (this.isDestroyed) return;
            setCameraCtrl(true);
            removeEvent();
            for (let i = 0, j = removalFunctions.length; i < j; i++) {
                removalFunctions[i]();
            }
            handler.destroy();
            rect.destroy();
            rect = null;
            this.isDestroyed = true;
        }
        DrawRectHandler.prototype.activate = function () {
            if (this.isDestroyed) return;
            setCameraCtrl(false);
            toggleCursorStyle(true);
            initEvent();
        }
        DrawRectHandler.prototype.deactivate = function () {
            if (this.isDestroyed) return;
            tooltip.setVisible(false);
            setCameraCtrl(true);
            toggleCursorStyle(false);
            removeEvent();
        }
    }
    let drawRect = new DrawRectHandler(container);
    // res为框的左上点与右下点的相对于给定dom节点的坐标
    drawRect.drawEvt.addEventListener(function (res) {
        tooltip.setVisible(false);
        drawRect.deactivate();
        callback(res);
    });
    drawRect.movingEvt.addEventListener(function (res) {
        tooltip.showAt(res.rightBottomPoint,
            '<p>松开鼠标左键以结束选择区域,鼠标右键取消操作</p>'
        );
    });
    drawRect.activeEvt.addEventListener(function (position) {
        tooltip.showAt(position,
            '<p>点击鼠标左键以开始选择区域,鼠标右键取消操作</p>'
        );
    });
    drawRect.cancelEvt.addEventListener(function () {
        tooltip.setVisible(false);
    })
    return drawRect;
}
//部件查看管线
export const PipeUnitInfoPipe = [
    {
        //名称
        "title": "设计-污水管线",
        //三维场景名称
        "name": "NETWORK_SJ_PSWS@sxgk#1",
        //二维地图服务
        "mapname": "TF_SJ_PSWS_PIPE_B@sxgk",
        //数据服务数据源名称
        "datasource": "sxgk",
        //数据服务数据集名称
        "dataset": "NETWORK_SJ_PSWS",
        //数据类型
        "geometryType": "line",
        //管线类型
        "pipeType": "SJ",
        //线段颜色
        //"lineColor": [76, 57, 38],
        "lineColor": [255, 54, 54],
        //
        "origindataset": "TF_SJ_PSWS_PIPE_B",
        "threeDDateset": "TF_SJ_PSWS_PIPE_B_3D"
    },
    {
        "title": "设计-污水管点",
        "name": "NETWORK_SJ_PSWS_Node@sxgk#1",
        "mapname": "TF_SJ_PSWS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_SJ_PSWS_NODE_B_3D",
        "tubewelldataset": "TF_SJ_PSWS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "SJ",
        "origindataset": "TF_SJ_PSWS_NODE_B",
        "threeDDateset": "TF_SJ_PSWS_NODE_B_3D",
        "ADJUNCT": [
            // "NETWORK_JSJS_Node@sxgk#2",//阀门
            // "NETWORK_JSJS_Node@sxgk#3",//水表
            // "NETWORK_JSJS_Node@sxgk#4"//消防栓
        ],
        "WELL": [
            "TF_SJ_PSWS_JG_B_3D@sxgk#1",
            "TF_SJ_PSWS_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "设计-雨水管线",
        "name": "NETWORK_SJ_PSYS@sxgk#1",
        "mapname": "TF_SJ_PSYS_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_SJ_PSYS",
        "geometryType": "line",
        "pipeType": "SJ",
        "lineColor": [0, 255, 255],
        "origindataset": "TF_SJ_PSYS_PIPE_B",
        "threeDDateset": "TF_SJ_PSYS_PIPE_B_3D"
    },
    {
        "title": "设计-雨水管点",
        "name": "NETWORK_SJ_PSYS_Node@sxgk#1",
        "mapname": "TF_SJ_PSYS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_SJ_PSYS_NODE_B_3D",
        "tubewelldataset": "TF_SJ_PSYS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "SJ",
        "origindataset": "TF_SJ_PSYS_NODE_B",
        "threeDDateset": "TF_SJ_PSYS_NODE_B_3D",
        "ADJUNCT": [],
        "WELL": [
            "TF_SJ_PSYS_JG_B_3D@sxgk#1",
            "TF_SJ_PSYS_JG_B_3D@sxgk#2"
        ]
    }, {
        "title": "设计-雨污合流管线",
        "name": "NETWORK_SJ_PSHS@sxgk#1",
        "mapname": "TF_SJ_PSHS_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_SJ_PSHS",
        "geometryType": "line",
        "pipeType": "SJ",
        "lineColor": [76, 57, 38],
        "origindataset": "TF_SJ_PSHS_PIPE_B",
        "threeDDateset": "TF_SJ_PSHS_PIPE_B_3D"
    },
    {
        "title": "设计-雨污合流管点",
        "name": "NETWORK_SJ_PSHS_Node@sxgk#1",
        "mapname": "TF_SJ_PSHS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_SJ_PSHS_NODE_B_3D",
        "tubewelldataset": "TF_SJ_PSHS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "SJ",
        "origindataset": "TF_SJ_PSHS_NODE_B",
        "threeDDateset": "TF_SJ_PSHS_NODE_B_3D",
        "ADJUNCT": [],
        "WELL": [
            "TF_SJ_PSHS_JG_B_3D@sxgk#1",
            "TF_SJ_PSHS_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-输水管线",
        "name": "NETWORK_PC_JSSS@sxgk#1",
        "mapname": "TF_PC_JSSS_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_JSSS",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [0, 255, 255],
        "origindataset": "TF_PC_JSSS_PIPE_B",
        "threeDDateset": "TF_PC_JSSS_PIPE_B_3D"
    },
    {
        "title": "存量-输水管点",
        "name": "TF_PC_JSSS_JG_B_3D@sxgk#1",
        "mapname": "TF_PC_JSSS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_JSSS_NODE_B_3D",
        "tubewelldataset": "TF_PC_JSSS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_JSSS_NODE_B",
        "threeDDateset": "TF_PC_JSSS_NODE_B_3D",
        "ADJUNCT": [
        ],
        "WELL": [
            "TF_PC_JSSS_JG_B_3D@sxgk#1",
            "TF_PC_JSSS_JG_B_3D@sxgk#2"
        ]
    },
    {
        //名称
        "title": "存量-污水管线",
        //三维场景名称
        "name": "NETWORK_PC_PSWS@sxgk#1",
        //二维地图服务
        "mapname": "TF_PC_PSWS_PIPE_B@sxgk",
        //数据服务数据源名称
        "datasource": "sxgk",
        //数据服务数据集名称
        "dataset": "NETWORK_PC_PSWS",
        //数据类型
        "geometryType": "line",
        //管线类型
        "pipeType": "PC",
        //线段颜色
        //"lineColor": [76, 57, 38],
        "lineColor": [255, 54, 54],
        //
        "origindataset": "TF_PC_PSWS_PIPE_B",
        "threeDDateset": "TF_PC_PSWS_PIPE_B_3D"
    },
    {
        "title": "存量-污水管点",
        "name": "NETWORK_PC_PSWS_Node@sxgk#1",
        "mapname": "TF_PC_PSWS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_PSWS_NODE_B_3D",
        "tubewelldataset": "TF_PC_PSWS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_PSWS_NODE_B",
        "threeDDateset": "TF_PC_PSWS_NODE_B_3D",
        "ADJUNCT": [
        ],
        "WELL": [
            "TF_PC_PSWS_JG_B_3D@sxgk#1",
            "TF_PC_PSWS_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-雨水管线",
        "name": "NETWORK_PC_PSYS@sxgk#1",
        "mapname": "TF_PC_PSYS_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_PSYS",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [0, 255, 255],
        "origindataset": "TF_PC_PSYS_PIPE_B",
        "threeDDateset": "TF_PC_PSYS_PIPE_B_3D"
    },
    {
        "title": "存量-雨水管点",
        "name": "NETWORK_PC_PSYS_Node@sxgk#1",
        "mapname": "TF_PC_PSYS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_PSYS_NODE_B_3D",
        "tubewelldataset": "TF_PC_PSYS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_PSYS_NODE_B",
        "threeDDateset": "TF_PC_PSYS_NODE_B_3D",
        "ADJUNCT": [],
        "WELL": [
            "TF_PC_PSYS_JG_B_3D@sxgk#1",
            "TF_PC_PSYS_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-雨污合流管线",
        "name": "NETWORK_PC_PSHS@sxgk#1",
        "mapname": "TF_PC_PSHS_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_PSHS",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [76, 57, 38],
        "origindataset": "TF_PC_PSHS_PIPE_B",
        "threeDDateset": "TF_PC_PSHS_PIPE_B_3D"
    },
    {
        "title": "存量-雨污合流管点",
        "name": "NETWORK_PC_PSHS_Node@sxgk#1",
        "mapname": "TF_PC_PSHS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_PSHS_NODE_B_3D",
        "tubewelldataset": "TF_PC_PSHS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_PSHS_NODE_B",
        "threeDDateset": "TF_PC_PSHS_NODE_B_3D",
        "ADJUNCT": [

        ],
        "WELL": [
            "TF_PC_PSHS_JG_B_3D@sxgk#1",
            "TF_PC_PSHS_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-供电管线",
        "name": "NETWORK_PC_DLGD@sxgk#1",
        "mapname": "TF_PC_DLGD_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_DLGD",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [255, 0, 0],
        "origindataset": "TF_PC_DLGD_PIPE_B",
        "threeDDateset": "TF_PC_DLGD_PIPE_B_3D"
    },
    {
        "title": "存量-供电管点",
        "name": "NETWORK_PC_DLGD_Node@sxgk#1",
        "mapname": "TF_PC_DLGD_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_DLGD_NODE_B_3D",
        "tubewelldataset": "TF_PC_DLGD_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_DLGD_NODE_B",
        "threeDDateset": "TF_PC_DLGD_NODE_B_3D",
        "ADJUNCT": [

        ],
        "WELL": [
            "TF_PC_DLGD_JG_B_3D@sxgk#1",
            "TF_PC_DLGD_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-燃气管线",
        "name": "NETWORK_PC_RQTQ@sxgk#1",
        "mapname": "TF_PC_RQTQ_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_RQTQ",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [255, 0, 255],
        "origindataset": "TF_PC_RQTQ_PIPE_B",
        "threeDDateset": "TF_PC_RQTQ_PIPE_B_3D"
    },
    {
        "title": "存量-燃气管点",
        "name": "NETWORK_PC_RQTQ_Node@sxgk#1",
        "mapname": "TF_PC_RQTQ_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_RQTQ_NODE_B_3D",
        "tubewelldataset": "TF_PC_RQTQ_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_RQTQ_NODE_B",
        "threeDDateset": "TF_PC_RQTQ_NODE_B_3D",
        "ADJUNCT": [
            "NETWORK_PC_RQTQ_Node@sxgk#2",
            "NETWORK_PC_RQTQ_Node@sxgk#3",
            "NETWORK_PC_RQTQ_Node@sxgk#4"
        ],
        "WELL": [
            "TF_PC_RQTQ_JG_B_3D@sxgk#1",
            "TF_PC_RQTQ_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-路灯管线",
        "name": "NETWORK_PC_DLLD@sxgk#1",
        "mapname": "TF_PC_DLLD_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_DLLD",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [255, 0, 0],
        "origindataset": "TF_PC_DLLD_PIPE_B",
        "threeDDateset": "TF_PC_DLLD_PIPE_B_3D"
    },
    {
        "title": "存量-路灯管点",
        "name": "NETWORK_PC_DLLD_Node@sxgk#1",
        "mapname": "TF_PC_DLLD_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_DLLD_NODE_B_3D",
        "tubewelldataset": "TF_PC_DLLD_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_DLLD_NODE_B",
        "threeDDateset": "TF_PC_DLLD_NODE_B_3D",
        "ADJUNCT": [

        ],
        "WELL": [
            "TF_PC_DLLD_JG_B_3D@sxgk#1",
            "TF_PC_DLLD_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-电视管线",
        "name": "NETWORK_PC_TXDS@sxgk#1",
        "mapname": "TF_PC_TXDS_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_TXDS",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [0, 255, 0],
        "origindataset": "TF_PC_TXDS_PIPE_B",
        "threeDDateset": "TF_PC_TXDS_PIPE_B_3D"
    },
    {
        "title": "存量-电视管点",
        "name": "NETWORK_PC_TXDS_Node@sxgk#1",
        "mapname": "TF_PC_TXDS_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_TXDS_NODE_B_3D",
        "tubewelldataset": "TF_PC_TXDS_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_TXDS_NODE_B",
        "threeDDateset": "TF_PC_TXDS_NODE_B_3D",
        "ADJUNCT": [
        ],
        "WELL": [
            "TF_PC_TXDS_JG_B_3D@sxgk#1",
            "TF_PC_TXDS_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-电信管线",
        "name": "NETWORK_PC_TXDX@sxgk#1",
        "mapname": "TF_PC_TXDX_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_TXDX",
        "geometryType": "line",
        "pipeType": "PC",
        "lineColor": [0, 255, 0],
        "origindataset": "TF_PC_TXDX_PIPE_B",
        "threeDDateset": "TF_PC_TXDX_PIPE_B_3D"
    },
    {
        "title": "存量-电信管点",
        "name": "NETWORK_PC_TXDX_Node@sxgk#1",
        "mapname": "TF_PC_TXDX_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_TXDX_NODE_B_3D",
        "tubewelldataset": "TF_PC_TXDX_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_TXDX_NODE_B",
        "threeDDateset": "TF_PC_TXDX_NODE_B_3D",
        "ADJUNCT": [
            "NETWORK_PC_TXDX_Node@sxgk#2"//接线箱
        ],
        "WELL": [
            "TF_PC_TXDX_JG_B_3D@sxgk#1",
            "TF_PC_TXDX_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-监控管线",
        "name": "NETWORK_PC_TXJK@sxgk#1",
        "mapname": "TF_PC_TXJK_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_TXJK",
        "geometryType": "line",
        "hasTube": true,//是否有套管,
        "tubeName": "NETWORK_PC_TXJK@sxgk#2",//套管图层名
        "pipeType": "PC",
        "lineColor": [0, 255, 0],
        "origindataset": "TF_PC_TXJK_PIPE_B",
        "threeDDateset": "TF_PC_TXJK_PIPE_B_3D"
    },
    {
        "title": "存量-监控管点",
        "name": "NETWORK_PC_TXJK_Node@sxgk#1",
        "mapname": "TF_PC_TXJK_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_TXJK_NODE_B_3D",
        "tubewelldataset": "TF_PC_TXJK_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_TXJK_NODE_B",
        "threeDDateset": "TF_PC_TXJK_NODE_B_3D",
        "ADJUNCT": [
        ],
        "WELL": [
            "TF_PC_TXJK_JG_B_3D@sxgk#1",
            "TF_PC_TXJK_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-电话管线",
        "name": "NETWORK_PC_TXDH@sxgk#1",
        "mapname": "TF_PC_TXDH_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_TXDH",
        "geometryType": "line",
        "hasTube": true,//是否有套管,
        "tubeName": "NETWORK_PC_TXDH@sxgk#2",//套管图层名
        "pipeType": "PC",
        "lineColor": [0, 255, 0],
        "origindataset": "TF_PC_TXDH_PIPE_B",
        "threeDDateset": "TF_PC_TXDH_PIPE_B_3D"
    },
    {
        "title": "存量-电话管点",
        "name": "NETWORK_PC_TXDH_Node@sxgk#1",
        "mapname": "TF_PC_TXDH_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_TXDH_NODE_B_3D",
        "tubewelldataset": "TF_PC_TXDH_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_TXDH_NODE_B",
        "threeDDateset": "TF_PC_TXDH_NODE_B_3D",
        "ADJUNCT": [
        ],
        "WELL": [
            "TF_PC_TXDH_JG_B_3D@sxgk#1",
            "TF_PC_TXDH_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-信息网络管线",
        "name": "NETWORK_PC_TXXX@sxgk#1",
        "mapname": "TF_PC_TXXX_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_TXXX",
        "geometryType": "line",
        "hasTube": true,//是否有套管,
        "tubeName": "NETWORK_PC_TXXX@sxgk#2",//套管图层名
        "pipeType": "PC",
        "lineColor": [0, 255, 0],
        "origindataset": "TF_PC_TXXX_PIPE_B",
        "threeDDateset": "TF_PC_TXXX_PIPE_B_3D"
    },
    {
        "title": "存量-信息网络管点",
        "name": "NETWORK_PC_TXXX_Node@sxgk#1",
        "mapname": "TF_PC_TXXX_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_TXXX_NODE_B_3D",
        "tubewelldataset": "TF_PC_TXXX_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_TXXX_NODE_B",
        "threeDDateset": "TF_PC_TXXX_NODE_B_3D",
        "ADJUNCT": [
        ],
        "WELL": [
            "TF_PC_TXXX_JG_B_3D@sxgk#1",
            "TF_PC_TXXX_JG_B_3D@sxgk#2"
        ]
    },
    {
        "title": "存量-综合管线",
        "name": "NETWORK_PC_ZH@sxgk#1",
        "mapname": "TF_PC_ZH_PIPE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "NETWORK_PC_ZH",
        "geometryType": "line",
        "hasTube": true,//是否有套管,
        "tubeName": "NETWORK_PC_ZH@sxgk#2",//套管图层名
        "pipeType": "PC",
        "lineColor": [0, 0, 0],
        "origindataset": "TF_PC_ZH_PIPE_B",
        "threeDDateset": "TF_PC_ZH_PIPE_B_3D"
    },
    {
        "title": "存量-综合管点",
        "name": "NETWORK_PC_ZH_Node@sxgk#1",
        "mapname": "TF_PC_ZH_NODE_B@sxgk",
        "datasource": "sxgk",
        "dataset": "TF_PC_ZH_NODE_B_3D",
        "tubewelldataset": "TF_PC_ZH_JG_B_3D",
        "geometryType": "point",
        "pipeType": "PC",
        "origindataset": "TF_PC_ZH_NODE_B",
        "threeDDateset": "TF_PC_ZH_NODE_B_3D",
        "ADJUNCT": [
        ],
        "WELL": [
            "TF_PC_ZH_JG_B_3D@sxgk#1",
            "TF_PC_ZH_JG_B_3D@sxgk#2"
        ]
    }
]
/**
 * 空间查询（查询地图服务）
 * @param options 
 */
export const queryMapByGeometry = function (options) {
    let filterParams = [];
    filterParams = options.datasetNames.map(item => {
        return new SuperMap.REST.FilterParameter({
            name: item,
            attributeFilter: options.whereclause,
            groupBy: options.groupBy,
            orderBy: options.orderBy,
            fields: options.fields
        });
    });
    const geoParams = new SuperMap.REST.QueryByGeometryParameters({
        geometry: options.geometry,
        queryParams: filterParams,
        returnContent: true,
        spatialQueryMode: !options.spatialMode ? SuperMap.REST.SpatialQueryMode.INTERSECT : options.spatialMode,
        queryOption: !options.queryOption ? SuperMap.REST.QueryOption.ATTRIBUTEANDGEOMETRY : options.queryOption
    });
    const queryService = new SuperMap.REST.QueryByGeometryService(options.url, {
        eventListeners: {
            processCompleted: options.completed,
            processFailed: options.failed
        }
    });
    queryService.processAsync(geoParams);
}
/**
 * 该方法用于属性查询(查询数据服务)
 * @param options 
 */
export const queryByAttribute = function (options) {
    const filterparams = new SuperMap.REST.FilterParameter({
        attributeFilter: options.whereclause,
        fields: options.fields
    });
    const sqlParams = new SuperMap.REST.GetFeaturesBySQLParameters({
        queryParameter: filterparams,
        datasetNames: options.datasetNames,
        toIndex: -1
    });
    const queryservice = new SuperMap.REST.GetFeaturesBySQLService(options.url, {
        eventListeners: {
            processCompleted: options.completed,
            processFailed: options.failed
        }
    });
    queryservice.processAsync(sqlParams);
}
export const queryMapByAttribute = function (options) {
    let filterParams = options.filterParameters;
    const sqlParams = new SuperMap.REST.QueryBySQLParameters({
        queryParams: filterParams,
        queryOption: !options.queryOption ? SuperMap.REST.QueryOption.ATTRIBUTEANDGEOMETRY : options.queryOption
    });
    const sqlService = new SuperMap.REST.QueryBySQLService(options.url, {
        eventListeners: {
            processCompleted: options.completed,
            processFailed: options.failed
        }
    });
    sqlService.processAsync(sqlParams);
}
//尾迹线效果
export function PolylineTrailLinkMaterialProperty(_aoLUDy1, h2, YjjjVEkm3) { this["\x5f\x64\x65\x66\x69\x6e\x69\x74\x69\x6f\x6e\x43\x68\x61\x6e\x67\x65\x64"] = new Cesium["\x45\x76\x65\x6e\x74"](); this["\x5f\x63\x6f\x6c\x6f\x72"] = undefined; this["\x5f\x69\x6d\x61\x67\x65"] = undefined; this["\x5f\x63\x6f\x6c\x6f\x72\x53\x75\x62\x73\x63\x72\x69\x70\x74\x69\x6f\x6e"] = undefined; this["\x63\x6f\x6c\x6f\x72"] = _aoLUDy1; this["\x69\x6d\x61\x67\x65"] = h2; this["\x64\x75\x72\x61\x74\x69\x6f\x6e"] = YjjjVEkm3; this["\x5f\x74\x69\x6d\x65"] = (new window["\x44\x61\x74\x65"]())["\x67\x65\x74\x54\x69\x6d\x65"](); } window["\x4f\x62\x6a\x65\x63\x74"]["\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73"](PolylineTrailLinkMaterialProperty["\x70\x72\x6f\x74\x6f\x74\x79\x70\x65"], { isConstant: { get: function () { return false; } }, definitionChanged: { get: function () { return this["\x5f\x64\x65\x66\x69\x6e\x69\x74\x69\x6f\x6e\x43\x68\x61\x6e\x67\x65\x64"]; } }, color: Cesium["\x63\x72\x65\x61\x74\x65\x50\x72\x6f\x70\x65\x72\x74\x79\x44\x65\x73\x63\x72\x69\x70\x74\x6f\x72"]('\x63\x6f\x6c\x6f\x72'), image: Cesium["\x63\x72\x65\x61\x74\x65\x50\x72\x6f\x70\x65\x72\x74\x79\x44\x65\x73\x63\x72\x69\x70\x74\x6f\x72"]('\x69\x6d\x61\x67\x65') }); PolylineTrailLinkMaterialProperty["\x70\x72\x6f\x74\x6f\x74\x79\x70\x65"]["\x67\x65\x74\x54\x79\x70\x65"] = function (time) { return '\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b'; }; PolylineTrailLinkMaterialProperty["\x70\x72\x6f\x74\x6f\x74\x79\x70\x65"]["\x67\x65\x74\x56\x61\x6c\x75\x65"] = function (time, ZcAjN4) { if (!Cesium["\x64\x65\x66\x69\x6e\x65\x64"](ZcAjN4)) { ZcAjN4 = {}; } ZcAjN4["\x63\x6f\x6c\x6f\x72"] = Cesium["\x50\x72\x6f\x70\x65\x72\x74\x79"]["\x67\x65\x74\x56\x61\x6c\x75\x65\x4f\x72\x43\x6c\x6f\x6e\x65\x64\x44\x65\x66\x61\x75\x6c\x74"](this["\x5f\x63\x6f\x6c\x6f\x72"], time, Cesium["\x43\x6f\x6c\x6f\x72"]["\x57\x48\x49\x54\x45"], ZcAjN4["\x63\x6f\x6c\x6f\x72"]); ZcAjN4["\x69\x6d\x61\x67\x65"] = Cesium["\x50\x72\x6f\x70\x65\x72\x74\x79"]["\x67\x65\x74\x56\x61\x6c\x75\x65\x4f\x72\x55\x6e\x64\x65\x66\x69\x6e\x65\x64"](this["\x5f\x69\x6d\x61\x67\x65"], time); ZcAjN4["\x74\x69\x6d\x65"] = (((new window["\x44\x61\x74\x65"]())["\x67\x65\x74\x54\x69\x6d\x65"]() - this["\x5f\x74\x69\x6d\x65"]) % this["\x64\x75\x72\x61\x74\x69\x6f\x6e"]) / this["\x64\x75\x72\x61\x74\x69\x6f\x6e"]; return ZcAjN4; }; PolylineTrailLinkMaterialProperty["\x70\x72\x6f\x74\x6f\x74\x79\x70\x65"]["\x65\x71\x75\x61\x6c\x73"] = function (other) { return this === other || (other instanceof PolylineTrailLinkMaterialProperty && Cesium["\x50\x72\x6f\x70\x65\x72\x74\x79"]["\x65\x71\x75\x61\x6c\x73"](this["\x5f\x63\x6f\x6c\x6f\x72"], (other as any)["\x5f\x63\x6f\x6c\x6f\x72"]) && Cesium["\x50\x72\x6f\x70\x65\x72\x74\x79"]["\x65\x71\x75\x61\x6c\x73"](this["\x5f\x69\x6d\x61\x67\x65"], (other as any)["\x5f\x69\x6d\x61\x67\x65"])) }; Cesium["\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b\x4d\x61\x74\x65\x72\x69\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x79"] = PolylineTrailLinkMaterialProperty; Cesium["\x4d\x61\x74\x65\x72\x69\x61\x6c"]["\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b\x54\x79\x70\x65"] = '\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b'; Cesium["\x4d\x61\x74\x65\x72\x69\x61\x6c"]["\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b\x53\x6f\x75\x72\x63\x65"] = "\x63\x7a\x6d\x5f\x6d\x61\x74\x65\x72\x69\x61\x6c \x63\x7a\x6d\x5f\x67\x65\x74\x4d\x61\x74\x65\x72\x69\x61\x6c\x28\x63\x7a\x6d\x5f\x6d\x61\x74\x65\x72\x69\x61\x6c\x49\x6e\x70\x75\x74 \x6d\x61\x74\x65\x72\x69\x61\x6c\x49\x6e\x70\x75\x74\x29\n\                                                \x7b\n\                                                    \x63\x7a\x6d\x5f\x6d\x61\x74\x65\x72\x69\x61\x6c \x6d\x61\x74\x65\x72\x69\x61\x6c \x3d \x63\x7a\x6d\x5f\x67\x65\x74\x44\x65\x66\x61\x75\x6c\x74\x4d\x61\x74\x65\x72\x69\x61\x6c\x28\x6d\x61\x74\x65\x72\x69\x61\x6c\x49\x6e\x70\x75\x74\x29\x3b\n\                                                    \x76\x65\x63\x32 \x73\x74 \x3d \x6d\x61\x74\x65\x72\x69\x61\x6c\x49\x6e\x70\x75\x74\x2e\x73\x74\x3b\n\                                                    \x76\x65\x63\x34 \x63\x6f\x6c\x6f\x72\x49\x6d\x61\x67\x65 \x3d \x74\x65\x78\x74\x75\x72\x65\x32\x44\x28\x69\x6d\x61\x67\x65\x2c \x76\x65\x63\x32\x28\x66\x72\x61\x63\x74\x28\x73\x74\x2e\x73 \x2d \x74\x69\x6d\x65\x29\x2c \x73\x74\x2e\x74\x29\x29\x3b\n\                                                    \x6d\x61\x74\x65\x72\x69\x61\x6c\x2e\x61\x6c\x70\x68\x61 \x3d \x63\x6f\x6c\x6f\x72\x49\x6d\x61\x67\x65\x2e\x61 \x2a \x63\x6f\x6c\x6f\x72\x2e\x61\x3b\n\                                                    \x6d\x61\x74\x65\x72\x69\x61\x6c\x2e\x64\x69\x66\x66\x75\x73\x65 \x3d \x63\x6f\x6c\x6f\x72\x2e\x72\x67\x62\x3b\n\                                                    \x72\x65\x74\x75\x72\x6e \x6d\x61\x74\x65\x72\x69\x61\x6c\x3b\n\                                                \x7d"; Cesium["\x4d\x61\x74\x65\x72\x69\x61\x6c"]["\x5f\x6d\x61\x74\x65\x72\x69\x61\x6c\x43\x61\x63\x68\x65"]["\x61\x64\x64\x4d\x61\x74\x65\x72\x69\x61\x6c"](Cesium["\x4d\x61\x74\x65\x72\x69\x61\x6c"]["\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b\x54\x79\x70\x65"], { fabric: { type: Cesium["\x4d\x61\x74\x65\x72\x69\x61\x6c"]["\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b\x54\x79\x70\x65"], uniforms: { color: new Cesium["\x43\x6f\x6c\x6f\x72"](0.0, 0.0, 0.0, 1), image: Cesium["\x4d\x61\x74\x65\x72\x69\x61\x6c"]["\x44\x65\x66\x61\x75\x6c\x74\x49\x6d\x61\x67\x65\x49\x64"], time: -20 }, source: Cesium["\x4d\x61\x74\x65\x72\x69\x61\x6c"]["\x50\x6f\x6c\x79\x6c\x69\x6e\x65\x54\x72\x61\x69\x6c\x4c\x69\x6e\x6b\x53\x6f\x75\x72\x63\x65"] }, translucent: function (fuAyB5) { return true; } });


//圆形扩散波纹材质 color 颜色 duration 持续时间 毫秒 count 数量 gradient 渐变
export function CircleWaveMaterialProperty(options) {
    options = Cesium.defaultValue(options, Cesium.defaultValue.EMPTY_OBJECT);
    this._definitionChanged = new Cesium.Event();
    this._color = undefined;
    this._colorSubscription = undefined;
    this.color = options.color;
    this.duration = Cesium.defaultValue(options.duration, 1e3);
    this.count = Cesium.defaultValue(options.count, 2);
    if (this.count <= 0) this.count = 1;
    this.gradient = Cesium.defaultValue(options.gradient, 0.1);
    if (this.gradient < 0) this.gradient = 0;
    else if (this.gradient > 1) this.gradient = 1;
    this._time = performance.now();
}
function _getCircleWaveShader() {
    return `
        uniform float time;
        uniform float count;
        uniform float gradient;
        uniform vec4 color;
        czm_material czm_getMaterial(czm_materialInput materialInput)
        {
                czm_material material = czm_getDefaultMaterial(materialInput);
                material.diffuse = 1.5 * color.rgb;
                vec2 st = materialInput.st;
                vec3 str = materialInput.str;
                float dis = distance(st, vec2(0.5, 0.5));
                float per = fract(time);
                if (abs(str.z) > 0.001) {
                    discard;
                }
                if (dis > 0.5) {
                    discard;
                } else {
                    float perDis = 0.5 / count;
                    float disNum;
                    float bl = .0;
                    for (int i = 0; i <= 999; i++) {
                        if (float(i) <= count) {
                            disNum = perDis * float(i) - dis + per / count;
                            if (disNum > 0.0) {
                                    if (disNum < perDis) {
                                        bl = 1.0 - disNum / perDis;
                                    }
                                    else if (disNum - perDis < perDis) {
                                        bl = 1.0 - abs(1.0 - disNum / perDis);
                                    }
                                    material.alpha = pow(bl, gradient);
                                }
                        }
                    }
                }
            return material;
        }
        `
}
Object.defineProperties(CircleWaveMaterialProperty.prototype, {
    isConstant: {
        get: function () {
            return false;
        }
    },
    definitionChanged: {
        get: function () {
            return this._definitionChanged;
        }
    },
    color: Cesium.createPropertyDescriptor('color')
});
var MaterialType = 'waveType' + Number(Math.random() * 1000);
CircleWaveMaterialProperty.prototype.getType = function (time) {
    return MaterialType;
}
CircleWaveMaterialProperty.prototype.getValue = function (time, result) {
    if (!Cesium.defined(result)) {
        result = {};
    }
    result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color);
    result.time = (performance.now() - this._time) / this.duration;
    result.count = this.count;
    result.gradient = 1 + 10 * (1 - this.gradient);
    return result;
}
CircleWaveMaterialProperty.prototype.equals = function (other) {
    return this === other ||
        (other instanceof CircleWaveMaterialProperty &&
            Cesium.Property.equals(this._color, (other as any)._color))
}
Cesium.Material._materialCache.addMaterial(MaterialType, {
    fabric: {
        type: MaterialType,
        uniforms: {
            color: new Cesium.Color(1.0, 0.0, 0.0, 1.0),
            time: 1,
            count: 1,
            gradient: 0.1
        },
        source: _getCircleWaveShader()
    },
    translucent: function (material) {
        return !0;
    }
});
Cesium.CircleWaveMaterialProperty = CircleWaveMaterialProperty;