function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}var ErectdynamicLine=function(){"use strict";function t(e){_classCallCheck(this,t),this["\x5f\x69\x64"]=e["\x69\x64"],Cesium["\x64\x65\x66\x69\x6e\x65\x64"](this["\x5f\x69\x64"])||(this["\x5f\x69\x64"]=Cesium["\x63\x72\x65\x61\x74\x65\x47\x75\x69\x64"]()),this["\x77\x69\x64\x74\x68"]=e["\x77\x69\x64\x74\x68"],Cesium["\x64\x65\x66\x69\x6e\x65\x64"](this["\x77\x69\x64\x74\x68"])||(this["\x77\x69\x64\x74\x68"]=16),this["\x5f\x63\x6f\x6c\x6f\x72"]=e["\x63\x6f\x6c\x6f\x72"],Cesium["\x64\x65\x66\x69\x6e\x65\x64"](this["\x5f\x63\x6f\x6c\x6f\x72"])||(this["\x5f\x63\x6f\x6c\x6f\x72"]=new Cesium["\x43\x6f\x6c\x6f\x72"](.3,.8,1,1)),this["\x5f\x65\x76\x65\x6e\x74"]=new Cesium["\x45\x76\x65\x6e\x74"],this["\x5f\x65\x76\x65\x6e\x74\x48\x65\x6c\x70\x65\x72"]=new Cesium["\x45\x76\x65\x6e\x74\x48\x65\x6c\x70\x65\x72"],this["\x5f\x73\x63\x72\x61\x74\x63\x68\x54\x57\x50"]=void 0,this["\x5f\x64\x79\x6e\x61\x6d\x69\x63\x4c\x69\x6e\x65\x50\x72\x69\x6d\x69\x74\x69\x76\x65\x73"]=[],this["\x5f\x64\x79\x6e\x61\x6d\x69\x63\x4c\x69\x6e\x65\x52\x6f\x75\x74\x65\x73"]=[],this["\x5f\x64\x69\x73\x70\x6f\x73\x65\x4c\x69\x73\x74\x65\x6e\x65\x72"]=void 0,this["\x72\x6f\x75\x74\x65\x73"]=e["\x72\x6f\x75\x74\x65\x73"],this["\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"]=new Cesium["\x50\x72\x69\x6d\x69\x74\x69\x76\x65\x43\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"],this["\x50\x72\x69\x6d\x69\x74\x69\x76\x65\x43\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"]=[],this["\x62\x75\x69\x6c\x64"]()}return _createClass(t,[{key:"build",value:function(){var B$qs1=this["\x72\x6f\x75\x74\x65\x73"];this["\x5f\x64\x79\x6e\x61\x6d\x69\x63\x4c\x69\x6e\x65\x52\x6f\x75\x74\x65\x73"]["\x70\x75\x73\x68"](B$qs1);var rlWeZu_K2=this["\x63\x72\x65\x61\x74\x65\x44\x79\x6e\x61\x6d\x69\x63\x4c\x69\x6e\x65\x73\x50\x72\x69\x6d\x69\x74\x69\x76\x65"](B$qs1);this["\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"]["\x61\x64\x64"](rlWeZu_K2),this["\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"]["\x5f\x67\x75\x69\x64"]=this["\x5f\x69\x64"],this["\x50\x72\x69\x6d\x69\x74\x69\x76\x65\x43\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"]["\x70\x75\x73\x68"](this["\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"]),viewer["\x73\x63\x65\x6e\x65"]["\x70\x72\x69\x6d\x69\x74\x69\x76\x65\x73"]["\x61\x64\x64"](this["\x63\x6f\x6c\x6c\x65\x63\x74\x69\x6f\x6e"]),this["\x5f\x64\x79\x6e\x61\x6d\x69\x63\x4c\x69\x6e\x65\x50\x72\x69\x6d\x69\x74\x69\x76\x65\x73"]["\x70\x75\x73\x68"](rlWeZu_K2),B$qs1["\x66\x6f\x72\x45\x61\x63\x68"](function(ABhuo3){ABhuo3["\x73\x74\x61\x72\x74\x54\x69\x6d\x65"],ABhuo3["\x64\x75\x72\x61\x74\x69\x6f\x6e"];ABhuo3["\x66\x6f\x72\x77\x61\x72\x64"]=Cesium["\x64\x65\x66\x61\x75\x6c\x74\x56\x61\x6c\x75\x65"](ABhuo3["\x66\x6f\x72\x77\x61\x72\x64"],!0),1==ABhuo3["\x66\x6f\x72\x77\x61\x72\x64"]?(ABhuo3["\x74\x69\x6d\x65"]=ABhuo3["\x73\x74\x61\x72\x74\x54\x69\x6d\x65"],ABhuo3["\x64\x65\x6c\x74\x61"]=.01):(ABhuo3["\x74\x69\x6d\x65"]=ABhuo3["\x73\x74\x61\x72\x74\x54\x69\x6d\x65"]+ABhuo3["\x64\x75\x72\x61\x74\x69\x6f\x6e"],ABhuo3["\x64\x65\x6c\x74\x61"]=-.01),ABhuo3["\x72\x6f\x75\x6e\x64"]=Cesium["\x64\x65\x66\x61\x75\x6c\x74\x56\x61\x6c\x75\x65"](ABhuo3["\x72\x6f\x75\x6e\x64"],!1)}),this["\x61\x64\x64\x4c\x73\x6e\x72\x4f\x66\x4d\x6f\x74\x69\x6f\x6e"](),viewer["\x73\x63\x65\x6e\x65"]["\x72\x65\x71\x75\x65\x73\x74\x52\x65\x6e\x64\x65\x72"]()}},{key:"createDynamicLinesPrimitive",value:function(e,t,n){var a=[],r=this;return e.forEach(function(e){var t=e.positions,i=r.createDynamicLinesGeometryInstance(t,n);a.push(i)}),new Cesium.Primitive({geometryInstances:a,appearance:this.createDynamicLinesApperance(t)})}},{key:"createDynamicLinesGeometryInstance",value:function(e){return new Cesium.GeometryInstance({geometry:new Cesium.PolylineGeometry({positions:e,width:this.width,vertexFormat:Cesium.PolylineMaterialAppearance.VERTEX_FORMAT}),attributes:{twp:new Cesium.GeometryInstanceAttribute({componentDatatype:Cesium.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:[0,.5,1,1]})}})}},{key:"createDynamicLinesApperance",value:function(){var e=new Cesium.PolylineMaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:this._color}},translucent:!0}),renderState:new Cesium.RenderState({polygonOffset:{enabled:!0,factor:-1,units:-1},depthTest:{enabled:!1,func:Cesium.WebGLConstants.LEQUAL}})}),t=Cesium.ShaderSource.replaceMain(e._vertexShaderSource,"czm_twp_main");e._vertexShaderSource=t+"\nvarying vec4 v_twp; \nvoid main() \n{ \n czm_twp_main(); \n v_twp = czm_batchTable_twp(batchId); \n}";var i=Cesium.ShaderSource.replaceMain(e._fragmentShaderSource,"czm_twp2_main");return e._fragmentShaderSource=i+"\nvarying vec4 v_twp; \nvoid main() \n{ \n czm_twp2_main(); \n float t = v_twp.x; float w = v_twp.y; float p = v_twp.z; float d = v_twp.w; float alpha = 0.1; if(d > 0.0){ if(v_st.s > (t - 0.06) && v_st.s < t){ alpha = smoothstep(1.0, alpha, abs(v_st.s - t) / 0.06) * (1.0 - alpha) + alpha; } } else { if(v_st.s > t && v_st.s < (t + 0.06)){ alpha = smoothstep(1.0, alpha, abs(v_st.s - t) / 0.06) * (1.0 - alpha) + alpha; } } gl_FragColor.a = alpha;}",e}},{key:"addLsnrOfMotion",value:function(){var i=this;null==this._disposeListener&&(this._disposeListener=viewer.scene.preUpdate.addEventListener(function(){for(var e=0;e<i._dynamicLinePrimitives.length;e++){var t=i._dynamicLinePrimitives[e];Cesium.defined(t)&&i.setDynamicLinesStatus(t,i._dynamicLineRoutes[e])}}))}},{key:"setDynamicLinesStatus",value:function(e,t){var i=this.getScratchTWP();if(void 0!==e._batchTable)for(var n=e._batchTableAttributeIndices.twp,a=e._batchTable._numberOfInstances,r=0;r<a;++r){var s=r,o=t[s],c=o.startTime,l=o.duration,u=o.time;c+l<(u+=o.delta)?o.round?(u=c+l,o.delta*=-1):u=c:u<c&&(o.round?(u=c,o.delta*=-1):u=c+l);var m=(o.time=u)-c,h=Math.min(m/l,1);Cesium.Cartesian4.fromElements(h,.3,1,o.delta,i),e._batchTable.setBatchedAttribute(s,n,i)}}},{key:"getScratchTWP",value:function(){return void 0===this._scratchTWP&&(this._scratchTWP=new Cesium.Cartesian4(0,0,0,0)),this._scratchTWP}},{key:"getprimitivebyid",value:function(e){for(var t=null,i=viewer.scene.primitives,n=i.length,a=0;a<n;a++){var r=i.get(a);r._guid===e&&(t=r)}return t}},{key:"removeprimitive",value:function(e){var t=this.getprimitivebyid(e);null!=t&&viewer.scene.primitives.remove(t)}},{key:"removeprimitiveList",value:function(){for(var e=0;e<this.PrimitiveCollection.length;e++){var t=this.PrimitiveCollection[e];viewer.scene.primitives.remove(t),this.PrimitiveCollection.splice(e,1),e--}}}]),t}();
Darren~52HZ
- 粉丝: 2061
- 资源: 9
最新资源
- 毕业设计-基于python实现的爬取携程景点数据和评论数据源代码+文档说明
- 微网优化调度 机组组合 主题:基于YALMIP 的微网优化调度模型 内容简介:程序基于MATLAB yalmip 开发,做了一个简单的微网优化调度模型,模型中含有蓄电池储能、风电、光伏等发电单元,程
- DEEP LEARNING:A Comprehensive Guide.pdf
- 毕业设计基于python实现的爬取携程景点数据和评论数据源代码+文档说明
- 微网孤岛优化调度 matlab 编程语言:matlab 内容摘要:采用灰狼算法实现微网孤岛优化调度,考虑风光、微燃机、燃料电池和蓄电池等主体,考虑价格型和激励型需求响应,以经济成本和环境治理成本为目标
- FactoryIO堆垛机仿真 使用简单的梯形图与SCL语言编写,通俗易懂,写有详细注释,起到抛砖引玉的作用,比较适合有动手能力的入门初学者 软件环境: 1、西门子编程软件:TIA Portal V1
- Comsol激光仿真通孔,利用高斯热源脉冲激光对材料进行蚀除过程仿真,其中运用了变形几何和固体传热实现单脉冲通孔的加工
- 毕业设计Python+Django音乐推荐系统源码+文档说明(高分毕设)
- glibC自动升级脚本
- C语言编写一个简单的俄罗斯方块游戏.docx
- 3b083教师工作量计算系统_springboot+vue.zip
- 3b081火车订票系统_springboot+vue.zip
- 3b082健身房管理系统_springboot+vue.zip
- C#与松下PLC串口 以太网通讯,自己写的,注释包含了自己理解和整理的资料,公司项目中使用,通讯用的PLC型号为FP-XH C60ET,文件包含:dll封装,测试程序,通讯文档 有代码注释
- python求链表长度的递归方法
- 3b084教师考勤系统_springboot+vue0.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论5