learning_cesium/Build168/Cesium/Workers/createPolylineVolumeGeometr...

2 lines
5.7 KiB
JavaScript
Raw Normal View History

2024-03-19 18:06:25 +08:00
define(["./when-c2e8ef35","./Check-c4f3a3fc","./Math-d30358ed","./Cartesian2-e875d9d2","./Transforms-44592b02","./RuntimeError-6122571f","./WebGLConstants-4ae0db90","./ComponentDatatype-5d3f6452","./GeometryAttribute-4098b8de","./GeometryAttributes-57608efc","./AttributeCompression-6cb5b251","./GeometryPipeline-99c06fbd","./EncodedCartesian3-e19aab62","./IndexDatatype-e3260434","./IntersectionTests-ef7d18d8","./Plane-2d882f9f","./VertexFormat-ad523db1","./arrayRemoveDuplicates-a580a060","./BoundingRectangle-8481a283","./EllipsoidTangentPlane-30395e74","./EllipsoidRhumbLine-5134246a","./PolygonPipeline-84f0d07f","./PolylineVolumeGeometryLibrary-6dcd44cb","./EllipsoidGeodesic-19bdf744","./PolylinePipeline-3852f7d2"],function(u,e,i,c,G,t,n,A,R,D,r,I,a,O,o,l,g,s,d,p,y,S,m,h,f){"use strict";var v={};function B(e,t){u.defined(v[e])||(v[e]=!0,console.warn(u.defaultValue(t,e)))}function b(e){var t=(e=u.defaultValue(e,u.defaultValue.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=c.Ellipsoid.clone(u.defaultValue(e.ellipsoid,c.Ellipsoid.WGS84)),this._cornerType=u.defaultValue(e.cornerType,m.CornerType.ROUNDED),this._vertexFormat=g.VertexFormat.clone(u.defaultValue(e.vertexFormat,g.VertexFormat.DEFAULT)),this._granularity=u.defaultValue(e.granularity,i.CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var r=1+t.length*c.Cartesian3.packedLength;r+=1+n.length*c.Cartesian2.packedLength,this.packedLength=r+c.Ellipsoid.packedLength+g.VertexFormat.packedLength+2}B.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",B.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",B.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",B.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",b.pack=function(e,t,n){var r;n=u.defaultValue(n,0);var i=e._positions,a=i.length;for(t[n++]=a,r=0;r<a;++r,n+=c.Cartesian3.packedLength)c.Cartesian3.pack(i[r],t,n);var o=e._shape;for(a=o.length,t[n++]=a,r=0;r<a;++r,n+=c.Cartesian2.packedLength)c.Cartesian2.pack(o[r],t,n);return c.Ellipsoid.pack(e._ellipsoid,t,n),n+=c.Ellipsoid.packedLength,g.VertexFormat.pack(e._vertexFormat,t,n),n+=g.VertexFormat.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var E=c.Ellipsoid.clone(c.Ellipsoid.UNIT_SPHERE),P=new g.VertexFormat,_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:E,vertexFormat:P,cornerType:void 0,granularity:void 0};b.unpack=function(e,t,n){var r;t=u.defaultValue(t,0);var i=e[t++],a=new Array(i);for(r=0;r<i;++r,t+=c.Cartesian3.packedLength)a[r]=c.Cartesian3.unpack(e,t);i=e[t++];var o=new Array(i);for(r=0;r<i;++r,t+=c.Cartesian2.packedLength)o[r]=c.Cartesian2.unpack(e,t);var l=c.Ellipsoid.unpack(e,t,E);t+=c.Ellipsoid.packedLength;var s=g.VertexFormat.unpack(e,t,P);t+=g.VertexFormat.packedLength;var d=e[t++],p=e[t];return u.defined(n)?(n._positions=a,n._shape=o,n._ellipsoid=c.Ellipsoid.clone(l,n._ellipsoid),n._vertexFormat=g.VertexFormat.clone(s,n._vertexFormat),n._cornerType=d,n._granularity=p,n):(_.polylinePositions=a,_.shapePositions=o,_.cornerType=d,_.granularity=p,new b(_))};var x=new d.BoundingRectangle;return b.createGeometry=function(e){var t=e._positions,n=s.arrayRemoveDuplicates(t,c.Cartesian3.equalsEpsilon),r=e._shape;if(r=m.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(r),!(n.length<2||r.length<3)){S.PolygonPipeline.computeWindingOrder2D(r)===S.WindingOrder.CLOCKWISE&&r.reverse();var i=d.BoundingRectangle.fromPoints(r,x);return function(e,t,n,r){var i=new D.GeometryAttributes;r.position&&(i.position=new R.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values