Agriculture-front-end/public/Cesium/Workers/GeometryAttribute-3a42bbdc.js

2 lines
6.2 KiB
JavaScript
Raw Normal View History

2023-04-16 22:33:44 +08:00
define(["exports","./Cartesian2-47311507","./Cartographic-3309dd0d","./Check-7b2a090c","./when-b60132fc","./BoundingSphere-561b54d0","./PrimitiveType-39acab88","./Transforms-cb0006b0"],(function(e,t,n,r,a,i,u,o){"use strict";var s=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function f(e,t,n,r){this[0]=a.defaultValue(e,0),this[1]=a.defaultValue(n,0),this[2]=a.defaultValue(t,0),this[3]=a.defaultValue(r,0)}f.packedLength=4,f.pack=function(e,t,n){return n=a.defaultValue(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t},f.unpack=function(e,t,n){return t=a.defaultValue(t,0),a.defined(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},f.clone=function(e,t){if(a.defined(e))return a.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new f(e[0],e[2],e[1],e[3])},f.fromArray=function(e,t,n){return t=a.defaultValue(t,0),a.defined(n)||(n=new f),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n},f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a.defined(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new f(e[0],e[1],e[2],e[3])},f.fromScale=function(e,t){return a.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new f(e.x,0,0,e.y)},f.fromUniformScale=function(e,t){return a.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new f(e,0,0,e)},f.fromRotation=function(e,t){var n=Math.cos(e),r=Math.sin(e);return a.defined(t)?(t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t):new f(n,-r,r,n)},f.toArray=function(e,t){return a.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},f.getElementIndex=function(e,t){return 2*e+t},f.getColumn=function(e,t,n){var r=2*t,a=e[r],i=e[r+1];return n.x=a,n.y=i,n},f.setColumn=function(e,t,n,r){var a=2*t;return(r=f.clone(e,r))[a]=n.x,r[a+1]=n.y,r},f.getRow=function(e,t,n){var r=e[t],a=e[t+2];return n.x=r,n.y=a,n},f.setRow=function(e,t,n,r){return(r=f.clone(e,r))[t]=n.x,r[t+2]=n.y,r};var c=new t.Cartesian2;f.getScale=function(e,n){return n.x=t.Cartesian2.magnitude(t.Cartesian2.fromElements(e[0],e[1],c)),n.y=t.Cartesian2.magnitude(t.Cartesian2.fromElements(e[2],e[3],c)),n};var l=new t.Cartesian2;function d(e){e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=a.defaultValue(e.primitiveType,u.PrimitiveType.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=a.defaultValue(e.geometryType,s.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}f.getMaximumScale=function(e){return f.getScale(e,l),t.Cartesian2.maximumComponent(l)},f.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],i=e[1]*t[0]+e[3]*t[1],u=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=u,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},f.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,a=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=a,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},f.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},f.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},f.transpose=function(e,t){var n=e[0],r=e[2],a=e[1],i=e[3];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t},f.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},f.equals=function(e,t){return e===t||a.defined(e)&&a.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},f.equalsEpsilon=function(e,t,n){return e===t||a.defined(e)&&a.defined(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},f.IDENTITY=Object.freeze(new f(1,0,0,1)),f.ZERO=Object.freeze(new f(0,0,0,0)),f.COLUMN0ROW0=0,f.COLUMN0ROW1=1,f.COLUMN1ROW0=2,f.COLUMN1ROW1=3,Object.defineProperties(f.prototype,{length:{get:function(){return f.packedLength