yanchengPowerSupply/node_modules/mxdraw/dist/lib/MxModule/MxDbLineShape/index.js

1 line
836 B
JavaScript

import{addRegisterMxDbEntity}from"../../tools/registerMxDbEntity";import MxDbShape from"../MxDbShape";class MxDbLineShape extends MxDbShape{constructor(){super(),this.points=[],this._propertyDbKeys=[...this._propertyDbKeys,"points"]}setPoints(t){return this.points=t,this}addPoint(t){return this.points.push(t),this}removePoint(t){return this.points.splice(t,1),this}getTypeName(){return"MxDbLineShape"}worldDraw(t){this._draw(t,this.points),this._drawStoreLine(t,this.points)}getGripPoints(){return this.points}moveGripPointsAt(t,e){return this.points[t].add(e),!0}getGeomExtents(){return(new THREE.Box3).setFromPoints(this.points)}getGetLength(){let t=0;for(let e=0;e++;e<this.points.length)this.points[e+1]&&(t+=this.points[e].distanceTo(this.points[e+1]));return t}}addRegisterMxDbEntity(MxDbLineShape);export default MxDbLineShape;