1 |
- define(["exports","./when-54c2dc71","./Math-fc8cecf5","./Cartesian2-bddc1162","./arrayRemoveDuplicates-ebc732b0","./PolylinePipeline-8a1a1e4f"],function(e,P,A,C,w,b){"use strict";var i={};var M=new C.Cartographic,E=new C.Cartographic;function F(e,i,t,r){var a=(i=w.arrayRemoveDuplicates(i,C.Cartesian3.equalsEpsilon)).length;if(!(a<2)){var n=P.defined(r),o=P.defined(t),l=new Array(a),s=new Array(a),h=new Array(a),g=i[0];l[0]=g;var c=e.cartesianToCartographic(g,M);o&&(c.height=t[0]),s[0]=c.height,h[0]=n?r[0]:0;for(var p,u,d=s[0]===h[0],v=1,y=1;y<a;++y){var f=i[y],m=e.cartesianToCartographic(f,E);o&&(m.height=t[y]),d=d&&0===m.height,p=c,u=m,A.CesiumMath.equalsEpsilon(p.latitude,u.latitude,A.CesiumMath.EPSILON10)&&A.CesiumMath.equalsEpsilon(p.longitude,u.longitude,A.CesiumMath.EPSILON10)?c.height<m.height&&(s[v-1]=m.height):(l[v]=f,s[v]=m.height,h[v]=n?r[y]:0,d=d&&s[v]===h[v],C.Cartographic.clone(m,c),++v)}if(!(d||v<2))return l.length=v,s.length=v,h.length=v,{positions:l,topHeights:s,bottomHeights:h}}}var H=new Array(2),L=new Array(2),q={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};i.computePositions=function(e,i,t,r,a,n){var o=F(e,i,t,r);if(P.defined(o)){i=o.positions,t=o.topHeights,r=o.bottomHeights;var l,s,h=i.length,g=h-2,c=A.CesiumMath.chordLength(a,e.maximumRadius),p=q;if(p.minDistance=c,p.ellipsoid=e,n){for(var u=0,d=0;d<h-1;d++)u+=b.PolylinePipeline.numberOfPoints(i[d],i[d+1],c)+1;l=new Float64Array(3*u),s=new Float64Array(3*u);var v=H,y=L;p.positions=v,p.height=y;var f=0;for(d=0;d<h-1;d++){v[0]=i[d],v[1]=i[d+1],y[0]=t[d],y[1]=t[d+1];var m=b.PolylinePipeline.generateArc(p);l.set(m,f),y[0]=r[d],y[1]=r[d+1],s.set(b.PolylinePipeline.generateArc(p),f),f+=m.length}}else p.positions=i,p.height=t,l=new Float64Array(b.PolylinePipeline.generateArc(p)),p.height=r,s=new Float64Array(b.PolylinePipeline.generateArc(p));return{bottomPositions:s,topPositions:l,numCorners:g}}},e.WallGeometryLibrary=i});
|