1 |
- define(["./arrayFill-4513d7ad","./buildModuleUrl-8cce5713","./Cartesian4-b0ddc4ba","./Check-7b2a090c","./FeatureDetection-ab6f364c","./when-b60132fc","./GeometryAttribute-923c2729","./GeometryAttributes-252e9929","./GeometryOffsetAttribute-fbeb6f1a","./Math-31e539c2","./WebGLConstants-aba9fc67"],(function(e,t,a,n,i,r,u,m,o,s,f){"use strict";var c=new a.Cartesian3;function d(e){var t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).minimum,n=e.maximum;this._min=a.Cartesian3.clone(t),this._max=a.Cartesian3.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}d.fromDimensions=function(e){var t=(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT)).dimensions,n=a.Cartesian3.multiplyByScalar(t,.5,new a.Cartesian3);return new d({minimum:a.Cartesian3.negate(n,new a.Cartesian3),maximum:n,offsetAttribute:e.offsetAttribute})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*a.Cartesian3.packedLength+1,d.pack=function(e,t,n){return n=r.defaultValue(n,0),a.Cartesian3.pack(e._min,t,n),a.Cartesian3.pack(e._max,t,n+a.Cartesian3.packedLength),t[n+2*a.Cartesian3.packedLength]=r.defaultValue(e._offsetAttribute,-1),t};var l=new a.Cartesian3,b=new a.Cartesian3,y={minimum:l,maximum:b,offsetAttribute:void 0};return d.unpack=function(e,t,n){t=r.defaultValue(t,0);var i=a.Cartesian3.unpack(e,t,l),u=a.Cartesian3.unpack(e,t+a.Cartesian3.packedLength,b),m=e[t+2*a.Cartesian3.packedLength];return r.defined(n)?(n._min=a.Cartesian3.clone(i,n._min),n._max=a.Cartesian3.clone(u,n._max),n._offsetAttribute=-1===m?void 0:m,n):(y.offsetAttribute=-1===m?void 0:m,new d(y))},d.createGeometry=function(n){var s=n._min,f=n._max;if(!a.Cartesian3.equals(s,f)){var d=new m.GeometryAttributes,l=new Uint16Array(24),b=new Float64Array(24);b[0]=s.x,b[1]=s.y,b[2]=s.z,b[3]=f.x,b[4]=s.y,b[5]=s.z,b[6]=f.x,b[7]=f.y,b[8]=s.z,b[9]=s.x,b[10]=f.y,b[11]=s.z,b[12]=s.x,b[13]=s.y,b[14]=f.z,b[15]=f.x,b[16]=s.y,b[17]=f.z,b[18]=f.x,b[19]=f.y,b[20]=f.z,b[21]=s.x,b[22]=f.y,b[23]=f.z,d.position=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:b}),l[0]=4,l[1]=5,l[2]=5,l[3]=6,l[4]=6,l[5]=7,l[6]=7,l[7]=4,l[8]=0,l[9]=1,l[10]=1,l[11]=2,l[12]=2,l[13]=3,l[14]=3,l[15]=0,l[16]=0,l[17]=4,l[18]=1,l[19]=5,l[20]=2,l[21]=6,l[22]=3,l[23]=7;var y=a.Cartesian3.subtract(f,s,c),p=.5*a.Cartesian3.magnitude(y);if(r.defined(n._offsetAttribute)){var C=b.length,A=new Uint8Array(C/3),x=n._offsetAttribute===o.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(A,x),d.applyOffset=new u.GeometryAttribute({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new u.Geometry({attributes:d,indices:l,primitiveType:t.PrimitiveType.LINES,boundingSphere:new t.BoundingSphere(a.Cartesian3.ZERO,p),offsetAttribute:n._offsetAttribute})}},function(e,t){return r.defined(t)&&(e=d.unpack(e,t)),d.createGeometry(e)}}));
|