1 |
- define(["./defaultValue-81eec7ed","./Matrix2-e3fb4559","./Transforms-98ffa11d","./Cartesian3-7e9cc2ff","./ComponentDatatype-aaeec80f","./Check-741c5f3c","./GeometryAttribute-b025f9a8","./GeometryAttributes-32b29525","./IndexDatatype-f1e3f799","./Math-5f585871","./WallGeometryLibrary-dfadd129","./Matrix4-d34187af","./RuntimeError-26acdd3b","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda","./WebGLConstants-508b9636","./arrayRemoveDuplicates-85770175","./PolylinePipeline-de59c85a","./EllipsoidGeodesic-6de45192","./EllipsoidRhumbLine-9c6b32ea","./IntersectionTests-73b87d72","./Plane-4f75b3df"],(function(e,i,t,n,a,o,s,r,l,d,m,u,c,p,f,h,g,y,_,E,b,C){"use strict";const H=new n.Cartesian3,A=new n.Cartesian3;function k(t){const a=(t=e.defaultValue(t,e.defaultValue.EMPTY_OBJECT)).positions,o=t.maximumHeights,s=t.minimumHeights,r=e.defaultValue(t.granularity,d.CesiumMath.RADIANS_PER_DEGREE),l=e.defaultValue(t.ellipsoid,i.Ellipsoid.WGS84);this._positions=a,this._minimumHeights=s,this._maximumHeights=o,this._granularity=r,this._ellipsoid=i.Ellipsoid.clone(l),this._workerName="createWallOutlineGeometry";let m=1+a.length*n.Cartesian3.packedLength+2;e.defined(s)&&(m+=s.length),e.defined(o)&&(m+=o.length),this.packedLength=m+i.Ellipsoid.packedLength+1}k.pack=function(t,a,o){let s;o=e.defaultValue(o,0);const r=t._positions;let l=r.length;for(a[o++]=l,s=0;s<l;++s,o+=n.Cartesian3.packedLength)n.Cartesian3.pack(r[s],a,o);const d=t._minimumHeights;if(l=e.defined(d)?d.length:0,a[o++]=l,e.defined(d))for(s=0;s<l;++s)a[o++]=d[s];const m=t._maximumHeights;if(l=e.defined(m)?m.length:0,a[o++]=l,e.defined(m))for(s=0;s<l;++s)a[o++]=m[s];return i.Ellipsoid.pack(t._ellipsoid,a,o),a[o+=i.Ellipsoid.packedLength]=t._granularity,a};const w=i.Ellipsoid.clone(i.Ellipsoid.UNIT_SPHERE),x={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:w,granularity:void 0};return k.unpack=function(t,a,o){let s;a=e.defaultValue(a,0);let r=t[a++];const l=new Array(r);for(s=0;s<r;++s,a+=n.Cartesian3.packedLength)l[s]=n.Cartesian3.unpack(t,a);let d,m;if(r=t[a++],r>0)for(d=new Array(r),s=0;s<r;++s)d[s]=t[a++];if(r=t[a++],r>0)for(m=new Array(r),s=0;s<r;++s)m[s]=t[a++];const u=i.Ellipsoid.unpack(t,a,w),c=t[a+=i.Ellipsoid.packedLength];return e.defined(o)?(o._positions=l,o._minimumHeights=d,o._maximumHeights=m,o._ellipsoid=i.Ellipsoid.clone(u,o._ellipsoid),o._granularity=c,o):(x.positions=l,x.minimumHeights=d,x.maximumHeights=m,x.granularity=c,new k(x))},k.fromConstantHeights=function(i){const t=(i=e.defaultValue(i,e.defaultValue.EMPTY_OBJECT)).positions;let n,a;const o=i.minimumHeight,s=i.maximumHeight,r=e.defined(o),l=e.defined(s);if(r||l){const e=t.length;n=r?new Array(e):void 0,a=l?new Array(e):void 0;for(let i=0;i<e;++i)r&&(n[i]=o),l&&(a[i]=s)}return new k({positions:t,maximumHeights:a,minimumHeights:n,ellipsoid:i.ellipsoid})},k.createGeometry=function(i){const o=i._positions,u=i._minimumHeights,c=i._maximumHeights,p=i._granularity,f=i._ellipsoid,h=m.WallGeometryLibrary.computePositions(f,o,c,u,p,!1);if(!e.defined(h))return;const g=h.bottomPositions,y=h.topPositions;let _=y.length,E=2*_;const b=new Float64Array(E);let C,k=0;for(_/=3,C=0;C<_;++C){const e=3*C,i=n.Cartesian3.fromArray(y,e,H),t=n.Cartesian3.fromArray(g,e,A);b[k++]=t.x,b[k++]=t.y,b[k++]=t.z,b[k++]=i.x,b[k++]=i.y,b[k++]=i.z}const w=new r.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b})}),x=E/3;E=2*x-4+x;const G=l.IndexDatatype.createTypedArray(x,E);let L=0;for(C=0;C<x-2;C+=2){const e=C,i=C+2,t=n.Cartesian3.fromArray(b,3*e,H),a=n.Cartesian3.fromArray(b,3*i,A);if(n.Cartesian3.equalsEpsilon(t,a,d.CesiumMath.EPSILON10))continue;const o=C+1,s=C+3;G[L++]=o,G[L++]=e,G[L++]=o,G[L++]=s,G[L++]=e,G[L++]=i}return G[L++]=x-2,G[L++]=x-1,new s.Geometry({attributes:w,indices:G,primitiveType:s.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere.fromVertices(b)})},function(t,n){return e.defined(n)&&(t=k.unpack(t,n)),t._ellipsoid=i.Ellipsoid.clone(t._ellipsoid),k.createGeometry(t)}}));
|