Agriculture-front-end/public/Cesium/Workers/GeometryAttribute-3a42bbdc.js
2023-04-16 22:33:44 +08:00

2 lines
6.2 KiB
JavaScript

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}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},d.computeNumberOfVertices=function(e){var t=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&a.defined(e.attributes[n])&&a.defined(e.attributes[n].values)){var r=e.attributes[n];t=r.values.length/r.componentsPerAttribute}return t};var y=new n.Cartographic,m=new n.Cartesian3,p=new i.Matrix4,h=[new n.Cartographic,new n.Cartographic,new n.Cartographic],C=[new t.Cartesian2,new t.Cartesian2,new t.Cartesian2],b=[new t.Cartesian2,new t.Cartesian2,new t.Cartesian2],x=new n.Cartesian3,g=new o.Quaternion,w=new i.Matrix4,M=new f;d._textureCoordinateRotationPoints=function(e,r,a,u){var s,c=t.Rectangle.center(u,y),l=n.Cartographic.toCartesian(c,a,m),d=o.Transforms.eastNorthUpToFixedFrame(l,a,p),v=i.Matrix4.inverse(d,p),N=C,T=h;T[0].longitude=u.west,T[0].latitude=u.south,T[1].longitude=u.west,T[1].latitude=u.north,T[2].longitude=u.east,T[2].latitude=u.south;var I=x;for(s=0;s<3;s++)n.Cartographic.toCartesian(T[s],a,I),I=i.Matrix4.multiplyByPointAsVector(v,I,I),N[s].x=I.x,N[s].y=I.y;var V=o.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,-r,g),E=i.Matrix3.fromQuaternion(V,w),O=e.length,A=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY,P=Number.NEGATIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(s=0;s<O;s++)I=i.Matrix4.multiplyByPointAsVector(v,e[s],I),I=i.Matrix3.multiplyByVector(E,I,I),A=Math.min(A,I.x),S=Math.min(S,I.y),P=Math.max(P,I.x),R=Math.max(R,I.y);var L=f.fromRotation(r,M),B=b;B[0].x=A,B[0].y=S,B[1].x=A,B[1].y=R,B[2].x=P,B[2].y=S;var k=N[0],Y=N[2].x-k.x,_=N[1].y-k.y;for(s=0;s<3;s++){var q=B[s];f.multiplyByVector(L,q,q),q.x=(q.x-k.x)/Y,q.y=(q.y-k.y)/_}var G=B[0],U=B[1],j=B[2],F=new Array(6);return t.Cartesian2.pack(G,F),t.Cartesian2.pack(U,F,2),t.Cartesian2.pack(j,F,4),F},e.Geometry=d,e.GeometryAttribute=function(e){e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=a.defaultValue(e.normalize,!1),this.values=e.values},e.GeometryType=s,e.Matrix2=f}));