UNPKG

cong-gis-viewer

Version:

The minimal recommended setup for an app using Cesium with Webpack 5

2 lines 3.51 kB
/*! For license information please see createPolylineVolumeOutlineGeometry.js.LICENSE.txt */ import{a as w}from"./chunk-6W2TVXDY.js";import{a as N,b as E}from"./chunk-S6F2UFMI.js";import"./chunk-A3LWLQUH.js";import"./chunk-T2PCUASF.js";import"./chunk-ZS2W345Z.js";import"./chunk-XS3SI335.js";import{a as v,b as G}from"./chunk-NXJBWKCJ.js";import{a as q}from"./chunk-QG27EHKP.js";import"./chunk-XTD56O4T.js";import"./chunk-MQA5R2TD.js";import"./chunk-BNIMZJFI.js";import{a as k}from"./chunk-UENNBKKY.js";import{a as O}from"./chunk-ZV2BSYVW.js";import{b as A,c as R,d as S}from"./chunk-3WTHA73F.js";import{d as C}from"./chunk-MEAQKBL7.js";import"./chunk-RKBLQ2M4.js";import{a as b}from"./chunk-K3VQHMI6.js";import{a,c as _,d as s}from"./chunk-UTRPTI5S.js";import{a as D}from"./chunk-TFNGIACM.js";import"./chunk-ISVCOS3X.js";import"./chunk-XUAQFAMT.js";import{a as d}from"./chunk-OW23VKVW.js";import{a as y}from"./chunk-LKAZ42NI.js";import{e as u}from"./chunk-MYHWD27O.js";function W(e,o){let r=new O;r.position=new S({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:e});let i,t,n=o.length,s=r.position.values.length/3,a=e.length/3/n,p=k.createTypedArray(s,2*n*(a+1)),u=0;i=0;let c=i*n;for(t=0;t<n-1;t++)p[u++]=t+c,p[u++]=t+c+1;for(p[u++]=n-1+c,p[u++]=c,i=a-1,c=i*n,t=0;t<n-1;t++)p[u++]=t+c,p[u++]=t+c+1;for(p[u++]=n-1+c,p[u++]=c,i=0;i<a-1;i++){let e=n*i,o=e+n;for(t=0;t<n;t++)p[u++]=t+e,p[u++]=t+o}return new R({attributes:r,indices:k.createTypedArray(s,p),boundingSphere:C.fromVertices(e),primitiveType:A.LINES})}function g(e){let o=(e=d(e,d.EMPTY_OBJECT)).polylinePositions,r=e.shapePositions;if(!u(o))throw new y("options.polylinePositions is required.");if(!u(r))throw new y("options.shapePositions is required.");this._positions=o,this._shape=r,this._ellipsoid=s.clone(d(e.ellipsoid,s.default)),this._cornerType=d(e.cornerType,N.ROUNDED),this._granularity=d(e.granularity,D.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+o.length*a.packedLength;i+=1+r.length*_.packedLength,this.packedLength=i+s.packedLength+2}g.pack=function(e,o,r){if(!u(e))throw new y("value is required");if(!u(o))throw new y("array is required");r=d(r,0);let i,t=e._positions,n=t.length;for(o[r++]=n,i=0;i<n;++i,r+=a.packedLength)a.pack(t[i],o,r);let p=e._shape;for(n=p.length,o[r++]=n,i=0;i<n;++i,r+=_.packedLength)_.pack(p[i],o,r);return s.pack(e._ellipsoid,o,r),r+=s.packedLength,o[r++]=e._cornerType,o[r]=e._granularity,o};var B=s.clone(s.UNIT_SPHERE),P={polylinePositions:void 0,shapePositions:void 0,ellipsoid:B,height:void 0,cornerType:void 0,granularity:void 0};g.unpack=function(e,o,r){if(!u(e))throw new y("array is required");o=d(o,0);let i,t=e[o++],n=new Array(t);for(i=0;i<t;++i,o+=a.packedLength)n[i]=a.unpack(e,o);t=e[o++];let p=new Array(t);for(i=0;i<t;++i,o+=_.packedLength)p[i]=_.unpack(e,o);let c=s.unpack(e,o,B);o+=s.packedLength;let h=e[o++],l=e[o];return u(r)?(r._positions=n,r._shape=p,r._ellipsoid=s.clone(c,r._ellipsoid),r._cornerType=h,r._granularity=l,r):(P.polylinePositions=n,P.shapePositions=p,P.cornerType=h,P.granularity=l,new g(P))};var M=new w;g.createGeometry=function(e){let o=e._positions,r=q(o,a.equalsEpsilon),i=e._shape;if(i=E.removeDuplicatesFromShape(i),r.length<2||i.length<3)return;G.computeWindingOrder2D(i)===v.CLOCKWISE&&i.reverse();let t=w.fromPoints(i,M);return W(E.computePositions(r,i,t,e,!1),i)};var L=g;function j(e,o){return u(o)&&(e=L.unpack(e,o)),e._ellipsoid=s.clone(e._ellipsoid),L.createGeometry(e)}var he=j;export{he as default};