1 |
- define(["./arrayRemoveDuplicates-f7eaafa2","./BoundingRectangle-418864a2","./buildModuleUrl-3d15f25c","./Cartesian2-6033fa5d","./Cartographic-67e73ef9","./Check-52a7d806","./ComponentDatatype-81047f82","./CoplanarPolygonGeometryLibrary-db52cfeb","./when-92c6cf3c","./Rectangle-bab7abf0","./GeometryAttribute-ef657318","./GeometryAttributes-7f66ea53","./GeometryInstance-da5e91bc","./GeometryPipeline-f4eddf07","./IndexDatatype-4c0e98b8","./Math-92c3b5f7","./PrimitiveType-cdfe443e","./PolygonGeometryLibrary-7c66403e","./PolygonPipeline-b86e8785","./VertexFormat-f496a3f1","./Intersect-b97e930a","./Event-3390cd7d","./RuntimeError-c6a62a80","./WebGLConstants-71f10989","./OrientedBoundingBox-513cf61d","./Cartesian4-ad128b5d","./EllipsoidTangentPlane-53184efd","./IntersectionTests-a42760d9","./Plane-f8d22530","./Buffer-1d0f8963","./RenderState-94064c70","./Color-45274500","./FeatureDetection-067cb23c","./WindingOrder-1b9c8a87","./AttributeCompression-49f7b62a","./EncodedCartesian3-b86c8d65","./ArcType-31298545","./EllipsoidRhumbLine-8847d1a1"],(function(e,t,n,o,a,r,i,c,p,s,l,y,d,u,g,m,f,v,h,b,w,A,P,x,T,D,F,_,k,L,E,C,R,I,H,G,O,B){"use strict";var z=new a.t,S=new t.f,N=new o.o,j=new o.o,M=new a.t,U=new a.t,V=new a.t,W=new a.t,Y=new a.t,q=new a.t,J=new l.n,Q=new f.p,Z=new f.p,K=new a.t;function X(e,t,n,r,c,p,s,d){var u=e.positions,v=h.A.triangulate(e.positions2D,e.holes);v.length<3&&(v=[0,1,2]);var b=g.IndexDatatype.createTypedArray(u.length,v.length);b.set(v);var w=Q;if(0!==r){var A=l.n.fromAxisAngle(p,r,J);if(w=f.p.fromQuaternion(A,w),t.tangent||t.bitangent){A=l.n.fromAxisAngle(p,-r,J);var P=f.p.fromQuaternion(A,Z);s=a.t.normalize(f.p.multiplyByVector(P,s,s),s),t.bitangent&&(d=a.t.normalize(a.t.cross(p,s,d),d))}}else w=f.p.clone(f.p.IDENTITY,w);var x=j;t.st&&(x.x=n.x,x.y=n.y);for(var T=u.length,D=3*T,F=new Float64Array(D),_=t.normal?new Float32Array(D):void 0,k=t.tangent?new Float32Array(D):void 0,L=t.bitangent?new Float32Array(D):void 0,E=t.st?new Float32Array(2*T):void 0,C=0,R=0,I=0,H=0,G=0,O=0;O<T;O++){var B=u[O];if(F[C++]=B.x,F[C++]=B.y,F[C++]=B.z,t.st){var S=c(f.p.multiplyByVector(w,B,z),N);o.o.subtract(S,x,S);var M=m.e.clamp(S.x/n.width,0,1),U=m.e.clamp(S.y/n.height,0,1);E[G++]=M,E[G++]=U}t.normal&&(_[R++]=p.x,_[R++]=p.y,_[R++]=p.z),t.tangent&&(k[H++]=s.x,k[H++]=s.y,k[H++]=s.z),t.bitangent&&(L[I++]=d.x,L[I++]=d.y,L[I++]=d.z)}var V=new y.a;return t.position&&(V.position=new l.o({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:F})),t.normal&&(V.normal=new l.o({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:_})),t.tangent&&(V.tangent=new l.o({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:k})),t.bitangent&&(V.bitangent=new l.o({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),t.st&&(V.st=new l.o({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:E})),new l.I({attributes:V,indices:b,primitiveType:f._0x29ba75.TRIANGLES})}function $(e){var t=(e=p.u(e,p.u.EMPTY_OBJECT)).polygonHierarchy;r.o.defined("options.polygonHierarchy",t);var n=p.u(e.vertexFormat,b.n.DEFAULT);this._vertexFormat=b.n.clone(n),this._polygonHierarchy=t,this._stRotation=p.u(e.stRotation,0),this._ellipsoid=s.t.clone(p.u(e.ellipsoid,s.t.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=v.y.computeHierarchyPackedLength(t)+b.n.packedLength+s.t.packedLength+2}$.fromPositions=function(e){return e=p.u(e,p.u.EMPTY_OBJECT),r.o.defined("options.positions",e.positions),new $({polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},$.pack=function(e,t,n){return r.o.typeOf.object("value",e),r.o.defined("array",t),n=p.u(n,0),n=v.y.packPolygonHierarchy(e._polygonHierarchy,t,n),s.t.pack(e._ellipsoid,t,n),n+=s.t.packedLength,b.n.pack(e._vertexFormat,t,n),n+=b.n.packedLength,t[n++]=e._stRotation,t[n]=e.packedLength,t};var ee=s.t.clone(s.t.UNIT_SPHERE),te=new b.n,ne={polygonHierarchy:{}};return $.unpack=function(e,t,n){r.o.defined("array",e),t=p.u(t,0);var o=v.y.unpackPolygonHierarchy(e,t);t=o.startingIndex,delete o.startingIndex;var a=s.t.unpack(e,t,ee);t+=s.t.packedLength;var i=b.n.unpack(e,t,te);t+=b.n.packedLength;var c=e[t++],l=e[t];return p.e(n)||(n=new $(ne)),n._polygonHierarchy=o,n._ellipsoid=s.t.clone(a,n._ellipsoid),n._vertexFormat=b.n.clone(i,n._vertexFormat),n._stRotation=c,n.packedLength=l,n},$.createGeometry=function(t){var o=t._vertexFormat,r=t._polygonHierarchy,i=t._stRotation,p=r.positions;if(!((p=e.D(p,a.t.equalsEpsilon,!0)).length<3)){var s=M,y=U,f=V,h=Y,b=q;if(c.g.computeProjectTo2DArguments(p,W,h,b)){if(s=a.t.cross(h,b,s),s=a.t.normalize(s,s),!a.t.equalsEpsilon(W,a.t.ZERO,m.e.EPSILON6)){var w=t._ellipsoid.geodeticSurfaceNormal(W,K);a.t.dot(s,w)<0&&(s=a.t.negate(s,s),h=a.t.negate(h,h))}var A=c.g.createProjectPointsTo2DFunction(W,h,b),P=c.g.createProjectPointTo2DFunction(W,h,b);o.tangent&&(y=a.t.clone(h,y)),o.bitangent&&(f=a.t.clone(b,f));var x=v.y.polygonsFromHierarchy(r,A,!1),T=x.hierarchy,D=x.polygons;if(0!==T.length){p=T[0].outerRing;for(var F=n.i.fromPoints(p),_=v.y.computeBoundingRectangle(s,P,p,i,S),k=[],L=0;L<D.length;L++){var E=new d.d({geometry:X(D[L],o,_,i,P,s,y,f)});k.push(E)}var C=u.k.combineInstances(k)[0];C.attributes.position.values=new Float64Array(C.attributes.position.values),C.indices=g.IndexDatatype.createTypedArray(C.attributes.position.values.length/3,C.indices);var R=C.attributes;return o.position||delete R.position,new l.I({attributes:R,indices:C.indices,primitiveType:C.primitiveType,boundingSphere:F})}}}},function(e,t){return p.e(t)&&(e=$.unpack(e,t)),$.createGeometry(e)}}));
|