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

2 lines
5.3 KiB
JavaScript
Raw Normal View History

2023-11-07 10:04:37 +08:00
define(["./defaultValue-81eec7ed","./Cartesian2-bd414876","./arrayRemoveDuplicates-cea3b206","./BoundingRectangle-0e36efc3","./BoundingSphere-9a3b5656","./Cartesian3-e0307675","./ComponentDatatype-aaeec80f","./PolylineVolumeGeometryLibrary-c618b783","./Check-741c5f3c","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./GeometryPipeline-e7083fea","./IndexDatatype-3f3c99e8","./Math-e73894ab","./PolygonPipeline-04baeb41","./VertexFormat-d50a69ba","./GeographicProjection-c931c7fb","./Rectangle-cf3e0e3e","./Matrix4-4c545f70","./RuntimeError-26acdd3b","./WebGLConstants-508b9636","./EllipsoidTangentPlane-4d138901","./AxisAlignedBoundingBox-8774439c","./IntersectionTests-80510c7b","./Plane-bc8b6777","./Transforms-5b829630","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda","./PolylinePipeline-0e56eeb9","./EllipsoidGeodesic-e7a5ca44","./EllipsoidRhumbLine-592e8885","./Matrix2-dc0c61cc","./AttributeCompression-8f752c03","./EncodedCartesian3-aafcc30f"],(function(e,t,n,o,i,a,r,l,s,c,p,u,d,m,y,g,h,f,b,P,E,_,k,C,v,V,x,L,F,A,G,T,D,R,w){"use strict";function B(n){const o=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,i=n.shapePositions;this._positions=o,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,l.CornerType.ROUNDED),this._vertexFormat=g.VertexFormat.clone(e.defaultValue(n.vertexFormat,g.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,m.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let r=1+o.length*a.Cartesian3.packedLength;r+=1+i.length*t.Cartesian2.packedLength,this.packedLength=r+t.Ellipsoid.packedLength+g.VertexFormat.packedLength+2}B.pack=function(n,o,i){let r;i=e.defaultValue(i,0);const l=n._positions;let s=l.length;for(o[i++]=s,r=0;r<s;++r,i+=a.Cartesian3.packedLength)a.Cartesian3.pack(l[r],o,i);const c=n._shape;for(s=c.length,o[i++]=s,r=0;r<s;++r,i+=t.Cartesian2.packedLength)t.Cartesian2.pack(c[r],o,i);return t.Ellipsoid.pack(n._ellipsoid,o,i),i+=t.Ellipsoid.packedLength,g.VertexFormat.pack(n._vertexFormat,o,i),i+=g.VertexFormat.packedLength,o[i++]=n._cornerType,o[i]=n._granularity,o};const S=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),I=new g.VertexFormat,O={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,vertexFormat:I,cornerType:void 0,granularity:void 0};B.unpack=function(n,o,i){let r;o=e.defaultValue(o,0);let l=n[o++];const s=new Array(l);for(r=0;r<l;++r,o+=a.Cartesian3.packedLength)s[r]=a.Cartesian3.unpack(n,o);l=n[o++];const c=new Array(l);for(r=0;r<l;++r,o+=t.Cartesian2.packedLength)c[r]=t.Cartesian2.unpack(n,o);const p=t.Ellipsoid.unpack(n,o,S);o+=t.Ellipsoid.packedLength;const u=g.VertexFormat.unpack(n,o,I);o+=g.VertexFormat.packedLength;const d=n[o++],m=n[o];return e.defined(i)?(i._positions=s,i._shape=c,i._ellipsoid=t.Ellipsoid.clone(p,i._ellipsoid),i._vertexFormat=g.VertexFormat.clone(u,i._vertexFormat),i._cornerType=d,i._granularity=m,i):(O.polylinePositions=s,O.shapePositions=c,O.cornerType=d,O.granularity=m,new B(O))};const N=new o.BoundingRectangle;return B.createGeometry=function(e){const t=e._positions,s=n.arrayRemoveDuplicates(t,a.Cartesian3.equalsEpsilon);let m=e._shape;if(m=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(m),s.length<2||m.length<3)return;y.PolygonPipeline.computeWindingOrder2D(m)===y.WindingOrder.CLOCKWISE&&m.reverse();const g=o.BoundingRectangle.fromPoints(m,N);return function(e,t,n,o){const a=new p.GeometryAttributes;o.position&&(a.position=new c.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}));const s=t.length,m=e.length/3,g=(m-2*s)/(2*s),h=y.PolygonPipeline.triangulate(t),f=(g-1)*s*6+2*h.length,b=d.IndexDatatype.createTypedArray(m,f);let P,E,_,k,C,v;const V=2*s;let x=0;for(P=0;P<g-1;P++){for(E=0;E<s-1;E++)_=2*E+P*s*2,v=_+V,k=_+1,C=k+V,b[x++]=k,b[x++]=_,b[x++]=C,b[x++]=C,b[x++]=_,b[x++]=v;_=2*s-2+P*s*2,k=_+1,C=k+V,v=_+V,b[x++]=k,b[x++]=_,b[x++]=C,b[x++]=C,b[x++]=_,b[x++]=v}if(o.st||o.tangent||o.bitangent){const e=new Float3