二三维增加单独展示在二维或者三维的功能,贴地图片增加设置锚点功能
This commit is contained in:
@ -10,10 +10,12 @@ import { getHost, getToken } from "../../on";
|
||||
import { regLeftClickCallback, regRightClickCallback, regMoveCallback } from "../../Global/ClickCallback";
|
||||
import { regLeftClickCallback as regLeftClickCallback2, regRightClickCallback as regRightClickCallback2, regMoveCallback as regMoveCallback2 } from "../../Global/SplitScreen/ClickCallback";
|
||||
import { setSplitDirection, syncSplitData, getSdk } from "../../Global/SplitScreen";
|
||||
import { syncData } from '../../Global/MultiViewportMode'
|
||||
import { syncData, getSdk as get2DSdk } from '../../Global/MultiViewportMode'
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../Global/global'
|
||||
|
||||
class Base extends Tools {
|
||||
#_showView
|
||||
#_isShowView
|
||||
constructor(sdk, options = {}) {
|
||||
super(sdk, options);
|
||||
if (!sdk || !sdk.viewer) {
|
||||
@ -55,6 +57,50 @@ class Base extends Tools {
|
||||
// setSplitDirection(this._splitDirection, this.options.id)
|
||||
// }
|
||||
|
||||
get showView() {
|
||||
return this.#_showView
|
||||
}
|
||||
|
||||
set showView(v) {
|
||||
let sdk2D = get2DSdk().sdkD
|
||||
if(!sdk2D) {
|
||||
v=0
|
||||
}
|
||||
if (!this.#_showView && !this.show) {
|
||||
return
|
||||
}
|
||||
if (this.sdk === sdk2D) {
|
||||
this.#_showView = 0
|
||||
return
|
||||
}
|
||||
if (v != 2 && v != 3) {
|
||||
this.#_showView = 0
|
||||
}
|
||||
else {
|
||||
this.#_showView = v
|
||||
}
|
||||
|
||||
this.isShowView = true
|
||||
|
||||
// if(!this.show) {
|
||||
// return
|
||||
// }
|
||||
|
||||
if (!this.#_showView) {
|
||||
this.show = true
|
||||
}
|
||||
else {
|
||||
if (v == 2) {
|
||||
this.show = false
|
||||
}
|
||||
else {
|
||||
this.show = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
get name() {
|
||||
return this.options.name
|
||||
}
|
||||
@ -72,19 +118,32 @@ class Base extends Tools {
|
||||
|
||||
set show(v) {
|
||||
if (typeof v === "boolean") {
|
||||
this.options.show = v
|
||||
if (this.originalOptions) {
|
||||
this.originalOptions.show = v
|
||||
if (!this.isShowView) {
|
||||
this.options.show = v
|
||||
if (this.originalOptions) {
|
||||
this.originalOptions.show = v
|
||||
}
|
||||
}
|
||||
this.entity && (this.entity.show = v)
|
||||
if (!this.showView || this.showView == 3) {
|
||||
this.entity && (this.entity.show = this.options.show)
|
||||
if (this.options.label && this.options.label.show && this.label) {
|
||||
this.label.show = this.options.show
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.entity && (this.entity.show = false)
|
||||
if (this.options.label && this.options.label.show && this.label) {
|
||||
this.label.show = false
|
||||
}
|
||||
}
|
||||
|
||||
if (this._DialogObject && this._DialogObject.showBtn) {
|
||||
this._DialogObject.showBtn.checked = v
|
||||
}
|
||||
if (this.options.label && this.options.label.show && this.label) {
|
||||
this.label.show = v
|
||||
this._DialogObject.showBtn.checked = this.options.show
|
||||
}
|
||||
|
||||
syncData(this.sdk, this.options.id)
|
||||
syncSplitData(this.sdk, this.options.id)
|
||||
this.isShowView = false
|
||||
} else {
|
||||
console.error("参数必须为boolean")
|
||||
}
|
||||
@ -263,7 +322,7 @@ class Base extends Tools {
|
||||
console.error('val:', val, '不是一个function')
|
||||
} else {
|
||||
let sdkD = getSdk().sdkD
|
||||
if(sdkD && this.sdk === sdkD) {
|
||||
if (sdkD && this.sdk === sdkD) {
|
||||
if (this.clickCallBack == null && this.options && this.options.id) {
|
||||
regLeftClickCallback2(this.options.id, this.leftClickCB, this)
|
||||
}
|
||||
@ -286,7 +345,7 @@ class Base extends Tools {
|
||||
console.error('val:', val, '不是一个function')
|
||||
} else {
|
||||
let sdkD = getSdk().sdkD
|
||||
if(sdkD && this.sdk === sdkD) {
|
||||
if (sdkD && this.sdk === sdkD) {
|
||||
if (this.rightClickCallBack == null && this.entity && this.entity.id) {
|
||||
regRightClickCallback2(this.entity.id, this.rightClickCB, this)
|
||||
}
|
||||
@ -309,7 +368,7 @@ class Base extends Tools {
|
||||
console.error('val:', val, '不是一个function')
|
||||
} else {
|
||||
let sdkD = getSdk().sdkD
|
||||
if(sdkD && this.sdk === sdkD) {
|
||||
if (sdkD && this.sdk === sdkD) {
|
||||
if (this.mouseMoveCallBack == null && this.entity && this.entity.id) {
|
||||
regMoveCallback2(this.entity.id, this.mouseMoveCB, this)
|
||||
}
|
||||
|
Reference in New Issue
Block a user