qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/createCoplanarPolygonOutlin...

2 lines
3.0 KiB
JavaScript

define(["./arrayRemoveDuplicates-cea3b206","./BoundingSphere-9a3b5656","./Cartesian3-e0307675","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./CoplanarPolygonGeometryLibrary-08d616f3","./defaultValue-81eec7ed","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./GeometryInstance-1b39c9e8","./GeometryPipeline-e7083fea","./IndexDatatype-3f3c99e8","./PolygonGeometryLibrary-231711c2","./Cartesian2-bd414876","./Math-e73894ab","./GeographicProjection-c931c7fb","./Matrix4-4c545f70","./RuntimeError-26acdd3b","./Rectangle-cf3e0e3e","./WebGLConstants-508b9636","./OrientedBoundingBox-c5d2adb7","./EllipsoidTangentPlane-4d138901","./AxisAlignedBoundingBox-8774439c","./IntersectionTests-80510c7b","./Plane-bc8b6777","./Transforms-5b829630","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda","./Matrix2-dc0c61cc","./AttributeCompression-8f752c03","./EncodedCartesian3-aafcc30f","./ArcType-fc72c06c","./EllipsoidRhumbLine-592e8885","./PolygonPipeline-04baeb41"],(function(e,t,n,o,r,i,a,c,y,l,s,u,p,d,m,b,g,f,h,P,G,L,C,T,E,k,A,H,w,x,B,I,_,v,D){"use strict";function O(e){const t=e.length,n=new Float64Array(3*t),o=u.IndexDatatype.createTypedArray(t,2*t);let i=0,a=0;for(let r=0;r<t;r++){const c=e[r];n[i++]=c.x,n[i++]=c.y,n[i++]=c.z,o[a++]=r,o[a++]=(r+1)%t}const l=new y.GeometryAttributes({position:new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n})});return new c.Geometry({attributes:l,indices:o,primitiveType:c.PrimitiveType.LINES})}function V(e){const t=(e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=p.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+1}V.fromPositions=function(e){return new V({polygonHierarchy:{positions:(e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT)).positions}})},V.pack=function(e,t,n){return n=a.defaultValue(n,0),t[n=p.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,n)]=e.packedLength,t};const R={polygonHierarchy:{}};return V.unpack=function(e,t,n){t=a.defaultValue(t,0);const o=p.PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=o.startingIndex,delete o.startingIndex;const r=e[t];return a.defined(n)||(n=new V(R)),n._polygonHierarchy=o,n.packedLength=r,n},V.createGeometry=function(o){const r=o._polygonHierarchy;let a=r.positions;if(a=e.arrayRemoveDuplicates(a,n.Cartesian3.equalsEpsilon,!0),a.length<3)return;if(!i.CoplanarPolygonGeometryLibrary.validOutline(a))return;const y=p.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!1);if(0===y.length)return;const u=[];for(let e=0;e<y.length;e++){const t=new l.GeometryInstance({geometry:O(y[e])});u.push(t)}const d=s.GeometryPipeline.combineInstances(u)[0],m=t.BoundingSphere.fromPoints(r.positions);return new c.Geometry({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:m})},function(e,t){return a.defined(t)&&(e=V.unpack(e,t)),e._ellipsoid=d.Ellipsoid.clone(e._ellipsoid),V.createGeometry(e)}}));