拖旺项目:聊城公交辅助决策系统
zhaoxing
2022-05-08 d5859b70023f40c195c58f81d3abcd14980cb722
1
define(["./when-229515d6","./Matrix2-f0fc6cd3","./Transforms-4a1d2c0e","./ComponentDatatype-5f63ec93","./RuntimeError-8f3d96ee","./GeometryAttribute-4b6dfc85","./GeometryAttributes-b253752a","./IndexDatatype-c2b69fc2","./VertexFormat-af764a6f","./WallGeometryLibrary-5c745ea0","./combine-6d9c3903","./WebGLConstants-f63312fc","./arrayRemoveDuplicates-7cd4e18c","./PolylinePipeline-8d9de722","./EllipsoidGeodesic-412b0c43","./EllipsoidRhumbLine-0893952b","./IntersectionTests-3a1d2826","./Plane-863ea815"],(function(e,t,n,i,a,o,r,s,l,m,c,u,p,d,f,y,g,h){"use strict";const C=new t.Cartesian3,x=new t.Cartesian3,A=new t.Cartesian3,b=new t.Cartesian3,_=new t.Cartesian3,E=new t.Cartesian3,w=new t.Cartesian3;function F(n){const a=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).positions,o=n.maximumHeights,r=n.minimumHeights,s=e.defaultValue(n.vertexFormat,l.VertexFormat.DEFAULT),m=e.defaultValue(n.granularity,i.CesiumMath.RADIANS_PER_DEGREE),c=e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84);this._positions=a,this._minimumHeights=r,this._maximumHeights=o,this._vertexFormat=l.VertexFormat.clone(s),this._granularity=m,this._ellipsoid=t.Ellipsoid.clone(c),this._workerName="createWallGeometry";let u=1+a.length*t.Cartesian3.packedLength+2;e.defined(r)&&(u+=r.length),e.defined(o)&&(u+=o.length),this.packedLength=u+t.Ellipsoid.packedLength+l.VertexFormat.packedLength+1}F.pack=function(n,i,a){let o;a=e.defaultValue(a,0);const r=n._positions;let s=r.length;for(i[a++]=s,o=0;o<s;++o,a+=t.Cartesian3.packedLength)t.Cartesian3.pack(r[o],i,a);const m=n._minimumHeights;if(s=e.defined(m)?m.length:0,i[a++]=s,e.defined(m))for(o=0;o<s;++o)i[a++]=m[o];const c=n._maximumHeights;if(s=e.defined(c)?c.length:0,i[a++]=s,e.defined(c))for(o=0;o<s;++o)i[a++]=c[o];return t.Ellipsoid.pack(n._ellipsoid,i,a),a+=t.Ellipsoid.packedLength,l.VertexFormat.pack(n._vertexFormat,i,a),i[a+=l.VertexFormat.packedLength]=n._granularity,i};const v=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),L=new l.VertexFormat,k={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:v,vertexFormat:L,granularity:void 0};return F.unpack=function(n,i,a){let o;i=e.defaultValue(i,0);let r=n[i++];const s=new Array(r);for(o=0;o<r;++o,i+=t.Cartesian3.packedLength)s[o]=t.Cartesian3.unpack(n,i);let m,c;if(r=n[i++],r>0)for(m=new Array(r),o=0;o<r;++o)m[o]=n[i++];if(r=n[i++],r>0)for(c=new Array(r),o=0;o<r;++o)c[o]=n[i++];const u=t.Ellipsoid.unpack(n,i,v);i+=t.Ellipsoid.packedLength;const p=l.VertexFormat.unpack(n,i,L),d=n[i+=l.VertexFormat.packedLength];return e.defined(a)?(a._positions=s,a._minimumHeights=m,a._maximumHeights=c,a._ellipsoid=t.Ellipsoid.clone(u,a._ellipsoid),a._vertexFormat=l.VertexFormat.clone(p,a._vertexFormat),a._granularity=d,a):(k.positions=s,k.minimumHeights=m,k.maximumHeights=c,k.granularity=d,new F(k))},F.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 F({positions:n,maximumHeights:a,minimumHeights:i,ellipsoid:t.ellipsoid,vertexFormat:t.vertexFormat})},F.createGeometry=function(a){const l=a._positions,c=a._minimumHeights,u=a._maximumHeights,p=a._vertexFormat,d=a._granularity,f=a._ellipsoid,y=m.WallGeometryLibrary.computePositions(f,l,u,c,d,!0);if(!e.defined(y))return;const g=y.bottomPositions,h=y.topPositions,F=y.numCorners;let v=h.length,L=2*v;const k=p.position?new Float64Array(L):void 0,H=p.normal?new Float32Array(L):void 0,V=p.tangent?new Float32Array(L):void 0,G=p.bitangent?new Float32Array(L):void 0,D=p.st?new Float32Array(L/3*2):void 0;let P,T=0,z=0,O=0,R=0,S=0,I=w,N=E,M=_,W=!0;v/=3;let B=0;const U=1/(v-F-1);for(P=0;P<v;++P){const e=3*P,n=t.Cartesian3.fromArray(h,e,C),a=t.Cartesian3.fromArray(g,e,x);if(p.position&&(k[T++]=a.x,k[T++]=a.y,k[T++]=a.z,k[T++]=n.x,k[T++]=n.y,k[T++]=n.z),p.st&&(D[S++]=B,D[S++]=0,D[S++]=B,D[S++]=1),p.normal||p.tangent||p.bitangent){let a=t.Cartesian3.clone(t.Cartesian3.ZERO,b);const o=t.Cartesian3.subtract(n,f.geodeticSurfaceNormal(n,x),x);if(P+1<v&&(a=t.Cartesian3.fromArray(h,e+3,b)),W){const e=t.Cartesian3.subtract(a,n,A),i=t.Cartesian3.subtract(o,n,C);I=t.Cartesian3.normalize(t.Cartesian3.cross(i,e,I),I),W=!1}t.Cartesian3.equalsEpsilon(n,a,i.CesiumMath.EPSILON10)?W=!0:(B+=U,p.tangent&&(N=t.Cartesian3.normalize(t.Cartesian3.subtract(a,n,N),N)),p.bitangent&&(M=t.Cartesian3.normalize(t.Cartesian3.cross(I,N,M),M))),p.normal&&(H[z++]=I.x,H[z++]=I.y,H[z++]=I.z,H[z++]=I.x,H[z++]=I.y,H[z++]=I.z),p.tangent&&(V[R++]=N.x,V[R++]=N.y,V[R++]=N.z,V[R++]=N.x,V[R++]=N.y,V[R++]=N.z),p.bitangent&&(G[O++]=M.x,G[O++]=M.y,G[O++]=M.z,G[O++]=M.x,G[O++]=M.y,G[O++]=M.z)}}const q=new r.GeometryAttributes;p.position&&(q.position=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:k})),p.normal&&(q.normal=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:H})),p.tangent&&(q.tangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),p.bitangent&&(q.bitangent=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),p.st&&(q.st=new o.GeometryAttribute({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D}));const J=L/3;L-=6*(F+1);const Y=s.IndexDatatype.createTypedArray(J,L);let Z=0;for(P=0;P<J-2;P+=2){const e=P,n=P+2,a=t.Cartesian3.fromArray(k,3*e,C),o=t.Cartesian3.fromArray(k,3*n,x);if(t.Cartesian3.equalsEpsilon(a,o,i.CesiumMath.EPSILON10))continue;const r=P+1,s=P+3;Y[Z++]=r,Y[Z++]=e,Y[Z++]=s,Y[Z++]=s,Y[Z++]=e,Y[Z++]=n}return new o.Geometry({attributes:q,indices:Y,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:new n.BoundingSphere.fromVertices(k)})},function(n,i){return e.defined(i)&&(n=F.unpack(n,i)),n._ellipsoid=t.Ellipsoid.clone(n._ellipsoid),F.createGeometry(n)}}));