Agriculture-front-end/dist/Cesium/Workers/PrimitivePipeline-3fed6725.js

2 lines
9.7 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["exports","./BoundingSphere-561b54d0","./ComponentDatatype-c140a87d","./when-b60132fc","./Check-7b2a090c","./Cartesian2-47311507","./GeometryAttribute-3a42bbdc","./GeometryAttributes-252e9929","./GeometryPipeline-e1b82a4e","./IndexDatatype-8a5eead4","./WebMercatorProjection-01b1b5e7"],(function(e,t,r,n,i,o,a,s,d,p,u){"use strict";function f(e,t,r){e=n.defaultValue(e,0),t=n.defaultValue(t,0),r=n.defaultValue(r,0),this.value=new Float32Array([e,t,r])}function c(e,t){var n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new a.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var s=n.batchId.values,d=0;d<o;++d)s[d]=t}function m(e){var i,o,a=e.instances,s=e.projection,p=e.elementIndexUintSupported,u=e.scene3DOnly,f=e.vertexCacheOptimize,m=e.compressVertices,h=e.modelMatrix,l=a.length;for(i=0;i<l;++i)if(n.defined(a[i].geometry)){a[i].geometry.primitiveType;break}if(function(e,r,i){var o,a=!i,s=e.length;if(!a&&s>1){var p=e[0].modelMatrix;for(o=1;o<s;++o)if(!t.Matrix4.equals(p,e[o].modelMatrix)){a=!0;break}}if(a)for(o=0;o<s;++o)n.defined(e[o].geometry)&&d.GeometryPipeline.transformToWorldCoordinates(e[o]);else t.Matrix4.multiplyTransformation(r,e[0].modelMatrix,r)}(a,h,u),!u)for(i=0;i<l;++i)n.defined(a[i].geometry)&&d.GeometryPipeline.splitLongitude(a[i]);if(function(e){for(var t=e.length,r=0;r<t;++r){var i=e[r];n.defined(i.geometry)?c(i.geometry,r):n.defined(i.westHemisphereGeometry)&&n.defined(i.eastHemisphereGeometry)&&(c(i.westHemisphereGeometry,r),c(i.eastHemisphereGeometry,r))}}(a),f)for(i=0;i<l;++i){var g=a[i];n.defined(g.geometry)?(d.GeometryPipeline.reorderForPostVertexCache(g.geometry),d.GeometryPipeline.reorderForPreVertexCache(g.geometry)):n.defined(g.westHemisphereGeometry)&&n.defined(g.eastHemisphereGeometry)&&(d.GeometryPipeline.reorderForPostVertexCache(g.westHemisphereGeometry),d.GeometryPipeline.reorderForPreVertexCache(g.westHemisphereGeometry),d.GeometryPipeline.reorderForPostVertexCache(g.eastHemisphereGeometry),d.GeometryPipeline.reorderForPreVertexCache(g.eastHemisphereGeometry))}var y=d.GeometryPipeline.combineInstances(a);for(l=y.length,i=0;i<l;++i){var b,v=(o=y[i]).attributes;if(u)for(b in v)v.hasOwnProperty(b)&&v[b].componentDatatype===r.ComponentDatatype.DOUBLE&&d.GeometryPipeline.encodeAttribute(o,b,b+"3DHigh",b+"3DLow");else for(b in v)if(v.hasOwnProperty(b)&&v[b].componentDatatype===r.ComponentDatatype.DOUBLE){var G=b+"3D",x=b+"2D";d.GeometryPipeline.projectTo2D(o,b,G,x,s),n.defined(o.boundingSphere)&&"position"===b&&(o.boundingSphereCV=t.BoundingSphere.fromVertices(o.attributes.position2D.values)),d.GeometryPipeline.encodeAttribute(o,G,G+"High",G+"Low"),d.GeometryPipeline.encodeAttribute(o,x,x+"High",x+"Low")}m&&d.GeometryPipeline.compressVertices(o)}if(!p){var S=[];for(l=y.length,i=0;i<l;++i)o=y[i],S=S.concat(d.GeometryPipeline.fitToUnsignedShortIndices(o));y=S}return y}function h(e,t,r,i){var o,a,s,d=i.length-1;if(d>=0){var p=i[d];o=p.offset+p.count,a=r[s=p.index].indices.length}else o=0,a=r[s=0].indices.length;for(var u=e.length,f=0;f<u;++f){var c=e[f][t];if(n.defined(c)){var m=c.indices.length;o+m>a&&(o=0,a=r[++s].indices.length),i.push({index:s,offset:o,count:m}),o+=m}}}Object.defineProperties(f.prototype,{componentDatatype:{get:function(){return r.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),f.fromCartesian3=function(e){return new f(e.x,e.y,e.z)},f.toValue=function(e,t){return n.defined(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var l={};function g(e,t){var r=e.attributes;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n.defined(o)&&n.defined(o.values)&&t.push(o.values.buffer)}n.defined(e.indices)&&t.push(e.indices.buffer)}function y(e,r){var i=e.length,o=new Float64Array(1+19*i),a=0;o[a++]=i;for(var s=0;s<i;s++){var d=e[s];if(t.Matrix4.pack(d.modelMatrix,o,a),a+=t.Matrix4.packedLength,n.defined(d.attributes)&&n.defined(d.attributes.offset)){var p=d.attributes.offset.value;o[a]=p[0],o[