轨迹运动增加反向

This commit is contained in:
takeshita
2025-11-28 18:11:33 +08:00
parent d6b0ed8bc3
commit d0b58f378b
7 changed files with 83 additions and 17 deletions

View File

@ -239,7 +239,9 @@ class CurvelineObject extends Base {
})
this.options.rotate = v
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
let params = { ...this.options }
params.speed = this.inputSpeed
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, params)
}
get space() {
@ -2590,10 +2592,14 @@ class CurvelineObject extends Base {
// }
nodeEdit(cd) {
let lastHeightMode = this.heightMode
this.positionEditing = false
this.heightMode = 0
if (YJ.Measure.GetMeasureStatus()) {
} else {
this.closeNodeEdit()
this._lastHeightMode = lastHeightMode
YJ.Measure.SetMeasureStatus(true)
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
this.event = new MouseEvent(this.sdk)
this.ControllerObject = new Controller(this.sdk)
@ -2643,6 +2649,11 @@ class CurvelineObject extends Base {
})
this.event.mouse_right((movement, cartesian) => {
let _lastHeightMode = this._lastHeightMode
this._lastHeightMode = null
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
this.heightMode = _lastHeightMode
}
for (let i = 0; i < this.nodePoints.length; i++) {
this.sdk.viewer.entities.remove(this.nodePoints[i])
}
@ -2695,6 +2706,12 @@ class CurvelineObject extends Base {
}
closeNodeEdit() {
let _lastHeightMode = this._lastHeightMode
this._lastHeightMode = null
if(_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
this.heightMode = _lastHeightMode
}
YJ.Measure.SetMeasureStatus(false)
this.ControllerObject && this.ControllerObject.destroy()
this.event && this.event.destroy()
this.tip && this.tip.destroy()

View File

@ -1683,6 +1683,7 @@ class PolygonObject extends Base {
_this.previous.positions[0],
_this.previous.positions[1]
]
this.previous = null
}
}

View File

@ -2587,6 +2587,7 @@ class PolylineObject extends Base {
// }
nodeEdit(cb) {
let lastHeightMode = this.heightMode
this.positionEditing = false
this.noseToTail = false
// this.smooth = false
@ -2594,6 +2595,7 @@ class PolylineObject extends Base {
if (YJ.Measure.GetMeasureStatus()) {
} else {
this.closeNodeEdit()
this._lastHeightMode = lastHeightMode
YJ.Measure.SetMeasureStatus(true)
this._nodeEditCallback = cb
this.tip = new MouseTip('请选择一个顶点,右键取消', this.sdk)
@ -2644,6 +2646,11 @@ class PolylineObject extends Base {
})
this.event.mouse_right((movement, cartesian) => {
let _lastHeightMode = this._lastHeightMode
this._lastHeightMode = null
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
this.heightMode = _lastHeightMode
}
for (let i = 0; i < this.nodePoints.length; i++) {
this.sdk.viewer.entities.remove(this.nodePoints[i])
}
@ -2696,6 +2703,11 @@ class PolylineObject extends Base {
}
closeNodeEdit() {
let _lastHeightMode = this._lastHeightMode
this._lastHeightMode = null
if (_lastHeightMode && _lastHeightMode !== 0 && _lastHeightMode !== '0') {
this.heightMode = _lastHeightMode
}
YJ.Measure.SetMeasureStatus(false)
this.ControllerObject && this.ControllerObject.destroy()
this.event && this.event.destroy()

View File

@ -1440,6 +1440,10 @@ class SectorObject extends Base {
center: this.deepCopyObj(this.options.center)
}
this.positionEditing = false
if(this._positionEditingCallback) {
this._positionEditingCallback()
this._positionEditingCallback = null
}
})
this.event.mouse_right((movement, cartesian) => {
this.positionEditing = false
@ -1520,7 +1524,8 @@ class SectorObject extends Base {
this._areaChangeCallBack = cd
}
static nodeEdit(that, cb = () => { }) {
nodeEdit(cb = () => { }) {
let that = this
that.positionEditing = false
if (YJ.Measure.GetMeasureStatus()) {
} else {
@ -1675,6 +1680,8 @@ class SectorObject extends Base {
that.tip = null
that.heightMode = that.heightMode
cb('', {...that.options.center})
})
}, 200);
async function createNodePoints(pos, type) {

View File

@ -95,6 +95,7 @@ class TrajectoryMotion extends Base {
this.options.line.noseToTail = options.line.noseToTail ? options.line.noseToTail : false
this.positions_smooth = []
this.options.ground = options.ground || false
this.options.reverse = options.reverse || false
this.options.state = (options.state || options.state === false) ? options.state : true
this.options.routeDirection = (options.routeDirection || options.routeDirection === false) ? options.routeDirection : true
this.keyPoints = []
@ -618,13 +619,23 @@ class TrajectoryMotion extends Base {
set delay(v) {
this.options.delay = v
if (this.TweenAnimate && this.TweenAnimate._isPlaying) {
this.TweenAnimate.delay(this.delay)
this.TweenAnimate.delay(this.delay*1000)
}
this._elms.delay && this._elms.delay.forEach((item) => {
item.value = v
})
}
get reverse() {
return this.options.reverse
}
set reverse(v) {
this.lineEdit = false
this.options.reverse = v
this.smooth = this.smooth
}
get state() {
return this.options.state
}
@ -646,10 +657,10 @@ class TrajectoryMotion extends Base {
if (this.TweenAnimate.isPlaying()) {
this.TweenAnimate.timeout = setTimeout(() => {
this.TweenAnimate.resume()
}, this.options.delay);
}, this.options.delay*1000);
}
else {
this.TweenAnimate.delay(this.delay).start()
this.TweenAnimate.delay(this.delay*1000).start()
}
this.speed = this.speed
}
@ -1513,7 +1524,7 @@ class TrajectoryMotion extends Base {
let HeadingPitchRoll2
let previous = {}
let m = 0
this.TweenAnimate = new TWEEN.Tween({ distance: startDistance }).to({ distance: this.distance }, (totalTime - time) * 1000).delay(this.delay).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop ? Infinity : 0).onRepeat(() => {
this.TweenAnimate = new TWEEN.Tween({ distance: startDistance }).to({ distance: this.distance }, (totalTime - time) * 1000).delay(this.delay*1000).easing(TWEEN.Easing.Linear.None).repeat(this.options.loop ? Infinity : 0).onRepeat(() => {
if (time || startDistance) {
this.modelMove(positions)
}
@ -2457,10 +2468,13 @@ class TrajectoryMotion extends Base {
// 更新坐标
renewLinePositions(pos) {
let positions = pos
let positions = [...pos]
if (this.noseToTail) {
positions = [...pos, pos[0]]
}
if(this.reverse) {
positions.reverse()
}
let fromDegreesArrayHeights = []
let time = []
let positions_smooth = []

View File

@ -1220,7 +1220,7 @@ class Tools {
let pos3 = new Cesium.Cartesian3.fromDegrees(position.lng, position.lat);
let position1
try {
position1 = await this.sdk.viewer.scene.clampToHeight(pos3, objectsToExclude) || pos3
position1 = await this.sdk.viewer.scene.clampToHeight({x:pos3.x, y: pos3.y, z: pos3.z}, objectsToExclude) || pos3
} catch (error) {
position1 = pos3
}

View File

@ -49,6 +49,10 @@
--color-text-shadow: rgba(20, 118, 255, 1);
}
/* .cesium-viewer.\32 d{
opacity: 0;
} */
.cesium-viewer-cesiumWidgetContainer {
position: relative;
}
@ -171,9 +175,14 @@
.YJ-custom-base-dialog button:not(button[disabled]):hover {
border-color: rgba(var(--color-base1), 1) !important;
color: rgba(var(--color-base1), 1) !important;
cursor: pointer;
}
.YJ-custom-base-dialog button:not(button[disabled]):hover svg {
fill: rgba(var(--color-base1), 1) !important;
}
.YJ-custom-base-dialog button:focus-visible {
outline: none;
}
@ -473,6 +482,9 @@
.YJ-custom-base-dialog>.content .table .table-body .tr:first-child {
border-top: none;
}
.YJ-custom-base-dialog>.content .table .table-body .tr:last-child {
border-bottom: 1px solid rgba(var(--color-base1), 0.5);
}
.YJ-custom-base-dialog>.content .table .table-empty {
display: flex;
@ -1772,7 +1784,7 @@
/* 轨迹运动 */
.YJ-custom-base-dialog.trajectory-motion>.content {
width: 550px;
width: 562px;
}
.YJ-custom-base-dialog.trajectory-motion>.content .div-item>.row>.col {
@ -1801,6 +1813,10 @@
.YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active {
border-color: rgba(var(--color-base1));
color: rgba(var(--color-base1));
}
.YJ-custom-base-dialog.trajectory-motion>.content .btn.is-active svg {
fill: rgba(var(--color-base1));
}
.YJ-custom-base-dialog.trajectory-motion>.content .btn-group .btn.is-active>span {
@ -1826,7 +1842,6 @@
.YJ-custom-base-dialog.trajectory-motion>.content .icon-rubric {
width: 16px;
height: 16px;
margin-left: 12px;
}
.YJ-custom-base-dialog.trajectory-motion>.content .custom__popper__arrow::after {