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