4x/irrigation-monitoring-platf.../public/Cesium/Workers/createPolygonOutlineGeometr...

2 lines
7.2 KiB
JavaScript
Raw Permalink Normal View History

2024-12-26 19:24:07 +08:00
define(["./when-4bbc8319","./Matrix2-9aa31791","./ArcType-98ec98bf","./GeometryOffsetAttribute-1772960d","./Transforms-d13cc04e","./RuntimeError-346a3079","./ComponentDatatype-93750d1a","./EllipsoidTangentPlane-eecce7e8","./GeometryAttribute-43536dc0","./GeometryAttributes-7827a6c2","./GeometryInstance-47b34185","./GeometryPipeline-b1a36b18","./IndexDatatype-b7d979a6","./PolygonGeometryLibrary-db856445","./PolygonPipeline-da7fc5ca","./combine-83860057","./WebGLConstants-1c8239cc","./AxisAlignedBoundingBox-07c6b7f2","./IntersectionTests-96a04219","./Plane-318d6937","./AttributeCompression-af389d04","./EncodedCartesian3-f286cedc","./arrayRemoveDuplicates-18786327","./EllipsoidRhumbLine-30c47ff4"],(function(e,t,i,r,o,n,a,l,s,y,u,p,d,c,g,f,m,h,b,P,v,E,A,_){"use strict";var G=[],L=[];function T(e,t,r,o,n){var p,f,m=l.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,G);g.PolygonPipeline.computeWindingOrder2D(m)===g.WindingOrder.CLOCKWISE&&(m.reverse(),t=t.slice().reverse());var h=t.length,b=0;if(o)for(p=new Float64Array(2*h*3),f=0;f<h;f++){var P=t[f],v=t[(f+1)%h];p[b++]=P.x,p[b++]=P.y,p[b++]=P.z,p[b++]=v.x,p[b++]=v.y,p[b++]=v.z}else{var E=0;if(n===i.ArcType.GEODESIC)for(f=0;f<h;f++)E+=c.PolygonGeometryLibrary.subdivideLineCount(t[f],t[(f+1)%h],r);else if(n===i.ArcType.RHUMB)for(f=0;f<h;f++)E+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[f],t[(f+1)%h],r);for(p=new Float64Array(3*E),f=0;f<h;f++){var A;n===i.ArcType.GEODESIC?A=c.PolygonGeometryLibrary.subdivideLine(t[f],t[(f+1)%h],r,L):n===i.ArcType.RHUMB&&(A=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[f],t[(f+1)%h],r,L));for(var _=A.length,T=0;T<_;++T)p[b++]=A[T]}}var H=2*(h=p.length/3),O=d.IndexDatatype.createTypedArray(h,H);for(b=0,f=0;f<h-1;f++)O[b++]=f,O[b++]=f+1;return O[b++]=h-1,O[b++]=0,new u.GeometryInstance({geometry:new s.Geometry({attributes:new y.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p})}),indices:O,primitiveType:s.PrimitiveType.LINES})})}function H(e,t,r,o,n){var p,f,m=l.EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,G);g.PolygonPipeline.computeWindingOrder2D(m)===g.WindingOrder.CLOCKWISE&&(m.reverse(),t=t.slice().reverse());var h=t.length,b=new Array(h),P=0;if(o)for(p=new Float64Array(2*h*3*2),f=0;f<h;++f){b[f]=P/3;var v=t[f],E=t[(f+1)%h];p[P++]=v.x,p[P++]=v.y,p[P++]=v.z,p[P++]=E.x,p[P++]=E.y,p[P++]=E.z}else{var A=0;if(n===i.ArcType.GEODESIC)for(f=0;f<h;f++)A+=c.PolygonGeometryLibrary.subdivideLineCount(t[f],t[(f+1)%h],r);else if(n===i.ArcType.RHUMB)for(f=0;f<h;f++)A+=c.PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[f],t[(f+1)%h],r);for(p=new Float64Array(3*A*2),f=0;f<h;++f){var _;b[f]=P/3,n===i.ArcType.GEODESIC?_=c.PolygonGeometryLibrary.subdivideLine(t[f],t[(f+1)%h],r,L):n===i.ArcType.RHUMB&&(_=c.PolygonGeometryLibrary.subdivideRhumbLine(e,t[f],t[(f+1)%h],r,L));for(var T=_.length,H=0;H<T;++H)p[P++]=_[H]}}h=p.length/6;var O=b.length,x=2*(2*h+O),C=d.IndexDatatype.createTypedArray(h+O,x);for(P=0,f=0;f<h;++f)C[P++]=f,C[P++]=(f+1)%h,C[P++]=f+h,C[P++]=(f+1)%h+h;for(f=0;f<O;f++){var D=b[f];C[P++]=D,C[P++]=D+h}return new u.GeometryInstance({geometry:new s.Geometry({attributes:new y.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p})}),indices:C,primitiveType:s.PrimitiveType.LINES})})}function O(r){var o=r.polygonHierarchy,n=e.defaultValue(r.ellipsoid,t.Ellipsoid.WGS84),l=e.defaultValue(r.granularity,a.CesiumMath.RADIANS_PER_DEGREE),s=e.defaultValue(r.perPositionHeight,!1),y=s&&e.defined(r.extrudedHeight),u=e.defaultValue(r.arcType,i.ArcType.GEODESIC),p=e.defaultValue(r.height,0),d=e.defaultValue(r.extrudedHeight,p);if(!y){var g=Math.max(p,d);d=Math.min(p,d),p=g}this._ellipsoid=t.Ellipsoid.clone(n),this._granularity=l,this._height=p,this._extrudedHeight=d,this._arcType=u,this._polygonHierarchy=o,this._perPositionHeight=s,this._perPositionHeightExtrude=y,this._offsetAttribute=r.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLe