/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.98 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ define(["exports","./Transforms-c9e418cb","./Matrix2-cf4c6e69","./ComponentDatatype-9b23164a","./defaultValue-50f7432c","./GeometryAttribute-b84ffce6","./GeometryAttributes-8bab1b25","./GeometryOffsetAttribute-490bc2c9","./IndexDatatype-ceed713e"],(function(t,i,e,n,a,o,r,s,u){"use strict";const m=new e.Cartesian3(1,1,1),f=Math.cos,c=Math.sin;function l(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT);const i=a.defaultValue(t.radii,m),o=a.defaultValue(t.innerRadii,i),r=a.defaultValue(t.minimumClock,0),s=a.defaultValue(t.maximumClock,n.CesiumMath.TWO_PI),u=a.defaultValue(t.minimumCone,0),f=a.defaultValue(t.maximumCone,n.CesiumMath.PI),c=Math.round(a.defaultValue(t.stackPartitions,10)),l=Math.round(a.defaultValue(t.slicePartitions,8)),d=Math.round(a.defaultValue(t.subdivisions,128));this._radii=e.Cartesian3.clone(i),this._innerRadii=e.Cartesian3.clone(o),this._minimumClock=r,this._maximumClock=s,this._minimumCone=u,this._maximumCone=f,this._stackPartitions=c,this._slicePartitions=l,this._subdivisions=d,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}l.packedLength=2*e.Cartesian3.packedLength+8,l.pack=function(t,i,n){return n=a.defaultValue(n,0),e.Cartesian3.pack(t._radii,i,n),n+=e.Cartesian3.packedLength,e.Cartesian3.pack(t._innerRadii,i,n),n+=e.Cartesian3.packedLength,i[n++]=t._minimumClock,i[n++]=t._maximumClock,i[n++]=t._minimumCone,i[n++]=t._maximumCone,i[n++]=t._stackPartitions,i[n++]=t._slicePartitions,i[n++]=t._subdivisions,i[n]=a.defaultValue(t._offsetAttribute,-1),i};const d=new e.Cartesian3,C=new e.Cartesian3,_={radii:d,innerRadii:C,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};l.unpack=function(t,i,n){i=a.defaultValue(i,0);const o=e.Cartesian3.unpack(t,i,d);i+=e.Cartesian3.packedLength;const r=e.Cartesian3.unpack(t,i,C);i+=e.Cartesian3.packedLength;const s=t[i++],u=t[i++],m=t[i++],f=t[i++],c=t[i++],p=t[i++],h=t[i++],b=t[i];return a.defined(n)?(n._radii=e.Cartesian3.clone(o,n._radii),n._innerRadii=e.Cartesian3.clone(r,n._innerRadii),n._minimumClock=s,n._maximumClock=u,n._minimumCone=m,n._maximumCone=f,n._stackPartitions=c,n._slicePartitions=p,n._subdivisions=h,n._offsetAttribute=-1===b?void 0:b,n):(_.minimumClock=s,_.maximumClock=u,_.minimumCone=m,_.maximumCone=f,_.stackPartitions=c,_.slicePartitions=p,_.subdivisions=h,_.offsetAttribute=-1===b?void 0:b,new l(_))},l.createGeometry=function(t){const m=t._radii;if(m.x<=0||m.y<=0||m.z<=0)return;const l=t._innerRadii;if(l.x<=0||l.y<=0||l.z<=0)return;const d=t._minimumClock,C=t._maximumClock,_=t._minimumCone,p=t._maximumCone,h=t._subdivisions,b=e.Ellipsoid.fromCartesian3(m);let y=t._slicePartitions+1,k=t._stackPartitions+1;y=Math.round(y*Math.abs(C-d)/n.CesiumMath.TWO_PI),k=Math.round(k*Math.abs(p-_)/n.CesiumMath.PI),y<2&&(y=2),k<2&&(k=2);let x=0,A=1;const P=l.x!==m.x||l.y!==m.y||l.z!==m.z;let v=!1,M=!1;P&&(A=2,_>0&&(v=!0,x+=y),p