数字孪生Web 后台dt( digital twin)2.0版本 统一命名格式
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
9.7 KiB

12 months ago
define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Cartesian2-c451a606","./Transforms-e4be2a30","./ComponentDatatype-7ee14e67","./GeometryAttribute-6f280ece","./GeometryAttributes-90846c5f","./GeometryPipeline-21a841db","./IndexDatatype-354a5ea3","./WebMercatorProjection-a8c0125a"],function(e,v,t,f,P,k,C,w,b,A,c){"use strict";function m(e,t,r){e=v.defaultValue(e,0),t=v.defaultValue(t,0),r=v.defaultValue(r,0),this.value=new Float32Array([e,t,r])}function G(e,t){var r=e.attributes,n=r.position,i=n.values.length/n.componentsPerAttribute;r.batchId=new C.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=r.batchId.values,a=0;a<i;++a)o[a]=t}function l(e){var t,r,n=e.instances,i=e.projection,o=e.elementIndexUintSupported,a=e.scene3DOnly,s=e.vertexCacheOptimize,d=e.compressVertices,p=e.modelMatrix,u=n.length;for(t=0;t<u;++t)if(v.defined(n[t].geometry)){n[t].geometry.primitiveType;break}if(function(e,t,r){var n,i=!r,o=e.length;if(!i&&1<o){var a=e[0].modelMatrix;for(n=1;n<o;++n)if(!P.Matrix4.equals(a,e[n].modelMatrix)){i=!0;break}}if(i)for(n=0;n<o;++n)v.defined(e[n].geometry)&&b.GeometryPipeline.transformToWorldCoordinates(e[n]);else P.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(n,p,a),!a)for(t=0;t<u;++t)v.defined(n[t].geometry)&&b.GeometryPipeline.splitLongitude(n[t]);if(function(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];v.defined(n.geometry)?G(n.geometry,r):v.defined(n.westHemisphereGeometry)&&v.defined(n.eastHemisphereGeometry)&&(G(n.westHemisphereGeometry,r),G(n.eastHemisphereGeometry,r))}}(n),s)for(t=0;t<u;++t){var f=n[t];v.defined(f.geometry)?(b.GeometryPipeline.reorderForPostVertexCache(f.geometry),b.GeometryPipeline.reorderForPreVertexCache(f.geometry)):v.defined(f.westHemisphereGeometry)&&v.defined(f.eastHemisphereGeometry)&&(b.GeometryPipeline.reorderForPostVertexCache(f.westHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(f.westHemisphereGeometry),b.GeometryPipeline.reorderForPostVertexCache(f.eastHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(f.eastHemisphereGeometry))}var c=b.GeometryPipeline.combineInstances(n);for(u=c.length,t=0;t<u;++t){var m,h=(r=c[t]).attributes;if(a)for(m in h)h.hasOwnProperty(m)&&h[m].componentDatatype===k.ComponentDatatype.DOUBLE&&b.GeometryPipeline.encodeAttribute(r,m,m+"3DHigh",m+"3DLow");else for(m in h)if(h.hasOwnProperty(m)&&h[m].componentDatatype===k.ComponentDatatype.DOUBLE){var l=m+"3D",g=m+"2D";b.GeometryPipeline.projectTo2D(r,m,l,g,i),v.defined(r.boundingSphere)&&"position"===m&&(r.boundingSphereCV=P.BoundingSphere.fromVertices(r.attributes.position2D.values)),b.GeometryPipeline.encodeAttribute(r,l,l+"High",l+"Low"),b.GeometryPipeline.encodeAttribute(r,g,g+"High",g+"Low")}d&&b.GeometryPipeline.compressVertices(r)}if(!o){var y=[];for(u=c.length,t=0;t<u;++t)r=c[t],y=y.concat(b.GeometryPipeline.fitToUnsignedShortIndices(r));c=y}return c}function g(e,t,r,n){var i,o,a,s=n.length-1;if(0<=s){var d=n[s];i=d.offset+d.count,o=r[a=d.index].indices.length}else o=r[a=i=0].indices.length;for(var p=e.length,u=0;u<p;++u){var f=e[u][t];if(v.defined(f)){var c=f.indices.length;o<i+c&&(i=0,o=r[++a].indices.length),n.push({index:a,offset:i,count:c}),i+=c}}}Object.defineProperties(m.prototype,{componentDatatype:{get:function(){return k.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),m.fromCartesian3=function(e){return new m(e.x,e.y,e.z)},m.toValue=function(e,t){return v.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 h={};function i(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var i=r[n];v.defined(i)&&v.defined(i.values)&&t.push(i.values.buffer)}v.defined(e.indices)&&t.push(e.indices.buffer)}function o(e){var t=e.length,r=1+(P.BoundingSphere.packedLength+1)*t,n=new Float32Array(r),i=0;n[i++]=t;for(var o=0;o<t;++o){var a=e[o];v.defined(a)?(n[i++]=1,P.BoundingSphere.pack(e[o],n,i)):n[i++]=0,i+=P.BoundingSphere.packedLength}return n}function r(e){for(var t=new Arr