mxdraw 0.1.31 → 0.1.32

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.
@@ -1 +1 @@
1
- "use strict";var __extends=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),McGeTool_1=require("../McGeTool"),MxDbEntity_1=require("../MxDbEntity"),MxFun_1=require("../MxFun"),MxThreeJS_1=require("../MxThreeJS"),MxDbArea=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.points=[],e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbArea"},e.prototype.create=function(){return new e},e.prototype.getDimText=function(){return McGeTool_1.default.calcArea(this.points).toFixed(2)},e.prototype.worldDraw=function(t){if(this.points.length<3)2==this.points.length&&t.drawLine(this.points[0],this.points[1]);else{for(var e=this.points[0],n=e.clone(),o=e.clone(),r=this.points.length,i=1;i<r;i++){var s=this.points[i];n.x>s.x&&(n.x=s.x),n.y>s.y&&(n.y=s.y),o.x<s.x&&(o.x=s.x),o.y<s.y&&(o.y=s.y),t.drawLine(e,s),e=s}t.drawLine(e,this.points[0]);var p=new THREE.Vector3(n.x+.5*(o.x-n.x),n.y+.5*(o.y-n.y)),u=t.getColor(),c=MxFun_1.default.screenCoordLong2Doc(20),a=MxThreeJS_1.default.creatTextSprite(this.getDimText(),p,c,0,u);null!=a&&t.drawEntity(a)}},e.prototype.getGripPoints=function(){return this.points},e.prototype.moveGripPointsAt=function(t,e){return!(t>=this.points.length)&&(this.points[t].add(e),!0)},e.prototype.dwgIn=function(t){var e=this;this.onDwgIn(t);var n=t.points;return this.points=[],n.forEach(function(t){e.points.push(new THREE.Vector3(t.x,t.y,t.z))}),!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.points=this.points,t},e.prototype.addPoint=function(t){this.points.push(t.clone())},e.prototype.getPoints=function(){return this.points},e.prototype.clearPoint=function(){this.points=[]},e}(MxDbEntity_1.default);exports.default=MxDbArea;
1
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(e,o)};return function(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),McGeTool_1=require("../McGeTool"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxDbHatch_1=require("../MxDbHatch"),MxFun_1=require("../MxFun"),MxThreeJS_1=require("../MxThreeJS"),MxDbArea=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.points=[],e.isFill=!1,e.fillColor=6697540,e.fillOpacity=.7,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbArea"},e.prototype.create=function(){return new e},e.prototype.getDimText=function(){return McGeTool_1.default.calcArea(this.points).toFixed(2)},e.prototype.worldDraw=function(t){if(this.points.length<3)2==this.points.length&&t.drawLine(this.points[0],this.points[1]);else{for(var e=this.points[0],o=e.clone(),r=e.clone(),i=this.points.length,n=1;n<i;n++){var s=this.points[n];o.x>s.x&&(o.x=s.x),o.y>s.y&&(o.y=s.y),r.x<s.x&&(r.x=s.x),r.y<s.y&&(r.y=s.y),t.drawLine(e,s),e=s}t.drawLine(e,this.points[0]);var p=new THREE.Vector3(o.x+.5*(r.x-o.x),o.y+.5*(r.y-o.y)),l=t.getColor(),u=MxFun_1.default.screenCoordLong2Doc(20),c=MxThreeJS_1.default.creatTextSprite(this.getDimText(),p,u,0,l);if(null!=c&&t.drawEntity(c),t.getType()==McGiWorldDrawType_1.default.kWorldDraw&&this.isFill){t.setColor(this.fillColor),t.setOpacity(this.fillOpacity),t.setRenderOrder(t.getRenderOrder()-1);var a=new MxDbHatch_1.default;a.points=this.points,a.worldDraw(t)}}},e.prototype.getGripPoints=function(){return this.points},e.prototype.moveGripPointsAt=function(t,e){return!(t>=this.points.length)&&(this.points[t].add(e),!0)},e.prototype.dwgIn=function(t){var e=this;this.onDwgIn(t);var o=t.points;return this.points=[],o.forEach(function(t){e.points.push(new THREE.Vector3(t.x,t.y,t.z))}),this.dwgInHelp(t,["isFill","fillColor","fillOpacity"]),!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.points=this.points,this.dwgOutHelp(t,["isFill","fillColor","fillOpacity"]),t},e.prototype.addPoint=function(t){this.points.push(t.clone())},e.prototype.getPoints=function(){return this.points},e.prototype.clearPoint=function(){this.points=[]},e}(MxDbEntity_1.default);exports.default=MxDbArea;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var 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={}}return t.prototype.dwgInHelp=function(t,e){var r=function(t,e){for(var n=0;n++;n<t.length)t[n]instanceof Array?r(t[n],e[n]):"object"==typeof t[n]?o(t[n],e[n]):e[n]=t[n]},o=function(t,o){for(var n in e)t[n]&&(t[n].isVector3||t[n].isVector2||t[n].isVector4?o[n]=t[n].clone():t[n]instanceof Array?r(t[n],o[n]):o[n]=t[n])};return o(t,this),!0},t.prototype.dwgOutHelp=function(t,e){for(var r in e)"function"!=typeof this[r]&&"MxDbEntityImp"!==r&&(t[r]=this[r]);return t},t.prototype.getTypeName=function(){return this.constructor.name},t.prototype.create=function(){return this.constructor()},t.prototype.transformBy=function(t){},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.setColor=function(t){this.color=t},t.prototype.getColor=function(){return this.color},t.prototype.clone=function(t){var e=this.create(),r={type:t||MxType_1.default.MxCloneType.kClone};return this.dwgOut(r),e.dwgIn(r),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={}},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.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}();exports.default=MxDbEntity;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var 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}return t.prototype.dwgInHelp=function(t,e){var i=function(t){return"object"==typeof t?function(t){return!!(t.isVector3||t.isVector2||t.isVector4)}(t)?t.clone():n(t,Object.create(null)):t instanceof Array?r(t):t},r=function(t){return t.map(function(t){return i(t)})},n=function(t,e){for(var r in t)t[r]&&(e[r]=i(t[r]));return e},o=this;return e.forEach(function(e){t[e]&&(o[e]=i(t[e]))}),!0},t.prototype.dwgOutHelp=function(t,e){var i=this;return e.forEach(function(e){t[e]=i[e]}),t},t.prototype.getTypeName=function(){return this.constructor.name},t.prototype.create=function(){return new(0,this.constructor)},t.prototype.transformBy=function(t){},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.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},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},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.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.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=.03,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.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}();exports.default=MxDbEntity;
@@ -0,0 +1 @@
1
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(r,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])})(r,n)};return function(r,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=r}t(r,n),r.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),__spreadArray=this&&this.__spreadArray||function(t,r,n){if(n||2===arguments.length)for(var o,e=0,i=r.length;e<i;e++)!o&&e in r||(o||(o=Array.prototype.slice.call(r,0,e)),o[e]=r[e]);return t.concat(o||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:!0});var index_1=require("../../tools/three/index"),THREE=require("three"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxDbHatch=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.points=[],r}return __extends(r,t),r.prototype.worldDraw=function(t){t.getType()===McGiWorldDrawType_1.default.kWorldDraw?t.drawSolid(this.points):t.drawLines(__spreadArray(__spreadArray([],this.points,!0),[this.points[0]],!1))},r.prototype.moveGripPointsAt=function(t,r){return 0===t?this.points.forEach(function(t){t.add(r)}):this.points[t-1]&&this.points[t-1].add(r),!0},r.prototype.setPoints=function(t){this.points=t.map(function(t){return t.clone()})},r.prototype.getGripPoints=function(){if(this.points.length>0){var t=(0,index_1.computeBounding)(this.points).centerPoint;return __spreadArray([t],this.points,!0)}return[]},r.prototype.dwgIn=function(t){this.onDwgIn(t);var r=t.points;return this.points=r.map(function(t){var r=t.x,n=t.y,o=t.z;return new THREE.Vector3(r,n,o)}),!0},r.prototype.dwgOut=function(t){return this.onDwgOut(t),t.points=this.points,t},r}(MxDbEntity_1.default);exports.default=MxDbHatch;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbHatch_1=require("./MxDbHatch");exports.default=MxDbHatch_1.default;
@@ -1 +1 @@
1
- "use strict";var MxCloneType,MxCloneType2;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone"}(MxCloneType||(MxCloneType={})),function(e){e[e.kClone=1]="kClone",e[e.kDragClone=2]="kDragClone"}(MxCloneType2||(MxCloneType2={})),exports.default={MxCloneType:MxCloneType,MxCloneType2:MxCloneType2};
1
+ "use strict";var MxCloneType,MxDefaultRenderOrder;Object.defineProperty(exports,"__esModule",{value:!0}),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={})),exports.default={MxCloneType:MxCloneType,MxDefaultRenderOrder:MxDefaultRenderOrder};