qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/GeometryAttribute-2b42a913.js

2 lines
3.1 KiB
JavaScript
Raw Permalink Normal View History

2023-11-07 10:04:37 +08:00
define(["exports","./Cartesian2-bd414876","./Cartesian3-e0307675","./Check-741c5f3c","./defaultValue-81eec7ed","./Matrix2-dc0c61cc","./Matrix4-4c545f70","./WebGLConstants-508b9636","./Transforms-5b829630","./Rectangle-cf3e0e3e"],(function(t,e,a,n,r,i,o,s,u,c){"use strict";var I=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});const N={POINTS:s.WebGLConstants.POINTS,LINES:s.WebGLConstants.LINES,LINE_LOOP:s.WebGLConstants.LINE_LOOP,LINE_STRIP:s.WebGLConstants.LINE_STRIP,TRIANGLES:s.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:s.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:s.WebGLConstants.TRIANGLE_FAN,validate:function(t){return t===N.POINTS||t===N.LINES||t===N.LINE_LOOP||t===N.LINE_STRIP||t===N.TRIANGLES||t===N.TRIANGLE_STRIP||t===N.TRIANGLE_FAN}};var l=Object.freeze(N);function T(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=r.defaultValue(t.primitiveType,l.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=r.defaultValue(t.geometryType,I.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}T.computeNumberOfVertices=function(t){let e=-1;for(const a in t.attributes)if(t.attributes.hasOwnProperty(a)&&r.defined(t.attributes[a])&&r.defined(t.attributes[a].values)){const n=t.attributes[a];e=n.values.length/n.componentsPerAttribute}return e};const f=new e.Cartographic,p=new a.Cartesian3,C=new o.Matrix4,b=[new e.Cartographic,new e.Cartographic,new e.Cartographic],m=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],y=[new e.Cartesian2,new e.Cartesian2,new e.Cartesian2],E=new a.Cartesian3,L=new u.Quaternion,h=new o.Matrix4,d=new i.Matrix2;T._textureCoordinateRotationPoints=function(t,n,r,s){let I;const N=c.Rectangle.center(s,f),l=e.Cartographic.toCartesian(N,r,p),T=u.Transforms.eastNorthUpToFixedFrame(l,r,C),x=o.Matrix4.inverse(T,C),A=m,P=b;P[0].longitude=s.west,P[0].latitude=s.south,P[1].longitude=s.west,P[1].latitude=s.north,P[2].longitude=s.east,P[2].latitude=s.south;let S=E;for(I=0;I<3;I++)e.Cartographic.toCartesian(P[I],r,S),S=o.Matrix4.multiplyByPointAsVector(x,S,S),A[I].x=S.x,A[I].y=S.y;const G=u.Quaternion.fromAxisAngle(a.Cartesian3.UNIT_Z,-n,L),R=o.Matrix3.fromQuaternion(G,h),g=t.length;let w=Number.POSITIVE_INFINITY,O=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,V=Number.NEGATIVE_INFINITY;for(I=0;I<g;I++)S=o.Matrix4.multiplyByPointAsVector(x,t[I],S),S=o.Matrix3.multiplyByVector(R,S,S),w=Math.min(w,S.x),O=Math.min(O,S.y),_=Math.max(_,S.x),V=Math.max(V,S.y);const M=i.Matrix2.fromRotation(n,d),v=y;v[0].x=w,v[0].y=O,v[1].x=w,v[1].y=V,v[2].x=_,v[2].y=O;const F=A[0],W=A[2].x-F.x,Y=A[1].y-F.y;for(I=0;I<3;I++){const t=v[I];i.Matrix2.multiplyByVector(M,t,t),t.x=(t.x-F.x)/W,t.y=(t.y-F.y)/Y}const B=v[0],k=v[1],z=v[2],Q=new Array(6);return e.Cartesian2.pack(B,Q),e.Cartesian2.pack(k,Q,2),e.Cartesian2.pack(z,Q,4),Q},t.Geometry=T,t.GeometryAttribute=function(t){t=r.defaultValue(t,r.defaultValue.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=r.defaultValue(t.normalize,!1),this.values=t.values},t.GeometryType=I,t.PrimitiveType=l}));