qa-prevention-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/createWallGeometry.js

2 lines
6.1 KiB
JavaScript
Raw Permalink Normal View History

2023-12-17 15:30:40 +08:00
define(["./defaultValue-81eec7ed","./Cartesian2-bd414876","./BoundingSphere-9a3b5656","./Cartesian3-e0307675","./ComponentDatatype-aaeec80f","./Check-741c5f3c","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./IndexDatatype-3f3c99e8","./Math-e73894ab","./VertexFormat-d50a69ba","./WallGeometryLibrary-2f7aa617","./GeographicProjection-c931c7fb","./Matrix4-4c545f70","./RuntimeError-26acdd3b","./Rectangle-cf3e0e3e","./WebGLConstants-508b9636","./Matrix2-dc0c61cc","./Transforms-5b829630","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda","./arrayRemoveDuplicates-cea3b206","./PolylinePipeline-0e56eeb9","./EllipsoidGeodesic-e7a5ca44","./EllipsoidRhumbLine-592e8885","./IntersectionTests-80510c7b","./Plane-bc8b6777"],(function(e,t,n,i,a,o,r,s,l,m,c,u,p,d,y,f,g,h,b,C,x,A,_,E,w,F,v,L){"use strict";const k=new i.Cartesian3,V=new i.Cartesian3,G=new i.Cartesian3,H=new i.Cartesian3,P=new i.Cartesian3,D=new i.Cartesian3,T=new i.Cartesian3;function z(n){const a=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,o=n.maximumHeights,r=n.minimumHeights,s=e.defaultValue(n.vertexFormat,c.VertexFormat.DEFAULT),l=e.defaultValue(n.granularity,m.CesiumMath.RADIANS_PER_DEGREE),u=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84);this._positions=a,this._minimumHeights=r,this._maximumHeights=o,this._vertexFormat=c.VertexFormat.clone(s),this._granularity=l,this._ellipsoid=t.Ellipsoid.clone(u),this._workerName="createWallGeometry";let p=1+a.length*i.Cartesian3.packedLength+2;e.defined(r)&&(p+=r.length),e.defined(o)&&(p+=o.length),this.packedLength=p+t.Ellipsoid.packedLength+c.VertexFormat.packedLength+1}z.pack=function(n,a,o){let r;o=e.defaultValue(o,0);const s=n._positions;let l=s.length;for(a[o++]=l,r=0;r<l;++r,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[r],a,o);const m=n._minimumHeights;if(l=e.defined(m)?m.length:0,a[o++]=l,e.defined(m))for(r=0;r<l;++r)a[o++]=m[r];const u=n._maximumHeights;if(l=e.defined(u)?u.length:0,a[o++]=l,e.defined(u))for(r=0;r<l;++r)a[o++]=u[r];return t.Ellipsoid.pack(n._ellipsoid,a,o),o+=t.Ellipsoid.packedLength,c.VertexFormat.pack(n._vertexFormat,a,o),a[o+=c.VertexFormat.packedLength]=n._granularity,a};const R=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),O=new c.VertexFormat,S={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:R,vertexFormat:O,granularity:void 0};return z.unpack=function(n,a,o){let r;a=e.defaultValue(a,0);let s=n[a++];const l=new Array(s);for(r=0;r<s;++r,a+=i.Cartesian3.packedLength)l[r]=i.Cartesian3.unpack(n,a);let m,u;if(s=n[a++],s>0)for(m=new Array(s),r=0;r<s;++r)m[r]=n[a++];if(s=n[a++],s>0)for(u=new Array(s),r=0;r<s;++r)u[r]=n[a++];const p=t.Ellipsoid.unpack(n,a,R);a+=t.Ellipsoid.packedLength;const d=c.VertexFormat.unpack(n,a,O),y=n[a+=c.VertexFormat.packedLength];return e.defined(o)?(o._positions=l,o._minimumHeights=m,o._maximumHeights=u,o._ellipsoid=t.Ellipsoid.clone(p,o._ellipsoid),o._vertexFormat=c.VertexFormat.clone(d,o._vertexFormat),o._granularity=y,o):(S.positions=l,S.minimumHeights=m,S.maximumHeights=u,S.granularity=y,new z(S))},z.fromConstantHeights=function(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions;let i,a;const o=t.minimumHeight,r=t.maximumHeight,s=e.defined(o),l=e.defined(r);if(s||l){const e=n.length;i=s?new Array(e):void 0,a=l?new Array(e):void 0;for(let t=0;t<e;++t)s&&(i[t]=o),l&&(a[t]=r)}return new z({positions:n,maximumHeights:a,minimumHeights:i,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat})},z.createGeometry=function(t){const o=t._positions,c=t._minimumHeights,p=t._maximumHeights,d=t._vertexFormat,y=t._granularity,f=t._ellipsoid,g=u.WallGeometryLibrary.computePositions(f,o,p,c,y,!0);if(!e.defined(g))return;const h=g.bottomPositions,b=g.topPositions,C=g.numCorners;let x=b.length,A=2*x;const _=d.position?new Float64Array(A):void 0,E=d.normal?new Float32Array(A):void 0,w=d.tangent?new Float32Array(A):void 0,F=d.bitangent?new Float32Array(A):void 0,v=d.st?new Float32Array(A/3*2):void 0;let L,z=0,R=0,O=0,S=0,I=0,M=T,N=D,B=P,W=!0;x/=3;let U=0;const q=1/(x-C-1);for(L=0;L<x;++L){const e=3*L,t=i.Cartesian3.f