2023-09-11 21:56:39 +08:00
|
|
|
define(["./when-b60132fc","./Cartesian2-47311507","./arrayRemoveDuplicates-d2f048c5","./BoundingRectangle-01b3e970","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./ComponentDatatype-c140a87d","./PolylineVolumeGeometryLibrary-3333255c","./Check-7b2a090c","./GeometryAttribute-3a42bbdc","./GeometryAttributes-252e9929","./GeometryPipeline-e1b82a4e","./IndexDatatype-8a5eead4","./Math-119be1a3","./buildModuleUrl-3addfe33","./PolygonPipeline-f49953b9","./PrimitiveType-39acab88","./VertexFormat-6446fca0","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./WebGLConstants-4ae0db90","./EllipsoidTangentPlane-b2b18d75","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./Transforms-cb0006b0","./FeatureDetection-c3b71206","./PolylinePipeline-971d8853","./EllipsoidGeodesic-0f19ac62","./EllipsoidRhumbLine-ed1a6bf4","./AttributeCompression-90851096","./EncodedCartesian3-f1396b05","./earcut-2.2.1-20c8012f"],(function(e,t,n,a,i,r,o,l,s,p,c,u,d,m,y,g,h,b,f,v,C,P,E,_,k,L,V,F,T,A,G,D){"use strict";function x(n){var a=(n=e.defaultValue(n,e.defaultValue.EMPTY_OBJECT)).polylinePositions,i=n.shapePositions;this._positions=a,this._shape=i,this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(n.ellipsoid,t.Ellipsoid.WGS84)),this._cornerType=e.defaultValue(n.cornerType,l.CornerType.ROUNDED),this._vertexFormat=b.VertexFormat.clone(e.defaultValue(n.vertexFormat,b.VertexFormat.DEFAULT)),this._granularity=e.defaultValue(n.granularity,m.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry",this.enuCenter=e.defaultValue(n.enuCenter,r.Cartesian3.ZERO);var o=1+a.length*r.Cartesian3.packedLength;o+=1+i.length*t.Cartesian2.packedLength+r.Cartesian3.packedLength,this.packedLength=o+t.Ellipsoid.packedLength+b.VertexFormat.packedLength+2}x.pack=function(n,a,i){var o;i=e.defaultValue(i,0);var l=n._positions,s=l.length;for(a[i++]=s,o=0;o<s;++o,i+=r.Cartesian3.packedLength)r.Cartesian3.pack(l[o],a,i);var p=n._shape;for(s=p.length,a[i++]=s,o=0;o<s;++o,i+=t.Cartesian2.packedLength)t.Cartesian2.pack(p[o],a,i);return t.Ellipsoid.pack(n._ellipsoid,a,i),i+=t.Ellipsoid.packedLength,b.VertexFormat.pack(n._vertexFormat,a,i),i+=b.VertexFormat.packedLength,a[i++]=n._cornerType,a[i++]=n._granularity,r.Cartesian3.pack(n.enuCenter,a,i),a};var w=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),R=new b.VertexFormat,O={polylinePositions:void 0,shapePositions:void 0,ellipsoid:w,vertexFormat:R,cornerType:void 0,granularity:void 0,enuCenter:void 0};x.unpack=function(n,a,i){var o;a=e.defaultValue(a,0);var l=n[a++],s=new Array(l);for(o=0;o<l;++o,a+=r.Cartesian3.packedLength)s[o]=r.Cartesian3.unpack(n,a);l=n[a++];var p=new Array(l);for(o=0;o<l;++o,a+=t.Cartesian2.packedLength)p[o]=t.Cartesian2.unpack(n,a);var c=t.Ellipsoid.unpack(n,a,w);a+=t.Ellipsoid.packedLength;var u=b.VertexFormat.unpack(n,a,R);a+=b.VertexFormat.packedLength;var d,m=n[a++],y=n[a++];return d=r.Cartesian3.unpack(n,a),e.defined(i)?(i._positions=s,i._shape=p,i._ellipsoid=t.Ellipsoid.clone(c,i._ellipsoid),i._vertexFormat=b.VertexFormat.clone(u,i._vertexFormat),i._cornerType=m,i._granularity=y,i.enuCenter=d,i):(O.polylinePositions=s,O.shapePositions=p,O.cornerType=m,O.granularity=y,O.enuCenter=d,new x(O))};var S=new a.BoundingRectangle;return x.createGeometry=function(t){for(var s=t._positions,m=n.arrayRemoveDuplicates(s,r.Cartesian3.equalsEpsilon),b=m.length,f=new Array(b),v=0;v<b;v++)f[v]=r.Cartesian3.clone(m[v]);var C=t._shape;if(C=l.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(C),!(m.length<2||C.length<3)){g.PolygonPipeline.computeWindingOrder2D(C)===g.WindingOrder.CLOCKWISE&&C.reverse();var P=a.BoundingRectangle.fromPoints(C,S),E={};if(E.combinedPositions=l.PolylineVolumeGeometryLibrary.computePositions(f,C,P,t,!0),!r.Cartesian3.equals(t.enuCenter,r.Cartesian3.ZERO)){var _=new Array(b);for(v=0;v<b;v++)_[v]=r.Cartesian3.clone(m[v]);E.combinedLocalPositions=l.PolylineVolumeGeometryLibrary.computeLocalPositions(_,C,P,t,!0,t.enuCenter)}return function(t,n,a,r){var l=t.combinedPositions,s=t.combinedLocalPositions,m=new c.GeometryAttributes;r.position&&(m.position=new p.GeometryAttribute(
|