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

2 lines
3.0 KiB
JavaScript
Raw Permalink Normal View History

2023-11-07 10:04:37 +08:00
define(["./GeometryOffsetAttribute-ed56ff58","./BoundingSphere-9a3b5656","./Cartesian2-bd414876","./Cartesian3-e0307675","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./CylinderGeometryLibrary-6ad7b69e","./defaultValue-81eec7ed","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./IndexDatatype-3f3c99e8","./GeographicProjection-c931c7fb","./Math-e73894ab","./Matrix4-4c545f70","./RuntimeError-26acdd3b","./Rectangle-cf3e0e3e","./WebGLConstants-508b9636","./Matrix2-dc0c61cc","./Transforms-5b829630","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda"],(function(e,t,i,n,a,r,o,s,u,c,f,d,l,b,m,p,y,_,h,A,R,G){"use strict";const g=new i.Cartesian2;function O(e){const t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).length,i=e.topRadius,n=e.bottomRadius,a=s.defaultValue(e.slices,128),r=Math.max(s.defaultValue(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=n,this._slices=a,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}O.packedLength=6,O.pack=function(e,t,i){return i=s.defaultValue(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i++]=e._numberOfVerticalLines,t[i]=s.defaultValue(e._offsetAttribute,-1),t};const V={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};return O.unpack=function(e,t,i){t=s.defaultValue(t,0);const n=e[t++],a=e[t++],r=e[t++],o=e[t++],u=e[t++],c=e[t];return s.defined(i)?(i._length=n,i._topRadius=a,i._bottomRadius=r,i._slices=o,i._numberOfVerticalLines=u,i._offsetAttribute=-1===c?void 0:c,i):(V.length=n,V.topRadius=a,V.bottomRadius=r,V.slices=o,V.numberOfVerticalLines=u,V.offsetAttribute=-1===c?void 0:c,new O(V))},O.createGeometry=function(a){let d=a._length;const l=a._topRadius,b=a._bottomRadius,m=a._slices,p=a._numberOfVerticalLines;if(d<=0||l<0||b<0||0===l&&0===b)return;const y=2*m,_=o.CylinderGeometryLibrary.computePositions(d,l,b,m,!1);let h,A=2*m;if(p>0){const e=Math.min(p,m);h=Math.round(m/e),A+=e}const R=f.IndexDatatype.createTypedArray(y,2*A);let G,O=0;for(G=0;G<m-1;G++)R[O++]=G,R[O++]=G+1,R[O++]=G+m,R[O++]=G+1+m;if(R[O++]=m-1,R[O++]=0,R[O++]=m+m-1,R[O++]=m,p>0)for(G=0;G<m;G+=h)R[O++]=G,R[O++]=G+m;const V=new c.GeometryAttributes;V.position=new u.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:_}),g.x=.5*d,g.y=Math.max(b,l);const C=new t.BoundingSphere(n.Cartesian3.ZERO,i.Cartesian2.magnitude(g));if(s.defined(a._offsetAttribute)){d=_.length;const t=new Uint8Array(d/3),i=a._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(t,i),V.applyOffset=new u.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}return new u.Geometry({attributes:V,indices:R,primitiveType:u.PrimitiveType.LINES,boundingSphere:C,offsetAttribute:a._offsetAttribute})},function(e,t){return s.defined(t)&&(e=O.unpack(e,t)),O.createGeometry(e)}}));