UNPKG

@wdp-api/wim-api

Version:

51WORLD WIM Api is a JavaScript plugin for WdpApi, It provides a set of APIs for developers to integrate WIM into their own applications.

1,115 lines 71.4 kB
var I = Object.defineProperty; var W = (n, a, r) => a in n ? I(n, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[a] = r; var d = (n, a, r) => W(n, typeof a != "symbol" ? a + "" : a, r); class se { constructor() { console.group("%c 🌍 WimApi", "color:white;padding:5px;border-radius:5px;background:black;margin-right:10px;font-weight:bold;"), console.log("%c 🌟 Version", "color:white;padding:5px;border-radius:5px;background:#4F4E4E;margin-right:10px;font-weight:bold;", "V2.0.4"), console.log("%c 🌟 Updated", "color:white;padding:5px;border-radius:5px;background:#4F4E4E;margin-right:10px;font-weight:bold;", (/* @__PURE__ */ new Date(1765520748652)).toISOString()), console.groupEnd(); } async install() { const a = await Promise.resolve().then(() => T), r = await Promise.resolve().then(() => F), l = await Promise.resolve().then(() => x), t = await Promise.resolve().then(() => k), e = await Promise.resolve().then(() => q), i = await Promise.resolve().then(() => B), s = await Promise.resolve().then(() => L), o = await Promise.resolve().then(() => $), h = await Promise.resolve().then(() => U), c = await Promise.resolve().then(() => J), b = await Promise.resolve().then(() => H), u = await Promise.resolve().then(() => Y), g = await Promise.resolve().then(() => K), E = await Promise.resolve().then(() => te), v = await Promise.resolve().then(() => Q); return { info: { des: "WIM js sdk to control user's WIM Model", name: "WIM API", version: "2.0.4" }, list: [ { factory: a.default, name: "WIM" }, { factory: r.default, name: "WimModelerRiver", category: "WIM", object: l.default, type: "WimModelerRiverEntity" }, { factory: t.default, name: "WimModelerWater", category: "WIM", object: e.default, type: "WimModelerWaterEntity" }, { factory: i.default, name: "CustomColorCard", category: "WIM", object: s.default, type: "CustomColorCard" }, { factory: o.default, name: "Flood", category: "WIM", object: h.default, type: "FloodEntity" }, { factory: c.default, name: "WimPipe", category: "WIM", object: b.default, type: "WimPipeEntity" }, { factory: u.default, name: "DamCae", category: "WIM" }, { factory: g.default, name: "PointCloudSim", category: "WIM" }, { factory: E.default, name: "WimDynamicWater", category: "WIM", object: v.default, type: "WimDynamicWaterEntity" } ] }; } } class P { constructor(a) { d(this, "obj"); d(this, "handleUserEventLogic", (a, r) => { r && (r.objs && r.objs.length > 0 && r.objs.forEach((l) => { l.func(a); }), r.obj && r.obj.func(a)); }); d(this, "OnWIMFileDownLoadEvent", async (a, r) => { var t, e, i, s, o, h; (t = this.obj) == null || t.highLevelLog("(WIM Plugin) OnWIMFileDownLoadEvent: ", a); const l = {}; if ((e = a.result) != null && e.eid) { const c = await ((s = (i = this.obj) == null ? void 0 : i.globalTools) == null ? void 0 : s.handleEidToObjectData([a.result.eid], this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap)); c && c.length > 0 && (l.object = c[0]); } ((o = a.result) == null ? void 0 : o.bSuccess) !== void 0 && (l.bSuccess = a.result.bSuccess), this.handleUserEventLogic({ success: !0, message: "OnWIMFileDownLoadEvent", event_name: "OnWIMFileDownLoadEvent", result: l }, r), (h = this.obj) == null || h.cloudApiLog("(WIM Plugin) OnWIMFileDownLoadEvent result:", { success: !0, message: "OnWIMFileDownLoadEvent", event_name: "OnWIMFileDownLoadEvent", result: l }); }); d(this, "OnWIMFramePlaybackFinishedEvent", async (a, r) => { var t, e, i, s, o, h; (t = this.obj) == null || t.highLevelLog("(WIM Plugin) OnWIMFramePlaybackFinishedEvent: ", a); const l = {}; if ((e = a.result) != null && e.eid) { const c = await ((s = (i = this.obj) == null ? void 0 : i.globalTools) == null ? void 0 : s.handleEidToObjectData([a.result.eid], this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap)); c && c.length > 0 && (l.object = c[0]); } ((o = a.result) == null ? void 0 : o.frameIndex) !== void 0 && (l.frameIndex = a.result.frameIndex), this.handleUserEventLogic({ success: !0, message: "OnWIMFramePlaybackFinishedEvent", event_name: "OnWIMFramePlaybackFinishedEvent", result: l }, r), (h = this.obj) == null || h.cloudApiLog("(WIM Plugin) OnWIMFramePlaybackFinishedEvent result:", { success: !0, message: "OnWIMFramePlaybackFinishedEvent", event_name: "OnWIMFramePlaybackFinishedEvent", result: l }); }); d(this, "OnRequestModelerWaterFileList", async (a, r) => { var e, i, s, o, h; (e = this.obj) == null || e.highLevelLog("(private) OnRequestModelerWaterFileList: ", a); const l = { format: [a.result.filterType], pageNumber: a.result.page, pageSize: a.result.rows }; a.result.searchName !== void 0 && (l.keyword = a.result.searchName); const t = await ((i = this.obj) == null ? void 0 : i.DataModel.DaaS.GetCloudDiskFileList(l)); if (t.success) { const c = { page: a.result.page, rows: a.result.rows, total: t.result.total, fileData: (s = t.result) == null ? void 0 : s.data }; await ((o = this.obj) == null ? void 0 : o.WIM.WimModelerWater.SendModelerWaterFileList(c)); } else (h = this.obj) == null || h.cloudApiLog("GetCloudDiskFileList error", t); }); this.obj = a, this.registerWimEvents(); } registerWimEvents() { var a, r; (r = (a = this.obj) == null ? void 0 : a.Renderer) == null || r.RegisterSceneEvents([ { name: "OnWIMFileDownLoadEvent_private_WIM", sync: !0, func: this.OnWIMFileDownLoadEvent }, { name: "OnWIMFramePlaybackFinishedEvent_private_WIM", sync: !0, func: this.OnWIMFramePlaybackFinishedEvent }, { name: "OnRequestModelerWaterFileList_private_WIM", func: this.OnRequestModelerWaterFileList } ]); } } const T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: P }, Symbol.toStringTag, { value: "Module" })), f = (n) => `${n > 15 ? "" : 0}${n.toString(16)}`, j = (n) => { const { r: a, g: r, b: l, a: t = 1 } = n; return `${f(a)}${f(r)}${f(l)}${t === 1 ? "" : f(Math.floor(t * 255))}`; }, C = (n) => { let a = n, r = 1; a.length === 3 && (a = `${a[0]}${a[0]}${a[1]}${a[1]}${a[2]}${a[2]}`), a.length === 8 && (r = parseInt(a.slice(6), 16) / 255, a = a.slice(0, 6)); const l = parseInt(a, 16); return { r: l >> 16 & 255, g: l >> 8 & 255, b: l & 255, a: r }; }, D = (n) => { const a = n.match(/(\d(\.\d+)?)+/g) || [], r = a.map((l) => parseInt(l, 10)); return { r: r[0], g: r[1], b: r[2], a: parseFloat(a[3]) }; }, y = (n) => n.startsWith("#") ? C(n.slice(1)) : n.startsWith("rgb") ? D(n) : C(n === "transparent" ? "00000000" : n), m = (n, a, r, l, t, e) => { const i = Object.keys(n); i.length > 0 && i.forEach((s) => { if (!l.find((o) => o === s)) { let o = s; const h = t.find((c) => c.name === s); h && (o = h.newName), Object.defineProperty(a, o, { get: () => n[s], set: (c) => { const b = {}; e ? (b[`${e}`] = {}, b[`${e}`][`${s}`] = c) : b[`${s}`] = c, a.Update(b); } }), a[`Get${R(o, r)}`] = async () => ({ success: !0, message: "", result: n[s] }), a[`Set${R(o, r)}`] = async (c) => { const b = {}; return e ? (b[`${e}`] = {}, b[`${e}`][`${s}`] = c) : b[`${s}`] = c, await a.Update(b); }; } }); }; function R(n, a) { return a.find((r) => r === n) || n.length === 0 ? n : n.charAt(0).toUpperCase() + n.slice(1); } class S { static extendsCore(a) { return class extends a { constructor(t) { super(); d(this, "className", "WimModelerRiver"); d(this, "WimModelerRiverPolylineAtom", { attributes: [ { cornerRadius: 1, cornerSplitNum: 10, baseWidth: 1, sideWidthScale: 1 } ], coordinates: [[0, 0, 0], [0, 0, 0]], bClosed: !1 }); d(this, "WimModelerRiverAtom", { mergeLength: 300, riverWidth: 300, riverHeight: 300, bInverseNormal: !1, cornerRadius: 800, cornerSplitNum: 5, bUseVertexCorner: !1, bUseVertexWidth: !1, waterType: "River01", waterColor: "0c120c", waveHeight: 1, waterTransparency: 0, waterTransparentDepth: 0.5, rippleScale: 0.05, waveRotate: 0, waveSpeed: 0.05 }); this.setObjAtom(this), this.oType = "WimModelerRiver", this.type = "WimModelerRiverEntity", m(this.WimModelerRiverPolylineAtom, this, ["bClosed"], [], []), m(this.WimModelerRiverAtom, this, ["bInverseNormal", "bUseVertexCorner", "bUseVertexWidth"], [], [], "wimModelerRiverStyle"), t && (this.SetData(t), this.addNewScheme = { EntityType: this.type, ...this.generateAtomData(t) }); } GetScheme() { return { WimModelerRiverAtom: this.WimModelerRiverAtom, WimModelerRiverPolylineAtom: this.WimModelerRiverPolylineAtom }; } GetData() { return { ...this.getEid(), ...this.getTransformData(), ...this.getBasicData(), ...this.getOtherData(), wimModelerRiverStyle: this.WimModelerRiverAtom, ...this.WimModelerRiverPolylineAtom }; } SetData(t) { var e; this.setEid(t), this.setTransformData(t), this.setBasicData(t), this.setVisibleData(t), this.setLockedData(t), this.setIndexData(t), t.wimModelerRiverStyle !== void 0 && ((e = t.wimModelerRiverStyle) != null && e.waterColor && (t.wimModelerRiverStyle.waterColor = typeof t.wimModelerRiverStyle.waterColor == "object" ? j(t.wimModelerRiverStyle.waterColor) : j(y(t.wimModelerRiverStyle.waterColor))), this.handleAtom(this.WimModelerRiverAtom, t.wimModelerRiverStyle)), t.coordinates && (this.WimModelerRiverPolylineAtom.coordinates = t.coordinates), t.attributes && (this.WimModelerRiverPolylineAtom.attributes = t.attributes), t.bClosed && (this.WimModelerRiverPolylineAtom.bClosed = t.bClosed); } generateAtomData(t) { var g; const e = {}, i = {}, s = {}, o = {}, h = {}, c = {}, b = {}, u = {}; return this.handleBasicAtom(i, t), Object.keys(i).length > 0 && (e.BasicInfoAtom = i), this.handleTransformAtom(s, t), Object.keys(s).length > 0 && (e.TransformAtom = s), this.handleVisibleAtom(o, t), Object.keys(o).length > 0 && (e.VisibleAtom = o), this.handleLockedAtom(h, t), Object.keys(h).length > 0 && (e.EntityFlagAtom = h), this.handleEntityOutlinerAtom(c, t), Object.keys(c).length > 0 && (e.EntityOutlinerAtom = c), t.wimModelerRiverStyle !== void 0 && ((g = t.wimModelerRiverStyle) != null && g.waterColor && (t.wimModelerRiverStyle.waterColor = typeof t.wimModelerRiverStyle.waterColor == "object" ? j(t.wimModelerRiverStyle.waterColor) : j(y(t.wimModelerRiverStyle.waterColor))), this.handleAtom(b, t.wimModelerRiverStyle)), Object.keys(b).length > 0 && (e.WimModelerRiverAtom = b), t.coordinates !== void 0 && (u.coordinates = t.coordinates), t.attributes !== void 0 && (u.attributes = t.attributes), t.bClosed !== void 0 && (u.bClosed = t.bClosed), Object.keys(u).length > 0 && (e.WimModelerRiverPolylineAtom = u), e; } }; } } const x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: S }, Symbol.toStringTag, { value: "Module" })); class N { static extendsCore(a, r) { return class extends a { constructor(t) { super(t, S.extendsCore(r)), this.setType("WimModelerRiver"); } }; } } const F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: N }, Symbol.toStringTag, { value: "Module" })); class w { static extendsCore(a) { return class extends a { constructor(t) { super(); d(this, "className", "WimModelerWater"); d(this, "WimModelerWaterPolygonAtom", { attributes: [ { cornerRadius: 1, cornerSplitNum: 10 } ], coordinates: [ [[0, 0, 0], [0, 0, 0]] ] }); d(this, "WimModelerWaterAtom", { waterHeight: 300, bInverseNormal: !1, bAlignZ: !0, bUseVertexCorner: !1, cornerRadius: 100, cornerSplitNum: 10, waterType: "Water01", // Water01|Water02|Water03|Water04|Water05|Water06|Water07|Water08|Water09 waterColor: "0c120c", waveHeight: 1, waterTransparency: 0, waterTransparentDepth: 0.5, rippleScale: 0.05, waveRotate: 0, waveSpeed: 0.05, waveIntensity: 1, waveScale: 1 }); this.setObjAtom(this), this.oType = "WimModelerWater", this.type = "WimModelerWaterEntity", m(this.WimModelerWaterPolygonAtom, this, [], [], []), m(this.WimModelerWaterAtom, this, ["bInverseNormal", "bAlignZ", "bUseVertexCorner"], [], [], "wimModelerWaterStyle"), t && (this.SetData(t), this.addNewScheme = { EntityType: this.type, ...this.generateAtomData(t) }); } GetScheme() { return { WimModelerWaterAtom: this.WimModelerWaterAtom, WimModelerWaterPolygonAtom: this.WimModelerWaterPolygonAtom }; } GetData() { return { ...this.getEid(), ...this.getTransformData(), ...this.getBasicData(), ...this.getOtherData(), wimModelerWaterStyle: this.WimModelerWaterAtom, ...this.WimModelerWaterPolygonAtom }; } SetData(t) { var e; this.setEid(t), this.setTransformData(t), this.setBasicData(t), this.setVisibleData(t), this.setLockedData(t), this.setIndexData(t), t.wimModelerWaterStyle !== void 0 && ((e = t.wimModelerWaterStyle) != null && e.waterColor && (t.wimModelerWaterStyle.waterColor = typeof t.wimModelerWaterStyle.waterColor == "object" ? j(t.wimModelerWaterStyle.waterColor) : j(y(t.wimModelerWaterStyle.waterColor))), this.handleAtom(this.WimModelerWaterAtom, t.wimModelerWaterStyle)), t.coordinates && (this.WimModelerWaterPolygonAtom.coordinates = t.coordinates), t.attributes && (this.WimModelerWaterPolygonAtom.attributes = t.attributes); } generateAtomData(t) { var g; const e = {}, i = {}, s = {}, o = {}, h = {}, c = {}, b = {}, u = {}; return this.handleBasicAtom(i, t), Object.keys(i).length > 0 && (e.BasicInfoAtom = i), this.handleTransformAtom(s, t), Object.keys(s).length > 0 && (e.TransformAtom = s), this.handleVisibleAtom(o, t), Object.keys(o).length > 0 && (e.VisibleAtom = o), this.handleLockedAtom(h, t), Object.keys(h).length > 0 && (e.EntityFlagAtom = h), this.handleEntityOutlinerAtom(c, t), Object.keys(c).length > 0 && (e.EntityOutlinerAtom = c), t.wimModelerWaterStyle !== void 0 && ((g = t.wimModelerWaterStyle) != null && g.waterColor && (t.wimModelerWaterStyle.waterColor = typeof t.wimModelerWaterStyle.waterColor == "object" ? j(t.wimModelerWaterStyle.waterColor) : j(y(t.wimModelerWaterStyle.waterColor))), this.handleAtom(b, t.wimModelerWaterStyle)), Object.keys(b).length > 0 && (e.WimModelerWaterAtom = b), t.coordinates !== void 0 && (u.coordinates = t.coordinates), t.attributes !== void 0 && (u.attributes = t.attributes), Object.keys(u).length > 0 && (e.WimModelerWaterPolygonAtom = u), e; } }; } } const q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: w }, Symbol.toStringTag, { value: "Module" })); class _ { static extendsCore(a, r) { return class extends a { constructor(e) { super(e, w.extendsCore(r)); d(this, "apiClassName", "WimModelerWaterAPIRegister"); this.setType("WimModelerWater"); } /** * @public * @async * @function ChangeModelerWaterMode * @param {boolean} isOpen * @param {string} language (optional) default value is cn * @returns {Promise<ResultType>} */ async ChangeModelerWaterMode(e = !1, i = "cn") { const s = await this.StartApi(this.apiClassName, "ChangeModelerWaterMode", { isOpen: e }); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function SendModelerWaterFileList * @param {IsendFileListToWim} opt * @returns {Promise<ResultType>} */ async SendModelerWaterFileList(e) { const i = await this.StartApi(this.apiClassName, "SendModelerWaterFileList", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } }; } } const k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: _ }, Symbol.toStringTag, { value: "Module" })); class p { static extendsCore(a) { return class extends a { constructor(t) { super(); d(this, "apiClassName", "CustomColorCardAPIRegister"); d(this, "className", "CustomColorCard"); d(this, "CustomColorCardAtom", { colorCardName: "None", t2dWidth: 512, t2dHeight: 1, colorCardPoints: [] }); this.setObjAtom(this), this.oType = "CustomColorCard", this.type = "CustomColorCard", m(this.CustomColorCardAtom, this, [], [], [], "customColorCardStyle"), t && (this.SetData(t), this.addNewScheme = { EntityType: this.type, ...this.generateAtomData(t) }); } GetScheme() { return { CustomColorCardAtom: this.CustomColorCardAtom }; } GetData() { return { ...this.getEid(), ...this.getBasicData(), customColorCardStyle: this.CustomColorCardAtom }; } SetData(t) { this.setEid(t), this.setBasicData(t), t.customColorCardStyle !== void 0 && this.handleAtom(this.CustomColorCardAtom, t.customColorCardStyle); } generateAtomData(t) { const e = {}, i = {}, s = {}; return this.handleBasicAtom(i, t), Object.keys(i).length > 0 && (e.BasicInfoAtom = i), t.customColorCardStyle !== void 0 && this.handleAtom(s, t.customColorCardStyle), Object.keys(s).length > 0 && (e.CustomColorCardAtom = s), e; } async UpdateCard(t) { const e = { eid: this.eid }; t.name !== void 0 && (e.name = t.name), t.color !== void 0 && (e.color = t.color), t.anchor !== void 0 && (e.anchor = t.anchor); const i = await this.StartApi(this.apiClassName, "UpdateCard", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async RemoveCard() { const t = await this.StartApi(this.apiClassName, "RemoveCard", { eid: this.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(t, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async GetCard(t) { const e = { eid: this.eid }; e.reverse = t.reverse ?? !1, e.pictureFormatExtension = t.pictureFormatExtension || "png"; const i = await this.StartApi(this.apiClassName, "GetCard", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async GetLegend(t) { const e = { size: t.size, eid: this.eid }; e.reverse = t.reverse ?? !1; const i = await this.StartApi(this.apiClassName, "GetLengend", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async GetColorValues(t) { const e = { percentArray: t.percentArray, eid: this.eid }, i = await this.StartApi(this.apiClassName, "GetColorValues", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async AddCardPoint(t) { const e = { name: t.name, position: t.position, weight: t.weight, color: t.color, eid: this.eid }, i = await this.StartApi(this.apiClassName, "AddCardPoint", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async RemoveCardPoint(t) { const e = { name: t.name, position: t.position, weight: t.weight, color: t.color, eid: this.eid }, i = await this.StartApi(this.apiClassName, "RemoveCardPoint", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async UpdateCardPoint(t) { const e = { name: t.name, position: t.position, weight: t.weight, color: t.color, eid: this.eid }, i = await this.StartApi(this.apiClassName, "UpdateCardPoint", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async GetCardPoints(t) { const e = await this.StartApi(this.apiClassName, "GetCardPoints", { position: t, eid: this.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(e, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } }; } } const L = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: p }, Symbol.toStringTag, { value: "Module" })); class G { static extendsCore(a, r) { return class extends a { constructor(e) { super(e, p.extendsCore(r)); d(this, "apiClassName", "CustomColorCardAPIRegister"); this.setType("CustomColorCard"); } /** * @public * @async * @function CreateCard * @param {ICreateCard} opt * @returns {Promise<ResultType>} */ async CreateCard(e) { const i = await this.StartApi(this.apiClassName, "CreateCard", e); if (i.success && i.result.eid) { const o = await this.obj.globalTools.handleEidToObjectData([i.result.eid], this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); i.result.object = o.length > 0 ? o[0] : i.result.eid; } return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function UpdateCard * @param {IUpdateCard} opt * @returns {Promise<ResultType>} */ async UpdateCard(e) { const i = { eid: e.object.eid }; e.name !== void 0 && (i.name = e.name), e.color !== void 0 && (i.color = e.color), e.anchor !== void 0 && (i.anchor = e.anchor); const s = await this.StartApi(this.apiClassName, "UpdateCard", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function RemoveCard * @param {Record<string, any>} obj * @returns {Promise<ResultType>} */ async RemoveCard(e) { const i = await this.StartApi(this.apiClassName, "RemoveCard", { eid: e.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function GetCard * @param {IGetCard} opt * @returns {Promise<ResultType>} */ async GetCard(e) { const i = { eid: e.object.eid }; i.reverse = e.reverse ?? !1, i.pictureFormatExtension = e.pictureFormatExtension || "png"; const s = await this.StartApi(this.apiClassName, "GetCard", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function GetLengend * @param {IGetLengend} opt * @returns {Promise<ResultType>} */ async GetLegend(e) { const i = { size: e.size, eid: e.object.eid }; i.reverse = e.reverse ?? !1; const s = await this.StartApi(this.apiClassName, "GetLengend", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function GetColorValues * @param {IGetColorValues} opt * @returns {Promise<ResultType>} */ async GetColorValues(e) { const i = { percentArray: e.percentArray, eid: e.object.eid }, s = await this.StartApi(this.apiClassName, "GetColorValues", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function AddCardPoint * @param {IAddCardPoint} opt * @returns {Promise<ResultType>} */ async AddCardPoint(e) { const i = { name: e.name, position: e.position, weight: e.weight, color: e.color, eid: e.object.eid }, s = await this.StartApi(this.apiClassName, "AddCardPoint", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function RemoveCardPoint * @param {IAddCardPoint} opt * @returns {Promise<ResultType>} */ async RemoveCardPoint(e) { const i = { name: e.name, position: e.position, weight: e.weight, color: e.color, eid: e.object.eid }, s = await this.StartApi(this.apiClassName, "RemoveCardPoint", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function UpdateCardPoint * @param {IAddCardPoint} opt * @returns {Promise<ResultType>} */ async UpdateCardPoint(e) { const i = { name: e.name, position: e.position, weight: e.weight, color: e.color, eid: e.object.eid }, s = await this.StartApi(this.apiClassName, "UpdateCardPoint", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function GetCardPoints * @param {number} position * @param {Record<string, any>} object * @returns {Promise<ResultType>} */ async GetCardPoints(e, i) { const s = await this.StartApi(this.apiClassName, "GetCardPoints", { position: e, eid: i.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } }; } } const B = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: G }, Symbol.toStringTag, { value: "Module" })); class M { static extendsCore(a) { return class extends a { constructor(t) { super(); d(this, "apiClassName", "FloodAPI"); d(this, "className", "Flood"); d(this, "FloodEntityAtom", { algorithmType: "FloodForShp", customID: "", customData: "", customDataPath: "", sceneCRS: "", floodTifFilePath: "", floodShpFilePath: "", floodShxFilePath: "", floodPrjFilePath: "", floodDbfFilePath: "", FloodTimesJsonFilePath: "", isLocalPath: "", dataMax: "", dataMin: "", matBlur: "", matOpaccity: "", timeIndex: "", valueArray: [], gridIDArray: [], waterMatIndex: "", heatMapMatIndex: "", playSpeed: "", playIndex: "", play: "", heatMap: "", minIndex: "", maxIndex: "", addPositionX: "", addPositionY: "", addScaleX: "", addScaleY: "", addRotation: "", addHeight: "", flowTifFilePath: "", flowShpFilePath: "", flowShxFilePath: "", flowPrjFilePath: "", flowDbfFilePath: "", isLocalFlowPath: "", flowTimeIndex: "", indexArray: [], valueUArray: [], valueVArray: [], flowDataMax: "", flowDataMin: "", collnst: "", speed: "", nomalValue: "", baseScale: "", particleCountBase: "", flowAddPositionX: "", flowAddPositionY: "", flowAddScaleX: "", flowAddScaleY: "", flowAddRotation: "", flowAddHeight: "", flowMatStyle: "", flowPlayIndex: "", flowPlay: "", flowMinIndex: "", flowMaxIndex: "", tifFloodTifFilePath: "", tifFloodTimeTifsFilePath: [], isLocalTifPath: "", tifDataMax: "", tifDataMin: "", tifMatBlur: "", tifMatOpaccity: "", tifWaterMatIndex: "", tifHeatMapMatIndex: "", tifPlaySpeed: "", tifPlayIndex: "", tifPlay: "", tifHeatMap: "", tifMinIndex: "", tifMaxIndex: "", tifAddPositionX: "", tifAddPositionY: "", tifAddScaleX: "", tifAddScaleY: "", tifAddRotation: "", tifAddHeight: "", async: !1 }); this.setObjAtom(this), this.oType = "Flood", this.type = "FloodEntity", m(this.FloodEntityAtom, this, [], [], [], "floodStyle"), t && (this.SetData(t), this.addNewScheme = { EntityType: this.type, ...this.generateAtomData(t) }); } GetScheme() { return { FloodEntityAtom: this.FloodEntityAtom }; } GetData() { return { ...this.getEid(), ...this.getTransformData(), ...this.getBasicData(), ...this.getOtherData(), floodStyle: this.FloodEntityAtom }; } SetData(t) { this.setEid(t), this.setTransformData(t), this.setBasicData(t), this.setVisibleData(t), t.floodStyle !== void 0 && this.handleAtom(this.FloodEntityAtom, t.floodStyle); } generateAtomData(t) { const e = {}, i = {}, s = {}, o = {}, h = {}; return this.handleBasicAtom(i, t), Object.keys(i).length > 0 && (e.BasicInfoAtom = i), this.handleTransformAtom(s, t), Object.keys(s).length > 0 && (e.TransformAtom = s), this.handleVisibleAtom(o, t), Object.keys(o).length > 0 && (e.VisibleAtom = o), t.floodStyle !== void 0 && this.handleAtom(h, t.floodStyle), Object.keys(h).length > 0 && (e.FloodEntityAtom = h), e; } async UpdateAlgorithm(t) { var o; const e = { eid: this.eid }; t.algorithmType !== void 0 && (e.algorithmType = t.algorithmType), t.customId !== void 0 && (e.customId = t.customId), t.customData !== void 0 && (e.customData = t.customData), t.file !== void 0 && (e.file = t.file, ((o = e.file) == null ? void 0 : o.override) !== void 0 && (e.file.override = `${e.file.override}`)), t.data !== void 0 && (e.data = t.data); const i = await this.StartApi(this.apiClassName, "UpdateAlgorithm", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async DeleteAlgorithm(t) { const e = { eid: this.eid }; e.force = t.force !== void 0 ? `${t.force}` : "false"; const i = await this.StartApi(this.apiClassName, "DeleteAlgorithm", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async ShowAlgorithm(t) { const e = { eid: this.eid }; e.isVisible = t.isVisible !== void 0 ? `${t.isVisible}` : "true"; const i = await this.StartApi(this.apiClassName, "ShowAlgorithm", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async RunAlgorithm(t) { const e = { eid: this.eid }; t.offset !== void 0 && (e.offset = t.offset), t.scale !== void 0 && (e.scale = t.scale), t.rotation !== void 0 && (e.rotation = t.rotation), t.materialEId !== void 0 && (e.materialEId = t.materialEId), t.colorPointEId !== void 0 && (e.colorPointEId = t.colorPointEId), t.index !== void 0 && (e.index = t.index), t.minIndex !== void 0 && (e.minIndex = t.minIndex), t.maxIndex !== void 0 && (e.maxIndex = t.maxIndex), t.speed !== void 0 && (e.speed = t.speed), t.status !== void 0 && (e.status = t.status), e.reset = t.reset !== void 0 ? `${t.reset}` : "false"; const i = await this.StartApi(this.apiClassName, "RunAlgorithm", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async AddAlgorithmData(t) { const e = { eid: this.eid }; t.data !== void 0 && (e.data = t.data); const i = await this.StartApi(this.apiClassName, "AddAlgorithmData", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async DeleteAlgorithmData(t) { const e = { eid: this.eid }; t.index !== void 0 && (e.index = t.index); const i = await this.StartApi(this.apiClassName, "DeleteAlgorithmData", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async UpdateAlgorithmData(t) { const e = { eid: this.eid }; t.index !== void 0 && (e.index = t.index), t.data !== void 0 && (e.data = t.data); const i = await this.StartApi(this.apiClassName, "UpdateAlgorithmData", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async GetAlgorithmData(t) { const e = { eid: this.eid }; t.index !== void 0 && (e.index = t.index); const i = await this.StartApi(this.apiClassName, "GetAlgorithmData", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async UpdateMaterial(t) { const e = await this.StartApi(this.apiClassName, "UpdateMaterial", { eid: this.eid, ...t }); return await this.obj.globalTools.handleResultSceneChangeInfo(e, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async DeleteMaterial() { const t = await this.StartApi(this.apiClassName, "DeleteMaterial", { eid: this.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(t, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async GetMaterial() { const t = await this.StartApi(this.apiClassName, "GetMaterial", { eid: this.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(t, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } async SetAlgorithmInteract({ bClick: t = !0, bReturnHistory: e = !0 } = {}) { const i = { eid: this.eid, bClick: t, bReturnHistory: e }, s = await this.StartApi(this.apiClassName, "SetAlgorithmInteract", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } }; } } const U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: M }, Symbol.toStringTag, { value: "Module" })); class V { static extendsCore(a, r) { return class extends a { constructor(e) { super(e, M.extendsCore(r)); d(this, "apiClassName", "FloodAPI"); this.setType("Flood"); } /** * @public * @async * @function CreateAlgorithm * @param {TCreateAlgorithm} opt * @returns {Promise<ResultType>} */ async CreateAlgorithm(e) { var o; (e == null ? void 0 : e.file) !== void 0 && ((o = e.file) == null ? void 0 : o.override) !== void 0 && (e.file.override = `${e.file.override}`); const i = await this.StartApi(this.apiClassName, "CreateAlgorithm", e); if (i.success && i.result.eid) { const h = await this.obj.globalTools.handleEidToObjectData([i.result.eid], this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); i.result.object = h.length > 0 ? h[0] : i.result.eid; } return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function UpdateAlgorithm * @param {IUpdateAlgorithm} opt * @returns {Promise<ResultType>} */ async UpdateAlgorithm(e) { var h; const i = { eid: e.object.eid }; e.algorithmType !== void 0 && (i.algorithmType = e.algorithmType), e.customId !== void 0 && (i.customId = e.customId), e.customData !== void 0 && (i.customData = e.customData), e.file !== void 0 && (i.file = e.file, ((h = i.file) == null ? void 0 : h.override) !== void 0 && (i.file.override = `${i.file.override}`)), e.data && (i.data = e.data); const s = await this.StartApi(this.apiClassName, "UpdateAlgorithm", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function DeleteAlgorithm * @param {IDeleteAlgorithm} opt * @returns {Promise<ResultType>} */ async DeleteAlgorithm(e) { const i = { eid: e.object.eid }; i.force = e.force !== void 0 ? `${e.force}` : "false"; const s = await this.StartApi(this.apiClassName, "DeleteAlgorithm", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function ShowAlgorithm * @param {IShowAlgorithm} opt * @returns {Promise<ResultType>} */ async ShowAlgorithm(e) { const i = { eid: e.object.eid }; i.isVisible = e.isVisible !== void 0 ? `${e.isVisible}` : "true"; const s = await this.StartApi(this.apiClassName, "ShowAlgorithm", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function RunAlgorithm * @param {IRunAlgorithm} opt * @returns {Promise<ResultType>} */ async RunAlgorithm(e) { const i = { eid: e.object.eid }; e.offset !== void 0 && (i.offset = e.offset), e.scale !== void 0 && (i.scale = e.scale), e.rotation !== void 0 && (i.rotation = e.rotation), e.materialEId !== void 0 && (i.materialEId = e.materialEId), e.colorPointEId !== void 0 && (i.colorPointEId = e.colorPointEId), e.index !== void 0 && (i.index = e.index), e.minIndex !== void 0 && (i.minIndex = e.minIndex), e.maxIndex !== void 0 && (i.maxIndex = e.maxIndex), e.speed !== void 0 && (i.speed = e.speed), e.status !== void 0 && (i.status = e.status), i.reset = e.reset !== void 0 ? `${e.reset}` : "false"; const s = await this.StartApi(this.apiClassName, "RunAlgorithm", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function AddAlgorithmData * @param {IAddAlgorithmData} opt * @returns {Promise<ResultType>} */ async AddAlgorithmData(e) { const i = { eid: e.object.eid }; e.data !== void 0 && (i.data = e.data); const s = await this.StartApi(this.apiClassName, "AddAlgorithmData", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function DeleteAlgorithmData * @param {IDeleteAlgorithmData} opt * @returns {Promise<ResultType>} */ async DeleteAlgorithmData(e) { const i = { eid: e.object.eid }; e.index !== void 0 && (i.index = e.index); const s = await this.StartApi(this.apiClassName, "DeleteAlgorithmData", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function UpdateAlgorithmData * @param {IUpdateAlgorithmData} opt * @returns {Promise<ResultType>} */ async UpdateAlgorithmData(e) { const i = { eid: e.object.eid }; e.index !== void 0 && (i.index = e.index), e.data !== void 0 && (i.data = e.data); const s = await this.StartApi(this.apiClassName, "UpdateAlgorithmData", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function GetAlgorithmData * @param {IGetAlgorithmData} opt * @returns {Promise<ResultType>} */ async GetAlgorithmData(e) { const i = { eid: e.object.eid }; e.index !== void 0 && (i.index = e.index); const s = await this.StartApi(this.apiClassName, "GetAlgorithmData", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function CreateMaterial * @param {ICreateMaterial} opt * @returns {Promise<ResultType>} */ async CreateMaterial(e) { const i = await this.StartApi(this.apiClassName, "CreateMaterial", e); if (i.success && i.result.eid) { const o = await this.obj.globalTools.handleEidToObjectData([i.result.eid], this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); i.result.object = o.length > 0 ? o[0] : i.result.eid; } return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function UpdateMaterial * @param {IUpdateMaterial} opt * @returns {Promise<ResultType>} */ async UpdateMaterial(e) { const i = { eid: e.object.eid }; e.mId !== void 0 && (i.mId = e.mId), e.customId !== void 0 && (i.customId = e.customId), e.opacity !== void 0 && (i.opacity = e.opacity), e.dataMax !== void 0 && (i.dataMax = e.dataMax), e.dataMin !== void 0 && (i.dataMin = e.dataMin), e.waterMatIndex !== void 0 && (i.waterMatIndex = e.waterMatIndex), e.matBlur !== void 0 && (i.matBlur = e.matBlur), e.heatMapMatIndex !== void 0 && (i.heatMapMatIndex = e.heatMapMatIndex), e.flowMatStyle !== void 0 && (i.flowMatStyle = e.flowMatStyle), e.collnst !== void 0 && (i.collnst = e.collnst), e.speed !== void 0 && (i.speed = e.speed), e.nomalValue !== void 0 && (i.nomalValue = e.nomalValue), e.baseScale !== void 0 && (i.baseScale = e.baseScale), e.particleCountBase !== void 0 && (i.particleCountBase = e.particleCountBase); const s = await this.StartApi(this.apiClassName, "UpdateMaterial", i); return await this.obj.globalTools.handleResultSceneChangeInfo(s, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function DeleteMaterial * @param {string} eid * @returns {Promise<ResultType>} */ async DeleteMaterial(e) { const i = await this.StartApi(this.apiClassName, "DeleteMaterial", { eid: e.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function GetMaterial * @param {string} eid * @returns {Promise<ResultType>} */ async GetMaterial(e) { const i = await this.StartApi(this.apiClassName, "GetMaterial", { eid: e.eid }); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } /** * @public * @async * @function GetSceneDEM * @param {{ShpPath?: string, OutTifPath?: string}} opt * @returns {Promise<ResultType>} */ async GetSceneDEM(e) { const i = await this.StartApi(this.apiClassName, "GetSceneDEM", e); return await this.obj.globalTools.handleResultSceneChangeInfo(i, this.obj.RequestEntity, this.obj.RegisterObj, this.obj.ObjectEidMap); } }; } } const $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: V }, Symbol.toStringTag, { value: "Module" })); class A { static extendsCore(a) { return class extends a { constructor(t) { super(); d(this, "className", "WimPipe"); d(this, "WimPipeBaseInfoAtom", { pipeUrl: "", parserType: "" }); this.setObjAtom(this), this.oType = "WimPipe", this.type = "WimPipeEntity", m(this.WimPipeBaseInfoAtom, this, [], [], [], "wimPipeStyle"), t && (this.SetData(t), this.addNewScheme = { EntityType: this.type, ...this.generateAtomData(t) }); } GetScheme() { return { WimPipeBaseInfoAtom: this.WimPipeBaseInfoAtom }; } GetData() { return { ...this.getEid(), ...this.getTransformData(), ...this.getBasicData(), ...this.getOtherData(), wimPipeStyle: this.WimPipeBaseInfoAtom }; } SetData(t) { this.setEid(t), this.setTransformData(t), this.setBasicData(t), this.setVisibleData(t), t.wimPipeStyle !== void 0 && this.handleAtom(this.WimPipeBaseInfoAtom, t.wimPipeStyle); } generateAtomData(t) { const e = {}, i = {}, s = {}, o = {}, h = {}; return this.handleBasicAtom(i, t), Object.keys(i).length > 0 && (e.BasicInfoAtom = i), this.handleTransformAtom(s, t), Object.keys(s).length > 0 && (e.TransformAtom = s), this.handleVisibleAtom(o, t), Object.keys(o).length > 0 && (e.VisibleAtom = o), t.wimPipeStyle !== void 0 && this.handleAtom(h, t.wimPipeStyle), Object.keys(h).length > 0 && (e.WimPipeBaseInfoAtom = h), e; } }; } } const H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: A }, Symbol.toStringTag, { value: "Module" })); class z { static extendsCore(a, r) { return class extends a { constructor(e) { super(e, A.extendsCore(r)); d(this, "apiClassName", "WimPipeAPI"); this.setType("WimPipe"); } /** * @public * @async * @function CreateWimPipeEntity * @param {ICreateWimPipeEntity} opt * @returns {Promise<ResultType>} */ async CreateWimPipeEntity(e) { const i = await this.StartApi(this.apiClassName, "CreateWimPipeEntity", e); if (i.success && i.result.eid) { const o = await this.obj.globalTools.handleEidToObjectData([i.result.eid], this.obj.Requ