2 lines
6.1 KiB
JavaScript
2 lines
6.1 KiB
JavaScript
|
/* 2020-9-22 15:23:26 | 版权所有 军懋国兴 */
|
||
|
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-69007a69","./Cartesian2-43e3a3be","./Transforms-2d1ac5ec","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-607c9a0c","./GeometryAttribute-2303bbfb","./GeometryAttributes-90846c5f","./IndexDatatype-79bb407c","./GeometryOffsetAttribute-9c676324","./EllipsoidRhumbLine-357c11e7","./PolygonPipeline-2ee85025","./RectangleGeometryLibrary-f62aa487"],function(h,c,y,d,m,e,t,E,A,w,G,b,i,R,P){"use strict";var _=new m.BoundingSphere,v=new m.BoundingSphere,D=new d.Cartesian3,L=new d.Rectangle;function C(e,t){var i=e._ellipsoid,r=t.height,a=t.width,n=t.northCap,o=t.southCap,l=r,u=2,s=0,c=4;n&&(--u,--l,s+=1,c-=2),o&&(--u,--l,s+=1,c-=2),s+=u*a+2*l-c;var d,p=new Float64Array(3*s),f=0,g=0,h=D;if(n)P.RectangleGeometryLibrary.computePosition(t,i,!1,g,0,h),p[f++]=h.x,p[f++]=h.y,p[f++]=h.z;else for(d=0;d<a;d++)P.RectangleGeometryLibrary.computePosition(t,i,!1,g,d,h),p[f++]=h.x,p[f++]=h.y,p[f++]=h.z;for(d=a-1,g=1;g<r;g++)P.RectangleGeometryLibrary.computePosition(t,i,!1,g,d,h),p[f++]=h.x,p[f++]=h.y,p[f++]=h.z;if(g=r-1,!o)for(d=a-2;0<=d;d--)P.RectangleGeometryLibrary.computePosition(t,i,!1,g,d,h),p[f++]=h.x,p[f++]=h.y,p[f++]=h.z;for(d=0,g=r-2;0<g;g--)P.RectangleGeometryLibrary.computePosition(t,i,!1,g,d,h),p[f++]=h.x,p[f++]=h.y,p[f++]=h.z;for(var y=p.length/3*2,m=G.IndexDatatype.createTypedArray(p.length/3,y),b=0,_=0;_<p.length/3-1;_++)m[b++]=_,m[b++]=_+1;m[b++]=p.length/3-1,m[b++]=0;var v=new A.Geometry({attributes:new w.GeometryAttributes,primitiveType:A.PrimitiveType.LINES});return v.attributes.position=new A.GeometryAttribute({componentDatatype:E.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:p}),v.indices=m,v}function p(e){var t=(e=h.defaultValue(e,h.defaultValue.EMPTY_OBJECT)).rectangle,i=h.defaultValue(e.granularity,y.CesiumMath.RADIANS_PER_DEGREE),r=h.defaultValue(e.ellipsoid,d.Ellipsoid.WGS84),a=h.defaultValue(e.rotation,0);if(!h.defined(t))throw new c.DeveloperError("rectangle is required.");if(d.Rectangle.validate(t),t.north<t.south)throw new c.DeveloperError("options.rectangle.north must be greater than options.rectangle.south");var n=h.defaultValue(e.height,0),o=h.defaultValue(e.extrudedHeight,n);this._rectangle=d.Rectangle.clone(t),this._granularity=i,this._ellipsoid=r,this._surfaceHeight=Math.max(n,o),this._rotation=a,this._extrudedHeight=Math.min(n,o),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}p.packedLength=d.Rectangle.packedLength+d.Ellipsoid.packedLength+5,p.pack=function(e,t,i){if(!h.defined(e))throw new c.DeveloperError("value is required");if(!h.defined(t))throw new c.DeveloperError("array is required");return i=h.defaultValue(i,0),d.Rectangle.pack(e._rectangle,t,i),i+=d.Rectangle.packedLength,d.Ellipsoid.pack(e._ellipsoid,t,i),i+=d.Ellipsoid.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=h.defaultValue(e._offsetAttribute,-1),t};var f=new d.Rectangle,g=d.Ellipsoid.clone(d.Ellipsoid.UNIT_SPHERE),x={rectangle:f,ellipsoid:g,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};p.unpack=function(e,t,i){if(!h.defined(e))throw new c.DeveloperError("array is required");t=h.defaultValue(t,0);var r=d.Rectangle.unpack(e,t,f);t+=d.Rectangle.packedLength;var a=d.Ellipsoid.unpack(e,t,g);t+=d.Ellipsoid.packedLength;var n=e[t++],o=e[t++],l=e[t++],u=e[t++],s=e[t];return h.defined(i)?(i._rectangle=d.Rectangle.clone(r,i._rectangle),i._ellipsoid=d.Ellipsoid.clone(a,i._ellipsoid),i._surfaceHeight=o,i._rotation=l,i._extrudedHeight=u,i._offsetAttribute=-1===s?void 0:s,i):(x.granularity=n,x.height=o,x.rotation=l,x.extrudedHeight=u,x.offsetAttribute=-1===s?void 0:s,new p(x))};var H=new d.Cartographic;return p.createGeometry=function(e){var t=e._rectangle,i=e._ellipsoid,r=P.RectangleGeometryLibrary.computeOptions(t,e._granularity,e._rotation,0,L,H);if(!y.CesiumMath.equalsEpsilon(t.north,t.south,y.CesiumMath.EPSILON10)&&!y.CesiumMath.equalsEpsilon(t.east,t.west,y.CesiumMath.EPSILON10)){var a,n,o,l,u,s,c,d,p,f=e._su
|