mxdraw 0.1.48 → 0.1.49

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.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.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.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(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;
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.getTypeName=function(){return"MxDbHatch"},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;
@@ -1 +1 @@
1
- "use strict";var __extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDbLeadTag=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.point=new THREE.Vector3,t.leadLen=88,t.text="",t.textHeight=24,t}return __extends(t,e),t.prototype.createDots=function(e,t){var n=e.x,o=e.y,r=(e.z,new THREE.Shape);r.arc(n,o,t.screenCoordLong2Doc(6),0,2*Math.PI,!0);var i=new THREE.Path;i.arc(n,o,t.screenCoordLong2Doc(3),0,2*Math.PI,!0),r.holes.push(i);var a=new THREE.ShapeGeometry(r),s=new THREE.MeshPhongMaterial({color:"#ff0000",transparent:!0}),c=new THREE.Shape;c.arc(n,o,t.screenCoordLong2Doc(3),0,2*Math.PI,!0);var p=new THREE.ShapeGeometry(c),d=new THREE.MeshPhongMaterial({color:"#e2da8f",transparent:!0}),x=new THREE.Mesh(a,s),u=new THREE.Mesh(p,d);return x.add(u),x},t.prototype.worldDraw=function(e){var t=e.getMxObject(),n=this.createDots(this.point,t);if(e.drawEntity(n),n.geometry.computeBoundingBox(),e.drawSelectLine(n.geometry.boundingBox.max,n.geometry.boundingBox.min),2!==e.getType()){var o=e.getMxObject().screenCoordLong2Doc(this.leadLen),r=new THREE.Vector3(this.point.x+2*o,this.point.y+o,0),i=r.x-o,a=new THREE.Vector3(i,r.y,r.z);e.setLineWidth(4),e.setColor("#ffe605"),e.drawLines([this.point,a,r]);var s=e.getMxObject().screenCoordLong2Doc(this.textHeight),c=r.clone().setX(r.x);e.setColor(16744448);var p=MxThreeJS_1.default.creatTextSprite(this.text,c,s,0,e.getColor());if(p){var d=new THREE.Box3,x=new THREE.Vector3;d.expandByObject(p),d.getSize(x),p.position.setX(p.position.x+x.x/2);var u=e.getMxObject().screenCoordLong2Doc(5),E=d.min.clone().setX(d.min.x+x.x/2).setY(d.min.y-u),h=d.max.clone().setX(d.max.x+x.x/2).setY(d.min.y+u);h.setY(d.max.y+u);var w=new THREE.Vector3(E.x,h.y),y=new THREE.Vector3(h.x,E.y);e.setColor("#ffffff"),e.setLineWidth(0),e.drawLine(E,w),e.drawLine(h,y),e.drawLine(E,y),e.drawLine(w,h);var l=u/2,f=[],g=[];f.push(new THREE.Vector3(w.x+l,w.y-u,w.z),new THREE.Vector3(w.x+l,w.y-l,w.z),new THREE.Vector3(w.x+u,w.y-l,w.z)),g.push(new THREE.Vector3(y.x-l,y.y+u,y.z),new THREE.Vector3(y.x-l,y.y+l,y.z),new THREE.Vector3(y.x-u,y.y+l,y.z)),e.drawLines(f),e.drawLines(g),e.setOpacity(.5),e.setColor("#663244"),e.setRenderOrder(-100),e.drawSolid([E,w,h,y]),e.setRenderOrder(100),e.drawEntity(p)}}},t.prototype.getGripPoints=function(){return[this.point]},t.prototype.onViewChange=function(){return this.setNeedUpdateDisplay(),!0},t.prototype.moveGripPointsAt=function(e,t){return 0===e&&this.point.add(t),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.dwgInHelp(e,["point","text","textHeight","leadLen"]),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),this.dwgOutHelp(e,["point","text","textHeight","leadLen"]),e},t}(MxDbEntity_1.default);exports.default=MxDbLeadTag;
1
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,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=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDbLeadTag=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.point=new THREE.Vector3,t.leadLen=88,t.text="",t.textHeight=24,t}return __extends(t,e),t.prototype.getTypeName=function(){return"MxDbLeadTag"},t.prototype.createDots=function(e,t){var n=e.x,o=e.y,r=(e.z,new THREE.Shape);r.arc(n,o,t.screenCoordLong2Doc(6),0,2*Math.PI,!0);var i=new THREE.Path;i.arc(n,o,t.screenCoordLong2Doc(3),0,2*Math.PI,!0),r.holes.push(i);var a=new THREE.ShapeGeometry(r),s=new THREE.MeshPhongMaterial({color:"#ff0000",transparent:!0}),c=new THREE.Shape;c.arc(n,o,t.screenCoordLong2Doc(3),0,2*Math.PI,!0);var p=new THREE.ShapeGeometry(c),d=new THREE.MeshPhongMaterial({color:"#e2da8f",transparent:!0}),x=new THREE.Mesh(a,s),u=new THREE.Mesh(p,d);return x.add(u),x},t.prototype.worldDraw=function(e){var t=e.getMxObject(),n=this.createDots(this.point,t);if(e.drawEntity(n),n.geometry.computeBoundingBox(),e.drawSelectLine(n.geometry.boundingBox.max,n.geometry.boundingBox.min),2!==e.getType()){var o=e.getMxObject().screenCoordLong2Doc(this.leadLen),r=new THREE.Vector3(this.point.x+2*o,this.point.y+o,0),i=r.x-o,a=new THREE.Vector3(i,r.y,r.z);e.setLineWidth(4),e.setColor("#ffe605"),e.drawLines([this.point,a,r]);var s=e.getMxObject().screenCoordLong2Doc(this.textHeight),c=r.clone().setX(r.x);e.setColor(16744448);var p=MxThreeJS_1.default.creatTextSprite(this.text,c,s,0,e.getColor());if(p){var d=new THREE.Box3,x=new THREE.Vector3;d.expandByObject(p),d.getSize(x),p.position.setX(p.position.x+x.x/2);var u=e.getMxObject().screenCoordLong2Doc(5),E=d.min.clone().setX(d.min.x+x.x/2).setY(d.min.y-u),h=d.max.clone().setX(d.max.x+x.x/2).setY(d.min.y+u);h.setY(d.max.y+u);var y=new THREE.Vector3(E.x,h.y),w=new THREE.Vector3(h.x,E.y);e.setColor("#ffffff"),e.setLineWidth(0),e.drawLine(E,y),e.drawLine(h,w),e.drawLine(E,w),e.drawLine(y,h);var l=u/2,f=[],g=[];f.push(new THREE.Vector3(y.x+l,y.y-u,y.z),new THREE.Vector3(y.x+l,y.y-l,y.z),new THREE.Vector3(y.x+u,y.y-l,y.z)),g.push(new THREE.Vector3(w.x-l,w.y+u,w.z),new THREE.Vector3(w.x-l,w.y+l,w.z),new THREE.Vector3(w.x-u,w.y+l,w.z)),e.drawLines(f),e.drawLines(g),e.setOpacity(.5),e.setColor("#663244"),e.setRenderOrder(-100),e.drawSolid([E,y,h,w]),e.setRenderOrder(100),e.drawEntity(p)}}},t.prototype.getGripPoints=function(){return[this.point]},t.prototype.onViewChange=function(){return this.setNeedUpdateDisplay(),!0},t.prototype.moveGripPointsAt=function(e,t){return 0===e&&this.point.add(t),!0},t.prototype.dwgIn=function(e){return this.onDwgIn(e),this.dwgInHelp(e,["point","text","textHeight","leadLen"]),!0},t.prototype.dwgOut=function(e){return this.onDwgOut(e),this.dwgOutHelp(e,["point","text","textHeight","leadLen"]),e},t}(MxDbEntity_1.default);exports.default=MxDbLeadTag;