1 |
- define(["./GeometryOffsetAttribute-1772960d","./Transforms-d5c6ad6e","./Matrix2-ccd5b911","./RuntimeError-346a3079","./ComponentDatatype-93750d1a","./when-4bbc8319","./GeometryAttribute-c30799b8","./GeometryAttributes-7827a6c2","./combine-83860057","./WebGLConstants-1c8239cc"],function(u,m,o,e,s,f,c,d,t,n){"use strict";var p=new o.Cartesian3;function r(e){var t=(e=f.defaultValue(e,f.defaultValue.EMPTY_OBJECT)).minimum,n=e.maximum;this._min=o.Cartesian3.clone(t),this._max=o.Cartesian3.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}r.fromDimensions=function(e){var t=(e=f.defaultValue(e,f.defaultValue.EMPTY_OBJECT)).dimensions,t=o.Cartesian3.multiplyByScalar(t,.5,new o.Cartesian3);return new r({minimum:o.Cartesian3.negate(t,new o.Cartesian3),maximum:t,offsetAttribute:e.offsetAttribute})},r.fromAxisAlignedBoundingBox=function(e){return new r({minimum:e.minimum,maximum:e.maximum})},r.packedLength=2*o.Cartesian3.packedLength+1,r.pack=function(e,t,n){return n=f.defaultValue(n,0),o.Cartesian3.pack(e._min,t,n),o.Cartesian3.pack(e._max,t,n+o.Cartesian3.packedLength),t[n+2*o.Cartesian3.packedLength]=f.defaultValue(e._offsetAttribute,-1),t};var y=new o.Cartesian3,l=new o.Cartesian3,b={minimum:y,maximum:l,offsetAttribute:void 0};return r.unpack=function(e,t,n){t=f.defaultValue(t,0);var a=o.Cartesian3.unpack(e,t,y),i=o.Cartesian3.unpack(e,t+o.Cartesian3.packedLength,l),t=e[t+2*o.Cartesian3.packedLength];return f.defined(n)?(n._min=o.Cartesian3.clone(a,n._min),n._max=o.Cartesian3.clone(i,n._max),n._offsetAttribute=-1===t?void 0:t,n):(b.offsetAttribute=-1===t?void 0:t,new r(b))},r.createGeometry=function(e){var t=e._min,n=e._max;if(!o.Cartesian3.equals(t,n)){var a=new d.GeometryAttributes,i=new Uint16Array(24),r=new Float64Array(24);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,a.position=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:r}),i[0]=4,i[1]=5,i[2]=5,i[3]=6,i[4]=6,i[5]=7,i[6]=7,i[7]=4,i[8]=0,i[9]=1,i[10]=1,i[11]=2,i[12]=2,i[13]=3,i[14]=3,i[15]=0,i[16]=0,i[17]=4,i[18]=1,i[19]=5,i[20]=2,i[21]=6,i[22]=3,i[23]=7;n=o.Cartesian3.subtract(n,t,p),t=.5*o.Cartesian3.magnitude(n);return f.defined(e._offsetAttribute)&&(n=r.length,r=new Uint8Array(n/3),n=e._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,u.arrayFill(r,n),a.applyOffset=new c.GeometryAttribute({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})),new c.Geometry({attributes:a,indices:i,primitiveType:c.PrimitiveType.LINES,boundingSphere:new m.BoundingSphere(o.Cartesian3.ZERO,t),offsetAttribute:e._offsetAttribute})}},function(e,t){return f.defined(t)&&(e=r.unpack(e,t)),r.createGeometry(e)}});
|