mxdraw 0.1.87 → 0.1.89

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";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"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):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];var r,n=(r=i[e]).isVector3?3:r.isVector2?2:r.isVector4?4:0;n&&(t[e].datatype=n)}),t},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.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},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.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.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;
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"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):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];var r,n=(r=i[e]).isVector3?3:r.isVector2?2:r.isVector4?4:0;n&&(t[e].datatype=n)}),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},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.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.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;
@@ -1 +1 @@
1
- "use strict";var __extends=this&&this.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxDbLine=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.pt1=new THREE.Vector3,n.pt2=new THREE.Vector3,n}return __extends(n,t),n.prototype.getTypeName=function(){return"MxDbLine"},n.prototype.worldDraw=function(t){t.drawLine(this.pt1,this.pt2)},n.prototype.setPoint1=function(t){this.pt1=t},n.prototype.getPoint1=function(){return this.pt1},n.prototype.setPoint2=function(t){this.pt2=t},n.prototype.getPoint2=function(){return this.pt2},n.prototype.getGripPoints=function(){var t=[];t.push(this.pt1),t.push(this.pt2);var n=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y),0);return t.push(n),t},n.prototype.moveGripPointsAt=function(t,n){return 0==t?this.pt1.add(n):1==t?this.pt2.add(n):2==t&&(this.pt1.add(n),this.pt2.add(n)),!0},n.prototype.dwgIn=function(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),!0},n.prototype.dwgOut=function(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t},n.prototype.create=function(){return new n},n}(MxDbEntity_1.default);exports.default=MxDbLine;
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"),three_1=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxDbLine=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}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbLine"},e.prototype.worldDraw=function(t){t.drawLine(this.pt1,this.pt2)},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),0);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),!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t},e.prototype.create=function(){return new e},e.prototype.getGeomExtents=function(){return new three_1.Box3(this.pt1,this.pt2)},e}(MxDbEntity_1.default);exports.default=MxDbLine;
@@ -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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();Object.defineProperty(exports,"__esModule",{value:!0});var three_1=require("three"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDbText=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.position=new three_1.Vector3,e.text="",e.height=1,e.angle=0,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbText"},e.prototype.worldDraw=function(t){if(this.text.length>0&&(t.drawText(this.text,this.height,this.angle,this.position),t.getType()===McGiWorldDrawType_1.default.kSelectDraw)){var e=MxThreeJS_1.default.creatTextSprite(this.text,this.position,this.height,this.angle,16777215);if(e){var r=new three_1.Box3;r.expandByObject(e);var i=r.min,n=r.max,o={x:i.x,y:n.y},s={x:n.x,y:i.y};t.drawLine(i.x,i.y,o.x,o.y),t.drawLine(o.x,o.y,n.x,n.y),t.drawLine(n.x,n.y,s.x,s.y),t.drawLine(s.x,s.y,i.x,i.y)}}},e.prototype.getGripPoints=function(){return[this.position]},e.prototype.moveGripPointsAt=function(t,e){return 0===t&&this.position.add(e),!0},e.prototype.create=function(){return new e},e.prototype.dwgIn=function(t){return this.onDwgIn(t),this.position.copy(t.position),this.text=t.text.substr(0),this.height=t.height,this.angle=t.angle,!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.position=this.position,t.text=this.text,t.height=this.height,t.angle=this.angle,t},e}(MxDbEntity_1.default);exports.default=MxDbText;
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 r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var formatting_1=require("../../tools/formatting"),three_1=require("three"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDbText=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.position=new three_1.Vector3,e.text="",e.height=1,e.angle=0,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbText"},e.prototype.worldDraw=function(t){if(this.text.length>0&&(t.drawText(this.text,this.height,this.angle,this.position),t.getType()===McGiWorldDrawType_1.default.kSelectDraw)){var e=MxThreeJS_1.default.creatTextSprite(this.text,this.position,this.height,this.angle,16777215);if(e){var i=new three_1.Box3;i.expandByObject(e);var r=i.min,n=i.max,o={x:r.x,y:n.y},s={x:n.x,y:r.y};t.drawLine(r.x,r.y,o.x,o.y),t.drawLine(o.x,o.y,n.x,n.y),t.drawLine(n.x,n.y,s.x,s.y),t.drawLine(s.x,s.y,r.x,r.y)}}},e.prototype.getGripPoints=function(){return[this.position]},e.prototype.moveGripPointsAt=function(t,e){return 0===t&&this.position.add(e),!0},e.prototype.create=function(){return new e},e.prototype.dwgIn=function(t){return this.onDwgIn(t),this.position.copy(t.position),this.text=t.text.substr(0),this.height=t.height,this.angle=t.angle,!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.position=this.position,t.text=this.text,t.height=this.height,t.angle=this.angle,t},e.prototype.getGeomExtents=function(){var t=document.createElement("canvas").getContext("2d");if(null==t)return null;var e=(0,formatting_1.formatString)("normal {0}px Arial","256");t.font=e;var i=t.measureText(this.text).width/256,r=this.position.x-i*this.height*.5,n=this.position.y-.5*this.height,o=this.position.x+i*this.height*.5,s=this.position.y+.5*this.height;return new three_1.Box3(new three_1.Vector3(r,n,this.position.z),new three_1.Vector3(o,s,this.position.z))},e}(MxDbEntity_1.default);exports.default=MxDbText;