This commit is contained in:
zh
2025-09-01 16:26:25 +08:00
parent 6fa99df21c
commit 29629b9d43
5 changed files with 117 additions and 31 deletions

View File

@ -2,11 +2,11 @@ import Dialog from '../../../BaseDialog';
import { html } from "./_element";
import DrawPolygon from "../../../Draw/drawPolygon"
import Tools from "../../../Tools";
import { closeRotateAround, closeViewFollow} from '../../../Global/global'
import { closeRotateAround, closeViewFollow } from '../../../Global/global'
class Submerge extends Tools {
/**
* @constructor
* @param sdk
* @param sdk
* @description 淹没效果
* */
constructor(sdk, options = {}, _Dialog = {}) {
@ -26,8 +26,9 @@ class Submerge extends Tools {
this.status = true
this.area = 0
this._elms = {};
this.tools = new Tools(this.sdk)
YJ.Analysis.AnalysesResults.push(this)
Submerge.EditBox(this)
// Submerge.EditBox(this)
// Submerge.create(this)
}
@ -35,16 +36,13 @@ class Submerge extends Tools {
that.Draw.start((a, positions) => {
if (!positions || positions.length < 3) {
let _error = '至少需要三个坐标!'
console.warn(_error)
window.ELEMENT &&
window.ELEMENT.Message({
message: _error,
type: 'warning',
duration: 1500
})
this.tools.message({
message: _error,
type: 'warning',
});
return
}
that.destroy()
Submerge.destroy()
if (!positions || positions.length == 0) {
that.positions = []
that._positions = []
@ -95,6 +93,9 @@ class Submerge extends Tools {
// Submerge.EditBox(that)
})
}
draw() {
Submerge.create(this)
}
static async EditBox(that) {
if (that._DialogObject && that._DialogObject.close) {
@ -104,7 +105,7 @@ class Submerge extends Tools {
that._DialogObject = await new Dialog(that.sdk.viewer._container, {
title: '淹没分析', left: '180px', top: '100px',
closeCallBack: () => {
that.destroy()
Submerge.destroy()
that.Dialog.closeCallBack && that.Dialog.closeCallBack()
},
})
@ -315,6 +316,39 @@ class Submerge extends Tools {
})
}
get waterVolume() {
return this.options.waterVolume
}
set waterVolume(val) {
this.options.waterVolume = val
}
get minWaterLevel() {
return this.options.minWaterLevel
}
set minWaterLevel(val) {
this.options.minWaterLevel = val
}
get maxWaterLevel() {
return this.options.maxWaterLevel
}
set maxWaterLevel(val) {
this.options.maxWaterLevel = val
}
get risingSpeed() {
return this.options.risingSpeed
}
set risingSpeed(val) {
this.options.risingSpeed = val
}
get area() {
return this.area
}
set area(val) {
this.area = val
}
move() {
if (this.TweenAnimate) {
TWEEN.remove(this.TweenAnimate)
@ -369,7 +403,7 @@ class Submerge extends Tools {
return
}
closeRotateAround(this.sdk)
closeViewFollow(this.sdk)
closeViewFollow(this.sdk)
let positionArray = []
for (let i = 0; i < this.positions.length; i++) {
@ -386,7 +420,7 @@ class Submerge extends Tools {
})
}
destroy() {
static destroy() {
if (this.TweenAnimate) {
TWEEN.remove(this.TweenAnimate)
}
@ -401,7 +435,7 @@ class Submerge extends Tools {
let isEvent = false
let removeName = []
if (!elements[i] || !elements[i].attributes) {
continue;
continue;
}
for (let m of elements[i].attributes) {
switch (m.name) {