/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import t from"../../../../geometry/Extent.js";import e from"../../../../geometry/Polygon.js";import{getContinuousIndexArray as i,getZeroIndexArray as o}from"../../../../geometry/support/Indices.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";function a(t){const e=t.attributeData.position.length/3,a=i(e),u=[["position",new n(t.attributeData.position,a,3,!0)]],{boundingRect:s,textureElementIndices:l,boundingRectIndices:c}=t.attributeData,p=null!=s,b=o(p?c?.length??1:e);return null!=t.attributeData.colorFeature?u.push(["colorFeatureAttribute",new n([t.attributeData.colorFeature],b,1,!0)]):t.attributeData.color&&u.push(["color",new n(t.attributeData.color,b,4,!0)]),t.attributeData.uvMapSpace&&u.push(["uvMapSpace",new n(t.attributeData.uvMapSpace,a,4,!0)]),p&&(u.push(["boundingRect",new n(s,c??[0],9,!0)]),null!=l&&u.push(["textureElementIndex",new n(l,a,1,!0)])),new r(t.material,u,t.mapPositions,0,t.attributeData.olidColor,void 0,void 0,t.indices)}function u(t,e=null){const o=t.attributeData.position.length/3,a=i(o),u=[["position",new n(t.attributeData.position,a,3,!0)],["uv0",new n(t.attributeData.uv0,a,2,!0)]];return new r(t.material,u,t.mapPositions,0,e,void 0,void 0,t.indices)}function s(i){switch(i.type){case"extent":if(i instanceof t)return e.fromExtent(i);break;case"polygon":return i}return null}class l{constructor(t,e,i){this.renderData=t,this.layerViewUid=e,this.graphicUid=i,this.outGeometries=new Array}}export{l as PolygonCreationDataBase,a as createColorGeometry,u as createWaterGeometry,s as geometryAsPolygon};
