@@ -98,15 +98,16 @@ export default class AdvancedAnalysisManager {
9898 /**
9999 * 创建洪水分析实例
100100 * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.createFlood
101+ * @param {Array<Cartesian3> } dotsList 指定区域多边形顶点坐标数组
101102 * @param {Object } options 洪水分析参数
102103 * @param {Number } [options.minHeight] 最低洪水水位高度
103104 * @param {Number } [options.maxHeight] 最高洪水水位高度
104105 * @param {Number } [options.floodSpeed] 洪水上涨速度
105106 * @returns {Object } flood 返回洪水实例
106107 */
107- createFlood ( options ) {
108+ createFlood ( dotsList , options ) {
108109 const optionsParam = Cesium . defaultValue ( options , { } ) ;
109- const flood = new Cesium . FloodAnalysis ( this . scene ) ;
110+ const flood = new Cesium . FloodAnalysis ( this . scene , dotsList ) ;
110111 flood . minHeight = Cesium . defaultValue ( optionsParam . minHeight , 0 ) ;
111112 flood . maxHeight = Cesium . defaultValue ( optionsParam . maxHeight , 100 ) ;
112113 flood . floodSpeed = Cesium . defaultValue ( optionsParam . floodSpeed , 20 ) ;
@@ -435,81 +436,106 @@ export default class AdvancedAnalysisManager {
435436
436437 /**
437438 * 动态粒子特效
438- * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.createParticle
439+ * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.createRoamParticle
439440 * @param {Object } options 动态粒子特效参数
440441 * @param {String } options.imageUrl 粒子url
441442 * @param {String } options.modelUrl 模型url
442443 * @param {Date } [options.startTime] 开始时间
443444 * @param {Number } [options.duration] 持续周期
444445 * @param {Cartesian3 } [options.positionStart] 起点坐标
445446 * @param {Cartesian3 } [options.positionEnd] 终点坐标
447+ * @returns {Object } roamParticle 返回粒子特效实例
446448 */
447- createParticle ( options ) {
449+ createRoamParticle ( options ) {
448450 const optionsParam = Cesium . defaultValue ( options , { } ) ;
449- const particleSystem = new Cesium . ParticleC ( this . viewer , {
451+ const roamParticle = new Cesium . RoamParticle ( this . viewer , {
450452 imageUrl : optionsParam . imageUrl ,
451453 modelUrl : optionsParam . modelUrl ,
452454 startTime : Cesium . defaultValue ( optionsParam . startTime , new Date ( 2015 , 2 , 25 , 16 ) ) ,
453455 duration : Cesium . defaultValue ( optionsParam . duration , 120 ) ,
454456 positionStart : Cesium . defaultValue ( optionsParam . positionStart , Cesium . Cartesian3 . fromDegrees ( - 75.15787310614596 , 39.97862668312678 ) ) ,
455457 positionEnd : Cesium . defaultValue ( optionsParam . positionEnd , Cesium . Cartesian3 . fromDegrees ( - 75.1633691390455 , 39.95355089912078 ) )
456458 } ) ;
457- particleSystem . start ( ) ;
458- return particleSystem ;
459+ roamParticle . start ( ) ;
460+ return roamParticle ;
459461 }
460462
461463 /**
462464 * 移除动态粒子特效
463- * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.removeParticle
464- * @param {Object } particle 动态粒子特效实例
465+ * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.removeRoamParticle
466+ * @param {Object } roamParticle 动态粒子特效实例
465467 */
466- removeParticle ( particle ) {
467- particle . remove ( ) ;
468+ removeRoamParticle ( roamParticle ) {
469+ roamParticle . remove ( ) ;
468470 this . scene . requestRender ( ) ;
469471 }
470472
471473 /**
472- * 火焰或烟雾粒子特效
473- * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.createFire
474- * @param {String } imageUrl 粒子特效图片url
475- * @param {Array<Number> } position 模型位置,position[0]:经度,position[1]:纬度,position[2]:高度
476- * @param {Object } options 粒子特效参数
477- * @param {String } [options.modelUrl] 模型url
478- * @param {Number } [options.minimumPixelSize] 模型最小像素尺寸
479- * @param {Number } [options.startScale] 起始规模
480- * @param {Number } [options.endScale] 终止规模
481- * @param {Number } [options.particleLife] 粒子生命
482- * @param {Number } [options.speed] 速度
483- * @param {Cartesian2 } [options.imageSize] 图像尺寸
474+ * 固定位置粒子特效,可通过更改image与附加参数来实现火焰、喷泉、烟雾等粒子特效
475+ * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.createStableParticle
476+ * @param {String } imageUrl 粒子url
477+ * @param {Cartesian3 } position 粒子特效位置
478+ * @param {Object } options 特效粒子参数
479+ * @param {String } options.modelUrl 模型url
480+ * @param {Number } [options.minimumPixelSize] 最小像素尺寸
481+ * @param {Color } [options.startColor] 开始的颜色
482+ * @param {Color } [options.endColor] 结束的颜色
483+ * @param {Number } [options.startScale] 起始尺寸
484+ * @param {Number } [options.endScale] 结束尺寸
485+ * @param {Number } [options.minimumParticleLife] 最小粒子周期
486+ * @param {Number } [options.maximumParticleLife] 最大粒子周期
487+ * @param {Number } [options.minimumSpeed] 最小速率
488+ * @param {Number } [options.maximumSpeed] 最大速率
489+ * @param {Cartesian2 } [options.imageSize] 粒子图像大小
484490 * @param {Number } [options.emissionRate] 排放率
485- * @param {Number } [options.lifetime] 持续时间
486- * @returns {Object } result 返回粒子特效实例
491+ * @param {Number } [options.minimumImageSize] 最小Image尺寸
492+ * @param {Number } [options.maximumImageSize] 最大Image尺寸
493+ * @param {Number } [options.lifetime] 单个粒子生命周期
494+ * @param {Object } [options.emitter] 粒子发射器类型
495+ * @param {Number } [options.gravity] 粒子重力
496+ * @param {Number } [options.viewHeight] 用于控制粒子特效在0到该值范围内可见,范围外不可见,当值为-1时,默认全部可见
497+ * @param {Number } [options.heading] 俯仰角
498+ * @param {Number } [options.pitch] 偏航角
499+ * @param {Number } [options.roll] 翻滚角
500+ * @returns {Object } stableParticle 返回粒子特效实例
487501 */
488- createFire ( imageUrl , position , options ) {
502+ createStableParticle ( imageUrl , position , options ) {
489503 this . viewer . clock . shouldAnimate = true ;
490504 const optionsParam = Cesium . defaultValue ( options , { } ) ;
491- const fire = new Cesium . Fire ( this . viewer , imageUrl , position , {
505+ const stableParticle = new Cesium . StableParticle ( this . viewer , imageUrl , position , {
492506 modelUrl : optionsParam . modelUrl ,
493507 minimumPixelSize : Cesium . defaultValue ( optionsParam . minimumPixelSize , 64.0 ) ,
508+ startColor : Cesium . defaultValue ( optionsParam . startColor , Cesium . Color . LIGHTSEAGREEN . withAlpha ( 0.7 ) ) ,
509+ endColor : Cesium . defaultValue ( optionsParam . endColor , Cesium . Color . WHITE . withAlpha ( 0.0 ) ) ,
494510 startScale : Cesium . defaultValue ( optionsParam . startScale , 1.0 ) ,
495511 endScale : Cesium . defaultValue ( optionsParam . endScale , 4.0 ) ,
496- particleLife : Cesium . defaultValue ( optionsParam . particleLife , 1.0 ) ,
497- speed : Cesium . defaultValue ( optionsParam . speed , 5.0 ) ,
498- imageSize : Cesium . defaultValue ( optionsParam . imageSize , new Cesium . Cartesian2 ( 20 , 20 ) ) ,
512+ minimumParticleLife : Cesium . defaultValue ( optionsParam . minimumParticleLife , 1.2 ) ,
513+ maximumParticleLife : Cesium . defaultValue ( optionsParam . maximumParticleLife , 1.2 ) ,
514+ minimumSpeed : Cesium . defaultValue ( optionsParam . minimumSpeed , 1.0 ) ,
515+ maximumSpeed : Cesium . defaultValue ( optionsParam . maximumSpeed , 4.0 ) ,
516+ imageSize : Cesium . defaultValue ( optionsParam . imageSize , new Cesium . Cartesian2 ( 25.0 , 25.0 ) ) ,
499517 emissionRate : Cesium . defaultValue ( optionsParam . emissionRate , 5.0 ) ,
500- lifetime : Cesium . defaultValue ( optionsParam . lifetime , 16.0 )
518+ minimumImageSize : Cesium . defaultValue ( optionsParam . minimumImageSize , new Cesium . Cartesian2 ( 25.0 , 25.0 ) ) ,
519+ maximumImageSize : Cesium . defaultValue ( optionsParam . maximumImageSize , new Cesium . Cartesian2 ( 25.0 , 25.0 ) ) ,
520+ lifetime : Cesium . defaultValue ( optionsParam . lifetime , 16.0 ) ,
521+ emitter : Cesium . defaultValue ( optionsParam . emitter , new Cesium . ConeEmitter ( Cesium . Math . toRadians ( 5.0 ) ) ) ,
522+ gravity : Cesium . defaultValue ( optionsParam . gravity , 0.0 ) ,
523+ viewHeight : Cesium . defaultValue ( optionsParam . viewHeight , - 1 ) ,
524+ heading : Cesium . defaultValue ( optionsParam . heading , 0.0 ) ,
525+ pitch : Cesium . defaultValue ( optionsParam . pitch , 0.0 ) ,
526+ roll : Cesium . defaultValue ( optionsParam . roll , 0.0 )
501527 } ) ;
502- fire . start ( ) ;
503- return fire ;
528+ stableParticle . start ( ) ;
529+ return stableParticle ;
504530 }
505531
506532 /**
507533 * 移除火焰特效
508- * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.removeFire
509- * @param {Object } fire 火焰特效实例
534+ * @function module:客户端可视化分析.AdvancedAnalysisManager.prototype.removeStableParticle
535+ * @param {Object } stableParticle 火焰特效实例
510536 */
511- removeFire ( fire ) {
512- fire . remove ( ) ;
537+ removeStableParticle ( stableParticle ) {
538+ stableParticle . remove ( ) ;
513539 this . scene . requestRender ( ) ;
514540 }
515541}
0 commit comments