@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.59 kB
JavaScript
import"../../../../geometry.js";import{isSome as t}from"../../../../core/maybe.js";import{Attribute as e}from"../../webgl-engine/lib/Attribute.js";import{ContentObjectType as i}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as n}from"../../webgl-engine/lib/VertexAttribute.js";import o from"../../../../geometry/Extent.js";import a from"../../../../geometry/Polygon.js";function s(o){const a=[[n.POSITION,o.indices]],s=[[n.POSITION,new e(o.attributeData.position,3,!0)]];return t(o.attributeData.color)&&(s.push([n.COLOR,new e(o.attributeData.color,4,!0)]),a.push([n.COLOR,new Array(o.indices.length).fill(0)])),t(o.attributeData.uvMapSpace)&&(s.push([n.UVMAPSPACE,new e(o.attributeData.uvMapSpace,4,!0)]),a.push([n.UVMAPSPACE,o.indices])),t(o.attributeData.boundingRect)&&(s.push([n.BOUNDINGRECT,new e(o.attributeData.boundingRect,9,!0)]),a.push([n.BOUNDINGRECT,o.indices])),new r(o.material,s,a,o.mapPositions,i.Mesh,o.attributeData.objectAndLayerIdColor)}function u(t){const i=[[n.POSITION,t.indices],[n.UV0,t.indices]],o=[[n.POSITION,new e(t.attributeData.position,3,!0)],[n.UV0,new e(t.attributeData.uv0,2,!0)]];return new r(t.material,o,i,t.mapPositions)}function c(t){switch(t.type){case"extent":if(t instanceof o)return a.fromExtent(t);break;case"polygon":return t}return null}class p{constructor(t,e,i){this.renderData=t,this.layerUid=e,this.graphicUid=i,this.outGeometries=new Array}}export{p as PolygonCreationDataBase,s as createColorGeometry,u as createWaterGeometry,c as geometryAsPolygon};