UNPKG

@mlightcad/graphic-interface

Version:

The graphic-interface package provides the graphics interface for controlling how AutoCAD entities are displayed on screen. This package offers a simplified API compared to AutoCAD ObjectARX's AcGi classes, making it more developer-friendly while maintain

2 lines (1 loc) 3.57 kB
(function(_,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@mlightcad/geometry-engine")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/geometry-engine"],s):(_=typeof globalThis<"u"?globalThis:_||self,s(_["graphic-interface"]={},_.geometryEngine))})(this,function(_,s){"use strict";var I=(t=>(t.ClosedFilled="",t.Dot="_DOT",t.DotSmall="_DOTSMALL",t.DotBlank="_DOTBLANK",t.Origin="_ORIGIN",t.Origin2="_ORIGIN2",t.Open="_OPEN",t.Open90="_OPEN90",t.Open30="_OPEN30",t.Closed="_CLOSED",t.Small="_SMALL",t.None="_NONE",t.Oblique="_OBLIQUE",t.BoxFilled="_BOXFILLED",t.Box="_BOXBLANK",t.ClosedBlank="_CLOSEDBLANK",t.DatumBlank="_DATUMBLANK",t.DatumFilled="_DATUMFILLED",t.Integral="_INTEGRAL",t.ArchTick="_ARCHTICK",t))(I||{}),O=(t=>(t[t.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=3]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=4]="BOTTOM_TO_TOP",t[t.BY_STYLE=5]="BY_STYLE",t))(O||{}),i=(t=>(t[t.TopLeft=1]="TopLeft",t[t.TopCenter=2]="TopCenter",t[t.TopRight=3]="TopRight",t[t.MiddleLeft=4]="MiddleLeft",t[t.MiddleCenter=5]="MiddleCenter",t[t.MiddleRight=6]="MiddleRight",t[t.BottomLeft=7]="BottomLeft",t[t.BottomCenter=8]="BottomCenter",t[t.BottomRight=9]="BottomRight",t))(i||{}),n=(t=>(t[t.OPTIMIZED_2D=0]="OPTIMIZED_2D",t[t.WIREFRAME=1]="WIREFRAME",t[t.HIDDEN_LINE=2]="HIDDEN_LINE",t[t.FLAT_SHADED=3]="FLAT_SHADED",t[t.GOURAUD_SHADED=4]="GOURAUD_SHADED",t[t.FLAT_SHADED_WITH_WIREFRAME=5]="FLAT_SHADED_WITH_WIREFRAME",t[t.GOURAUD_SHADED_WITH_WIREFRAME=6]="GOURAUD_SHADED_WITH_WIREFRAME",t))(n||{}),u=(t=>(t[t.NON_ORTHOGRAPHIC=0]="NON_ORTHOGRAPHIC",t[t.TOP=1]="TOP",t[t.BOTTOM=2]="BOTTOM",t[t.FRONT=3]="FRONT",t[t.BACK=4]="BACK",t[t.LEFT=5]="LEFT",t[t.RIGHT=6]="RIGHT",t))(u||{}),d=(t=>(t[t.ONE_DISTANT_LIGHT=0]="ONE_DISTANT_LIGHT",t[t.TWO_DISTANT_LIGHTS=1]="TWO_DISTANT_LIGHTS",t))(d||{});class h{constructor(){this._number=-1,this._id="",this._groupId="",this._centerPoint=new s.AcGePoint3d,this._height=0,this._width=0,this._viewCenter=new s.AcGePoint3d,this._viewHeight=0}get number(){return this._number}set number(e){this._number=e}get id(){return this._id}set id(e){this._id=e}get groupId(){return this._groupId}set groupId(e){this._groupId=e}get centerPoint(){return this._centerPoint}set centerPoint(e){this._centerPoint.copy(e)}get height(){return this._height}set height(e){this._height=e}get width(){return this._width}set width(e){this._width=e}get box(){const e=new s.AcGeBox2d;return e.setFromCenterAndSize(this.centerPoint,{x:this.width,y:this.height}),e}get viewCenter(){return this._viewCenter}set viewCenter(e){this._viewCenter.copy(e)}get viewHeight(){return this._viewHeight}set viewHeight(e){this._viewHeight=e}get viewWidth(){return this.viewHeight*(this.width/this.height)}get viewBox(){const e=new s.AcGeBox2d;return e.setFromCenterAndSize(this.viewCenter,{x:this.viewWidth,y:this.viewHeight}),e}clone(){const e=new h;return e.id=this.id,e.groupId=this.groupId,e.number=this.number,e.centerPoint.copy(this.centerPoint),e.height=this.height,e.width=this.width,e.viewCenter.copy(this.viewCenter),e.viewHeight=this.viewHeight,e}copy(e){return this.id=e.id,this.groupId=e.groupId,this.number=e.number,this.centerPoint.copy(e.centerPoint),this.height=e.height,this.width=e.width,this.viewCenter.copy(e.viewCenter),this.viewHeight=e.viewHeight,this}}_.AcGiArrowType=I,_.AcGiDefaultLightingType=d,_.AcGiMTextAttachmentPoint=i,_.AcGiMTextFlowDirection=O,_.AcGiOrthographicType=u,_.AcGiRenderMode=n,_.AcGiViewport=h,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});