1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
import{addRegisterMxDbEntity}from"../../tools/registerMxDbEntity";import MxDbArcShape from"../MxDbArcShape";import drawMxDbRingShape from"./draw";class MxDbRingShape extends MxDbArcShape{getTypeName(){return"MxDbRingShape"}worldDraw(t){const{center:e,startAngle:i,endAngle:r,clockwise:s}=this,{x:n,y:h}=e;this.isClosedToCenter=!1;const o=this.createEllipseCurve(n,h,this.innerRadius,this.innerRadius,i,r,s),a=this.createEllipseCurve(n,h,this.outerRadius,this.outerRadius,i,r,!s),d=this.createPaths([o,a]);let p=this.getShapePoints(d);const c=this.createPaths(o);let u=this.getShapePoints(c);const x=this.createPaths(a);let D=this.getShapePoints(x);this.isFill?(this._draw(t,p),this._drawStoreLine(t,u),this._drawStoreLine(t,D)):(this._draw(t,u),this._drawStoreLine(t,u),this._draw(t,D),this._drawStoreLine(t,D))}}MxDbRingShape.isRegister=!1,MxDbRingShape.cmd="Mx_MxDbRingShape",MxDbRingShape.draw=drawMxDbRingShape;export class MxDbRingShapeDraw extends MxDbRingShape{constructor(){super(),this.innerPoint=new THREE.Vector3,this.outerPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"innerPoint","outerPoint"]}getGripPoints(){return[this.center,this.innerPoint,this.outerPoint]}moveGripPointsAt(t,e){return 0===t&&(this.center.add(e),this.innerPoint.add(e),this.outerPoint.add(e)),1===t&&this.innerPoint.add(e),2===t&&this.outerPoint.add(e),!0}worldDraw(t){this.innerPoint&&(this.innerRadius=this.center.distanceTo(this.innerPoint)),this.outerPoint&&(this.outerRadius=this.center.distanceTo(this.outerPoint)),super.worldDraw(t)}};addRegisterMxDbEntity(MxDbRingShape);export default MxDbRingShape; |