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

1 lines
5.8 KiB

define(["./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./GeometryAttribute-6f280ece","./GeometryAttributes-90846c5f","./IndexDatatype-354a5ea3","./IntersectionTests-8371bf29","./Plane-929e0674","./VertexFormat-cc24f342","./arrayRemoveDuplicates-4dfa28d2","./EllipsoidRhumbLine-8c93f67a","./EllipsoidGeodesic-19b1a191","./PolylinePipeline-d0f0e8fc","./WallGeometryLibrary-04578c7e"],function(Y,e,Z,j,K,t,a,Q,X,$,ee,i,r,p,n,o,s,m,te){"use strict";var ae=new j.Cartesian3,ie=new j.Cartesian3,re=new j.Cartesian3,ne=new j.Cartesian3,oe=new j.Cartesian3,se=new j.Cartesian3,me=new j.Cartesian3;function d(e){var t=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,a=e.maximumHeights,i=e.minimumHeights,r=Y.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT),n=Y.defaultValue(e.granularity,Z.CesiumMath.RADIANS_PER_DEGREE),o=Y.defaultValue(e.ellipsoid,j.Ellipsoid.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=a,this._vertexFormat=p.VertexFormat.clone(r),this._granularity=n,this._ellipsoid=j.Ellipsoid.clone(o),this._workerName="createWallGeometry";var s=1+t.length*j.Cartesian3.packedLength+2;Y.defined(i)&&(s+=i.length),Y.defined(a)&&(s+=a.length),this.packedLength=s+j.Ellipsoid.packedLength+p.VertexFormat.packedLength+1}d.pack=function(e,t,a){var i;a=Y.defaultValue(a,0);var r=e._positions,n=r.length;for(t[a++]=n,i=0;i<n;++i,a+=j.Cartesian3.packedLength)j.Cartesian3.pack(r[i],t,a);var o=e._minimumHeights;if(n=Y.defined(o)?o.length:0,t[a++]=n,Y.defined(o))for(i=0;i<n;++i)t[a++]=o[i];var s=e._maximumHeights;if(n=Y.defined(s)?s.length:0,t[a++]=n,Y.defined(s))for(i=0;i<n;++i)t[a++]=s[i];return j.Ellipsoid.pack(e._ellipsoid,t,a),a+=j.Ellipsoid.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),t[a+=p.VertexFormat.packedLength]=e._granularity,t};var c=j.Ellipsoid.clone(j.Ellipsoid.UNIT_SPHERE),f=new p.VertexFormat,y={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:c,vertexFormat:f,granularity:void 0};return d.unpack=function(e,t,a){var i;t=Y.defaultValue(t,0);var r,n,o=e[t++],s=new Array(o);for(i=0;i<o;++i,t+=j.Cartesian3.packedLength)s[i]=j.Cartesian3.unpack(e,t);if(0<(o=e[t++]))for(r=new Array(o),i=0;i<o;++i)r[i]=e[t++];if(0<(o=e[t++]))for(n=new Array(o),i=0;i<o;++i)n[i]=e[t++];var m=j.Ellipsoid.unpack(e,t,c);t+=j.Ellipsoid.packedLength;var l=p.VertexFormat.unpack(e,t,f),u=e[t+=p.VertexFormat.packedLength];return Y.defined(a)?(a._positions=s,a._minimumHeights=r,a._maximumHeights=n,a._ellipsoid=j.Ellipsoid.clone(m,a._ellipsoid),a._vertexFormat=p.VertexFormat.clone(l,a._vertexFormat),a._granularity=u,a):(y.positions=s,y.minimumHeights=r,y.maximumHeights=n,y.granularity=u,new d(y))},d.fromConstantHeights=function(e){var t,a,i=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,r=e.minimumHeight,n=e.maximumHeight,o=Y.defined(r),s=Y.defined(n);if(o||s){var m=i.length;t=o?new Array(m):void 0,a=s?new Array(m):void 0;for(var l=0;l<m;++l)o&&(t[l]=r),s&&(a[l]=n)}return new d({positions:i,maximumHeights:a,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},d.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,n=e._granularity,o=e._ellipsoid,s=te.WallGeometryLibrary.computePositions(o,t,i,a,n,!0);if(Y.defined(s)){var m,l=s.bottomPositions,u=s.topPositions,p=s.numCorners,d=u.length,c=2*d,f=r.position?new Float64Array(c):void 0,y=r.normal?new Float32Array(c):void 0,g=r.tangent?new Float32Array(c):void 0,h=r.bitangent?new Float32Array(c):void 0,v=r.st?new Float32Array(c/3*2):void 0,C=0,x=0,A=0,b=0,_=0,E=me,w=se,F=oe,L=!0,k=0,H=1/((d/=3)-p-1);for(m=0;m<d;++m){var V=3*m,G=j.Cartesian3.fromArray(u,V,ae),D=j.Cartesian3.fromArray(l,V,ie);if(r.position&&(f[C++]=D.x,f[C++]=D.y,f[C++]=D.z,f[C++]=G.x,f[C++]=G.y,f[C++]=G.z),r.st&&(v[_++]=k,v[_++]=0,v[_++]=k,v[_++]=1),r.normal||r.tangent||r.bitangent){var P=j.Cartesian3.clone(j.Cartesian3.ZERO,ne),T=j.Cartesian3.subtract(G,o.geodeticSurfaceNormal(G,ie),ie);if(m+1<d&&(P=j.Cartesian3.fromArray(u,3+V,ne)),L){var z=j.Cartesian3.subtract(P,G,re),O=j.Cartesian3.subtract(T,G,ae);E=j.Cartesian3.normalize(j.Cartesian3.cross(O,z,E),E),L=!1}j.Cartesian3.equalsEpsilon(G,P,Z.CesiumMath.EPSILON10)?L=!0:(k+=H,r.tangent&&(w=j.Cartesian3.normalize(j.Cartesian3.subtract(P,G,w),w)),r.bitangent&&(F=j.Cartesian3.normalize(j.Cartesian3.cross(E,w,F),F))),r.normal&&(y[x++]=E.x,y[x++]=E.y,y[x++]=E.z,y[x++]=E.x,y[x++]=E.y,y[x++]=E.z),r.tangent&&(g[b++]=w.x,g[b++]=w.y,g[b++]=w.z,g[b++]=w.x,g[b++]=w.y,g[b++]=w.z),r.bitangent&&(h[A++]=F.x,h[A++]=F.y,h[A++]=F.z,h[A++]=F.x,h[A++]=F.y,h[A++]=F.z)}}var R=new $.GeometryAttributes;r.position&&(R.position=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f})),r.normal&&(R.normal=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:y})),r.tangent&&(R.tangent=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:g})),r.bitangent&&(R.bitangent=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),r.st&&(R.st=new X.GeometryAttribute({componentDatatype:Q.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:v}));var S=c/3;c-=6*(p+1);var I=ee.IndexDatatype.createTypedArray(S,c),N=0;for(m=0;m<S-2;m+=2){var M=m,W=m+2,B=j.Cartesian3.fromArray(f,3*M,ae),U=j.Cartesian3.fromArray(f,3*W,ie);if(!j.Cartesian3.equalsEpsilon(B,U,Z.CesiumMath.EPSILON10)){var q=m+1,J=m+3;I[N++]=q,I[N++]=M,I[N++]=J,I[N++]=J,I[N++]=M,I[N++]=W}}return new X.Geometry({attributes:R,indices:I,primitiveType:X.PrimitiveType.TRIANGLES,boundingSphere:new K.BoundingSphere.fromVertices(f)})}},function(e,t){return Y.defined(t)&&(e=d.unpack(e,t)),e._ellipsoid=j.Ellipsoid.clone(e._ellipsoid),d.createGeometry(e)}});