mxdraw 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +22 -0
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js.map +1 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -1
- package/dist/lib/MxModule/useCoreCode/mxfun.es5.js +16 -12
- package/dist/lib/MxModule/useCoreCode/mxfun.es5.js.map +1 -1
- package/dist/mxdraw.es5.js +2 -2
- package/dist/mxdraw.es5.js.map +1 -1
- package/dist/mxdraw.umd.js +2 -2
- package/dist/mxdraw.umd.js.map +1 -1
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +18 -0
- package/package.json +1 -1
|
@@ -154,6 +154,28 @@ var MxDrawObject = /** @class */ (function () {
|
|
|
154
154
|
MxDrawObject.prototype.addViewObject = function (obj) {
|
|
155
155
|
return _mxdrawObj.addViewObject(obj);
|
|
156
156
|
};
|
|
157
|
+
/**
|
|
158
|
+
* 得到对象画布的宽度,单位屏幕像素
|
|
159
|
+
* @returns number
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* Mx.MxFun.getCurrentDraw().getViewWidth()
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
MxDrawObject.prototype.getViewWidth = function () {
|
|
166
|
+
return _mxdrawObj.getViewWidth();
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* 得到对象画布的高度,单位屏幕像素
|
|
170
|
+
* @returns number
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* Mx.MxFun.getCurrentDraw().getViewHeight()
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
MxDrawObject.prototype.getViewHeight = function () {
|
|
177
|
+
return _mxdrawObj.getViewHeight();
|
|
178
|
+
};
|
|
157
179
|
/**
|
|
158
180
|
* 删除addObject函数添加的THREE.Object3D对象
|
|
159
181
|
* @param obj THREE.Object3D
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MxDrawObject.js","sourceRoot":"","sources":["../../../../src/MxModule/MxDrawObject/MxDrawObject.ts"],"names":[],"mappings":";AAAA,2BAA2B;;AAI3B,IAAI,UAA4B,CAAA;AAChC;;;;;;;;;GASG;AACH;IACE,sBAAY,MAAwB;QAClC,UAAU,GAAG,MAAM,CAAA;IACrB,CAAC;IAMD;;;OAGG;IACH,+BAAQ,GAAR;QACE,OAAO,UAAU,CAAC,QAAQ,EAAE,CAAA;IAC9B,CAAC;IAED;;;OAGG;IACH,gCAAS,GAAT;QACE,OAAO,UAAU,CAAC,SAAS,EAAE,CAAA;IAC/B,CAAC;IAED;;;OAGG;IACH,kCAAW,GAAX;QACE,OAAO,UAAU,CAAC,QAAQ,CAAA;IAC5B,CAAC;IACD;;;;;;;;;OASG;IACH,0CAAmB,GAAnB,UAAoB,QAAe;QAAf,yBAAA,EAAA,eAAe;QACjC,OAAO,UAAU,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IACjD,CAAC;IAED;;;;;;;OAOG;IACH,0CAAmB,GAAnB;QACE,OAAO,UAAU,CAAC,mBAAmB,EAAE,CAAA;IACzC,CAAC;IAED;;;OAGG;IACH,gCAAS,GAAT;QACE,OAAO,UAAU,CAAC,SAAS,EAAE,CAAA;IAC/B,CAAC;IAED;;;OAGG;IACH,oCAAa,GAAb;QACE,OAAO,UAAU,CAAC,aAAa,EAAE,CAAA;IACnC,CAAC;IACD;;;;;;;;;;;OAWG;IACH,4CAAqB,GAArB,UAAsB,EAA+B,EAAE,KAAc;QACnE,OAAO,UAAU,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;IACpD,CAAC;IAED;;;;;;;;OAQG;IACH,mCAAY,GAAZ,UAAa,KAAa;QACxB,OAAO,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IACvC,C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BAA2B;QAC3D,OAAO,UAAU,CAAC,YAAY,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;IAC3D,CAAC;IAED;;;OAGG;IACH,wCAAiB,GAAjB;QACE,OAAO,UAAU,CAAC,iBAAiB,EAAE,CAAA;IACvC,CAAC;IAED;;;;;;;;OAQG;IACH,gCAAS,GAAT,UAAU,KAAa;QACrB,OAAO,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;IAED;;;;;;;;;;OAUG;IACH,4BAAK,GAAL,UAAM,KAAoB,EAAE,KAAoB,EAAE,OAAiB;QACjE,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;IAED;;;;;;;;;OASG;IACH,iCAAU,GAAV,UAAW,KAAa,EAAE,KAAa;QACrC,OAAO,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAC5C,CAAC;IAED;;;;;;;;;;OAUG;IACH,gCAAS,GAAT,UAAU,MAAqB,EAAE,MAAqB;QACpD,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,CAAC;IAED;;;;;;;;;;OAUG;IAEH;;;;;;;;;;;;;;OAcG;IACH,+BAAQ,GAAR,UAAS,SAAiB,EAAE,GAA4B;QACtD,OAAO,UAAU,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;IAC5C,CAAC;IAED;;;;;;;;;OASG;IACH,gCAAS,GAAT,UAAU,OAAyC;QACjD,OAAO,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;IACtC,CAAC;IACH,mBAAC;AAAD,CAAC,AA/SD,IA+SC"}
|
|
@@ -7,7 +7,7 @@ var three_2 = require("../../tools/three");
|
|
|
7
7
|
function default_1(MxThreeJS) {
|
|
8
8
|
MxThreeJS.createImage = function (pos, w, h, imageUrlPath, callResult) {
|
|
9
9
|
new three_1.TextureLoader().load(imageUrlPath, function (texture) {
|
|
10
|
-
var geometry = new three_1.PlaneGeometry(w,
|
|
10
|
+
var geometry = new three_1.PlaneGeometry(w, h);
|
|
11
11
|
// 测试 transparent: true,打开,renderOrder才管用。
|
|
12
12
|
var materialTexture = new three_1.MeshLambertMaterial({
|
|
13
13
|
map: texture,
|
|
@@ -5982,8 +5982,8 @@ function mxfun() { !function a(o, s, l) { function c(e, t) { if (!s[e]) {
|
|
|
5982
5982
|
var e = new h.MxNet;
|
|
5983
5983
|
e.init(this, !1), this._extRefManager.createTzDwgExternalReferences(99999), e.setCurrentDatabaseId(99999), this._staticLoadTzNet = new h.MxHFileLoad(e), this._staticLoadTzNet.setShowloading(!1), this._staticLoadTzNet.setRequestHeader(this._requestHeader), this._staticLoadTzNet.load(encodeURIComponent(this._tzDwgStaticFile));
|
|
5984
5984
|
}
|
|
5985
|
-
} }, _.prototype.getStaticNet = function () { return this._staticNet; }, _.prototype.isStaticFileNet = function () { return !this._isStaticLocalLoad && null != this._staticNet; }, _.prototype.getStaticLocalNet = function () { return this._staticLocalNet; }, _.prototype.getStaticLoadTzNet = function () { return this._staticLoadTzNet; }, _.prototype.getViewWidth = function () { return null != this._userCanvas ? this._userCanvas.clientWidth : this._viewWidth; }, _.prototype.getViewHeight = function () { return null != this._userCanvas ? this._userCanvas.clientHeight : this._viewHeight; }, _.prototype.makeCurrent = function () { p.MxManager.setCurrentMx(this); }, _.prototype.createCanvasImageData = function (e, t) { var n = this, i = 0, r = 0, a = !1; t && t.width && t.height && (i = this.getViewWidth(), r = this.getViewHeight(), a = !0, this.setSize(t.width, t.height)), this._callCreateCanvasImageData = function (t) { a && n.setSize(i, r), e(t); }, this.updateDisplay(); }, _.prototype.getIntersectObjects = function (t) { var e = new c.Raycaster; e.linePrecision = this.screenCoordLong2World(4); var n = this.getCanvas(), i = n.clientWidth, r = n.clientHeight; return t = new c.Vector2(t.x / i * 2 - 1, -t.y / r * 2 + 1), e.setFromCamera(t, this.camera), e.intersectObjects(this.threejsselectObjects.children, !0); }, _.prototype.addObject = function (t, e) { null == e || 1 == e ?
|
|
5986
|
-
this.threejsselectObjects.remove(this.threejsselectObjects.children[0]); }, _.prototype.removeObject = function (t, e) { null == e || 1 == e ? this.threejsselectObjects.remove(t) : this.scene.remove(t); }, _.prototype.render = function () { this.renderer.autoClear = !0, this.renderer.render(this.scene, this.camera), null != this._callCreateCanvasImageData && (this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")), this._callCreateCanvasImageData = void 0), this.
|
|
5985
|
+
} }, _.prototype.getStaticNet = function () { return this._staticNet; }, _.prototype.isStaticFileNet = function () { return !this._isStaticLocalLoad && null != this._staticNet; }, _.prototype.getStaticLocalNet = function () { return this._staticLocalNet; }, _.prototype.getStaticLoadTzNet = function () { return this._staticLoadTzNet; }, _.prototype.getViewWidth = function () { return null != this._userCanvas ? this._userCanvas.clientWidth : this._viewWidth; }, _.prototype.getViewHeight = function () { return null != this._userCanvas ? this._userCanvas.clientHeight : this._viewHeight; }, _.prototype.makeCurrent = function () { p.MxManager.setCurrentMx(this); }, _.prototype.createCanvasImageData = function (e, t) { var n = this, i = 0, r = 0, a = !1; t && t.width && t.height && (i = this.getViewWidth(), r = this.getViewHeight(), a = !0, this.setSize(t.width, t.height)), this._callCreateCanvasImageData = function (t) { a && n.setSize(i, r), e(t); }, this.updateDisplay(); }, _.prototype.getIntersectObjects = function (t) { var e = new c.Raycaster; e.linePrecision = this.screenCoordLong2World(4); var n = this.getCanvas(), i = n.clientWidth, r = n.clientHeight; return t = new c.Vector2(t.x / i * 2 - 1, -t.y / r * 2 + 1), e.setFromCamera(t, this.camera), e.intersectObjects(this.threejsselectObjects.children, !0); }, _.prototype.addObject = function (t, e) { null == e || 1 == e ? this.threejsselectObjects.add(t) : this.scene.add(t); }, _.prototype.addViewObject = function (t, e) { this.secenView ? null == e || 1 == e ? this.threejsselectObjectsView.add(t) : this.secenView.add(t) : console.log("this.secenView is null"); }, _.prototype.removeAllSelectObject = function () { for (; this.threejsselectObjects.children.length;)
|
|
5986
|
+
this.threejsselectObjects.remove(this.threejsselectObjects.children[0]); }, _.prototype.removeObject = function (t, e) { null == e || 1 == e ? this.threejsselectObjects.remove(t) : this.scene.remove(t); }, _.prototype.render = function () { this.secenView ? (this.renderer.autoClear = !0, this.renderer.render(this.secenView, this.cameraView), this.renderer.autoClear = !1) : this.renderer.autoClear = !0, this.renderer.render(this.scene, this.camera), null != this._callCreateCanvasImageData && (this._callCreateCanvasImageData(this.renderer.domElement.toDataURL("image/png")), this._callCreateCanvasImageData = void 0), this.callEvent("render", this.renderer); }, _.prototype.updateDisplay = function (t) { function e() { n._isAnimation ? (n._isAnimationStarting = !0, requestAnimationFrame(this.needRander)) : n._isWaiteCount = 0, n.render(); } void 0 === t && (t = !1); var n = this; !0 !== t ? this._isAnimationStarting || (this._isAnimation ? requestAnimationFrame(e) : ((5 < this._isWaiteCount || this._isWaiteCount < 0) && (this._isWaiteCount = 0), this._isWaiteCount <= 0 && requestAnimationFrame(e), this._isWaiteCount++)) : e(); }, _.prototype.gotoLayout = function (t) { "Modle" == t && (t = ""); var e = this._openFile; for (var n in this._iniParam)
|
|
5987
5987
|
"srcname" == (o = (a = this._iniParam[n])[0]) && (e = a[1]); var i = {}, r = ""; for (var n in this._iniParam) {
|
|
5988
5988
|
var a, o;
|
|
5989
5989
|
if (null == i[o = (a = this._iniParam[n])[0]]) {
|
|
@@ -5999,14 +5999,10 @@ function mxfun() { !function a(o, s, l) { function c(e, t) { if (!s[e]) {
|
|
|
5999
5999
|
continue;
|
|
6000
6000
|
0 == r.length ? r = o + "=" + s + "&srcname=" + e : r += "&" + o + "=" + s;
|
|
6001
6001
|
}
|
|
6002
|
-
} var c = u.MxFun.getLocationPageUrl() + "?" + r; window.location.href = c; }, _.prototype.addInitParam = function (t, e) { var n = new Array; n.push(t), n.push(e), this._iniParam.push(n); }, _.prototype.
|
|
6003
|
-
this.secenView = new c.Scene;
|
|
6004
|
-
var t = this.getViewWidth(), e = this.getViewHeight();
|
|
6005
|
-
t = this.xzSize(t), e = this.xzSize(e), this.cameraView = new c.OrthographicCamera(0, t, 0, e, .1, 2e3), this.cameraView.position.set(0, 0, 2e3), this.cameraView.updateProjectionMatrix();
|
|
6006
|
-
} }, _.prototype.updataCameraView = function (t, e) { var n = t, i = e; this.cameraView.left = 0, this.cameraView.right = n, this.cameraView.top = 0, this.cameraView.bottom = i, this.cameraView.updateProjectionMatrix(); }, _.prototype.create = function (t, e) { if (this._callCreateCanvasImageData = void 0, this._isCreate = !0, this._devicePixelRatio = window.devicePixelRatio, this._openFile = e, this._iniParam = u.MxFun.getUrlParams(), this._openFileExtName = e.substring(e.lastIndexOf(".") + 1), "" != this._openFile && this._runMode != s.kMxCAD && this._runMode != s.kMxCADBrowseApp) {
|
|
6002
|
+
} var c = u.MxFun.getLocationPageUrl() + "?" + r; window.location.href = c; }, _.prototype.addInitParam = function (t, e) { var n = new Array; n.push(t), n.push(e), this._iniParam.push(n); }, _.prototype.create = function (t, e) { if (this._callCreateCanvasImageData = void 0, this._isCreate = !0, this._devicePixelRatio = window.devicePixelRatio, this._openFile = e, this._iniParam = u.MxFun.getUrlParams(), this._openFileExtName = e.substring(e.lastIndexOf(".") + 1), "" != this._openFile && this._runMode != s.kMxCAD && this._runMode != s.kMxCADBrowseApp) {
|
|
6007
6003
|
var n = new Array;
|
|
6008
6004
|
n.push("file"), n.push(this._openFile), this._iniParam.push(n);
|
|
6009
|
-
} "" != this._userIdentitySign && (this.addInitParam("userIdentitySign", this._userIdentitySign), this.addInitParam("userRandomToken", this._userRandomToken)), this.addInitParam("runMode", this._runMode == s.kMxCAD || this._runMode == s.kMxCADBrowseApp ? "mxcad" : "browse"), this._runMode == s.kMxCAD || this._runMode == s.kMxCADBrowseApp ? ("empty" == this._openFile && (this._openFile = ""), this._mxCAD = new g.MxCADObject(this)) : this._mxCAD = null, this._userCanvas = t; var i = window.innerWidth, r = window.innerHeight; null != t && (i = t.clientWidth, r = t.clientHeight), this._viewWidth = i, this._viewHeight = r, this.onInitThreejs(), this.
|
|
6005
|
+
} "" != this._userIdentitySign && (this.addInitParam("userIdentitySign", this._userIdentitySign), this.addInitParam("userRandomToken", this._userRandomToken)), this.addInitParam("runMode", this._runMode == s.kMxCAD || this._runMode == s.kMxCADBrowseApp ? "mxcad" : "browse"), this._runMode == s.kMxCAD || this._runMode == s.kMxCADBrowseApp ? ("empty" == this._openFile && (this._openFile = ""), this._mxCAD = new g.MxCADObject(this)) : this._mxCAD = null, this._userCanvas = t; var i = window.innerWidth, r = window.innerHeight; null != t && (i = t.clientWidth, r = t.clientHeight), this._viewWidth = i, this._viewHeight = r, this.onInitThreejs(), this.onCreate(), this.threejsselectObjects = new c.Object3D, this.scene.add(this.threejsselectObjects), this._objectsOsnap = new y.MxDrawObjectOsnap(this), this._is2d && (this._runMode != s.kMxCAD && this._runMode != s.kMxCADBrowseApp || (this.controls.mouseButtons.LEFT = -1, this.controls.mouseButtons.RIGHT = -1, this.controls.mouseButtons.MIDDLE = c.MOUSE.PAN)), this._select = new d.MxSelect(this, this.getCanvas()), this._select.enabled = u.MxFun.isEnableSelect(), this._select.init(), this._is2d || (this._select.enabled = !1), this._runMode != s.kBrowse && (this._select.enabled = !1), p.MxManager.add(this), p.MxManager.setCurrentMx(this); var a = this; if (this.controls.addEventListener("change", function () { f.MxJigCmdManager.OnThreeControlsChage(), a.callEvent("viewchange"); var t = a.getMxCAD(); t && t.getGrip().onControlsChage(), a.updateDisplay(); }), this.updateDisplay(), null == t)
|
|
6010
6006
|
window.addEventListener("resize", function () { a._viewWidth = window.innerWidth, a._viewHeight = window.innerHeight, a.onResizeImp(), a.updateDisplay(); }, !1);
|
|
6011
6007
|
else {
|
|
6012
6008
|
var o = function () { if (a._viewWidth = a._userCanvas.clientWidth, a._viewHeight = a._userCanvas.clientHeight, null != a._event.onResize) {
|
|
@@ -6034,7 +6030,7 @@ function mxfun() { !function a(o, s, l) { function c(e, t) { if (!s[e]) {
|
|
|
6034
6030
|
var i = t.getInt32(4 * (n + 20), !0);
|
|
6035
6031
|
this.removeEntity(i);
|
|
6036
6032
|
} }, _.prototype.removeAllEntity = function () { var r = this; this._mapId2Entity.forEach(function (t, e, n) { for (var i in t)
|
|
6037
|
-
r.scene.remove(t[i]); }), this._mapId2Entity.clear(), this._sketchLayers.removeAllEntity(); }, _.prototype.mxWebAddEntity = function (t) { this._setAdyDelete.clear(); var e = this.mxWebAddEntity_3DChild(t); this.mxWebAddEntity_Curve(t, e), this._setAdyDelete.clear(); }, _.prototype.screenCoord2World = function (t, e, n) { var i = this.getCanvas(), r = i.clientWidth, a = i.clientHeight; n = .5; var o = this.camera; o && o.isOrthographicCamera && (n = (o.near + o.far) / (o.near - o.far)); var s = new c.Vector3(t / r * 2 - 1, -e / a * 2 + 1, n); return s.unproject(this.camera), s; }, _.prototype.worldCoord2Screen = function (t, e, n) { var i = new c.Vector3(t, e, n).project(this.camera), r = this.getCanvas(), a = r.clientWidth / 2, o = r.clientHeight / 2, s = Math.round(i.x * a + a), l = Math.round(-i.y * o + o); return new c.
|
|
6033
|
+
r.scene.remove(t[i]); }), this._mapId2Entity.clear(), this._sketchLayers.removeAllEntity(); }, _.prototype.mxWebAddEntity = function (t) { this._setAdyDelete.clear(); var e = this.mxWebAddEntity_3DChild(t); this.mxWebAddEntity_Curve(t, e), this._setAdyDelete.clear(); }, _.prototype.screenCoord2World = function (t, e, n) { var i = this.getCanvas(), r = i.clientWidth, a = i.clientHeight; n = .5; var o = this.camera; o && o.isOrthographicCamera && (n = (o.near + o.far) / (o.near - o.far)); var s = new c.Vector3(t / r * 2 - 1, -e / a * 2 + 1, n); return s.unproject(this.camera), s; }, _.prototype.worldCoord2Screen = function (t, e, n) { var i = new c.Vector3(t, e, n).project(this.camera), r = this.getCanvas(), a = r.clientWidth / 2, o = r.clientHeight / 2, s = Math.round(i.x * a + a), l = Math.round(-i.y * o + o); return new c.Vector3(s, l, 0); }, _.prototype.worldCoordLong2Doc = function (t) { var e = this.worldCoord2Doc(0, 0, 0), n = this.worldCoord2Doc(t, 0, 0); return e.distanceTo(n); }, _.prototype.docCoordLong2World = function (t) { var e = this.docCoord2World(0, 0, 0), n = this.docCoord2World(t, 0, 0); return e.distanceTo(n); }, _.prototype.docCoord2World = function (t, e, n) { var i = new c.Vector3(t, e, n); return i.applyMatrix4(this._doc2World), i; }, _.prototype.worldCoord2Doc = function (t, e, n) { var i = new c.Vector3(t, e, n); return i.applyMatrix4(this._word2doc), i; }, _.prototype.screenCoord2Doc = function (t, e, n) { var i = this.screenCoord2World(t, e, n); return this.worldCoord2Doc(i.x, i.y, i.z); }, _.prototype.docCoord2Screen = function (t, e, n) { var i = this.docCoord2World(t, e, n); return this.worldCoord2Screen(i.x, i.y, i.z); }, _.prototype.screenCoordLong2Doc = function (t) { var e = this.screenCoord2Doc(0, 0, 0), n = this.screenCoord2Doc(t, 0, 0); return e.distanceTo(n); }, _.prototype.screenCoordLong2DocScale = function () { var t = this.screenCoord2Doc(0, 0, 0), e = this.screenCoord2Doc(1, 0, 0); return t.distanceTo(e); }, _.prototype.docCoordLong2Screen = function (t) { var e = this.docCoord2Screen(0, 0, 0), n = this.docCoord2Screen(t, 0, 0); return e.distanceTo(n); }, _.prototype.screenCoordLong2World = function (t) { var e = this.screenCoord2World(0, 0, 0), n = this.screenCoord2World(t, 0, 0); return e.distanceTo(n); }, _.prototype.worldCoordLong2Screen = function (t) { var e = this.worldCoord2Screen(0, 0, 0), n = this.worldCoord2Screen(t, 0, 0); return e.distanceTo(n); }, _.prototype.intiDoc2Wold = function (t) { this._doc2World.fromArray(t), this._word2doc.getInverse(this._doc2World); }, _.prototype.enableSingleTouchPan = function (t) { this.controls.enablePan = t; }, _.prototype.mxWebAddEntityFor2dPointMeshBuffers = function (t, e) { var n = new L.MxNetData(t), i = n.getdPointMeshBuffersHead(), r = i.zeroLayerIdIndex, a = i.databaseIndex; -1 != e && (a = e); for (var o = i.datasize, s = 0; s < i.datacount; s++) {
|
|
6038
6034
|
var l = n.getdPointMeshBufferDataHead(o);
|
|
6039
6035
|
o = l.offset;
|
|
6040
6036
|
var c = l.layerId, u = c == r, h = l.blkId, d = l.pointCount;
|
|
@@ -6139,7 +6135,7 @@ function mxfun() { !function a(o, s, l) { function c(e, t) { if (!s[e]) {
|
|
|
6139
6135
|
C.addGeometryMesh(l, c, r, h, u, d), M.createThreejsObj(C, this, S);
|
|
6140
6136
|
}
|
|
6141
6137
|
} }, _.prototype.mxWebCreateAllBlocks = function (t, e) { var n = new L.MxNetData(t).getDatabaseIndex(); -1 != e && (n = e); var i = this._blocks; 0 != n && (i = this._extRefManager.getBlocks(n)), i.createBlocks(t, this.scene); }, _.prototype.mxWebEntitysData = function (t, e) { -1 == e && this._objectsOsnap.mxWebEntitysData(t, e); }, _.prototype.getObjectOsnap = function () { return this._objectsOsnap; }, _);
|
|
6142
|
-
function _() { this._is2d = !0, this._runMode = s.kBrowse, this._mxCAD = null, this._userCanvas = null, this._openFile = "empty", this._openFileExtName = "", this._userIdentitySign = "", this._userRandomToken = "", this._isCreate = !1, this.m_iniSet = {}, this._net = null, this._staticNet = null, this._staticLoadTzNet = null, this._staticLocalNet = null, this._isStaticLocalLoad = !1, this._staticLocalLoadPath = "", this._viewWidth = 1, this._viewHeight = 1, this.m_sysVariable = new m.MxSystemVariable, this._color = "#FFFFFF", this._viewcolor = 15790320, this._isAnimation = !1, this._isAnimationStarting = !1, this._isWaiteCount = 0, this._callCreateCanvasImageData = void 0, this._event = {}, this.scene = null, this.camera = null, this.secenView = null, this.cameraView = null, this.renderer = null, this.controls = null, this.threejsselectObjects = null, this._mouseRightRotate = !0, this._mapId2Entity = new Map, this._setAdyDelete = new Map, this._sketchLayers = new a.MxCadSketchLayers(this), this._layers = new o.MxBrowseLayerData, this._blocks = new l.Blocks, this._extRefManager = new l.ExternalReferenceManager, this._doc2World = new c.Matrix4, this._word2doc = new c.Matrix4, this._allLayoutName = new Array, this._devicePixelRatio = 1, this._tzDwgStaticFile = "", this._requestHeader = "", this._objectsOsnap = null, this._initZoomwCoordPt1 = null, this._initZoomWCoordPt2 = null, this._blocks.initRootBlockRef(), this.m_iniSet[r.kEnableOsnapFunction] = !1, this.m_sysVariable.init(this); }
|
|
6138
|
+
function _() { this._is2d = !0, this._runMode = s.kBrowse, this._mxCAD = null, this._userCanvas = null, this._openFile = "empty", this._openFileExtName = "", this._userIdentitySign = "", this._userRandomToken = "", this._isCreate = !1, this.m_iniSet = {}, this._net = null, this._staticNet = null, this._staticLoadTzNet = null, this._staticLocalNet = null, this._isStaticLocalLoad = !1, this._staticLocalLoadPath = "", this._viewWidth = 1, this._viewHeight = 1, this.m_sysVariable = new m.MxSystemVariable, this._color = "#FFFFFF", this._viewcolor = 15790320, this._isAnimation = !1, this._isAnimationStarting = !1, this._isWaiteCount = 0, this._callCreateCanvasImageData = void 0, this._event = {}, this.scene = null, this.camera = null, this.secenView = null, this.cameraView = null, this.renderer = null, this.controls = null, this.threejsselectObjects = null, this.threejsselectObjectsView = null, this._mouseRightRotate = !0, this._mapId2Entity = new Map, this._setAdyDelete = new Map, this._sketchLayers = new a.MxCadSketchLayers(this), this._layers = new o.MxBrowseLayerData, this._blocks = new l.Blocks, this._extRefManager = new l.ExternalReferenceManager, this._doc2World = new c.Matrix4, this._word2doc = new c.Matrix4, this._allLayoutName = new Array, this._devicePixelRatio = 1, this._tzDwgStaticFile = "", this._requestHeader = "", this._objectsOsnap = null, this._initZoomwCoordPt1 = null, this._initZoomWCoordPt2 = null, this._blocks.initRootBlockRef(), this.m_iniSet[r.kEnableOsnapFunction] = !1, this.m_sysVariable.init(this); }
|
|
6143
6139
|
n.MxDrawObject = x;
|
|
6144
6140
|
}, { "./MxBrowseDisplay": 23, "./MxBrowseLayerData": 24, "./MxCADObject": 28, "./MxCadSketchLayer": 31, "./MxDrawObjectOsnap": 38, "./MxFun": 39, "./MxJigCmdManager": 42, "./MxLocalFileLoad": 44, "./MxManager": 45, "./MxNetData": 47, "./MxSelect": 48, "./MxSystemVariable": 51, three: 19 }], 36: [function (t, e, n) {
|
|
6145
6141
|
"use strict";
|
|
@@ -6155,12 +6151,20 @@ function mxfun() { !function a(o, s, l) { function c(e, t) { if (!s[e]) {
|
|
|
6155
6151
|
l.left = -c * u, l.right = c * u, l.top = c, l.bottom = -c;
|
|
6156
6152
|
}
|
|
6157
6153
|
else
|
|
6158
|
-
c = .5 * o, u = a / r, l.left = -c, l.right = c, l.top = c * u, l.bottom = -c * u; var h = o, d = s, p = h; p < h && (p = d), l.far = p; var f = t.x + .5 * h, m = t.y + .5 * d; l.zoom = 1, l.position.set(f, m, .5 * p), l.lookAt(new g.Vector3(f, m, 0)), l.updateProjectionMatrix(), this.controls.target.x = f, this.controls.target.y = m, this.controls.target.z = 0, this.controls.update(); }, d.prototype.zoomScale = function (t) { var e = this.getOrthographicCamera(); e.zoom = Math.max(this.controls.minZoom, Math.min(this.controls.maxZoom, e.zoom * t)), e.updateProjectionMatrix(), this.controls.update(); }, d.prototype.zoomCenter = function (t, e) { var n = this.getOrthographicCamera(), i = this.docCoord2World(t, e, 0); t = i.x, e = i.y, n.position.set(t, e, n.position.z), n.lookAt(new g.Vector3(t, e, 0)), n.updateProjectionMatrix(), this.controls.target.x = t, this.controls.target.y = e, this.controls.target.z = 0, this.controls.update(); }, d.prototype.calcCameraUp = function (t) { var e = new g.Vector3(0, 1, 0), n = new g.Matrix4; return n.makeRotationZ(t), e.applyMatrix4(n), e; }, d.prototype.updateCameraDisplayRange = function (t, e, n) { null != this._initZoomwCoordPt1 && null != this._initZoomWCoordPt2 ? (this._minDisplayPoint = this.docCoord2World(this._initZoomwCoordPt1.x, this._initZoomwCoordPt1.y, 0), this._maxDisplayPoint = this.docCoord2World(this._initZoomWCoordPt2.x, this._initZoomWCoordPt2.y, 0)) : (this._minDisplayPoint = t, this._maxDisplayPoint = e), this.camera.up = this.calcCameraUp(n), this.zoomW(this._minDisplayPoint, this._maxDisplayPoint, !0); }, d.prototype.zoomInitialStates = function () { null != this._minDisplayPoint && null != this._maxDisplayPoint ? this.zoomW(this._minDisplayPoint, this._maxDisplayPoint, !0) : console.log("mx assert(0)"); }, d.prototype.onInitScene = function () { var t = this.getEvent(), e = 0; if (null != t.initScene && (e = t.initScene(this.scene, this.controls, !0)), 0 == e) {
|
|
6154
|
+
c = .5 * o, u = a / r, l.left = -c, l.right = c, l.top = c * u, l.bottom = -c * u; var h = o, d = s, p = h; p < h && (p = d), l.far = p; var f = t.x + .5 * h, m = t.y + .5 * d; l.zoom = 1, l.position.set(f, m, .5 * p), l.lookAt(new g.Vector3(f, m, 0)), l.updateProjectionMatrix(), this.controls.target.x = f, this.controls.target.y = m, this.controls.target.z = 0, this.controls.update(); }, d.prototype.zoomScale = function (t) { var e = this.getOrthographicCamera(); e.zoom = Math.max(this.controls.minZoom, Math.min(this.controls.maxZoom, e.zoom * t)), e.updateProjectionMatrix(), this.controls.update(); }, d.prototype.zoomCenter = function (t, e) { var n = this.getOrthographicCamera(), i = this.docCoord2World(t, e, 0); t = i.x, e = i.y, n.position.set(t, e, n.position.z), n.lookAt(new g.Vector3(t, e, 0)), n.updateProjectionMatrix(), this.controls.target.x = t, this.controls.target.y = e, this.controls.target.z = 0, this.controls.update(); }, d.prototype.calcCameraUp = function (t) { var e = new g.Vector3(0, 1, 0), n = new g.Matrix4; return n.makeRotationZ(t), e.applyMatrix4(n), e; }, d.prototype.updateCameraDisplayRange = function (t, e, n) { null != this._initZoomwCoordPt1 && null != this._initZoomWCoordPt2 ? (this._minDisplayPoint = this.docCoord2World(this._initZoomwCoordPt1.x, this._initZoomwCoordPt1.y, 0), this._maxDisplayPoint = this.docCoord2World(this._initZoomWCoordPt2.x, this._initZoomWCoordPt2.y, 0)) : (this._minDisplayPoint = t, this._maxDisplayPoint = e), this.camera.up = this.calcCameraUp(n), this.cameraView.up = this.calcCameraUp(n), this.cameraView.updateProjectionMatrix(), this.zoomW(this._minDisplayPoint, this._maxDisplayPoint, !0); }, d.prototype.zoomInitialStates = function () { null != this._minDisplayPoint && null != this._maxDisplayPoint ? this.zoomW(this._minDisplayPoint, this._maxDisplayPoint, !0) : console.log("mx assert(0)"); }, d.prototype.onInitScene = function () { var t = this.getEvent(), e = 0; if (null != t.initScene && (e = t.initScene(this.scene, this.controls, !0)), 0 == e) {
|
|
6159
6155
|
var n = new g.AmbientLight(3355443, 1);
|
|
6160
6156
|
this.scene.add(n);
|
|
6161
6157
|
var i = new g.DirectionalLight(16777215, 1);
|
|
6162
6158
|
i.position.set(-2, 2, 3).normalize(), this.scene.add(i);
|
|
6163
|
-
} }, d.prototype.
|
|
6159
|
+
} }, d.prototype.updataCameraView = function (t, e) { var n = t, i = e; this.cameraView.left = 0, this.cameraView.right = n, this.cameraView.top = i, this.cameraView.bottom = 0, this.cameraView.updateProjectionMatrix(); }, d.prototype.initViewScene = function () { if (!this.secenView) {
|
|
6160
|
+
this.secenView = new g.Scene, this.secenView.background = new g.Color(this._viewcolor);
|
|
6161
|
+
var t = this.getViewWidth(), e = this.getViewHeight();
|
|
6162
|
+
t = this.xzSize(t), e = this.xzSize(e), this.cameraView = new g.OrthographicCamera(0, t, e, 0, 1, 2e3), this.cameraView.position.set(0, 0, 2e3), this.cameraView.lookAt(new g.Vector3(0, 0, 0)), this.cameraView.updateProjectionMatrix();
|
|
6163
|
+
var n = new g.AmbientLight(3355443, 1);
|
|
6164
|
+
this.secenView.add(n);
|
|
6165
|
+
var i = new g.DirectionalLight(16777215, 1);
|
|
6166
|
+
i.position.set(-2, 2, 3).normalize(), this.secenView.add(i), this.threejsselectObjectsView = new g.Object3D, this.secenView.add(this.threejsselectObjectsView);
|
|
6167
|
+
} }, d.prototype.onInitThreejs = function () { var t = this.getViewWidth(), e = this.getViewHeight(), n = (t = this.xzSize(t)) / (e = this.xzSize(e)) * 50; this.initViewScene(), this.camera = new g.OrthographicCamera(n / -2, n / 2, 25, -25, 1, 1e3), this.camera.position.set(0, 0, 200), this.scene = new g.Scene; var i = this.getUserCanvas(); if (null == i)
|
|
6164
6168
|
this.renderer = new g.WebGLRenderer({ antialias: !1 }), this.renderer.setClearColor(0, 1), this.renderer.setPixelRatio(this._devicePixelRatio), this.renderer.setSize(t, e), document.body.appendChild(this.renderer.domElement);
|
|
6165
6169
|
else {
|
|
6166
6170
|
var r = {};
|