/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import s from"../../../Graphic.js";import i from"../../../core/Collection.js";import t from"../../../geometry/Point.js";import o from"../../../geometry/Polyline.js";import e from"../../../symbols/IconSymbol3DLayer.js";import r from"../../../symbols/LineSymbol3D.js";import h from"../../../symbols/LineSymbol3DLayer.js";import n from"../../../symbols/PointSymbol3D.js";import a from"../../../symbols/TextSymbol3DLayer.js";class c{constructor(s){this.destination=s}hide(){null!=this.graphic&&(this.destination.remove(this.graphic),this.graphic=null)}}class m extends c{constructor(s,t,o=""){super(s),this._symbol=new n({symbolLayers:new i([new e({material:{color:t},outline:{color:[255,255,255],size:1},resource:{primitive:"circle"}}),new a({text:o,halo:{color:"white",size:1/.75},material:{color:t},size:12})])})}show(i,o){if(!o)return;this.hide();const e=new t({x:i[0],y:i[1],z:i[2],spatialReference:o});this.graphic=new s({geometry:e,symbol:this._symbol}),this.destination.add(this.graphic)}}class l extends c{constructor(s,t){super(s),this._symbol=new r({symbolLayers:new i([new h({material:{color:t},size:2})])})}show(i,t){if(!t)return;this.hide();const e=new o({paths:i,spatialReference:t});this.graphic=new s({geometry:e,symbol:this._symbol}),this.destination.add(this.graphic)}}class p{constructor(s){this.destination=s,this._graphics=new Map}showPoint(s,i,t,o){const e=new m(this.destination,o,s);this._graphics.get(s)?.hide(),this._graphics.set(s,e),e.show(i,t)}showSegment(s,i,t,o,e){const r=[[[i[0],i[1],i[2]],[t[0],t[1],t[2]]]],h=new l(this.destination,e);this._graphics.get(s)?.hide(),this._graphics.set(s,h),h.show(r,o)}showVector(s,i,t,o,e){const r=[[[i[0],i[1],i[2]],[i[0]+t[0],i[1]+t[1],i[2]+t[2]]]],h=new l(this.destination,e);this._graphics.get(s)?.hide(),this._graphics.set(s,h),h.show(r,o)}hide(){this._graphics.forEach(s=>s.hide)}}export{p as DebugGraphics,m as DebugPoint,l as DebugSegment};
