月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-07-07 3c23ce2d0214a1246664e61fd51466033e25481e
public/CIMSDK/Workers/createWallOutlineGeometry.js
@@ -1 +1 @@
define(["./defaultValue-abec0268","./Matrix3-2b60b40d","./Transforms-98e4fe15","./ComponentDatatype-565a8190","./GeometryAttribute-2634d326","./GeometryAttributes-50483cde","./IndexDatatype-5f9fa3ed","./Math-a56d1479","./WallGeometryLibrary-ad14c89c","./Matrix2-9599853a","./RuntimeError-279c39be","./combine-7a07cedd","./WebGLConstants-292d99ef","./arrayRemoveDuplicates-a4e37a99","./PolylinePipeline-7675bf7d","./EllipsoidGeodesic-53f26b06","./EllipsoidRhumbLine-a3c0be77","./IntersectionTests-51d114e6","./Plane-1c708c34"],(function(e,i,t,n,o,a,s,r,l,d,m,u,c,p,f,h,g,y,_){"use strict";const E=new i.Cartesian3,b=new i.Cartesian3;function C(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,o=t.maximumHeights,a=t.minimumHeights,s=e.defaultValue(t.granularity,r.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=n,this._minimumHeights=a,this._maximumHeights=o,this._granularity=s,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let d=1+n.length*i.Cartesian3.packedLength+2;e.defined(a)&&(d+=a.length),e.defined(o)&&(d+=o.length),this.packedLength=d+i.Ellipsoid.packedLength+1}C.pack=function(t,n,o){let a;o=e.defaultValue(o,0);const s=t._positions;let r=s.length;for(n[o++]=r,a=0;a<r;++a,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[a],n,o);const l=t._minimumHeights;if(r=e.defined(l)?l.length:0,n[o++]=r,e.defined(l))for(a=0;a<r;++a)n[o++]=l[a];const d=t._maximumHeights;if(r=e.defined(d)?d.length:0,n[o++]=r,e.defined(d))for(a=0;a<r;++a)n[o++]=d[a];return i.Ellipsoid.pack(t._ellipsoid,n,o),n[o+=i.Ellipsoid.packedLength]=t._granularity,n};const H=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),A={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:H,granularity:void 0};return C.unpack=function(t,n,o){let a;n=e.defaultValue(n,0);let s=t[n++];const r=new Array(s);for(a=0;a<s;++a,n+=i.Cartesian3.packedLength)r[a]=i.Cartesian3.unpack(t,n);let l,d;if(s=t[n++],s>0)for(l=new Array(s),a=0;a<s;++a)l[a]=t[n++];if(s=t[n++],s>0)for(d=new Array(s),a=0;a<s;++a)d[a]=t[n++];const m=i.Ellipsoid.unpack(t,n,H),u=t[n+=i.Ellipsoid.packedLength];return e.defined(o)?(o._positions=r,o._minimumHeights=l,o._maximumHeights=d,o._ellipsoid=i.Ellipsoid.clone(m,o._ellipsoid),o._granularity=u,o):(A.positions=r,A.minimumHeights=l,A.maximumHeights=d,A.granularity=u,new C(A))},C.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,o;const a=i.minimumHeight,s=i.maximumHeight,r=e.defined(a),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,o=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=a),l&&(o[i]=s)}return new C({positions:t,maximumHeights:o,minimumHeights:n,ellipsoid:i.ellipsoid})},C.createGeometry=function(d){const m=d._positions,u=d._minimumHeights,c=d._maximumHeights,p=d._granularity,f=d._ellipsoid,h=l.WallGeometryLibrary.computePositions(f,m,c,u,p,!1);if(!e.defined(h))return;const g=h.bottomPositions,y=h.topPositions;let _=y.length,C=2*_;const H=new Float64Array(C);let A,k=0;for(_/=3,A=0;A<_;++A){const e=3*A,t=i.Cartesian3.fromArray(y,e,E),n=i.Cartesian3.fromArray(g,e,b);H[k++]=n.x,H[k++]=n.y,H[k++]=n.z,H[k++]=t.x,H[k++]=t.y,H[k++]=t.z}const w=new a.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:H})}),x=C/3;C=2*x-4+x;const G=s.IndexDatatype.createTypedArray(x,C);let L=0;for(A=0;A<x-2;A+=2){const e=A,t=A+2,n=i.Cartesian3.fromArray(H,3*e,E),o=i.Cartesian3.fromArray(H,3*t,b);if(i.Cartesian3.equalsEpsilon(n,o,r.CesiumMath.EPSILON10))continue;const a=A+1,s=A+3;G[L++]=a,G[L++]=e,G[L++]=a,G[L++]=s,G[L++]=e,G[L++]=t}return G[L++]=x-2,G[L++]=x-1,new o.Geometry({attributes:w,indices:G,primitiveType:o.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(H)})},function(t,n){return e.defined(n)&&(t=C.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),C.createGeometry(t)}}));
define(["./defaultValue-865ac579","./Matrix3-6e56fbc7","./Transforms-f3654378","./ComponentDatatype-985dcc38","./GeometryAttribute-e3f63a02","./GeometryAttributes-75794475","./IndexDatatype-16f6b4a1","./Math-76ce6367","./WallGeometryLibrary-d0268552","./Matrix2-23dd5853","./RuntimeError-9e0724f9","./combine-5e110d09","./WebGLConstants-258cf3a0","./arrayRemoveDuplicates-398390b2","./PolylinePipeline-70a831f8","./EllipsoidGeodesic-3e762525","./EllipsoidRhumbLine-b175af48","./IntersectionTests-63574cfd","./Plane-4befcca0"],(function(e,i,t,n,o,a,s,r,l,m,d,u,c,p,f,h,g,y,_){"use strict";const E=new i.Cartesian3,C=new i.Cartesian3;function H(t){const n=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,o=t.maximumHeights,a=t.minimumHeights,s=e.defaultValue(t.granularity,r.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=n,this._minimumHeights=a,this._maximumHeights=o,this._granularity=s,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let m=1+n.length*i.Cartesian3.packedLength+2;e.defined(a)&&(m+=a.length),e.defined(o)&&(m+=o.length),this.packedLength=m+i.Ellipsoid.packedLength+1}H.pack=function(t,n,o){let a;o=e.defaultValue(o,0);const s=t._positions;let r=s.length;for(n[o++]=r,a=0;a<r;++a,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[a],n,o);const l=t._minimumHeights;if(r=e.defined(l)?l.length:0,n[o++]=r,e.defined(l))for(a=0;a<r;++a)n[o++]=l[a];const m=t._maximumHeights;if(r=e.defined(m)?m.length:0,n[o++]=r,e.defined(m))for(a=0;a<r;++a)n[o++]=m[a];return i.Ellipsoid.pack(t._ellipsoid,n,o),n[o+=i.Ellipsoid.packedLength]=t._granularity,n};const b=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),A={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:b,granularity:void 0};return H.unpack=function(t,n,o){let a;n=e.defaultValue(n,0);let s=t[n++];const r=new Array(s);for(a=0;a<s;++a,n+=i.Cartesian3.packedLength)r[a]=i.Cartesian3.unpack(t,n);let l,m;if(s=t[n++],s>0)for(l=new Array(s),a=0;a<s;++a)l[a]=t[n++];if(s=t[n++],s>0)for(m=new Array(s),a=0;a<s;++a)m[a]=t[n++];const d=i.Ellipsoid.unpack(t,n,b),u=t[n+=i.Ellipsoid.packedLength];return e.defined(o)?(o._positions=r,o._minimumHeights=l,o._maximumHeights=m,o._ellipsoid=i.Ellipsoid.clone(d,o._ellipsoid),o._granularity=u,o):(A.positions=r,A.minimumHeights=l,A.maximumHeights=m,A.granularity=u,new H(A))},H.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,o;const a=i.minimumHeight,s=i.maximumHeight,r=e.defined(a),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,o=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=a),l&&(o[i]=s)}return new H({positions:t,maximumHeights:o,minimumHeights:n,ellipsoid:i.ellipsoid})},H.createGeometry=function(m){const d=m._positions,u=m._minimumHeights,c=m._maximumHeights,p=m._granularity,f=m._ellipsoid,h=l.WallGeometryLibrary.computePositions(f,d,c,u,p,!1);if(!e.defined(h))return;const g=h.bottomPositions,y=h.topPositions;let _=y.length,H=2*_;const b=new Float64Array(H);let A,k=0;for(_/=3,A=0;A<_;++A){const e=3*A,t=i.Cartesian3.fromArray(y,e,E),n=i.Cartesian3.fromArray(g,e,C);b[k++]=n.x,b[k++]=n.y,b[k++]=n.z,b[k++]=t.x,b[k++]=t.y,b[k++]=t.z}const w=new a.GeometryAttributes({position:new o.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b})}),x=H/3;H=2*x-4+x;const G=s.IndexDatatype.createTypedArray(x,H);let L=0;for(A=0;A<x-2;A+=2){const e=A,t=A+2,n=i.Cartesian3.fromArray(b,3*e,E),o=i.Cartesian3.fromArray(b,3*t,C);if(i.Cartesian3.equalsEpsilon(n,o,r.CesiumMath.EPSILON10))continue;const a=A+1,s=A+3;G[L++]=a,G[L++]=e,G[L++]=a,G[L++]=s,G[L++]=e,G[L++]=t}return G[L++]=x-2,G[L++]=x-1,new o.Geometry({attributes:w,indices:G,primitiveType:o.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(b)})},function(t,n){return e.defined(n)&&(t=H.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),H.createGeometry(t)}}));