mxdraw 0.1.93 → 0.1.96
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/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -1
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -1
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -1
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -1
- package/dist/lib/MxModule/MxType/MxType.js +1 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
- package/dist/mxdraw.es5.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +7 -0
- package/dist/types/MxModule/MxDbImage/MxDbImage.d.ts +3 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +18 -0
- package/dist/types/MxModule/MxType/MxType.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDbAlignedDimension=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.point1=new THREE.Vector3,e.point2=new THREE.Vector3,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbAlignedDimension"},e.prototype.getDirection=function(t,e,r){var n=new THREE.Vector3(t.x,t.y,0),i=new THREE.Vector3(1,0,0),o=t.angleTo(i),a=-1;(o<7*Math.PI/18||o>10*Math.PI/18)&&e.x>r.x&&(a=1);var p=new THREE.Matrix4;return p.makeRotationZ(Math.PI/2*a),n.applyMatrix4(p),n},e.prototype.getDimText=function(){return new THREE.Vector3(this.point1.x-this.point2.x,this.point1.y-this.point2.y,0).length().toFixed(3)},e.prototype.worldDraw=function(t){if(t.getType()==McGiWorldDrawType_1.default.kWorldDraw||t.getType()==McGiWorldDrawType_1.default.kDynDragDraw){var e,r,n,i,o,a,p,y=this.point1,c=this.point2,x=new THREE.Vector3(y.x-c.x,y.y-c.y,0),E=this.getDirection(x,y,c),u=new THREE.Matrix4;u.makeScale(.01,.01,.01),(h=new THREE.Vector3(E.x,E.y,0)).applyMatrix4(u);var l=new THREE.Vector3(y.x+h.x,y.y+h.y,0),w=new THREE.Vector3(c.x+h.x,c.y+h.y,0),s=16777215;a=MxThreeJS_1.default.createPoint(y,s),p=MxThreeJS_1.default.createPoint(c,s),u.identity(),u.makeScale(.2,.2,0),new THREE.Vector3(E.x,E.y,0).applyMatrix4(u),u.identity(),u.makeScale(.02,.02,0);var T=new THREE.Vector3(E.x,E.y,0);T.applyMatrix4(u),t.drawLine(l,w),e=MxThreeJS_1.default.createLine(new THREE.Vector3(l.x+2*T.x,l.y+2*T.y,0),new THREE.Vector3(y.x+T.x,y.y+T.y,0),s),r=MxThreeJS_1.default.createLine(new THREE.Vector3(w.x+2*T.x,w.y+2*T.y,0),new THREE.Vector3(c.x+T.x,c.y+T.y,0),s);var h,d=new THREE.Vector3(1,0,0),M=x.angleTo(d);(h=new THREE.Vector3(E.x,E.y,0)).normalize();var f=y.distanceTo(c);x.y<0?M=M<Math.PI/2?2*Math.PI-M:Math.PI-M:M>Math.PI/2&&(M=Math.PI+M);var R=this.getDimText();null!=(n=MxThreeJS_1.default.creatTextSprite(
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDbAlignedDimension=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.point1=new THREE.Vector3,e.point2=new THREE.Vector3,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbAlignedDimension"},e.prototype.getDirection=function(t,e,r){var n=new THREE.Vector3(t.x,t.y,0),i=new THREE.Vector3(1,0,0),o=t.angleTo(i),a=-1;(o<7*Math.PI/18||o>10*Math.PI/18)&&e.x>r.x&&(a=1);var p=new THREE.Matrix4;return p.makeRotationZ(Math.PI/2*a),n.applyMatrix4(p),n},e.prototype.getDimText=function(){return new THREE.Vector3(this.point1.x-this.point2.x,this.point1.y-this.point2.y,0).length().toFixed(3)},e.prototype.worldDraw=function(t){if(t.getType()==McGiWorldDrawType_1.default.kWorldDraw||t.getType()==McGiWorldDrawType_1.default.kDynDragDraw){var e,r,n,i,o,a,p,y=this.point1,c=this.point2,x=new THREE.Vector3(y.x-c.x,y.y-c.y,0),E=this.getDirection(x,y,c),u=new THREE.Matrix4;u.makeScale(.01,.01,.01),(h=new THREE.Vector3(E.x,E.y,0)).applyMatrix4(u);var l=new THREE.Vector3(y.x+h.x,y.y+h.y,0),w=new THREE.Vector3(c.x+h.x,c.y+h.y,0),s=16777215;a=MxThreeJS_1.default.createPoint(y,s),p=MxThreeJS_1.default.createPoint(c,s),u.identity(),u.makeScale(.2,.2,0),new THREE.Vector3(E.x,E.y,0).applyMatrix4(u),u.identity(),u.makeScale(.02,.02,0);var T=new THREE.Vector3(E.x,E.y,0);T.applyMatrix4(u),t.drawLine(l,w),e=MxThreeJS_1.default.createLine(new THREE.Vector3(l.x+2*T.x,l.y+2*T.y,0),new THREE.Vector3(y.x+T.x,y.y+T.y,0),s),r=MxThreeJS_1.default.createLine(new THREE.Vector3(w.x+2*T.x,w.y+2*T.y,0),new THREE.Vector3(c.x+T.x,c.y+T.y,0),s);var h,d=new THREE.Vector3(1,0,0),M=x.angleTo(d);(h=new THREE.Vector3(E.x,E.y,0)).normalize();var f=y.distanceTo(c);x.y<0?M=M<Math.PI/2?2*Math.PI-M:Math.PI-M:M>Math.PI/2&&(M=Math.PI+M);var R=t.getMxObject();R&&(M-=R.getViewAngle());var H=this.getDimText();null!=(n=MxThreeJS_1.default.creatTextSprite(H,new THREE.Vector3(w.x+x.x/2+h.x*f/30,w.y+x.y/2+h.y*f/30,0),.07*f,M,s))&&t.drawEntity(n),u.identity(),u.makeScale(.08,.08,.08);var V=new THREE.Matrix4;V.makeRotationZ(17*Math.PI/18);var _=new THREE.Vector3(x.x,x.y,0);_.applyMatrix4(u),_.applyMatrix4(V),V.identity(),V.makeRotationZ(17*-Math.PI/18);var g=new THREE.Vector3(x.x,x.y,0);g.applyMatrix4(u),g.applyMatrix4(V);var D=new Array;D.push(new THREE.Vector3(l.x,l.y,0),new THREE.Vector3(l.x+_.x,l.y+_.y,0),new THREE.Vector3(l.x+g.x,l.y+g.y,0)),i=MxThreeJS_1.default.createTriangle(D,s),V.identity(),V.makeRotationZ(Math.PI/18),(_=new THREE.Vector3(x.x,x.y,0)).applyMatrix4(u),_.applyMatrix4(V),V.identity(),V.makeRotationZ(-Math.PI/18),(g=new THREE.Vector3(x.x,x.y,0)).applyMatrix4(u),g.applyMatrix4(V);var v=new Array;v.push(new THREE.Vector3(w.x,w.y,0),new THREE.Vector3(w.x+_.x,w.y+_.y,0),new THREE.Vector3(w.x+g.x,w.y+g.y,0)),o=MxThreeJS_1.default.createTriangle(v,s),t.drawEntity(e),t.drawEntity(r),i&&t.drawEntity(i),o&&t.drawEntity(o),t.drawEntity(a),t.drawEntity(p)}else t.drawLine(this.point1,this.point2)},e.prototype.setPoint1=function(t){this.point1=t},e.prototype.setPoint2=function(t){this.point2=t},e.prototype.getGripPoints=function(){var t=[];return t.push(this.point1),t.push(this.point2),t},e.prototype.moveGripPointsAt=function(t,e){return 0==t?this.point1.add(e):(t=1)&&this.point2.add(e),!0},e.prototype.dwgIn=function(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t},e.prototype.create=function(){return new e},e}(MxDbEntity_1.default);exports.default=MxDbAlignedDimension;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxType_1=require("../MxType"),store_1=require("../store/store"),MxDbEntity=function(){function t(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={},this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer=""}return t.prototype.dwgInHelp=function(t,e){var i=function(t){return t instanceof Array?r(t):"object"==typeof t?function(t){return!!(t.isVector3||t.isVector2||t.isVector4)}(t)?t.clone():2==t.datatype?new THREE.Vector2(t.x,t.y):3==t.datatype?new THREE.Vector3(t.x,t.y,t.z):4==t.datatype?new THREE.Vector4(t.x,t.y,t.z,t.w):o(t,Object.create(null)):t},r=function(t){return t.map(function(t){return i(t)})},o=function(t,e){for(var r in t)t[r]&&(e[r]=i(t[r]));return e},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxType_1=require("../MxType"),store_1=require("../store/store"),MxDbEntity=function(){function t(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={},this.sGuid="",this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer=""}return t.prototype.initGuid=function(t){this.sGuid.length>0?console.log("mx: init guid error"):this.sGuid=t},t.prototype.dwgInHelp=function(t,e){var i=function(t){return t instanceof Array?r(t):"object"==typeof t?function(t){return!!(t.isVector3||t.isVector2||t.isVector4)}(t)?t.clone():2==t.datatype?new THREE.Vector2(t.x,t.y):3==t.datatype?new THREE.Vector3(t.x,t.y,t.z):4==t.datatype?new THREE.Vector4(t.x,t.y,t.z,t.w):o(t,Object.create(null)):t},r=function(t){return t.map(function(t){return i(t)})},o=function(t,e){for(var r in t)t[r]&&(e[r]=i(t[r]));return e},s=this;return e.forEach(function(e){t[e]&&(s[e]=i(t[e]))}),!0},t.prototype.dwgOutHelp=function(t,e){var i=this;return e.forEach(function(e){t[e]=i[e];var r,o=(r=i[e]).isVector3?3:r.isVector2?2:r.isVector4?4:0;o&&(t[e].datatype=o)}),t},t.prototype.create=function(){return new(0,this.constructor)},t.prototype.transformBy=function(t){},t.prototype.getGeomExtents=function(){return null},t.prototype.getImp=function(){return this.MxDbEntityImp},t.prototype.setNeedUpdateDisplay=function(t){var e=this.getImp();return!!e&&(t?e.upDisplay():e.setDirtyDisplay(!0),!0)},t.prototype.getMxObject=function(){var t=this.getImp();return t?t.getMxObject():null},t.prototype.onViewChange=function(){return!1},t.prototype.objectId=function(){var t=this.getImp();return t?t.objectId():0},t.prototype.erase=function(){var t=this.getImp();return!!t&&t.erase()},t.prototype.setLayer=function(t){var e=this.getImp();e&&e.nodifySetLayer(),this.layer=t},t.prototype.getLayer=function(){return this.layer},t.prototype.setColor=function(t){this.color=t},t.prototype.getColor=function(){return this.color},t.prototype.clone=function(t){var e=this.create(),i={type:t||MxType_1.default.MxCloneType.kClone};return this.dwgOut(i),e.dwgIn(i),e.sGuid="",e},t.prototype.onDwgIn=function(t){this.color=t.color,this.renderOrder=t.renderOrder,this.opacity=t.opacity,this.visible=t.visible,t.userData?this.userData=JSON.parse(JSON.stringify(t.userData)):this.userData={},this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio,this.layer=t.layer,t.guid&&(this.sGuid=t.guid)},t.prototype.onDwgOut=function(t){t.color=this.color,t.renderOrder=this.renderOrder,t.opacity=this.opacity,t.visible=this.visible,Object.keys(this.userData).length>0&&(t.userData=this.userData),t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio,t.layer=this.layer,t.guid=this.sGuid},t.prototype.rxInit=function(){store_1.default.state.MxFun.initMxDbEntityType(this)},t.prototype.setRenderOrder=function(t){this.renderOrder=t},t.prototype.getRenderOrder=function(){return this.renderOrder},t.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels=t},t.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},t.prototype.setLineWidth=function(t){this.dLineWidth=t},t.prototype.getLineWidth=function(){return this.dLineWidth},t.prototype.getGetLength=function(){return 0},t.prototype.setDashLen=function(t){var e=this.getGetLength();if(!(e<1e-6||t<1e-6)){var i=Math.floor(e/t);i<1e-6&&(this.dDashRatio=0),this.dDashArray=1/i}},t.prototype.setDashRatio=function(t){this.dDashRatio=t},t.prototype.setDashArray=function(t){this.dDashArray=t},t.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)},t.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},t.prototype.setDashLineDisplay=function(t){t?(this.dDashArray<1e-5&&(this.dDashArray=.03),this.dDashRatio<1e-5&&(this.dDashRatio=.1),0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},t.prototype.isDashLineDisplay=function(){return this.dDashArray>0&&this.dDashRatio>0},t.prototype.guid=function(){return this.sGuid},t}();exports.default=MxDbEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxFun_1=require("../MxFun"),MxDbImage=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pt1=new THREE.Vector3,e.pt2=new THREE.Vector3,e.imagePath="",e.isLoadMaterialFromPath=!0,e.material=null,e.angle=0,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbImage"},e.prototype.getAngle=function(){return this.angle},e.prototype.setAngle=function(t){this.angle=t},e.prototype.worldDraw=function(t){var e=this,i=new THREE.Vector3(this.pt1.x,this.pt2.y),a=new THREE.Vector3(this.pt2.x,this.pt1.y);if(Math.abs(this.angle)>1e-5){var r=new THREE.Vector3(.5*(this.pt1.x-this.pt2.x)+this.pt2.x,.5*(this.pt1.y-this.pt2.y)+this.pt2.y),n=new THREE.Matrix4;n.makeRotationZ(this.angle);var s=(new THREE.Matrix4).makeTranslation(r.x,r.y,r.z).multiply(n).multiply((new THREE.Matrix4).makeTranslation(-r.x,-r.y,-r.z));t.setMatrix(s)}if(1==t.getType()){if(t.drawSelectLine(this.pt1,i),t.drawSelectLine(i,this.pt2),t.drawSelectLine(this.pt2,a),t.drawSelectLine(a,this.pt1),this.material){for(var o=Math.abs(this.pt1.x-this.pt2.x),h=Math.abs(this.pt1.y-this.pt2.y),p=new THREE.PlaneGeometry(o,h),l=Math.min(this.pt1.x,this.pt2.x),u=Math.min(this.pt1.y,this.pt2.y),y=0;y<p.vertices.length;y++)p.vertices[y].x+=l+.5*o,p.vertices[y].y+=u+.5*h,p.vertices[y].z=0;(d=new THREE.Mesh(p,this.material)).material.depthTest=!1,t.drawEntity(d)}else if(this.imagePath.length>0&&this.isLoadMaterialFromPath){var c=this,m=t.getMxObject();MxFun_1.default.loadImageMaterial(this.imagePath,function(t){e.isLoadMaterialFromPath=!1,t&&(c.setMaterial(t),c.setNeedUpdateDisplay(),m.updateDisplay())})}}else if(this.material){for(o=Math.abs(this.pt1.x-this.pt2.x),h=Math.abs(this.pt1.y-this.pt2.y),p=new THREE.PlaneGeometry(o,h),l=Math.min(this.pt1.x,this.pt2.x),u=Math.min(this.pt1.y,this.pt2.y),y=0;y<p.vertices.length;y++)p.vertices[y].x+=l+.5*o,p.vertices[y].y+=u+.5*h,p.vertices[y].z=0;var d;(d=new THREE.Mesh(p,this.material)).material.depthTest=!1,t.drawEntity(d)}else t.drawLine(this.pt1,i),t.drawLine(i,this.pt2),t.drawLine(this.pt2,a),t.drawLine(a,this.pt1);t.setMatrix(null)},e.prototype.setImagePath=function(t){this.imagePath=t,this.isLoadMaterialFromPath=!0,this.material=null},e.prototype.getImagePath=function(){return this.imagePath},e.prototype.setMaterial=function(t){this.material=t},e.prototype.loadMaterial=function(t){var e=this;t&&(this.imagePath=t),this.isLoadMaterialFromPath=!1,this.material=null;var i=this;MxFun_1.default.loadImageMaterial(this.imagePath,function(t){e.isLoadMaterialFromPath=!1,i.setMaterial(t)})},e.prototype.setPoint1=function(t){this.pt1=t},e.prototype.getPoint1=function(){return this.pt1},e.prototype.setPoint2=function(t){this.pt2=t},e.prototype.getPoint2=function(){return this.pt2},e.prototype.getGripPoints=function(){var t=[];t.push(this.pt1),t.push(this.pt2);var e=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y));return t.push(e),t},e.prototype.moveGripPointsAt=function(t,e){return 0==t?this.pt1.add(e):1==t?this.pt2.add(e):2==t&&(this.pt1.add(e),this.pt2.add(e)),!0},e.prototype.dwgIn=function(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),this.imagePath=t.imagePath.substr(0),this.isLoadMaterialFromPath=!0,t.angle&&(this.angle=t.angle),!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t.imagePath=this.imagePath,t.angle=this.angle,t},e.prototype.create=function(){return new e},e}(MxDbEntity_1.default);exports.default=MxDbImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,o){return new(r||(r=Promise))(function(n,i){function a(t){try{d(o.next(t))}catch(t){i(t)}}function u(t){try{d(o.throw(t))}catch(t){i(t)}}function d(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,u)}d((o=o.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(exports,"__esModule",{value:!0});var MxCADObject_1=require("../MxCADObject"),MxDbDatabase_1=require("../MxDbDatabase"),MxThreeJS_1=require("../MxThreeJS"),MxDrawObject=function(){function t(t){this._mxdrawObj=t}return t.prototype.getScene=function(){return this._mxdrawObj.getScene()},t.prototype.getCamera=function(){return this._mxdrawObj.getCamera()},t.prototype.getRenderer=function(){return this._mxdrawObj.renderer},t.prototype.setMouseRightRotate=function(t){return void 0===t&&(t=!0),this._mxdrawObj.setMouseRightRotate(t)},t.prototype.getFullDisplayRange=function(){return this._mxdrawObj.getFullDisplayRange()},t.prototype.getCanvas=function(){return this._mxdrawObj.getCanvas()},t.prototype.updateDisplay=function(){return this._mxdrawObj.updateDisplay()},t.prototype.createCanvasImageData=function(t,e){return this._mxdrawObj.createCanvasImageData(t,e)},t.prototype.setViewColor=function(t){return this._mxdrawObj.setViewColor(t)},t.prototype.setSize=function(t,e){return this._mxdrawObj.setSize(t,e)},t.prototype.getIntersectObjects=function(t){return this._mxdrawObj.getIntersectObjects(t)},t.prototype.addObject=function(t,e){return void 0===e&&(e=!0),this._mxdrawObj.addObject(t,e)},t.prototype.addViewObject=function(t){return this._mxdrawObj.addViewObject(t)},t.prototype.getViewWidth=function(){return this._mxdrawObj.getViewWidth()},t.prototype.getViewHeight=function(){return this._mxdrawObj.getViewHeight()},t.prototype.removeObject=function(t,e){return void 0===e&&(e=!0),this._mxdrawObj.removeObject(t,e)},t.prototype.zoomInitialStates=function(){return this._mxdrawObj.zoomInitialStates()},t.prototype.zoomScale=function(t){return this._mxdrawObj.zoomScale(t)},t.prototype.zoomW=function(t,e,r){return this._mxdrawObj.zoomW(t,e,r)},t.prototype.zoomCenter=function(t,e){return this._mxdrawObj.zoomCenter(t,e)},t.prototype.initZoomW=function(t,e){return this._mxdrawObj.initZoomW(t,e)},t.prototype.addEvent=function(t,e){return this._mxdrawObj.addEvent(t,e)},t.prototype.on=function(t,e){return this._mxdrawObj.addEvent(t,e)},t.prototype.setIniset=function(t){return this._mxdrawObj.setIniset(t)},t.prototype.screenCoord2World=function(t,e,r){return this._mxdrawObj.screenCoord2World(t,e,r)},t.prototype.worldCoord2Screen=function(t,e,r){return this._mxdrawObj.worldCoord2Screen(t,e,r)},t.prototype.screenCoord2Doc=function(t,e){return this._mxdrawObj.screenCoord2Doc(t,e,0)},t.prototype.worldCoordLong2Doc=function(t){return this._mxdrawObj.worldCoordLong2Doc(t)},t.prototype.docCoordLong2World=function(t){return this._mxdrawObj.docCoordLong2World(t)},t.prototype.docCoord2World=function(t,e,r){return this._mxdrawObj.docCoord2World(t,e,r)},t.prototype.docCoord2World2=function(t){return this._mxdrawObj.docCoord2World(t.x,t.y,t.z)},t.prototype.worldCoord2Doc=function(t,e,r){return this._mxdrawObj.worldCoord2Doc(t,e,r)},t.prototype.worldCoord2Doc2=function(t){return this._mxdrawObj.worldCoord2Doc(t.x,t.y,t.z)},t.prototype.docCoord2Screen=function(t,e){return this._mxdrawObj.docCoord2Screen(t,e,0)},t.prototype.screenCoordLong2Doc=function(t){return this._mxdrawObj.screenCoordLong2Doc(t)},t.prototype.docCoordLong2Screen=function(t){return this._mxdrawObj.docCoordLong2Screen(t)},t.prototype.screenCoordLong2World=function(t){return this._mxdrawObj.screenCoordLong2World(t)},t.prototype.worldCoordLong2Screen=function(t){return this._mxdrawObj.worldCoordLong2Screen(t)},t.prototype.initRendererParam=function(t){return this._mxdrawObj.initRendererParam(t)},t.prototype.addMxEntity=function(t){return this._mxdrawObj.addMxEntity(t)},t.prototype.getMxCurrentSelect=function(){var t=this._mxdrawObj.getMxAllSelect();return 0==t.length&&(t=this._mxdrawObj.getPrvCommandSelect()),t},t.prototype.addMxCurrentSelect=function(t){return this._mxdrawObj.addMxCurrentSelect(t)},t.prototype.clearMxCurrentSelect=function(){return this._mxdrawObj.clearMxCurrentSelect()},t.prototype.getMxEntity=function(t){return this._mxdrawObj.getMxEntityUserObject(t)},t.prototype.findMxEntityAtPoint=function(t){return this._mxdrawObj.findMxEntityAtPoint(t)},t.prototype.getAllMxEntity=function(){return this._mxdrawObj.getAllMxEntity()},t.prototype.setMouseMiddlePan=function(t){return this._mxdrawObj.setMouseMiddlePan(t)},t.prototype.resetThreeJSControls=function(){return this._mxdrawObj.resetThreeJSControls()},t.prototype.enableZoom=function(t){return this._mxdrawObj.enableZoom(t)},t.prototype.enablePan=function(t){return this._mxdrawObj.enablePan(t)},t.prototype.eraseMxEntity=function(t){return this._mxdrawObj.eraseMxEntity(t)},t.prototype.removeViewObject=function(t){this._mxdrawObj.removeViewObject(t)},t.prototype.saveMxEntityToJson=function(){return JSON.stringify(this._mxdrawObj.saveMxEntityToJson())},t.prototype.saveMxEntityToObject=function(){return this._mxdrawObj.saveMxEntityToJson()},t.prototype.loadMxEntityFromJson=function(t,e){return void 0===e&&(e=null),__awaiter(this,void 0,void 0,function(){var r,o;return __generator(this,function(n){switch(n.label){case 0:if(!e)return[3,4];r=e.length,o=0,n.label=1;case 1:return o<r?[4,MxThreeJS_1.default.loadSVG(e[o])]:[3,4];case 2:n.sent(),n.label=3;case 3:return o++,[3,1];case 4:return"string"==typeof t?[2,this._mxdrawObj.loadMxEntityFromJson(JSON.parse(t))]:[2,this._mxdrawObj.loadMxEntityFromJson(t)]}})})},t.prototype.eraseAllMxEntity=function(){return this._mxdrawObj.eraseAllMxEntity()},t.prototype.makeCurrent=function(){this._mxdrawObj.makeCurrent()},t.prototype.getViewCenterDocCoord=function(){return this._mxdrawObj.getViewCenterDocCoord()},t.prototype.updateCanvasSize=function(){this._mxdrawObj.updateCanvasSize()},t.prototype.newFile=function(t,e,r,o){return this._mxdrawObj.newFile(t,e,r,o)},t.prototype.stopAllLoading=function(){return this._mxdrawObj.stopAllLoading()},t.prototype.getOrbitControls=function(){return this._mxdrawObj.getOrbitControls()},t.prototype.getMxDatabase=function(){return new MxDbDatabase_1.default(this._mxdrawObj.getMxDatabase())},t.prototype.setZoomSpeed=function(t){return this._mxdrawObj.setZoomSpeed(t)},t.prototype.getMxCAD=function(){var t=this._mxdrawObj.getMxCAD();return new MxCADObject_1.default(t)},t.prototype.resetRenderer=function(){return this._mxdrawObj.resetRenderer()},t.prototype.setRequestHeader=function(t){return this._mxdrawObj.setRequestHeader(t)},t.prototype.closeWebSocket=function(){return this._mxdrawObj.closeWebSocket()},t.prototype.cadCoord2Doc=function(t,e,r){return this._mxdrawObj.cadCoord2Doc(t,e,r)},t.prototype.docCoord2Cad=function(t,e,r){return this._mxdrawObj.docCoord2Cad(t,e,r)},t}();exports.default=MxDrawObject;
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,o){return new(r||(r=Promise))(function(n,i){function a(t){try{d(o.next(t))}catch(t){i(t)}}function u(t){try{d(o.throw(t))}catch(t){i(t)}}function d(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,u)}d((o=o.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(exports,"__esModule",{value:!0});var MxCADObject_1=require("../MxCADObject"),MxDbDatabase_1=require("../MxDbDatabase"),MxThreeJS_1=require("../MxThreeJS"),MxDrawObject=function(){function t(t){this._mxdrawObj=t}return t.prototype.getScene=function(){return this._mxdrawObj.getScene()},t.prototype.getCamera=function(){return this._mxdrawObj.getCamera()},t.prototype.getRenderer=function(){return this._mxdrawObj.renderer},t.prototype.setMouseRightRotate=function(t){return void 0===t&&(t=!0),this._mxdrawObj.setMouseRightRotate(t)},t.prototype.getFullDisplayRange=function(){return this._mxdrawObj.getFullDisplayRange()},t.prototype.getCanvas=function(){return this._mxdrawObj.getCanvas()},t.prototype.updateDisplay=function(){return this._mxdrawObj.updateDisplay()},t.prototype.createCanvasImageData=function(t,e){return this._mxdrawObj.createCanvasImageData(t,e)},t.prototype.setViewColor=function(t){return this._mxdrawObj.setViewColor(t)},t.prototype.setSize=function(t,e){return this._mxdrawObj.setSize(t,e)},t.prototype.getIntersectObjects=function(t){return this._mxdrawObj.getIntersectObjects(t)},t.prototype.addObject=function(t,e){return void 0===e&&(e=!0),this._mxdrawObj.addObject(t,e)},t.prototype.addViewObject=function(t){return this._mxdrawObj.addViewObject(t)},t.prototype.getViewWidth=function(){return this._mxdrawObj.getViewWidth()},t.prototype.getViewHeight=function(){return this._mxdrawObj.getViewHeight()},t.prototype.removeObject=function(t,e){return void 0===e&&(e=!0),this._mxdrawObj.removeObject(t,e)},t.prototype.zoomInitialStates=function(){return this._mxdrawObj.zoomInitialStates()},t.prototype.zoomScale=function(t){return this._mxdrawObj.zoomScale(t)},t.prototype.zoomW=function(t,e,r){return this._mxdrawObj.zoomW(t,e,r)},t.prototype.zoomCenter=function(t,e){return this._mxdrawObj.zoomCenter(t,e)},t.prototype.initZoomW=function(t,e){return this._mxdrawObj.initZoomW(t,e)},t.prototype.addEvent=function(t,e){return this._mxdrawObj.addEvent(t,e)},t.prototype.on=function(t,e){return this._mxdrawObj.addEvent(t,e)},t.prototype.setIniset=function(t){return this._mxdrawObj.setIniset(t)},t.prototype.screenCoord2World=function(t,e,r){return this._mxdrawObj.screenCoord2World(t,e,r)},t.prototype.worldCoord2Screen=function(t,e,r){return this._mxdrawObj.worldCoord2Screen(t,e,r)},t.prototype.screenCoord2Doc=function(t,e){return this._mxdrawObj.screenCoord2Doc(t,e,0)},t.prototype.worldCoordLong2Doc=function(t){return this._mxdrawObj.worldCoordLong2Doc(t)},t.prototype.docCoordLong2World=function(t){return this._mxdrawObj.docCoordLong2World(t)},t.prototype.docCoord2World=function(t,e,r){return this._mxdrawObj.docCoord2World(t,e,r)},t.prototype.docCoord2World2=function(t){return this._mxdrawObj.docCoord2World(t.x,t.y,t.z)},t.prototype.worldCoord2Doc=function(t,e,r){return this._mxdrawObj.worldCoord2Doc(t,e,r)},t.prototype.worldCoord2Doc2=function(t){return this._mxdrawObj.worldCoord2Doc(t.x,t.y,t.z)},t.prototype.docCoord2Screen=function(t,e){return this._mxdrawObj.docCoord2Screen(t,e,0)},t.prototype.screenCoordLong2Doc=function(t){return this._mxdrawObj.screenCoordLong2Doc(t)},t.prototype.docCoordLong2Screen=function(t){return this._mxdrawObj.docCoordLong2Screen(t)},t.prototype.screenCoordLong2World=function(t){return this._mxdrawObj.screenCoordLong2World(t)},t.prototype.worldCoordLong2Screen=function(t){return this._mxdrawObj.worldCoordLong2Screen(t)},t.prototype.initRendererParam=function(t){return this._mxdrawObj.initRendererParam(t)},t.prototype.addMxEntity=function(t){return this._mxdrawObj.addMxEntity(t)},t.prototype.getMxCurrentSelect=function(){var t=this._mxdrawObj.getMxAllSelect();return 0==t.length&&(t=this._mxdrawObj.getPrvCommandSelect()),t},t.prototype.addMxCurrentSelect=function(t){return this._mxdrawObj.addMxCurrentSelect(t)},t.prototype.clearMxCurrentSelect=function(){return this._mxdrawObj.clearMxCurrentSelect()},t.prototype.getMxEntity=function(t){return this._mxdrawObj.getMxEntityUserObject(t)},t.prototype.findMxEntityAtPoint=function(t){return this._mxdrawObj.findMxEntityAtPoint(t)},t.prototype.getAllMxEntity=function(){return this._mxdrawObj.getAllMxEntity()},t.prototype.setMouseMiddlePan=function(t){return this._mxdrawObj.setMouseMiddlePan(t)},t.prototype.resetThreeJSControls=function(){return this._mxdrawObj.resetThreeJSControls()},t.prototype.enableZoom=function(t){return this._mxdrawObj.enableZoom(t)},t.prototype.enablePan=function(t){return this._mxdrawObj.enablePan(t)},t.prototype.eraseMxEntity=function(t){return this._mxdrawObj.eraseMxEntity(t)},t.prototype.removeViewObject=function(t){this._mxdrawObj.removeViewObject(t)},t.prototype.saveMxEntityToJson=function(){return JSON.stringify(this._mxdrawObj.saveMxEntityToJson())},t.prototype.saveMxEntityToObject=function(){return this._mxdrawObj.saveMxEntityToJson()},t.prototype.loadMxEntityFromJson=function(t,e){return void 0===e&&(e=null),__awaiter(this,void 0,void 0,function(){var r,o;return __generator(this,function(n){switch(n.label){case 0:if(!e)return[3,4];r=e.length,o=0,n.label=1;case 1:return o<r?[4,MxThreeJS_1.default.loadSVG(e[o])]:[3,4];case 2:n.sent(),n.label=3;case 3:return o++,[3,1];case 4:return"string"==typeof t?[2,this._mxdrawObj.loadMxEntityFromJson(JSON.parse(t))]:[2,this._mxdrawObj.loadMxEntityFromJson(t)]}})})},t.prototype.eraseAllMxEntity=function(){return this._mxdrawObj.eraseAllMxEntity()},t.prototype.makeCurrent=function(){this._mxdrawObj.makeCurrent()},t.prototype.getViewCenterDocCoord=function(){return this._mxdrawObj.getViewCenterDocCoord()},t.prototype.updateCanvasSize=function(){this._mxdrawObj.updateCanvasSize()},t.prototype.newFile=function(t,e,r,o){return this._mxdrawObj.newFile(t,e,r,o)},t.prototype.stopAllLoading=function(){return this._mxdrawObj.stopAllLoading()},t.prototype.getOrbitControls=function(){return this._mxdrawObj.getOrbitControls()},t.prototype.getMxDatabase=function(){return new MxDbDatabase_1.default(this._mxdrawObj.getMxDatabase())},t.prototype.setZoomSpeed=function(t){return this._mxdrawObj.setZoomSpeed(t)},t.prototype.getMxCAD=function(){var t=this._mxdrawObj.getMxCAD();return new MxCADObject_1.default(t)},t.prototype.resetRenderer=function(){return this._mxdrawObj.resetRenderer()},t.prototype.setRequestHeader=function(t){return this._mxdrawObj.setRequestHeader(t)},t.prototype.closeWebSocket=function(){return this._mxdrawObj.closeWebSocket()},t.prototype.cadCoord2Doc=function(t,e,r){return this._mxdrawObj.cadCoord2Doc(t,e,r)},t.prototype.docCoord2Cad=function(t,e,r){return this._mxdrawObj.docCoord2Cad(t,e,r)},t.prototype.setViewAngle=function(t){return this._mxdrawObj.setViewAngle(t)},t.prototype.getViewAngle=function(){return this._mxdrawObj.getViewAngle()},t}();exports.default=MxDrawObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var MxCloneType,MxDefaultRenderOrder,InputToucheType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.InputToucheType=exports.MxDefaultRenderOrder=void 0,function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone"}(MxCloneType||(MxCloneType={})),function(e){e[e.kCADMeshRenderOrder=10]="kCADMeshRenderOrder",e[e.kCADCurveRenderOrder=20]="kCADCurveRenderOrder",e[e.kMxEntityRenderOrder=30]="kMxEntityRenderOrder",e[e.kGripRenderOrder=110]="kGripRenderOrder",e[e.kDynJigRenderOrder=120]="kDynJigRenderOrder"}(MxDefaultRenderOrder=exports.MxDefaultRenderOrder||(exports.MxDefaultRenderOrder={})),function(e){e[e.kGetBegan=1]="kGetBegan",e[e.kGetEnd=2]="kGetEnd"}(InputToucheType=exports.InputToucheType||(exports.InputToucheType={})),exports.default={MxCloneType:MxCloneType,MxDefaultRenderOrder:MxDefaultRenderOrder,InputToucheType:InputToucheType};
|
|
1
|
+
"use strict";var MxCloneType,MxDefaultRenderOrder,InputToucheType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.InputToucheType=exports.MxDefaultRenderOrder=void 0,function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone",e[e.kMxFileClone=3]="kMxFileClone"}(MxCloneType||(MxCloneType={})),function(e){e[e.kCADMeshRenderOrder=10]="kCADMeshRenderOrder",e[e.kCADCurveRenderOrder=20]="kCADCurveRenderOrder",e[e.kMxEntityRenderOrder=30]="kMxEntityRenderOrder",e[e.kGripRenderOrder=110]="kGripRenderOrder",e[e.kDynJigRenderOrder=120]="kDynJigRenderOrder"}(MxDefaultRenderOrder=exports.MxDefaultRenderOrder||(exports.MxDefaultRenderOrder={})),function(e){e[e.kGetBegan=1]="kGetBegan",e[e.kGetEnd=2]="kGetEnd"}(InputToucheType=exports.InputToucheType||(exports.InputToucheType={})),exports.default={MxCloneType:MxCloneType,MxDefaultRenderOrder:MxDefaultRenderOrder,InputToucheType:InputToucheType};
|