import{computeRegularPolygonVertices}from"../../tools/three/index";import MxDbShape from"../MxDbShape";import{addRegisterMxDbEntity}from"../../tools/registerMxDbEntity";import drawMxDbRegularPolygon from"./draw";class MxDbRegularPolygon extends MxDbShape{constructor(){super(),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5,this._propertyDbKeys=[...this._propertyDbKeys,"centerPoint","otherPoint","sidesNumber"]}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=computeRegularPolygonVertices(this.centerPoint,this.otherPoint,this.sidesNumber);this.closed=!1,e.push(e[0]),this._draw(t,e),this._drawStoreLine(t,e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}}MxDbRegularPolygon.cmd="Mx_RegularPolygon",MxDbRegularPolygon.draw=drawMxDbRegularPolygon,addRegisterMxDbEntity(MxDbRegularPolygon);export default MxDbRegularPolygon;