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) 4.64 kB
(function(e,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@mlightcad/geometry-engine")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/geometry-engine"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e["graphic-interface"]={},e.geometryEngine))})(this,function(e,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.ByBlock=-2]="ByBlock",t[t.ByDIPs=-4]="ByDIPs",t[t.ByLayer=-1]="ByLayer",t[t.ByLineWeightDefault=-3]="ByLineWeightDefault",t[t.LineWeight000=0]="LineWeight000",t[t.LineWeight005=5]="LineWeight005",t[t.LineWeight009=9]="LineWeight009",t[t.LineWeight013=13]="LineWeight013",t[t.LineWeight015=15]="LineWeight015",t[t.LineWeight018=18]="LineWeight018",t[t.LineWeight020=20]="LineWeight020",t[t.LineWeight025=25]="LineWeight025",t[t.LineWeight030=30]="LineWeight030",t[t.LineWeight035=35]="LineWeight035",t[t.LineWeight040=40]="LineWeight040",t[t.LineWeight050=50]="LineWeight050",t[t.LineWeight053=53]="LineWeight053",t[t.LineWeight060=60]="LineWeight060",t[t.LineWeight070=70]="LineWeight070",t[t.LineWeight080=80]="LineWeight080",t[t.LineWeight090=90]="LineWeight090",t[t.LineWeight100=100]="LineWeight100",t[t.LineWeight106=106]="LineWeight106",t[t.LineWeight120=120]="LineWeight120",t[t.LineWeight140=140]="LineWeight140",t[t.LineWeight158=158]="LineWeight158",t[t.LineWeight200=200]="LineWeight200",t[t.LineWeight211=211]="LineWeight211",t))(O||{}),u=(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))(u||{}),n=(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))(n||{}),d=(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))(d||{}),E=(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))(E||{}),B=(t=>(t[t.ONE_DISTANT_LIGHT=0]="ONE_DISTANT_LIGHT",t[t.TWO_DISTANT_LIGHTS=1]="TWO_DISTANT_LIGHTS",t))(B||{});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(_){this._number=_}get id(){return this._id}set id(_){this._id=_}get groupId(){return this._groupId}set groupId(_){this._groupId=_}get centerPoint(){return this._centerPoint}set centerPoint(_){this._centerPoint.copy(_)}get height(){return this._height}set height(_){this._height=_}get width(){return this._width}set width(_){this._width=_}get box(){const _=new s.AcGeBox2d;return _.setFromCenterAndSize(this.centerPoint,{x:this.width,y:this.height}),_}get viewCenter(){return this._viewCenter}set viewCenter(_){this._viewCenter.copy(_)}get viewHeight(){return this._viewHeight}set viewHeight(_){this._viewHeight=_}get viewWidth(){return this.viewHeight*(this.width/this.height)}get viewBox(){const _=new s.AcGeBox2d;return _.setFromCenterAndSize(this.viewCenter,{x:this.viewWidth,y:this.viewHeight}),_}clone(){const _=new h;return _.id=this.id,_.groupId=this.groupId,_.number=this.number,_.centerPoint.copy(this.centerPoint),_.height=this.height,_.width=this.width,_.viewCenter.copy(this.viewCenter),_.viewHeight=this.viewHeight,_}copy(_){return this.id=_.id,this.groupId=_.groupId,this.number=_.number,this.centerPoint.copy(_.centerPoint),this.height=_.height,this.width=_.width,this.viewCenter.copy(_.viewCenter),this.viewHeight=_.viewHeight,this}}e.AcGiArrowType=I,e.AcGiDefaultLightingType=B,e.AcGiLineWeight=O,e.AcGiMTextAttachmentPoint=n,e.AcGiMTextFlowDirection=u,e.AcGiOrthographicType=E,e.AcGiRenderMode=d,e.AcGiViewport=h,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});