数字孪生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
29 KiB

12 months ago
define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./ComponentDatatype-7ee14e67","./GeometryAttribute-6f280ece","./AttributeCompression-bb3dc748","./EncodedCartesian3-4930ae29","./IndexDatatype-354a5ea3","./IntersectionTests-8371bf29","./Plane-929e0674"],function(e,_,t,q,U,Y,M,G,P,l,w,Z,a){"use strict";var x=new U.Cartesian3,S=new U.Cartesian3,I=new U.Cartesian3;var s={calculateACMR:function(e){var t=(e=_.defaultValue(e,_.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=_.defaultValue(e.cacheSize,24),i=t.length;if(!_.defined(r))for(var n=r=0,s=t[n];n<i;)r<s&&(r=s),s=t[++n];for(var o=[],u=0;u<r+1;u++)o[u]=0;for(var p=a+1,d=0;d<i;++d)p-o[t[d]]>a&&(o[t[d]]=p,++p);return(p-a+1)/(i/3)}};s.tipsify=function(e){var v,t=(e=_.defaultValue(e,_.defaultValue.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=_.defaultValue(e.cacheSize,24);function i(e,t,r,a,i,n,s){for(var o,u=-1,p=-1,d=0;d<r.length;){var l=r[d];a[l].numLiveTriangles&&(o=0,i-a[l].timeStamp+2*a[l].numLiveTriangles<=t&&(o=i-a[l].timeStamp),(p<o||-1===p)&&(p=o,u=l)),++d}return-1===u?function(e,t,r,a){for(;1<=t.length;){var i=t[t.length-1];if(t.splice(t.length-1,1),0<e[i].numLiveTriangles)return i}for(;v<a;){if(0<e[v].numLiveTriangles)return++v-1;++v}return-1}(a,n,0,s):u}var n=t.length,s=0,o=0,u=t[o],p=n;if(_.defined(r))s=r+1;else{for(;o<p;)s<u&&(s=u),u=t[++o];if(-1===s)return 0;++s}var d,l=[];for(d=0;d<s;d++)l[d]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};for(var y=o=0;o<p;)l[t[o]].vertexTriangles.push(y),++l[t[o]].numLiveTriangles,l[t[o+1]].vertexTriangles.push(y),++l[t[o+1]].numLiveTriangles,l[t[o+2]].vertexTriangles.push(y),++l[t[o+2]].numLiveTriangles,++y,o+=3;var f=0,c=a+1;v=1;var m,C,h,b,g=[],A=[],T=0,x=[],P=n/3,w=[];for(d=0;d<P;d++)w[d]=!1;for(;-1!==f;){g=[],b=(C=l[f]).vertexTriangles.length;for(var S=0;S<b;++S)if(!w[y=C.vertexTriangles[S]]){w[y]=!0,o=y+y+y;for(var I=0;I<3;++I)h=t[o],g.push(h),A.push(h),x[T]=h,++T,--(m=l[h]).numLiveTriangles,c-m.timeStamp>a&&(m.timeStamp=c,++c),++o}f=i(0,a,g,l,c,A,s)}return x};var r={};function o(e,t,r,a,i){e[t++]=r,e[t++]=a,e[t++]=a,e[t++]=i,e[t++]=i,e[t]=r}function f(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&_.defined(e[r])&&_.defined(e[r].values)){var a=e[r];t[r]=new G.GeometryAttribute({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return t}function c(e,t,r){for(var a in t)if(t.hasOwnProperty(a)&&_.defined(t[a])&&_.defined(t[a].values))for(var i=t[a],n=0;n<i.componentsPerAttribute;++n)e[a].values.push(i.values[r*i.componentsPerAttribute+n])}r.toWireframe=function(e){var t=e.indices;if(_.defined(t)){switch(e.primitiveType){case G.PrimitiveType.TRIANGLES:e.indices=function(e){for(var t=e.length,r=t/3*6,a=w.IndexDatatype.createTypedArray(t,r),i=0,n=0;n<t;n+=3,i+=6)o(a,i,e[n],e[n+1],e[n+2]);return a}(t);break;case G.PrimitiveType.TRIANGLE_STRIP:e.indices=function(e){var t=e.length;if(3<=t){var r=6*(t-2),a=w.IndexDatatype.createTypedArray(t,r);o(a,0,e[0],e[1],e[2]);for(var i=6,n=3;n<t;++n,i+=6)o(a,i,e[n-1],e[n],e[n-2]);return a}return new Uint16Array}(t);break;case G.PrimitiveType.TRIANGLE_FAN:e.indices=function(e){if(0<e.length){for(var t=e.length-1,r=6*(t-1),a=w.IndexDatatype.createTypedArray(t,r),i=e[0],n=0,s=1;s<t;++s,n+=6)o(a,n,i,e[s],e[s+1]);return a}return new Uint16Array}(t)}e.primitiveType=G.PrimitiveType.LINES}return e},r.createLineSegmentsForVectors=function(e,t,r){t=_.defaultValue(t,"normal"),r=_.defaultValue(r,1e4);for(var a,i=e.attributes.position.values,n=e.attributes[t].values,s=i.length,o=new Float64Array(2*s),u=0,p=0;p<s;p+=3)o[u++]=i[p],o[u++]=i[p+1],o[u++]=i[p+2],o[u++]=i[p]+n[p]*r,o[u++]=i[p+1]+n[p+1]*r,o[u++]=i[p+2]+n[p+2]*r;var d=e.boundingSphere;return _.defined(d)&&(a=new Y.BoundingSphere(d.center,d.radius+r)),new G.Geometry({attributes:{position:new G.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o})},primitiveType:G.PrimitiveType.LINES,boundingSphere:a})},r.createAttributeLocations=function(e){var