bimland/public/Cesium/Workers/createPolylineGeometry.js

2 lines
7.4 KiB
JavaScript
Raw Normal View History

2023-07-26 17:04:38 +08:00
define(["./when-b60132fc","./Cartesian2-47311507","./ArcType-29cf2197","./arrayRemoveDuplicates-d2f048c5","./buildModuleUrl-4e1b81e7","./Cartographic-3309dd0d","./Color-5008547b","./ComponentDatatype-c140a87d","./Check-7b2a090c","./GeometryAttribute-3a88ba31","./GeometryAttributes-252e9929","./IndexDatatype-8a5eead4","./Math-119be1a3","./PolylinePipeline-2fe9092e","./PrimitiveType-a54dc62f","./VertexFormat-6446fca0","./Event-16a2dfbf","./RuntimeError-4a5c8994","./FeatureDetection-c3b71206","./WebGLConstants-4ae0db90","./Cartesian4-3ca25aab","./EllipsoidGeodesic-0f19ac62","./EllipsoidRhumbLine-ed1a6bf4","./IntersectionTests-7386ffbf","./Plane-7ae8294c"],(function(e,t,r,a,o,i,n,l,s,p,d,c,u,y,f,m,h,v,C,_,A,g,b,E,w){"use strict";var P=[];function T(e,t,r,a,o){var i,l=P;l.length=o;var s=r.red,p=r.green,d=r.blue,c=r.alpha,u=a.red,y=a.green,f=a.blue,m=a.alpha;if(n.Color.equals(r,a)){for(i=0;i<o;i++)l[i]=n.Color.clone(r);return l}var h=(u-s)/o,v=(y-p)/o,C=(f-d)/o,_=(m-c)/o;for(i=0;i<o;i++)l[i]=new n.Color(s+i*h,p+i*v,d+i*C,c+i*_);return l}function x(a){var l,s,p=(a=e.defaultValue(a,e.defaultValue.EMPTY_OBJECT)).positions,d=a.colors,c=e.defaultValue(a.width,1),y=e.defaultValue(a.hMax,-1),f=e.defaultValue(a.colorsPerVertex,!1);this._positions=p,this._colors=d,this._width=c,this._hMax=y,this._colorsPerVertex=f,this._dist=a.dist,this._period=a.period,this._vertexFormat=m.VertexFormat.clone(e.defaultValue(a.vertexFormat,m.VertexFormat.DEFAULT)),this._followSurface=e.defaultValue(a.followSurface,!0),e.defined(a.followSurface)&&(l="PolylineGeometry.followSurface",s="PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.55. Use PolylineGeometry.arcType instead.",o.oneTimeWarning(l,s),a.arcType=a.followSurface?r.ArcType.GEODESIC:r.ArcType.NONE),this._arcType=e.defaultValue(a.arcType,r.ArcType.GEODESIC),this._followSurface=this._arcType!==r.ArcType.NONE,this._granularity=e.defaultValue(a.granularity,u.CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=t.Ellipsoid.clone(e.defaultValue(a.ellipsoid,t.Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";var h=1+p.length*i.Cartesian3.packedLength;h+=e.defined(d)?1+d.length*n.Color.packedLength:1,this.packedLength=h+t.Ellipsoid.packedLength+m.VertexFormat.packedLength+4+2}x.pack=function(r,a,o){var l;o=e.defaultValue(o,0);var s=r._positions,p=s.length;for(a[o++]=p,l=0;l<p;++l,o+=i.Cartesian3.packedLength)i.Cartesian3.pack(s[l],a,o);var d=r._colors;for(p=e.defined(d)?d.length:0,a[o++]=p,l=0;l<p;++l,o+=n.Color.packedLength)n.Color.pack(d[l],a,o);return t.Ellipsoid.pack(r._ellipsoid,a,o),o+=t.Ellipsoid.packedLength,m.VertexFormat.pack(r._vertexFormat,a,o),o+=m.VertexFormat.packedLength,a[o++]=r._width,a[o++]=r._colorsPerVertex?1:0,a[o++]=r._arcType,a[o++]=r._granularity,a[o++]=r._hMax,a[o++]=r._dist,a[o]=r._period,a};var D=t.Ellipsoid.clone(t.Ellipsoid.UNIT_SPHERE),k=new m.VertexFormat,G={positions:void 0,colors:void 0,ellipsoid:D,vertexFormat:k,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};x.unpack=function(r,a,o){var l;a=e.defaultValue(a,0);var s=r[a++],p=new Array(s);for(l=0;l<s;++l,a+=i.Cartesian3.packedLength)p[l]=i.Cartesian3.unpack(r,a);var d=(s=r[a++])>0?new Array(s):void 0;for(l=0;l<s;++l,a+=n.Color.packedLength)d[l]=n.Color.unpack(r,a);var c=t.Ellipsoid.unpack(r,a,D);a+=t.Ellipsoid.packedLength;var u=m.VertexFormat.unpack(r,a,k);a+=m.VertexFormat.packedLength;var y=r[a++],f=1===r[a++],h=r[a++],v=r[a++],C=r[a++],_=1==r[a++],A=r[a];return e.defined(o)?(o._positions=p,o._colors=d,o._ellipsoid=t.Ellipsoid.clone(c,o._ellipsoid),o._vertexFormat=m.VertexFormat.clone(u,o._vertexFormat),o._width=y,o._colorsPerVertex=f,o._arcType=h,o._granularity=v,o._hMax=C,o._dist=_,o._period=A,o):(G.positions=p,G.colors=d,G.width=y,G.colorsPerVertex=f,G.arcType=h,G.granularity=v,G.hMax=C,G.dist=_,G.period=A,new x(G))};var V=new i.Cartesian3,F=new i.Cartesian3,L=new i.Cartesian3,S=new i.Cartesian3;return x.createGeometry=function(t){var s,m,h,v=t._width,C=t._hMax,_=t._vertexFormat,A=t._colors,g=t._colorsPerVertex,b=t._arcType,E=t._granularity,w=t._ellipsoid,x=t