1
0

Cesium.d.ts 2.0 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413
  1. declare module "cesium" {
  2. /**
  3. * Private interfaces to support PropertyBag being a dictionary-like object.
  4. */
  5. interface DictionaryLike {
  6. [index: string]: any;
  7. }
  8. /**
  9. * Enum containing WebGL Constant values by name.
  10. * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context
  11. * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).
  12. *
  13. * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}
  14. * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}
  15. * specifications.
  16. */
  17. export enum WebGLConstants {
  18. DEPTH_BUFFER_BIT = 256,
  19. STENCIL_BUFFER_BIT = 1024,
  20. COLOR_BUFFER_BIT = 16384,
  21. POINTS = 0,
  22. LINES = 1,
  23. LINE_LOOP = 2,
  24. LINE_STRIP = 3,
  25. TRIANGLES = 4,
  26. TRIANGLE_STRIP = 5,
  27. TRIANGLE_FAN = 6,
  28. ZERO = 0,
  29. ONE = 1,
  30. SRC_COLOR = 768,
  31. ONE_MINUS_SRC_COLOR = 769,
  32. SRC_ALPHA = 770,
  33. ONE_MINUS_SRC_ALPHA = 771,
  34. DST_ALPHA = 772,
  35. ONE_MINUS_DST_ALPHA = 773,
  36. DST_COLOR = 774,
  37. ONE_MINUS_DST_COLOR = 775,
  38. SRC_ALPHA_SATURATE = 776,
  39. FUNC_ADD = 32774,
  40. BLEND_EQUATION = 32777,
  41. BLEND_EQUATION_RGB = 32777,
  42. BLEND_EQUATION_ALPHA = 34877,
  43. FUNC_SUBTRACT = 32778,
  44. FUNC_REVERSE_SUBTRACT = 32779,
  45. BLEND_DST_RGB = 32968,
  46. BLEND_SRC_RGB = 32969,
  47. BLEND_DST_ALPHA = 32970,
  48. BLEND_SRC_ALPHA = 32971,
  49. CONSTANT_COLOR = 32769,
  50. ONE_MINUS_CONSTANT_COLOR = 32770,
  51. CONSTANT_ALPHA = 32771,
  52. ONE_MINUS_CONSTANT_ALPHA = 32772,
  53. BLEND_COLOR = 32773,
  54. ARRAY_BUFFER = 34962,
  55. ELEMENT_ARRAY_BUFFER = 34963,
  56. ARRAY_BUFFER_BINDING = 34964,
  57. ELEMENT_ARRAY_BUFFER_BINDING = 34965,
  58. STREAM_DRAW = 35040,
  59. STATIC_DRAW = 35044,
  60. DYNAMIC_DRAW = 35048,
  61. BUFFER_SIZE = 34660,
  62. BUFFER_USAGE = 34661,
  63. CURRENT_VERTEX_ATTRIB = 34342,
  64. FRONT = 1028,
  65. BACK = 1029,
  66. FRONT_AND_BACK = 1032,
  67. CULL_FACE = 2884,
  68. BLEND = 3042,
  69. DITHER = 3024,
  70. STENCIL_TEST = 2960,
  71. DEPTH_TEST = 2929,
  72. SCISSOR_TEST = 3089,
  73. POLYGON_OFFSET_FILL = 32823,
  74. SAMPLE_ALPHA_TO_COVERAGE = 32926,
  75. SAMPLE_COVERAGE = 32928,
  76. NO_ERROR = 0,
  77. INVALID_ENUM = 1280,
  78. INVALID_VALUE = 1281,
  79. INVALID_OPERATION = 1282,
  80. OUT_OF_MEMORY = 1285,
  81. CW = 2304,
  82. CCW = 2305,
  83. LINE_WIDTH = 2849,
  84. ALIASED_POINT_SIZE_RANGE = 33901,
  85. ALIASED_LINE_WIDTH_RANGE = 33902,
  86. CULL_FACE_MODE = 2885,
  87. FRONT_FACE = 2886,
  88. DEPTH_RANGE = 2928,
  89. DEPTH_WRITEMASK = 2930,
  90. DEPTH_CLEAR_VALUE = 2931,
  91. DEPTH_FUNC = 2932,
  92. STENCIL_CLEAR_VALUE = 2961,
  93. STENCIL_FUNC = 2962,
  94. STENCIL_FAIL = 2964,
  95. STENCIL_PASS_DEPTH_FAIL = 2965,
  96. STENCIL_PASS_DEPTH_PASS = 2966,
  97. STENCIL_REF = 2967,
  98. STENCIL_VALUE_MASK = 2963,
  99. STENCIL_WRITEMASK = 2968,
  100. STENCIL_BACK_FUNC = 34816,
  101. STENCIL_BACK_FAIL = 34817,
  102. STENCIL_BACK_PASS_DEPTH_FAIL = 34818,
  103. STENCIL_BACK_PASS_DEPTH_PASS = 34819,
  104. STENCIL_BACK_REF = 36003,
  105. STENCIL_BACK_VALUE_MASK = 36004,
  106. STENCIL_BACK_WRITEMASK = 36005,
  107. VIEWPORT = 2978,
  108. SCISSOR_BOX = 3088,
  109. COLOR_CLEAR_VALUE = 3106,
  110. COLOR_WRITEMASK = 3107,
  111. UNPACK_ALIGNMENT = 3317,
  112. PACK_ALIGNMENT = 3333,
  113. MAX_TEXTURE_SIZE = 3379,
  114. MAX_VIEWPORT_DIMS = 3386,
  115. SUBPIXEL_BITS = 3408,
  116. RED_BITS = 3410,
  117. GREEN_BITS = 3411,
  118. BLUE_BITS = 3412,
  119. ALPHA_BITS = 3413,
  120. DEPTH_BITS = 3414,
  121. STENCIL_BITS = 3415,
  122. POLYGON_OFFSET_UNITS = 10752,
  123. POLYGON_OFFSET_FACTOR = 32824,
  124. TEXTURE_BINDING_2D = 32873,
  125. SAMPLE_BUFFERS = 32936,
  126. SAMPLES = 32937,
  127. SAMPLE_COVERAGE_VALUE = 32938,
  128. SAMPLE_COVERAGE_INVERT = 32939,
  129. COMPRESSED_TEXTURE_FORMATS = 34467,
  130. DONT_CARE = 4352,
  131. FASTEST = 4353,
  132. NICEST = 4354,
  133. GENERATE_MIPMAP_HINT = 33170,
  134. BYTE = 5120,
  135. UNSIGNED_BYTE = 5121,
  136. SHORT = 5122,
  137. UNSIGNED_SHORT = 5123,
  138. INT = 5124,
  139. UNSIGNED_INT = 5125,
  140. FLOAT = 5126,
  141. DEPTH_COMPONENT = 6402,
  142. ALPHA = 6406,
  143. RGB = 6407,
  144. RGBA = 6408,
  145. LUMINANCE = 6409,
  146. LUMINANCE_ALPHA = 6410,
  147. UNSIGNED_SHORT_4_4_4_4 = 32819,
  148. UNSIGNED_SHORT_5_5_5_1 = 32820,
  149. UNSIGNED_SHORT_5_6_5 = 33635,
  150. FRAGMENT_SHADER = 35632,
  151. VERTEX_SHADER = 35633,
  152. MAX_VERTEX_ATTRIBS = 34921,
  153. MAX_VERTEX_UNIFORM_VECTORS = 36347,
  154. MAX_VARYING_VECTORS = 36348,
  155. MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661,
  156. MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660,
  157. MAX_TEXTURE_IMAGE_UNITS = 34930,
  158. MAX_FRAGMENT_UNIFORM_VECTORS = 36349,
  159. SHADER_TYPE = 35663,
  160. DELETE_STATUS = 35712,
  161. LINK_STATUS = 35714,
  162. VALIDATE_STATUS = 35715,
  163. ATTACHED_SHADERS = 35717,
  164. ACTIVE_UNIFORMS = 35718,
  165. ACTIVE_ATTRIBUTES = 35721,
  166. SHADING_LANGUAGE_VERSION = 35724,
  167. CURRENT_PROGRAM = 35725,
  168. NEVER = 512,
  169. LESS = 513,
  170. EQUAL = 514,
  171. LEQUAL = 515,
  172. GREATER = 516,
  173. NOTEQUAL = 517,
  174. GEQUAL = 518,
  175. ALWAYS = 519,
  176. KEEP = 7680,
  177. REPLACE = 7681,
  178. INCR = 7682,
  179. DECR = 7683,
  180. INVERT = 5386,
  181. INCR_WRAP = 34055,
  182. DECR_WRAP = 34056,
  183. VENDOR = 7936,
  184. RENDERER = 7937,
  185. VERSION = 7938,
  186. NEAREST = 9728,
  187. LINEAR = 9729,
  188. NEAREST_MIPMAP_NEAREST = 9984,
  189. LINEAR_MIPMAP_NEAREST = 9985,
  190. NEAREST_MIPMAP_LINEAR = 9986,
  191. LINEAR_MIPMAP_LINEAR = 9987,
  192. TEXTURE_MAG_FILTER = 10240,
  193. TEXTURE_MIN_FILTER = 10241,
  194. TEXTURE_WRAP_S = 10242,
  195. TEXTURE_WRAP_T = 10243,
  196. TEXTURE_2D = 3553,
  197. TEXTURE = 5890,
  198. TEXTURE_CUBE_MAP = 34067,
  199. TEXTURE_BINDING_CUBE_MAP = 34068,
  200. TEXTURE_CUBE_MAP_POSITIVE_X = 34069,
  201. TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,
  202. TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,
  203. TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,
  204. TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,
  205. TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074,
  206. MAX_CUBE_MAP_TEXTURE_SIZE = 34076,
  207. TEXTURE0 = 33984,
  208. TEXTURE1 = 33985,
  209. TEXTURE2 = 33986,
  210. TEXTURE3 = 33987,
  211. TEXTURE4 = 33988,
  212. TEXTURE5 = 33989,
  213. TEXTURE6 = 33990,
  214. TEXTURE7 = 33991,
  215. TEXTURE8 = 33992,
  216. TEXTURE9 = 33993,
  217. TEXTURE10 = 33994,
  218. TEXTURE11 = 33995,
  219. TEXTURE12 = 33996,
  220. TEXTURE13 = 33997,
  221. TEXTURE14 = 33998,
  222. TEXTURE15 = 33999,
  223. TEXTURE16 = 34000,
  224. TEXTURE17 = 34001,
  225. TEXTURE18 = 34002,
  226. TEXTURE19 = 34003,
  227. TEXTURE20 = 34004,
  228. TEXTURE21 = 34005,
  229. TEXTURE22 = 34006,
  230. TEXTURE23 = 34007,
  231. TEXTURE24 = 34008,
  232. TEXTURE25 = 34009,
  233. TEXTURE26 = 34010,
  234. TEXTURE27 = 34011,
  235. TEXTURE28 = 34012,
  236. TEXTURE29 = 34013,
  237. TEXTURE30 = 34014,
  238. TEXTURE31 = 34015,
  239. ACTIVE_TEXTURE = 34016,
  240. REPEAT = 10497,
  241. CLAMP_TO_EDGE = 33071,
  242. MIRRORED_REPEAT = 33648,
  243. FLOAT_VEC2 = 35664,
  244. FLOAT_VEC3 = 35665,
  245. FLOAT_VEC4 = 35666,
  246. INT_VEC2 = 35667,
  247. INT_VEC3 = 35668,
  248. INT_VEC4 = 35669,
  249. BOOL = 35670,
  250. BOOL_VEC2 = 35671,
  251. BOOL_VEC3 = 35672,
  252. BOOL_VEC4 = 35673,
  253. FLOAT_MAT2 = 35674,
  254. FLOAT_MAT3 = 35675,
  255. FLOAT_MAT4 = 35676,
  256. SAMPLER_2D = 35678,
  257. SAMPLER_CUBE = 35680,
  258. VERTEX_ATTRIB_ARRAY_ENABLED = 34338,
  259. VERTEX_ATTRIB_ARRAY_SIZE = 34339,
  260. VERTEX_ATTRIB_ARRAY_STRIDE = 34340,
  261. VERTEX_ATTRIB_ARRAY_TYPE = 34341,
  262. VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922,
  263. VERTEX_ATTRIB_ARRAY_POINTER = 34373,
  264. VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975,
  265. IMPLEMENTATION_COLOR_READ_TYPE = 35738,
  266. IMPLEMENTATION_COLOR_READ_FORMAT = 35739,
  267. COMPILE_STATUS = 35713,
  268. LOW_FLOAT = 36336,
  269. MEDIUM_FLOAT = 36337,
  270. HIGH_FLOAT = 36338,
  271. LOW_INT = 36339,
  272. MEDIUM_INT = 36340,
  273. HIGH_INT = 36341,
  274. FRAMEBUFFER = 36160,
  275. RENDERBUFFER = 36161,
  276. RGBA4 = 32854,
  277. RGB5_A1 = 32855,
  278. RGB565 = 36194,
  279. DEPTH_COMPONENT16 = 33189,
  280. STENCIL_INDEX = 6401,
  281. STENCIL_INDEX8 = 36168,
  282. DEPTH_STENCIL = 34041,
  283. RENDERBUFFER_WIDTH = 36162,
  284. RENDERBUFFER_HEIGHT = 36163,
  285. RENDERBUFFER_INTERNAL_FORMAT = 36164,
  286. RENDERBUFFER_RED_SIZE = 36176,
  287. RENDERBUFFER_GREEN_SIZE = 36177,
  288. RENDERBUFFER_BLUE_SIZE = 36178,
  289. RENDERBUFFER_ALPHA_SIZE = 36179,
  290. RENDERBUFFER_DEPTH_SIZE = 36180,
  291. RENDERBUFFER_STENCIL_SIZE = 36181,
  292. FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048,
  293. FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049,
  294. FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050,
  295. FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051,
  296. COLOR_ATTACHMENT0 = 36064,
  297. DEPTH_ATTACHMENT = 36096,
  298. STENCIL_ATTACHMENT = 36128,
  299. DEPTH_STENCIL_ATTACHMENT = 33306,
  300. NONE = 0,
  301. FRAMEBUFFER_COMPLETE = 36053,
  302. FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054,
  303. FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055,
  304. FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057,
  305. FRAMEBUFFER_UNSUPPORTED = 36061,
  306. FRAMEBUFFER_BINDING = 36006,
  307. RENDERBUFFER_BINDING = 36007,
  308. MAX_RENDERBUFFER_SIZE = 34024,
  309. INVALID_FRAMEBUFFER_OPERATION = 1286,
  310. UNPACK_FLIP_Y_WEBGL = 37440,
  311. UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441,
  312. CONTEXT_LOST_WEBGL = 37442,
  313. UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443,
  314. BROWSER_DEFAULT_WEBGL = 37444,
  315. COMPRESSED_RGB_S3TC_DXT1_EXT = 33776,
  316. COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777,
  317. COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778,
  318. COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779,
  319. COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840,
  320. COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841,
  321. COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842,
  322. COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843,
  323. COMPRESSED_RGBA_ASTC_4x4_WEBGL = 37808,
  324. COMPRESSED_RGB_ETC1_WEBGL = 36196,
  325. COMPRESSED_RGBA_BPTC_UNORM = 36492,
  326. HALF_FLOAT_OES = 36193,
  327. DOUBLE = 5130,
  328. READ_BUFFER = 3074,
  329. UNPACK_ROW_LENGTH = 3314,
  330. UNPACK_SKIP_ROWS = 3315,
  331. UNPACK_SKIP_PIXELS = 3316,
  332. PACK_ROW_LENGTH = 3330,
  333. PACK_SKIP_ROWS = 3331,
  334. PACK_SKIP_PIXELS = 3332,
  335. COLOR = 6144,
  336. DEPTH = 6145,
  337. STENCIL = 6146,
  338. RED = 6403,
  339. RGB8 = 32849,
  340. RGBA8 = 32856,
  341. RGB10_A2 = 32857,
  342. TEXTURE_BINDING_3D = 32874,
  343. UNPACK_SKIP_IMAGES = 32877,
  344. UNPACK_IMAGE_HEIGHT = 32878,
  345. TEXTURE_3D = 32879,
  346. TEXTURE_WRAP_R = 32882,
  347. MAX_3D_TEXTURE_SIZE = 32883,
  348. UNSIGNED_INT_2_10_10_10_REV = 33640,
  349. MAX_ELEMENTS_VERTICES = 33000,
  350. MAX_ELEMENTS_INDICES = 33001,
  351. TEXTURE_MIN_LOD = 33082,
  352. TEXTURE_MAX_LOD = 33083,
  353. TEXTURE_BASE_LEVEL = 33084,
  354. TEXTURE_MAX_LEVEL = 33085,
  355. MIN = 32775,
  356. MAX = 32776,
  357. DEPTH_COMPONENT24 = 33190,
  358. MAX_TEXTURE_LOD_BIAS = 34045,
  359. TEXTURE_COMPARE_MODE = 34892,
  360. TEXTURE_COMPARE_FUNC = 34893,
  361. CURRENT_QUERY = 34917,
  362. QUERY_RESULT = 34918,
  363. QUERY_RESULT_AVAILABLE = 34919,
  364. STREAM_READ = 35041,
  365. STREAM_COPY = 35042,
  366. STATIC_READ = 35045,
  367. STATIC_COPY = 35046,
  368. DYNAMIC_READ = 35049,
  369. DYNAMIC_COPY = 35050,
  370. MAX_DRAW_BUFFERS = 34852,
  371. DRAW_BUFFER0 = 34853,
  372. DRAW_BUFFER1 = 34854,
  373. DRAW_BUFFER2 = 34855,
  374. DRAW_BUFFER3 = 34856,
  375. DRAW_BUFFER4 = 34857,
  376. DRAW_BUFFER5 = 34858,
  377. DRAW_BUFFER6 = 34859,
  378. DRAW_BUFFER7 = 34860,
  379. DRAW_BUFFER8 = 34861,
  380. DRAW_BUFFER9 = 34862,
  381. DRAW_BUFFER10 = 34863,
  382. DRAW_BUFFER11 = 34864,
  383. DRAW_BUFFER12 = 34865,
  384. DRAW_BUFFER13 = 34866,
  385. DRAW_BUFFER14 = 34867,
  386. DRAW_BUFFER15 = 34868,
  387. MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657,
  388. MAX_VERTEX_UNIFORM_COMPONENTS = 35658,
  389. SAMPLER_3D = 35679,
  390. SAMPLER_2D_SHADOW = 35682,
  391. FRAGMENT_SHADER_DERIVATIVE_HINT = 35723,
  392. PIXEL_PACK_BUFFER = 35051,
  393. PIXEL_UNPACK_BUFFER = 35052,
  394. PIXEL_PACK_BUFFER_BINDING = 35053,
  395. PIXEL_UNPACK_BUFFER_BINDING = 35055,
  396. FLOAT_MAT2x3 = 35685,
  397. FLOAT_MAT2x4 = 35686,
  398. FLOAT_MAT3x2 = 35687,
  399. FLOAT_MAT3x4 = 35688,
  400. FLOAT_MAT4x2 = 35689,
  401. FLOAT_MAT4x3 = 35690,
  402. SRGB = 35904,
  403. SRGB8 = 35905,
  404. SRGB8_ALPHA8 = 35907,
  405. COMPARE_REF_TO_TEXTURE = 34894,
  406. RGBA32F = 34836,
  407. RGB32F = 34837,
  408. RGBA16F = 34842,
  409. RGB16F = 34843,
  410. VERTEX_ATTRIB_ARRAY_INTEGER = 35069,
  411. MAX_ARRAY_TEXTURE_LAYERS = 35071,
  412. MIN_PROGRAM_TEXEL_OFFSET = 35076,
  413. MAX_PROGRAM_TEXEL_OFFSET = 35077,
  414. MAX_VARYING_COMPONENTS = 35659,
  415. TEXTURE_2D_ARRAY = 35866,
  416. TEXTURE_BINDING_2D_ARRAY = 35869,
  417. R11F_G11F_B10F = 35898,
  418. UNSIGNED_INT_10F_11F_11F_REV = 35899,
  419. RGB9_E5 = 35901,
  420. UNSIGNED_INT_5_9_9_9_REV = 35902,
  421. TRANSFORM_FEEDBACK_BUFFER_MODE = 35967,
  422. MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968,
  423. TRANSFORM_FEEDBACK_VARYINGS = 35971,
  424. TRANSFORM_FEEDBACK_BUFFER_START = 35972,
  425. TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973,
  426. TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976,
  427. RASTERIZER_DISCARD = 35977,
  428. MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978,
  429. MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979,
  430. INTERLEAVED_ATTRIBS = 35980,
  431. SEPARATE_ATTRIBS = 35981,
  432. TRANSFORM_FEEDBACK_BUFFER = 35982,
  433. TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983,
  434. RGBA32UI = 36208,
  435. RGB32UI = 36209,
  436. RGBA16UI = 36214,
  437. RGB16UI = 36215,
  438. RGBA8UI = 36220,
  439. RGB8UI = 36221,
  440. RGBA32I = 36226,
  441. RGB32I = 36227,
  442. RGBA16I = 36232,
  443. RGB16I = 36233,
  444. RGBA8I = 36238,
  445. RGB8I = 36239,
  446. RED_INTEGER = 36244,
  447. RGB_INTEGER = 36248,
  448. RGBA_INTEGER = 36249,
  449. SAMPLER_2D_ARRAY = 36289,
  450. SAMPLER_2D_ARRAY_SHADOW = 36292,
  451. SAMPLER_CUBE_SHADOW = 36293,
  452. UNSIGNED_INT_VEC2 = 36294,
  453. UNSIGNED_INT_VEC3 = 36295,
  454. UNSIGNED_INT_VEC4 = 36296,
  455. INT_SAMPLER_2D = 36298,
  456. INT_SAMPLER_3D = 36299,
  457. INT_SAMPLER_CUBE = 36300,
  458. INT_SAMPLER_2D_ARRAY = 36303,
  459. UNSIGNED_INT_SAMPLER_2D = 36306,
  460. UNSIGNED_INT_SAMPLER_3D = 36307,
  461. UNSIGNED_INT_SAMPLER_CUBE = 36308,
  462. UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311,
  463. DEPTH_COMPONENT32F = 36012,
  464. DEPTH32F_STENCIL8 = 36013,
  465. FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,
  466. FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296,
  467. FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297,
  468. FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298,
  469. FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299,
  470. FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300,
  471. FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301,
  472. FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302,
  473. FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303,
  474. FRAMEBUFFER_DEFAULT = 33304,
  475. UNSIGNED_INT_24_8 = 34042,
  476. DEPTH24_STENCIL8 = 35056,
  477. UNSIGNED_NORMALIZED = 35863,
  478. DRAW_FRAMEBUFFER_BINDING = 36006,
  479. READ_FRAMEBUFFER = 36008,
  480. DRAW_FRAMEBUFFER = 36009,
  481. READ_FRAMEBUFFER_BINDING = 36010,
  482. RENDERBUFFER_SAMPLES = 36011,
  483. FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052,
  484. MAX_COLOR_ATTACHMENTS = 36063,
  485. COLOR_ATTACHMENT1 = 36065,
  486. COLOR_ATTACHMENT2 = 36066,
  487. COLOR_ATTACHMENT3 = 36067,
  488. COLOR_ATTACHMENT4 = 36068,
  489. COLOR_ATTACHMENT5 = 36069,
  490. COLOR_ATTACHMENT6 = 36070,
  491. COLOR_ATTACHMENT7 = 36071,
  492. COLOR_ATTACHMENT8 = 36072,
  493. COLOR_ATTACHMENT9 = 36073,
  494. COLOR_ATTACHMENT10 = 36074,
  495. COLOR_ATTACHMENT11 = 36075,
  496. COLOR_ATTACHMENT12 = 36076,
  497. COLOR_ATTACHMENT13 = 36077,
  498. COLOR_ATTACHMENT14 = 36078,
  499. COLOR_ATTACHMENT15 = 36079,
  500. FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182,
  501. MAX_SAMPLES = 36183,
  502. HALF_FLOAT = 5131,
  503. RG = 33319,
  504. RG_INTEGER = 33320,
  505. R8 = 33321,
  506. RG8 = 33323,
  507. R16F = 33325,
  508. R32F = 33326,
  509. RG16F = 33327,
  510. RG32F = 33328,
  511. R8I = 33329,
  512. R8UI = 33330,
  513. R16I = 33331,
  514. R16UI = 33332,
  515. R32I = 33333,
  516. R32UI = 33334,
  517. RG8I = 33335,
  518. RG8UI = 33336,
  519. RG16I = 33337,
  520. RG16UI = 33338,
  521. RG32I = 33339,
  522. RG32UI = 33340,
  523. VERTEX_ARRAY_BINDING = 34229,
  524. R8_SNORM = 36756,
  525. RG8_SNORM = 36757,
  526. RGB8_SNORM = 36758,
  527. RGBA8_SNORM = 36759,
  528. SIGNED_NORMALIZED = 36764,
  529. COPY_READ_BUFFER = 36662,
  530. COPY_WRITE_BUFFER = 36663,
  531. COPY_READ_BUFFER_BINDING = 36662,
  532. COPY_WRITE_BUFFER_BINDING = 36663,
  533. UNIFORM_BUFFER = 35345,
  534. UNIFORM_BUFFER_BINDING = 35368,
  535. UNIFORM_BUFFER_START = 35369,
  536. UNIFORM_BUFFER_SIZE = 35370,
  537. MAX_VERTEX_UNIFORM_BLOCKS = 35371,
  538. MAX_FRAGMENT_UNIFORM_BLOCKS = 35373,
  539. MAX_COMBINED_UNIFORM_BLOCKS = 35374,
  540. MAX_UNIFORM_BUFFER_BINDINGS = 35375,
  541. MAX_UNIFORM_BLOCK_SIZE = 35376,
  542. MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377,
  543. MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379,
  544. UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380,
  545. ACTIVE_UNIFORM_BLOCKS = 35382,
  546. UNIFORM_TYPE = 35383,
  547. UNIFORM_SIZE = 35384,
  548. UNIFORM_BLOCK_INDEX = 35386,
  549. UNIFORM_OFFSET = 35387,
  550. UNIFORM_ARRAY_STRIDE = 35388,
  551. UNIFORM_MATRIX_STRIDE = 35389,
  552. UNIFORM_IS_ROW_MAJOR = 35390,
  553. UNIFORM_BLOCK_BINDING = 35391,
  554. UNIFORM_BLOCK_DATA_SIZE = 35392,
  555. UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394,
  556. UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395,
  557. UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396,
  558. UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398,
  559. INVALID_INDEX = 4294967295,
  560. MAX_VERTEX_OUTPUT_COMPONENTS = 37154,
  561. MAX_FRAGMENT_INPUT_COMPONENTS = 37157,
  562. MAX_SERVER_WAIT_TIMEOUT = 37137,
  563. OBJECT_TYPE = 37138,
  564. SYNC_CONDITION = 37139,
  565. SYNC_STATUS = 37140,
  566. SYNC_FLAGS = 37141,
  567. SYNC_FENCE = 37142,
  568. SYNC_GPU_COMMANDS_COMPLETE = 37143,
  569. UNSIGNALED = 37144,
  570. SIGNALED = 37145,
  571. ALREADY_SIGNALED = 37146,
  572. TIMEOUT_EXPIRED = 37147,
  573. CONDITION_SATISFIED = 37148,
  574. WAIT_FAILED = 37149,
  575. SYNC_FLUSH_COMMANDS_BIT = 1,
  576. VERTEX_ATTRIB_ARRAY_DIVISOR = 35070,
  577. ANY_SAMPLES_PASSED = 35887,
  578. ANY_SAMPLES_PASSED_CONSERVATIVE = 36202,
  579. SAMPLER_BINDING = 35097,
  580. RGB10_A2UI = 36975,
  581. INT_2_10_10_10_REV = 36255,
  582. TRANSFORM_FEEDBACK = 36386,
  583. TRANSFORM_FEEDBACK_PAUSED = 36387,
  584. TRANSFORM_FEEDBACK_ACTIVE = 36388,
  585. TRANSFORM_FEEDBACK_BINDING = 36389,
  586. COMPRESSED_R11_EAC = 37488,
  587. COMPRESSED_SIGNED_R11_EAC = 37489,
  588. COMPRESSED_RG11_EAC = 37490,
  589. COMPRESSED_SIGNED_RG11_EAC = 37491,
  590. COMPRESSED_RGB8_ETC2 = 37492,
  591. COMPRESSED_SRGB8_ETC2 = 37493,
  592. COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494,
  593. COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495,
  594. COMPRESSED_RGBA8_ETC2_EAC = 37496,
  595. COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497,
  596. TEXTURE_IMMUTABLE_FORMAT = 37167,
  597. MAX_ELEMENT_INDEX = 36203,
  598. TEXTURE_IMMUTABLE_LEVELS = 33503,
  599. MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047
  600. }
  601. /**
  602. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  603. * retrieved from Elevation Tiles of an an ArcGIS ImageService.
  604. * @example
  605. * var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
  606. * url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
  607. * token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..'
  608. * });
  609. * viewer.terrainProvider = terrainProvider;
  610. *
  611. *
  612. * @param options - Object with the following properties:
  613. * @param options.url - The URL of the ArcGIS ImageServer service.
  614. * @param [options.token] - The authorization token to use to connect to the service.
  615. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  616. * this parameter is ignored and the tiling scheme's ellipsoid is used instead.
  617. * If neither parameter is specified, the WGS84 ellipsoid is used.
  618. */
  619. export class ArcGISTiledElevationTerrainProvider {
  620. constructor(options: {
  621. url: Resource | string | Promise<Resource> | Promise<string>;
  622. token?: string;
  623. ellipsoid?: Ellipsoid;
  624. });
  625. /**
  626. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  627. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  628. * are passed an instance of {@link TileProviderError}.
  629. */
  630. readonly errorEvent: Event;
  631. /**
  632. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  633. * the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  634. */
  635. readonly credit: Credit;
  636. /**
  637. * Gets the tiling scheme used by this provider. This function should
  638. * not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  639. */
  640. readonly tilingScheme: GeographicTilingScheme;
  641. /**
  642. * Gets a value indicating whether or not the provider is ready for use.
  643. */
  644. readonly ready: boolean;
  645. /**
  646. * Gets a promise that resolves to true when the provider is ready for use.
  647. */
  648. readonly readyPromise: Promise<boolean>;
  649. /**
  650. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  651. * indicates which areas of the globe are water rather than land, so they can be rendered
  652. * as a reflective surface with animated waves. This function should not be
  653. * called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  654. */
  655. readonly hasWaterMask: boolean;
  656. /**
  657. * Gets a value indicating whether or not the requested tiles include vertex normals.
  658. * This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  659. */
  660. readonly hasVertexNormals: boolean;
  661. /**
  662. * Gets an object that can be used to determine availability of terrain from this provider, such as
  663. * at points and in rectangles. This function should not be called before
  664. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  665. * information is not available.
  666. */
  667. readonly availability: TileAvailability;
  668. /**
  669. * Requests the geometry for a given tile. This function should not be called before
  670. * {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain
  671. * data and indicates that all child tiles are available.
  672. * @param x - The X coordinate of the tile for which to request geometry.
  673. * @param y - The Y coordinate of the tile for which to request geometry.
  674. * @param level - The level of the tile for which to request geometry.
  675. * @param [request] - The request object. Intended for internal use only.
  676. * @returns A promise for the requested geometry. If this method
  677. * returns undefined instead of a promise, it is an indication that too many requests are already
  678. * pending and the request will be retried later.
  679. */
  680. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  681. /**
  682. * Gets the maximum geometric error allowed in a tile at a given level.
  683. * @param level - The tile level for which to get the maximum geometric error.
  684. * @returns The maximum geometric error.
  685. */
  686. getLevelMaximumGeometricError(level: number): number;
  687. /**
  688. * Determines whether data for a tile is available to be loaded.
  689. * @param x - The X coordinate of the tile for which to request geometry.
  690. * @param y - The Y coordinate of the tile for which to request geometry.
  691. * @param level - The level of the tile for which to request geometry.
  692. * @returns Undefined if not supported, otherwise true or false.
  693. */
  694. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  695. /**
  696. * Makes sure we load availability data for a tile
  697. * @param x - The X coordinate of the tile for which to request geometry.
  698. * @param y - The Y coordinate of the tile for which to request geometry.
  699. * @param level - The level of the tile for which to request geometry.
  700. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  701. */
  702. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  703. }
  704. /**
  705. * ArcType defines the path that should be taken connecting vertices.
  706. */
  707. export enum ArcType {
  708. /**
  709. * Straight line that does not conform to the surface of the ellipsoid.
  710. */
  711. NONE = 0,
  712. /**
  713. * Follow geodesic path.
  714. */
  715. GEODESIC = 1,
  716. /**
  717. * Follow rhumb or loxodrome path.
  718. */
  719. RHUMB = 2
  720. }
  721. /**
  722. * A collection of key-value pairs that is stored as a hash for easy
  723. * lookup but also provides an array for fast iteration.
  724. */
  725. export class AssociativeArray {
  726. constructor();
  727. /**
  728. * Gets the number of items in the collection.
  729. */
  730. length: number;
  731. /**
  732. * Gets an unordered array of all values in the collection.
  733. * This is a live array that will automatically reflect the values in the collection,
  734. * it should not be modified directly.
  735. */
  736. values: any[];
  737. /**
  738. * Determines if the provided key is in the array.
  739. * @param key - The key to check.
  740. * @returns <code>true</code> if the key is in the array, <code>false</code> otherwise.
  741. */
  742. contains(key: string | number): boolean;
  743. /**
  744. * Associates the provided key with the provided value. If the key already
  745. * exists, it is overwritten with the new value.
  746. * @param key - A unique identifier.
  747. * @param value - The value to associate with the provided key.
  748. */
  749. set(key: string | number, value: any): void;
  750. /**
  751. * Retrieves the value associated with the provided key.
  752. * @param key - The key whose value is to be retrieved.
  753. * @returns The associated value, or undefined if the key does not exist in the collection.
  754. */
  755. get(key: string | number): any;
  756. /**
  757. * Removes a key-value pair from the collection.
  758. * @param key - The key to be removed.
  759. * @returns True if it was removed, false if the key was not in the collection.
  760. */
  761. remove(key: string | number): boolean;
  762. /**
  763. * Clears the collection.
  764. */
  765. removeAll(): void;
  766. }
  767. /**
  768. * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
  769. * @param [minimum = Cartesian3.ZERO] - The minimum point along the x, y, and z axes.
  770. * @param [maximum = Cartesian3.ZERO] - The maximum point along the x, y, and z axes.
  771. * @param [center] - The center of the box; automatically computed if not supplied.
  772. */
  773. export class AxisAlignedBoundingBox {
  774. constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3);
  775. /**
  776. * The minimum point defining the bounding box.
  777. */
  778. minimum: Cartesian3;
  779. /**
  780. * The maximum point defining the bounding box.
  781. */
  782. maximum: Cartesian3;
  783. /**
  784. * The center point of the bounding box.
  785. */
  786. center: Cartesian3;
  787. /**
  788. * Computes an instance of an AxisAlignedBoundingBox. The box is determined by
  789. * finding the points spaced the farthest apart on the x, y, and z axes.
  790. * @example
  791. * // Compute an axis aligned bounding box enclosing two points.
  792. * var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  793. * @param positions - List of points that the bounding box will enclose. Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties.
  794. * @param [result] - The object onto which to store the result.
  795. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  796. */
  797. static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  798. /**
  799. * Duplicates a AxisAlignedBoundingBox instance.
  800. * @param box - The bounding box to duplicate.
  801. * @param [result] - The object onto which to store the result.
  802. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  803. */
  804. static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  805. /**
  806. * Compares the provided AxisAlignedBoundingBox componentwise and returns
  807. * <code>true</code> if they are equal, <code>false</code> otherwise.
  808. * @param [left] - The first AxisAlignedBoundingBox.
  809. * @param [right] - The second AxisAlignedBoundingBox.
  810. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  811. */
  812. static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean;
  813. /**
  814. * Determines which side of a plane a box is located.
  815. * @param box - The bounding box to test.
  816. * @param plane - The plane to test against.
  817. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  818. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  819. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  820. * intersects the plane.
  821. */
  822. static intersectPlane(box: AxisAlignedBoundingBox, plane: Plane): Intersect;
  823. /**
  824. * Duplicates this AxisAlignedBoundingBox instance.
  825. * @param [result] - The object onto which to store the result.
  826. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  827. */
  828. clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  829. /**
  830. * Determines which side of a plane this box is located.
  831. * @param plane - The plane to test against.
  832. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  833. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  834. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  835. * intersects the plane.
  836. */
  837. intersectPlane(plane: Plane): Intersect;
  838. /**
  839. * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
  840. * <code>true</code> if they are equal, <code>false</code> otherwise.
  841. * @param [right] - The right hand side AxisAlignedBoundingBox.
  842. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  843. */
  844. equals(right?: AxisAlignedBoundingBox): boolean;
  845. }
  846. /**
  847. * Provides geocoding through Bing Maps.
  848. * @param options - Object with the following properties:
  849. * @param options.key - A key to use with the Bing Maps geocoding service
  850. * @param [options.culture] - A Bing Maps {@link https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes|Culture Code} to return results in a specific culture and language.
  851. */
  852. export class BingMapsGeocoderService {
  853. constructor(options: {
  854. key: string;
  855. culture?: string;
  856. });
  857. /**
  858. * The URL endpoint for the Bing geocoder service
  859. */
  860. readonly url: string;
  861. /**
  862. * The key for the Bing geocoder service
  863. */
  864. readonly key: string;
  865. /**
  866. * @param query - The query to be sent to the geocoder service
  867. */
  868. geocode(query: string): Promise<GeocoderService.Result[]>;
  869. }
  870. /**
  871. * A bounding rectangle given by a corner, width and height.
  872. * @param [x = 0.0] - The x coordinate of the rectangle.
  873. * @param [y = 0.0] - The y coordinate of the rectangle.
  874. * @param [width = 0.0] - The width of the rectangle.
  875. * @param [height = 0.0] - The height of the rectangle.
  876. */
  877. export class BoundingRectangle {
  878. constructor(x?: number, y?: number, width?: number, height?: number);
  879. /**
  880. * The x coordinate of the rectangle.
  881. */
  882. x: number;
  883. /**
  884. * The y coordinate of the rectangle.
  885. */
  886. y: number;
  887. /**
  888. * The width of the rectangle.
  889. */
  890. width: number;
  891. /**
  892. * The height of the rectangle.
  893. */
  894. height: number;
  895. /**
  896. * The number of elements used to pack the object into an array.
  897. */
  898. static packedLength: number;
  899. /**
  900. * Stores the provided instance into the provided array.
  901. * @param value - The value to pack.
  902. * @param array - The array to pack into.
  903. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  904. * @returns The array that was packed into
  905. */
  906. static pack(value: BoundingRectangle, array: number[], startingIndex?: number): number[];
  907. /**
  908. * Retrieves an instance from a packed array.
  909. * @param array - The packed array.
  910. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  911. * @param [result] - The object into which to store the result.
  912. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  913. */
  914. static unpack(array: number[], startingIndex?: number, result?: BoundingRectangle): BoundingRectangle;
  915. /**
  916. * Computes a bounding rectangle enclosing the list of 2D points.
  917. * The rectangle is oriented with the corner at the bottom left.
  918. * @param positions - List of points that the bounding rectangle will enclose. Each point must have <code>x</code> and <code>y</code> properties.
  919. * @param [result] - The object onto which to store the result.
  920. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  921. */
  922. static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle;
  923. /**
  924. * Computes a bounding rectangle from a rectangle.
  925. * @param rectangle - The valid rectangle used to create a bounding rectangle.
  926. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  927. * @param [result] - The object onto which to store the result.
  928. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  929. */
  930. static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle;
  931. /**
  932. * Duplicates a BoundingRectangle instance.
  933. * @param rectangle - The bounding rectangle to duplicate.
  934. * @param [result] - The object onto which to store the result.
  935. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
  936. */
  937. static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  938. /**
  939. * Computes a bounding rectangle that is the union of the left and right bounding rectangles.
  940. * @param left - A rectangle to enclose in bounding rectangle.
  941. * @param right - A rectangle to enclose in a bounding rectangle.
  942. * @param [result] - The object onto which to store the result.
  943. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  944. */
  945. static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  946. /**
  947. * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
  948. * @param rectangle - A rectangle to expand.
  949. * @param point - A point to enclose in a bounding rectangle.
  950. * @param [result] - The object onto which to store the result.
  951. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  952. */
  953. static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle;
  954. /**
  955. * Determines if two rectangles intersect.
  956. * @param left - A rectangle to check for intersection.
  957. * @param right - The other rectangle to check for intersection.
  958. * @returns <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  959. */
  960. static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect;
  961. /**
  962. * Compares the provided BoundingRectangles componentwise and returns
  963. * <code>true</code> if they are equal, <code>false</code> otherwise.
  964. * @param [left] - The first BoundingRectangle.
  965. * @param [right] - The second BoundingRectangle.
  966. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  967. */
  968. static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean;
  969. /**
  970. * Duplicates this BoundingRectangle instance.
  971. * @param [result] - The object onto which to store the result.
  972. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  973. */
  974. clone(result?: BoundingRectangle): BoundingRectangle;
  975. /**
  976. * Determines if this rectangle intersects with another.
  977. * @param right - A rectangle to check for intersection.
  978. * @returns <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  979. */
  980. intersect(right: BoundingRectangle): Intersect;
  981. /**
  982. * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
  983. * <code>true</code> if they are equal, <code>false</code> otherwise.
  984. * @param [right] - The right hand side BoundingRectangle.
  985. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  986. */
  987. equals(right?: BoundingRectangle): boolean;
  988. }
  989. /**
  990. * A bounding sphere with a center and a radius.
  991. * @param [center = Cartesian3.ZERO] - The center of the bounding sphere.
  992. * @param [radius = 0.0] - The radius of the bounding sphere.
  993. */
  994. export class BoundingSphere {
  995. constructor(center?: Cartesian3, radius?: number);
  996. /**
  997. * The center point of the sphere.
  998. */
  999. center: Cartesian3;
  1000. /**
  1001. * The radius of the sphere.
  1002. */
  1003. radius: number;
  1004. /**
  1005. * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.
  1006. * The bounding sphere is computed by running two algorithms, a naive algorithm and
  1007. * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.
  1008. * @param [positions] - An array of points that the bounding sphere will enclose. Each point must have <code>x</code>, <code>y</code>, and <code>z</code> properties.
  1009. * @param [result] - The object onto which to store the result.
  1010. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1011. */
  1012. static fromPoints(positions?: Cartesian3[], result?: BoundingSphere): BoundingSphere;
  1013. /**
  1014. * Computes a bounding sphere from a rectangle projected in 2D.
  1015. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1016. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  1017. * @param [result] - The object onto which to store the result.
  1018. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1019. */
  1020. static fromRectangle2D(rectangle?: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere;
  1021. /**
  1022. * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the
  1023. * object's minimum and maximum heights over the rectangle.
  1024. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1025. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  1026. * @param [minimumHeight = 0.0] - The minimum height over the rectangle.
  1027. * @param [maximumHeight = 0.0] - The maximum height over the rectangle.
  1028. * @param [result] - The object onto which to store the result.
  1029. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1030. */
  1031. static fromRectangleWithHeights2D(rectangle?: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere;
  1032. /**
  1033. * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points
  1034. * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
  1035. * @param [rectangle] - The valid rectangle used to create a bounding sphere.
  1036. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  1037. * @param [surfaceHeight = 0.0] - The height above the surface of the ellipsoid.
  1038. * @param [result] - The object onto which to store the result.
  1039. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1040. */
  1041. static fromRectangle3D(rectangle?: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere;
  1042. /**
  1043. * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
  1044. * stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two
  1045. * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1046. * ensure a tight fit.
  1047. * @example
  1048. * // Compute the bounding sphere from 3 positions, each specified relative to a center.
  1049. * // In addition to the X, Y, and Z coordinates, the points array contains two additional
  1050. * // elements per point which are ignored for the purpose of computing the bounding sphere.
  1051. * var center = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  1052. * var points = [1.0, 2.0, 3.0, 0.1, 0.2,
  1053. * 4.0, 5.0, 6.0, 0.1, 0.2,
  1054. * 7.0, 8.0, 9.0, 0.1, 0.2];
  1055. * var sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);
  1056. * @param [positions] - An array of points that the bounding sphere will enclose. Each point
  1057. * is formed from three elements in the array in the order X, Y, Z.
  1058. * @param [center = Cartesian3.ZERO] - The position to which the positions are relative, which need not be the
  1059. * origin of the coordinate system. This is useful when the positions are to be used for
  1060. * relative-to-center (RTC) rendering.
  1061. * @param [stride = 3] - The number of array elements per vertex. It must be at least 3, but it may
  1062. * be higher. Regardless of the value of this parameter, the X coordinate of the first position
  1063. * is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index
  1064. * 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If
  1065. * the stride is 5, however, two array elements are skipped and the next position begins at array
  1066. * index 5.
  1067. * @param [result] - The object onto which to store the result.
  1068. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1069. */
  1070. static fromVertices(positions?: number[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere;
  1071. /**
  1072. * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are
  1073. * stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two
  1074. * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1075. * ensure a tight fit.
  1076. * @param [positionsHigh] - An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1077. * is formed from three elements in the array in the order X, Y, Z.
  1078. * @param [positionsLow] - An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1079. * is formed from three elements in the array in the order X, Y, Z.
  1080. * @param [result] - The object onto which to store the result.
  1081. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1082. */
  1083. static fromEncodedCartesianVertices(positionsHigh?: number[], positionsLow?: number[], result?: BoundingSphere): BoundingSphere;
  1084. /**
  1085. * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
  1086. * tighly and fully encompases the box.
  1087. * @example
  1088. * // Create a bounding sphere around the unit cube
  1089. * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));
  1090. * @param [corner] - The minimum height over the rectangle.
  1091. * @param [oppositeCorner] - The maximum height over the rectangle.
  1092. * @param [result] - The object onto which to store the result.
  1093. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1094. */
  1095. static fromCornerPoints(corner?: Cartesian3, oppositeCorner?: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1096. /**
  1097. * Creates a bounding sphere encompassing an ellipsoid.
  1098. * @example
  1099. * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
  1100. * @param ellipsoid - The ellipsoid around which to create a bounding sphere.
  1101. * @param [result] - The object onto which to store the result.
  1102. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1103. */
  1104. static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere;
  1105. /**
  1106. * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.
  1107. * @param [boundingSpheres] - The array of bounding spheres.
  1108. * @param [result] - The object onto which to store the result.
  1109. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1110. */
  1111. static fromBoundingSpheres(boundingSpheres?: BoundingSphere[], result?: BoundingSphere): BoundingSphere;
  1112. /**
  1113. * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.
  1114. * @param orientedBoundingBox - The oriented bounding box.
  1115. * @param [result] - The object onto which to store the result.
  1116. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1117. */
  1118. static fromOrientedBoundingBox(orientedBoundingBox: OrientedBoundingBox, result?: BoundingSphere): BoundingSphere;
  1119. /**
  1120. * Duplicates a BoundingSphere instance.
  1121. * @param sphere - The bounding sphere to duplicate.
  1122. * @param [result] - The object onto which to store the result.
  1123. * @returns The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)
  1124. */
  1125. static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1126. /**
  1127. * The number of elements used to pack the object into an array.
  1128. */
  1129. static packedLength: number;
  1130. /**
  1131. * Stores the provided instance into the provided array.
  1132. * @param value - The value to pack.
  1133. * @param array - The array to pack into.
  1134. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1135. * @returns The array that was packed into
  1136. */
  1137. static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[];
  1138. /**
  1139. * Retrieves an instance from a packed array.
  1140. * @param array - The packed array.
  1141. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1142. * @param [result] - The object into which to store the result.
  1143. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1144. */
  1145. static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere;
  1146. /**
  1147. * Computes a bounding sphere that contains both the left and right bounding spheres.
  1148. * @param left - A sphere to enclose in a bounding sphere.
  1149. * @param right - A sphere to enclose in a bounding sphere.
  1150. * @param [result] - The object onto which to store the result.
  1151. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1152. */
  1153. static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1154. /**
  1155. * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.
  1156. * @param sphere - A sphere to expand.
  1157. * @param point - A point to enclose in a bounding sphere.
  1158. * @param [result] - The object onto which to store the result.
  1159. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1160. */
  1161. static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1162. /**
  1163. * Determines which side of a plane a sphere is located.
  1164. * @param sphere - The bounding sphere to test.
  1165. * @param plane - The plane to test against.
  1166. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1167. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1168. * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1169. * intersects the plane.
  1170. */
  1171. static intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect;
  1172. /**
  1173. * Applies a 4x4 affine transformation matrix to a bounding sphere.
  1174. * @param sphere - The bounding sphere to apply the transformation to.
  1175. * @param transform - The transformation matrix to apply to the bounding sphere.
  1176. * @param [result] - The object onto which to store the result.
  1177. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1178. */
  1179. static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1180. /**
  1181. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1182. * @example
  1183. * // Sort bounding spheres from back to front
  1184. * spheres.sort(function(a, b) {
  1185. * return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);
  1186. * });
  1187. * @param sphere - The sphere.
  1188. * @param cartesian - The point
  1189. * @returns The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.
  1190. */
  1191. static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number;
  1192. /**
  1193. * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale
  1194. * The transformation matrix is not verified to have a uniform scale of 1.
  1195. * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.
  1196. * @example
  1197. * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);
  1198. * var boundingSphere = new Cesium.BoundingSphere();
  1199. * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);
  1200. * @param sphere - The bounding sphere to apply the transformation to.
  1201. * @param transform - The transformation matrix to apply to the bounding sphere.
  1202. * @param [result] - The object onto which to store the result.
  1203. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1204. */
  1205. static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1206. /**
  1207. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1208. * plus/minus the radius of the bounding sphere.
  1209. * <br>
  1210. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1211. * closest and farthest planes from position that intersect the bounding sphere.
  1212. * @param sphere - The bounding sphere to calculate the distance to.
  1213. * @param position - The position to calculate the distance from.
  1214. * @param direction - The direction from position.
  1215. * @param [result] - A Interval to store the nearest and farthest distances.
  1216. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1217. */
  1218. static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1219. /**
  1220. * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.
  1221. * @param sphere - The bounding sphere to transform to 2D.
  1222. * @param [projection = GeographicProjection] - The projection to 2D.
  1223. * @param [result] - The object onto which to store the result.
  1224. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1225. */
  1226. static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere;
  1227. /**
  1228. * Determines whether or not a sphere is hidden from view by the occluder.
  1229. * @param sphere - The bounding sphere surrounding the occludee object.
  1230. * @param occluder - The occluder.
  1231. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1232. */
  1233. static isOccluded(sphere: BoundingSphere, occluder: Occluder): boolean;
  1234. /**
  1235. * Compares the provided BoundingSphere componentwise and returns
  1236. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1237. * @param [left] - The first BoundingSphere.
  1238. * @param [right] - The second BoundingSphere.
  1239. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1240. */
  1241. static equals(left?: BoundingSphere, right?: BoundingSphere): boolean;
  1242. /**
  1243. * Determines which side of a plane the sphere is located.
  1244. * @param plane - The plane to test against.
  1245. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1246. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1247. * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1248. * intersects the plane.
  1249. */
  1250. intersectPlane(plane: Plane): Intersect;
  1251. /**
  1252. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1253. * @example
  1254. * // Sort bounding spheres from back to front
  1255. * spheres.sort(function(a, b) {
  1256. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  1257. * });
  1258. * @param cartesian - The point
  1259. * @returns The estimated distance squared from the bounding sphere to the point.
  1260. */
  1261. distanceSquaredTo(cartesian: Cartesian3): number;
  1262. /**
  1263. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1264. * plus/minus the radius of the bounding sphere.
  1265. * <br>
  1266. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1267. * closest and farthest planes from position that intersect the bounding sphere.
  1268. * @param position - The position to calculate the distance from.
  1269. * @param direction - The direction from position.
  1270. * @param [result] - A Interval to store the nearest and farthest distances.
  1271. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1272. */
  1273. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1274. /**
  1275. * Determines whether or not a sphere is hidden from view by the occluder.
  1276. * @param occluder - The occluder.
  1277. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1278. */
  1279. isOccluded(occluder: Occluder): boolean;
  1280. /**
  1281. * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns
  1282. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1283. * @param [right] - The right hand side BoundingSphere.
  1284. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1285. */
  1286. equals(right?: BoundingSphere): boolean;
  1287. /**
  1288. * Duplicates this BoundingSphere instance.
  1289. * @param [result] - The object onto which to store the result.
  1290. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1291. */
  1292. clone(result?: BoundingSphere): BoundingSphere;
  1293. /**
  1294. * Computes the radius of the BoundingSphere.
  1295. * @returns The radius of the BoundingSphere.
  1296. */
  1297. volume(): number;
  1298. }
  1299. /**
  1300. * Describes a cube centered at the origin.
  1301. * @example
  1302. * var box = new Cesium.BoxGeometry({
  1303. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1304. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1305. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1306. * });
  1307. * var geometry = Cesium.BoxGeometry.createGeometry(box);
  1308. * @param options - Object with the following properties:
  1309. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1310. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1311. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1312. */
  1313. export class BoxGeometry {
  1314. constructor(options: {
  1315. minimum: Cartesian3;
  1316. maximum: Cartesian3;
  1317. vertexFormat?: VertexFormat;
  1318. });
  1319. /**
  1320. * Creates a cube centered at the origin given its dimensions.
  1321. * @example
  1322. * var box = Cesium.BoxGeometry.fromDimensions({
  1323. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1324. * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1325. * });
  1326. * var geometry = Cesium.BoxGeometry.createGeometry(box);
  1327. * @param options - Object with the following properties:
  1328. * @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.
  1329. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1330. */
  1331. static fromDimensions(options: {
  1332. dimensions: Cartesian3;
  1333. vertexFormat?: VertexFormat;
  1334. }): BoxGeometry;
  1335. /**
  1336. * Creates a cube from the dimensions of an AxisAlignedBoundingBox.
  1337. * @example
  1338. * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1339. * -72.0, 40.0,
  1340. * -70.0, 35.0,
  1341. * -75.0, 30.0,
  1342. * -70.0, 30.0,
  1343. * -68.0, 40.0
  1344. * ]));
  1345. * var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
  1346. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1347. */
  1348. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxGeometry;
  1349. /**
  1350. * The number of elements used to pack the object into an array.
  1351. */
  1352. static packedLength: number;
  1353. /**
  1354. * Stores the provided instance into the provided array.
  1355. * @param value - The value to pack.
  1356. * @param array - The array to pack into.
  1357. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1358. * @returns The array that was packed into
  1359. */
  1360. static pack(value: BoxGeometry, array: number[], startingIndex?: number): number[];
  1361. /**
  1362. * Retrieves an instance from a packed array.
  1363. * @param array - The packed array.
  1364. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1365. * @param [result] - The object into which to store the result.
  1366. * @returns The modified result parameter or a new BoxGeometry instance if one was not provided.
  1367. */
  1368. static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry;
  1369. /**
  1370. * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
  1371. * @param boxGeometry - A description of the box.
  1372. * @returns The computed vertices and indices.
  1373. */
  1374. static createGeometry(boxGeometry: BoxGeometry): Geometry | undefined;
  1375. }
  1376. /**
  1377. * A description of the outline of a cube centered at the origin.
  1378. * @example
  1379. * var box = new Cesium.BoxOutlineGeometry({
  1380. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1381. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1382. * });
  1383. * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1384. * @param options - Object with the following properties:
  1385. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1386. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1387. */
  1388. export class BoxOutlineGeometry {
  1389. constructor(options: {
  1390. minimum: Cartesian3;
  1391. maximum: Cartesian3;
  1392. });
  1393. /**
  1394. * Creates an outline of a cube centered at the origin given its dimensions.
  1395. * @example
  1396. * var box = Cesium.BoxOutlineGeometry.fromDimensions({
  1397. * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1398. * });
  1399. * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1400. * @param options - Object with the following properties:
  1401. * @param options.dimensions - The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.
  1402. */
  1403. static fromDimensions(options: {
  1404. dimensions: Cartesian3;
  1405. }): BoxOutlineGeometry;
  1406. /**
  1407. * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.
  1408. * @example
  1409. * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1410. * -72.0, 40.0,
  1411. * -70.0, 35.0,
  1412. * -75.0, 30.0,
  1413. * -70.0, 30.0,
  1414. * -68.0, 40.0
  1415. * ]));
  1416. * var box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);
  1417. *
  1418. *
  1419. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1420. */
  1421. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxOutlineGeometry;
  1422. /**
  1423. * The number of elements used to pack the object into an array.
  1424. */
  1425. static packedLength: number;
  1426. /**
  1427. * Stores the provided instance into the provided array.
  1428. * @param value - The value to pack.
  1429. * @param array - The array to pack into.
  1430. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1431. * @returns The array that was packed into
  1432. */
  1433. static pack(value: BoxOutlineGeometry, array: number[], startingIndex?: number): number[];
  1434. /**
  1435. * Retrieves an instance from a packed array.
  1436. * @param array - The packed array.
  1437. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1438. * @param [result] - The object into which to store the result.
  1439. * @returns The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.
  1440. */
  1441. static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry;
  1442. /**
  1443. * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.
  1444. * @param boxGeometry - A description of the box outline.
  1445. * @returns The computed vertices and indices.
  1446. */
  1447. static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry | undefined;
  1448. }
  1449. /**
  1450. * A 2D Cartesian point.
  1451. * @param [x = 0.0] - The X component.
  1452. * @param [y = 0.0] - The Y component.
  1453. */
  1454. export class Cartesian2 {
  1455. constructor(x?: number, y?: number);
  1456. /**
  1457. * The X component.
  1458. */
  1459. x: number;
  1460. /**
  1461. * The Y component.
  1462. */
  1463. y: number;
  1464. /**
  1465. * Creates a Cartesian2 instance from x and y coordinates.
  1466. * @param x - The x coordinate.
  1467. * @param y - The y coordinate.
  1468. * @param [result] - The object onto which to store the result.
  1469. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1470. */
  1471. static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2;
  1472. /**
  1473. * Duplicates a Cartesian2 instance.
  1474. * @param cartesian - The Cartesian to duplicate.
  1475. * @param [result] - The object onto which to store the result.
  1476. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1477. */
  1478. static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2;
  1479. /**
  1480. * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
  1481. * x and y properties of the Cartesian3 and drops z.
  1482. * @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from.
  1483. * @param [result] - The object onto which to store the result.
  1484. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1485. */
  1486. static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  1487. /**
  1488. * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
  1489. * x and y properties of the Cartesian4 and drops z and w.
  1490. * @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from.
  1491. * @param [result] - The object onto which to store the result.
  1492. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1493. */
  1494. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2;
  1495. /**
  1496. * The number of elements used to pack the object into an array.
  1497. */
  1498. static packedLength: number;
  1499. /**
  1500. * Stores the provided instance into the provided array.
  1501. * @param value - The value to pack.
  1502. * @param array - The array to pack into.
  1503. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1504. * @returns The array that was packed into
  1505. */
  1506. static pack(value: Cartesian2, array: number[], startingIndex?: number): number[];
  1507. /**
  1508. * Retrieves an instance from a packed array.
  1509. * @param array - The packed array.
  1510. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1511. * @param [result] - The object into which to store the result.
  1512. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1513. */
  1514. static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1515. /**
  1516. * Flattens an array of Cartesian2s into and array of components.
  1517. * @param array - The array of cartesians to pack.
  1518. * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.
  1519. * @returns The packed array.
  1520. */
  1521. static packArray(array: Cartesian2[], result?: number[]): number[];
  1522. /**
  1523. * Unpacks an array of cartesian components into and array of Cartesian2s.
  1524. * @param array - The array of components to unpack.
  1525. * @param [result] - The array onto which to store the result.
  1526. * @returns The unpacked array.
  1527. */
  1528. static unpackArray(array: number[], result?: Cartesian2[]): Cartesian2[];
  1529. /**
  1530. * Creates a Cartesian2 from two consecutive elements in an array.
  1531. * @example
  1532. * // Create a Cartesian2 with (1.0, 2.0)
  1533. * var v = [1.0, 2.0];
  1534. * var p = Cesium.Cartesian2.fromArray(v);
  1535. *
  1536. * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
  1537. * var v2 = [0.0, 0.0, 1.0, 2.0];
  1538. * var p2 = Cesium.Cartesian2.fromArray(v2, 2);
  1539. * @param array - The array whose two consecutive elements correspond to the x and y components, respectively.
  1540. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1541. * @param [result] - The object onto which to store the result.
  1542. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1543. */
  1544. static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1545. /**
  1546. * Computes the value of the maximum component for the supplied Cartesian.
  1547. * @param cartesian - The cartesian to use.
  1548. * @returns The value of the maximum component.
  1549. */
  1550. static maximumComponent(cartesian: Cartesian2): number;
  1551. /**
  1552. * Computes the value of the minimum component for the supplied Cartesian.
  1553. * @param cartesian - The cartesian to use.
  1554. * @returns The value of the minimum component.
  1555. */
  1556. static minimumComponent(cartesian: Cartesian2): number;
  1557. /**
  1558. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1559. * @param first - A cartesian to compare.
  1560. * @param second - A cartesian to compare.
  1561. * @param result - The object into which to store the result.
  1562. * @returns A cartesian with the minimum components.
  1563. */
  1564. static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1565. /**
  1566. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1567. * @param first - A cartesian to compare.
  1568. * @param second - A cartesian to compare.
  1569. * @param result - The object into which to store the result.
  1570. * @returns A cartesian with the maximum components.
  1571. */
  1572. static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1573. /**
  1574. * Computes the provided Cartesian's squared magnitude.
  1575. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1576. * @returns The squared magnitude.
  1577. */
  1578. static magnitudeSquared(cartesian: Cartesian2): number;
  1579. /**
  1580. * Computes the Cartesian's magnitude (length).
  1581. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1582. * @returns The magnitude.
  1583. */
  1584. static magnitude(cartesian: Cartesian2): number;
  1585. /**
  1586. * Computes the distance between two points.
  1587. * @example
  1588. * // Returns 1.0
  1589. * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
  1590. * @param left - The first point to compute the distance from.
  1591. * @param right - The second point to compute the distance to.
  1592. * @returns The distance between two points.
  1593. */
  1594. static distance(left: Cartesian2, right: Cartesian2): number;
  1595. /**
  1596. * Computes the squared distance between two points. Comparing squared distances
  1597. * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
  1598. * @example
  1599. * // Returns 4.0, not 2.0
  1600. * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
  1601. * @param left - The first point to compute the distance from.
  1602. * @param right - The second point to compute the distance to.
  1603. * @returns The distance between two points.
  1604. */
  1605. static distanceSquared(left: Cartesian2, right: Cartesian2): number;
  1606. /**
  1607. * Computes the normalized form of the supplied Cartesian.
  1608. * @param cartesian - The Cartesian to be normalized.
  1609. * @param result - The object onto which to store the result.
  1610. * @returns The modified result parameter.
  1611. */
  1612. static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1613. /**
  1614. * Computes the dot (scalar) product of two Cartesians.
  1615. * @param left - The first Cartesian.
  1616. * @param right - The second Cartesian.
  1617. * @returns The dot product.
  1618. */
  1619. static dot(left: Cartesian2, right: Cartesian2): number;
  1620. /**
  1621. * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0
  1622. * @param left - The first Cartesian.
  1623. * @param right - The second Cartesian.
  1624. * @returns The cross product.
  1625. */
  1626. static cross(left: Cartesian2, right: Cartesian2): number;
  1627. /**
  1628. * Computes the componentwise product of two Cartesians.
  1629. * @param left - The first Cartesian.
  1630. * @param right - The second Cartesian.
  1631. * @param result - The object onto which to store the result.
  1632. * @returns The modified result parameter.
  1633. */
  1634. static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1635. /**
  1636. * Computes the componentwise quotient of two Cartesians.
  1637. * @param left - The first Cartesian.
  1638. * @param right - The second Cartesian.
  1639. * @param result - The object onto which to store the result.
  1640. * @returns The modified result parameter.
  1641. */
  1642. static divideComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1643. /**
  1644. * Computes the componentwise sum of two Cartesians.
  1645. * @param left - The first Cartesian.
  1646. * @param right - The second Cartesian.
  1647. * @param result - The object onto which to store the result.
  1648. * @returns The modified result parameter.
  1649. */
  1650. static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1651. /**
  1652. * Computes the componentwise difference of two Cartesians.
  1653. * @param left - The first Cartesian.
  1654. * @param right - The second Cartesian.
  1655. * @param result - The object onto which to store the result.
  1656. * @returns The modified result parameter.
  1657. */
  1658. static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1659. /**
  1660. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1661. * @param cartesian - The Cartesian to be scaled.
  1662. * @param scalar - The scalar to multiply with.
  1663. * @param result - The object onto which to store the result.
  1664. * @returns The modified result parameter.
  1665. */
  1666. static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1667. /**
  1668. * Divides the provided Cartesian componentwise by the provided scalar.
  1669. * @param cartesian - The Cartesian to be divided.
  1670. * @param scalar - The scalar to divide by.
  1671. * @param result - The object onto which to store the result.
  1672. * @returns The modified result parameter.
  1673. */
  1674. static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1675. /**
  1676. * Negates the provided Cartesian.
  1677. * @param cartesian - The Cartesian to be negated.
  1678. * @param result - The object onto which to store the result.
  1679. * @returns The modified result parameter.
  1680. */
  1681. static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1682. /**
  1683. * Computes the absolute value of the provided Cartesian.
  1684. * @param cartesian - The Cartesian whose absolute value is to be computed.
  1685. * @param result - The object onto which to store the result.
  1686. * @returns The modified result parameter.
  1687. */
  1688. static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1689. /**
  1690. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  1691. * @param start - The value corresponding to t at 0.0.
  1692. * @param end - The value corresponding to t at 1.0.
  1693. * @param t - The point along t at which to interpolate.
  1694. * @param result - The object onto which to store the result.
  1695. * @returns The modified result parameter.
  1696. */
  1697. static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2;
  1698. /**
  1699. * Returns the angle, in radians, between the provided Cartesians.
  1700. * @param left - The first Cartesian.
  1701. * @param right - The second Cartesian.
  1702. * @returns The angle between the Cartesians.
  1703. */
  1704. static angleBetween(left: Cartesian2, right: Cartesian2): number;
  1705. /**
  1706. * Returns the axis that is most orthogonal to the provided Cartesian.
  1707. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  1708. * @param result - The object onto which to store the result.
  1709. * @returns The most orthogonal axis.
  1710. */
  1711. static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1712. /**
  1713. * Compares the provided Cartesians componentwise and returns
  1714. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1715. * @param [left] - The first Cartesian.
  1716. * @param [right] - The second Cartesian.
  1717. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1718. */
  1719. static equals(left?: Cartesian2, right?: Cartesian2): boolean;
  1720. /**
  1721. * Compares the provided Cartesians componentwise and returns
  1722. * <code>true</code> if they pass an absolute or relative tolerance test,
  1723. * <code>false</code> otherwise.
  1724. * @param [left] - The first Cartesian.
  1725. * @param [right] - The second Cartesian.
  1726. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1727. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1728. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  1729. */
  1730. static equalsEpsilon(left?: Cartesian2, right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1731. /**
  1732. * An immutable Cartesian2 instance initialized to (0.0, 0.0).
  1733. */
  1734. static readonly ZERO: Cartesian2;
  1735. /**
  1736. * An immutable Cartesian2 instance initialized to (1.0, 1.0).
  1737. */
  1738. static readonly ONE: Cartesian2;
  1739. /**
  1740. * An immutable Cartesian2 instance initialized to (1.0, 0.0).
  1741. */
  1742. static readonly UNIT_X: Cartesian2;
  1743. /**
  1744. * An immutable Cartesian2 instance initialized to (0.0, 1.0).
  1745. */
  1746. static readonly UNIT_Y: Cartesian2;
  1747. /**
  1748. * Duplicates this Cartesian2 instance.
  1749. * @param [result] - The object onto which to store the result.
  1750. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1751. */
  1752. clone(result?: Cartesian2): Cartesian2;
  1753. /**
  1754. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1755. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1756. * @param [right] - The right hand side Cartesian.
  1757. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1758. */
  1759. equals(right?: Cartesian2): boolean;
  1760. /**
  1761. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1762. * <code>true</code> if they pass an absolute or relative tolerance test,
  1763. * <code>false</code> otherwise.
  1764. * @param [right] - The right hand side Cartesian.
  1765. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1766. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1767. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  1768. */
  1769. equalsEpsilon(right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1770. /**
  1771. * Creates a string representing this Cartesian in the format '(x, y)'.
  1772. * @returns A string representing the provided Cartesian in the format '(x, y)'.
  1773. */
  1774. toString(): string;
  1775. }
  1776. /**
  1777. * A 3D Cartesian point.
  1778. * @param [x = 0.0] - The X component.
  1779. * @param [y = 0.0] - The Y component.
  1780. * @param [z = 0.0] - The Z component.
  1781. */
  1782. export class Cartesian3 {
  1783. constructor(x?: number, y?: number, z?: number);
  1784. /**
  1785. * The X component.
  1786. */
  1787. x: number;
  1788. /**
  1789. * The Y component.
  1790. */
  1791. y: number;
  1792. /**
  1793. * The Z component.
  1794. */
  1795. z: number;
  1796. /**
  1797. * Converts the provided Spherical into Cartesian3 coordinates.
  1798. * @param spherical - The Spherical to be converted to Cartesian3.
  1799. * @param [result] - The object onto which to store the result.
  1800. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1801. */
  1802. static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3;
  1803. /**
  1804. * Creates a Cartesian3 instance from x, y and z coordinates.
  1805. * @param x - The x coordinate.
  1806. * @param y - The y coordinate.
  1807. * @param z - The z coordinate.
  1808. * @param [result] - The object onto which to store the result.
  1809. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1810. */
  1811. static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3;
  1812. /**
  1813. * Duplicates a Cartesian3 instance.
  1814. * @param cartesian - The Cartesian to duplicate.
  1815. * @param [result] - The object onto which to store the result.
  1816. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1817. */
  1818. static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  1819. /**
  1820. * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the
  1821. * x, y, and z properties of the Cartesian4 and drops w.
  1822. * @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from.
  1823. * @param [result] - The object onto which to store the result.
  1824. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1825. */
  1826. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3;
  1827. /**
  1828. * The number of elements used to pack the object into an array.
  1829. */
  1830. static packedLength: number;
  1831. /**
  1832. * Stores the provided instance into the provided array.
  1833. * @param value - The value to pack.
  1834. * @param array - The array to pack into.
  1835. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1836. * @returns The array that was packed into
  1837. */
  1838. static pack(value: Cartesian3, array: number[], startingIndex?: number): number[];
  1839. /**
  1840. * Retrieves an instance from a packed array.
  1841. * @param array - The packed array.
  1842. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1843. * @param [result] - The object into which to store the result.
  1844. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1845. */
  1846. static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1847. /**
  1848. * Flattens an array of Cartesian3s into an array of components.
  1849. * @param array - The array of cartesians to pack.
  1850. * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements.
  1851. * @returns The packed array.
  1852. */
  1853. static packArray(array: Cartesian3[], result?: number[]): number[];
  1854. /**
  1855. * Unpacks an array of cartesian components into an array of Cartesian3s.
  1856. * @param array - The array of components to unpack.
  1857. * @param [result] - The array onto which to store the result.
  1858. * @returns The unpacked array.
  1859. */
  1860. static unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[];
  1861. /**
  1862. * Creates a Cartesian3 from three consecutive elements in an array.
  1863. * @example
  1864. * // Create a Cartesian3 with (1.0, 2.0, 3.0)
  1865. * var v = [1.0, 2.0, 3.0];
  1866. * var p = Cesium.Cartesian3.fromArray(v);
  1867. *
  1868. * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array
  1869. * var v2 = [0.0, 0.0, 1.0, 2.0, 3.0];
  1870. * var p2 = Cesium.Cartesian3.fromArray(v2, 2);
  1871. * @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively.
  1872. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1873. * @param [result] - The object onto which to store the result.
  1874. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1875. */
  1876. static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1877. /**
  1878. * Computes the value of the maximum component for the supplied Cartesian.
  1879. * @param cartesian - The cartesian to use.
  1880. * @returns The value of the maximum component.
  1881. */
  1882. static maximumComponent(cartesian: Cartesian3): number;
  1883. /**
  1884. * Computes the value of the minimum component for the supplied Cartesian.
  1885. * @param cartesian - The cartesian to use.
  1886. * @returns The value of the minimum component.
  1887. */
  1888. static minimumComponent(cartesian: Cartesian3): number;
  1889. /**
  1890. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1891. * @param first - A cartesian to compare.
  1892. * @param second - A cartesian to compare.
  1893. * @param result - The object into which to store the result.
  1894. * @returns A cartesian with the minimum components.
  1895. */
  1896. static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1897. /**
  1898. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1899. * @param first - A cartesian to compare.
  1900. * @param second - A cartesian to compare.
  1901. * @param result - The object into which to store the result.
  1902. * @returns A cartesian with the maximum components.
  1903. */
  1904. static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1905. /**
  1906. * Computes the provided Cartesian's squared magnitude.
  1907. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1908. * @returns The squared magnitude.
  1909. */
  1910. static magnitudeSquared(cartesian: Cartesian3): number;
  1911. /**
  1912. * Computes the Cartesian's magnitude (length).
  1913. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1914. * @returns The magnitude.
  1915. */
  1916. static magnitude(cartesian: Cartesian3): number;
  1917. /**
  1918. * Computes the distance between two points.
  1919. * @example
  1920. * // Returns 1.0
  1921. * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
  1922. * @param left - The first point to compute the distance from.
  1923. * @param right - The second point to compute the distance to.
  1924. * @returns The distance between two points.
  1925. */
  1926. static distance(left: Cartesian3, right: Cartesian3): number;
  1927. /**
  1928. * Computes the squared distance between two points. Comparing squared distances
  1929. * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.
  1930. * @example
  1931. * // Returns 4.0, not 2.0
  1932. * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));
  1933. * @param left - The first point to compute the distance from.
  1934. * @param right - The second point to compute the distance to.
  1935. * @returns The distance between two points.
  1936. */
  1937. static distanceSquared(left: Cartesian3, right: Cartesian3): number;
  1938. /**
  1939. * Computes the normalized form of the supplied Cartesian.
  1940. * @param cartesian - The Cartesian to be normalized.
  1941. * @param result - The object onto which to store the result.
  1942. * @returns The modified result parameter.
  1943. */
  1944. static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1945. /**
  1946. * Computes the dot (scalar) product of two Cartesians.
  1947. * @param left - The first Cartesian.
  1948. * @param right - The second Cartesian.
  1949. * @returns The dot product.
  1950. */
  1951. static dot(left: Cartesian3, right: Cartesian3): number;
  1952. /**
  1953. * Computes the componentwise product of two Cartesians.
  1954. * @param left - The first Cartesian.
  1955. * @param right - The second Cartesian.
  1956. * @param result - The object onto which to store the result.
  1957. * @returns The modified result parameter.
  1958. */
  1959. static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1960. /**
  1961. * Computes the componentwise quotient of two Cartesians.
  1962. * @param left - The first Cartesian.
  1963. * @param right - The second Cartesian.
  1964. * @param result - The object onto which to store the result.
  1965. * @returns The modified result parameter.
  1966. */
  1967. static divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1968. /**
  1969. * Computes the componentwise sum of two Cartesians.
  1970. * @param left - The first Cartesian.
  1971. * @param right - The second Cartesian.
  1972. * @param result - The object onto which to store the result.
  1973. * @returns The modified result parameter.
  1974. */
  1975. static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1976. /**
  1977. * Computes the componentwise difference of two Cartesians.
  1978. * @param left - The first Cartesian.
  1979. * @param right - The second Cartesian.
  1980. * @param result - The object onto which to store the result.
  1981. * @returns The modified result parameter.
  1982. */
  1983. static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1984. /**
  1985. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1986. * @param cartesian - The Cartesian to be scaled.
  1987. * @param scalar - The scalar to multiply with.
  1988. * @param result - The object onto which to store the result.
  1989. * @returns The modified result parameter.
  1990. */
  1991. static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  1992. /**
  1993. * Divides the provided Cartesian componentwise by the provided scalar.
  1994. * @param cartesian - The Cartesian to be divided.
  1995. * @param scalar - The scalar to divide by.
  1996. * @param result - The object onto which to store the result.
  1997. * @returns The modified result parameter.
  1998. */
  1999. static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  2000. /**
  2001. * Negates the provided Cartesian.
  2002. * @param cartesian - The Cartesian to be negated.
  2003. * @param result - The object onto which to store the result.
  2004. * @returns The modified result parameter.
  2005. */
  2006. static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2007. /**
  2008. * Computes the absolute value of the provided Cartesian.
  2009. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2010. * @param result - The object onto which to store the result.
  2011. * @returns The modified result parameter.
  2012. */
  2013. static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2014. /**
  2015. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2016. * @param start - The value corresponding to t at 0.0.
  2017. * @param end - The value corresponding to t at 1.0.
  2018. * @param t - The point along t at which to interpolate.
  2019. * @param result - The object onto which to store the result.
  2020. * @returns The modified result parameter.
  2021. */
  2022. static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3;
  2023. /**
  2024. * Returns the angle, in radians, between the provided Cartesians.
  2025. * @param left - The first Cartesian.
  2026. * @param right - The second Cartesian.
  2027. * @returns The angle between the Cartesians.
  2028. */
  2029. static angleBetween(left: Cartesian3, right: Cartesian3): number;
  2030. /**
  2031. * Returns the axis that is most orthogonal to the provided Cartesian.
  2032. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2033. * @param result - The object onto which to store the result.
  2034. * @returns The most orthogonal axis.
  2035. */
  2036. static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2037. /**
  2038. * Projects vector a onto vector b
  2039. * @param a - The vector that needs projecting
  2040. * @param b - The vector to project onto
  2041. * @param result - The result cartesian
  2042. * @returns The modified result parameter
  2043. */
  2044. static projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3;
  2045. /**
  2046. * Compares the provided Cartesians componentwise and returns
  2047. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2048. * @param [left] - The first Cartesian.
  2049. * @param [right] - The second Cartesian.
  2050. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2051. */
  2052. static equals(left?: Cartesian3, right?: Cartesian3): boolean;
  2053. /**
  2054. * Compares the provided Cartesians componentwise and returns
  2055. * <code>true</code> if they pass an absolute or relative tolerance test,
  2056. * <code>false</code> otherwise.
  2057. * @param [left] - The first Cartesian.
  2058. * @param [right] - The second Cartesian.
  2059. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2060. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2061. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2062. */
  2063. static equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2064. /**
  2065. * Computes the cross (outer) product of two Cartesians.
  2066. * @param left - The first Cartesian.
  2067. * @param right - The second Cartesian.
  2068. * @param result - The object onto which to store the result.
  2069. * @returns The cross product.
  2070. */
  2071. static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2072. /**
  2073. * Computes the midpoint between the right and left Cartesian.
  2074. * @param left - The first Cartesian.
  2075. * @param right - The second Cartesian.
  2076. * @param result - The object onto which to store the result.
  2077. * @returns The midpoint.
  2078. */
  2079. static midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2080. /**
  2081. * Returns a Cartesian3 position from longitude and latitude values given in degrees.
  2082. * @example
  2083. * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
  2084. * @param longitude - The longitude, in degrees
  2085. * @param latitude - The latitude, in degrees
  2086. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2087. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2088. * @param [result] - The object onto which to store the result.
  2089. * @returns The position
  2090. */
  2091. static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2092. /**
  2093. * Returns a Cartesian3 position from longitude and latitude values given in radians.
  2094. * @example
  2095. * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
  2096. * @param longitude - The longitude, in radians
  2097. * @param latitude - The latitude, in radians
  2098. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2099. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2100. * @param [result] - The object onto which to store the result.
  2101. * @returns The position
  2102. */
  2103. static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2104. /**
  2105. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
  2106. * @example
  2107. * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
  2108. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2109. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2110. * @param [result] - An array of Cartesian3 objects to store the result.
  2111. * @returns The array of positions.
  2112. */
  2113. static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2114. /**
  2115. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
  2116. * @example
  2117. * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
  2118. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2119. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2120. * @param [result] - An array of Cartesian3 objects to store the result.
  2121. * @returns The array of positions.
  2122. */
  2123. static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2124. /**
  2125. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
  2126. * @example
  2127. * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
  2128. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2129. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2130. * @param [result] - An array of Cartesian3 objects to store the result.
  2131. * @returns The array of positions.
  2132. */
  2133. static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2134. /**
  2135. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
  2136. * @example
  2137. * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
  2138. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2139. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2140. * @param [result] - An array of Cartesian3 objects to store the result.
  2141. * @returns The array of positions.
  2142. */
  2143. static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2144. /**
  2145. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
  2146. */
  2147. static readonly ZERO: Cartesian3;
  2148. /**
  2149. * An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).
  2150. */
  2151. static readonly ONE: Cartesian3;
  2152. /**
  2153. * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
  2154. */
  2155. static readonly UNIT_X: Cartesian3;
  2156. /**
  2157. * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
  2158. */
  2159. static readonly UNIT_Y: Cartesian3;
  2160. /**
  2161. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
  2162. */
  2163. static readonly UNIT_Z: Cartesian3;
  2164. /**
  2165. * Duplicates this Cartesian3 instance.
  2166. * @param [result] - The object onto which to store the result.
  2167. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  2168. */
  2169. clone(result?: Cartesian3): Cartesian3;
  2170. /**
  2171. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2172. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2173. * @param [right] - The right hand side Cartesian.
  2174. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2175. */
  2176. equals(right?: Cartesian3): boolean;
  2177. /**
  2178. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2179. * <code>true</code> if they pass an absolute or relative tolerance test,
  2180. * <code>false</code> otherwise.
  2181. * @param [right] - The right hand side Cartesian.
  2182. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2183. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2184. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2185. */
  2186. equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2187. /**
  2188. * Creates a string representing this Cartesian in the format '(x, y, z)'.
  2189. * @returns A string representing this Cartesian in the format '(x, y, z)'.
  2190. */
  2191. toString(): string;
  2192. }
  2193. /**
  2194. * A 4D Cartesian point.
  2195. * @param [x = 0.0] - The X component.
  2196. * @param [y = 0.0] - The Y component.
  2197. * @param [z = 0.0] - The Z component.
  2198. * @param [w = 0.0] - The W component.
  2199. */
  2200. export class Cartesian4 {
  2201. constructor(x?: number, y?: number, z?: number, w?: number);
  2202. /**
  2203. * The X component.
  2204. */
  2205. x: number;
  2206. /**
  2207. * The Y component.
  2208. */
  2209. y: number;
  2210. /**
  2211. * The Z component.
  2212. */
  2213. z: number;
  2214. /**
  2215. * The W component.
  2216. */
  2217. w: number;
  2218. /**
  2219. * Creates a Cartesian4 instance from x, y, z and w coordinates.
  2220. * @param x - The x coordinate.
  2221. * @param y - The y coordinate.
  2222. * @param z - The z coordinate.
  2223. * @param w - The w coordinate.
  2224. * @param [result] - The object onto which to store the result.
  2225. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2226. */
  2227. static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4;
  2228. /**
  2229. * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,
  2230. * and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.
  2231. * @param color - The source color.
  2232. * @param [result] - The object onto which to store the result.
  2233. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2234. */
  2235. static fromColor(color: Color, result?: Cartesian4): Cartesian4;
  2236. /**
  2237. * Duplicates a Cartesian4 instance.
  2238. * @param cartesian - The Cartesian to duplicate.
  2239. * @param [result] - The object onto which to store the result.
  2240. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
  2241. */
  2242. static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  2243. /**
  2244. * The number of elements used to pack the object into an array.
  2245. */
  2246. static packedLength: number;
  2247. /**
  2248. * Stores the provided instance into the provided array.
  2249. * @param value - The value to pack.
  2250. * @param array - The array to pack into.
  2251. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2252. * @returns The array that was packed into
  2253. */
  2254. static pack(value: Cartesian4, array: number[], startingIndex?: number): number[];
  2255. /**
  2256. * Retrieves an instance from a packed array.
  2257. * @param array - The packed array.
  2258. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2259. * @param [result] - The object into which to store the result.
  2260. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2261. */
  2262. static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2263. /**
  2264. * Flattens an array of Cartesian4s into and array of components.
  2265. * @param array - The array of cartesians to pack.
  2266. * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.
  2267. * @returns The packed array.
  2268. */
  2269. static packArray(array: Cartesian4[], result?: number[]): number[];
  2270. /**
  2271. * Unpacks an array of cartesian components into and array of Cartesian4s.
  2272. * @param array - The array of components to unpack.
  2273. * @param [result] - The array onto which to store the result.
  2274. * @returns The unpacked array.
  2275. */
  2276. static unpackArray(array: number[], result?: Cartesian4[]): Cartesian4[];
  2277. /**
  2278. * Creates a Cartesian4 from four consecutive elements in an array.
  2279. * @example
  2280. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
  2281. * var v = [1.0, 2.0, 3.0, 4.0];
  2282. * var p = Cesium.Cartesian4.fromArray(v);
  2283. *
  2284. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
  2285. * var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
  2286. * var p2 = Cesium.Cartesian4.fromArray(v2, 2);
  2287. * @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
  2288. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  2289. * @param [result] - The object onto which to store the result.
  2290. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2291. */
  2292. static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2293. /**
  2294. * Computes the value of the maximum component for the supplied Cartesian.
  2295. * @param cartesian - The cartesian to use.
  2296. * @returns The value of the maximum component.
  2297. */
  2298. static maximumComponent(cartesian: Cartesian4): number;
  2299. /**
  2300. * Computes the value of the minimum component for the supplied Cartesian.
  2301. * @param cartesian - The cartesian to use.
  2302. * @returns The value of the minimum component.
  2303. */
  2304. static minimumComponent(cartesian: Cartesian4): number;
  2305. /**
  2306. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  2307. * @param first - A cartesian to compare.
  2308. * @param second - A cartesian to compare.
  2309. * @param result - The object into which to store the result.
  2310. * @returns A cartesian with the minimum components.
  2311. */
  2312. static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2313. /**
  2314. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  2315. * @param first - A cartesian to compare.
  2316. * @param second - A cartesian to compare.
  2317. * @param result - The object into which to store the result.
  2318. * @returns A cartesian with the maximum components.
  2319. */
  2320. static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2321. /**
  2322. * Computes the provided Cartesian's squared magnitude.
  2323. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  2324. * @returns The squared magnitude.
  2325. */
  2326. static magnitudeSquared(cartesian: Cartesian4): number;
  2327. /**
  2328. * Computes the Cartesian's magnitude (length).
  2329. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  2330. * @returns The magnitude.
  2331. */
  2332. static magnitude(cartesian: Cartesian4): number;
  2333. /**
  2334. * Computes the 4-space distance between two points.
  2335. * @example
  2336. * // Returns 1.0
  2337. * var d = Cesium.Cartesian4.distance(
  2338. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2339. * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
  2340. * @param left - The first point to compute the distance from.
  2341. * @param right - The second point to compute the distance to.
  2342. * @returns The distance between two points.
  2343. */
  2344. static distance(left: Cartesian4, right: Cartesian4): number;
  2345. /**
  2346. * Computes the squared distance between two points. Comparing squared distances
  2347. * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
  2348. * @example
  2349. * // Returns 4.0, not 2.0
  2350. * var d = Cesium.Cartesian4.distance(
  2351. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2352. * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
  2353. * @param left - The first point to compute the distance from.
  2354. * @param right - The second point to compute the distance to.
  2355. * @returns The distance between two points.
  2356. */
  2357. static distanceSquared(left: Cartesian4, right: Cartesian4): number;
  2358. /**
  2359. * Computes the normalized form of the supplied Cartesian.
  2360. * @param cartesian - The Cartesian to be normalized.
  2361. * @param result - The object onto which to store the result.
  2362. * @returns The modified result parameter.
  2363. */
  2364. static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2365. /**
  2366. * Computes the dot (scalar) product of two Cartesians.
  2367. * @param left - The first Cartesian.
  2368. * @param right - The second Cartesian.
  2369. * @returns The dot product.
  2370. */
  2371. static dot(left: Cartesian4, right: Cartesian4): number;
  2372. /**
  2373. * Computes the componentwise product of two Cartesians.
  2374. * @param left - The first Cartesian.
  2375. * @param right - The second Cartesian.
  2376. * @param result - The object onto which to store the result.
  2377. * @returns The modified result parameter.
  2378. */
  2379. static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2380. /**
  2381. * Computes the componentwise quotient of two Cartesians.
  2382. * @param left - The first Cartesian.
  2383. * @param right - The second Cartesian.
  2384. * @param result - The object onto which to store the result.
  2385. * @returns The modified result parameter.
  2386. */
  2387. static divideComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2388. /**
  2389. * Computes the componentwise sum of two Cartesians.
  2390. * @param left - The first Cartesian.
  2391. * @param right - The second Cartesian.
  2392. * @param result - The object onto which to store the result.
  2393. * @returns The modified result parameter.
  2394. */
  2395. static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2396. /**
  2397. * Computes the componentwise difference of two Cartesians.
  2398. * @param left - The first Cartesian.
  2399. * @param right - The second Cartesian.
  2400. * @param result - The object onto which to store the result.
  2401. * @returns The modified result parameter.
  2402. */
  2403. static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2404. /**
  2405. * Multiplies the provided Cartesian componentwise by the provided scalar.
  2406. * @param cartesian - The Cartesian to be scaled.
  2407. * @param scalar - The scalar to multiply with.
  2408. * @param result - The object onto which to store the result.
  2409. * @returns The modified result parameter.
  2410. */
  2411. static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2412. /**
  2413. * Divides the provided Cartesian componentwise by the provided scalar.
  2414. * @param cartesian - The Cartesian to be divided.
  2415. * @param scalar - The scalar to divide by.
  2416. * @param result - The object onto which to store the result.
  2417. * @returns The modified result parameter.
  2418. */
  2419. static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2420. /**
  2421. * Negates the provided Cartesian.
  2422. * @param cartesian - The Cartesian to be negated.
  2423. * @param result - The object onto which to store the result.
  2424. * @returns The modified result parameter.
  2425. */
  2426. static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2427. /**
  2428. * Computes the absolute value of the provided Cartesian.
  2429. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2430. * @param result - The object onto which to store the result.
  2431. * @returns The modified result parameter.
  2432. */
  2433. static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2434. /**
  2435. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2436. * @param start - The value corresponding to t at 0.0.
  2437. * @param end - The value corresponding to t at 1.0.
  2438. * @param t - The point along t at which to interpolate.
  2439. * @param result - The object onto which to store the result.
  2440. * @returns The modified result parameter.
  2441. */
  2442. static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4;
  2443. /**
  2444. * Returns the axis that is most orthogonal to the provided Cartesian.
  2445. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2446. * @param result - The object onto which to store the result.
  2447. * @returns The most orthogonal axis.
  2448. */
  2449. static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2450. /**
  2451. * Compares the provided Cartesians componentwise and returns
  2452. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2453. * @param [left] - The first Cartesian.
  2454. * @param [right] - The second Cartesian.
  2455. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2456. */
  2457. static equals(left?: Cartesian4, right?: Cartesian4): boolean;
  2458. /**
  2459. * Compares the provided Cartesians componentwise and returns
  2460. * <code>true</code> if they pass an absolute or relative tolerance test,
  2461. * <code>false</code> otherwise.
  2462. * @param [left] - The first Cartesian.
  2463. * @param [right] - The second Cartesian.
  2464. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2465. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2466. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2467. */
  2468. static equalsEpsilon(left?: Cartesian4, right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2469. /**
  2470. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
  2471. */
  2472. static readonly ZERO: Cartesian4;
  2473. /**
  2474. * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).
  2475. */
  2476. static readonly ONE: Cartesian4;
  2477. /**
  2478. * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
  2479. */
  2480. static readonly UNIT_X: Cartesian4;
  2481. /**
  2482. * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
  2483. */
  2484. static readonly UNIT_Y: Cartesian4;
  2485. /**
  2486. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
  2487. */
  2488. static readonly UNIT_Z: Cartesian4;
  2489. /**
  2490. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
  2491. */
  2492. static readonly UNIT_W: Cartesian4;
  2493. /**
  2494. * Duplicates this Cartesian4 instance.
  2495. * @param [result] - The object onto which to store the result.
  2496. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2497. */
  2498. clone(result?: Cartesian4): Cartesian4;
  2499. /**
  2500. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2501. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2502. * @param [right] - The right hand side Cartesian.
  2503. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2504. */
  2505. equals(right?: Cartesian4): boolean;
  2506. /**
  2507. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2508. * <code>true</code> if they pass an absolute or relative tolerance test,
  2509. * <code>false</code> otherwise.
  2510. * @param [right] - The right hand side Cartesian.
  2511. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2512. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2513. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2514. */
  2515. equalsEpsilon(right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2516. /**
  2517. * Creates a string representing this Cartesian in the format '(x, y, z, w)'.
  2518. * @returns A string representing the provided Cartesian in the format '(x, y, z, w)'.
  2519. */
  2520. toString(): string;
  2521. /**
  2522. * Packs an arbitrary floating point value to 4 values representable using uint8.
  2523. * @param value - A floating point number.
  2524. * @param [result] - The Cartesian4 that will contain the packed float.
  2525. * @returns A Cartesian4 representing the float packed to values in x, y, z, and w.
  2526. */
  2527. static packFloat(value: number, result?: Cartesian4): Cartesian4;
  2528. }
  2529. /**
  2530. * A position defined by longitude, latitude, and height.
  2531. * @param [longitude = 0.0] - The longitude, in radians.
  2532. * @param [latitude = 0.0] - The latitude, in radians.
  2533. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2534. */
  2535. export class Cartographic {
  2536. constructor(longitude?: number, latitude?: number, height?: number);
  2537. /**
  2538. * The longitude, in radians.
  2539. */
  2540. longitude: number;
  2541. /**
  2542. * The latitude, in radians.
  2543. */
  2544. latitude: number;
  2545. /**
  2546. * The height, in meters, above the ellipsoid.
  2547. */
  2548. height: number;
  2549. /**
  2550. * Creates a new Cartographic instance from longitude and latitude
  2551. * specified in radians.
  2552. * @param longitude - The longitude, in radians.
  2553. * @param latitude - The latitude, in radians.
  2554. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2555. * @param [result] - The object onto which to store the result.
  2556. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2557. */
  2558. static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2559. /**
  2560. * Creates a new Cartographic instance from longitude and latitude
  2561. * specified in degrees. The values in the resulting object will
  2562. * be in radians.
  2563. * @param longitude - The longitude, in degrees.
  2564. * @param latitude - The latitude, in degrees.
  2565. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2566. * @param [result] - The object onto which to store the result.
  2567. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2568. */
  2569. static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2570. /**
  2571. * Creates a new Cartographic instance from a Cartesian position. The values in the
  2572. * resulting object will be in radians.
  2573. * @param cartesian - The Cartesian position to convert to cartographic representation.
  2574. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2575. * @param [result] - The object onto which to store the result.
  2576. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  2577. */
  2578. static fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic;
  2579. /**
  2580. * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
  2581. * object should be in radians.
  2582. * @param cartographic - Input to be converted into a Cartesian3 output.
  2583. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2584. * @param [result] - The object onto which to store the result.
  2585. * @returns The position
  2586. */
  2587. static toCartesian(cartographic: Cartographic, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2588. /**
  2589. * Duplicates a Cartographic instance.
  2590. * @param cartographic - The cartographic to duplicate.
  2591. * @param [result] - The object onto which to store the result.
  2592. * @returns The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
  2593. */
  2594. static clone(cartographic: Cartographic, result?: Cartographic): Cartographic;
  2595. /**
  2596. * Compares the provided cartographics componentwise and returns
  2597. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2598. * @param [left] - The first cartographic.
  2599. * @param [right] - The second cartographic.
  2600. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2601. */
  2602. static equals(left?: Cartographic, right?: Cartographic): boolean;
  2603. /**
  2604. * Compares the provided cartographics componentwise and returns
  2605. * <code>true</code> if they are within the provided epsilon,
  2606. * <code>false</code> otherwise.
  2607. * @param [left] - The first cartographic.
  2608. * @param [right] - The second cartographic.
  2609. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2610. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2611. */
  2612. static equalsEpsilon(left?: Cartographic, right?: Cartographic, epsilon?: number): boolean;
  2613. /**
  2614. * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
  2615. */
  2616. static readonly ZERO: Cartographic;
  2617. /**
  2618. * Duplicates this instance.
  2619. * @param [result] - The object onto which to store the result.
  2620. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2621. */
  2622. clone(result?: Cartographic): Cartographic;
  2623. /**
  2624. * Compares the provided against this cartographic componentwise and returns
  2625. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2626. * @param [right] - The second cartographic.
  2627. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2628. */
  2629. equals(right?: Cartographic): boolean;
  2630. /**
  2631. * Compares the provided against this cartographic componentwise and returns
  2632. * <code>true</code> if they are within the provided epsilon,
  2633. * <code>false</code> otherwise.
  2634. * @param [right] - The second cartographic.
  2635. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2636. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2637. */
  2638. equalsEpsilon(right?: Cartographic, epsilon?: number): boolean;
  2639. /**
  2640. * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
  2641. * @returns A string representing the provided cartographic in the format '(longitude, latitude, height)'.
  2642. */
  2643. toString(): string;
  2644. }
  2645. /**
  2646. * Geocodes queries containing longitude and latitude coordinates and an optional height.
  2647. * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.
  2648. */
  2649. export class CartographicGeocoderService {
  2650. constructor();
  2651. /**
  2652. * @param query - The query to be sent to the geocoder service
  2653. */
  2654. geocode(query: string): Promise<GeocoderService.Result[]>;
  2655. }
  2656. /**
  2657. * A Catmull-Rom spline is a cubic spline where the tangent at control points,
  2658. * except the first and last, are computed using the previous and next control points.
  2659. * Catmull-Rom splines are in the class C<sup>1</sup>.
  2660. * @example
  2661. * // spline above the earth from Philadelphia to Los Angeles
  2662. * var spline = new Cesium.CatmullRomSpline({
  2663. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  2664. * points : [
  2665. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  2666. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  2667. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  2668. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  2669. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  2670. * ]
  2671. * });
  2672. *
  2673. * var p0 = spline.evaluate(times[i]); // equal to positions[i]
  2674. * var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
  2675. * @param options - Object with the following properties:
  2676. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  2677. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  2678. * @param options.points - The array of {@link Cartesian3} control points.
  2679. * @param [options.firstTangent] - The tangent of the curve at the first control point.
  2680. * If the tangent is not given, it will be estimated.
  2681. * @param [options.lastTangent] - The tangent of the curve at the last control point.
  2682. * If the tangent is not given, it will be estimated.
  2683. */
  2684. export class CatmullRomSpline {
  2685. constructor(options: {
  2686. times: number[];
  2687. points: Cartesian3[];
  2688. firstTangent?: Cartesian3;
  2689. lastTangent?: Cartesian3;
  2690. });
  2691. /**
  2692. * An array of times for the control points.
  2693. */
  2694. readonly times: number[];
  2695. /**
  2696. * An array of {@link Cartesian3} control points.
  2697. */
  2698. readonly points: Cartesian3[];
  2699. /**
  2700. * The tangent at the first control point.
  2701. */
  2702. readonly firstTangent: Cartesian3;
  2703. /**
  2704. * The tangent at the last control point.
  2705. */
  2706. readonly lastTangent: Cartesian3;
  2707. /**
  2708. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  2709. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  2710. * @param time - The time.
  2711. * @returns The index for the element at the start of the interval.
  2712. */
  2713. findTimeInterval(time: number): number;
  2714. /**
  2715. * Wraps the given time to the period covered by the spline.
  2716. * @param time - The time.
  2717. * @returns The time, wrapped around to the updated animation.
  2718. */
  2719. wrapTime(time: number): number;
  2720. /**
  2721. * Clamps the given time to the period covered by the spline.
  2722. * @param time - The time.
  2723. * @returns The time, clamped to the animation period.
  2724. */
  2725. clampTime(time: number): number;
  2726. /**
  2727. * Evaluates the curve at a given time.
  2728. * @param time - The time at which to evaluate the curve.
  2729. * @param [result] - The object onto which to store the result.
  2730. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  2731. */
  2732. evaluate(time: number, result?: Cartesian3): Cartesian3;
  2733. }
  2734. /**
  2735. * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.
  2736. * @example
  2737. * // Create Arctic DEM terrain with normals.
  2738. * var viewer = new Cesium.Viewer('cesiumContainer', {
  2739. * terrainProvider : new Cesium.CesiumTerrainProvider({
  2740. * url : Cesium.IonResource.fromAssetId(3956),
  2741. * requestVertexNormals : true
  2742. * })
  2743. * });
  2744. * @param options - Object with the following properties:
  2745. * @param options.url - The URL of the Cesium terrain server.
  2746. * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server, in the form of per vertex normals if available.
  2747. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available.
  2748. * @param [options.requestMetadata = true] - Flag that indicates if the client should request per tile metadata from the server, if available.
  2749. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  2750. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  2751. */
  2752. export class CesiumTerrainProvider {
  2753. constructor(options: {
  2754. url: Resource | string | Promise<Resource> | Promise<string>;
  2755. requestVertexNormals?: boolean;
  2756. requestWaterMask?: boolean;
  2757. requestMetadata?: boolean;
  2758. ellipsoid?: Ellipsoid;
  2759. credit?: Credit | string;
  2760. });
  2761. /**
  2762. * Requests the geometry for a given tile. This function should not be called before
  2763. * {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and
  2764. * may optionally include a water mask and an indication of which child tiles are available.
  2765. * @param x - The X coordinate of the tile for which to request geometry.
  2766. * @param y - The Y coordinate of the tile for which to request geometry.
  2767. * @param level - The level of the tile for which to request geometry.
  2768. * @param [request] - The request object. Intended for internal use only.
  2769. * @returns A promise for the requested geometry. If this method
  2770. * returns undefined instead of a promise, it is an indication that too many requests are already
  2771. * pending and the request will be retried later.
  2772. */
  2773. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  2774. /**
  2775. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  2776. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  2777. * are passed an instance of {@link TileProviderError}.
  2778. */
  2779. readonly errorEvent: Event;
  2780. /**
  2781. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  2782. * the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2783. */
  2784. readonly credit: Credit;
  2785. /**
  2786. * Gets the tiling scheme used by this provider. This function should
  2787. * not be called before {@link CesiumTerrainProvider#ready} returns true.
  2788. */
  2789. readonly tilingScheme: GeographicTilingScheme;
  2790. /**
  2791. * Gets a value indicating whether or not the provider is ready for use.
  2792. */
  2793. readonly ready: boolean;
  2794. /**
  2795. * Gets a promise that resolves to true when the provider is ready for use.
  2796. */
  2797. readonly readyPromise: Promise<boolean>;
  2798. /**
  2799. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  2800. * indicates which areas of the globe are water rather than land, so they can be rendered
  2801. * as a reflective surface with animated waves. This function should not be
  2802. * called before {@link CesiumTerrainProvider#ready} returns true.
  2803. */
  2804. readonly hasWaterMask: boolean;
  2805. /**
  2806. * Gets a value indicating whether or not the requested tiles include vertex normals.
  2807. * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2808. */
  2809. readonly hasVertexNormals: boolean;
  2810. /**
  2811. * Gets a value indicating whether or not the requested tiles include metadata.
  2812. * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2813. */
  2814. readonly hasMetadata: boolean;
  2815. /**
  2816. * Boolean flag that indicates if the client should request vertex normals from the server.
  2817. * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and
  2818. * if the server provides vertex normals.
  2819. */
  2820. readonly requestVertexNormals: boolean;
  2821. /**
  2822. * Boolean flag that indicates if the client should request a watermask from the server.
  2823. * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and
  2824. * if the server provides a watermask.
  2825. */
  2826. readonly requestWaterMask: boolean;
  2827. /**
  2828. * Boolean flag that indicates if the client should request metadata from the server.
  2829. * Metadata is appended to the standard tile mesh data only if the client requests the metadata and
  2830. * if the server provides a metadata.
  2831. */
  2832. readonly requestMetadata: boolean;
  2833. /**
  2834. * Gets an object that can be used to determine availability of terrain from this provider, such as
  2835. * at points and in rectangles. This function should not be called before
  2836. * {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability
  2837. * information is not available. Note that this reflects tiles that are known to be available currently.
  2838. * Additional tiles may be discovered to be available in the future, e.g. if availability information
  2839. * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that
  2840. * is available now will not become unavailable in the future.
  2841. */
  2842. readonly availability: TileAvailability;
  2843. /**
  2844. * Gets the maximum geometric error allowed in a tile at a given level.
  2845. * @param level - The tile level for which to get the maximum geometric error.
  2846. * @returns The maximum geometric error.
  2847. */
  2848. getLevelMaximumGeometricError(level: number): number;
  2849. /**
  2850. * Determines whether data for a tile is available to be loaded.
  2851. * @param x - The X coordinate of the tile for which to request geometry.
  2852. * @param y - The Y coordinate of the tile for which to request geometry.
  2853. * @param level - The level of the tile for which to request geometry.
  2854. * @returns Undefined if not supported or availability is unknown, otherwise true or false.
  2855. */
  2856. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  2857. /**
  2858. * Makes sure we load availability data for a tile
  2859. * @param x - The X coordinate of the tile for which to request geometry.
  2860. * @param y - The Y coordinate of the tile for which to request geometry.
  2861. * @param level - The level of the tile for which to request geometry.
  2862. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  2863. */
  2864. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  2865. }
  2866. /**
  2867. * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  2868. * @example
  2869. * // Create a circle.
  2870. * var circle = new Cesium.CircleGeometry({
  2871. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2872. * radius : 100000.0
  2873. * });
  2874. * var geometry = Cesium.CircleGeometry.createGeometry(circle);
  2875. * @param options - Object with the following properties:
  2876. * @param options.center - The circle's center point in the fixed frame.
  2877. * @param options.radius - The radius in meters.
  2878. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2879. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2880. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2881. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  2882. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2883. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  2884. */
  2885. export class CircleGeometry {
  2886. constructor(options: {
  2887. center: Cartesian3;
  2888. radius: number;
  2889. ellipsoid?: Ellipsoid;
  2890. height?: number;
  2891. granularity?: number;
  2892. vertexFormat?: VertexFormat;
  2893. extrudedHeight?: number;
  2894. stRotation?: number;
  2895. });
  2896. /**
  2897. * The number of elements used to pack the object into an array.
  2898. */
  2899. static packedLength: number;
  2900. /**
  2901. * Stores the provided instance into the provided array.
  2902. * @param value - The value to pack.
  2903. * @param array - The array to pack into.
  2904. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2905. * @returns The array that was packed into
  2906. */
  2907. static pack(value: CircleGeometry, array: number[], startingIndex?: number): number[];
  2908. /**
  2909. * Retrieves an instance from a packed array.
  2910. * @param array - The packed array.
  2911. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2912. * @param [result] - The object into which to store the result.
  2913. * @returns The modified result parameter or a new CircleGeometry instance if one was not provided.
  2914. */
  2915. static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): CircleGeometry;
  2916. /**
  2917. * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2918. * @param circleGeometry - A description of the circle.
  2919. * @returns The computed vertices and indices.
  2920. */
  2921. static createGeometry(circleGeometry: CircleGeometry): Geometry | undefined;
  2922. }
  2923. /**
  2924. * A description of the outline of a circle on the ellipsoid.
  2925. * @example
  2926. * // Create a circle.
  2927. * var circle = new Cesium.CircleOutlineGeometry({
  2928. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2929. * radius : 100000.0
  2930. * });
  2931. * var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
  2932. * @param options - Object with the following properties:
  2933. * @param options.center - The circle's center point in the fixed frame.
  2934. * @param options.radius - The radius in meters.
  2935. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2936. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2937. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2938. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2939. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom of an extruded circle.
  2940. */
  2941. export class CircleOutlineGeometry {
  2942. constructor(options: {
  2943. center: Cartesian3;
  2944. radius: number;
  2945. ellipsoid?: Ellipsoid;
  2946. height?: number;
  2947. granularity?: number;
  2948. extrudedHeight?: number;
  2949. numberOfVerticalLines?: number;
  2950. });
  2951. /**
  2952. * The number of elements used to pack the object into an array.
  2953. */
  2954. static packedLength: number;
  2955. /**
  2956. * Stores the provided instance into the provided array.
  2957. * @param value - The value to pack.
  2958. * @param array - The array to pack into.
  2959. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2960. * @returns The array that was packed into
  2961. */
  2962. static pack(value: CircleOutlineGeometry, array: number[], startingIndex?: number): number[];
  2963. /**
  2964. * Retrieves an instance from a packed array.
  2965. * @param array - The packed array.
  2966. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2967. * @param [result] - The object into which to store the result.
  2968. * @returns The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
  2969. */
  2970. static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): CircleOutlineGeometry;
  2971. /**
  2972. * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2973. * @param circleGeometry - A description of the circle.
  2974. * @returns The computed vertices and indices.
  2975. */
  2976. static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry | undefined;
  2977. }
  2978. /**
  2979. * A simple clock for keeping track of simulated time.
  2980. * @example
  2981. * // Create a clock that loops on Christmas day 2013 and runs in real-time.
  2982. * var clock = new Cesium.Clock({
  2983. * startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  2984. * currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  2985. * stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
  2986. * clockRange : Cesium.ClockRange.LOOP_STOP,
  2987. * clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
  2988. * });
  2989. * @param [options] - Object with the following properties:
  2990. * @param [options.startTime] - The start time of the clock.
  2991. * @param [options.stopTime] - The stop time of the clock.
  2992. * @param [options.currentTime] - The current time.
  2993. * @param [options.multiplier = 1.0] - Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.
  2994. * @param [options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER] - Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  2995. * @param [options.clockRange = ClockRange.UNBOUNDED] - Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  2996. * @param [options.canAnimate = true] - Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered, for example. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  2997. * @param [options.shouldAnimate = false] - Indicates whether {@link Clock#tick} should attempt to advance time. The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  2998. */
  2999. export class Clock {
  3000. constructor(options?: {
  3001. startTime?: JulianDate;
  3002. stopTime?: JulianDate;
  3003. currentTime?: JulianDate;
  3004. multiplier?: number;
  3005. clockStep?: ClockStep;
  3006. clockRange?: ClockRange;
  3007. canAnimate?: boolean;
  3008. shouldAnimate?: boolean;
  3009. });
  3010. /**
  3011. * The start time of the clock.
  3012. */
  3013. startTime: JulianDate;
  3014. /**
  3015. * The stop time of the clock.
  3016. */
  3017. stopTime: JulianDate;
  3018. /**
  3019. * Determines how the clock should behave when
  3020. * {@link Clock#startTime} or {@link Clock#stopTime}
  3021. * is reached.
  3022. */
  3023. clockRange: ClockRange;
  3024. /**
  3025. * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered,
  3026. * for example. The clock will only advance time when both
  3027. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3028. */
  3029. canAnimate: boolean;
  3030. /**
  3031. * An {@link Event} that is fired whenever {@link Clock#tick} is called.
  3032. */
  3033. onTick: Event;
  3034. /**
  3035. * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.
  3036. */
  3037. onStop: Event;
  3038. /**
  3039. * The current time.
  3040. * Changing this property will change
  3041. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3042. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3043. */
  3044. currentTime: JulianDate;
  3045. /**
  3046. * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.
  3047. * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.
  3048. * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the
  3049. * elapsed system time since the last call to {@link Clock#tick}.
  3050. * Changing this property will change
  3051. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3052. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3053. */
  3054. multiplier: number;
  3055. /**
  3056. * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  3057. * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set
  3058. * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and
  3059. * {@link Clock#currentTime} to the current system clock time.
  3060. */
  3061. clockStep: ClockStep;
  3062. /**
  3063. * Indicates whether {@link Clock#tick} should attempt to advance time.
  3064. * The clock will only advance time when both
  3065. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3066. * Changing this property will change
  3067. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3068. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3069. */
  3070. shouldAnimate: boolean;
  3071. /**
  3072. * Advances the clock from the current time based on the current configuration options.
  3073. * tick should be called every frame, regardless of whether animation is taking place
  3074. * or not. To control animation, use the {@link Clock#shouldAnimate} property.
  3075. * @returns The new value of the {@link Clock#currentTime} property.
  3076. */
  3077. tick(): JulianDate;
  3078. }
  3079. /**
  3080. * Constants used by {@link Clock#tick} to determine behavior
  3081. * when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  3082. */
  3083. export enum ClockRange {
  3084. /**
  3085. * {@link Clock#tick} will always advances the clock in its current direction.
  3086. */
  3087. UNBOUNDED = 0,
  3088. /**
  3089. * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,
  3090. * {@link Clock#tick} will not advance {@link Clock#currentTime} any further.
  3091. */
  3092. CLAMPED = 1,
  3093. /**
  3094. * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance
  3095. * {@link Clock#currentTime} to the opposite end of the interval. When
  3096. * time is moving backwards, {@link Clock#tick} will not advance past
  3097. * {@link Clock#startTime}
  3098. */
  3099. LOOP_STOP = 2
  3100. }
  3101. /**
  3102. * Constants to determine how much time advances with each call
  3103. * to {@link Clock#tick}.
  3104. */
  3105. export enum ClockStep {
  3106. /**
  3107. * {@link Clock#tick} advances the current time by a fixed step,
  3108. * which is the number of seconds specified by {@link Clock#multiplier}.
  3109. */
  3110. TICK_DEPENDENT = 0,
  3111. /**
  3112. * {@link Clock#tick} advances the current time by the amount of system
  3113. * time elapsed since the previous call multiplied by {@link Clock#multiplier}.
  3114. */
  3115. SYSTEM_CLOCK_MULTIPLIER = 1,
  3116. /**
  3117. * {@link Clock#tick} sets the clock to the current system time;
  3118. * ignoring all other settings.
  3119. */
  3120. SYSTEM_CLOCK = 2
  3121. }
  3122. /**
  3123. * A color, specified using red, green, blue, and alpha values,
  3124. * which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).
  3125. * @param [red = 1.0] - The red component.
  3126. * @param [green = 1.0] - The green component.
  3127. * @param [blue = 1.0] - The blue component.
  3128. * @param [alpha = 1.0] - The alpha component.
  3129. */
  3130. export class Color {
  3131. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  3132. /**
  3133. * The red component.
  3134. */
  3135. red: number;
  3136. /**
  3137. * The green component.
  3138. */
  3139. green: number;
  3140. /**
  3141. * The blue component.
  3142. */
  3143. blue: number;
  3144. /**
  3145. * The alpha component.
  3146. */
  3147. alpha: number;
  3148. /**
  3149. * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,
  3150. * and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.
  3151. * @param cartesian - The source cartesian.
  3152. * @param [result] - The object onto which to store the result.
  3153. * @returns The modified result parameter or a new Color instance if one was not provided.
  3154. */
  3155. static fromCartesian4(cartesian: Cartesian4, result?: Color): Color;
  3156. /**
  3157. * Creates a new Color specified using red, green, blue, and alpha values
  3158. * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
  3159. * @param [red = 255] - The red component.
  3160. * @param [green = 255] - The green component.
  3161. * @param [blue = 255] - The blue component.
  3162. * @param [alpha = 255] - The alpha component.
  3163. * @param [result] - The object onto which to store the result.
  3164. * @returns The modified result parameter or a new Color instance if one was not provided.
  3165. */
  3166. static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color;
  3167. /**
  3168. * Creates a new Color that has the same red, green, and blue components
  3169. * of the specified color, but with the specified alpha value.
  3170. * @example
  3171. * var translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
  3172. * @param color - The base color
  3173. * @param alpha - The new alpha component.
  3174. * @param [result] - The object onto which to store the result.
  3175. * @returns The modified result parameter or a new Color instance if one was not provided.
  3176. */
  3177. static fromAlpha(color: Color, alpha: number, result?: Color): Color;
  3178. /**
  3179. * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
  3180. * of the system.
  3181. * @example
  3182. * var color = Cesium.Color.fromRgba(0x67ADDFFF);
  3183. * @param rgba - A single numeric unsigned 32-bit RGBA value.
  3184. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3185. * @returns The color object.
  3186. */
  3187. static fromRgba(rgba: number, result?: Color): Color;
  3188. /**
  3189. * Creates a Color instance from hue, saturation, and lightness.
  3190. * @param [hue = 0] - The hue angle 0...1
  3191. * @param [saturation = 0] - The saturation value 0...1
  3192. * @param [lightness = 0] - The lightness value 0...1
  3193. * @param [alpha = 1.0] - The alpha component 0...1
  3194. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3195. * @returns The color object.
  3196. */
  3197. static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color;
  3198. /**
  3199. * Creates a random color using the provided options. For reproducible random colors, you should
  3200. * call {@link Math#setRandomNumberSeed} once at the beginning of your application.
  3201. * @example
  3202. * //Create a completely random color
  3203. * var color = Cesium.Color.fromRandom();
  3204. *
  3205. * //Create a random shade of yellow.
  3206. * var color = Cesium.Color.fromRandom({
  3207. * red : 1.0,
  3208. * green : 1.0,
  3209. * alpha : 1.0
  3210. * });
  3211. *
  3212. * //Create a random bright color.
  3213. * var color = Cesium.Color.fromRandom({
  3214. * minimumRed : 0.75,
  3215. * minimumGreen : 0.75,
  3216. * minimumBlue : 0.75,
  3217. * alpha : 1.0
  3218. * });
  3219. * @param [options] - Object with the following properties:
  3220. * @param [options.red] - If specified, the red component to use instead of a randomized value.
  3221. * @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified.
  3222. * @param [options.maximumRed = 1.0] - The minimum red value to generate if none was specified.
  3223. * @param [options.green] - If specified, the green component to use instead of a randomized value.
  3224. * @param [options.minimumGreen = 0.0] - The maximum green value to generate if none was specified.
  3225. * @param [options.maximumGreen = 1.0] - The minimum green value to generate if none was specified.
  3226. * @param [options.blue] - If specified, the blue component to use instead of a randomized value.
  3227. * @param [options.minimumBlue = 0.0] - The maximum blue value to generate if none was specified.
  3228. * @param [options.maximumBlue = 1.0] - The minimum blue value to generate if none was specified.
  3229. * @param [options.alpha] - If specified, the alpha component to use instead of a randomized value.
  3230. * @param [options.minimumAlpha = 0.0] - The maximum alpha value to generate if none was specified.
  3231. * @param [options.maximumAlpha = 1.0] - The minimum alpha value to generate if none was specified.
  3232. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3233. * @returns The modified result parameter or a new instance if result was undefined.
  3234. */
  3235. static fromRandom(options?: {
  3236. red?: number;
  3237. minimumRed?: number;
  3238. maximumRed?: number;
  3239. green?: number;
  3240. minimumGreen?: number;
  3241. maximumGreen?: number;
  3242. blue?: number;
  3243. minimumBlue?: number;
  3244. maximumBlue?: number;
  3245. alpha?: number;
  3246. minimumAlpha?: number;
  3247. maximumAlpha?: number;
  3248. }, result?: Color): Color;
  3249. /**
  3250. * Creates a Color instance from a CSS color value.
  3251. * @example
  3252. * var cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
  3253. * var green = Cesium.Color.fromCssColorString('green');
  3254. * @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.
  3255. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3256. * @returns The color object, or undefined if the string was not a valid CSS color.
  3257. */
  3258. static fromCssColorString(color: string, result?: Color): Color;
  3259. /**
  3260. * The number of elements used to pack the object into an array.
  3261. */
  3262. static packedLength: number;
  3263. /**
  3264. * Stores the provided instance into the provided array.
  3265. * @param value - The value to pack.
  3266. * @param array - The array to pack into.
  3267. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  3268. * @returns The array that was packed into
  3269. */
  3270. static pack(value: Color, array: number[], startingIndex?: number): number[];
  3271. /**
  3272. * Retrieves an instance from a packed array.
  3273. * @param array - The packed array.
  3274. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  3275. * @param [result] - The object into which to store the result.
  3276. * @returns The modified result parameter or a new Color instance if one was not provided.
  3277. */
  3278. static unpack(array: number[], startingIndex?: number, result?: Color): Color;
  3279. /**
  3280. * Converts a 'byte' color component in the range of 0 to 255 into
  3281. * a 'float' color component in the range of 0 to 1.0.
  3282. * @param number - The number to be converted.
  3283. * @returns The converted number.
  3284. */
  3285. static byteToFloat(number: number): number;
  3286. /**
  3287. * Converts a 'float' color component in the range of 0 to 1.0 into
  3288. * a 'byte' color component in the range of 0 to 255.
  3289. * @param number - The number to be converted.
  3290. * @returns The converted number.
  3291. */
  3292. static floatToByte(number: number): number;
  3293. /**
  3294. * Duplicates a Color.
  3295. * @param color - The Color to duplicate.
  3296. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3297. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
  3298. */
  3299. static clone(color: Color, result?: Color): Color;
  3300. /**
  3301. * Returns true if the first Color equals the second color.
  3302. * @param left - The first Color to compare for equality.
  3303. * @param right - The second Color to compare for equality.
  3304. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3305. */
  3306. static equals(left: Color, right: Color): boolean;
  3307. /**
  3308. * Returns a duplicate of a Color instance.
  3309. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3310. * @returns The modified result parameter or a new instance if result was undefined.
  3311. */
  3312. clone(result?: Color): Color;
  3313. /**
  3314. * Returns true if this Color equals other.
  3315. * @param other - The Color to compare for equality.
  3316. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3317. */
  3318. equals(other: Color): boolean;
  3319. /**
  3320. * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.
  3321. * @param other - The Color to compare for equality.
  3322. * @param [epsilon = 0.0] - The epsilon to use for equality testing.
  3323. * @returns <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.
  3324. */
  3325. equalsEpsilon(other: Color, epsilon?: number): boolean;
  3326. /**
  3327. * Creates a string representing this Color in the format '(red, green, blue, alpha)'.
  3328. * @returns A string representing this Color in the format '(red, green, blue, alpha)'.
  3329. */
  3330. toString(): string;
  3331. /**
  3332. * Creates a string containing the CSS color value for this color.
  3333. * @returns The CSS equivalent of this color.
  3334. */
  3335. toCssColorString(): string;
  3336. /**
  3337. * Creates a string containing CSS hex string color value for this color.
  3338. * @returns The CSS hex string equivalent of this color.
  3339. */
  3340. toCssHexString(): string;
  3341. /**
  3342. * Converts this color to an array of red, green, blue, and alpha values
  3343. * that are in the range of 0 to 255.
  3344. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  3345. * @returns The modified result parameter or a new instance if result was undefined.
  3346. */
  3347. toBytes(result?: number[]): number[];
  3348. /**
  3349. * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
  3350. * of the system.
  3351. * @example
  3352. * var rgba = Cesium.Color.BLUE.toRgba();
  3353. * @returns A single numeric unsigned 32-bit RGBA value.
  3354. */
  3355. toRgba(): number;
  3356. /**
  3357. * Brightens this color by the provided magnitude.
  3358. * @example
  3359. * var brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
  3360. * @param magnitude - A positive number indicating the amount to brighten.
  3361. * @param result - The object onto which to store the result.
  3362. * @returns The modified result parameter.
  3363. */
  3364. brighten(magnitude: number, result: Color): Color;
  3365. /**
  3366. * Darkens this color by the provided magnitude.
  3367. * @example
  3368. * var darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
  3369. * @param magnitude - A positive number indicating the amount to darken.
  3370. * @param result - The object onto which to store the result.
  3371. * @returns The modified result parameter.
  3372. */
  3373. darken(magnitude: number, result: Color): Color;
  3374. /**
  3375. * Creates a new Color that has the same red, green, and blue components
  3376. * as this Color, but with the specified alpha value.
  3377. * @example
  3378. * var translucentRed = Cesium.Color.RED.withAlpha(0.9);
  3379. * @param alpha - The new alpha component.
  3380. * @param [result] - The object onto which to store the result.
  3381. * @returns The modified result parameter or a new Color instance if one was not provided.
  3382. */
  3383. withAlpha(alpha: number, result?: Color): Color;
  3384. /**
  3385. * Computes the componentwise sum of two Colors.
  3386. * @param left - The first Color.
  3387. * @param right - The second Color.
  3388. * @param result - The object onto which to store the result.
  3389. * @returns The modified result parameter.
  3390. */
  3391. static add(left: Color, right: Color, result: Color): Color;
  3392. /**
  3393. * Computes the componentwise difference of two Colors.
  3394. * @param left - The first Color.
  3395. * @param right - The second Color.
  3396. * @param result - The object onto which to store the result.
  3397. * @returns The modified result parameter.
  3398. */
  3399. static subtract(left: Color, right: Color, result: Color): Color;
  3400. /**
  3401. * Computes the componentwise product of two Colors.
  3402. * @param left - The first Color.
  3403. * @param right - The second Color.
  3404. * @param result - The object onto which to store the result.
  3405. * @returns The modified result parameter.
  3406. */
  3407. static multiply(left: Color, right: Color, result: Color): Color;
  3408. /**
  3409. * Computes the componentwise quotient of two Colors.
  3410. * @param left - The first Color.
  3411. * @param right - The second Color.
  3412. * @param result - The object onto which to store the result.
  3413. * @returns The modified result parameter.
  3414. */
  3415. static divide(left: Color, right: Color, result: Color): Color;
  3416. /**
  3417. * Computes the componentwise modulus of two Colors.
  3418. * @param left - The first Color.
  3419. * @param right - The second Color.
  3420. * @param result - The object onto which to store the result.
  3421. * @returns The modified result parameter.
  3422. */
  3423. static mod(left: Color, right: Color, result: Color): Color;
  3424. /**
  3425. * Computes the linear interpolation or extrapolation at t between the provided colors.
  3426. * @param start - The color corresponding to t at 0.0.
  3427. * @param end - The color corresponding to t at 1.0.
  3428. * @param t - The point along t at which to interpolate.
  3429. * @param result - The object onto which to store the result.
  3430. * @returns The modified result parameter.
  3431. */
  3432. static lerp(start: Color, end: Color, t: number, result: Color): Color;
  3433. /**
  3434. * Multiplies the provided Color componentwise by the provided scalar.
  3435. * @param color - The Color to be scaled.
  3436. * @param scalar - The scalar to multiply with.
  3437. * @param result - The object onto which to store the result.
  3438. * @returns The modified result parameter.
  3439. */
  3440. static multiplyByScalar(color: Color, scalar: number, result: Color): Color;
  3441. /**
  3442. * Divides the provided Color componentwise by the provided scalar.
  3443. * @param color - The Color to be divided.
  3444. * @param scalar - The scalar to divide with.
  3445. * @param result - The object onto which to store the result.
  3446. * @returns The modified result parameter.
  3447. */
  3448. static divideByScalar(color: Color, scalar: number, result: Color): Color;
  3449. /**
  3450. * An immutable Color instance initialized to CSS color #F0F8FF
  3451. * <span class="colorSwath" style="background: #F0F8FF;"></span>
  3452. */
  3453. static readonly ALICEBLUE: Color;
  3454. /**
  3455. * An immutable Color instance initialized to CSS color #FAEBD7
  3456. * <span class="colorSwath" style="background: #FAEBD7;"></span>
  3457. */
  3458. static readonly ANTIQUEWHITE: Color;
  3459. /**
  3460. * An immutable Color instance initialized to CSS color #00FFFF
  3461. * <span class="colorSwath" style="background: #00FFFF;"></span>
  3462. */
  3463. static readonly AQUA: Color;
  3464. /**
  3465. * An immutable Color instance initialized to CSS color #7FFFD4
  3466. * <span class="colorSwath" style="background: #7FFFD4;"></span>
  3467. */
  3468. static readonly AQUAMARINE: Color;
  3469. /**
  3470. * An immutable Color instance initialized to CSS color #F0FFFF
  3471. * <span class="colorSwath" style="background: #F0FFFF;"></span>
  3472. */
  3473. static readonly AZURE: Color;
  3474. /**
  3475. * An immutable Color instance initialized to CSS color #F5F5DC
  3476. * <span class="colorSwath" style="background: #F5F5DC;"></span>
  3477. */
  3478. static readonly BEIGE: Color;
  3479. /**
  3480. * An immutable Color instance initialized to CSS color #FFE4C4
  3481. * <span class="colorSwath" style="background: #FFE4C4;"></span>
  3482. */
  3483. static readonly BISQUE: Color;
  3484. /**
  3485. * An immutable Color instance initialized to CSS color #000000
  3486. * <span class="colorSwath" style="background: #000000;"></span>
  3487. */
  3488. static readonly BLACK: Color;
  3489. /**
  3490. * An immutable Color instance initialized to CSS color #FFEBCD
  3491. * <span class="colorSwath" style="background: #FFEBCD;"></span>
  3492. */
  3493. static readonly BLANCHEDALMOND: Color;
  3494. /**
  3495. * An immutable Color instance initialized to CSS color #0000FF
  3496. * <span class="colorSwath" style="background: #0000FF;"></span>
  3497. */
  3498. static readonly BLUE: Color;
  3499. /**
  3500. * An immutable Color instance initialized to CSS color #8A2BE2
  3501. * <span class="colorSwath" style="background: #8A2BE2;"></span>
  3502. */
  3503. static readonly BLUEVIOLET: Color;
  3504. /**
  3505. * An immutable Color instance initialized to CSS color #A52A2A
  3506. * <span class="colorSwath" style="background: #A52A2A;"></span>
  3507. */
  3508. static readonly BROWN: Color;
  3509. /**
  3510. * An immutable Color instance initialized to CSS color #DEB887
  3511. * <span class="colorSwath" style="background: #DEB887;"></span>
  3512. */
  3513. static readonly BURLYWOOD: Color;
  3514. /**
  3515. * An immutable Color instance initialized to CSS color #5F9EA0
  3516. * <span class="colorSwath" style="background: #5F9EA0;"></span>
  3517. */
  3518. static readonly CADETBLUE: Color;
  3519. /**
  3520. * An immutable Color instance initialized to CSS color #7FFF00
  3521. * <span class="colorSwath" style="background: #7FFF00;"></span>
  3522. */
  3523. static readonly CHARTREUSE: Color;
  3524. /**
  3525. * An immutable Color instance initialized to CSS color #D2691E
  3526. * <span class="colorSwath" style="background: #D2691E;"></span>
  3527. */
  3528. static readonly CHOCOLATE: Color;
  3529. /**
  3530. * An immutable Color instance initialized to CSS color #FF7F50
  3531. * <span class="colorSwath" style="background: #FF7F50;"></span>
  3532. */
  3533. static readonly CORAL: Color;
  3534. /**
  3535. * An immutable Color instance initialized to CSS color #6495ED
  3536. * <span class="colorSwath" style="background: #6495ED;"></span>
  3537. */
  3538. static readonly CORNFLOWERBLUE: Color;
  3539. /**
  3540. * An immutable Color instance initialized to CSS color #FFF8DC
  3541. * <span class="colorSwath" style="background: #FFF8DC;"></span>
  3542. */
  3543. static readonly CORNSILK: Color;
  3544. /**
  3545. * An immutable Color instance initialized to CSS color #DC143C
  3546. * <span class="colorSwath" style="background: #DC143C;"></span>
  3547. */
  3548. static readonly CRIMSON: Color;
  3549. /**
  3550. * An immutable Color instance initialized to CSS color #00FFFF
  3551. * <span class="colorSwath" style="background: #00FFFF;"></span>
  3552. */
  3553. static readonly CYAN: Color;
  3554. /**
  3555. * An immutable Color instance initialized to CSS color #00008B
  3556. * <span class="colorSwath" style="background: #00008B;"></span>
  3557. */
  3558. static readonly DARKBLUE: Color;
  3559. /**
  3560. * An immutable Color instance initialized to CSS color #008B8B
  3561. * <span class="colorSwath" style="background: #008B8B;"></span>
  3562. */
  3563. static readonly DARKCYAN: Color;
  3564. /**
  3565. * An immutable Color instance initialized to CSS color #B8860B
  3566. * <span class="colorSwath" style="background: #B8860B;"></span>
  3567. */
  3568. static readonly DARKGOLDENROD: Color;
  3569. /**
  3570. * An immutable Color instance initialized to CSS color #A9A9A9
  3571. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3572. */
  3573. static readonly DARKGRAY: Color;
  3574. /**
  3575. * An immutable Color instance initialized to CSS color #006400
  3576. * <span class="colorSwath" style="background: #006400;"></span>
  3577. */
  3578. static readonly DARKGREEN: Color;
  3579. /**
  3580. * An immutable Color instance initialized to CSS color #A9A9A9
  3581. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3582. */
  3583. static readonly DARKGREY: Color;
  3584. /**
  3585. * An immutable Color instance initialized to CSS color #BDB76B
  3586. * <span class="colorSwath" style="background: #BDB76B;"></span>
  3587. */
  3588. static readonly DARKKHAKI: Color;
  3589. /**
  3590. * An immutable Color instance initialized to CSS color #8B008B
  3591. * <span class="colorSwath" style="background: #8B008B;"></span>
  3592. */
  3593. static readonly DARKMAGENTA: Color;
  3594. /**
  3595. * An immutable Color instance initialized to CSS color #556B2F
  3596. * <span class="colorSwath" style="background: #556B2F;"></span>
  3597. */
  3598. static readonly DARKOLIVEGREEN: Color;
  3599. /**
  3600. * An immutable Color instance initialized to CSS color #FF8C00
  3601. * <span class="colorSwath" style="background: #FF8C00;"></span>
  3602. */
  3603. static readonly DARKORANGE: Color;
  3604. /**
  3605. * An immutable Color instance initialized to CSS color #9932CC
  3606. * <span class="colorSwath" style="background: #9932CC;"></span>
  3607. */
  3608. static readonly DARKORCHID: Color;
  3609. /**
  3610. * An immutable Color instance initialized to CSS color #8B0000
  3611. * <span class="colorSwath" style="background: #8B0000;"></span>
  3612. */
  3613. static readonly DARKRED: Color;
  3614. /**
  3615. * An immutable Color instance initialized to CSS color #E9967A
  3616. * <span class="colorSwath" style="background: #E9967A;"></span>
  3617. */
  3618. static readonly DARKSALMON: Color;
  3619. /**
  3620. * An immutable Color instance initialized to CSS color #8FBC8F
  3621. * <span class="colorSwath" style="background: #8FBC8F;"></span>
  3622. */
  3623. static readonly DARKSEAGREEN: Color;
  3624. /**
  3625. * An immutable Color instance initialized to CSS color #483D8B
  3626. * <span class="colorSwath" style="background: #483D8B;"></span>
  3627. */
  3628. static readonly DARKSLATEBLUE: Color;
  3629. /**
  3630. * An immutable Color instance initialized to CSS color #2F4F4F
  3631. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3632. */
  3633. static readonly DARKSLATEGRAY: Color;
  3634. /**
  3635. * An immutable Color instance initialized to CSS color #2F4F4F
  3636. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3637. */
  3638. static readonly DARKSLATEGREY: Color;
  3639. /**
  3640. * An immutable Color instance initialized to CSS color #00CED1
  3641. * <span class="colorSwath" style="background: #00CED1;"></span>
  3642. */
  3643. static readonly DARKTURQUOISE: Color;
  3644. /**
  3645. * An immutable Color instance initialized to CSS color #9400D3
  3646. * <span class="colorSwath" style="background: #9400D3;"></span>
  3647. */
  3648. static readonly DARKVIOLET: Color;
  3649. /**
  3650. * An immutable Color instance initialized to CSS color #FF1493
  3651. * <span class="colorSwath" style="background: #FF1493;"></span>
  3652. */
  3653. static readonly DEEPPINK: Color;
  3654. /**
  3655. * An immutable Color instance initialized to CSS color #00BFFF
  3656. * <span class="colorSwath" style="background: #00BFFF;"></span>
  3657. */
  3658. static readonly DEEPSKYBLUE: Color;
  3659. /**
  3660. * An immutable Color instance initialized to CSS color #696969
  3661. * <span class="colorSwath" style="background: #696969;"></span>
  3662. */
  3663. static readonly DIMGRAY: Color;
  3664. /**
  3665. * An immutable Color instance initialized to CSS color #696969
  3666. * <span class="colorSwath" style="background: #696969;"></span>
  3667. */
  3668. static readonly DIMGREY: Color;
  3669. /**
  3670. * An immutable Color instance initialized to CSS color #1E90FF
  3671. * <span class="colorSwath" style="background: #1E90FF;"></span>
  3672. */
  3673. static readonly DODGERBLUE: Color;
  3674. /**
  3675. * An immutable Color instance initialized to CSS color #B22222
  3676. * <span class="colorSwath" style="background: #B22222;"></span>
  3677. */
  3678. static readonly FIREBRICK: Color;
  3679. /**
  3680. * An immutable Color instance initialized to CSS color #FFFAF0
  3681. * <span class="colorSwath" style="background: #FFFAF0;"></span>
  3682. */
  3683. static readonly FLORALWHITE: Color;
  3684. /**
  3685. * An immutable Color instance initialized to CSS color #228B22
  3686. * <span class="colorSwath" style="background: #228B22;"></span>
  3687. */
  3688. static readonly FORESTGREEN: Color;
  3689. /**
  3690. * An immutable Color instance initialized to CSS color #FF00FF
  3691. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3692. */
  3693. static readonly FUCHSIA: Color;
  3694. /**
  3695. * An immutable Color instance initialized to CSS color #DCDCDC
  3696. * <span class="colorSwath" style="background: #DCDCDC;"></span>
  3697. */
  3698. static readonly GAINSBORO: Color;
  3699. /**
  3700. * An immutable Color instance initialized to CSS color #F8F8FF
  3701. * <span class="colorSwath" style="background: #F8F8FF;"></span>
  3702. */
  3703. static readonly GHOSTWHITE: Color;
  3704. /**
  3705. * An immutable Color instance initialized to CSS color #FFD700
  3706. * <span class="colorSwath" style="background: #FFD700;"></span>
  3707. */
  3708. static readonly GOLD: Color;
  3709. /**
  3710. * An immutable Color instance initialized to CSS color #DAA520
  3711. * <span class="colorSwath" style="background: #DAA520;"></span>
  3712. */
  3713. static readonly GOLDENROD: Color;
  3714. /**
  3715. * An immutable Color instance initialized to CSS color #808080
  3716. * <span class="colorSwath" style="background: #808080;"></span>
  3717. */
  3718. static readonly GRAY: Color;
  3719. /**
  3720. * An immutable Color instance initialized to CSS color #008000
  3721. * <span class="colorSwath" style="background: #008000;"></span>
  3722. */
  3723. static readonly GREEN: Color;
  3724. /**
  3725. * An immutable Color instance initialized to CSS color #ADFF2F
  3726. * <span class="colorSwath" style="background: #ADFF2F;"></span>
  3727. */
  3728. static readonly GREENYELLOW: Color;
  3729. /**
  3730. * An immutable Color instance initialized to CSS color #808080
  3731. * <span class="colorSwath" style="background: #808080;"></span>
  3732. */
  3733. static readonly GREY: Color;
  3734. /**
  3735. * An immutable Color instance initialized to CSS color #F0FFF0
  3736. * <span class="colorSwath" style="background: #F0FFF0;"></span>
  3737. */
  3738. static readonly HONEYDEW: Color;
  3739. /**
  3740. * An immutable Color instance initialized to CSS color #FF69B4
  3741. * <span class="colorSwath" style="background: #FF69B4;"></span>
  3742. */
  3743. static readonly HOTPINK: Color;
  3744. /**
  3745. * An immutable Color instance initialized to CSS color #CD5C5C
  3746. * <span class="colorSwath" style="background: #CD5C5C;"></span>
  3747. */
  3748. static readonly INDIANRED: Color;
  3749. /**
  3750. * An immutable Color instance initialized to CSS color #4B0082
  3751. * <span class="colorSwath" style="background: #4B0082;"></span>
  3752. */
  3753. static readonly INDIGO: Color;
  3754. /**
  3755. * An immutable Color instance initialized to CSS color #FFFFF0
  3756. * <span class="colorSwath" style="background: #FFFFF0;"></span>
  3757. */
  3758. static readonly IVORY: Color;
  3759. /**
  3760. * An immutable Color instance initialized to CSS color #F0E68C
  3761. * <span class="colorSwath" style="background: #F0E68C;"></span>
  3762. */
  3763. static readonly KHAKI: Color;
  3764. /**
  3765. * An immutable Color instance initialized to CSS color #E6E6FA
  3766. * <span class="colorSwath" style="background: #E6E6FA;"></span>
  3767. */
  3768. static readonly LAVENDER: Color;
  3769. /**
  3770. * An immutable Color instance initialized to CSS color #FFF0F5
  3771. * <span class="colorSwath" style="background: #FFF0F5;"></span>
  3772. */
  3773. static readonly LAVENDAR_BLUSH: Color;
  3774. /**
  3775. * An immutable Color instance initialized to CSS color #7CFC00
  3776. * <span class="colorSwath" style="background: #7CFC00;"></span>
  3777. */
  3778. static readonly LAWNGREEN: Color;
  3779. /**
  3780. * An immutable Color instance initialized to CSS color #FFFACD
  3781. * <span class="colorSwath" style="background: #FFFACD;"></span>
  3782. */
  3783. static readonly LEMONCHIFFON: Color;
  3784. /**
  3785. * An immutable Color instance initialized to CSS color #ADD8E6
  3786. * <span class="colorSwath" style="background: #ADD8E6;"></span>
  3787. */
  3788. static readonly LIGHTBLUE: Color;
  3789. /**
  3790. * An immutable Color instance initialized to CSS color #F08080
  3791. * <span class="colorSwath" style="background: #F08080;"></span>
  3792. */
  3793. static readonly LIGHTCORAL: Color;
  3794. /**
  3795. * An immutable Color instance initialized to CSS color #E0FFFF
  3796. * <span class="colorSwath" style="background: #E0FFFF;"></span>
  3797. */
  3798. static readonly LIGHTCYAN: Color;
  3799. /**
  3800. * An immutable Color instance initialized to CSS color #FAFAD2
  3801. * <span class="colorSwath" style="background: #FAFAD2;"></span>
  3802. */
  3803. static readonly LIGHTGOLDENRODYELLOW: Color;
  3804. /**
  3805. * An immutable Color instance initialized to CSS color #D3D3D3
  3806. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3807. */
  3808. static readonly LIGHTGRAY: Color;
  3809. /**
  3810. * An immutable Color instance initialized to CSS color #90EE90
  3811. * <span class="colorSwath" style="background: #90EE90;"></span>
  3812. */
  3813. static readonly LIGHTGREEN: Color;
  3814. /**
  3815. * An immutable Color instance initialized to CSS color #D3D3D3
  3816. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3817. */
  3818. static readonly LIGHTGREY: Color;
  3819. /**
  3820. * An immutable Color instance initialized to CSS color #FFB6C1
  3821. * <span class="colorSwath" style="background: #FFB6C1;"></span>
  3822. */
  3823. static readonly LIGHTPINK: Color;
  3824. /**
  3825. * An immutable Color instance initialized to CSS color #20B2AA
  3826. * <span class="colorSwath" style="background: #20B2AA;"></span>
  3827. */
  3828. static readonly LIGHTSEAGREEN: Color;
  3829. /**
  3830. * An immutable Color instance initialized to CSS color #87CEFA
  3831. * <span class="colorSwath" style="background: #87CEFA;"></span>
  3832. */
  3833. static readonly LIGHTSKYBLUE: Color;
  3834. /**
  3835. * An immutable Color instance initialized to CSS color #778899
  3836. * <span class="colorSwath" style="background: #778899;"></span>
  3837. */
  3838. static readonly LIGHTSLATEGRAY: Color;
  3839. /**
  3840. * An immutable Color instance initialized to CSS color #778899
  3841. * <span class="colorSwath" style="background: #778899;"></span>
  3842. */
  3843. static readonly LIGHTSLATEGREY: Color;
  3844. /**
  3845. * An immutable Color instance initialized to CSS color #B0C4DE
  3846. * <span class="colorSwath" style="background: #B0C4DE;"></span>
  3847. */
  3848. static readonly LIGHTSTEELBLUE: Color;
  3849. /**
  3850. * An immutable Color instance initialized to CSS color #FFFFE0
  3851. * <span class="colorSwath" style="background: #FFFFE0;"></span>
  3852. */
  3853. static readonly LIGHTYELLOW: Color;
  3854. /**
  3855. * An immutable Color instance initialized to CSS color #00FF00
  3856. * <span class="colorSwath" style="background: #00FF00;"></span>
  3857. */
  3858. static readonly LIME: Color;
  3859. /**
  3860. * An immutable Color instance initialized to CSS color #32CD32
  3861. * <span class="colorSwath" style="background: #32CD32;"></span>
  3862. */
  3863. static readonly LIMEGREEN: Color;
  3864. /**
  3865. * An immutable Color instance initialized to CSS color #FAF0E6
  3866. * <span class="colorSwath" style="background: #FAF0E6;"></span>
  3867. */
  3868. static readonly LINEN: Color;
  3869. /**
  3870. * An immutable Color instance initialized to CSS color #FF00FF
  3871. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3872. */
  3873. static readonly MAGENTA: Color;
  3874. /**
  3875. * An immutable Color instance initialized to CSS color #800000
  3876. * <span class="colorSwath" style="background: #800000;"></span>
  3877. */
  3878. static readonly MAROON: Color;
  3879. /**
  3880. * An immutable Color instance initialized to CSS color #66CDAA
  3881. * <span class="colorSwath" style="background: #66CDAA;"></span>
  3882. */
  3883. static readonly MEDIUMAQUAMARINE: Color;
  3884. /**
  3885. * An immutable Color instance initialized to CSS color #0000CD
  3886. * <span class="colorSwath" style="background: #0000CD;"></span>
  3887. */
  3888. static readonly MEDIUMBLUE: Color;
  3889. /**
  3890. * An immutable Color instance initialized to CSS color #BA55D3
  3891. * <span class="colorSwath" style="background: #BA55D3;"></span>
  3892. */
  3893. static readonly MEDIUMORCHID: Color;
  3894. /**
  3895. * An immutable Color instance initialized to CSS color #9370DB
  3896. * <span class="colorSwath" style="background: #9370DB;"></span>
  3897. */
  3898. static readonly MEDIUMPURPLE: Color;
  3899. /**
  3900. * An immutable Color instance initialized to CSS color #3CB371
  3901. * <span class="colorSwath" style="background: #3CB371;"></span>
  3902. */
  3903. static readonly MEDIUMSEAGREEN: Color;
  3904. /**
  3905. * An immutable Color instance initialized to CSS color #7B68EE
  3906. * <span class="colorSwath" style="background: #7B68EE;"></span>
  3907. */
  3908. static readonly MEDIUMSLATEBLUE: Color;
  3909. /**
  3910. * An immutable Color instance initialized to CSS color #00FA9A
  3911. * <span class="colorSwath" style="background: #00FA9A;"></span>
  3912. */
  3913. static readonly MEDIUMSPRINGGREEN: Color;
  3914. /**
  3915. * An immutable Color instance initialized to CSS color #48D1CC
  3916. * <span class="colorSwath" style="background: #48D1CC;"></span>
  3917. */
  3918. static readonly MEDIUMTURQUOISE: Color;
  3919. /**
  3920. * An immutable Color instance initialized to CSS color #C71585
  3921. * <span class="colorSwath" style="background: #C71585;"></span>
  3922. */
  3923. static readonly MEDIUMVIOLETRED: Color;
  3924. /**
  3925. * An immutable Color instance initialized to CSS color #191970
  3926. * <span class="colorSwath" style="background: #191970;"></span>
  3927. */
  3928. static readonly MIDNIGHTBLUE: Color;
  3929. /**
  3930. * An immutable Color instance initialized to CSS color #F5FFFA
  3931. * <span class="colorSwath" style="background: #F5FFFA;"></span>
  3932. */
  3933. static readonly MINTCREAM: Color;
  3934. /**
  3935. * An immutable Color instance initialized to CSS color #FFE4E1
  3936. * <span class="colorSwath" style="background: #FFE4E1;"></span>
  3937. */
  3938. static readonly MISTYROSE: Color;
  3939. /**
  3940. * An immutable Color instance initialized to CSS color #FFE4B5
  3941. * <span class="colorSwath" style="background: #FFE4B5;"></span>
  3942. */
  3943. static readonly MOCCASIN: Color;
  3944. /**
  3945. * An immutable Color instance initialized to CSS color #FFDEAD
  3946. * <span class="colorSwath" style="background: #FFDEAD;"></span>
  3947. */
  3948. static readonly NAVAJOWHITE: Color;
  3949. /**
  3950. * An immutable Color instance initialized to CSS color #000080
  3951. * <span class="colorSwath" style="background: #000080;"></span>
  3952. */
  3953. static readonly NAVY: Color;
  3954. /**
  3955. * An immutable Color instance initialized to CSS color #FDF5E6
  3956. * <span class="colorSwath" style="background: #FDF5E6;"></span>
  3957. */
  3958. static readonly OLDLACE: Color;
  3959. /**
  3960. * An immutable Color instance initialized to CSS color #808000
  3961. * <span class="colorSwath" style="background: #808000;"></span>
  3962. */
  3963. static readonly OLIVE: Color;
  3964. /**
  3965. * An immutable Color instance initialized to CSS color #6B8E23
  3966. * <span class="colorSwath" style="background: #6B8E23;"></span>
  3967. */
  3968. static readonly OLIVEDRAB: Color;
  3969. /**
  3970. * An immutable Color instance initialized to CSS color #FFA500
  3971. * <span class="colorSwath" style="background: #FFA500;"></span>
  3972. */
  3973. static readonly ORANGE: Color;
  3974. /**
  3975. * An immutable Color instance initialized to CSS color #FF4500
  3976. * <span class="colorSwath" style="background: #FF4500;"></span>
  3977. */
  3978. static readonly ORANGERED: Color;
  3979. /**
  3980. * An immutable Color instance initialized to CSS color #DA70D6
  3981. * <span class="colorSwath" style="background: #DA70D6;"></span>
  3982. */
  3983. static readonly ORCHID: Color;
  3984. /**
  3985. * An immutable Color instance initialized to CSS color #EEE8AA
  3986. * <span class="colorSwath" style="background: #EEE8AA;"></span>
  3987. */
  3988. static readonly PALEGOLDENROD: Color;
  3989. /**
  3990. * An immutable Color instance initialized to CSS color #98FB98
  3991. * <span class="colorSwath" style="background: #98FB98;"></span>
  3992. */
  3993. static readonly PALEGREEN: Color;
  3994. /**
  3995. * An immutable Color instance initialized to CSS color #AFEEEE
  3996. * <span class="colorSwath" style="background: #AFEEEE;"></span>
  3997. */
  3998. static readonly PALETURQUOISE: Color;
  3999. /**
  4000. * An immutable Color instance initialized to CSS color #DB7093
  4001. * <span class="colorSwath" style="background: #DB7093;"></span>
  4002. */
  4003. static readonly PALEVIOLETRED: Color;
  4004. /**
  4005. * An immutable Color instance initialized to CSS color #FFEFD5
  4006. * <span class="colorSwath" style="background: #FFEFD5;"></span>
  4007. */
  4008. static readonly PAPAYAWHIP: Color;
  4009. /**
  4010. * An immutable Color instance initialized to CSS color #FFDAB9
  4011. * <span class="colorSwath" style="background: #FFDAB9;"></span>
  4012. */
  4013. static readonly PEACHPUFF: Color;
  4014. /**
  4015. * An immutable Color instance initialized to CSS color #CD853F
  4016. * <span class="colorSwath" style="background: #CD853F;"></span>
  4017. */
  4018. static readonly PERU: Color;
  4019. /**
  4020. * An immutable Color instance initialized to CSS color #FFC0CB
  4021. * <span class="colorSwath" style="background: #FFC0CB;"></span>
  4022. */
  4023. static readonly PINK: Color;
  4024. /**
  4025. * An immutable Color instance initialized to CSS color #DDA0DD
  4026. * <span class="colorSwath" style="background: #DDA0DD;"></span>
  4027. */
  4028. static readonly PLUM: Color;
  4029. /**
  4030. * An immutable Color instance initialized to CSS color #B0E0E6
  4031. * <span class="colorSwath" style="background: #B0E0E6;"></span>
  4032. */
  4033. static readonly POWDERBLUE: Color;
  4034. /**
  4035. * An immutable Color instance initialized to CSS color #800080
  4036. * <span class="colorSwath" style="background: #800080;"></span>
  4037. */
  4038. static readonly PURPLE: Color;
  4039. /**
  4040. * An immutable Color instance initialized to CSS color #FF0000
  4041. * <span class="colorSwath" style="background: #FF0000;"></span>
  4042. */
  4043. static readonly RED: Color;
  4044. /**
  4045. * An immutable Color instance initialized to CSS color #BC8F8F
  4046. * <span class="colorSwath" style="background: #BC8F8F;"></span>
  4047. */
  4048. static readonly ROSYBROWN: Color;
  4049. /**
  4050. * An immutable Color instance initialized to CSS color #4169E1
  4051. * <span class="colorSwath" style="background: #4169E1;"></span>
  4052. */
  4053. static readonly ROYALBLUE: Color;
  4054. /**
  4055. * An immutable Color instance initialized to CSS color #8B4513
  4056. * <span class="colorSwath" style="background: #8B4513;"></span>
  4057. */
  4058. static readonly SADDLEBROWN: Color;
  4059. /**
  4060. * An immutable Color instance initialized to CSS color #FA8072
  4061. * <span class="colorSwath" style="background: #FA8072;"></span>
  4062. */
  4063. static readonly SALMON: Color;
  4064. /**
  4065. * An immutable Color instance initialized to CSS color #F4A460
  4066. * <span class="colorSwath" style="background: #F4A460;"></span>
  4067. */
  4068. static readonly SANDYBROWN: Color;
  4069. /**
  4070. * An immutable Color instance initialized to CSS color #2E8B57
  4071. * <span class="colorSwath" style="background: #2E8B57;"></span>
  4072. */
  4073. static readonly SEAGREEN: Color;
  4074. /**
  4075. * An immutable Color instance initialized to CSS color #FFF5EE
  4076. * <span class="colorSwath" style="background: #FFF5EE;"></span>
  4077. */
  4078. static readonly SEASHELL: Color;
  4079. /**
  4080. * An immutable Color instance initialized to CSS color #A0522D
  4081. * <span class="colorSwath" style="background: #A0522D;"></span>
  4082. */
  4083. static readonly SIENNA: Color;
  4084. /**
  4085. * An immutable Color instance initialized to CSS color #C0C0C0
  4086. * <span class="colorSwath" style="background: #C0C0C0;"></span>
  4087. */
  4088. static readonly SILVER: Color;
  4089. /**
  4090. * An immutable Color instance initialized to CSS color #87CEEB
  4091. * <span class="colorSwath" style="background: #87CEEB;"></span>
  4092. */
  4093. static readonly SKYBLUE: Color;
  4094. /**
  4095. * An immutable Color instance initialized to CSS color #6A5ACD
  4096. * <span class="colorSwath" style="background: #6A5ACD;"></span>
  4097. */
  4098. static readonly SLATEBLUE: Color;
  4099. /**
  4100. * An immutable Color instance initialized to CSS color #708090
  4101. * <span class="colorSwath" style="background: #708090;"></span>
  4102. */
  4103. static readonly SLATEGRAY: Color;
  4104. /**
  4105. * An immutable Color instance initialized to CSS color #708090
  4106. * <span class="colorSwath" style="background: #708090;"></span>
  4107. */
  4108. static readonly SLATEGREY: Color;
  4109. /**
  4110. * An immutable Color instance initialized to CSS color #FFFAFA
  4111. * <span class="colorSwath" style="background: #FFFAFA;"></span>
  4112. */
  4113. static readonly SNOW: Color;
  4114. /**
  4115. * An immutable Color instance initialized to CSS color #00FF7F
  4116. * <span class="colorSwath" style="background: #00FF7F;"></span>
  4117. */
  4118. static readonly SPRINGGREEN: Color;
  4119. /**
  4120. * An immutable Color instance initialized to CSS color #4682B4
  4121. * <span class="colorSwath" style="background: #4682B4;"></span>
  4122. */
  4123. static readonly STEELBLUE: Color;
  4124. /**
  4125. * An immutable Color instance initialized to CSS color #D2B48C
  4126. * <span class="colorSwath" style="background: #D2B48C;"></span>
  4127. */
  4128. static readonly TAN: Color;
  4129. /**
  4130. * An immutable Color instance initialized to CSS color #008080
  4131. * <span class="colorSwath" style="background: #008080;"></span>
  4132. */
  4133. static readonly TEAL: Color;
  4134. /**
  4135. * An immutable Color instance initialized to CSS color #D8BFD8
  4136. * <span class="colorSwath" style="background: #D8BFD8;"></span>
  4137. */
  4138. static readonly THISTLE: Color;
  4139. /**
  4140. * An immutable Color instance initialized to CSS color #FF6347
  4141. * <span class="colorSwath" style="background: #FF6347;"></span>
  4142. */
  4143. static readonly TOMATO: Color;
  4144. /**
  4145. * An immutable Color instance initialized to CSS color #40E0D0
  4146. * <span class="colorSwath" style="background: #40E0D0;"></span>
  4147. */
  4148. static readonly TURQUOISE: Color;
  4149. /**
  4150. * An immutable Color instance initialized to CSS color #EE82EE
  4151. * <span class="colorSwath" style="background: #EE82EE;"></span>
  4152. */
  4153. static readonly VIOLET: Color;
  4154. /**
  4155. * An immutable Color instance initialized to CSS color #F5DEB3
  4156. * <span class="colorSwath" style="background: #F5DEB3;"></span>
  4157. */
  4158. static readonly WHEAT: Color;
  4159. /**
  4160. * An immutable Color instance initialized to CSS color #FFFFFF
  4161. * <span class="colorSwath" style="background: #FFFFFF;"></span>
  4162. */
  4163. static readonly WHITE: Color;
  4164. /**
  4165. * An immutable Color instance initialized to CSS color #F5F5F5
  4166. * <span class="colorSwath" style="background: #F5F5F5;"></span>
  4167. */
  4168. static readonly WHITESMOKE: Color;
  4169. /**
  4170. * An immutable Color instance initialized to CSS color #FFFF00
  4171. * <span class="colorSwath" style="background: #FFFF00;"></span>
  4172. */
  4173. static readonly YELLOW: Color;
  4174. /**
  4175. * An immutable Color instance initialized to CSS color #9ACD32
  4176. * <span class="colorSwath" style="background: #9ACD32;"></span>
  4177. */
  4178. static readonly YELLOWGREEN: Color;
  4179. /**
  4180. * An immutable Color instance initialized to CSS transparent.
  4181. * <span class="colorSwath" style="background: transparent;"></span>
  4182. */
  4183. static readonly TRANSPARENT: Color;
  4184. }
  4185. /**
  4186. * Value and type information for per-instance geometry color.
  4187. * @example
  4188. * var instance = new Cesium.GeometryInstance({
  4189. * geometry : Cesium.BoxGeometry.fromDimensions({
  4190. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  4191. * }),
  4192. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  4193. * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  4194. * id : 'box',
  4195. * attributes : {
  4196. * color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)
  4197. * }
  4198. * });
  4199. * @param [red = 1.0] - The red component.
  4200. * @param [green = 1.0] - The green component.
  4201. * @param [blue = 1.0] - The blue component.
  4202. * @param [alpha = 1.0] - The alpha component.
  4203. */
  4204. export class ColorGeometryInstanceAttribute {
  4205. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  4206. /**
  4207. * The values for the attributes stored in a typed array.
  4208. */
  4209. value: Uint8Array;
  4210. /**
  4211. * The datatype of each component in the attribute, e.g., individual elements in
  4212. * {@link ColorGeometryInstanceAttribute#value}.
  4213. */
  4214. readonly componentDatatype: ComponentDatatype;
  4215. /**
  4216. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  4217. */
  4218. readonly componentsPerAttribute: number;
  4219. /**
  4220. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  4221. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  4222. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  4223. */
  4224. readonly normalize: boolean;
  4225. /**
  4226. * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.
  4227. * @example
  4228. * var instance = new Cesium.GeometryInstance({
  4229. * geometry : geometry,
  4230. * attributes : {
  4231. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),
  4232. * }
  4233. * });
  4234. * @param color - The color.
  4235. * @returns The new {@link ColorGeometryInstanceAttribute} instance.
  4236. */
  4237. static fromColor(color: Color): ColorGeometryInstanceAttribute;
  4238. /**
  4239. * Converts a color to a typed array that can be used to assign a color attribute.
  4240. * @example
  4241. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  4242. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);
  4243. * @param color - The color.
  4244. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  4245. * @returns The modified result parameter or a new instance if result was undefined.
  4246. */
  4247. static toValue(color: Color, result?: Uint8Array): Uint8Array;
  4248. /**
  4249. * Compares the provided ColorGeometryInstanceAttributes and returns
  4250. * <code>true</code> if they are equal, <code>false</code> otherwise.
  4251. * @param [left] - The first ColorGeometryInstanceAttribute.
  4252. * @param [right] - The second ColorGeometryInstanceAttribute.
  4253. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4254. */
  4255. static equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean;
  4256. }
  4257. /**
  4258. * WebGL component datatypes. Components are intrinsics,
  4259. * which form attributes, which form vertices.
  4260. */
  4261. export enum ComponentDatatype {
  4262. /**
  4263. * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
  4264. * of an element in <code>Int8Array</code>.
  4265. */
  4266. BYTE = WebGLConstants.BYTE,
  4267. /**
  4268. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  4269. * of an element in <code>Uint8Array</code>.
  4270. */
  4271. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  4272. /**
  4273. * 16-bit signed short corresponding to <code>SHORT</code> and the type
  4274. * of an element in <code>Int16Array</code>.
  4275. */
  4276. SHORT = WebGLConstants.SHORT,
  4277. /**
  4278. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  4279. * of an element in <code>Uint16Array</code>.
  4280. */
  4281. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  4282. /**
  4283. * 32-bit signed int corresponding to <code>INT</code> and the type
  4284. * of an element in <code>Int32Array</code>.
  4285. */
  4286. INT = WebGLConstants.INT,
  4287. /**
  4288. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  4289. * of an element in <code>Uint32Array</code>.
  4290. */
  4291. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  4292. /**
  4293. * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
  4294. * of an element in <code>Float32Array</code>.
  4295. */
  4296. FLOAT = WebGLConstants.FLOAT,
  4297. /**
  4298. * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
  4299. * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
  4300. * and the type of an element in <code>Float64Array</code>.
  4301. */
  4302. DOUBLE = WebGLConstants.DOUBLE
  4303. }
  4304. /**
  4305. * Describes a compressed texture and contains a compressed texture buffer.
  4306. * @param internalFormat - The pixel format of the compressed texture.
  4307. * @param pixelDatatype - The pixel datatype of the compressed texture.
  4308. * @param width - The width of the texture.
  4309. * @param height - The height of the texture.
  4310. * @param buffer - The compressed texture buffer.
  4311. */
  4312. export class CompressedTextureBuffer {
  4313. constructor(internalFormat: PixelFormat, pixelDatatype: PixelDatatype, width: number, height: number, buffer: Uint8Array);
  4314. /**
  4315. * The format of the compressed texture.
  4316. */
  4317. readonly internalFormat: PixelFormat;
  4318. /**
  4319. * The datatype of the compressed texture.
  4320. */
  4321. readonly pixelDatatype: PixelDatatype;
  4322. /**
  4323. * The width of the texture.
  4324. */
  4325. readonly width: number;
  4326. /**
  4327. * The height of the texture.
  4328. */
  4329. readonly height: number;
  4330. /**
  4331. * The compressed texture buffer.
  4332. */
  4333. readonly bufferView: Uint8Array;
  4334. /**
  4335. * Creates a shallow clone of a compressed texture buffer.
  4336. * @param object - The compressed texture buffer to be cloned.
  4337. * @returns A shallow clone of the compressed texture buffer.
  4338. */
  4339. static clone(object: CompressedTextureBuffer): CompressedTextureBuffer;
  4340. /**
  4341. * Creates a shallow clone of this compressed texture buffer.
  4342. * @returns A shallow clone of the compressed texture buffer.
  4343. */
  4344. clone(): CompressedTextureBuffer;
  4345. }
  4346. /**
  4347. * A description of a polygon composed of arbitrary coplanar positions.
  4348. * @example
  4349. * var polygonGeometry = new Cesium.CoplanarPolygonGeometry({
  4350. * polygonHierarchy: new Cesium.PolygonHierarchy(
  4351. * Cesium.Cartesian3.fromDegreesArrayHeights([
  4352. * -90.0, 30.0, 0.0,
  4353. * -90.0, 30.0, 300000.0,
  4354. * -80.0, 30.0, 300000.0,
  4355. * -80.0, 30.0, 0.0
  4356. * ]))
  4357. * });
  4358. * @param options - Object with the following properties:
  4359. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4360. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4361. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4362. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4363. */
  4364. export class CoplanarPolygonGeometry {
  4365. constructor(options: {
  4366. polygonHierarchy: PolygonHierarchy;
  4367. stRotation?: number;
  4368. vertexFormat?: VertexFormat;
  4369. ellipsoid?: Ellipsoid;
  4370. });
  4371. /**
  4372. * The number of elements used to pack the object into an array.
  4373. */
  4374. packedLength: number;
  4375. /**
  4376. * A description of a coplanar polygon from an array of positions.
  4377. * @example
  4378. * // create a polygon from points
  4379. * var polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
  4380. * positions : Cesium.Cartesian3.fromDegreesArray([
  4381. * -72.0, 40.0,
  4382. * -70.0, 35.0,
  4383. * -75.0, 30.0,
  4384. * -70.0, 30.0,
  4385. * -68.0, 40.0
  4386. * ])
  4387. * });
  4388. * var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  4389. * @param options - Object with the following properties:
  4390. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4391. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4392. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4393. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4394. */
  4395. static fromPositions(options: {
  4396. positions: Cartesian3[];
  4397. vertexFormat?: VertexFormat;
  4398. stRotation?: number;
  4399. ellipsoid?: Ellipsoid;
  4400. }): CoplanarPolygonGeometry;
  4401. /**
  4402. * Stores the provided instance into the provided array.
  4403. * @param value - The value to pack.
  4404. * @param array - The array to pack into.
  4405. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4406. * @returns The array that was packed into
  4407. */
  4408. static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[];
  4409. /**
  4410. * Retrieves an instance from a packed array.
  4411. * @param array - The packed array.
  4412. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4413. * @param [result] - The object into which to store the result.
  4414. * @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
  4415. */
  4416. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry;
  4417. /**
  4418. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4419. * @param polygonGeometry - A description of the polygon.
  4420. * @returns The computed vertices and indices.
  4421. */
  4422. static createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined;
  4423. }
  4424. /**
  4425. * A description of the outline of a polygon composed of arbitrary coplanar positions.
  4426. * @example
  4427. * var polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
  4428. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  4429. * -90.0, 30.0, 0.0,
  4430. * -90.0, 30.0, 1000.0,
  4431. * -80.0, 30.0, 1000.0,
  4432. * -80.0, 30.0, 0.0
  4433. * ])
  4434. * });
  4435. * var geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
  4436. * @param options - Object with the following properties:
  4437. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4438. */
  4439. export class CoplanarPolygonOutlineGeometry {
  4440. constructor(options: {
  4441. polygonHierarchy: PolygonHierarchy;
  4442. });
  4443. /**
  4444. * The number of elements used to pack the object into an array.
  4445. */
  4446. packedLength: number;
  4447. /**
  4448. * A description of a coplanar polygon outline from an array of positions.
  4449. * @param options - Object with the following properties:
  4450. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4451. */
  4452. static fromPositions(options: {
  4453. positions: Cartesian3[];
  4454. }): CoplanarPolygonOutlineGeometry;
  4455. /**
  4456. * Stores the provided instance into the provided array.
  4457. * @param value - The value to pack.
  4458. * @param array - The array to pack into.
  4459. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4460. * @returns The array that was packed into
  4461. */
  4462. static pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  4463. /**
  4464. * Retrieves an instance from a packed array.
  4465. * @param array - The packed array.
  4466. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4467. * @param [result] - The object into which to store the result.
  4468. * @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
  4469. */
  4470. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry;
  4471. /**
  4472. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4473. * @param polygonGeometry - A description of the polygon.
  4474. * @returns The computed vertices and indices.
  4475. */
  4476. static createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined;
  4477. }
  4478. /**
  4479. * Style options for corners.
  4480. */
  4481. export enum CornerType {
  4482. /**
  4483. * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
  4484. *
  4485. * Corner has a smooth edge.
  4486. */
  4487. ROUNDED = 0,
  4488. /**
  4489. * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
  4490. *
  4491. * Corner point is the intersection of adjacent edges.
  4492. */
  4493. MITERED = 1,
  4494. /**
  4495. * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
  4496. *
  4497. * Corner is clipped.
  4498. */
  4499. BEVELED = 2
  4500. }
  4501. /**
  4502. * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  4503. * @example
  4504. * var corridor = new Cesium.CorridorGeometry({
  4505. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  4506. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4507. * width : 100000
  4508. * });
  4509. * @param options - Object with the following properties:
  4510. * @param options.positions - An array of positions that define the center of the corridor.
  4511. * @param options.width - The distance between the edges of the corridor in meters.
  4512. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4513. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4514. * @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions.
  4515. * @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face.
  4516. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4517. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4518. */
  4519. export class CorridorGeometry {
  4520. constructor(options: {
  4521. positions: Cartesian3[];
  4522. width: number;
  4523. ellipsoid?: Ellipsoid;
  4524. granularity?: number;
  4525. height?: number;
  4526. extrudedHeight?: number;
  4527. vertexFormat?: VertexFormat;
  4528. cornerType?: CornerType;
  4529. });
  4530. /**
  4531. * The number of elements used to pack the object into an array.
  4532. */
  4533. packedLength: number;
  4534. /**
  4535. * Stores the provided instance into the provided array.
  4536. * @param value - The value to pack.
  4537. * @param array - The array to pack into.
  4538. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4539. * @returns The array that was packed into
  4540. */
  4541. static pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[];
  4542. /**
  4543. * Retrieves an instance from a packed array.
  4544. * @param array - The packed array.
  4545. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4546. * @param [result] - The object into which to store the result.
  4547. * @returns The modified result parameter or a new CorridorGeometry instance if one was not provided.
  4548. */
  4549. static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry;
  4550. /**
  4551. * Computes the bounding rectangle given the provided options
  4552. * @param options - Object with the following properties:
  4553. * @param options.positions - An array of positions that define the center of the corridor.
  4554. * @param options.width - The distance between the edges of the corridor in meters.
  4555. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4556. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4557. * @param [result] - An object in which to store the result.
  4558. * @returns The result rectangle.
  4559. */
  4560. static computeRectangle(options: {
  4561. positions: Cartesian3[];
  4562. width: number;
  4563. ellipsoid?: Ellipsoid;
  4564. cornerType?: CornerType;
  4565. }, result?: Rectangle): Rectangle;
  4566. /**
  4567. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4568. * @param corridorGeometry - A description of the corridor.
  4569. * @returns The computed vertices and indices.
  4570. */
  4571. static createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined;
  4572. }
  4573. /**
  4574. * A description of a corridor outline.
  4575. * @example
  4576. * var corridor = new Cesium.CorridorOutlineGeometry({
  4577. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4578. * width : 100000
  4579. * });
  4580. * @param options - Object with the following properties:
  4581. * @param options.positions - An array of positions that define the center of the corridor outline.
  4582. * @param options.width - The distance between the edges of the corridor outline.
  4583. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4584. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4585. * @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface.
  4586. * @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface.
  4587. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4588. */
  4589. export class CorridorOutlineGeometry {
  4590. constructor(options: {
  4591. positions: Cartesian3[];
  4592. width: number;
  4593. ellipsoid?: Ellipsoid;
  4594. granularity?: number;
  4595. height?: number;
  4596. extrudedHeight?: number;
  4597. cornerType?: CornerType;
  4598. });
  4599. /**
  4600. * The number of elements used to pack the object into an array.
  4601. */
  4602. packedLength: number;
  4603. /**
  4604. * Stores the provided instance into the provided array.
  4605. * @param value - The value to pack.
  4606. * @param array - The array to pack into.
  4607. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4608. * @returns The array that was packed into
  4609. */
  4610. static pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[];
  4611. /**
  4612. * Retrieves an instance from a packed array.
  4613. * @param array - The packed array.
  4614. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4615. * @param [result] - The object into which to store the result.
  4616. * @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
  4617. */
  4618. static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry;
  4619. /**
  4620. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4621. * @param corridorOutlineGeometry - A description of the corridor.
  4622. * @returns The computed vertices and indices.
  4623. */
  4624. static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined;
  4625. }
  4626. /**
  4627. * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
  4628. * @example
  4629. * //Create a credit with a tooltip, image and link
  4630. * var credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
  4631. * @param html - An string representing an html code snippet
  4632. * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
  4633. */
  4634. export class Credit {
  4635. constructor(html: string, showOnScreen?: boolean);
  4636. /**
  4637. * The credit content
  4638. */
  4639. readonly html: string;
  4640. /**
  4641. * Whether the credit should be displayed on screen or in a lightbox
  4642. */
  4643. readonly showOnScreen: boolean;
  4644. /**
  4645. * Gets the credit element
  4646. */
  4647. readonly element: HTMLElement;
  4648. /**
  4649. * Returns true if the credits are equal
  4650. * @param left - The first credit
  4651. * @param right - The second credit
  4652. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4653. */
  4654. static equals(left: Credit, right: Credit): boolean;
  4655. /**
  4656. * Returns true if the credits are equal
  4657. * @param credit - The credit to compare to.
  4658. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4659. */
  4660. equals(credit: Credit): boolean;
  4661. /**
  4662. * Duplicates a Credit instance.
  4663. * @param [credit] - The Credit to duplicate.
  4664. * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
  4665. */
  4666. static clone(credit?: Credit): Credit;
  4667. }
  4668. /**
  4669. * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
  4670. */
  4671. export namespace CubicRealPolynomial {
  4672. /**
  4673. * Provides the discriminant of the cubic equation from the supplied coefficients.
  4674. * @param a - The coefficient of the 3rd order monomial.
  4675. * @param b - The coefficient of the 2nd order monomial.
  4676. * @param c - The coefficient of the 1st order monomial.
  4677. * @param d - The coefficient of the 0th order monomial.
  4678. * @returns The value of the discriminant.
  4679. */
  4680. function computeDiscriminant(a: number, b: number, c: number, d: number): number;
  4681. /**
  4682. * Provides the real valued roots of the cubic polynomial with the provided coefficients.
  4683. * @param a - The coefficient of the 3rd order monomial.
  4684. * @param b - The coefficient of the 2nd order monomial.
  4685. * @param c - The coefficient of the 1st order monomial.
  4686. * @param d - The coefficient of the 0th order monomial.
  4687. * @returns The real valued roots.
  4688. */
  4689. function computeRealRoots(a: number, b: number, c: number, d: number): number[];
  4690. }
  4691. /**
  4692. * The culling volume defined by planes.
  4693. * @param [planes] - An array of clipping planes.
  4694. */
  4695. export class CullingVolume {
  4696. constructor(planes?: Cartesian4[]);
  4697. /**
  4698. * Each plane is represented by a Cartesian4 object, where the x, y, and z components
  4699. * define the unit vector normal to the plane, and the w component is the distance of the
  4700. * plane from the origin.
  4701. */
  4702. planes: Cartesian4[];
  4703. /**
  4704. * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
  4705. * The planes are aligned to the x, y, and z axes in world coordinates.
  4706. * @param boundingSphere - The bounding sphere used to create the culling volume.
  4707. * @param [result] - The object onto which to store the result.
  4708. * @returns The culling volume created from the bounding sphere.
  4709. */
  4710. static fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume;
  4711. /**
  4712. * Determines whether a bounding volume intersects the culling volume.
  4713. * @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested.
  4714. * @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
  4715. */
  4716. computeVisibility(boundingVolume: any): Intersect;
  4717. }
  4718. export namespace CustomHeightmapTerrainProvider {
  4719. /**
  4720. * @param x - The X coordinate of the tile for which to request geometry.
  4721. * @param y - The Y coordinate of the tile for which to request geometry.
  4722. * @param level - The level of the tile for which to request geometry.
  4723. */
  4724. type GeometryCallback = (x: number, y: number, level: number) => Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | number[] | Promise<Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | number[]> | undefined;
  4725. }
  4726. /**
  4727. * A simple {@link TerrainProvider} that gets height values from a callback function.
  4728. * It can be used for procedurally generated terrain or as a way to load custom
  4729. * heightmap data without creating a subclass of {@link TerrainProvider}.
  4730. *
  4731. * There are some limitations such as no water mask, no vertex normals, and no
  4732. * availability, so a full-fledged {@link TerrainProvider} subclass is better suited
  4733. * for these more sophisticated use cases.
  4734. * @example
  4735. * var viewer = new Cesium.Viewer("cesiumContainer", {
  4736. * terrainProvider: new Cesium.CustomHeightmapTerrainProvider({
  4737. * width: 32,
  4738. * height: 32,
  4739. * callback: function (x, y, level) {
  4740. * return new Float32Array(32 * 32); // all zeros
  4741. * },
  4742. * }),
  4743. * });
  4744. * @param options - Object with the following properties:
  4745. * @param options.callback - The callback function for requesting tile geometry.
  4746. * @param options.width - The number of columns per heightmap tile.
  4747. * @param options.height - The number of rows per heightmap tile.
  4748. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  4749. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  4750. * is used.
  4751. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  4752. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  4753. * parameter is specified, the WGS84 ellipsoid is used.
  4754. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  4755. */
  4756. export class CustomHeightmapTerrainProvider {
  4757. constructor(options: {
  4758. callback: CustomHeightmapTerrainProvider.GeometryCallback;
  4759. width: number;
  4760. height: number;
  4761. tilingScheme?: TilingScheme;
  4762. ellipsoid?: Ellipsoid;
  4763. credit?: Credit | string;
  4764. });
  4765. /**
  4766. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  4767. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  4768. * are passed an instance of {@link TileProviderError}.
  4769. */
  4770. readonly errorEvent: Event;
  4771. /**
  4772. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  4773. * the source of the terrain.
  4774. */
  4775. readonly credit: Credit;
  4776. /**
  4777. * Gets the tiling scheme used by this provider.
  4778. */
  4779. readonly tilingScheme: TilingScheme;
  4780. /**
  4781. * Gets a value indicating whether or not the provider is ready for use.
  4782. */
  4783. readonly ready: boolean;
  4784. /**
  4785. * Gets a promise that resolves to true when the provider is ready for use.
  4786. */
  4787. readonly readyPromise: Promise<boolean>;
  4788. /**
  4789. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  4790. * indicates which areas of the globe are water rather than land, so they can be rendered
  4791. * as a reflective surface with animated waves.
  4792. * Water mask is not supported by {@link CustomHeightmapTerrainProvider}, so the return
  4793. * value will always be false.
  4794. */
  4795. readonly hasWaterMask: boolean;
  4796. /**
  4797. * Gets a value indicating whether or not the requested tiles include vertex normals.
  4798. * Vertex normals are not supported by {@link CustomHeightmapTerrainProvider}, so the return
  4799. * value will always be false.
  4800. */
  4801. readonly hasVertexNormals: boolean;
  4802. /**
  4803. * Gets the number of columns per heightmap tile.
  4804. */
  4805. readonly width: boolean;
  4806. /**
  4807. * Gets the number of rows per heightmap tile.
  4808. */
  4809. readonly height: boolean;
  4810. /**
  4811. * Requests the geometry for a given tile. The result includes terrain
  4812. * data and indicates that all child tiles are available.
  4813. * @param x - The X coordinate of the tile for which to request geometry.
  4814. * @param y - The Y coordinate of the tile for which to request geometry.
  4815. * @param level - The level of the tile for which to request geometry.
  4816. * @param [request] - The request object. Intended for internal use only.
  4817. * @returns A promise for the requested geometry. If this method
  4818. * returns undefined instead of a promise, it is an indication that too many requests are already
  4819. * pending and the request will be retried later.
  4820. */
  4821. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  4822. /**
  4823. * Gets the maximum geometric error allowed in a tile at a given level.
  4824. * @param level - The tile level for which to get the maximum geometric error.
  4825. * @returns The maximum geometric error.
  4826. */
  4827. getLevelMaximumGeometricError(level: number): number;
  4828. /**
  4829. * Determines whether data for a tile is available to be loaded.
  4830. * @param x - The X coordinate of the tile for which to request geometry.
  4831. * @param y - The Y coordinate of the tile for which to request geometry.
  4832. * @param level - The level of the tile for which to request geometry.
  4833. * @returns Undefined if not supported, otherwise true or false.
  4834. */
  4835. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  4836. /**
  4837. * Makes sure we load availability data for a tile
  4838. * @param x - The X coordinate of the tile for which to request geometry.
  4839. * @param y - The Y coordinate of the tile for which to request geometry.
  4840. * @param level - The level of the tile for which to request geometry.
  4841. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  4842. */
  4843. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  4844. }
  4845. /**
  4846. * A description of a cylinder.
  4847. * @example
  4848. * // create cylinder geometry
  4849. * var cylinder = new Cesium.CylinderGeometry({
  4850. * length: 200000,
  4851. * topRadius: 80000,
  4852. * bottomRadius: 200000,
  4853. * });
  4854. * var geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
  4855. * @param options - Object with the following properties:
  4856. * @param options.length - The length of the cylinder.
  4857. * @param options.topRadius - The radius of the top of the cylinder.
  4858. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4859. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4860. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4861. */
  4862. export class CylinderGeometry {
  4863. constructor(options: {
  4864. length: number;
  4865. topRadius: number;
  4866. bottomRadius: number;
  4867. slices?: number;
  4868. vertexFormat?: VertexFormat;
  4869. });
  4870. /**
  4871. * The number of elements used to pack the object into an array.
  4872. */
  4873. static packedLength: number;
  4874. /**
  4875. * Stores the provided instance into the provided array.
  4876. * @param value - The value to pack.
  4877. * @param array - The array to pack into.
  4878. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4879. * @returns The array that was packed into
  4880. */
  4881. static pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[];
  4882. /**
  4883. * Retrieves an instance from a packed array.
  4884. * @param array - The packed array.
  4885. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4886. * @param [result] - The object into which to store the result.
  4887. * @returns The modified result parameter or a new CylinderGeometry instance if one was not provided.
  4888. */
  4889. static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry;
  4890. /**
  4891. * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
  4892. * @param cylinderGeometry - A description of the cylinder.
  4893. * @returns The computed vertices and indices.
  4894. */
  4895. static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined;
  4896. }
  4897. /**
  4898. * A description of the outline of a cylinder.
  4899. * @example
  4900. * // create cylinder geometry
  4901. * var cylinder = new Cesium.CylinderOutlineGeometry({
  4902. * length: 200000,
  4903. * topRadius: 80000,
  4904. * bottomRadius: 200000,
  4905. * });
  4906. * var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
  4907. * @param options - Object with the following properties:
  4908. * @param options.length - The length of the cylinder.
  4909. * @param options.topRadius - The radius of the top of the cylinder.
  4910. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4911. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4912. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder.
  4913. */
  4914. export class CylinderOutlineGeometry {
  4915. constructor(options: {
  4916. length: number;
  4917. topRadius: number;
  4918. bottomRadius: number;
  4919. slices?: number;
  4920. numberOfVerticalLines?: number;
  4921. });
  4922. /**
  4923. * The number of elements used to pack the object into an array.
  4924. */
  4925. static packedLength: number;
  4926. /**
  4927. * Stores the provided instance into the provided array.
  4928. * @param value - The value to pack.
  4929. * @param array - The array to pack into.
  4930. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4931. * @returns The array that was packed into
  4932. */
  4933. static pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[];
  4934. /**
  4935. * Retrieves an instance from a packed array.
  4936. * @param array - The packed array.
  4937. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4938. * @param [result] - The object into which to store the result.
  4939. * @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
  4940. */
  4941. static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry;
  4942. /**
  4943. * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
  4944. * @param cylinderGeometry - A description of the cylinder outline.
  4945. * @returns The computed vertices and indices.
  4946. */
  4947. static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined;
  4948. }
  4949. /**
  4950. * A simple proxy that appends the desired resource as the sole query parameter
  4951. * to the given proxy URL.
  4952. * @param proxy - The proxy URL that will be used to requests all resources.
  4953. */
  4954. export class DefaultProxy extends Proxy {
  4955. constructor(proxy: string);
  4956. /**
  4957. * Get the final URL to use to request a given resource.
  4958. * @param resource - The resource to request.
  4959. * @returns proxied resource
  4960. */
  4961. getURL(resource: string): string;
  4962. }
  4963. /**
  4964. * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
  4965. * argument out of range, etc. This exception should only be thrown during development;
  4966. * it usually indicates a bug in the calling code. This exception should never be
  4967. * caught; instead the calling code should strive not to generate it.
  4968. * <br /><br />
  4969. * On the other hand, a {@link RuntimeError} indicates an exception that may
  4970. * be thrown at runtime, e.g., out of memory, that the calling code should be prepared
  4971. * to catch.
  4972. * @param [message] - The error message for this exception.
  4973. */
  4974. export class DeveloperError extends Error {
  4975. constructor(message?: string);
  4976. /**
  4977. * 'DeveloperError' indicating that this exception was thrown due to a developer error.
  4978. */
  4979. readonly name: string;
  4980. /**
  4981. * The explanation for why this exception was thrown.
  4982. */
  4983. readonly message: string;
  4984. /**
  4985. * The stack trace of this exception, if available.
  4986. */
  4987. readonly stack: string;
  4988. }
  4989. /**
  4990. * Determines visibility based on the distance to the camera.
  4991. * @example
  4992. * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
  4993. * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
  4994. * @param [near = 0.0] - The smallest distance in the interval where the object is visible.
  4995. * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible.
  4996. */
  4997. export class DistanceDisplayCondition {
  4998. constructor(near?: number, far?: number);
  4999. /**
  5000. * The smallest distance in the interval where the object is visible.
  5001. */
  5002. near: number;
  5003. /**
  5004. * The largest distance in the interval where the object is visible.
  5005. */
  5006. far: number;
  5007. /**
  5008. * The number of elements used to pack the object into an array.
  5009. */
  5010. static packedLength: number;
  5011. /**
  5012. * Stores the provided instance into the provided array.
  5013. * @param value - The value to pack.
  5014. * @param array - The array to pack into.
  5015. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5016. * @returns The array that was packed into
  5017. */
  5018. static pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[];
  5019. /**
  5020. * Retrieves an instance from a packed array.
  5021. * @param array - The packed array.
  5022. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5023. * @param [result] - The object into which to store the result.
  5024. * @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
  5025. */
  5026. static unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5027. /**
  5028. * Determines if two distance display conditions are equal.
  5029. * @param left - A distance display condition.
  5030. * @param right - Another distance display condition.
  5031. * @returns Whether the two distance display conditions are equal.
  5032. */
  5033. static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean;
  5034. /**
  5035. * Duplicates a distance display condition instance.
  5036. * @param [value] - The distance display condition to duplicate.
  5037. * @param [result] - The result onto which to store the result.
  5038. * @returns The duplicated instance.
  5039. */
  5040. static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5041. /**
  5042. * Duplicates this instance.
  5043. * @param [result] - The result onto which to store the result.
  5044. * @returns The duplicated instance.
  5045. */
  5046. clone(result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5047. /**
  5048. * Determines if this distance display condition is equal to another.
  5049. * @param other - Another distance display condition.
  5050. * @returns Whether this distance display condition is equal to the other.
  5051. */
  5052. equals(other: DistanceDisplayCondition): boolean;
  5053. }
  5054. /**
  5055. * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
  5056. * @example
  5057. * var instance = new Cesium.GeometryInstance({
  5058. * geometry : new Cesium.BoxGeometry({
  5059. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  5060. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  5061. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  5062. * }),
  5063. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  5064. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  5065. * id : 'box',
  5066. * attributes : {
  5067. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
  5068. * }
  5069. * });
  5070. * @param [near = 0.0] - The near distance.
  5071. * @param [far = Number.MAX_VALUE] - The far distance.
  5072. */
  5073. export class DistanceDisplayConditionGeometryInstanceAttribute {
  5074. constructor(near?: number, far?: number);
  5075. /**
  5076. * The values for the attributes stored in a typed array.
  5077. */
  5078. value: Float32Array;
  5079. /**
  5080. * The datatype of each component in the attribute, e.g., individual elements in
  5081. * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5082. */
  5083. readonly componentDatatype: ComponentDatatype;
  5084. /**
  5085. * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5086. */
  5087. readonly componentsPerAttribute: number;
  5088. /**
  5089. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  5090. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  5091. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  5092. */
  5093. readonly normalize: boolean;
  5094. /**
  5095. * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
  5096. * @example
  5097. * var distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);
  5098. * var instance = new Cesium.GeometryInstance({
  5099. * geometry : geometry,
  5100. * attributes : {
  5101. * distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
  5102. * }
  5103. * });
  5104. * @param distanceDisplayCondition - The distance display condition.
  5105. * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
  5106. */
  5107. static fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute;
  5108. /**
  5109. * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
  5110. * @example
  5111. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  5112. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
  5113. * @param distanceDisplayCondition - The distance display condition value.
  5114. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  5115. * @returns The modified result parameter or a new instance if result was undefined.
  5116. */
  5117. static toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array;
  5118. }
  5119. /**
  5120. * Easing functions for use with TweenCollection. These function are from
  5121. * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the
  5122. * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.
  5123. */
  5124. export namespace EasingFunction {
  5125. /**
  5126. * Linear easing.
  5127. */
  5128. const LINEAR_NONE: EasingFunction.Callback;
  5129. /**
  5130. * Quadratic in.
  5131. */
  5132. const QUADRATIC_IN: EasingFunction.Callback;
  5133. /**
  5134. * Quadratic out.
  5135. */
  5136. const QUADRATIC_OUT: EasingFunction.Callback;
  5137. /**
  5138. * Quadratic in then out.
  5139. */
  5140. const QUADRATIC_IN_OUT: EasingFunction.Callback;
  5141. /**
  5142. * Cubic in.
  5143. */
  5144. const CUBIC_IN: EasingFunction.Callback;
  5145. /**
  5146. * Cubic out.
  5147. */
  5148. const CUBIC_OUT: EasingFunction.Callback;
  5149. /**
  5150. * Cubic in then out.
  5151. */
  5152. const CUBIC_IN_OUT: EasingFunction.Callback;
  5153. /**
  5154. * Quartic in.
  5155. */
  5156. const QUARTIC_IN: EasingFunction.Callback;
  5157. /**
  5158. * Quartic out.
  5159. */
  5160. const QUARTIC_OUT: EasingFunction.Callback;
  5161. /**
  5162. * Quartic in then out.
  5163. */
  5164. const QUARTIC_IN_OUT: EasingFunction.Callback;
  5165. /**
  5166. * Quintic in.
  5167. */
  5168. const QUINTIC_IN: EasingFunction.Callback;
  5169. /**
  5170. * Quintic out.
  5171. */
  5172. const QUINTIC_OUT: EasingFunction.Callback;
  5173. /**
  5174. * Quintic in then out.
  5175. */
  5176. const QUINTIC_IN_OUT: EasingFunction.Callback;
  5177. /**
  5178. * Sinusoidal in.
  5179. */
  5180. const SINUSOIDAL_IN: EasingFunction.Callback;
  5181. /**
  5182. * Sinusoidal out.
  5183. */
  5184. const SINUSOIDAL_OUT: EasingFunction.Callback;
  5185. /**
  5186. * Sinusoidal in then out.
  5187. */
  5188. const SINUSOIDAL_IN_OUT: EasingFunction.Callback;
  5189. /**
  5190. * Exponential in.
  5191. */
  5192. const EXPONENTIAL_IN: EasingFunction.Callback;
  5193. /**
  5194. * Exponential out.
  5195. */
  5196. const EXPONENTIAL_OUT: EasingFunction.Callback;
  5197. /**
  5198. * Exponential in then out.
  5199. */
  5200. const EXPONENTIAL_IN_OUT: EasingFunction.Callback;
  5201. /**
  5202. * Circular in.
  5203. */
  5204. const CIRCULAR_IN: EasingFunction.Callback;
  5205. /**
  5206. * Circular out.
  5207. */
  5208. const CIRCULAR_OUT: EasingFunction.Callback;
  5209. /**
  5210. * Circular in then out.
  5211. */
  5212. const CIRCULAR_IN_OUT: EasingFunction.Callback;
  5213. /**
  5214. * Elastic in.
  5215. */
  5216. const ELASTIC_IN: EasingFunction.Callback;
  5217. /**
  5218. * Elastic out.
  5219. */
  5220. const ELASTIC_OUT: EasingFunction.Callback;
  5221. /**
  5222. * Elastic in then out.
  5223. */
  5224. const ELASTIC_IN_OUT: EasingFunction.Callback;
  5225. /**
  5226. * Back in.
  5227. */
  5228. const BACK_IN: EasingFunction.Callback;
  5229. /**
  5230. * Back out.
  5231. */
  5232. const BACK_OUT: EasingFunction.Callback;
  5233. /**
  5234. * Back in then out.
  5235. */
  5236. const BACK_IN_OUT: EasingFunction.Callback;
  5237. /**
  5238. * Bounce in.
  5239. */
  5240. const BOUNCE_IN: EasingFunction.Callback;
  5241. /**
  5242. * Bounce out.
  5243. */
  5244. const BOUNCE_OUT: EasingFunction.Callback;
  5245. /**
  5246. * Bounce in then out.
  5247. */
  5248. const BOUNCE_IN_OUT: EasingFunction.Callback;
  5249. /**
  5250. * Function interface for implementing a custom easing function.
  5251. * @example
  5252. * function quadraticIn(time) {
  5253. * return time * time;
  5254. * }
  5255. * @example
  5256. * function quadraticOut(time) {
  5257. * return time * (2.0 - time);
  5258. * }
  5259. * @param time - The time in the range <code>[0, 1]</code>.
  5260. */
  5261. type Callback = (time: number) => number;
  5262. }
  5263. /**
  5264. * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  5265. * @example
  5266. * // Create an ellipse.
  5267. * var ellipse = new Cesium.EllipseGeometry({
  5268. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5269. * semiMajorAxis : 500000.0,
  5270. * semiMinorAxis : 300000.0,
  5271. * rotation : Cesium.Math.toRadians(60.0)
  5272. * });
  5273. * var geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
  5274. * @param options - Object with the following properties:
  5275. * @param options.center - The ellipse's center point in the fixed frame.
  5276. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5277. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5278. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5279. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5280. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5281. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5282. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north.
  5283. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5284. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5285. */
  5286. export class EllipseGeometry {
  5287. constructor(options: {
  5288. center: Cartesian3;
  5289. semiMajorAxis: number;
  5290. semiMinorAxis: number;
  5291. ellipsoid?: Ellipsoid;
  5292. height?: number;
  5293. extrudedHeight?: number;
  5294. rotation?: number;
  5295. stRotation?: number;
  5296. granularity?: number;
  5297. vertexFormat?: VertexFormat;
  5298. });
  5299. /**
  5300. * The number of elements used to pack the object into an array.
  5301. */
  5302. static packedLength: number;
  5303. /**
  5304. * Stores the provided instance into the provided array.
  5305. * @param value - The value to pack.
  5306. * @param array - The array to pack into.
  5307. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5308. * @returns The array that was packed into
  5309. */
  5310. static pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[];
  5311. /**
  5312. * Retrieves an instance from a packed array.
  5313. * @param array - The packed array.
  5314. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5315. * @param [result] - The object into which to store the result.
  5316. * @returns The modified result parameter or a new EllipseGeometry instance if one was not provided.
  5317. */
  5318. static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry;
  5319. /**
  5320. * Computes the bounding rectangle based on the provided options
  5321. * @param options - Object with the following properties:
  5322. * @param options.center - The ellipse's center point in the fixed frame.
  5323. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5324. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5325. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5326. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5327. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5328. * @param [result] - An object in which to store the result
  5329. * @returns The result rectangle
  5330. */
  5331. static computeRectangle(options: {
  5332. center: Cartesian3;
  5333. semiMajorAxis: number;
  5334. semiMinorAxis: number;
  5335. ellipsoid?: Ellipsoid;
  5336. rotation?: number;
  5337. granularity?: number;
  5338. }, result?: Rectangle): Rectangle;
  5339. /**
  5340. * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5341. * @param ellipseGeometry - A description of the ellipse.
  5342. * @returns The computed vertices and indices.
  5343. */
  5344. static createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined;
  5345. }
  5346. /**
  5347. * A description of the outline of an ellipse on an ellipsoid.
  5348. * @example
  5349. * var ellipse = new Cesium.EllipseOutlineGeometry({
  5350. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5351. * semiMajorAxis : 500000.0,
  5352. * semiMinorAxis : 300000.0,
  5353. * rotation : Cesium.Math.toRadians(60.0)
  5354. * });
  5355. * var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
  5356. * @param options - Object with the following properties:
  5357. * @param options.center - The ellipse's center point in the fixed frame.
  5358. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5359. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5360. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5361. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5362. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5363. * @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians.
  5364. * @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians.
  5365. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse.
  5366. */
  5367. export class EllipseOutlineGeometry {
  5368. constructor(options: {
  5369. center: Cartesian3;
  5370. semiMajorAxis: number;
  5371. semiMinorAxis: number;
  5372. ellipsoid?: Ellipsoid;
  5373. height?: number;
  5374. extrudedHeight?: number;
  5375. rotation?: number;
  5376. granularity?: number;
  5377. numberOfVerticalLines?: number;
  5378. });
  5379. /**
  5380. * The number of elements used to pack the object into an array.
  5381. */
  5382. static packedLength: number;
  5383. /**
  5384. * Stores the provided instance into the provided array.
  5385. * @param value - The value to pack.
  5386. * @param array - The array to pack into.
  5387. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5388. * @returns The array that was packed into
  5389. */
  5390. static pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[];
  5391. /**
  5392. * Retrieves an instance from a packed array.
  5393. * @param array - The packed array.
  5394. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5395. * @param [result] - The object into which to store the result.
  5396. * @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
  5397. */
  5398. static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry;
  5399. /**
  5400. * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5401. * @param ellipseGeometry - A description of the ellipse.
  5402. * @returns The computed vertices and indices.
  5403. */
  5404. static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined;
  5405. }
  5406. /**
  5407. * A quadratic surface defined in Cartesian coordinates by the equation
  5408. * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used
  5409. * by Cesium to represent the shape of planetary bodies.
  5410. *
  5411. * Rather than constructing this object directly, one of the provided
  5412. * constants is normally used.
  5413. * @param [x = 0] - The radius in the x direction.
  5414. * @param [y = 0] - The radius in the y direction.
  5415. * @param [z = 0] - The radius in the z direction.
  5416. */
  5417. export class Ellipsoid {
  5418. constructor(x?: number, y?: number, z?: number);
  5419. /**
  5420. * Gets the radii of the ellipsoid.
  5421. */
  5422. readonly radii: Cartesian3;
  5423. /**
  5424. * Gets the squared radii of the ellipsoid.
  5425. */
  5426. readonly radiiSquared: Cartesian3;
  5427. /**
  5428. * Gets the radii of the ellipsoid raise to the fourth power.
  5429. */
  5430. readonly radiiToTheFourth: Cartesian3;
  5431. /**
  5432. * Gets one over the radii of the ellipsoid.
  5433. */
  5434. readonly oneOverRadii: Cartesian3;
  5435. /**
  5436. * Gets one over the squared radii of the ellipsoid.
  5437. */
  5438. readonly oneOverRadiiSquared: Cartesian3;
  5439. /**
  5440. * Gets the minimum radius of the ellipsoid.
  5441. */
  5442. readonly minimumRadius: number;
  5443. /**
  5444. * Gets the maximum radius of the ellipsoid.
  5445. */
  5446. readonly maximumRadius: number;
  5447. /**
  5448. * Duplicates an Ellipsoid instance.
  5449. * @param ellipsoid - The ellipsoid to duplicate.
  5450. * @param [result] - The object onto which to store the result, or undefined if a new
  5451. * instance should be created.
  5452. * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
  5453. */
  5454. static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid;
  5455. /**
  5456. * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
  5457. * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions.
  5458. * @param [result] - The object onto which to store the result, or undefined if a new
  5459. * instance should be created.
  5460. * @returns A new Ellipsoid instance.
  5461. */
  5462. static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid;
  5463. /**
  5464. * An Ellipsoid instance initialized to the WGS84 standard.
  5465. */
  5466. static readonly WGS84: Ellipsoid;
  5467. /**
  5468. * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
  5469. */
  5470. static readonly UNIT_SPHERE: Ellipsoid;
  5471. /**
  5472. * An Ellipsoid instance initialized to a sphere with the lunar radius.
  5473. */
  5474. static readonly MOON: Ellipsoid;
  5475. /**
  5476. * Duplicates an Ellipsoid instance.
  5477. * @param [result] - The object onto which to store the result, or undefined if a new
  5478. * instance should be created.
  5479. * @returns The cloned Ellipsoid.
  5480. */
  5481. clone(result?: Ellipsoid): Ellipsoid;
  5482. /**
  5483. * The number of elements used to pack the object into an array.
  5484. */
  5485. static packedLength: number;
  5486. /**
  5487. * Stores the provided instance into the provided array.
  5488. * @param value - The value to pack.
  5489. * @param array - The array to pack into.
  5490. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5491. * @returns The array that was packed into
  5492. */
  5493. static pack(value: Ellipsoid, array: number[], startingIndex?: number): number[];
  5494. /**
  5495. * Retrieves an instance from a packed array.
  5496. * @param array - The packed array.
  5497. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5498. * @param [result] - The object into which to store the result.
  5499. * @returns The modified result parameter or a new Ellipsoid instance if one was not provided.
  5500. */
  5501. static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid;
  5502. /**
  5503. * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
  5504. * @param cartesian - The Cartesian for which to to determine the geocentric normal.
  5505. * @param [result] - The object onto which to store the result.
  5506. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5507. */
  5508. geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5509. /**
  5510. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5511. * @param cartographic - The cartographic position for which to to determine the geodetic normal.
  5512. * @param [result] - The object onto which to store the result.
  5513. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5514. */
  5515. geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5516. /**
  5517. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5518. * @param cartesian - The Cartesian position for which to to determine the surface normal.
  5519. * @param [result] - The object onto which to store the result.
  5520. * @returns The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
  5521. */
  5522. geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5523. /**
  5524. * Converts the provided cartographic to Cartesian representation.
  5525. * @example
  5526. * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
  5527. * var position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
  5528. * var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
  5529. * @param cartographic - The cartographic position.
  5530. * @param [result] - The object onto which to store the result.
  5531. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5532. */
  5533. cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5534. /**
  5535. * Converts the provided array of cartographics to an array of Cartesians.
  5536. * @example
  5537. * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
  5538. * var positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
  5539. * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
  5540. * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
  5541. * var cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
  5542. * @param cartographics - An array of cartographic positions.
  5543. * @param [result] - The object onto which to store the result.
  5544. * @returns The modified result parameter or a new Array instance if none was provided.
  5545. */
  5546. cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[];
  5547. /**
  5548. * Converts the provided cartesian to cartographic representation.
  5549. * The cartesian is undefined at the center of the ellipsoid.
  5550. * @example
  5551. * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
  5552. * var position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
  5553. * var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
  5554. * @param cartesian - The Cartesian position to convert to cartographic representation.
  5555. * @param [result] - The object onto which to store the result.
  5556. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  5557. */
  5558. cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  5559. /**
  5560. * Converts the provided array of cartesians to an array of cartographics.
  5561. * @example
  5562. * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
  5563. * var positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
  5564. * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
  5565. * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
  5566. * var cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
  5567. * @param cartesians - An array of Cartesian positions.
  5568. * @param [result] - The object onto which to store the result.
  5569. * @returns The modified result parameter or a new Array instance if none was provided.
  5570. */
  5571. cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[];
  5572. /**
  5573. * Scales the provided Cartesian position along the geodetic surface normal
  5574. * so that it is on the surface of this ellipsoid. If the position is
  5575. * at the center of the ellipsoid, this function returns undefined.
  5576. * @param cartesian - The Cartesian position to scale.
  5577. * @param [result] - The object onto which to store the result.
  5578. * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
  5579. */
  5580. scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5581. /**
  5582. * Scales the provided Cartesian position along the geocentric surface normal
  5583. * so that it is on the surface of this ellipsoid.
  5584. * @param cartesian - The Cartesian position to scale.
  5585. * @param [result] - The object onto which to store the result.
  5586. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5587. */
  5588. scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5589. /**
  5590. * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
  5591. * its components by the result of {@link Ellipsoid#oneOverRadii}.
  5592. * @param position - The position to transform.
  5593. * @param [result] - The position to which to copy the result, or undefined to create and
  5594. * return a new instance.
  5595. * @returns The position expressed in the scaled space. The returned instance is the
  5596. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5597. */
  5598. transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5599. /**
  5600. * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
  5601. * its components by the result of {@link Ellipsoid#radii}.
  5602. * @param position - The position to transform.
  5603. * @param [result] - The position to which to copy the result, or undefined to create and
  5604. * return a new instance.
  5605. * @returns The position expressed in the unscaled space. The returned instance is the
  5606. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5607. */
  5608. transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5609. /**
  5610. * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
  5611. * <code>true</code> if they are equal, <code>false</code> otherwise.
  5612. * @param [right] - The other Ellipsoid.
  5613. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  5614. */
  5615. equals(right?: Ellipsoid): boolean;
  5616. /**
  5617. * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5618. * @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5619. */
  5620. toString(): string;
  5621. /**
  5622. * Computes a point which is the intersection of the surface normal with the z-axis.
  5623. * @param position - the position. must be on the surface of the ellipsoid.
  5624. * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
  5625. * In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.
  5626. * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
  5627. * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
  5628. * @param [result] - The cartesian to which to copy the result, or undefined to create and
  5629. * return a new instance.
  5630. * @returns the intersection point if it's inside the ellipsoid, undefined otherwise
  5631. */
  5632. getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined;
  5633. /**
  5634. * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
  5635. * Gauss-Legendre 10th order quadrature.
  5636. * @param rectangle - The rectangle used for computing the surface area.
  5637. * @returns The approximate area of the rectangle on the surface of this ellipsoid.
  5638. */
  5639. surfaceArea(rectangle: Rectangle): number;
  5640. }
  5641. /**
  5642. * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
  5643. * @param [start] - The initial planetodetic point on the path.
  5644. * @param [end] - The final planetodetic point on the path.
  5645. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies.
  5646. */
  5647. export class EllipsoidGeodesic {
  5648. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5649. /**
  5650. * Gets the ellipsoid.
  5651. */
  5652. readonly ellipsoid: Ellipsoid;
  5653. /**
  5654. * Gets the surface distance between the start and end point
  5655. */
  5656. readonly surfaceDistance: number;
  5657. /**
  5658. * Gets the initial planetodetic point on the path.
  5659. */
  5660. readonly start: Cartographic;
  5661. /**
  5662. * Gets the final planetodetic point on the path.
  5663. */
  5664. readonly end: Cartographic;
  5665. /**
  5666. * Gets the heading at the initial point.
  5667. */
  5668. readonly startHeading: number;
  5669. /**
  5670. * Gets the heading at the final point.
  5671. */
  5672. readonly endHeading: number;
  5673. /**
  5674. * Sets the start and end points of the geodesic
  5675. * @param start - The initial planetodetic point on the path.
  5676. * @param end - The final planetodetic point on the path.
  5677. */
  5678. setEndPoints(start: Cartographic, end: Cartographic): void;
  5679. /**
  5680. * Provides the location of a point at the indicated portion along the geodesic.
  5681. * @param fraction - The portion of the distance between the initial and final points.
  5682. * @param [result] - The object in which to store the result.
  5683. * @returns The location of the point along the geodesic.
  5684. */
  5685. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5686. /**
  5687. * Provides the location of a point at the indicated distance along the geodesic.
  5688. * @param distance - The distance from the inital point to the point of interest along the geodesic
  5689. * @param [result] - The object in which to store the result.
  5690. * @returns The location of the point along the geodesic.
  5691. */
  5692. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5693. }
  5694. /**
  5695. * A description of an ellipsoid centered at the origin.
  5696. * @example
  5697. * var ellipsoid = new Cesium.EllipsoidGeometry({
  5698. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  5699. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
  5700. * });
  5701. * var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
  5702. * @param [options] - Object with the following properties:
  5703. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5704. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5705. * @param [options.minimumClock = 0.0] - The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  5706. * @param [options.maximumClock = 2*PI] - The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  5707. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5708. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5709. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  5710. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  5711. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5712. */
  5713. export class EllipsoidGeometry {
  5714. constructor(options?: {
  5715. radii?: Cartesian3;
  5716. innerRadii?: Cartesian3;
  5717. minimumClock?: number;
  5718. maximumClock?: number;
  5719. minimumCone?: number;
  5720. maximumCone?: number;
  5721. stackPartitions?: number;
  5722. slicePartitions?: number;
  5723. vertexFormat?: VertexFormat;
  5724. });
  5725. /**
  5726. * The number of elements used to pack the object into an array.
  5727. */
  5728. static packedLength: number;
  5729. /**
  5730. * Stores the provided instance into the provided array.
  5731. * @param value - The value to pack.
  5732. * @param array - The array to pack into.
  5733. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5734. * @returns The array that was packed into
  5735. */
  5736. static pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[];
  5737. /**
  5738. * Retrieves an instance from a packed array.
  5739. * @param array - The packed array.
  5740. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5741. * @param [result] - The object into which to store the result.
  5742. * @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
  5743. */
  5744. static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry;
  5745. /**
  5746. * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5747. * @param ellipsoidGeometry - A description of the ellipsoid.
  5748. * @returns The computed vertices and indices.
  5749. */
  5750. static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined;
  5751. }
  5752. /**
  5753. * A description of the outline of an ellipsoid centered at the origin.
  5754. * @example
  5755. * var ellipsoid = new Cesium.EllipsoidOutlineGeometry({
  5756. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
  5757. * stackPartitions: 6,
  5758. * slicePartitions: 5
  5759. * });
  5760. * var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
  5761. * @param [options] - Object with the following properties:
  5762. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5763. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5764. * @param [options.minimumClock = 0.0] - The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  5765. * @param [options.maximumClock = 2*PI] - The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  5766. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5767. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5768. * @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
  5769. * @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines).
  5770. * @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature.
  5771. */
  5772. export class EllipsoidOutlineGeometry {
  5773. constructor(options?: {
  5774. radii?: Cartesian3;
  5775. innerRadii?: Cartesian3;
  5776. minimumClock?: number;
  5777. maximumClock?: number;
  5778. minimumCone?: number;
  5779. maximumCone?: number;
  5780. stackPartitions?: number;
  5781. slicePartitions?: number;
  5782. subdivisions?: number;
  5783. });
  5784. /**
  5785. * The number of elements used to pack the object into an array.
  5786. */
  5787. static packedLength: number;
  5788. /**
  5789. * Stores the provided instance into the provided array.
  5790. * @param value - The value to pack.
  5791. * @param array - The array to pack into.
  5792. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5793. * @returns The array that was packed into
  5794. */
  5795. static pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[];
  5796. /**
  5797. * Retrieves an instance from a packed array.
  5798. * @param array - The packed array.
  5799. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5800. * @param [result] - The object into which to store the result.
  5801. * @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
  5802. */
  5803. static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry;
  5804. /**
  5805. * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5806. * @param ellipsoidGeometry - A description of the ellipsoid outline.
  5807. * @returns The computed vertices and indices.
  5808. */
  5809. static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined;
  5810. }
  5811. /**
  5812. * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
  5813. * @param [start] - The initial planetodetic point on the path.
  5814. * @param [end] - The final planetodetic point on the path.
  5815. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5816. */
  5817. export class EllipsoidRhumbLine {
  5818. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5819. /**
  5820. * Gets the ellipsoid.
  5821. */
  5822. readonly ellipsoid: Ellipsoid;
  5823. /**
  5824. * Gets the surface distance between the start and end point
  5825. */
  5826. readonly surfaceDistance: number;
  5827. /**
  5828. * Gets the initial planetodetic point on the path.
  5829. */
  5830. readonly start: Cartographic;
  5831. /**
  5832. * Gets the final planetodetic point on the path.
  5833. */
  5834. readonly end: Cartographic;
  5835. /**
  5836. * Gets the heading from the start point to the end point.
  5837. */
  5838. readonly heading: number;
  5839. /**
  5840. * Create a rhumb line using an initial position with a heading and distance.
  5841. * @param start - The initial planetodetic point on the path.
  5842. * @param heading - The heading in radians.
  5843. * @param distance - The rhumb line distance between the start and end point.
  5844. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5845. * @param [result] - The object in which to store the result.
  5846. * @returns The EllipsoidRhumbLine object.
  5847. */
  5848. static fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine;
  5849. /**
  5850. * Sets the start and end points of the rhumb line.
  5851. * @param start - The initial planetodetic point on the path.
  5852. * @param end - The final planetodetic point on the path.
  5853. */
  5854. setEndPoints(start: Cartographic, end: Cartographic): void;
  5855. /**
  5856. * Provides the location of a point at the indicated portion along the rhumb line.
  5857. * @param fraction - The portion of the distance between the initial and final points.
  5858. * @param [result] - The object in which to store the result.
  5859. * @returns The location of the point along the rhumb line.
  5860. */
  5861. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5862. /**
  5863. * Provides the location of a point at the indicated distance along the rhumb line.
  5864. * @param distance - The distance from the inital point to the point of interest along the rhumbLine.
  5865. * @param [result] - The object in which to store the result.
  5866. * @returns The location of the point along the rhumb line.
  5867. */
  5868. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5869. /**
  5870. * Provides the location of a point at the indicated longitude along the rhumb line.
  5871. * If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
  5872. * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading.
  5873. * @param [result] - The object in which to store the result.
  5874. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5875. */
  5876. findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic;
  5877. /**
  5878. * Provides the location of a point at the indicated latitude along the rhumb line.
  5879. * If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
  5880. * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading.
  5881. * @param [result] - The object in which to store the result.
  5882. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5883. */
  5884. findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic;
  5885. }
  5886. /**
  5887. * A plane tangent to the provided ellipsoid at the provided origin.
  5888. * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
  5889. * If origin is at the center of the ellipsoid, an exception will be thrown.
  5890. * @param origin - The point on the surface of the ellipsoid where the tangent plane touches.
  5891. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5892. */
  5893. export class EllipsoidTangentPlane {
  5894. constructor(origin: Cartesian3, ellipsoid?: Ellipsoid);
  5895. /**
  5896. * Gets the ellipsoid.
  5897. */
  5898. ellipsoid: Ellipsoid;
  5899. /**
  5900. * Gets the origin.
  5901. */
  5902. origin: Cartesian3;
  5903. /**
  5904. * Gets the plane which is tangent to the ellipsoid.
  5905. */
  5906. readonly plane: Plane;
  5907. /**
  5908. * Gets the local X-axis (east) of the tangent plane.
  5909. */
  5910. readonly xAxis: Cartesian3;
  5911. /**
  5912. * Gets the local Y-axis (north) of the tangent plane.
  5913. */
  5914. readonly yAxis: Cartesian3;
  5915. /**
  5916. * Gets the local Z-axis (up) of the tangent plane.
  5917. */
  5918. readonly zAxis: Cartesian3;
  5919. /**
  5920. * Creates a new instance from the provided ellipsoid and the center
  5921. * point of the provided Cartesians.
  5922. * @param cartesians - The list of positions surrounding the center point.
  5923. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5924. * @returns The new instance of EllipsoidTangentPlane.
  5925. */
  5926. static fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): EllipsoidTangentPlane;
  5927. /**
  5928. * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
  5929. * @param cartesian - The point to project.
  5930. * @param [result] - The object onto which to store the result.
  5931. * @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
  5932. */
  5933. projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5934. /**
  5935. * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
  5936. * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
  5937. * @param cartesians - The array of points to project.
  5938. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5939. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided.
  5940. */
  5941. projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5942. /**
  5943. * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
  5944. * @param cartesian - The point to project.
  5945. * @param [result] - The object onto which to store the result.
  5946. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  5947. */
  5948. projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  5949. /**
  5950. * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
  5951. * @param cartesians - The array of points to project.
  5952. * @param [result] - The array of Cartesian2 instances onto which to store results.
  5953. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as <code>cartesians</code>.
  5954. */
  5955. projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  5956. /**
  5957. * Computes the projection of the provided 2D position onto the 3D ellipsoid.
  5958. * @param cartesian - The points to project.
  5959. * @param [result] - The Cartesian3 instance to store result.
  5960. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5961. */
  5962. projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3;
  5963. /**
  5964. * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
  5965. * @param cartesians - The array of points to project.
  5966. * @param [result] - The array of Cartesian3 instances onto which to store results.
  5967. * @returns The modified result parameter or a new array of Cartesian3 instances if none was provided.
  5968. */
  5969. projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[];
  5970. }
  5971. /**
  5972. * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
  5973. * surface.
  5974. * @param [options] - Object with the following properties:
  5975. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  5976. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  5977. * is used.
  5978. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  5979. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  5980. * parameter is specified, the WGS84 ellipsoid is used.
  5981. */
  5982. export class EllipsoidTerrainProvider {
  5983. constructor(options?: {
  5984. tilingScheme?: TilingScheme;
  5985. ellipsoid?: Ellipsoid;
  5986. });
  5987. /**
  5988. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  5989. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  5990. * are passed an instance of {@link TileProviderError}.
  5991. */
  5992. readonly errorEvent: Event;
  5993. /**
  5994. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  5995. * the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  5996. */
  5997. readonly credit: Credit;
  5998. /**
  5999. * Gets the tiling scheme used by this provider. This function should
  6000. * not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6001. */
  6002. readonly tilingScheme: GeographicTilingScheme;
  6003. /**
  6004. * Gets a value indicating whether or not the provider is ready for use.
  6005. */
  6006. readonly ready: boolean;
  6007. /**
  6008. * Gets a promise that resolves to true when the provider is ready for use.
  6009. */
  6010. readonly readyPromise: Promise<boolean>;
  6011. /**
  6012. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  6013. * indicates which areas of the globe are water rather than land, so they can be rendered
  6014. * as a reflective surface with animated waves. This function should not be
  6015. * called before {@link EllipsoidTerrainProvider#ready} returns true.
  6016. */
  6017. readonly hasWaterMask: boolean;
  6018. /**
  6019. * Gets a value indicating whether or not the requested tiles include vertex normals.
  6020. * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6021. */
  6022. readonly hasVertexNormals: boolean;
  6023. /**
  6024. * Gets an object that can be used to determine availability of terrain from this provider, such as
  6025. * at points and in rectangles. This function should not be called before
  6026. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  6027. * information is not available.
  6028. */
  6029. readonly availability: TileAvailability;
  6030. /**
  6031. * Requests the geometry for a given tile. This function should not be called before
  6032. * {@link TerrainProvider#ready} returns true. The result includes terrain
  6033. * data and indicates that all child tiles are available.
  6034. * @param x - The X coordinate of the tile for which to request geometry.
  6035. * @param y - The Y coordinate of the tile for which to request geometry.
  6036. * @param level - The level of the tile for which to request geometry.
  6037. * @param [request] - The request object. Intended for internal use only.
  6038. * @returns A promise for the requested geometry. If this method
  6039. * returns undefined instead of a promise, it is an indication that too many requests are already
  6040. * pending and the request will be retried later.
  6041. */
  6042. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  6043. /**
  6044. * Gets the maximum geometric error allowed in a tile at a given level.
  6045. * @param level - The tile level for which to get the maximum geometric error.
  6046. * @returns The maximum geometric error.
  6047. */
  6048. getLevelMaximumGeometricError(level: number): number;
  6049. /**
  6050. * Determines whether data for a tile is available to be loaded.
  6051. * @param x - The X coordinate of the tile for which to request geometry.
  6052. * @param y - The Y coordinate of the tile for which to request geometry.
  6053. * @param level - The level of the tile for which to request geometry.
  6054. * @returns Undefined if not supported, otherwise true or false.
  6055. */
  6056. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  6057. /**
  6058. * Makes sure we load availability data for a tile
  6059. * @param x - The X coordinate of the tile for which to request geometry.
  6060. * @param y - The Y coordinate of the tile for which to request geometry.
  6061. * @param level - The level of the tile for which to request geometry.
  6062. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  6063. */
  6064. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  6065. }
  6066. /**
  6067. * A generic utility class for managing subscribers for a particular event.
  6068. * This class is usually instantiated inside of a container class and
  6069. * exposed as a property for others to subscribe to.
  6070. * @example
  6071. * MyObject.prototype.myListener = function(arg1, arg2) {
  6072. * this.myArg1Copy = arg1;
  6073. * this.myArg2Copy = arg2;
  6074. * }
  6075. *
  6076. * var myObjectInstance = new MyObject();
  6077. * var evt = new Cesium.Event();
  6078. * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
  6079. * evt.raiseEvent('1', '2');
  6080. * evt.removeEventListener(MyObject.prototype.myListener);
  6081. */
  6082. export class Event {
  6083. constructor();
  6084. /**
  6085. * The number of listeners currently subscribed to the event.
  6086. */
  6087. readonly numberOfListeners: number;
  6088. /**
  6089. * Registers a callback function to be executed whenever the event is raised.
  6090. * An optional scope can be provided to serve as the <code>this</code> pointer
  6091. * in which the function will execute.
  6092. * @param listener - The function to be executed when the event is raised.
  6093. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6094. * pointer in which the listener function will execute.
  6095. * @returns A function that will remove this event listener when invoked.
  6096. */
  6097. addEventListener(listener: (...params: any[]) => any, scope?: any): Event.RemoveCallback;
  6098. /**
  6099. * Unregisters a previously registered callback.
  6100. * @param listener - The function to be unregistered.
  6101. * @param [scope] - The scope that was originally passed to addEventListener.
  6102. * @returns <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.
  6103. */
  6104. removeEventListener(listener: (...params: any[]) => any, scope?: any): boolean;
  6105. /**
  6106. * Raises the event by calling each registered listener with all supplied arguments.
  6107. * @param arguments - This method takes any number of parameters and passes them through to the listener functions.
  6108. */
  6109. raiseEvent(...arguments: any[]): void;
  6110. }
  6111. export namespace Event {
  6112. /**
  6113. * A function that removes a listener.
  6114. */
  6115. type RemoveCallback = () => void;
  6116. }
  6117. /**
  6118. * A convenience object that simplifies the common pattern of attaching event listeners
  6119. * to several events, then removing all those listeners at once later, for example, in
  6120. * a destroy method.
  6121. * @example
  6122. * var helper = new Cesium.EventHelper();
  6123. *
  6124. * helper.add(someObject.event, listener1, this);
  6125. * helper.add(otherObject.event, listener2, this);
  6126. *
  6127. * // later...
  6128. * helper.removeAll();
  6129. */
  6130. export class EventHelper {
  6131. constructor();
  6132. /**
  6133. * Adds a listener to an event, and records the registration to be cleaned up later.
  6134. * @param event - The event to attach to.
  6135. * @param listener - The function to be executed when the event is raised.
  6136. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6137. * pointer in which the listener function will execute.
  6138. * @returns A function that will remove this event listener when invoked.
  6139. */
  6140. add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback;
  6141. /**
  6142. * Unregisters all previously added listeners.
  6143. */
  6144. removeAll(): void;
  6145. }
  6146. export namespace EventHelper {
  6147. /**
  6148. * A function that removes a listener.
  6149. */
  6150. type RemoveCallback = () => void;
  6151. }
  6152. /**
  6153. * Constants to determine how an interpolated value is extrapolated
  6154. * when querying outside the bounds of available data.
  6155. */
  6156. export enum ExtrapolationType {
  6157. /**
  6158. * No extrapolation occurs.
  6159. */
  6160. NONE = 0,
  6161. /**
  6162. * The first or last value is used when outside the range of sample data.
  6163. */
  6164. HOLD = 1,
  6165. /**
  6166. * The value is extrapolated.
  6167. */
  6168. EXTRAPOLATE = 2
  6169. }
  6170. /**
  6171. * A set of functions to detect whether the current browser supports
  6172. * various features.
  6173. */
  6174. export namespace FeatureDetection {
  6175. /**
  6176. * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.
  6177. * @returns true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.
  6178. */
  6179. function supportsBasis(scene: Scene): boolean;
  6180. /**
  6181. * Detects whether the current browser supports the full screen standard.
  6182. * @returns true if the browser supports the full screen standard, false if not.
  6183. */
  6184. function supportsFullscreen(): boolean;
  6185. /**
  6186. * Detects whether the current browser supports typed arrays.
  6187. * @returns true if the browser supports typed arrays, false if not.
  6188. */
  6189. function supportsTypedArrays(): boolean;
  6190. /**
  6191. * Detects whether the current browser supports BigInt64Array typed arrays.
  6192. * @returns true if the browser supports BigInt64Array typed arrays, false if not.
  6193. */
  6194. function supportsBigInt64Array(): boolean;
  6195. /**
  6196. * Detects whether the current browser supports BigUint64Array typed arrays.
  6197. * @returns true if the browser supports BigUint64Array typed arrays, false if not.
  6198. */
  6199. function supportsBigUint64Array(): boolean;
  6200. /**
  6201. * Detects whether the current browser supports BigInt.
  6202. * @returns true if the browser supports BigInt, false if not.
  6203. */
  6204. function supportsBigInt(): boolean;
  6205. /**
  6206. * Detects whether the current browser supports Web Workers.
  6207. * @returns true if the browsers supports Web Workers, false if not.
  6208. */
  6209. function supportsWebWorkers(): boolean;
  6210. /**
  6211. * Detects whether the current browser supports Web Assembly.
  6212. * @returns true if the browsers supports Web Assembly, false if not.
  6213. */
  6214. function supportsWebAssembly(): boolean;
  6215. }
  6216. /**
  6217. * Describes a frustum at the given the origin and orientation.
  6218. * @param options - Object with the following properties:
  6219. * @param options.frustum - The frustum.
  6220. * @param options.origin - The origin of the frustum.
  6221. * @param options.orientation - The orientation of the frustum.
  6222. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  6223. */
  6224. export class FrustumGeometry {
  6225. constructor(options: {
  6226. frustum: PerspectiveFrustum | OrthographicFrustum;
  6227. origin: Cartesian3;
  6228. orientation: Quaternion;
  6229. vertexFormat?: VertexFormat;
  6230. });
  6231. /**
  6232. * The number of elements used to pack the object into an array.
  6233. */
  6234. packedLength: number;
  6235. /**
  6236. * Stores the provided instance into the provided array.
  6237. * @param value - The value to pack.
  6238. * @param array - The array to pack into.
  6239. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6240. * @returns The array that was packed into
  6241. */
  6242. static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[];
  6243. /**
  6244. * Retrieves an instance from a packed array.
  6245. * @param array - The packed array.
  6246. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6247. * @param [result] - The object into which to store the result.
  6248. */
  6249. static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void;
  6250. /**
  6251. * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
  6252. * @param frustumGeometry - A description of the frustum.
  6253. * @returns The computed vertices and indices.
  6254. */
  6255. static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined;
  6256. }
  6257. /**
  6258. * A description of the outline of a frustum with the given the origin and orientation.
  6259. * @param options - Object with the following properties:
  6260. * @param options.frustum - The frustum.
  6261. * @param options.origin - The origin of the frustum.
  6262. * @param options.orientation - The orientation of the frustum.
  6263. */
  6264. export class FrustumOutlineGeometry {
  6265. constructor(options: {
  6266. frustum: PerspectiveFrustum | OrthographicFrustum;
  6267. origin: Cartesian3;
  6268. orientation: Quaternion;
  6269. });
  6270. /**
  6271. * The number of elements used to pack the object into an array.
  6272. */
  6273. packedLength: number;
  6274. /**
  6275. * Stores the provided instance into the provided array.
  6276. * @param value - The value to pack.
  6277. * @param array - The array to pack into.
  6278. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6279. * @returns The array that was packed into
  6280. */
  6281. static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[];
  6282. /**
  6283. * Retrieves an instance from a packed array.
  6284. * @param array - The packed array.
  6285. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6286. * @param [result] - The object into which to store the result.
  6287. */
  6288. static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void;
  6289. /**
  6290. * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
  6291. * @param frustumGeometry - A description of the frustum.
  6292. * @returns The computed vertices and indices.
  6293. */
  6294. static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined;
  6295. }
  6296. /**
  6297. * Browser-independent functions for working with the standard fullscreen API.
  6298. */
  6299. export namespace Fullscreen {
  6300. /**
  6301. * The element that is currently fullscreen, if any. To simply check if the
  6302. * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
  6303. */
  6304. const element: any;
  6305. /**
  6306. * The name of the event on the document that is fired when fullscreen is
  6307. * entered or exited. This event name is intended for use with addEventListener.
  6308. * In your event handler, to determine if the browser is in fullscreen mode or not,
  6309. * use {@link Fullscreen#fullscreen}.
  6310. */
  6311. const changeEventName: string;
  6312. /**
  6313. * The name of the event that is fired when a fullscreen error
  6314. * occurs. This event name is intended for use with addEventListener.
  6315. */
  6316. const errorEventName: string;
  6317. /**
  6318. * Determine whether the browser will allow an element to be made fullscreen, or not.
  6319. * For example, by default, iframes cannot go fullscreen unless the containing page
  6320. * adds an "allowfullscreen" attribute (or prefixed equivalent).
  6321. */
  6322. const enabled: boolean;
  6323. /**
  6324. * Determines if the browser is currently in fullscreen mode.
  6325. */
  6326. const fullscreen: boolean;
  6327. /**
  6328. * Detects whether the browser supports the standard fullscreen API.
  6329. * @returns <code>true</code> if the browser supports the standard fullscreen API,
  6330. * <code>false</code> otherwise.
  6331. */
  6332. function supportsFullscreen(): boolean;
  6333. /**
  6334. * Asynchronously requests the browser to enter fullscreen mode on the given element.
  6335. * If fullscreen mode is not supported by the browser, does nothing.
  6336. * @example
  6337. * // Put the entire page into fullscreen.
  6338. * Cesium.Fullscreen.requestFullscreen(document.body)
  6339. *
  6340. * // Place only the Cesium canvas into fullscreen.
  6341. * Cesium.Fullscreen.requestFullscreen(scene.canvas)
  6342. * @param element - The HTML element which will be placed into fullscreen mode.
  6343. * @param [vrDevice] - The HMDVRDevice device.
  6344. */
  6345. function requestFullscreen(element: any, vrDevice?: any): void;
  6346. /**
  6347. * Asynchronously exits fullscreen mode. If the browser is not currently
  6348. * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
  6349. */
  6350. function exitFullscreen(): void;
  6351. }
  6352. /**
  6353. * The type of geocoding to be performed by a {@link GeocoderService}.
  6354. */
  6355. export enum GeocodeType {
  6356. /**
  6357. * Perform a search where the input is considered complete.
  6358. */
  6359. SEARCH = 0,
  6360. /**
  6361. * Perform an auto-complete using partial input, typically
  6362. * reserved for providing possible results as a user is typing.
  6363. */
  6364. AUTOCOMPLETE = 1
  6365. }
  6366. export namespace GeocoderService {
  6367. /**
  6368. * @property displayName - The display name for a location
  6369. * @property destination - The bounding box for a location
  6370. */
  6371. type Result = {
  6372. displayName: string;
  6373. destination: Rectangle | Cartesian3;
  6374. };
  6375. }
  6376. /**
  6377. * Provides geocoding through an external service. This type describes an interface and
  6378. * is not intended to be used.
  6379. */
  6380. export class GeocoderService {
  6381. constructor();
  6382. /**
  6383. * @param query - The query to be sent to the geocoder service
  6384. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  6385. */
  6386. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  6387. }
  6388. /**
  6389. * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
  6390. * them by the {@link Ellipsoid#maximumRadius}. This projection
  6391. * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
  6392. * is also known as EPSG:4326.
  6393. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  6394. */
  6395. export class GeographicProjection {
  6396. constructor(ellipsoid?: Ellipsoid);
  6397. /**
  6398. * Gets the {@link Ellipsoid}.
  6399. */
  6400. readonly ellipsoid: Ellipsoid;
  6401. /**
  6402. * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
  6403. * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
  6404. * ellipsoid. Z is the unmodified height.
  6405. * @param cartographic - The coordinates to project.
  6406. * @param [result] - An instance into which to copy the result. If this parameter is
  6407. * undefined, a new instance is created and returned.
  6408. * @returns The projected coordinates. If the result parameter is not undefined, the
  6409. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6410. * created and returned.
  6411. */
  6412. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  6413. /**
  6414. * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  6415. * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
  6416. * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
  6417. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  6418. * @param [result] - An instance into which to copy the result. If this parameter is
  6419. * undefined, a new instance is created and returned.
  6420. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  6421. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6422. * created and returned.
  6423. */
  6424. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  6425. }
  6426. /**
  6427. * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
  6428. * longitude and latitude are directly mapped to X and Y. This projection is commonly
  6429. * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
  6430. * @param [options] - Object with the following properties:
  6431. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  6432. * the WGS84 ellipsoid.
  6433. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme.
  6434. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of
  6435. * the tile tree.
  6436. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  6437. * the tile tree.
  6438. */
  6439. export class GeographicTilingScheme {
  6440. constructor(options?: {
  6441. ellipsoid?: Ellipsoid;
  6442. rectangle?: Rectangle;
  6443. numberOfLevelZeroTilesX?: number;
  6444. numberOfLevelZeroTilesY?: number;
  6445. });
  6446. /**
  6447. * Gets the ellipsoid that is tiled by this tiling scheme.
  6448. */
  6449. ellipsoid: Ellipsoid;
  6450. /**
  6451. * Gets the rectangle, in radians, covered by this tiling scheme.
  6452. */
  6453. rectangle: Rectangle;
  6454. /**
  6455. * Gets the map projection used by this tiling scheme.
  6456. */
  6457. projection: MapProjection;
  6458. /**
  6459. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  6460. * @param level - The level-of-detail.
  6461. * @returns The number of tiles in the X direction at the given level.
  6462. */
  6463. getNumberOfXTilesAtLevel(level: number): number;
  6464. /**
  6465. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  6466. * @param level - The level-of-detail.
  6467. * @returns The number of tiles in the Y direction at the given level.
  6468. */
  6469. getNumberOfYTilesAtLevel(level: number): number;
  6470. /**
  6471. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  6472. * of this tiling scheme.
  6473. * @param rectangle - The rectangle to transform.
  6474. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6475. * should be created.
  6476. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  6477. * is undefined.
  6478. */
  6479. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  6480. /**
  6481. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  6482. * of the tiling scheme.
  6483. * @param x - The integer x coordinate of the tile.
  6484. * @param y - The integer y coordinate of the tile.
  6485. * @param level - The tile level-of-detail. Zero is the least detailed.
  6486. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6487. * should be created.
  6488. * @returns The specified 'result', or a new object containing the rectangle
  6489. * if 'result' is undefined.
  6490. */
  6491. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6492. /**
  6493. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  6494. * @param x - The integer x coordinate of the tile.
  6495. * @param y - The integer y coordinate of the tile.
  6496. * @param level - The tile level-of-detail. Zero is the least detailed.
  6497. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6498. * should be created.
  6499. * @returns The specified 'result', or a new object containing the rectangle
  6500. * if 'result' is undefined.
  6501. */
  6502. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6503. /**
  6504. * Calculates the tile x, y coordinates of the tile containing
  6505. * a given cartographic position.
  6506. * @param position - The position.
  6507. * @param level - The tile level-of-detail. Zero is the least detailed.
  6508. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6509. * should be created.
  6510. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  6511. * if 'result' is undefined.
  6512. */
  6513. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  6514. }
  6515. /**
  6516. * A geometry representation with attributes forming vertices and optional index data
  6517. * defining primitives. Geometries and an {@link Appearance}, which describes the shading,
  6518. * can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can
  6519. * be created from many heterogeneous - in many cases - geometries for performance.
  6520. * <p>
  6521. * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
  6522. * </p>
  6523. * @example
  6524. * // Create geometry with a position attribute and indexed lines.
  6525. * var positions = new Float64Array([
  6526. * 0.0, 0.0, 0.0,
  6527. * 7500000.0, 0.0, 0.0,
  6528. * 0.0, 7500000.0, 0.0
  6529. * ]);
  6530. *
  6531. * var geometry = new Cesium.Geometry({
  6532. * attributes : {
  6533. * position : new Cesium.GeometryAttribute({
  6534. * componentDatatype : Cesium.ComponentDatatype.DOUBLE,
  6535. * componentsPerAttribute : 3,
  6536. * values : positions
  6537. * })
  6538. * },
  6539. * indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
  6540. * primitiveType : Cesium.PrimitiveType.LINES,
  6541. * boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
  6542. * });
  6543. * @param options - Object with the following properties:
  6544. * @param options.attributes - Attributes, which make up the geometry's vertices.
  6545. * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry.
  6546. * @param [options.indices] - Optional index data that determines the primitives in the geometry.
  6547. * @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry.
  6548. */
  6549. export class Geometry {
  6550. constructor(options: {
  6551. attributes: GeometryAttributes;
  6552. primitiveType?: PrimitiveType;
  6553. indices?: Uint16Array | Uint32Array;
  6554. boundingSphere?: BoundingSphere;
  6555. });
  6556. /**
  6557. * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a
  6558. * {@link GeometryAttribute} containing the attribute's data.
  6559. * <p>
  6560. * Attributes are always stored non-interleaved in a Geometry.
  6561. * </p>
  6562. * <p>
  6563. * There are reserved attribute names with well-known semantics. The following attributes
  6564. * are created by a Geometry (depending on the provided {@link VertexFormat}.
  6565. * <ul>
  6566. * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li>
  6567. * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li>
  6568. * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li>
  6569. * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li>
  6570. * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li>
  6571. * </ul>
  6572. * </p>
  6573. * <p>
  6574. * The following attribute names are generally not created by a Geometry, but are added
  6575. * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
  6576. * the geometry for rendering.
  6577. * <ul>
  6578. * <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
  6579. * <li><code>position3DLow</code> - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
  6580. * <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
  6581. * <li><code>position2DLow</code> - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
  6582. * <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>
  6583. * <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>
  6584. * </ul>
  6585. * </p>
  6586. * @example
  6587. * geometry.attributes.position = new Cesium.GeometryAttribute({
  6588. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6589. * componentsPerAttribute : 3,
  6590. * values : new Float32Array(0)
  6591. * });
  6592. */
  6593. attributes: GeometryAttributes;
  6594. /**
  6595. * Optional index data that - along with {@link Geometry#primitiveType} -
  6596. * determines the primitives in the geometry.
  6597. */
  6598. indices: any[];
  6599. /**
  6600. * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},
  6601. * but can varying based on the specific geometry.
  6602. */
  6603. primitiveType: PrimitiveType;
  6604. /**
  6605. * An optional bounding sphere that fully encloses the geometry. This is
  6606. * commonly used for culling.
  6607. */
  6608. boundingSphere: BoundingSphere;
  6609. /**
  6610. * Computes the number of vertices in a geometry. The runtime is linear with
  6611. * respect to the number of attributes in a vertex, not the number of vertices.
  6612. * @example
  6613. * var numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);
  6614. * @param geometry - The geometry.
  6615. * @returns The number of vertices in the geometry.
  6616. */
  6617. static computeNumberOfVertices(geometry: Geometry): number;
  6618. }
  6619. /**
  6620. * Values and type information for geometry attributes. A {@link Geometry}
  6621. * generally contains one or more attributes. All attributes together form
  6622. * the geometry's vertices.
  6623. * @example
  6624. * var geometry = new Cesium.Geometry({
  6625. * attributes : {
  6626. * position : new Cesium.GeometryAttribute({
  6627. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6628. * componentsPerAttribute : 3,
  6629. * values : new Float32Array([
  6630. * 0.0, 0.0, 0.0,
  6631. * 7500000.0, 0.0, 0.0,
  6632. * 0.0, 7500000.0, 0.0
  6633. * ])
  6634. * })
  6635. * },
  6636. * primitiveType : Cesium.PrimitiveType.LINE_LOOP
  6637. * });
  6638. * @param [options] - Object with the following properties:
  6639. * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values.
  6640. * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes.
  6641. * @param [options.normalize = false] - When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6642. * @param [options.values] - The values for the attributes stored in a typed array.
  6643. */
  6644. export class GeometryAttribute {
  6645. constructor(options?: {
  6646. componentDatatype?: ComponentDatatype;
  6647. componentsPerAttribute?: number;
  6648. normalize?: boolean;
  6649. values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6650. });
  6651. /**
  6652. * The datatype of each component in the attribute, e.g., individual elements in
  6653. * {@link GeometryAttribute#values}.
  6654. */
  6655. componentDatatype: ComponentDatatype;
  6656. /**
  6657. * A number between 1 and 4 that defines the number of components in an attributes.
  6658. * For example, a position attribute with x, y, and z components would have 3 as
  6659. * shown in the code example.
  6660. * @example
  6661. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6662. * attribute.componentsPerAttribute = 3;
  6663. * attribute.values = new Float32Array([
  6664. * 0.0, 0.0, 0.0,
  6665. * 7500000.0, 0.0, 0.0,
  6666. * 0.0, 7500000.0, 0.0
  6667. * ]);
  6668. */
  6669. componentsPerAttribute: number;
  6670. /**
  6671. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6672. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6673. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6674. * <p>
  6675. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6676. * </p>
  6677. * @example
  6678. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6679. * attribute.componentsPerAttribute = 4;
  6680. * attribute.normalize = true;
  6681. * attribute.values = new Uint8Array([
  6682. * Cesium.Color.floatToByte(color.red),
  6683. * Cesium.Color.floatToByte(color.green),
  6684. * Cesium.Color.floatToByte(color.blue),
  6685. * Cesium.Color.floatToByte(color.alpha)
  6686. * ]);
  6687. */
  6688. normalize: boolean;
  6689. /**
  6690. * The values for the attributes stored in a typed array. In the code example,
  6691. * every three elements in <code>values</code> defines one attributes since
  6692. * <code>componentsPerAttribute</code> is 3.
  6693. * @example
  6694. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6695. * attribute.componentsPerAttribute = 3;
  6696. * attribute.values = new Float32Array([
  6697. * 0.0, 0.0, 0.0,
  6698. * 7500000.0, 0.0, 0.0,
  6699. * 0.0, 7500000.0, 0.0
  6700. * ]);
  6701. */
  6702. values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6703. }
  6704. /**
  6705. * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
  6706. * {@link GeometryAttribute} containing the attribute's data.
  6707. * <p>
  6708. * Attributes are always stored non-interleaved in a Geometry.
  6709. * </p>
  6710. */
  6711. export class GeometryAttributes {
  6712. constructor();
  6713. /**
  6714. * The 3D position attribute.
  6715. * <p>
  6716. * 64-bit floating-point (for precision). 3 components per attribute.
  6717. * </p>
  6718. */
  6719. position: GeometryAttribute;
  6720. /**
  6721. * The normal attribute (normalized), which is commonly used for lighting.
  6722. * <p>
  6723. * 32-bit floating-point. 3 components per attribute.
  6724. * </p>
  6725. */
  6726. normal: GeometryAttribute;
  6727. /**
  6728. * The 2D texture coordinate attribute.
  6729. * <p>
  6730. * 32-bit floating-point. 2 components per attribute
  6731. * </p>
  6732. */
  6733. st: GeometryAttribute;
  6734. /**
  6735. * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6736. * <p>
  6737. * 32-bit floating-point. 3 components per attribute.
  6738. * </p>
  6739. */
  6740. bitangent: GeometryAttribute;
  6741. /**
  6742. * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6743. * <p>
  6744. * 32-bit floating-point. 3 components per attribute.
  6745. * </p>
  6746. */
  6747. tangent: GeometryAttribute;
  6748. /**
  6749. * The color attribute.
  6750. * <p>
  6751. * 8-bit unsigned integer. 4 components per attribute.
  6752. * </p>
  6753. */
  6754. color: GeometryAttribute;
  6755. }
  6756. /**
  6757. * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}
  6758. * for asynchronous geometry creation.
  6759. */
  6760. export class GeometryFactory {
  6761. constructor();
  6762. /**
  6763. * Returns a geometry.
  6764. * @param geometryFactory - A description of the circle.
  6765. * @returns The computed vertices and indices.
  6766. */
  6767. static createGeometry(geometryFactory: GeometryFactory): Geometry | undefined;
  6768. }
  6769. /**
  6770. * Geometry instancing allows one {@link Geometry} object to be positions in several
  6771. * different locations and colored uniquely. For example, one {@link BoxGeometry} can
  6772. * be instanced several times, each with a different <code>modelMatrix</code> to change
  6773. * its position, rotation, and scale.
  6774. * @example
  6775. * // Create geometry for a box, and two instances that refer to it.
  6776. * // One instance positions the box on the bottom and colored aqua.
  6777. * // The other instance positions the box on the top and color white.
  6778. * var geometry = Cesium.BoxGeometry.fromDimensions({
  6779. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  6780. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6781. * });
  6782. * var instanceBottom = new Cesium.GeometryInstance({
  6783. * geometry : geometry,
  6784. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6785. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6786. * attributes : {
  6787. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6788. * },
  6789. * id : 'bottom'
  6790. * });
  6791. * var instanceTop = new Cesium.GeometryInstance({
  6792. * geometry : geometry,
  6793. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6794. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
  6795. * attributes : {
  6796. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6797. * },
  6798. * id : 'top'
  6799. * });
  6800. * @param options - Object with the following properties:
  6801. * @param options.geometry - The geometry to instance.
  6802. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  6803. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}.
  6804. * @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below.
  6805. */
  6806. export class GeometryInstance {
  6807. constructor(options: {
  6808. geometry: Geometry | GeometryFactory;
  6809. modelMatrix?: Matrix4;
  6810. id?: any;
  6811. attributes?: any;
  6812. });
  6813. /**
  6814. * The geometry being instanced.
  6815. */
  6816. geometry: Geometry;
  6817. /**
  6818. * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
  6819. * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  6820. * Local reference frames can be used by providing a different transformation matrix, like that returned
  6821. * by {@link Transforms.eastNorthUpToFixedFrame}.
  6822. */
  6823. modelMatrix: Matrix4;
  6824. /**
  6825. * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
  6826. */
  6827. id: any;
  6828. /**
  6829. * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
  6830. * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
  6831. */
  6832. attributes: any;
  6833. }
  6834. /**
  6835. * Values and type information for per-instance geometry attributes.
  6836. * @example
  6837. * var instance = new Cesium.GeometryInstance({
  6838. * geometry : Cesium.BoxGeometry.fromDimensions({
  6839. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6840. * }),
  6841. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6842. * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6843. * id : 'box',
  6844. * attributes : {
  6845. * color : new Cesium.GeometryInstanceAttribute({
  6846. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6847. * componentsPerAttribute : 4,
  6848. * normalize : true,
  6849. * value : [255, 255, 0, 255]
  6850. * })
  6851. * }
  6852. * });
  6853. * @param options - Object with the following properties:
  6854. * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values.
  6855. * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes.
  6856. * @param [options.normalize = false] - When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6857. * @param options.value - The value for the attribute.
  6858. */
  6859. export class GeometryInstanceAttribute {
  6860. constructor(options: {
  6861. componentDatatype: ComponentDatatype;
  6862. componentsPerAttribute: number;
  6863. normalize?: boolean;
  6864. value: number[];
  6865. });
  6866. /**
  6867. * The datatype of each component in the attribute, e.g., individual elements in
  6868. * {@link GeometryInstanceAttribute#value}.
  6869. */
  6870. componentDatatype: ComponentDatatype;
  6871. /**
  6872. * A number between 1 and 4 that defines the number of components in an attributes.
  6873. * For example, a position attribute with x, y, and z components would have 3 as
  6874. * shown in the code example.
  6875. * @example
  6876. * show : new Cesium.GeometryInstanceAttribute({
  6877. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6878. * componentsPerAttribute : 1,
  6879. * normalize : true,
  6880. * value : [1.0]
  6881. * })
  6882. */
  6883. componentsPerAttribute: number;
  6884. /**
  6885. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6886. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6887. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6888. * <p>
  6889. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6890. * </p>
  6891. * @example
  6892. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6893. * attribute.componentsPerAttribute = 4;
  6894. * attribute.normalize = true;
  6895. * attribute.value = [
  6896. * Cesium.Color.floatToByte(color.red),
  6897. * Cesium.Color.floatToByte(color.green),
  6898. * Cesium.Color.floatToByte(color.blue),
  6899. * Cesium.Color.floatToByte(color.alpha)
  6900. * ];
  6901. */
  6902. normalize: boolean;
  6903. /**
  6904. * The values for the attributes stored in a typed array. In the code example,
  6905. * every three elements in <code>values</code> defines one attributes since
  6906. * <code>componentsPerAttribute</code> is 3.
  6907. * @example
  6908. * show : new Cesium.GeometryInstanceAttribute({
  6909. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6910. * componentsPerAttribute : 1,
  6911. * normalize : true,
  6912. * value : [1.0]
  6913. * })
  6914. */
  6915. value: number[];
  6916. }
  6917. /**
  6918. * Content pipeline functions for geometries.
  6919. */
  6920. export namespace GeometryPipeline {
  6921. /**
  6922. * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code>
  6923. * and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,
  6924. * <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.
  6925. * <p>
  6926. * This is commonly used to create a wireframe geometry for visual debugging.
  6927. * </p>
  6928. * @example
  6929. * geometry = Cesium.GeometryPipeline.toWireframe(geometry);
  6930. * @param geometry - The geometry to modify.
  6931. * @returns The modified <code>geometry</code> argument, with its triangle indices converted to lines.
  6932. */
  6933. function toWireframe(geometry: Geometry): Geometry;
  6934. /**
  6935. * Creates a new {@link Geometry} with <code>LINES</code> representing the provided
  6936. * attribute (<code>attributeName</code>) for the provided geometry. This is used to
  6937. * visualize vector attributes like normals, tangents, and bitangents.
  6938. * @example
  6939. * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
  6940. * @param geometry - The <code>Geometry</code> instance with the attribute.
  6941. * @param [attributeName = 'normal'] - The name of the attribute.
  6942. * @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
  6943. * @returns A new <code>Geometry</code> instance with line segments for the vector.
  6944. */
  6945. function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry;
  6946. /**
  6947. * Creates an object that maps attribute names to unique locations (indices)
  6948. * for matching vertex attributes and shader programs.
  6949. * @example
  6950. * var attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
  6951. * // Example output
  6952. * // {
  6953. * // 'position' : 0,
  6954. * // 'normal' : 1
  6955. * // }
  6956. * @param geometry - The geometry, which is not modified, to create the object for.
  6957. * @returns An object with attribute name / index pairs.
  6958. */
  6959. function createAttributeLocations(geometry: Geometry): any;
  6960. /**
  6961. * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.
  6962. * @example
  6963. * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
  6964. * @param geometry - The geometry to modify.
  6965. * @returns The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
  6966. */
  6967. function reorderForPreVertexCache(geometry: Geometry): Geometry;
  6968. /**
  6969. * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's
  6970. * post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code>
  6971. * is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.
  6972. * @example
  6973. * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
  6974. * @param geometry - The geometry to modify.
  6975. * @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache.
  6976. * @returns The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.
  6977. */
  6978. function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry;
  6979. /**
  6980. * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
  6981. * <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements
  6982. * when unsigned int indices are not supported.
  6983. * <p>
  6984. * If the geometry does not have any <code>indices</code>, this function has no effect.
  6985. * </p>
  6986. * @example
  6987. * var geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);
  6988. * @param geometry - The geometry to be split into multiple geometries.
  6989. * @returns An array of geometries, each with indices that fit into unsigned shorts.
  6990. */
  6991. function fitToUnsignedShortIndices(geometry: Geometry): Geometry[];
  6992. /**
  6993. * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>
  6994. * attribute with separate <code>position3D</code> and <code>position2D</code> attributes.
  6995. * <p>
  6996. * If the geometry does not have a <code>position</code>, this function has no effect.
  6997. * </p>
  6998. * @example
  6999. * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
  7000. * @param geometry - The geometry to modify.
  7001. * @param attributeName - The name of the attribute.
  7002. * @param attributeName3D - The name of the attribute in 3D.
  7003. * @param attributeName2D - The name of the attribute in 2D.
  7004. * @param [projection = new GeographicProjection()] - The projection to use.
  7005. * @returns The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.
  7006. */
  7007. function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry;
  7008. /**
  7009. * Encodes floating-point geometry attribute values as two separate attributes to improve
  7010. * rendering precision.
  7011. * <p>
  7012. * This is commonly used to create high-precision position vertex attributes.
  7013. * </p>
  7014. * @example
  7015. * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
  7016. * @param geometry - The geometry to modify.
  7017. * @param attributeName - The name of the attribute.
  7018. * @param attributeHighName - The name of the attribute for the encoded high bits.
  7019. * @param attributeLowName - The name of the attribute for the encoded low bits.
  7020. * @returns The modified <code>geometry</code> argument, with its encoded attribute.
  7021. */
  7022. function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry;
  7023. /**
  7024. * Transforms a geometry instance to world coordinates. This changes
  7025. * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the
  7026. * following attributes if they are present: <code>position</code>, <code>normal</code>,
  7027. * <code>tangent</code>, and <code>bitangent</code>.
  7028. * @example
  7029. * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);
  7030. * @param instance - The geometry instance to modify.
  7031. * @returns The modified <code>instance</code> argument, with its attributes transforms to world coordinates.
  7032. */
  7033. function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance;
  7034. /**
  7035. * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of
  7036. * all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry.
  7037. * This assumes a counter-clockwise winding order.
  7038. * @example
  7039. * Cesium.GeometryPipeline.computeNormal(geometry);
  7040. * @param geometry - The geometry to modify.
  7041. * @returns The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.
  7042. */
  7043. function computeNormal(geometry: Geometry): Geometry;
  7044. /**
  7045. * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.
  7046. * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.
  7047. * This assumes a counter-clockwise winding order.
  7048. * <p>
  7049. * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors
  7050. * for an Arbitrary Mesh</a> by Eric Lengyel.
  7051. * </p>
  7052. * @example
  7053. * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
  7054. * @param geometry - The geometry to modify.
  7055. * @returns The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.
  7056. */
  7057. function computeTangentAndBitangent(geometry: Geometry): Geometry;
  7058. /**
  7059. * Compresses and packs geometry normal attribute values to save memory.
  7060. * @example
  7061. * geometry = Cesium.GeometryPipeline.compressVertices(geometry);
  7062. * @param geometry - The geometry to modify.
  7063. * @returns The modified <code>geometry</code> argument, with its normals compressed and packed.
  7064. */
  7065. function compressVertices(geometry: Geometry): Geometry;
  7066. }
  7067. /**
  7068. * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
  7069. * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
  7070. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery
  7071. */
  7072. export class GoogleEarthEnterpriseMetadata {
  7073. constructor(resourceOrUrl: Resource | string);
  7074. /**
  7075. * True if imagery is available.
  7076. */
  7077. imageryPresent: boolean;
  7078. /**
  7079. * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.
  7080. */
  7081. protoImagery: boolean;
  7082. /**
  7083. * True if terrain is available.
  7084. */
  7085. terrainPresent: boolean;
  7086. /**
  7087. * Exponent used to compute constant to calculate negative height values.
  7088. */
  7089. negativeAltitudeExponentBias: number;
  7090. /**
  7091. * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.
  7092. */
  7093. negativeAltitudeThreshold: number;
  7094. /**
  7095. * Dictionary of provider id to copyright strings.
  7096. */
  7097. providers: any;
  7098. /**
  7099. * Key used to decode packets
  7100. */
  7101. key: ArrayBuffer;
  7102. /**
  7103. * Gets the name of the Google Earth Enterprise server.
  7104. */
  7105. readonly url: string;
  7106. /**
  7107. * Gets the proxy used for metadata requests.
  7108. */
  7109. readonly proxy: Proxy;
  7110. /**
  7111. * Gets the resource used for metadata requests.
  7112. */
  7113. readonly resource: Resource;
  7114. /**
  7115. * Gets a promise that resolves to true when the metadata is ready for use.
  7116. */
  7117. readonly readyPromise: Promise<boolean>;
  7118. /**
  7119. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  7120. * from a Google Earth Enterprise server.
  7121. * @param x - The tile's x coordinate.
  7122. * @param y - The tile's y coordinate.
  7123. * @param level - The tile's zoom level.
  7124. */
  7125. static tileXYToQuadKey(x: number, y: number, level: number): void;
  7126. /**
  7127. * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the
  7128. * (x, y, level) position.
  7129. * @param quadkey - The tile's quad key
  7130. */
  7131. static quadKeyToTileXY(quadkey: string): void;
  7132. }
  7133. /**
  7134. * Terrain data for a single tile from a Google Earth Enterprise server.
  7135. * @example
  7136. * var buffer = ...
  7137. * var childTileMask = ...
  7138. * var terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({
  7139. * buffer : heightBuffer,
  7140. * childTileMask : childTileMask
  7141. * });
  7142. * @param options - Object with the following properties:
  7143. * @param options.buffer - The buffer containing terrain data.
  7144. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values.
  7145. * @param options.negativeElevationThreshold - Threshold for negative values
  7146. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7147. * If a child's bit is set, geometry will be requested for that tile as well when it
  7148. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  7149. * instead upsampled from the parent. The bit values are as follows:
  7150. * <table>
  7151. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7152. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7153. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7154. * <tr><td>2</td><td>4</td><td>Northeast</td></tr>
  7155. * <tr><td>3</td><td>8</td><td>Northwest</td></tr>
  7156. * </table>
  7157. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7158. * otherwise, false.
  7159. * @param [options.credits] - Array of credits for this tile.
  7160. */
  7161. export class GoogleEarthEnterpriseTerrainData {
  7162. constructor(options: {
  7163. buffer: ArrayBuffer;
  7164. negativeAltitudeExponentBias: number;
  7165. negativeElevationThreshold: number;
  7166. childTileMask?: number;
  7167. createdByUpsampling?: boolean;
  7168. credits?: Credit[];
  7169. });
  7170. /**
  7171. * An array of credits for this tile
  7172. */
  7173. credits: Credit[];
  7174. /**
  7175. * The water mask included in this terrain data, if any. A water mask is a rectangular
  7176. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7177. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7178. */
  7179. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7180. /**
  7181. * Computes the terrain height at a specified longitude and latitude.
  7182. * @param rectangle - The rectangle covered by this terrain data.
  7183. * @param longitude - The longitude in radians.
  7184. * @param latitude - The latitude in radians.
  7185. * @returns The terrain height at the specified position. If the position
  7186. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7187. * incorrect for positions far outside the rectangle.
  7188. */
  7189. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7190. /**
  7191. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7192. * height samples in this instance, interpolated if necessary.
  7193. * @param tilingScheme - The tiling scheme of this terrain data.
  7194. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7195. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7196. * @param thisLevel - The level of this tile in the tiling scheme.
  7197. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7198. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7199. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7200. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7201. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  7202. * deferred.
  7203. */
  7204. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7205. /**
  7206. * Determines if a given child tile is available, based on the
  7207. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7208. * to be one of the four children of this tile. If non-child tile coordinates are
  7209. * given, the availability of the southeast child tile is returned.
  7210. * @param thisX - The tile X coordinate of this (the parent) tile.
  7211. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7212. * @param childX - The tile X coordinate of the child tile to check for availability.
  7213. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7214. * @returns True if the child tile is available; otherwise, false.
  7215. */
  7216. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7217. /**
  7218. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7219. * terrain data. If this value is false, the data was obtained from some other source, such
  7220. * as by downloading it from a remote server. This method should return true for instances
  7221. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7222. * @returns True if this instance was created by upsampling; otherwise, false.
  7223. */
  7224. wasCreatedByUpsampling(): boolean;
  7225. }
  7226. /**
  7227. * Provides tiled terrain using the Google Earth Enterprise REST API.
  7228. * @example
  7229. * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  7230. * var gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
  7231. * metadata : geeMetadata
  7232. * });
  7233. * @param options - Object with the following properties:
  7234. * @param options.url - The url of the Google Earth Enterprise server hosting the imagery.
  7235. * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
  7236. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  7237. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  7238. */
  7239. export class GoogleEarthEnterpriseTerrainProvider {
  7240. constructor(options: {
  7241. url: Resource | string;
  7242. metadata: GoogleEarthEnterpriseMetadata;
  7243. ellipsoid?: Ellipsoid;
  7244. credit?: Credit | string;
  7245. });
  7246. /**
  7247. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  7248. */
  7249. readonly url: string;
  7250. /**
  7251. * Gets the proxy used by this provider.
  7252. */
  7253. readonly proxy: Proxy;
  7254. /**
  7255. * Gets the tiling scheme used by this provider. This function should
  7256. * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7257. */
  7258. readonly tilingScheme: TilingScheme;
  7259. /**
  7260. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  7261. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  7262. * are passed an instance of {@link TileProviderError}.
  7263. */
  7264. readonly errorEvent: Event;
  7265. /**
  7266. * Gets a value indicating whether or not the provider is ready for use.
  7267. */
  7268. readonly ready: boolean;
  7269. /**
  7270. * Gets a promise that resolves to true when the provider is ready for use.
  7271. */
  7272. readonly readyPromise: Promise<boolean>;
  7273. /**
  7274. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  7275. * the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7276. */
  7277. readonly credit: Credit;
  7278. /**
  7279. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  7280. * indicates which areas of the globe are water rather than land, so they can be rendered
  7281. * as a reflective surface with animated waves. This function should not be
  7282. * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7283. */
  7284. readonly hasWaterMask: boolean;
  7285. /**
  7286. * Gets a value indicating whether or not the requested tiles include vertex normals.
  7287. * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7288. */
  7289. readonly hasVertexNormals: boolean;
  7290. /**
  7291. * Gets an object that can be used to determine availability of terrain from this provider, such as
  7292. * at points and in rectangles. This function should not be called before
  7293. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
  7294. * information is not available.
  7295. */
  7296. readonly availability: TileAvailability;
  7297. /**
  7298. * Requests the geometry for a given tile. This function should not be called before
  7299. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
  7300. * may optionally include a water mask and an indication of which child tiles are available.
  7301. * @param x - The X coordinate of the tile for which to request geometry.
  7302. * @param y - The Y coordinate of the tile for which to request geometry.
  7303. * @param level - The level of the tile for which to request geometry.
  7304. * @param [request] - The request object. Intended for internal use only.
  7305. * @returns A promise for the requested geometry. If this method
  7306. * returns undefined instead of a promise, it is an indication that too many requests are already
  7307. * pending and the request will be retried later.
  7308. */
  7309. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  7310. /**
  7311. * Gets the maximum geometric error allowed in a tile at a given level.
  7312. * @param level - The tile level for which to get the maximum geometric error.
  7313. * @returns The maximum geometric error.
  7314. */
  7315. getLevelMaximumGeometricError(level: number): number;
  7316. /**
  7317. * Determines whether data for a tile is available to be loaded.
  7318. * @param x - The X coordinate of the tile for which to request geometry.
  7319. * @param y - The Y coordinate of the tile for which to request geometry.
  7320. * @param level - The level of the tile for which to request geometry.
  7321. * @returns Undefined if not supported, otherwise true or false.
  7322. */
  7323. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  7324. /**
  7325. * Makes sure we load availability data for a tile
  7326. * @param x - The X coordinate of the tile for which to request geometry.
  7327. * @param y - The Y coordinate of the tile for which to request geometry.
  7328. * @param level - The level of the tile for which to request geometry.
  7329. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  7330. */
  7331. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  7332. }
  7333. /**
  7334. * Represents a Gregorian date in a more precise format than the JavaScript Date object.
  7335. * In addition to submillisecond precision, this object can also represent leap seconds.
  7336. * @param [year] - The year as a whole number.
  7337. * @param [month] - The month as a whole number with range [1, 12].
  7338. * @param [day] - The day of the month as a whole number starting at 1.
  7339. * @param [hour] - The hour as a whole number with range [0, 23].
  7340. * @param [minute] - The minute of the hour as a whole number with range [0, 59].
  7341. * @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7342. * @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0).
  7343. * @param [isLeapSecond] - Whether this time is during a leap second.
  7344. */
  7345. export class GregorianDate {
  7346. constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean);
  7347. /**
  7348. * Gets or sets the year as a whole number.
  7349. */
  7350. year: number;
  7351. /**
  7352. * Gets or sets the month as a whole number with range [1, 12].
  7353. */
  7354. month: number;
  7355. /**
  7356. * Gets or sets the day of the month as a whole number starting at 1.
  7357. */
  7358. day: number;
  7359. /**
  7360. * Gets or sets the hour as a whole number with range [0, 23].
  7361. */
  7362. hour: number;
  7363. /**
  7364. * Gets or sets the minute of the hour as a whole number with range [0, 59].
  7365. */
  7366. minute: number;
  7367. /**
  7368. * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7369. */
  7370. second: number;
  7371. /**
  7372. * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
  7373. */
  7374. millisecond: number;
  7375. /**
  7376. * Gets or sets whether this time is during a leap second.
  7377. */
  7378. isLeapSecond: boolean;
  7379. }
  7380. /**
  7381. * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
  7382. * @example
  7383. * var positions = Cesium.Cartesian3.fromDegreesArray([
  7384. * -112.1340164450331, 36.05494287836128,
  7385. * -112.08821010582645, 36.097804071380715,
  7386. * -112.13296079730024, 36.168769146801104
  7387. * ]);
  7388. *
  7389. * var geometry = new Cesium.GroundPolylineGeometry({
  7390. * positions : positions
  7391. * });
  7392. * @param options - Options with the following properties:
  7393. * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
  7394. * @param [options.width = 1.0] - The screen space width in pixels.
  7395. * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
  7396. * @param [options.loop = false] - Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
  7397. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7398. */
  7399. export class GroundPolylineGeometry {
  7400. constructor(options: {
  7401. positions: Cartesian3[];
  7402. width?: number;
  7403. granularity?: number;
  7404. loop?: boolean;
  7405. arcType?: ArcType;
  7406. });
  7407. /**
  7408. * The screen space width in pixels.
  7409. */
  7410. width: number;
  7411. /**
  7412. * The distance interval used for interpolating options.points. Zero indicates no interpolation.
  7413. * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
  7414. */
  7415. granularity: boolean;
  7416. /**
  7417. * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
  7418. * If the geometry has two positions this parameter will be ignored.
  7419. */
  7420. loop: boolean;
  7421. /**
  7422. * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7423. */
  7424. arcType: ArcType;
  7425. /**
  7426. * Stores the provided instance into the provided array.
  7427. * @param value - The value to pack.
  7428. * @param array - The array to pack into.
  7429. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  7430. * @returns The array that was packed into
  7431. */
  7432. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  7433. /**
  7434. * Retrieves an instance from a packed array.
  7435. * @param array - The packed array.
  7436. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  7437. * @param [result] - The object into which to store the result.
  7438. */
  7439. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  7440. }
  7441. /**
  7442. * Defines a heading angle, pitch angle, and range in a local frame.
  7443. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7444. * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
  7445. * angles are below the plane. Range is the distance from the center of the frame.
  7446. * @param [heading = 0.0] - The heading angle in radians.
  7447. * @param [pitch = 0.0] - The pitch angle in radians.
  7448. * @param [range = 0.0] - The distance from the center in meters.
  7449. */
  7450. export class HeadingPitchRange {
  7451. constructor(heading?: number, pitch?: number, range?: number);
  7452. /**
  7453. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7454. */
  7455. heading: number;
  7456. /**
  7457. * Pitch is the rotation from the local xy-plane. Positive pitch angles
  7458. * are above the plane. Negative pitch angles are below the plane.
  7459. */
  7460. pitch: number;
  7461. /**
  7462. * Range is the distance from the center of the local frame.
  7463. */
  7464. range: number;
  7465. /**
  7466. * Duplicates a HeadingPitchRange instance.
  7467. * @param hpr - The HeadingPitchRange to duplicate.
  7468. * @param [result] - The object onto which to store the result.
  7469. * @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
  7470. */
  7471. static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange;
  7472. }
  7473. /**
  7474. * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
  7475. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  7476. * the positive x axis.
  7477. * @param [heading = 0.0] - The heading component in radians.
  7478. * @param [pitch = 0.0] - The pitch component in radians.
  7479. * @param [roll = 0.0] - The roll component in radians.
  7480. */
  7481. export class HeadingPitchRoll {
  7482. constructor(heading?: number, pitch?: number, roll?: number);
  7483. /**
  7484. * Gets or sets the heading.
  7485. */
  7486. heading: number;
  7487. /**
  7488. * Gets or sets the pitch.
  7489. */
  7490. pitch: number;
  7491. /**
  7492. * Gets or sets the roll.
  7493. */
  7494. roll: number;
  7495. /**
  7496. * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  7497. * @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
  7498. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7499. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7500. */
  7501. static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
  7502. /**
  7503. * Returns a new HeadingPitchRoll instance from angles given in degrees.
  7504. * @param heading - the heading in degrees
  7505. * @param pitch - the pitch in degrees
  7506. * @param roll - the heading in degrees
  7507. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7508. * @returns A new HeadingPitchRoll instance
  7509. */
  7510. static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
  7511. /**
  7512. * Duplicates a HeadingPitchRoll instance.
  7513. * @param headingPitchRoll - The HeadingPitchRoll to duplicate.
  7514. * @param [result] - The object onto which to store the result.
  7515. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
  7516. */
  7517. static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
  7518. /**
  7519. * Compares the provided HeadingPitchRolls componentwise and returns
  7520. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7521. * @param [left] - The first HeadingPitchRoll.
  7522. * @param [right] - The second HeadingPitchRoll.
  7523. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  7524. */
  7525. static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean;
  7526. /**
  7527. * Compares the provided HeadingPitchRolls componentwise and returns
  7528. * <code>true</code> if they pass an absolute or relative tolerance test,
  7529. * <code>false</code> otherwise.
  7530. * @param [left] - The first HeadingPitchRoll.
  7531. * @param [right] - The second HeadingPitchRoll.
  7532. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7533. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7534. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  7535. */
  7536. static equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7537. /**
  7538. * Duplicates this HeadingPitchRoll instance.
  7539. * @param [result] - The object onto which to store the result.
  7540. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7541. */
  7542. clone(result?: HeadingPitchRoll): HeadingPitchRoll;
  7543. /**
  7544. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7545. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7546. * @param [right] - The right hand side HeadingPitchRoll.
  7547. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  7548. */
  7549. equals(right?: HeadingPitchRoll): boolean;
  7550. /**
  7551. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7552. * <code>true</code> if they pass an absolute or relative tolerance test,
  7553. * <code>false</code> otherwise.
  7554. * @param [right] - The right hand side HeadingPitchRoll.
  7555. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7556. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7557. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  7558. */
  7559. equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7560. /**
  7561. * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
  7562. * @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
  7563. */
  7564. toString(): string;
  7565. }
  7566. /**
  7567. * The encoding that is used for a heightmap
  7568. */
  7569. export enum HeightmapEncoding {
  7570. /**
  7571. * No encoding
  7572. */
  7573. NONE = 0,
  7574. /**
  7575. * LERC encoding
  7576. */
  7577. LERC = 1
  7578. }
  7579. /**
  7580. * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap
  7581. * is a rectangular array of heights in row-major order from north to south and west to east.
  7582. * @example
  7583. * var buffer = ...
  7584. * var heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
  7585. * var childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
  7586. * var waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
  7587. * var terrainData = new Cesium.HeightmapTerrainData({
  7588. * buffer : heightBuffer,
  7589. * width : 65,
  7590. * height : 65,
  7591. * childTileMask : childTileMask,
  7592. * waterMask : waterMask
  7593. * });
  7594. * @param options - Object with the following properties:
  7595. * @param options.buffer - The buffer containing height data.
  7596. * @param options.width - The width (longitude direction) of the heightmap, in samples.
  7597. * @param options.height - The height (latitude direction) of the heightmap, in samples.
  7598. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7599. * If a child's bit is set, geometry will be requested for that tile as well when it
  7600. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  7601. * instead upsampled from the parent. The bit values are as follows:
  7602. * <table>
  7603. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7604. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7605. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7606. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  7607. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  7608. * </table>
  7609. * @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square
  7610. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7611. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7612. * @param [options.structure] - An object describing the structure of the height data.
  7613. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain
  7614. * the height above the heightOffset, in meters. The heightOffset is added to the resulting
  7615. * height after multiplying by the scale.
  7616. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final
  7617. * height in meters. The offset is added after the height sample is multiplied by the
  7618. * heightScale.
  7619. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height
  7620. * sample. This is usually 1, indicating that each element is a separate height sample. If
  7621. * it is greater than 1, that number of elements together form the height sample, which is
  7622. * computed according to the structure.elementMultiplier and structure.isBigEndian properties.
  7623. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of
  7624. * one height to the first element of the next height.
  7625. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the
  7626. * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
  7627. * is 256, the height is computed as follows:
  7628. * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
  7629. * This is assuming that the isBigEndian property is false. If it is true, the order of the
  7630. * elements is reversed.
  7631. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the
  7632. * stride property is greater than 1. If this property is false, the first element is the
  7633. * low-order element. If it is true, the first element is the high-order element.
  7634. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower
  7635. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7636. * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
  7637. * not specified, no minimum value is enforced.
  7638. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher
  7639. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7640. * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
  7641. * than 65535. If this parameter is not specified, no maximum value is enforced.
  7642. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer.
  7643. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7644. * otherwise, false.
  7645. */
  7646. export class HeightmapTerrainData {
  7647. constructor(options: {
  7648. buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  7649. width: number;
  7650. height: number;
  7651. childTileMask?: number;
  7652. waterMask?: Uint8Array;
  7653. structure?: {
  7654. heightScale?: number;
  7655. heightOffset?: number;
  7656. elementsPerHeight?: number;
  7657. stride?: number;
  7658. elementMultiplier?: number;
  7659. isBigEndian?: boolean;
  7660. lowestEncodedHeight?: number;
  7661. highestEncodedHeight?: number;
  7662. };
  7663. encoding?: HeightmapEncoding;
  7664. createdByUpsampling?: boolean;
  7665. });
  7666. /**
  7667. * An array of credits for this tile.
  7668. */
  7669. credits: Credit[];
  7670. /**
  7671. * The water mask included in this terrain data, if any. A water mask is a square
  7672. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7673. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7674. */
  7675. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7676. /**
  7677. * Computes the terrain height at a specified longitude and latitude.
  7678. * @param rectangle - The rectangle covered by this terrain data.
  7679. * @param longitude - The longitude in radians.
  7680. * @param latitude - The latitude in radians.
  7681. * @returns The terrain height at the specified position. If the position
  7682. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7683. * incorrect for positions far outside the rectangle.
  7684. */
  7685. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7686. /**
  7687. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7688. * height samples in this instance, interpolated if necessary.
  7689. * @param tilingScheme - The tiling scheme of this terrain data.
  7690. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7691. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7692. * @param thisLevel - The level of this tile in the tiling scheme.
  7693. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7694. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7695. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7696. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7697. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  7698. * deferred.
  7699. */
  7700. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7701. /**
  7702. * Determines if a given child tile is available, based on the
  7703. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7704. * to be one of the four children of this tile. If non-child tile coordinates are
  7705. * given, the availability of the southeast child tile is returned.
  7706. * @param thisX - The tile X coordinate of this (the parent) tile.
  7707. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7708. * @param childX - The tile X coordinate of the child tile to check for availability.
  7709. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7710. * @returns True if the child tile is available; otherwise, false.
  7711. */
  7712. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7713. /**
  7714. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7715. * terrain data. If this value is false, the data was obtained from some other source, such
  7716. * as by downloading it from a remote server. This method should return true for instances
  7717. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7718. * @returns True if this instance was created by upsampling; otherwise, false.
  7719. */
  7720. wasCreatedByUpsampling(): boolean;
  7721. }
  7722. /**
  7723. * An {@link InterpolationAlgorithm} for performing Hermite interpolation.
  7724. */
  7725. export namespace HermitePolynomialApproximation {
  7726. /**
  7727. * Given the desired degree, returns the number of data points required for interpolation.
  7728. * @param degree - The desired degree of interpolation.
  7729. * @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).
  7730. * @returns The number of required data points needed for the desired degree of interpolation.
  7731. */
  7732. function getRequiredDataPoints(degree: number, inputOrder?: number): number;
  7733. /**
  7734. * Interpolates values using Hermite Polynomial Approximation.
  7735. * @param x - The independent variable for which the dependent variables will be interpolated.
  7736. * @param xTable - The array of independent variables to use to interpolate. The values
  7737. * in this array must be in increasing order and the same value must not occur twice in the array.
  7738. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7739. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7740. * @param yStride - The number of dependent variable values in yTable corresponding to
  7741. * each independent variable value in xTable.
  7742. * @param [result] - An existing array into which to store the result.
  7743. * @returns The array of interpolated values, or the result parameter if one was provided.
  7744. */
  7745. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7746. /**
  7747. * Interpolates values using Hermite Polynomial Approximation.
  7748. * @param x - The independent variable for which the dependent variables will be interpolated.
  7749. * @param xTable - The array of independent variables to use to interpolate. The values
  7750. * in this array must be in increasing order and the same value must not occur twice in the array.
  7751. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7752. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7753. * @param yStride - The number of dependent variable values in yTable corresponding to
  7754. * each independent variable value in xTable.
  7755. * @param inputOrder - The number of derivatives supplied for input.
  7756. * @param outputOrder - The number of derivatives desired for output.
  7757. * @param [result] - An existing array into which to store the result.
  7758. * @returns The array of interpolated values, or the result parameter if one was provided.
  7759. */
  7760. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7761. }
  7762. /**
  7763. * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
  7764. * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
  7765. * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and
  7766. * <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,
  7767. * respectively.
  7768. * @example
  7769. * // Create a G<sup>1</sup> continuous Hermite spline
  7770. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  7771. * var spline = new Cesium.HermiteSpline({
  7772. * times : times,
  7773. * points : [
  7774. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7775. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7776. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7777. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7778. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7779. * ],
  7780. * outTangents : [
  7781. * new Cesium.Cartesian3(1125196, -161816, 270551),
  7782. * new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),
  7783. * new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),
  7784. * new Cesium.Cartesian3(-890902.5, 408999.5, -447115)
  7785. * ],
  7786. * inTangents : [
  7787. * new Cesium.Cartesian3(-1993381, -731813, 368057),
  7788. * new Cesium.Cartesian3(-4193834, 96759, -585367),
  7789. * new Cesium.Cartesian3(-1781805, 817999, -894230),
  7790. * new Cesium.Cartesian3(1165345, 112641, 47281)
  7791. * ]
  7792. * });
  7793. *
  7794. * var p0 = spline.evaluate(times[0]);
  7795. * @param options - Object with the following properties:
  7796. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  7797. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  7798. * @param options.points - The array of {@link Cartesian3} control points.
  7799. * @param options.inTangents - The array of {@link Cartesian3} incoming tangents at each control point.
  7800. * @param options.outTangents - The array of {@link Cartesian3} outgoing tangents at each control point.
  7801. */
  7802. export class HermiteSpline {
  7803. constructor(options: {
  7804. times: number[];
  7805. points: Cartesian3[];
  7806. inTangents: Cartesian3[];
  7807. outTangents: Cartesian3[];
  7808. });
  7809. /**
  7810. * An array of times for the control points.
  7811. */
  7812. readonly times: number[];
  7813. /**
  7814. * An array of {@link Cartesian3} control points.
  7815. */
  7816. readonly points: Cartesian3[];
  7817. /**
  7818. * An array of {@link Cartesian3} incoming tangents at each control point.
  7819. */
  7820. readonly inTangents: Cartesian3[];
  7821. /**
  7822. * An array of {@link Cartesian3} outgoing tangents at each control point.
  7823. */
  7824. readonly outTangents: Cartesian3[];
  7825. /**
  7826. * Creates a spline where the tangents at each control point are the same.
  7827. * The curves are guaranteed to be at least in the class C<sup>1</sup>.
  7828. * @example
  7829. * var points = [
  7830. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7831. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7832. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7833. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7834. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7835. * ];
  7836. *
  7837. * // Add tangents
  7838. * var tangents = new Array(points.length);
  7839. * tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);
  7840. * var temp = new Cesium.Cartesian3();
  7841. * for (var i = 1; i < tangents.length - 1; ++i) {
  7842. * tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());
  7843. * }
  7844. * tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);
  7845. *
  7846. * var spline = Cesium.HermiteSpline.createC1({
  7847. * times : times,
  7848. * points : points,
  7849. * tangents : tangents
  7850. * });
  7851. * @param options - Object with the following properties:
  7852. * @param options.times - The array of control point times.
  7853. * @param options.points - The array of control points.
  7854. * @param options.tangents - The array of tangents at the control points.
  7855. * @returns A hermite spline.
  7856. */
  7857. static createC1(options: {
  7858. times: number[];
  7859. points: Cartesian3[];
  7860. tangents: Cartesian3[];
  7861. }): HermiteSpline;
  7862. /**
  7863. * Creates a natural cubic spline. The tangents at the control points are generated
  7864. * to create a curve in the class C<sup>2</sup>.
  7865. * @example
  7866. * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.
  7867. * var spline = Cesium.HermiteSpline.createNaturalCubic({
  7868. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7869. * points : [
  7870. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7871. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7872. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7873. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7874. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7875. * ]
  7876. * });
  7877. * @param options - Object with the following properties:
  7878. * @param options.times - The array of control point times.
  7879. * @param options.points - The array of control points.
  7880. * @returns A hermite spline or a linear spline if less than 3 control points were given.
  7881. */
  7882. static createNaturalCubic(options: {
  7883. times: number[];
  7884. points: Cartesian3[];
  7885. }): HermiteSpline | LinearSpline;
  7886. /**
  7887. * Creates a clamped cubic spline. The tangents at the interior control points are generated
  7888. * to create a curve in the class C<sup>2</sup>.
  7889. * @example
  7890. * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.
  7891. * var spline = Cesium.HermiteSpline.createClampedCubic({
  7892. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7893. * points : [
  7894. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7895. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7896. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7897. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7898. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7899. * ],
  7900. * firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),
  7901. * lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)
  7902. * });
  7903. * @param options - Object with the following properties:
  7904. * @param options.times - The array of control point times.
  7905. * @param options.points - The array of control points.
  7906. * @param options.firstTangent - The outgoing tangent of the first control point.
  7907. * @param options.lastTangent - The incoming tangent of the last control point.
  7908. * @returns A hermite spline or a linear spline if less than 3 control points were given.
  7909. */
  7910. static createClampedCubic(options: {
  7911. times: number[];
  7912. points: Cartesian3[];
  7913. firstTangent: Cartesian3;
  7914. lastTangent: Cartesian3;
  7915. }): HermiteSpline | LinearSpline;
  7916. /**
  7917. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  7918. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  7919. * @param time - The time.
  7920. * @returns The index for the element at the start of the interval.
  7921. */
  7922. findTimeInterval(time: number): number;
  7923. /**
  7924. * Wraps the given time to the period covered by the spline.
  7925. * @param time - The time.
  7926. * @returns The time, wrapped around to the updated animation.
  7927. */
  7928. wrapTime(time: number): number;
  7929. /**
  7930. * Clamps the given time to the period covered by the spline.
  7931. * @param time - The time.
  7932. * @returns The time, clamped to the animation period.
  7933. */
  7934. clampTime(time: number): number;
  7935. /**
  7936. * Evaluates the curve at a given time.
  7937. * @param time - The time at which to evaluate the curve.
  7938. * @param [result] - The object onto which to store the result.
  7939. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  7940. */
  7941. evaluate(time: number, result?: Cartesian3): Cartesian3;
  7942. }
  7943. /**
  7944. * Hilbert Order helper functions.
  7945. */
  7946. export namespace HilbertOrder { }
  7947. /**
  7948. * Constants for WebGL index datatypes. These corresponds to the
  7949. * <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
  7950. */
  7951. export enum IndexDatatype {
  7952. /**
  7953. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  7954. * of an element in <code>Uint8Array</code>.
  7955. */
  7956. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  7957. /**
  7958. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  7959. * of an element in <code>Uint16Array</code>.
  7960. */
  7961. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  7962. /**
  7963. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  7964. * of an element in <code>Uint32Array</code>.
  7965. */
  7966. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
  7967. }
  7968. export namespace InterpolationAlgorithm {
  7969. /**
  7970. * Gets the name of this interpolation algorithm.
  7971. */
  7972. var type: string;
  7973. /**
  7974. * Given the desired degree, returns the number of data points required for interpolation.
  7975. * @param degree - The desired degree of interpolation.
  7976. * @returns The number of required data points needed for the desired degree of interpolation.
  7977. */
  7978. function getRequiredDataPoints(degree: number): number;
  7979. /**
  7980. * Performs zero order interpolation.
  7981. * @param x - The independent variable for which the dependent variables will be interpolated.
  7982. * @param xTable - The array of independent variables to use to interpolate. The values
  7983. * in this array must be in increasing order and the same value must not occur twice in the array.
  7984. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7985. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7986. * @param yStride - The number of dependent variable values in yTable corresponding to
  7987. * each independent variable value in xTable.
  7988. * @param [result] - An existing array into which to store the result.
  7989. * @returns The array of interpolated values, or the result parameter if one was provided.
  7990. */
  7991. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7992. /**
  7993. * Performs higher order interpolation. Not all interpolators need to support high-order interpolation,
  7994. * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
  7995. * @param x - The independent variable for which the dependent variables will be interpolated.
  7996. * @param xTable - The array of independent variables to use to interpolate. The values
  7997. * in this array must be in increasing order and the same value must not occur twice in the array.
  7998. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7999. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8000. * @param yStride - The number of dependent variable values in yTable corresponding to
  8001. * each independent variable value in xTable.
  8002. * @param inputOrder - The number of derivatives supplied for input.
  8003. * @param outputOrder - The number of derivatives desired for output.
  8004. * @param [result] - An existing array into which to store the result.
  8005. * @returns The array of interpolated values, or the result parameter if one was provided.
  8006. */
  8007. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  8008. }
  8009. /**
  8010. * The interface for interpolation algorithms.
  8011. */
  8012. export interface InterpolationAlgorithm {
  8013. }
  8014. /**
  8015. * This enumerated type is used in determining where, relative to the frustum, an
  8016. * object is located. The object can either be fully contained within the frustum (INSIDE),
  8017. * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
  8018. * outside of the frustum's 6 planes (OUTSIDE).
  8019. */
  8020. export enum Intersect {
  8021. /**
  8022. * Represents that an object is not contained within the frustum.
  8023. */
  8024. OUTSIDE = -1,
  8025. /**
  8026. * Represents that an object intersects one of the frustum's planes.
  8027. */
  8028. INTERSECTING = 0,
  8029. /**
  8030. * Represents that an object is fully within the frustum.
  8031. */
  8032. INSIDE = 1
  8033. }
  8034. /**
  8035. * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
  8036. */
  8037. export namespace IntersectionTests {
  8038. /**
  8039. * Computes the intersection of a ray and a plane.
  8040. * @param ray - The ray.
  8041. * @param plane - The plane.
  8042. * @param [result] - The object onto which to store the result.
  8043. * @returns The intersection point or undefined if there is no intersections.
  8044. */
  8045. function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3;
  8046. /**
  8047. * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.
  8048. *
  8049. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8050. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8051. * @param ray - The ray.
  8052. * @param p0 - The first vertex of the triangle.
  8053. * @param p1 - The second vertex of the triangle.
  8054. * @param p2 - The third vertex of the triangle.
  8055. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8056. * and return undefined for intersections with the back face.
  8057. * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection.
  8058. */
  8059. function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number;
  8060. /**
  8061. * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
  8062. *
  8063. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8064. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8065. * @param ray - The ray.
  8066. * @param p0 - The first vertex of the triangle.
  8067. * @param p1 - The second vertex of the triangle.
  8068. * @param p2 - The third vertex of the triangle.
  8069. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8070. * and return undefined for intersections with the back face.
  8071. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8072. * @returns The intersection point or undefined if there is no intersections.
  8073. */
  8074. function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8075. /**
  8076. * Computes the intersection of a line segment and a triangle.
  8077. * @param v0 - The an end point of the line segment.
  8078. * @param v1 - The other end point of the line segment.
  8079. * @param p0 - The first vertex of the triangle.
  8080. * @param p1 - The second vertex of the triangle.
  8081. * @param p2 - The third vertex of the triangle.
  8082. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8083. * and return undefined for intersections with the back face.
  8084. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8085. * @returns The intersection point or undefined if there is no intersections.
  8086. */
  8087. function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8088. /**
  8089. * Computes the intersection points of a ray with a sphere.
  8090. * @param ray - The ray.
  8091. * @param sphere - The sphere.
  8092. * @param [result] - The result onto which to store the result.
  8093. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8094. */
  8095. function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval;
  8096. /**
  8097. * Computes the intersection points of a line segment with a sphere.
  8098. * @param p0 - An end point of the line segment.
  8099. * @param p1 - The other end point of the line segment.
  8100. * @param sphere - The sphere.
  8101. * @param [result] - The result onto which to store the result.
  8102. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8103. */
  8104. function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval;
  8105. /**
  8106. * Computes the intersection points of a ray with an ellipsoid.
  8107. * @param ray - The ray.
  8108. * @param ellipsoid - The ellipsoid.
  8109. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8110. */
  8111. function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval;
  8112. /**
  8113. * Provides the point along the ray which is nearest to the ellipsoid.
  8114. * @param ray - The ray.
  8115. * @param ellipsoid - The ellipsoid.
  8116. * @returns The nearest planetodetic point on the ray.
  8117. */
  8118. function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3;
  8119. /**
  8120. * Computes the intersection of a line segment and a plane.
  8121. * @example
  8122. * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8123. * var normal = ellipsoid.geodeticSurfaceNormal(origin);
  8124. * var plane = Cesium.Plane.fromPointNormal(origin, normal);
  8125. *
  8126. * var p0 = new Cesium.Cartesian3(...);
  8127. * var p1 = new Cesium.Cartesian3(...);
  8128. *
  8129. * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
  8130. * var intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
  8131. * @param endPoint0 - An end point of the line segment.
  8132. * @param endPoint1 - The other end point of the line segment.
  8133. * @param plane - The plane.
  8134. * @param [result] - The object onto which to store the result.
  8135. * @returns The intersection point or undefined if there is no intersection.
  8136. */
  8137. function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3;
  8138. /**
  8139. * Computes the intersection of a triangle and a plane
  8140. * @example
  8141. * var origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8142. * var normal = ellipsoid.geodeticSurfaceNormal(origin);
  8143. * var plane = Cesium.Plane.fromPointNormal(origin, normal);
  8144. *
  8145. * var p0 = new Cesium.Cartesian3(...);
  8146. * var p1 = new Cesium.Cartesian3(...);
  8147. * var p2 = new Cesium.Cartesian3(...);
  8148. *
  8149. * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
  8150. * var triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
  8151. * @param p0 - First point of the triangle
  8152. * @param p1 - Second point of the triangle
  8153. * @param p2 - Third point of the triangle
  8154. * @param plane - Intersection plane
  8155. * @returns An object with properties <code>positions</code> and <code>indices</code>, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)
  8156. */
  8157. function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any;
  8158. }
  8159. /**
  8160. * Contains functions for operating on 2D triangles.
  8161. */
  8162. export namespace Intersections2D {
  8163. /**
  8164. * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
  8165. * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
  8166. * 3, or 4 vertices.
  8167. * @example
  8168. * var result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
  8169. * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
  8170. * @param threshold - The threshold coordinate value at which to clip the triangle.
  8171. * @param keepAbove - true to keep the portion of the triangle above the threshold, or false
  8172. * to keep the portion below.
  8173. * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order.
  8174. * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order.
  8175. * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order.
  8176. * @param [result] - The array into which to copy the result. If this parameter is not supplied,
  8177. * a new array is constructed and returned.
  8178. * @returns The polygon that results after the clip, specified as a list of
  8179. * vertices. The vertices are specified in counter-clockwise order.
  8180. * Each vertex is either an index from the existing list (identified as
  8181. * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
  8182. * For new vertices, the -1 is followed by three additional numbers: the
  8183. * index of each of the two original vertices forming the line segment that
  8184. * the new vertex lies on, and the fraction of the distance from the first
  8185. * vertex to the second one.
  8186. */
  8187. function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[];
  8188. /**
  8189. * Compute the barycentric coordinates of a 2D position within a 2D triangle.
  8190. * @example
  8191. * var result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
  8192. * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
  8193. * @param x - The x coordinate of the position for which to find the barycentric coordinates.
  8194. * @param y - The y coordinate of the position for which to find the barycentric coordinates.
  8195. * @param x1 - The x coordinate of the triangle's first vertex.
  8196. * @param y1 - The y coordinate of the triangle's first vertex.
  8197. * @param x2 - The x coordinate of the triangle's second vertex.
  8198. * @param y2 - The y coordinate of the triangle's second vertex.
  8199. * @param x3 - The x coordinate of the triangle's third vertex.
  8200. * @param y3 - The y coordinate of the triangle's third vertex.
  8201. * @param [result] - The instance into to which to copy the result. If this parameter
  8202. * is undefined, a new instance is created and returned.
  8203. * @returns The barycentric coordinates of the position within the triangle.
  8204. */
  8205. function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3;
  8206. /**
  8207. * Compute the intersection between 2 line segments
  8208. * @example
  8209. * var result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
  8210. * // result === new Cesium.Cartesian2(0.0, 1.0);
  8211. * @param x00 - The x coordinate of the first line's first vertex.
  8212. * @param y00 - The y coordinate of the first line's first vertex.
  8213. * @param x01 - The x coordinate of the first line's second vertex.
  8214. * @param y01 - The y coordinate of the first line's second vertex.
  8215. * @param x10 - The x coordinate of the second line's first vertex.
  8216. * @param y10 - The y coordinate of the second line's first vertex.
  8217. * @param x11 - The x coordinate of the second line's second vertex.
  8218. * @param y11 - The y coordinate of the second line's second vertex.
  8219. * @param [result] - The instance into to which to copy the result. If this parameter
  8220. * is undefined, a new instance is created and returned.
  8221. * @returns The intersection point, undefined if there is no intersection point or lines are coincident.
  8222. */
  8223. function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2;
  8224. }
  8225. /**
  8226. * Represents the closed interval [start, stop].
  8227. * @param [start = 0.0] - The beginning of the interval.
  8228. * @param [stop = 0.0] - The end of the interval.
  8229. */
  8230. export class Interval {
  8231. constructor(start?: number, stop?: number);
  8232. /**
  8233. * The beginning of the interval.
  8234. */
  8235. start: number;
  8236. /**
  8237. * The end of the interval.
  8238. */
  8239. stop: number;
  8240. }
  8241. /**
  8242. * Default settings for accessing the Cesium ion API.
  8243. *
  8244. * An ion access token is only required if you are using any ion related APIs.
  8245. * A default access token is provided for evaluation purposes only.
  8246. * Sign up for a free ion account and get your own access token at {@link https://cesium.com}
  8247. */
  8248. export namespace Ion {
  8249. /**
  8250. * Gets or sets the default Cesium ion access token.
  8251. */
  8252. var defaultAccessToken: string;
  8253. /**
  8254. * Gets or sets the default Cesium ion server.
  8255. */
  8256. var defaultServer: string | Resource;
  8257. }
  8258. /**
  8259. * Provides geocoding through Cesium ion.
  8260. * @param options - Object with the following properties:
  8261. * @param options.scene - The scene
  8262. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8263. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8264. */
  8265. export class IonGeocoderService {
  8266. constructor(options: {
  8267. scene: Scene;
  8268. accessToken?: string;
  8269. server?: string | Resource;
  8270. });
  8271. /**
  8272. * @param query - The query to be sent to the geocoder service
  8273. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  8274. */
  8275. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  8276. }
  8277. /**
  8278. * A {@link Resource} instance that encapsulates Cesium ion asset access.
  8279. * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.
  8280. * @param endpoint - The result of the Cesium ion asset endpoint service.
  8281. * @param endpointResource - The resource used to retreive the endpoint.
  8282. */
  8283. export class IonResource extends Resource {
  8284. constructor(endpoint: any, endpointResource: Resource);
  8285. /**
  8286. * Asynchronously creates an instance.
  8287. * @example
  8288. * //Load a Cesium3DTileset with asset ID of 124624234
  8289. * viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
  8290. * @example
  8291. * //Load a CZML file with asset ID of 10890
  8292. * Cesium.IonResource.fromAssetId(10890)
  8293. * .then(function (resource) {
  8294. * viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
  8295. * });
  8296. * @param assetId - The Cesium ion asset id.
  8297. * @param [options] - An object with the following properties:
  8298. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8299. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8300. * @returns A Promise to am instance representing the Cesium ion Asset.
  8301. */
  8302. static fromAssetId(assetId: number, options?: {
  8303. accessToken?: string;
  8304. server?: string | Resource;
  8305. }): Promise<IonResource>;
  8306. /**
  8307. * Gets the credits required for attribution of the asset.
  8308. */
  8309. readonly credits: Credit[];
  8310. /**
  8311. * Duplicates a Resource instance.
  8312. * @param [result] - The object onto which to store the result.
  8313. * @returns The modified result parameter or a new Resource instance if one was not provided.
  8314. */
  8315. clone(result?: Resource): Resource;
  8316. /**
  8317. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  8318. * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if <code>preferImageBitmap</code> is true and the browser supports <code>createImageBitmap</code> or otherwise an
  8319. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  8320. * @example
  8321. * // load a single image asynchronously
  8322. * resource.fetchImage().then(function(image) {
  8323. * // use the loaded image
  8324. * }).otherwise(function(error) {
  8325. * // an error occurred
  8326. * });
  8327. *
  8328. * // load several images in parallel
  8329. * when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  8330. * // images is an array containing all the loaded images
  8331. * });
  8332. * @param [options] - An object with the following properties.
  8333. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  8334. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  8335. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  8336. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.
  8337. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  8338. */
  8339. fetchImage(options?: {
  8340. preferBlob?: boolean;
  8341. preferImageBitmap?: boolean;
  8342. flipY?: boolean;
  8343. skipColorSpaceConversion?: boolean;
  8344. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  8345. }
  8346. /**
  8347. * Constants related to ISO8601 support.
  8348. */
  8349. export namespace Iso8601 {
  8350. /**
  8351. * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.
  8352. * This is equivalent to the date string '0000-01-01T00:00:00Z'
  8353. */
  8354. const MINIMUM_VALUE: JulianDate;
  8355. /**
  8356. * A {@link JulianDate} representing the latest time representable by an ISO8601 date.
  8357. * This is equivalent to the date string '9999-12-31T24:00:00Z'
  8358. */
  8359. const MAXIMUM_VALUE: JulianDate;
  8360. /**
  8361. * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.
  8362. * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'
  8363. */
  8364. const MAXIMUM_INTERVAL: JulianDate;
  8365. }
  8366. /**
  8367. * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
  8368. * For increased precision, this class stores the whole number part of the date and the seconds
  8369. * part of the date in separate components. In order to be safe for arithmetic and represent
  8370. * leap seconds, the date is always stored in the International Atomic Time standard
  8371. * {@link TimeStandard.TAI}.
  8372. * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
  8373. * @param [secondsOfDay = 0.0] - The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly.
  8374. * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined.
  8375. */
  8376. export class JulianDate {
  8377. constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard);
  8378. /**
  8379. * Gets or sets the number of whole days.
  8380. */
  8381. dayNumber: number;
  8382. /**
  8383. * Gets or sets the number of seconds into the current day.
  8384. */
  8385. secondsOfDay: number;
  8386. /**
  8387. * Creates a new instance from a GregorianDate.
  8388. * @param date - A GregorianDate.
  8389. * @param [result] - An existing instance to use for the result.
  8390. * @returns The modified result parameter or a new instance if none was provided.
  8391. */
  8392. static fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate;
  8393. /**
  8394. * Creates a new instance from a JavaScript Date.
  8395. * @param date - A JavaScript Date.
  8396. * @param [result] - An existing instance to use for the result.
  8397. * @returns The modified result parameter or a new instance if none was provided.
  8398. */
  8399. static fromDate(date: Date, result?: JulianDate): JulianDate;
  8400. /**
  8401. * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
  8402. * This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601
  8403. * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
  8404. * @param iso8601String - An ISO 8601 date.
  8405. * @param [result] - An existing instance to use for the result.
  8406. * @returns The modified result parameter or a new instance if none was provided.
  8407. */
  8408. static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate;
  8409. /**
  8410. * Creates a new instance that represents the current system time.
  8411. * This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.
  8412. * @param [result] - An existing instance to use for the result.
  8413. * @returns The modified result parameter or a new instance if none was provided.
  8414. */
  8415. static now(result?: JulianDate): JulianDate;
  8416. /**
  8417. * Creates a {@link GregorianDate} from the provided instance.
  8418. * @param julianDate - The date to be converted.
  8419. * @param [result] - An existing instance to use for the result.
  8420. * @returns The modified result parameter or a new instance if none was provided.
  8421. */
  8422. static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate;
  8423. /**
  8424. * Creates a JavaScript Date from the provided instance.
  8425. * Since JavaScript dates are only accurate to the nearest millisecond and
  8426. * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
  8427. * If the provided JulianDate is during a leap second, the previous second is used.
  8428. * @param julianDate - The date to be converted.
  8429. * @returns A new instance representing the provided date.
  8430. */
  8431. static toDate(julianDate: JulianDate): Date;
  8432. /**
  8433. * Creates an ISO8601 representation of the provided date.
  8434. * @param julianDate - The date to be converted.
  8435. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  8436. * @returns The ISO8601 representation of the provided date.
  8437. */
  8438. static toIso8601(julianDate: JulianDate, precision?: number): string;
  8439. /**
  8440. * Duplicates a JulianDate instance.
  8441. * @param julianDate - The date to duplicate.
  8442. * @param [result] - An existing instance to use for the result.
  8443. * @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
  8444. */
  8445. static clone(julianDate: JulianDate, result?: JulianDate): JulianDate;
  8446. /**
  8447. * Compares two instances.
  8448. * @param left - The first instance.
  8449. * @param right - The second instance.
  8450. * @returns A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal.
  8451. */
  8452. static compare(left: JulianDate, right: JulianDate): number;
  8453. /**
  8454. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8455. * @param [left] - The first instance.
  8456. * @param [right] - The second instance.
  8457. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8458. */
  8459. static equals(left?: JulianDate, right?: JulianDate): boolean;
  8460. /**
  8461. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8462. * each other. That is, in order for the dates to be considered equal (and for
  8463. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8464. * seconds, must be less than <code>epsilon</code>.
  8465. * @param [left] - The first instance.
  8466. * @param [right] - The second instance.
  8467. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8468. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8469. */
  8470. static equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean;
  8471. /**
  8472. * Computes the total number of whole and fractional days represented by the provided instance.
  8473. * @param julianDate - The date.
  8474. * @returns The Julian date as single floating point number.
  8475. */
  8476. static totalDays(julianDate: JulianDate): number;
  8477. /**
  8478. * Computes the difference in seconds between the provided instance.
  8479. * @param left - The first instance.
  8480. * @param right - The second instance.
  8481. * @returns The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.
  8482. */
  8483. static secondsDifference(left: JulianDate, right: JulianDate): number;
  8484. /**
  8485. * Computes the difference in days between the provided instance.
  8486. * @param left - The first instance.
  8487. * @param right - The second instance.
  8488. * @returns The difference, in days, when subtracting <code>right</code> from <code>left</code>.
  8489. */
  8490. static daysDifference(left: JulianDate, right: JulianDate): number;
  8491. /**
  8492. * Computes the number of seconds the provided instance is ahead of UTC.
  8493. * @param julianDate - The date.
  8494. * @returns The number of seconds the provided instance is ahead of UTC
  8495. */
  8496. static computeTaiMinusUtc(julianDate: JulianDate): number;
  8497. /**
  8498. * Adds the provided number of seconds to the provided date instance.
  8499. * @param julianDate - The date.
  8500. * @param seconds - The number of seconds to add or subtract.
  8501. * @param result - An existing instance to use for the result.
  8502. * @returns The modified result parameter.
  8503. */
  8504. static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate;
  8505. /**
  8506. * Adds the provided number of minutes to the provided date instance.
  8507. * @param julianDate - The date.
  8508. * @param minutes - The number of minutes to add or subtract.
  8509. * @param result - An existing instance to use for the result.
  8510. * @returns The modified result parameter.
  8511. */
  8512. static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate;
  8513. /**
  8514. * Adds the provided number of hours to the provided date instance.
  8515. * @param julianDate - The date.
  8516. * @param hours - The number of hours to add or subtract.
  8517. * @param result - An existing instance to use for the result.
  8518. * @returns The modified result parameter.
  8519. */
  8520. static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate;
  8521. /**
  8522. * Adds the provided number of days to the provided date instance.
  8523. * @param julianDate - The date.
  8524. * @param days - The number of days to add or subtract.
  8525. * @param result - An existing instance to use for the result.
  8526. * @returns The modified result parameter.
  8527. */
  8528. static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate;
  8529. /**
  8530. * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8531. * @param left - The first instance.
  8532. * @param right - The second instance.
  8533. * @returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8534. */
  8535. static lessThan(left: JulianDate, right: JulianDate): boolean;
  8536. /**
  8537. * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.
  8538. * @param left - The first instance.
  8539. * @param right - The second instance.
  8540. * @returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.
  8541. */
  8542. static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8543. /**
  8544. * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8545. * @param left - The first instance.
  8546. * @param right - The second instance.
  8547. * @returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8548. */
  8549. static greaterThan(left: JulianDate, right: JulianDate): boolean;
  8550. /**
  8551. * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.
  8552. * @param left - The first instance.
  8553. * @param right - The second instance.
  8554. * @returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.
  8555. */
  8556. static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8557. /**
  8558. * Duplicates this instance.
  8559. * @param [result] - An existing instance to use for the result.
  8560. * @returns The modified result parameter or a new instance if none was provided.
  8561. */
  8562. clone(result?: JulianDate): JulianDate;
  8563. /**
  8564. * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8565. * @param [right] - The second instance.
  8566. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8567. */
  8568. equals(right?: JulianDate): boolean;
  8569. /**
  8570. * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8571. * each other. That is, in order for the dates to be considered equal (and for
  8572. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8573. * seconds, must be less than <code>epsilon</code>.
  8574. * @param [right] - The second instance.
  8575. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8576. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8577. */
  8578. equalsEpsilon(right?: JulianDate, epsilon?: number): boolean;
  8579. /**
  8580. * Creates a string representing this date in ISO8601 format.
  8581. * @returns A string representing this date in ISO8601 format.
  8582. */
  8583. toString(): string;
  8584. /**
  8585. * Gets or sets the list of leap seconds used throughout Cesium.
  8586. */
  8587. static leapSeconds: LeapSecond[];
  8588. }
  8589. /**
  8590. * This enumerated type is for representing keyboard modifiers. These are keys
  8591. * that are held down in addition to other event types.
  8592. */
  8593. export enum KeyboardEventModifier {
  8594. /**
  8595. * Represents the shift key being held down.
  8596. */
  8597. SHIFT = 0,
  8598. /**
  8599. * Represents the control key being held down.
  8600. */
  8601. CTRL = 1,
  8602. /**
  8603. * Represents the alt key being held down.
  8604. */
  8605. ALT = 2
  8606. }
  8607. /**
  8608. * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.
  8609. */
  8610. export namespace LagrangePolynomialApproximation {
  8611. /**
  8612. * Given the desired degree, returns the number of data points required for interpolation.
  8613. * @param degree - The desired degree of interpolation.
  8614. * @returns The number of required data points needed for the desired degree of interpolation.
  8615. */
  8616. function getRequiredDataPoints(degree: number): number;
  8617. /**
  8618. * Interpolates values using Lagrange Polynomial Approximation.
  8619. * @param x - The independent variable for which the dependent variables will be interpolated.
  8620. * @param xTable - The array of independent variables to use to interpolate. The values
  8621. * in this array must be in increasing order and the same value must not occur twice in the array.
  8622. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8623. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8624. * @param yStride - The number of dependent variable values in yTable corresponding to
  8625. * each independent variable value in xTable.
  8626. * @param [result] - An existing array into which to store the result.
  8627. * @returns The array of interpolated values, or the result parameter if one was provided.
  8628. */
  8629. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8630. }
  8631. /**
  8632. * Describes a single leap second, which is constructed from a {@link JulianDate} and a
  8633. * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
  8634. * @param [date] - A Julian date representing the time of the leap second.
  8635. * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date.
  8636. */
  8637. export class LeapSecond {
  8638. constructor(date?: JulianDate, offset?: number);
  8639. /**
  8640. * Gets or sets the date at which this leap second occurs.
  8641. */
  8642. julianDate: JulianDate;
  8643. /**
  8644. * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
  8645. * of this leap second.
  8646. */
  8647. offset: number;
  8648. }
  8649. /**
  8650. * An {@link InterpolationAlgorithm} for performing linear interpolation.
  8651. */
  8652. export namespace LinearApproximation {
  8653. /**
  8654. * Given the desired degree, returns the number of data points required for interpolation.
  8655. * Since linear interpolation can only generate a first degree polynomial, this function
  8656. * always returns 2.
  8657. * @param degree - The desired degree of interpolation.
  8658. * @returns This function always returns 2.
  8659. */
  8660. function getRequiredDataPoints(degree: number): number;
  8661. /**
  8662. * Interpolates values using linear approximation.
  8663. * @param x - The independent variable for which the dependent variables will be interpolated.
  8664. * @param xTable - The array of independent variables to use to interpolate. The values
  8665. * in this array must be in increasing order and the same value must not occur twice in the array.
  8666. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8667. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8668. * @param yStride - The number of dependent variable values in yTable corresponding to
  8669. * each independent variable value in xTable.
  8670. * @param [result] - An existing array into which to store the result.
  8671. * @returns The array of interpolated values, or the result parameter if one was provided.
  8672. */
  8673. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8674. }
  8675. /**
  8676. * A spline that uses piecewise linear interpolation to create a curve.
  8677. * @example
  8678. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  8679. * var spline = new Cesium.LinearSpline({
  8680. * times : times,
  8681. * points : [
  8682. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  8683. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  8684. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  8685. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  8686. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  8687. * ]
  8688. * });
  8689. *
  8690. * var p0 = spline.evaluate(times[0]);
  8691. * @param options - Object with the following properties:
  8692. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  8693. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  8694. * @param options.points - The array of {@link Cartesian3} control points.
  8695. */
  8696. export class LinearSpline {
  8697. constructor(options: {
  8698. times: number[];
  8699. points: Cartesian3[];
  8700. });
  8701. /**
  8702. * An array of times for the control points.
  8703. */
  8704. readonly times: number[];
  8705. /**
  8706. * An array of {@link Cartesian3} control points.
  8707. */
  8708. readonly points: Cartesian3[];
  8709. /**
  8710. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  8711. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  8712. * @param time - The time.
  8713. * @returns The index for the element at the start of the interval.
  8714. */
  8715. findTimeInterval(time: number): number;
  8716. /**
  8717. * Wraps the given time to the period covered by the spline.
  8718. * @param time - The time.
  8719. * @returns The time, wrapped around to the updated animation.
  8720. */
  8721. wrapTime(time: number): number;
  8722. /**
  8723. * Clamps the given time to the period covered by the spline.
  8724. * @param time - The time.
  8725. * @returns The time, clamped to the animation period.
  8726. */
  8727. clampTime(time: number): number;
  8728. /**
  8729. * Evaluates the curve at a given time.
  8730. * @param time - The time at which to evaluate the curve.
  8731. * @param [result] - The object onto which to store the result.
  8732. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  8733. */
  8734. evaluate(time: number, result?: Cartesian3): Cartesian3;
  8735. }
  8736. /**
  8737. * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a
  8738. * flat map like Cesium's 2D and Columbus View modes.
  8739. */
  8740. export class MapProjection {
  8741. constructor();
  8742. /**
  8743. * Gets the {@link Ellipsoid}.
  8744. */
  8745. readonly ellipsoid: Ellipsoid;
  8746. /**
  8747. * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.
  8748. * @param cartographic - The coordinates to project.
  8749. * @param [result] - An instance into which to copy the result. If this parameter is
  8750. * undefined, a new instance is created and returned.
  8751. * @returns The projected coordinates. If the result parameter is not undefined, the
  8752. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8753. * created and returned.
  8754. */
  8755. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  8756. /**
  8757. * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  8758. * coordinates, in radians.
  8759. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  8760. * @param [result] - An instance into which to copy the result. If this parameter is
  8761. * undefined, a new instance is created and returned.
  8762. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  8763. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8764. * created and returned.
  8765. */
  8766. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  8767. }
  8768. /**
  8769. * Math functions.
  8770. */
  8771. export namespace Math {
  8772. /**
  8773. * 0.1
  8774. */
  8775. const EPSILON1 = 0.1;
  8776. /**
  8777. * 0.01
  8778. */
  8779. const EPSILON2 = 0.01;
  8780. /**
  8781. * 0.001
  8782. */
  8783. const EPSILON3 = 0.001;
  8784. /**
  8785. * 0.0001
  8786. */
  8787. const EPSILON4 = 0.0001;
  8788. /**
  8789. * 0.00001
  8790. */
  8791. const EPSILON5 = 0.00001;
  8792. /**
  8793. * 0.000001
  8794. */
  8795. const EPSILON6 = 0.000001;
  8796. /**
  8797. * 0.0000001
  8798. */
  8799. const EPSILON7 = 1e-7;
  8800. /**
  8801. * 0.00000001
  8802. */
  8803. const EPSILON8 = 1e-8;
  8804. /**
  8805. * 0.000000001
  8806. */
  8807. const EPSILON9 = 1e-9;
  8808. /**
  8809. * 0.0000000001
  8810. */
  8811. const EPSILON10 = 1e-10;
  8812. /**
  8813. * 0.00000000001
  8814. */
  8815. const EPSILON11 = 1e-11;
  8816. /**
  8817. * 0.000000000001
  8818. */
  8819. const EPSILON12 = 1e-12;
  8820. /**
  8821. * 0.0000000000001
  8822. */
  8823. const EPSILON13 = 1e-13;
  8824. /**
  8825. * 0.00000000000001
  8826. */
  8827. const EPSILON14 = 1e-14;
  8828. /**
  8829. * 0.000000000000001
  8830. */
  8831. const EPSILON15 = 1e-15;
  8832. /**
  8833. * 0.0000000000000001
  8834. */
  8835. const EPSILON16 = 1e-16;
  8836. /**
  8837. * 0.00000000000000001
  8838. */
  8839. const EPSILON17 = 1e-17;
  8840. /**
  8841. * 0.000000000000000001
  8842. */
  8843. const EPSILON18 = 1e-18;
  8844. /**
  8845. * 0.0000000000000000001
  8846. */
  8847. const EPSILON19 = 1e-19;
  8848. /**
  8849. * 0.00000000000000000001
  8850. */
  8851. const EPSILON20 = 1e-20;
  8852. /**
  8853. * 0.000000000000000000001
  8854. */
  8855. const EPSILON21 = 1e-21;
  8856. /**
  8857. * The gravitational parameter of the Earth in meters cubed
  8858. * per second squared as defined by the WGS84 model: 3.986004418e14
  8859. */
  8860. const GRAVITATIONALPARAMETER = 398600441800000;
  8861. /**
  8862. * Radius of the sun in meters: 6.955e8
  8863. */
  8864. const SOLAR_RADIUS = 695500000;
  8865. /**
  8866. * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
  8867. * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
  8868. * Celestial Mechanics 82: 83-110, 2002.
  8869. */
  8870. const LUNAR_RADIUS = 1737400;
  8871. /**
  8872. * 64 * 1024
  8873. */
  8874. const SIXTY_FOUR_KILOBYTES: number;
  8875. /**
  8876. * 4 * 1024 * 1024 * 1024
  8877. */
  8878. const FOUR_GIGABYTES: number;
  8879. /**
  8880. * Returns the sign of the value; 1 if the value is positive, -1 if the value is
  8881. * negative, or 0 if the value is 0.
  8882. * @param value - The value to return the sign of.
  8883. * @returns The sign of value.
  8884. */
  8885. function sign(value: number): number;
  8886. /**
  8887. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
  8888. * This is similar to {@link Math#sign} except that returns 1.0 instead of
  8889. * 0.0 when the input value is 0.0.
  8890. * @param value - The value to return the sign of.
  8891. * @returns The sign of value.
  8892. */
  8893. function signNotZero(value: number): number;
  8894. /**
  8895. * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
  8896. * @param value - The scalar value in the range [-1.0, 1.0]
  8897. * @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default.
  8898. * @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
  8899. */
  8900. function toSNorm(value: number, rangeMaximum?: number): number;
  8901. /**
  8902. * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
  8903. * @param value - SNORM value in the range [0, rangeMaximum]
  8904. * @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default.
  8905. * @returns Scalar in the range [-1.0, 1.0].
  8906. */
  8907. function fromSNorm(value: number, rangeMaximum?: number): number;
  8908. /**
  8909. * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
  8910. * @param value - The scalar value in the range [rangeMinimum, rangeMaximum]
  8911. * @param rangeMinimum - The minimum value in the mapped range.
  8912. * @param rangeMaximum - The maximum value in the mapped range.
  8913. * @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
  8914. */
  8915. function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number;
  8916. /**
  8917. * Returns the hyperbolic sine of a number.
  8918. * The hyperbolic sine of <em>value</em> is defined to be
  8919. * (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0
  8920. * where <i>e</i> is Euler's number, approximately 2.71828183.
  8921. *
  8922. * <p>Special cases:
  8923. * <ul>
  8924. * <li>If the argument is NaN, then the result is NaN.</li>
  8925. *
  8926. * <li>If the argument is infinite, then the result is an infinity
  8927. * with the same sign as the argument.</li>
  8928. *
  8929. * <li>If the argument is zero, then the result is a zero with the
  8930. * same sign as the argument.</li>
  8931. * </ul>
  8932. * </p>
  8933. * @param value - The number whose hyperbolic sine is to be returned.
  8934. * @returns The hyperbolic sine of <code>value</code>.
  8935. */
  8936. function sinh(value: number): number;
  8937. /**
  8938. * Returns the hyperbolic cosine of a number.
  8939. * The hyperbolic cosine of <strong>value</strong> is defined to be
  8940. * (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0
  8941. * where <i>e</i> is Euler's number, approximately 2.71828183.
  8942. *
  8943. * <p>Special cases:
  8944. * <ul>
  8945. * <li>If the argument is NaN, then the result is NaN.</li>
  8946. *
  8947. * <li>If the argument is infinite, then the result is positive infinity.</li>
  8948. *
  8949. * <li>If the argument is zero, then the result is 1.0.</li>
  8950. * </ul>
  8951. * </p>
  8952. * @param value - The number whose hyperbolic cosine is to be returned.
  8953. * @returns The hyperbolic cosine of <code>value</code>.
  8954. */
  8955. function cosh(value: number): number;
  8956. /**
  8957. * Computes the linear interpolation of two values.
  8958. * @example
  8959. * var n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
  8960. * @param p - The start value to interpolate.
  8961. * @param q - The end value to interpolate.
  8962. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  8963. * @returns The linearly interpolated value.
  8964. */
  8965. function lerp(p: number, q: number, time: number): number;
  8966. /**
  8967. * pi
  8968. */
  8969. const PI: number;
  8970. /**
  8971. * 1/pi
  8972. */
  8973. const ONE_OVER_PI: number;
  8974. /**
  8975. * pi/2
  8976. */
  8977. const PI_OVER_TWO: number;
  8978. /**
  8979. * pi/3
  8980. */
  8981. const PI_OVER_THREE: number;
  8982. /**
  8983. * pi/4
  8984. */
  8985. const PI_OVER_FOUR: number;
  8986. /**
  8987. * pi/6
  8988. */
  8989. const PI_OVER_SIX: number;
  8990. /**
  8991. * 3pi/2
  8992. */
  8993. const THREE_PI_OVER_TWO: number;
  8994. /**
  8995. * 2pi
  8996. */
  8997. const TWO_PI: number;
  8998. /**
  8999. * 1/2pi
  9000. */
  9001. const ONE_OVER_TWO_PI: number;
  9002. /**
  9003. * The number of radians in a degree.
  9004. */
  9005. const RADIANS_PER_DEGREE: number;
  9006. /**
  9007. * The number of degrees in a radian.
  9008. */
  9009. const DEGREES_PER_RADIAN: number;
  9010. /**
  9011. * The number of radians in an arc second.
  9012. */
  9013. const RADIANS_PER_ARCSECOND: number;
  9014. /**
  9015. * Converts degrees to radians.
  9016. * @param degrees - The angle to convert in degrees.
  9017. * @returns The corresponding angle in radians.
  9018. */
  9019. function toRadians(degrees: number): number;
  9020. /**
  9021. * Converts radians to degrees.
  9022. * @param radians - The angle to convert in radians.
  9023. * @returns The corresponding angle in degrees.
  9024. */
  9025. function toDegrees(radians: number): number;
  9026. /**
  9027. * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9028. * @example
  9029. * // Convert 270 degrees to -90 degrees longitude
  9030. * var longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
  9031. * @param angle - The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9032. * @returns The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9033. */
  9034. function convertLongitudeRange(angle: number): number;
  9035. /**
  9036. * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9037. * Useful for sanitizing data before use in objects requiring correct range.
  9038. * @example
  9039. * // Clamp 108 degrees latitude to 90 degrees latitude
  9040. * var latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
  9041. * @param angle - The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9042. * @returns The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9043. */
  9044. function clampToLatitudeRange(angle: number): number;
  9045. /**
  9046. * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
  9047. * @param angle - in radians
  9048. * @returns The angle in the range [<code>-Math.PI</code>, <code>Math.PI</code>].
  9049. */
  9050. function negativePiToPi(angle: number): number;
  9051. /**
  9052. * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
  9053. * @param angle - in radians
  9054. * @returns The angle in the range [0, <code>Math.TWO_PI</code>].
  9055. */
  9056. function zeroToTwoPi(angle: number): number;
  9057. /**
  9058. * The modulo operation that also works for negative dividends.
  9059. * @param m - The dividend.
  9060. * @param n - The divisor.
  9061. * @returns The remainder.
  9062. */
  9063. function mod(m: number, n: number): number;
  9064. /**
  9065. * Determines if two values are equal using an absolute or relative tolerance test. This is useful
  9066. * to avoid problems due to roundoff error when comparing floating-point values directly. The values are
  9067. * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
  9068. * Use this test if you are unsure of the magnitudes of left and right.
  9069. * @example
  9070. * var a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
  9071. * var b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
  9072. * var c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
  9073. * var d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
  9074. * @param left - The first value to compare.
  9075. * @param right - The other value to compare.
  9076. * @param [relativeEpsilon = 0] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.
  9077. * @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.
  9078. * @returns <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.
  9079. */
  9080. function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  9081. /**
  9082. * Determines if the left value is less than the right value. If the two values are within
  9083. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9084. * @param left - The first number to compare.
  9085. * @param right - The second number to compare.
  9086. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9087. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> by more than
  9088. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two
  9089. * values are nearly equal.
  9090. */
  9091. function lessThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9092. /**
  9093. * Determines if the left value is less than or equal to the right value. If the two values are within
  9094. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9095. * @param left - The first number to compare.
  9096. * @param right - The second number to compare.
  9097. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9098. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> or if the
  9099. * the values are nearly equal.
  9100. */
  9101. function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9102. /**
  9103. * Determines if the left value is greater the right value. If the two values are within
  9104. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9105. * @param left - The first number to compare.
  9106. * @param right - The second number to compare.
  9107. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9108. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> by more than
  9109. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two
  9110. * values are nearly equal.
  9111. */
  9112. function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9113. /**
  9114. * Determines if the left value is greater than or equal to the right value. If the two values are within
  9115. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9116. * @param left - The first number to compare.
  9117. * @param right - The second number to compare.
  9118. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9119. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> or if the
  9120. * the values are nearly equal.
  9121. */
  9122. function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9123. /**
  9124. * Computes the factorial of the provided number.
  9125. * @example
  9126. * //Compute 7!, which is equal to 5040
  9127. * var computedFactorial = Cesium.Math.factorial(7);
  9128. * @param n - The number whose factorial is to be computed.
  9129. * @returns The factorial of the provided number or undefined if the number is less than 0.
  9130. */
  9131. function factorial(n: number): number;
  9132. /**
  9133. * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
  9134. * @example
  9135. * var n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
  9136. * var n = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
  9137. * @param [n] - The number to be incremented.
  9138. * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value.
  9139. * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded.
  9140. * @returns The incremented number.
  9141. */
  9142. function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number;
  9143. /**
  9144. * Determines if a non-negative integer is a power of two.
  9145. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  9146. * @example
  9147. * var t = Cesium.Math.isPowerOfTwo(16); // true
  9148. * var f = Cesium.Math.isPowerOfTwo(20); // false
  9149. * @param n - The integer to test in the range [0, (2^32)-1].
  9150. * @returns <code>true</code> if the number if a power of two; otherwise, <code>false</code>.
  9151. */
  9152. function isPowerOfTwo(n: number): boolean;
  9153. /**
  9154. * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.
  9155. * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.
  9156. * @example
  9157. * var n = Cesium.Math.nextPowerOfTwo(29); // 32
  9158. * var m = Cesium.Math.nextPowerOfTwo(32); // 32
  9159. * @param n - The integer to test in the range [0, 2^31].
  9160. * @returns The next power-of-two integer.
  9161. */
  9162. function nextPowerOfTwo(n: number): number;
  9163. /**
  9164. * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.
  9165. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  9166. * @example
  9167. * var n = Cesium.Math.previousPowerOfTwo(29); // 16
  9168. * var m = Cesium.Math.previousPowerOfTwo(32); // 32
  9169. * @param n - The integer to test in the range [0, (2^32)-1].
  9170. * @returns The previous power-of-two integer.
  9171. */
  9172. function previousPowerOfTwo(n: number): number;
  9173. /**
  9174. * Constraint a value to lie between two values.
  9175. * @param value - The value to constrain.
  9176. * @param min - The minimum value.
  9177. * @param max - The maximum value.
  9178. * @returns The value clamped so that min <= value <= max.
  9179. */
  9180. function clamp(value: number, min: number, max: number): number;
  9181. /**
  9182. * Sets the seed used by the random number generator
  9183. * in {@link Math#nextRandomNumber}.
  9184. * @param seed - An integer used as the seed.
  9185. */
  9186. function setRandomNumberSeed(seed: number): void;
  9187. /**
  9188. * Generates a random floating point number in the range of [0.0, 1.0)
  9189. * using a Mersenne twister.
  9190. * @returns A random number in the range of [0.0, 1.0).
  9191. */
  9192. function nextRandomNumber(): number;
  9193. /**
  9194. * Generates a random number between two numbers.
  9195. * @param min - The minimum value.
  9196. * @param max - The maximum value.
  9197. * @returns A random number between the min and max.
  9198. */
  9199. function randomBetween(min: number, max: number): number;
  9200. /**
  9201. * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9202. * so that the function will never return NaN.
  9203. * @param value - The value for which to compute acos.
  9204. * @returns The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0,
  9205. * whichever is closer, if the value is outside the range.
  9206. */
  9207. function acosClamped(value: number): number;
  9208. /**
  9209. * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9210. * so that the function will never return NaN.
  9211. * @param value - The value for which to compute asin.
  9212. * @returns The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0,
  9213. * whichever is closer, if the value is outside the range.
  9214. */
  9215. function asinClamped(value: number): number;
  9216. /**
  9217. * Finds the chord length between two points given the circle's radius and the angle between the points.
  9218. * @param angle - The angle between the two points.
  9219. * @param radius - The radius of the circle.
  9220. * @returns The chord length.
  9221. */
  9222. function chordLength(angle: number, radius: number): number;
  9223. /**
  9224. * Finds the logarithm of a number to a base.
  9225. * @param number - The number.
  9226. * @param base - The base.
  9227. * @returns The result.
  9228. */
  9229. function logBase(number: number, base: number): number;
  9230. /**
  9231. * Finds the cube root of a number.
  9232. * Returns NaN if <code>number</code> is not provided.
  9233. * @param [number] - The number.
  9234. * @returns The result.
  9235. */
  9236. function cbrt(number?: number): number;
  9237. /**
  9238. * Finds the base 2 logarithm of a number.
  9239. * @param number - The number.
  9240. * @returns The result.
  9241. */
  9242. function log2(number: number): number;
  9243. /**
  9244. * Computes a fast approximation of Atan for input in the range [-1, 1].
  9245. *
  9246. * Based on Michal Drobot's approximation from ShaderFastLibs,
  9247. * which in turn is based on "Efficient approximations for the arctangent function,"
  9248. * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  9249. * Adapted from ShaderFastLibs under MIT License.
  9250. * @param x - An input number in the range [-1, 1]
  9251. * @returns An approximation of atan(x)
  9252. */
  9253. function fastApproximateAtan(x: number): number;
  9254. /**
  9255. * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
  9256. *
  9257. * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
  9258. * @param x - An input number that isn't zero if y is zero.
  9259. * @param y - An input number that isn't zero if x is zero.
  9260. * @returns An approximation of atan2(x, y)
  9261. */
  9262. function fastApproximateAtan2(x: number, y: number): number;
  9263. }
  9264. export interface Matrix2 extends ArrayLike<number> {
  9265. }
  9266. /**
  9267. * A 2x2 matrix, indexable as a column-major order array.
  9268. * Constructor parameters are in row-major order for code readability.
  9269. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9270. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9271. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9272. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9273. */
  9274. export class Matrix2 implements ArrayLike<number> {
  9275. constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number);
  9276. /**
  9277. * The number of elements used to pack the object into an array.
  9278. */
  9279. static packedLength: number;
  9280. /**
  9281. * Stores the provided instance into the provided array.
  9282. * @param value - The value to pack.
  9283. * @param array - The array to pack into.
  9284. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9285. * @returns The array that was packed into
  9286. */
  9287. static pack(value: Matrix2, array: number[], startingIndex?: number): number[];
  9288. /**
  9289. * Retrieves an instance from a packed array.
  9290. * @param array - The packed array.
  9291. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9292. * @param [result] - The object into which to store the result.
  9293. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9294. */
  9295. static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9296. /**
  9297. * Duplicates a Matrix2 instance.
  9298. * @param matrix - The matrix to duplicate.
  9299. * @param [result] - The object onto which to store the result.
  9300. * @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
  9301. */
  9302. static clone(matrix: Matrix2, result?: Matrix2): Matrix2;
  9303. /**
  9304. * Creates a Matrix2 from 4 consecutive elements in an array.
  9305. * @example
  9306. * // Create the Matrix2:
  9307. * // [1.0, 2.0]
  9308. * // [1.0, 2.0]
  9309. *
  9310. * var v = [1.0, 1.0, 2.0, 2.0];
  9311. * var m = Cesium.Matrix2.fromArray(v);
  9312. *
  9313. * // Create same Matrix2 with using an offset into an array
  9314. * var v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
  9315. * var m2 = Cesium.Matrix2.fromArray(v2, 2);
  9316. * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9317. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9318. * @param [result] - The object onto which to store the result.
  9319. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9320. */
  9321. static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9322. /**
  9323. * Creates a Matrix2 instance from a column-major order array.
  9324. * @param values - The column-major order array.
  9325. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9326. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9327. */
  9328. static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2;
  9329. /**
  9330. * Creates a Matrix2 instance from a row-major order array.
  9331. * The resulting matrix will be in column-major order.
  9332. * @param values - The row-major order array.
  9333. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9334. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9335. */
  9336. static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2;
  9337. /**
  9338. * Computes a Matrix2 instance representing a non-uniform scale.
  9339. * @example
  9340. * // Creates
  9341. * // [7.0, 0.0]
  9342. * // [0.0, 8.0]
  9343. * var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
  9344. * @param scale - The x and y scale factors.
  9345. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9346. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9347. */
  9348. static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2;
  9349. /**
  9350. * Computes a Matrix2 instance representing a uniform scale.
  9351. * @example
  9352. * // Creates
  9353. * // [2.0, 0.0]
  9354. * // [0.0, 2.0]
  9355. * var m = Cesium.Matrix2.fromUniformScale(2.0);
  9356. * @param scale - The uniform scale factor.
  9357. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9358. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9359. */
  9360. static fromUniformScale(scale: number, result?: Matrix2): Matrix2;
  9361. /**
  9362. * Creates a rotation matrix.
  9363. * @example
  9364. * // Rotate a point 45 degrees counterclockwise.
  9365. * var p = new Cesium.Cartesian2(5, 6);
  9366. * var m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
  9367. * var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
  9368. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9369. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9370. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9371. */
  9372. static fromRotation(angle: number, result?: Matrix2): Matrix2;
  9373. /**
  9374. * Creates an Array from the provided Matrix2 instance.
  9375. * The array will be in column-major order.
  9376. * @param matrix - The matrix to use..
  9377. * @param [result] - The Array onto which to store the result.
  9378. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9379. */
  9380. static toArray(matrix: Matrix2, result?: number[]): number[];
  9381. /**
  9382. * Computes the array index of the element at the provided row and column.
  9383. * @example
  9384. * var myMatrix = new Cesium.Matrix2();
  9385. * var column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
  9386. * var column1Row0 = myMatrix[column1Row0Index]
  9387. * myMatrix[column1Row0Index] = 10.0;
  9388. * @param row - The zero-based index of the row.
  9389. * @param column - The zero-based index of the column.
  9390. * @returns The index of the element at the provided row and column.
  9391. */
  9392. static getElementIndex(row: number, column: number): number;
  9393. /**
  9394. * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
  9395. * @param matrix - The matrix to use.
  9396. * @param index - The zero-based index of the column to retrieve.
  9397. * @param result - The object onto which to store the result.
  9398. * @returns The modified result parameter.
  9399. */
  9400. static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9401. /**
  9402. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
  9403. * @param matrix - The matrix to use.
  9404. * @param index - The zero-based index of the column to set.
  9405. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9406. * @param result - The object onto which to store the result.
  9407. * @returns The modified result parameter.
  9408. */
  9409. static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2;
  9410. /**
  9411. * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
  9412. * @param matrix - The matrix to use.
  9413. * @param index - The zero-based index of the row to retrieve.
  9414. * @param result - The object onto which to store the result.
  9415. * @returns The modified result parameter.
  9416. */
  9417. static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9418. /**
  9419. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
  9420. * @param matrix - The matrix to use.
  9421. * @param index - The zero-based index of the row to set.
  9422. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9423. * @param result - The object onto which to store the result.
  9424. * @returns The modified result parameter.
  9425. */
  9426. static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2;
  9427. /**
  9428. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9429. * @param matrix - The matrix.
  9430. * @param result - The object onto which to store the result.
  9431. * @returns The modified result parameter.
  9432. */
  9433. static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2;
  9434. /**
  9435. * Computes the maximum scale assuming the matrix is an affine transformation.
  9436. * The maximum scale is the maximum length of the column vectors.
  9437. * @param matrix - The matrix.
  9438. * @returns The maximum scale.
  9439. */
  9440. static getMaximumScale(matrix: Matrix2): number;
  9441. /**
  9442. * Computes the product of two matrices.
  9443. * @param left - The first matrix.
  9444. * @param right - The second matrix.
  9445. * @param result - The object onto which to store the result.
  9446. * @returns The modified result parameter.
  9447. */
  9448. static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9449. /**
  9450. * Computes the sum of two matrices.
  9451. * @param left - The first matrix.
  9452. * @param right - The second matrix.
  9453. * @param result - The object onto which to store the result.
  9454. * @returns The modified result parameter.
  9455. */
  9456. static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9457. /**
  9458. * Computes the difference of two matrices.
  9459. * @param left - The first matrix.
  9460. * @param right - The second matrix.
  9461. * @param result - The object onto which to store the result.
  9462. * @returns The modified result parameter.
  9463. */
  9464. static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9465. /**
  9466. * Computes the product of a matrix and a column vector.
  9467. * @param matrix - The matrix.
  9468. * @param cartesian - The column.
  9469. * @param result - The object onto which to store the result.
  9470. * @returns The modified result parameter.
  9471. */
  9472. static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  9473. /**
  9474. * Computes the product of a matrix and a scalar.
  9475. * @param matrix - The matrix.
  9476. * @param scalar - The number to multiply by.
  9477. * @param result - The object onto which to store the result.
  9478. * @returns The modified result parameter.
  9479. */
  9480. static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2;
  9481. /**
  9482. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9483. * @example
  9484. * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
  9485. * Cesium.Matrix2.multiplyByScale(m, scale, m);
  9486. * @param matrix - The matrix on the left-hand side.
  9487. * @param scale - The non-uniform scale on the right-hand side.
  9488. * @param result - The object onto which to store the result.
  9489. * @returns The modified result parameter.
  9490. */
  9491. static multiplyByScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2;
  9492. /**
  9493. * Creates a negated copy of the provided matrix.
  9494. * @param matrix - The matrix to negate.
  9495. * @param result - The object onto which to store the result.
  9496. * @returns The modified result parameter.
  9497. */
  9498. static negate(matrix: Matrix2, result: Matrix2): Matrix2;
  9499. /**
  9500. * Computes the transpose of the provided matrix.
  9501. * @param matrix - The matrix to transpose.
  9502. * @param result - The object onto which to store the result.
  9503. * @returns The modified result parameter.
  9504. */
  9505. static transpose(matrix: Matrix2, result: Matrix2): Matrix2;
  9506. /**
  9507. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9508. * @param matrix - The matrix with signed elements.
  9509. * @param result - The object onto which to store the result.
  9510. * @returns The modified result parameter.
  9511. */
  9512. static abs(matrix: Matrix2, result: Matrix2): Matrix2;
  9513. /**
  9514. * Compares the provided matrices componentwise and returns
  9515. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9516. * @param [left] - The first matrix.
  9517. * @param [right] - The second matrix.
  9518. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9519. */
  9520. static equals(left?: Matrix2, right?: Matrix2): boolean;
  9521. /**
  9522. * Compares the provided matrices componentwise and returns
  9523. * <code>true</code> if they are within the provided epsilon,
  9524. * <code>false</code> otherwise.
  9525. * @param [left] - The first matrix.
  9526. * @param [right] - The second matrix.
  9527. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9528. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9529. */
  9530. static equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean;
  9531. /**
  9532. * An immutable Matrix2 instance initialized to the identity matrix.
  9533. */
  9534. static readonly IDENTITY: Matrix2;
  9535. /**
  9536. * An immutable Matrix2 instance initialized to the zero matrix.
  9537. */
  9538. static readonly ZERO: Matrix2;
  9539. /**
  9540. * The index into Matrix2 for column 0, row 0.
  9541. * @example
  9542. * var matrix = new Cesium.Matrix2();
  9543. * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
  9544. */
  9545. static readonly COLUMN0ROW0: number;
  9546. /**
  9547. * The index into Matrix2 for column 0, row 1.
  9548. * @example
  9549. * var matrix = new Cesium.Matrix2();
  9550. * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
  9551. */
  9552. static readonly COLUMN0ROW1: number;
  9553. /**
  9554. * The index into Matrix2 for column 1, row 0.
  9555. * @example
  9556. * var matrix = new Cesium.Matrix2();
  9557. * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
  9558. */
  9559. static readonly COLUMN1ROW0: number;
  9560. /**
  9561. * The index into Matrix2 for column 1, row 1.
  9562. * @example
  9563. * var matrix = new Cesium.Matrix2();
  9564. * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
  9565. */
  9566. static readonly COLUMN1ROW1: number;
  9567. /**
  9568. * Gets the number of items in the collection.
  9569. */
  9570. length: number;
  9571. /**
  9572. * Duplicates the provided Matrix2 instance.
  9573. * @param [result] - The object onto which to store the result.
  9574. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9575. */
  9576. clone(result?: Matrix2): Matrix2;
  9577. /**
  9578. * Compares this matrix to the provided matrix componentwise and returns
  9579. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9580. * @param [right] - The right hand side matrix.
  9581. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  9582. */
  9583. equals(right?: Matrix2): boolean;
  9584. /**
  9585. * Compares this matrix to the provided matrix componentwise and returns
  9586. * <code>true</code> if they are within the provided epsilon,
  9587. * <code>false</code> otherwise.
  9588. * @param [right] - The right hand side matrix.
  9589. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9590. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  9591. */
  9592. equalsEpsilon(right?: Matrix2, epsilon?: number): boolean;
  9593. /**
  9594. * Creates a string representing this Matrix with each row being
  9595. * on a separate line and in the format '(column0, column1)'.
  9596. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
  9597. */
  9598. toString(): string;
  9599. }
  9600. export interface Matrix3 extends ArrayLike<number> {
  9601. }
  9602. /**
  9603. * A 3x3 matrix, indexable as a column-major order array.
  9604. * Constructor parameters are in row-major order for code readability.
  9605. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9606. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9607. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  9608. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9609. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9610. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  9611. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  9612. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  9613. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  9614. */
  9615. export class Matrix3 implements ArrayLike<number> {
  9616. constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number);
  9617. /**
  9618. * The number of elements used to pack the object into an array.
  9619. */
  9620. static packedLength: number;
  9621. /**
  9622. * Stores the provided instance into the provided array.
  9623. * @param value - The value to pack.
  9624. * @param array - The array to pack into.
  9625. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9626. * @returns The array that was packed into
  9627. */
  9628. static pack(value: Matrix3, array: number[], startingIndex?: number): number[];
  9629. /**
  9630. * Retrieves an instance from a packed array.
  9631. * @param array - The packed array.
  9632. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9633. * @param [result] - The object into which to store the result.
  9634. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9635. */
  9636. static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9637. /**
  9638. * Duplicates a Matrix3 instance.
  9639. * @param matrix - The matrix to duplicate.
  9640. * @param [result] - The object onto which to store the result.
  9641. * @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
  9642. */
  9643. static clone(matrix: Matrix3, result?: Matrix3): Matrix3;
  9644. /**
  9645. * Creates a Matrix3 from 9 consecutive elements in an array.
  9646. * @example
  9647. * // Create the Matrix3:
  9648. * // [1.0, 2.0, 3.0]
  9649. * // [1.0, 2.0, 3.0]
  9650. * // [1.0, 2.0, 3.0]
  9651. *
  9652. * var v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9653. * var m = Cesium.Matrix3.fromArray(v);
  9654. *
  9655. * // Create same Matrix3 with using an offset into an array
  9656. * var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9657. * var m2 = Cesium.Matrix3.fromArray(v2, 2);
  9658. * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9659. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9660. * @param [result] - The object onto which to store the result.
  9661. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9662. */
  9663. static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9664. /**
  9665. * Creates a Matrix3 instance from a column-major order array.
  9666. * @param values - The column-major order array.
  9667. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9668. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9669. */
  9670. static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
  9671. /**
  9672. * Creates a Matrix3 instance from a row-major order array.
  9673. * The resulting matrix will be in column-major order.
  9674. * @param values - The row-major order array.
  9675. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9676. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9677. */
  9678. static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
  9679. /**
  9680. * Computes a 3x3 rotation matrix from the provided quaternion.
  9681. * @param quaternion - the quaternion to use.
  9682. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9683. * @returns The 3x3 rotation matrix from this quaternion.
  9684. */
  9685. static fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3;
  9686. /**
  9687. * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  9688. * @param headingPitchRoll - the headingPitchRoll to use.
  9689. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9690. * @returns The 3x3 rotation matrix from this headingPitchRoll.
  9691. */
  9692. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
  9693. /**
  9694. * Computes a Matrix3 instance representing a non-uniform scale.
  9695. * @example
  9696. * // Creates
  9697. * // [7.0, 0.0, 0.0]
  9698. * // [0.0, 8.0, 0.0]
  9699. * // [0.0, 0.0, 9.0]
  9700. * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9701. * @param scale - The x, y, and z scale factors.
  9702. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9703. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9704. */
  9705. static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
  9706. /**
  9707. * Computes a Matrix3 instance representing a uniform scale.
  9708. * @example
  9709. * // Creates
  9710. * // [2.0, 0.0, 0.0]
  9711. * // [0.0, 2.0, 0.0]
  9712. * // [0.0, 0.0, 2.0]
  9713. * var m = Cesium.Matrix3.fromUniformScale(2.0);
  9714. * @param scale - The uniform scale factor.
  9715. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9716. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9717. */
  9718. static fromUniformScale(scale: number, result?: Matrix3): Matrix3;
  9719. /**
  9720. * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
  9721. * @example
  9722. * // Creates
  9723. * // [0.0, -9.0, 8.0]
  9724. * // [9.0, 0.0, -7.0]
  9725. * // [-8.0, 7.0, 0.0]
  9726. * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9727. * @param vector - the vector on the left hand side of the cross product operation.
  9728. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9729. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9730. */
  9731. static fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3;
  9732. /**
  9733. * Creates a rotation matrix around the x-axis.
  9734. * @example
  9735. * // Rotate a point 45 degrees counterclockwise around the x-axis.
  9736. * var p = new Cesium.Cartesian3(5, 6, 7);
  9737. * var m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));
  9738. * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9739. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9740. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9741. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9742. */
  9743. static fromRotationX(angle: number, result?: Matrix3): Matrix3;
  9744. /**
  9745. * Creates a rotation matrix around the y-axis.
  9746. * @example
  9747. * // Rotate a point 45 degrees counterclockwise around the y-axis.
  9748. * var p = new Cesium.Cartesian3(5, 6, 7);
  9749. * var m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));
  9750. * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9751. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9752. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9753. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9754. */
  9755. static fromRotationY(angle: number, result?: Matrix3): Matrix3;
  9756. /**
  9757. * Creates a rotation matrix around the z-axis.
  9758. * @example
  9759. * // Rotate a point 45 degrees counterclockwise around the z-axis.
  9760. * var p = new Cesium.Cartesian3(5, 6, 7);
  9761. * var m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));
  9762. * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9763. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9764. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9765. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9766. */
  9767. static fromRotationZ(angle: number, result?: Matrix3): Matrix3;
  9768. /**
  9769. * Creates an Array from the provided Matrix3 instance.
  9770. * The array will be in column-major order.
  9771. * @param matrix - The matrix to use..
  9772. * @param [result] - The Array onto which to store the result.
  9773. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9774. */
  9775. static toArray(matrix: Matrix3, result?: number[]): number[];
  9776. /**
  9777. * Computes the array index of the element at the provided row and column.
  9778. * @example
  9779. * var myMatrix = new Cesium.Matrix3();
  9780. * var column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);
  9781. * var column1Row0 = myMatrix[column1Row0Index]
  9782. * myMatrix[column1Row0Index] = 10.0;
  9783. * @param row - The zero-based index of the row.
  9784. * @param column - The zero-based index of the column.
  9785. * @returns The index of the element at the provided row and column.
  9786. */
  9787. static getElementIndex(row: number, column: number): number;
  9788. /**
  9789. * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
  9790. * @param matrix - The matrix to use.
  9791. * @param index - The zero-based index of the column to retrieve.
  9792. * @param result - The object onto which to store the result.
  9793. * @returns The modified result parameter.
  9794. */
  9795. static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9796. /**
  9797. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
  9798. * @param matrix - The matrix to use.
  9799. * @param index - The zero-based index of the column to set.
  9800. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9801. * @param result - The object onto which to store the result.
  9802. * @returns The modified result parameter.
  9803. */
  9804. static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9805. /**
  9806. * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
  9807. * @param matrix - The matrix to use.
  9808. * @param index - The zero-based index of the row to retrieve.
  9809. * @param result - The object onto which to store the result.
  9810. * @returns The modified result parameter.
  9811. */
  9812. static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9813. /**
  9814. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
  9815. * @param matrix - The matrix to use.
  9816. * @param index - The zero-based index of the row to set.
  9817. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9818. * @param result - The object onto which to store the result.
  9819. * @returns The modified result parameter.
  9820. */
  9821. static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9822. /**
  9823. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9824. * @param matrix - The matrix.
  9825. * @param result - The object onto which to store the result.
  9826. * @returns The modified result parameter.
  9827. */
  9828. static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3;
  9829. /**
  9830. * Computes the maximum scale assuming the matrix is an affine transformation.
  9831. * The maximum scale is the maximum length of the column vectors.
  9832. * @param matrix - The matrix.
  9833. * @returns The maximum scale.
  9834. */
  9835. static getMaximumScale(matrix: Matrix3): number;
  9836. /**
  9837. * Computes the product of two matrices.
  9838. * @param left - The first matrix.
  9839. * @param right - The second matrix.
  9840. * @param result - The object onto which to store the result.
  9841. * @returns The modified result parameter.
  9842. */
  9843. static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9844. /**
  9845. * Computes the sum of two matrices.
  9846. * @param left - The first matrix.
  9847. * @param right - The second matrix.
  9848. * @param result - The object onto which to store the result.
  9849. * @returns The modified result parameter.
  9850. */
  9851. static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9852. /**
  9853. * Computes the difference of two matrices.
  9854. * @param left - The first matrix.
  9855. * @param right - The second matrix.
  9856. * @param result - The object onto which to store the result.
  9857. * @returns The modified result parameter.
  9858. */
  9859. static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  9860. /**
  9861. * Computes the product of a matrix and a column vector.
  9862. * @param matrix - The matrix.
  9863. * @param cartesian - The column.
  9864. * @param result - The object onto which to store the result.
  9865. * @returns The modified result parameter.
  9866. */
  9867. static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  9868. /**
  9869. * Computes the product of a matrix and a scalar.
  9870. * @param matrix - The matrix.
  9871. * @param scalar - The number to multiply by.
  9872. * @param result - The object onto which to store the result.
  9873. * @returns The modified result parameter.
  9874. */
  9875. static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3;
  9876. /**
  9877. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9878. * @example
  9879. * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);
  9880. * Cesium.Matrix3.multiplyByScale(m, scale, m);
  9881. * @param matrix - The matrix on the left-hand side.
  9882. * @param scale - The non-uniform scale on the right-hand side.
  9883. * @param result - The object onto which to store the result.
  9884. * @returns The modified result parameter.
  9885. */
  9886. static multiplyByScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3;
  9887. /**
  9888. * Creates a negated copy of the provided matrix.
  9889. * @param matrix - The matrix to negate.
  9890. * @param result - The object onto which to store the result.
  9891. * @returns The modified result parameter.
  9892. */
  9893. static negate(matrix: Matrix3, result: Matrix3): Matrix3;
  9894. /**
  9895. * Computes the transpose of the provided matrix.
  9896. * @param matrix - The matrix to transpose.
  9897. * @param result - The object onto which to store the result.
  9898. * @returns The modified result parameter.
  9899. */
  9900. static transpose(matrix: Matrix3, result: Matrix3): Matrix3;
  9901. /**
  9902. * Extracts the rotation assuming the matrix is an affine transformation.
  9903. * @param matrix - The matrix.
  9904. * @param result - The object onto which to store the result.
  9905. * @returns The modified result parameter
  9906. */
  9907. static getRotation(matrix: Matrix3, result: Matrix3): Matrix3;
  9908. /**
  9909. * Computes the eigenvectors and eigenvalues of a symmetric matrix.
  9910. * <p>
  9911. * Returns a diagonal matrix and unitary matrix such that:
  9912. * <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>
  9913. * </p>
  9914. * <p>
  9915. * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
  9916. * of the unitary matrix are the corresponding eigenvectors.
  9917. * </p>
  9918. * @example
  9919. * var a = //... symetric matrix
  9920. * var result = {
  9921. * unitary : new Cesium.Matrix3(),
  9922. * diagonal : new Cesium.Matrix3()
  9923. * };
  9924. * Cesium.Matrix3.computeEigenDecomposition(a, result);
  9925. *
  9926. * var unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());
  9927. * var b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());
  9928. * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
  9929. *
  9930. * var lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue
  9931. * var v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector
  9932. * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)
  9933. * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
  9934. * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result.
  9935. * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
  9936. */
  9937. static computeEigenDecomposition(matrix: Matrix3, result?: any): any;
  9938. /**
  9939. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9940. * @param matrix - The matrix with signed elements.
  9941. * @param result - The object onto which to store the result.
  9942. * @returns The modified result parameter.
  9943. */
  9944. static abs(matrix: Matrix3, result: Matrix3): Matrix3;
  9945. /**
  9946. * Computes the determinant of the provided matrix.
  9947. * @param matrix - The matrix to use.
  9948. * @returns The value of the determinant of the matrix.
  9949. */
  9950. static determinant(matrix: Matrix3): number;
  9951. /**
  9952. * Computes the inverse of the provided matrix.
  9953. * @param matrix - The matrix to invert.
  9954. * @param result - The object onto which to store the result.
  9955. * @returns The modified result parameter.
  9956. */
  9957. static inverse(matrix: Matrix3, result: Matrix3): Matrix3;
  9958. /**
  9959. * Computes the inverse transpose of a matrix.
  9960. * @param matrix - The matrix to transpose and invert.
  9961. * @param result - The object onto which to store the result.
  9962. * @returns The modified result parameter.
  9963. */
  9964. static inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3;
  9965. /**
  9966. * Compares the provided matrices componentwise and returns
  9967. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9968. * @param [left] - The first matrix.
  9969. * @param [right] - The second matrix.
  9970. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9971. */
  9972. static equals(left?: Matrix3, right?: Matrix3): boolean;
  9973. /**
  9974. * Compares the provided matrices componentwise and returns
  9975. * <code>true</code> if they are within the provided epsilon,
  9976. * <code>false</code> otherwise.
  9977. * @param [left] - The first matrix.
  9978. * @param [right] - The second matrix.
  9979. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9980. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9981. */
  9982. static equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean;
  9983. /**
  9984. * An immutable Matrix3 instance initialized to the identity matrix.
  9985. */
  9986. static readonly IDENTITY: Matrix3;
  9987. /**
  9988. * An immutable Matrix3 instance initialized to the zero matrix.
  9989. */
  9990. static readonly ZERO: Matrix3;
  9991. /**
  9992. * The index into Matrix3 for column 0, row 0.
  9993. */
  9994. static readonly COLUMN0ROW0: number;
  9995. /**
  9996. * The index into Matrix3 for column 0, row 1.
  9997. */
  9998. static readonly COLUMN0ROW1: number;
  9999. /**
  10000. * The index into Matrix3 for column 0, row 2.
  10001. */
  10002. static readonly COLUMN0ROW2: number;
  10003. /**
  10004. * The index into Matrix3 for column 1, row 0.
  10005. */
  10006. static readonly COLUMN1ROW0: number;
  10007. /**
  10008. * The index into Matrix3 for column 1, row 1.
  10009. */
  10010. static readonly COLUMN1ROW1: number;
  10011. /**
  10012. * The index into Matrix3 for column 1, row 2.
  10013. */
  10014. static readonly COLUMN1ROW2: number;
  10015. /**
  10016. * The index into Matrix3 for column 2, row 0.
  10017. */
  10018. static readonly COLUMN2ROW0: number;
  10019. /**
  10020. * The index into Matrix3 for column 2, row 1.
  10021. */
  10022. static readonly COLUMN2ROW1: number;
  10023. /**
  10024. * The index into Matrix3 for column 2, row 2.
  10025. */
  10026. static readonly COLUMN2ROW2: number;
  10027. /**
  10028. * Gets the number of items in the collection.
  10029. */
  10030. length: number;
  10031. /**
  10032. * Duplicates the provided Matrix3 instance.
  10033. * @param [result] - The object onto which to store the result.
  10034. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  10035. */
  10036. clone(result?: Matrix3): Matrix3;
  10037. /**
  10038. * Compares this matrix to the provided matrix componentwise and returns
  10039. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10040. * @param [right] - The right hand side matrix.
  10041. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10042. */
  10043. equals(right?: Matrix3): boolean;
  10044. /**
  10045. * Compares this matrix to the provided matrix componentwise and returns
  10046. * <code>true</code> if they are within the provided epsilon,
  10047. * <code>false</code> otherwise.
  10048. * @param [right] - The right hand side matrix.
  10049. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10050. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10051. */
  10052. equalsEpsilon(right?: Matrix3, epsilon?: number): boolean;
  10053. /**
  10054. * Creates a string representing this Matrix with each row being
  10055. * on a separate line and in the format '(column0, column1, column2)'.
  10056. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
  10057. */
  10058. toString(): string;
  10059. }
  10060. export interface Matrix4 extends ArrayLike<number> {
  10061. }
  10062. /**
  10063. * A 4x4 matrix, indexable as a column-major order array.
  10064. * Constructor parameters are in row-major order for code readability.
  10065. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  10066. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  10067. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  10068. * @param [column3Row0 = 0.0] - The value for column 3, row 0.
  10069. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  10070. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  10071. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  10072. * @param [column3Row1 = 0.0] - The value for column 3, row 1.
  10073. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  10074. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  10075. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  10076. * @param [column3Row2 = 0.0] - The value for column 3, row 2.
  10077. * @param [column0Row3 = 0.0] - The value for column 0, row 3.
  10078. * @param [column1Row3 = 0.0] - The value for column 1, row 3.
  10079. * @param [column2Row3 = 0.0] - The value for column 2, row 3.
  10080. * @param [column3Row3 = 0.0] - The value for column 3, row 3.
  10081. */
  10082. export class Matrix4 implements ArrayLike<number> {
  10083. constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column3Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column3Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number, column3Row2?: number, column0Row3?: number, column1Row3?: number, column2Row3?: number, column3Row3?: number);
  10084. /**
  10085. * The number of elements used to pack the object into an array.
  10086. */
  10087. static packedLength: number;
  10088. /**
  10089. * Stores the provided instance into the provided array.
  10090. * @param value - The value to pack.
  10091. * @param array - The array to pack into.
  10092. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10093. * @returns The array that was packed into
  10094. */
  10095. static pack(value: Matrix4, array: number[], startingIndex?: number): number[];
  10096. /**
  10097. * Retrieves an instance from a packed array.
  10098. * @param array - The packed array.
  10099. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10100. * @param [result] - The object into which to store the result.
  10101. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10102. */
  10103. static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10104. /**
  10105. * Duplicates a Matrix4 instance.
  10106. * @param matrix - The matrix to duplicate.
  10107. * @param [result] - The object onto which to store the result.
  10108. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
  10109. */
  10110. static clone(matrix: Matrix4, result?: Matrix4): Matrix4;
  10111. /**
  10112. * Creates a Matrix4 from 16 consecutive elements in an array.
  10113. * @example
  10114. * // Create the Matrix4:
  10115. * // [1.0, 2.0, 3.0, 4.0]
  10116. * // [1.0, 2.0, 3.0, 4.0]
  10117. * // [1.0, 2.0, 3.0, 4.0]
  10118. * // [1.0, 2.0, 3.0, 4.0]
  10119. *
  10120. * var v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
  10121. * var m = Cesium.Matrix4.fromArray(v);
  10122. *
  10123. * // Create same Matrix4 with using an offset into an array
  10124. * var v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
  10125. * var m2 = Cesium.Matrix4.fromArray(v2, 2);
  10126. * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  10127. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  10128. * @param [result] - The object onto which to store the result.
  10129. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10130. */
  10131. static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10132. /**
  10133. * Computes a Matrix4 instance from a column-major order array.
  10134. * @param values - The column-major order array.
  10135. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10136. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10137. */
  10138. static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4;
  10139. /**
  10140. * Computes a Matrix4 instance from a row-major order array.
  10141. * The resulting matrix will be in column-major order.
  10142. * @param values - The row-major order array.
  10143. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10144. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10145. */
  10146. static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4;
  10147. /**
  10148. * Computes a Matrix4 instance from a Matrix3 representing the rotation
  10149. * and a Cartesian3 representing the translation.
  10150. * @param rotation - The upper left portion of the matrix representing the rotation.
  10151. * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation.
  10152. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10153. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10154. */
  10155. static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4;
  10156. /**
  10157. * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
  10158. * representation with the rotation represented as a quaternion.
  10159. * @example
  10160. * var result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  10161. * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
  10162. * Cesium.Quaternion.IDENTITY, // rotation
  10163. * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
  10164. * result);
  10165. * @param translation - The translation transformation.
  10166. * @param rotation - The rotation transformation.
  10167. * @param scale - The non-uniform scale transformation.
  10168. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10169. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10170. */
  10171. static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4;
  10172. /**
  10173. * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
  10174. * @param translationRotationScale - The instance.
  10175. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10176. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10177. */
  10178. static fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4;
  10179. /**
  10180. * Creates a Matrix4 instance from a Cartesian3 representing the translation.
  10181. * @param translation - The upper right portion of the matrix representing the translation.
  10182. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10183. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10184. */
  10185. static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4;
  10186. /**
  10187. * Computes a Matrix4 instance representing a non-uniform scale.
  10188. * @example
  10189. * // Creates
  10190. * // [7.0, 0.0, 0.0, 0.0]
  10191. * // [0.0, 8.0, 0.0, 0.0]
  10192. * // [0.0, 0.0, 9.0, 0.0]
  10193. * // [0.0, 0.0, 0.0, 1.0]
  10194. * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  10195. * @param scale - The x, y, and z scale factors.
  10196. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10197. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10198. */
  10199. static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4;
  10200. /**
  10201. * Computes a Matrix4 instance representing a uniform scale.
  10202. * @example
  10203. * // Creates
  10204. * // [2.0, 0.0, 0.0, 0.0]
  10205. * // [0.0, 2.0, 0.0, 0.0]
  10206. * // [0.0, 0.0, 2.0, 0.0]
  10207. * // [0.0, 0.0, 0.0, 1.0]
  10208. * var m = Cesium.Matrix4.fromUniformScale(2.0);
  10209. * @param scale - The uniform scale factor.
  10210. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10211. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10212. */
  10213. static fromUniformScale(scale: number, result?: Matrix4): Matrix4;
  10214. /**
  10215. * Computes a Matrix4 instance from a Camera.
  10216. * @param camera - The camera to use.
  10217. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10218. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10219. */
  10220. static fromCamera(camera: Camera, result?: Matrix4): Matrix4;
  10221. /**
  10222. * Computes a Matrix4 instance representing a perspective transformation matrix.
  10223. * @param fovY - The field of view along the Y axis in radians.
  10224. * @param aspectRatio - The aspect ratio.
  10225. * @param near - The distance to the near plane in meters.
  10226. * @param far - The distance to the far plane in meters.
  10227. * @param result - The object in which the result will be stored.
  10228. * @returns The modified result parameter.
  10229. */
  10230. static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4;
  10231. /**
  10232. * Computes a Matrix4 instance representing an orthographic transformation matrix.
  10233. * @param left - The number of meters to the left of the camera that will be in view.
  10234. * @param right - The number of meters to the right of the camera that will be in view.
  10235. * @param bottom - The number of meters below of the camera that will be in view.
  10236. * @param top - The number of meters above of the camera that will be in view.
  10237. * @param near - The distance to the near plane in meters.
  10238. * @param far - The distance to the far plane in meters.
  10239. * @param result - The object in which the result will be stored.
  10240. * @returns The modified result parameter.
  10241. */
  10242. static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10243. /**
  10244. * Computes a Matrix4 instance representing an off center perspective transformation.
  10245. * @param left - The number of meters to the left of the camera that will be in view.
  10246. * @param right - The number of meters to the right of the camera that will be in view.
  10247. * @param bottom - The number of meters below of the camera that will be in view.
  10248. * @param top - The number of meters above of the camera that will be in view.
  10249. * @param near - The distance to the near plane in meters.
  10250. * @param far - The distance to the far plane in meters.
  10251. * @param result - The object in which the result will be stored.
  10252. * @returns The modified result parameter.
  10253. */
  10254. static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10255. /**
  10256. * Computes a Matrix4 instance representing an infinite off center perspective transformation.
  10257. * @param left - The number of meters to the left of the camera that will be in view.
  10258. * @param right - The number of meters to the right of the camera that will be in view.
  10259. * @param bottom - The number of meters below of the camera that will be in view.
  10260. * @param top - The number of meters above of the camera that will be in view.
  10261. * @param near - The distance to the near plane in meters.
  10262. * @param result - The object in which the result will be stored.
  10263. * @returns The modified result parameter.
  10264. */
  10265. static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4;
  10266. /**
  10267. * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
  10268. * @example
  10269. * // Create viewport transformation using an explicit viewport and depth range.
  10270. * var m = Cesium.Matrix4.computeViewportTransformation({
  10271. * x : 0.0,
  10272. * y : 0.0,
  10273. * width : 1024.0,
  10274. * height : 768.0
  10275. * }, 0.0, 1.0, new Cesium.Matrix4());
  10276. * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1.
  10277. * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates.
  10278. * @param [farDepthRange = 1.0] - The far plane distance in window coordinates.
  10279. * @param [result] - The object in which the result will be stored.
  10280. * @returns The modified result parameter.
  10281. */
  10282. static computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4;
  10283. /**
  10284. * Computes a Matrix4 instance that transforms from world space to view space.
  10285. * @param position - The position of the camera.
  10286. * @param direction - The forward direction.
  10287. * @param up - The up direction.
  10288. * @param right - The right direction.
  10289. * @param result - The object in which the result will be stored.
  10290. * @returns The modified result parameter.
  10291. */
  10292. static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4;
  10293. /**
  10294. * Computes an Array from the provided Matrix4 instance.
  10295. * The array will be in column-major order.
  10296. * @example
  10297. * //create an array from an instance of Matrix4
  10298. * // m = [10.0, 14.0, 18.0, 22.0]
  10299. * // [11.0, 15.0, 19.0, 23.0]
  10300. * // [12.0, 16.0, 20.0, 24.0]
  10301. * // [13.0, 17.0, 21.0, 25.0]
  10302. * var a = Cesium.Matrix4.toArray(m);
  10303. *
  10304. * // m remains the same
  10305. * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]
  10306. * @param matrix - The matrix to use..
  10307. * @param [result] - The Array onto which to store the result.
  10308. * @returns The modified Array parameter or a new Array instance if one was not provided.
  10309. */
  10310. static toArray(matrix: Matrix4, result?: number[]): number[];
  10311. /**
  10312. * Computes the array index of the element at the provided row and column.
  10313. * @example
  10314. * var myMatrix = new Cesium.Matrix4();
  10315. * var column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
  10316. * var column1Row0 = myMatrix[column1Row0Index];
  10317. * myMatrix[column1Row0Index] = 10.0;
  10318. * @param row - The zero-based index of the row.
  10319. * @param column - The zero-based index of the column.
  10320. * @returns The index of the element at the provided row and column.
  10321. */
  10322. static getElementIndex(row: number, column: number): number;
  10323. /**
  10324. * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
  10325. * @example
  10326. * //returns a Cartesian4 instance with values from the specified column
  10327. * // m = [10.0, 11.0, 12.0, 13.0]
  10328. * // [14.0, 15.0, 16.0, 17.0]
  10329. * // [18.0, 19.0, 20.0, 21.0]
  10330. * // [22.0, 23.0, 24.0, 25.0]
  10331. *
  10332. * //Example 1: Creates an instance of Cartesian
  10333. * var a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
  10334. * @example
  10335. * //Example 2: Sets values for Cartesian instance
  10336. * var a = new Cesium.Cartesian4();
  10337. * Cesium.Matrix4.getColumn(m, 2, a);
  10338. *
  10339. * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
  10340. * @param matrix - The matrix to use.
  10341. * @param index - The zero-based index of the column to retrieve.
  10342. * @param result - The object onto which to store the result.
  10343. * @returns The modified result parameter.
  10344. */
  10345. static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10346. /**
  10347. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
  10348. * @example
  10349. * //creates a new Matrix4 instance with new column values from the Cartesian4 instance
  10350. * // m = [10.0, 11.0, 12.0, 13.0]
  10351. * // [14.0, 15.0, 16.0, 17.0]
  10352. * // [18.0, 19.0, 20.0, 21.0]
  10353. * // [22.0, 23.0, 24.0, 25.0]
  10354. *
  10355. * var a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10356. *
  10357. * // m remains the same
  10358. * // a = [10.0, 11.0, 99.0, 13.0]
  10359. * // [14.0, 15.0, 98.0, 17.0]
  10360. * // [18.0, 19.0, 97.0, 21.0]
  10361. * // [22.0, 23.0, 96.0, 25.0]
  10362. * @param matrix - The matrix to use.
  10363. * @param index - The zero-based index of the column to set.
  10364. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  10365. * @param result - The object onto which to store the result.
  10366. * @returns The modified result parameter.
  10367. */
  10368. static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10369. /**
  10370. * Computes a new matrix that replaces the translation in the rightmost column of the provided
  10371. * matrix with the provided translation. This assumes the matrix is an affine transformation.
  10372. * @param matrix - The matrix to use.
  10373. * @param translation - The translation that replaces the translation of the provided matrix.
  10374. * @param result - The object onto which to store the result.
  10375. * @returns The modified result parameter.
  10376. */
  10377. static setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10378. /**
  10379. * Computes a new matrix that replaces the scale with the provided scale.
  10380. * This assumes the matrix is an affine transformation.
  10381. * @param matrix - The matrix to use.
  10382. * @param scale - The scale that replaces the scale of the provided matrix.
  10383. * @param result - The object onto which to store the result.
  10384. * @returns The modified result parameter.
  10385. */
  10386. static setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10387. /**
  10388. * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
  10389. * @example
  10390. * //returns a Cartesian4 instance with values from the specified column
  10391. * // m = [10.0, 11.0, 12.0, 13.0]
  10392. * // [14.0, 15.0, 16.0, 17.0]
  10393. * // [18.0, 19.0, 20.0, 21.0]
  10394. * // [22.0, 23.0, 24.0, 25.0]
  10395. *
  10396. * //Example 1: Returns an instance of Cartesian
  10397. * var a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
  10398. * @example
  10399. * //Example 2: Sets values for a Cartesian instance
  10400. * var a = new Cesium.Cartesian4();
  10401. * Cesium.Matrix4.getRow(m, 2, a);
  10402. *
  10403. * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
  10404. * @param matrix - The matrix to use.
  10405. * @param index - The zero-based index of the row to retrieve.
  10406. * @param result - The object onto which to store the result.
  10407. * @returns The modified result parameter.
  10408. */
  10409. static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10410. /**
  10411. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
  10412. * @example
  10413. * //create a new Matrix4 instance with new row values from the Cartesian4 instance
  10414. * // m = [10.0, 11.0, 12.0, 13.0]
  10415. * // [14.0, 15.0, 16.0, 17.0]
  10416. * // [18.0, 19.0, 20.0, 21.0]
  10417. * // [22.0, 23.0, 24.0, 25.0]
  10418. *
  10419. * var a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10420. *
  10421. * // m remains the same
  10422. * // a = [10.0, 11.0, 12.0, 13.0]
  10423. * // [14.0, 15.0, 16.0, 17.0]
  10424. * // [99.0, 98.0, 97.0, 96.0]
  10425. * // [22.0, 23.0, 24.0, 25.0]
  10426. * @param matrix - The matrix to use.
  10427. * @param index - The zero-based index of the row to set.
  10428. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  10429. * @param result - The object onto which to store the result.
  10430. * @returns The modified result parameter.
  10431. */
  10432. static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10433. /**
  10434. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  10435. * @param matrix - The matrix.
  10436. * @param result - The object onto which to store the result.
  10437. * @returns The modified result parameter
  10438. */
  10439. static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10440. /**
  10441. * Computes the maximum scale assuming the matrix is an affine transformation.
  10442. * The maximum scale is the maximum length of the column vectors in the upper-left
  10443. * 3x3 matrix.
  10444. * @param matrix - The matrix.
  10445. * @returns The maximum scale.
  10446. */
  10447. static getMaximumScale(matrix: Matrix4): number;
  10448. /**
  10449. * Computes the product of two matrices.
  10450. * @param left - The first matrix.
  10451. * @param right - The second matrix.
  10452. * @param result - The object onto which to store the result.
  10453. * @returns The modified result parameter.
  10454. */
  10455. static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10456. /**
  10457. * Computes the sum of two matrices.
  10458. * @param left - The first matrix.
  10459. * @param right - The second matrix.
  10460. * @param result - The object onto which to store the result.
  10461. * @returns The modified result parameter.
  10462. */
  10463. static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10464. /**
  10465. * Computes the difference of two matrices.
  10466. * @param left - The first matrix.
  10467. * @param right - The second matrix.
  10468. * @param result - The object onto which to store the result.
  10469. * @returns The modified result parameter.
  10470. */
  10471. static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10472. /**
  10473. * Computes the product of two matrices assuming the matrices are affine transformation matrices,
  10474. * where the upper left 3x3 elements are any matrix, and
  10475. * the upper three elements in the fourth column are the translation.
  10476. * The bottom row is assumed to be [0, 0, 0, 1].
  10477. * The matrix is not verified to be in the proper form.
  10478. * This method is faster than computing the product for general 4x4
  10479. * matrices using {@link Matrix4.multiply}.
  10480. * @example
  10481. * var m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);
  10482. * var m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
  10483. * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
  10484. * @param left - The first matrix.
  10485. * @param right - The second matrix.
  10486. * @param result - The object onto which to store the result.
  10487. * @returns The modified result parameter.
  10488. */
  10489. static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10490. /**
  10491. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10492. * by a 3x3 rotation matrix. This is an optimization
  10493. * for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.
  10494. * @example
  10495. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
  10496. * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
  10497. * @param matrix - The matrix on the left-hand side.
  10498. * @param rotation - The 3x3 rotation matrix on the right-hand side.
  10499. * @param result - The object onto which to store the result.
  10500. * @returns The modified result parameter.
  10501. */
  10502. static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4;
  10503. /**
  10504. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10505. * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
  10506. * for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.
  10507. * @example
  10508. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
  10509. * Cesium.Matrix4.multiplyByTranslation(m, position, m);
  10510. * @param matrix - The matrix on the left-hand side.
  10511. * @param translation - The translation on the right-hand side.
  10512. * @param result - The object onto which to store the result.
  10513. * @returns The modified result parameter.
  10514. */
  10515. static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10516. /**
  10517. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10518. * by an implicit uniform scale matrix. This is an optimization
  10519. * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10520. * <code>m</code> must be an affine matrix.
  10521. * This function performs fewer allocations and arithmetic operations.
  10522. * @example
  10523. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
  10524. * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
  10525. * @param matrix - The affine matrix on the left-hand side.
  10526. * @param scale - The uniform scale on the right-hand side.
  10527. * @param result - The object onto which to store the result.
  10528. * @returns The modified result parameter.
  10529. */
  10530. static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  10531. /**
  10532. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10533. * by an implicit non-uniform scale matrix. This is an optimization
  10534. * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10535. * <code>m</code> must be an affine matrix.
  10536. * This function performs fewer allocations and arithmetic operations.
  10537. * @example
  10538. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
  10539. * Cesium.Matrix4.multiplyByScale(m, scale, m);
  10540. * @param matrix - The affine matrix on the left-hand side.
  10541. * @param scale - The non-uniform scale on the right-hand side.
  10542. * @param result - The object onto which to store the result.
  10543. * @returns The modified result parameter.
  10544. */
  10545. static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10546. /**
  10547. * Computes the product of a matrix and a column vector.
  10548. * @param matrix - The matrix.
  10549. * @param cartesian - The vector.
  10550. * @param result - The object onto which to store the result.
  10551. * @returns The modified result parameter.
  10552. */
  10553. static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  10554. /**
  10555. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10556. * with a {@link Cartesian4} with a <code>w</code> component of zero.
  10557. * @example
  10558. * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10559. * var result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
  10560. * // A shortcut for
  10561. * // Cartesian3 p = ...
  10562. * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
  10563. * @param matrix - The matrix.
  10564. * @param cartesian - The point.
  10565. * @param result - The object onto which to store the result.
  10566. * @returns The modified result parameter.
  10567. */
  10568. static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10569. /**
  10570. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10571. * with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
  10572. * @example
  10573. * var p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10574. * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
  10575. * @param matrix - The matrix.
  10576. * @param cartesian - The point.
  10577. * @param result - The object onto which to store the result.
  10578. * @returns The modified result parameter.
  10579. */
  10580. static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10581. /**
  10582. * Computes the product of a matrix and a scalar.
  10583. * @example
  10584. * //create a Matrix4 instance which is a scaled version of the supplied Matrix4
  10585. * // m = [10.0, 11.0, 12.0, 13.0]
  10586. * // [14.0, 15.0, 16.0, 17.0]
  10587. * // [18.0, 19.0, 20.0, 21.0]
  10588. * // [22.0, 23.0, 24.0, 25.0]
  10589. *
  10590. * var a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
  10591. *
  10592. * // m remains the same
  10593. * // a = [-20.0, -22.0, -24.0, -26.0]
  10594. * // [-28.0, -30.0, -32.0, -34.0]
  10595. * // [-36.0, -38.0, -40.0, -42.0]
  10596. * // [-44.0, -46.0, -48.0, -50.0]
  10597. * @param matrix - The matrix.
  10598. * @param scalar - The number to multiply by.
  10599. * @param result - The object onto which to store the result.
  10600. * @returns The modified result parameter.
  10601. */
  10602. static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4;
  10603. /**
  10604. * Computes a negated copy of the provided matrix.
  10605. * @example
  10606. * //create a new Matrix4 instance which is a negation of a Matrix4
  10607. * // m = [10.0, 11.0, 12.0, 13.0]
  10608. * // [14.0, 15.0, 16.0, 17.0]
  10609. * // [18.0, 19.0, 20.0, 21.0]
  10610. * // [22.0, 23.0, 24.0, 25.0]
  10611. *
  10612. * var a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
  10613. *
  10614. * // m remains the same
  10615. * // a = [-10.0, -11.0, -12.0, -13.0]
  10616. * // [-14.0, -15.0, -16.0, -17.0]
  10617. * // [-18.0, -19.0, -20.0, -21.0]
  10618. * // [-22.0, -23.0, -24.0, -25.0]
  10619. * @param matrix - The matrix to negate.
  10620. * @param result - The object onto which to store the result.
  10621. * @returns The modified result parameter.
  10622. */
  10623. static negate(matrix: Matrix4, result: Matrix4): Matrix4;
  10624. /**
  10625. * Computes the transpose of the provided matrix.
  10626. * @example
  10627. * //returns transpose of a Matrix4
  10628. * // m = [10.0, 11.0, 12.0, 13.0]
  10629. * // [14.0, 15.0, 16.0, 17.0]
  10630. * // [18.0, 19.0, 20.0, 21.0]
  10631. * // [22.0, 23.0, 24.0, 25.0]
  10632. *
  10633. * var a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
  10634. *
  10635. * // m remains the same
  10636. * // a = [10.0, 14.0, 18.0, 22.0]
  10637. * // [11.0, 15.0, 19.0, 23.0]
  10638. * // [12.0, 16.0, 20.0, 24.0]
  10639. * // [13.0, 17.0, 21.0, 25.0]
  10640. * @param matrix - The matrix to transpose.
  10641. * @param result - The object onto which to store the result.
  10642. * @returns The modified result parameter.
  10643. */
  10644. static transpose(matrix: Matrix4, result: Matrix4): Matrix4;
  10645. /**
  10646. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10647. * @param matrix - The matrix with signed elements.
  10648. * @param result - The object onto which to store the result.
  10649. * @returns The modified result parameter.
  10650. */
  10651. static abs(matrix: Matrix4, result: Matrix4): Matrix4;
  10652. /**
  10653. * Compares the provided matrices componentwise and returns
  10654. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10655. * @example
  10656. * //compares two Matrix4 instances
  10657. *
  10658. * // a = [10.0, 14.0, 18.0, 22.0]
  10659. * // [11.0, 15.0, 19.0, 23.0]
  10660. * // [12.0, 16.0, 20.0, 24.0]
  10661. * // [13.0, 17.0, 21.0, 25.0]
  10662. *
  10663. * // b = [10.0, 14.0, 18.0, 22.0]
  10664. * // [11.0, 15.0, 19.0, 23.0]
  10665. * // [12.0, 16.0, 20.0, 24.0]
  10666. * // [13.0, 17.0, 21.0, 25.0]
  10667. *
  10668. * if(Cesium.Matrix4.equals(a,b)) {
  10669. * console.log("Both matrices are equal");
  10670. * } else {
  10671. * console.log("They are not equal");
  10672. * }
  10673. *
  10674. * //Prints "Both matrices are equal" on the console
  10675. * @param [left] - The first matrix.
  10676. * @param [right] - The second matrix.
  10677. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10678. */
  10679. static equals(left?: Matrix4, right?: Matrix4): boolean;
  10680. /**
  10681. * Compares the provided matrices componentwise and returns
  10682. * <code>true</code> if they are within the provided epsilon,
  10683. * <code>false</code> otherwise.
  10684. * @example
  10685. * //compares two Matrix4 instances
  10686. *
  10687. * // a = [10.5, 14.5, 18.5, 22.5]
  10688. * // [11.5, 15.5, 19.5, 23.5]
  10689. * // [12.5, 16.5, 20.5, 24.5]
  10690. * // [13.5, 17.5, 21.5, 25.5]
  10691. *
  10692. * // b = [10.0, 14.0, 18.0, 22.0]
  10693. * // [11.0, 15.0, 19.0, 23.0]
  10694. * // [12.0, 16.0, 20.0, 24.0]
  10695. * // [13.0, 17.0, 21.0, 25.0]
  10696. *
  10697. * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
  10698. * console.log("Difference between both the matrices is less than 0.1");
  10699. * } else {
  10700. * console.log("Difference between both the matrices is not less than 0.1");
  10701. * }
  10702. *
  10703. * //Prints "Difference between both the matrices is not less than 0.1" on the console
  10704. * @param [left] - The first matrix.
  10705. * @param [right] - The second matrix.
  10706. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10707. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10708. */
  10709. static equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean;
  10710. /**
  10711. * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.
  10712. * @param matrix - The matrix to use.
  10713. * @param result - The object onto which to store the result.
  10714. * @returns The modified result parameter.
  10715. */
  10716. static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10717. /**
  10718. * Gets the upper left 3x3 matrix of the provided matrix.
  10719. * @example
  10720. * // returns a Matrix3 instance from a Matrix4 instance
  10721. *
  10722. * // m = [10.0, 14.0, 18.0, 22.0]
  10723. * // [11.0, 15.0, 19.0, 23.0]
  10724. * // [12.0, 16.0, 20.0, 24.0]
  10725. * // [13.0, 17.0, 21.0, 25.0]
  10726. *
  10727. * var b = new Cesium.Matrix3();
  10728. * Cesium.Matrix4.getMatrix3(m,b);
  10729. *
  10730. * // b = [10.0, 14.0, 18.0]
  10731. * // [11.0, 15.0, 19.0]
  10732. * // [12.0, 16.0, 20.0]
  10733. * @param matrix - The matrix to use.
  10734. * @param result - The object onto which to store the result.
  10735. * @returns The modified result parameter.
  10736. */
  10737. static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3;
  10738. /**
  10739. * Computes the inverse of the provided matrix using Cramers Rule.
  10740. * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
  10741. * If the matrix is a proper rigid transformation, it is more efficient
  10742. * to invert it with {@link Matrix4.inverseTransformation}.
  10743. * @param matrix - The matrix to invert.
  10744. * @param result - The object onto which to store the result.
  10745. * @returns The modified result parameter.
  10746. */
  10747. static inverse(matrix: Matrix4, result: Matrix4): Matrix4;
  10748. /**
  10749. * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,
  10750. * where the upper left 3x3 elements are a rotation matrix,
  10751. * and the upper three elements in the fourth column are the translation.
  10752. * The bottom row is assumed to be [0, 0, 0, 1].
  10753. * The matrix is not verified to be in the proper form.
  10754. * This method is faster than computing the inverse for a general 4x4
  10755. * matrix using {@link Matrix4.inverse}.
  10756. * @param matrix - The matrix to invert.
  10757. * @param result - The object onto which to store the result.
  10758. * @returns The modified result parameter.
  10759. */
  10760. static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4;
  10761. /**
  10762. * Computes the inverse transpose of a matrix.
  10763. * @param matrix - The matrix to transpose and invert.
  10764. * @param result - The object onto which to store the result.
  10765. * @returns The modified result parameter.
  10766. */
  10767. static inverseTranspose(matrix: Matrix4, result: Matrix4): Matrix4;
  10768. /**
  10769. * An immutable Matrix4 instance initialized to the identity matrix.
  10770. */
  10771. static readonly IDENTITY: Matrix4;
  10772. /**
  10773. * An immutable Matrix4 instance initialized to the zero matrix.
  10774. */
  10775. static readonly ZERO: Matrix4;
  10776. /**
  10777. * The index into Matrix4 for column 0, row 0.
  10778. */
  10779. static readonly COLUMN0ROW0: number;
  10780. /**
  10781. * The index into Matrix4 for column 0, row 1.
  10782. */
  10783. static readonly COLUMN0ROW1: number;
  10784. /**
  10785. * The index into Matrix4 for column 0, row 2.
  10786. */
  10787. static readonly COLUMN0ROW2: number;
  10788. /**
  10789. * The index into Matrix4 for column 0, row 3.
  10790. */
  10791. static readonly COLUMN0ROW3: number;
  10792. /**
  10793. * The index into Matrix4 for column 1, row 0.
  10794. */
  10795. static readonly COLUMN1ROW0: number;
  10796. /**
  10797. * The index into Matrix4 for column 1, row 1.
  10798. */
  10799. static readonly COLUMN1ROW1: number;
  10800. /**
  10801. * The index into Matrix4 for column 1, row 2.
  10802. */
  10803. static readonly COLUMN1ROW2: number;
  10804. /**
  10805. * The index into Matrix4 for column 1, row 3.
  10806. */
  10807. static readonly COLUMN1ROW3: number;
  10808. /**
  10809. * The index into Matrix4 for column 2, row 0.
  10810. */
  10811. static readonly COLUMN2ROW0: number;
  10812. /**
  10813. * The index into Matrix4 for column 2, row 1.
  10814. */
  10815. static readonly COLUMN2ROW1: number;
  10816. /**
  10817. * The index into Matrix4 for column 2, row 2.
  10818. */
  10819. static readonly COLUMN2ROW2: number;
  10820. /**
  10821. * The index into Matrix4 for column 2, row 3.
  10822. */
  10823. static readonly COLUMN2ROW3: number;
  10824. /**
  10825. * The index into Matrix4 for column 3, row 0.
  10826. */
  10827. static readonly COLUMN3ROW0: number;
  10828. /**
  10829. * The index into Matrix4 for column 3, row 1.
  10830. */
  10831. static readonly COLUMN3ROW1: number;
  10832. /**
  10833. * The index into Matrix4 for column 3, row 2.
  10834. */
  10835. static readonly COLUMN3ROW2: number;
  10836. /**
  10837. * The index into Matrix4 for column 3, row 3.
  10838. */
  10839. static readonly COLUMN3ROW3: number;
  10840. /**
  10841. * Gets the number of items in the collection.
  10842. */
  10843. length: number;
  10844. /**
  10845. * Duplicates the provided Matrix4 instance.
  10846. * @param [result] - The object onto which to store the result.
  10847. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10848. */
  10849. clone(result?: Matrix4): Matrix4;
  10850. /**
  10851. * Compares this matrix to the provided matrix componentwise and returns
  10852. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10853. * @param [right] - The right hand side matrix.
  10854. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10855. */
  10856. equals(right?: Matrix4): boolean;
  10857. /**
  10858. * Compares this matrix to the provided matrix componentwise and returns
  10859. * <code>true</code> if they are within the provided epsilon,
  10860. * <code>false</code> otherwise.
  10861. * @param [right] - The right hand side matrix.
  10862. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10863. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10864. */
  10865. equalsEpsilon(right?: Matrix4, epsilon?: number): boolean;
  10866. /**
  10867. * Computes a string representing this Matrix with each row being
  10868. * on a separate line and in the format '(column0, column1, column2, column3)'.
  10869. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
  10870. */
  10871. toString(): string;
  10872. }
  10873. /**
  10874. * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
  10875. * @param [near = 0.0] - The lower bound of the camera range.
  10876. * @param [nearValue = 0.0] - The value at the lower bound of the camera range.
  10877. * @param [far = 1.0] - The upper bound of the camera range.
  10878. * @param [farValue = 0.0] - The value at the upper bound of the camera range.
  10879. */
  10880. export class NearFarScalar {
  10881. constructor(near?: number, nearValue?: number, far?: number, farValue?: number);
  10882. /**
  10883. * The lower bound of the camera range.
  10884. */
  10885. near: number;
  10886. /**
  10887. * The value at the lower bound of the camera range.
  10888. */
  10889. nearValue: number;
  10890. /**
  10891. * The upper bound of the camera range.
  10892. */
  10893. far: number;
  10894. /**
  10895. * The value at the upper bound of the camera range.
  10896. */
  10897. farValue: number;
  10898. /**
  10899. * Duplicates a NearFarScalar instance.
  10900. * @param nearFarScalar - The NearFarScalar to duplicate.
  10901. * @param [result] - The object onto which to store the result.
  10902. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)
  10903. */
  10904. static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar;
  10905. /**
  10906. * The number of elements used to pack the object into an array.
  10907. */
  10908. static packedLength: number;
  10909. /**
  10910. * Stores the provided instance into the provided array.
  10911. * @param value - The value to pack.
  10912. * @param array - The array to pack into.
  10913. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10914. * @returns The array that was packed into
  10915. */
  10916. static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[];
  10917. /**
  10918. * Retrieves an instance from a packed array.
  10919. * @param array - The packed array.
  10920. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10921. * @param [result] - The object into which to store the result.
  10922. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  10923. */
  10924. static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar;
  10925. /**
  10926. * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,
  10927. * <code>false</code> otherwise.
  10928. * @param [left] - The first NearFarScalar.
  10929. * @param [right] - The second NearFarScalar.
  10930. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  10931. */
  10932. static equals(left?: NearFarScalar, right?: NearFarScalar): boolean;
  10933. /**
  10934. * Duplicates this instance.
  10935. * @param [result] - The object onto which to store the result.
  10936. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  10937. */
  10938. clone(result?: NearFarScalar): NearFarScalar;
  10939. /**
  10940. * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,
  10941. * <code>false</code> otherwise.
  10942. * @param [right] - The right hand side NearFarScalar.
  10943. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  10944. */
  10945. equals(right?: NearFarScalar): boolean;
  10946. }
  10947. /**
  10948. * Creates an Occluder derived from an object's position and radius, as well as the camera position.
  10949. * The occluder can be used to determine whether or not other objects are visible or hidden behind the
  10950. * visible horizon defined by the occluder and camera position.
  10951. * @example
  10952. * // Construct an occluder one unit away from the origin with a radius of one.
  10953. * var cameraPosition = Cesium.Cartesian3.ZERO;
  10954. * var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);
  10955. * var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  10956. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10957. * @param cameraPosition - The coordinate of the viewer/camera.
  10958. */
  10959. export class Occluder {
  10960. constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3);
  10961. /**
  10962. * The position of the occluder.
  10963. */
  10964. position: Cartesian3;
  10965. /**
  10966. * The radius of the occluder.
  10967. */
  10968. radius: number;
  10969. /**
  10970. * The position of the camera.
  10971. */
  10972. cameraPosition: Cartesian3;
  10973. /**
  10974. * Creates an occluder from a bounding sphere and the camera position.
  10975. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  10976. * @param cameraPosition - The coordinate of the viewer/camera.
  10977. * @param [result] - The object onto which to store the result.
  10978. * @returns The occluder derived from an object's position and radius, as well as the camera position.
  10979. */
  10980. static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder;
  10981. /**
  10982. * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
  10983. * @example
  10984. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  10985. * var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  10986. * var occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  10987. * var point = new Cesium.Cartesian3(0, 0, -3);
  10988. * occluder.isPointVisible(point); //returns true
  10989. * @param occludee - The point surrounding the occludee object.
  10990. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  10991. */
  10992. isPointVisible(occludee: Cartesian3): boolean;
  10993. /**
  10994. * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.
  10995. * @example
  10996. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  10997. * var littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  10998. * var occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  10999. * var bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);
  11000. * occluder.isBoundingSphereVisible(bigSphere); //returns true
  11001. * @param occludee - The bounding sphere surrounding the occludee object.
  11002. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  11003. */
  11004. isBoundingSphereVisible(occludee: BoundingSphere): boolean;
  11005. /**
  11006. * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
  11007. * @example
  11008. * var sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);
  11009. * var sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);
  11010. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11011. * var occluder = new Cesium.Occluder(sphere1, cameraPosition);
  11012. * occluder.computeVisibility(sphere2); //returns Visibility.NONE
  11013. * @param occludeeBS - The bounding sphere of the occludee.
  11014. * @returns Visibility.NONE if the occludee is not visible,
  11015. * Visibility.PARTIAL if the occludee is partially visible, or
  11016. * Visibility.FULL if the occludee is fully visible.
  11017. */
  11018. computeVisibility(occludeeBS: BoundingSphere): Visibility;
  11019. /**
  11020. * Computes a point that can be used as the occludee position to the visibility functions.
  11021. * Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around
  11022. * an object that is used for visibility; however it is also possible to compute a point that if
  11023. * seen/not seen would also indicate if an object is visible/not visible. This function is better
  11024. * called for objects that do not move relative to the occluder and is large, such as a chunk of
  11025. * terrain. You are better off not calling this and using the object's bounding sphere for objects
  11026. * such as a satellite or ground vehicle.
  11027. * @example
  11028. * var cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11029. * var occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);
  11030. * var occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  11031. * var positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];
  11032. * var tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);
  11033. * var occludeePosition = tileOccluderSphere.center;
  11034. * var occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
  11035. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11036. * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located.
  11037. * @param positions - List of altitude points on the horizon near the surface of the occluder.
  11038. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11039. * which is a boolean value.
  11040. */
  11041. static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any;
  11042. /**
  11043. * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.
  11044. * @param rectangle - The rectangle used to create a bounding sphere.
  11045. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  11046. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11047. * which is a boolean value.
  11048. */
  11049. static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any;
  11050. }
  11051. /**
  11052. * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.
  11053. * @example
  11054. * // Configure a Viewer to use the OpenCage Geocoder
  11055. * var viewer = new Cesium.Viewer('cesiumContainer', {
  11056. * geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
  11057. * });
  11058. * @param url - The endpoint to the OpenCage server.
  11059. * @param apiKey - The OpenCage API Key.
  11060. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt):
  11061. * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return.
  11062. * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging.
  11063. * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in.
  11064. * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).
  11065. * @param [options.jsonp] - Wraps the returned JSON with a function name.
  11066. * @param [options.language] - An IETF format language code.
  11067. * @param [options.limit] - The maximum number of results we should return.
  11068. * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned.
  11069. * @param [options.no_annotations] - When set to 1 results will not contain annotations.
  11070. * @param [options.no_dedupe] - When set to 1 results will not be deduplicated.
  11071. * @param [options.no_record] - When set to 1 the query contents are not logged.
  11072. * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.
  11073. * @param [options.proximity] - Provides the geocoder with a hint to bias results in favour of those closer to the specified location (For example: 41.40139,2.12870).
  11074. */
  11075. export class OpenCageGeocoderService {
  11076. constructor(url: Resource | string, apiKey: string, params?: {
  11077. abbrv?: number;
  11078. });
  11079. /**
  11080. * The Resource used to access the OpenCage endpoint.
  11081. */
  11082. readonly url: Resource;
  11083. /**
  11084. * Optional params passed to OpenCage in order to customize geocoding
  11085. */
  11086. readonly params: any;
  11087. /**
  11088. * @param query - The query to be sent to the geocoder service
  11089. */
  11090. geocode(query: string): Promise<GeocoderService.Result[]>;
  11091. }
  11092. /**
  11093. * Creates an instance of an OrientedBoundingBox.
  11094. * An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases.
  11095. * @example
  11096. * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
  11097. * var center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
  11098. * var halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
  11099. *
  11100. * var obb = new Cesium.OrientedBoundingBox(center, halfAxes);
  11101. * @param [center = Cartesian3.ZERO] - The center of the box.
  11102. * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box.
  11103. * Equivalently, the transformation matrix, to rotate and scale a 0x0x0
  11104. * cube centered at the origin.
  11105. */
  11106. export class OrientedBoundingBox {
  11107. constructor(center?: Cartesian3, halfAxes?: Matrix3);
  11108. /**
  11109. * The center of the box.
  11110. */
  11111. center: Cartesian3;
  11112. /**
  11113. * The transformation matrix, to rotate the box to the right position.
  11114. */
  11115. halfAxes: Matrix3;
  11116. /**
  11117. * The number of elements used to pack the object into an array.
  11118. */
  11119. static packedLength: number;
  11120. /**
  11121. * Stores the provided instance into the provided array.
  11122. * @param value - The value to pack.
  11123. * @param array - The array to pack into.
  11124. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11125. * @returns The array that was packed into
  11126. */
  11127. static pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[];
  11128. /**
  11129. * Retrieves an instance from a packed array.
  11130. * @param array - The packed array.
  11131. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11132. * @param [result] - The object into which to store the result.
  11133. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11134. */
  11135. static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox;
  11136. /**
  11137. * Computes an instance of an OrientedBoundingBox of the given positions.
  11138. * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
  11139. * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
  11140. * @example
  11141. * // Compute an object oriented bounding box enclosing two points.
  11142. * var box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  11143. * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose.
  11144. * @param [result] - The object onto which to store the result.
  11145. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11146. */
  11147. static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox;
  11148. /**
  11149. * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
  11150. * There are no guarantees about the orientation of the bounding box.
  11151. * @param rectangle - The cartographic rectangle on the surface of the ellipsoid.
  11152. * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile.
  11153. * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile.
  11154. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined.
  11155. * @param [result] - The object onto which to store the result.
  11156. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  11157. */
  11158. static fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox;
  11159. /**
  11160. * Duplicates a OrientedBoundingBox instance.
  11161. * @param box - The bounding box to duplicate.
  11162. * @param [result] - The object onto which to store the result.
  11163. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  11164. */
  11165. static clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox;
  11166. /**
  11167. * Determines which side of a plane the oriented bounding box is located.
  11168. * @param box - The oriented bounding box to test.
  11169. * @param plane - The plane to test against.
  11170. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11171. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11172. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11173. * intersects the plane.
  11174. */
  11175. static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect;
  11176. /**
  11177. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11178. * @example
  11179. * // Sort bounding boxes from back to front
  11180. * boxes.sort(function(a, b) {
  11181. * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
  11182. * });
  11183. * @param box - The box.
  11184. * @param cartesian - The point
  11185. * @returns The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.
  11186. */
  11187. static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number;
  11188. /**
  11189. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11190. * <br>
  11191. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11192. * closest and farthest planes from position that intersect the bounding box.
  11193. * @param box - The bounding box to calculate the distance to.
  11194. * @param position - The position to calculate the distance from.
  11195. * @param direction - The direction from position.
  11196. * @param [result] - A Interval to store the nearest and farthest distances.
  11197. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11198. */
  11199. static computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11200. /**
  11201. * Determines whether or not a bounding box is hidden from view by the occluder.
  11202. * @param box - The bounding box surrounding the occludee object.
  11203. * @param occluder - The occluder.
  11204. * @returns <code>true</code> if the box is not visible; otherwise <code>false</code>.
  11205. */
  11206. static isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean;
  11207. /**
  11208. * Determines which side of a plane the oriented bounding box is located.
  11209. * @param plane - The plane to test against.
  11210. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11211. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11212. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11213. * intersects the plane.
  11214. */
  11215. intersectPlane(plane: Plane): Intersect;
  11216. /**
  11217. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11218. * @example
  11219. * // Sort bounding boxes from back to front
  11220. * boxes.sort(function(a, b) {
  11221. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  11222. * });
  11223. * @param cartesian - The point
  11224. * @returns The estimated distance squared from the bounding sphere to the point.
  11225. */
  11226. distanceSquaredTo(cartesian: Cartesian3): number;
  11227. /**
  11228. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11229. * <br>
  11230. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11231. * closest and farthest planes from position that intersect the bounding box.
  11232. * @param position - The position to calculate the distance from.
  11233. * @param direction - The direction from position.
  11234. * @param [result] - A Interval to store the nearest and farthest distances.
  11235. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11236. */
  11237. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11238. /**
  11239. * Determines whether or not a bounding box is hidden from view by the occluder.
  11240. * @param occluder - The occluder.
  11241. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  11242. */
  11243. isOccluded(occluder: Occluder): boolean;
  11244. /**
  11245. * Compares the provided OrientedBoundingBox componentwise and returns
  11246. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11247. * @param left - The first OrientedBoundingBox.
  11248. * @param right - The second OrientedBoundingBox.
  11249. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  11250. */
  11251. static equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean;
  11252. /**
  11253. * Duplicates this OrientedBoundingBox instance.
  11254. * @param [result] - The object onto which to store the result.
  11255. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11256. */
  11257. clone(result?: OrientedBoundingBox): OrientedBoundingBox;
  11258. /**
  11259. * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
  11260. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11261. * @param [right] - The right hand side OrientedBoundingBox.
  11262. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11263. */
  11264. equals(right?: OrientedBoundingBox): boolean;
  11265. }
  11266. /**
  11267. * The viewing frustum is defined by 6 planes.
  11268. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11269. * define the unit vector normal to the plane, and the w component is the distance of the
  11270. * plane from the origin/camera position.
  11271. * @example
  11272. * var maxRadii = ellipsoid.maximumRadius;
  11273. *
  11274. * var frustum = new Cesium.OrthographicFrustum();
  11275. * frustum.near = 0.01 * maxRadii;
  11276. * frustum.far = 50.0 * maxRadii;
  11277. * @param [options] - An object with the following properties:
  11278. * @param [options.width] - The width of the frustum in meters.
  11279. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11280. * @param [options.near = 1.0] - The distance of the near plane.
  11281. * @param [options.far = 500000000.0] - The distance of the far plane.
  11282. */
  11283. export class OrthographicFrustum {
  11284. constructor(options?: {
  11285. width?: number;
  11286. aspectRatio?: number;
  11287. near?: number;
  11288. far?: number;
  11289. });
  11290. /**
  11291. * The horizontal width of the frustum in meters.
  11292. */
  11293. width: number;
  11294. /**
  11295. * The aspect ratio of the frustum's width to it's height.
  11296. */
  11297. aspectRatio: number;
  11298. /**
  11299. * The distance of the near plane.
  11300. */
  11301. near: number;
  11302. /**
  11303. * The distance of the far plane.
  11304. */
  11305. far: number;
  11306. /**
  11307. * The number of elements used to pack the object into an array.
  11308. */
  11309. static packedLength: number;
  11310. /**
  11311. * Stores the provided instance into the provided array.
  11312. * @param value - The value to pack.
  11313. * @param array - The array to pack into.
  11314. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11315. * @returns The array that was packed into
  11316. */
  11317. static pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[];
  11318. /**
  11319. * Retrieves an instance from a packed array.
  11320. * @param array - The packed array.
  11321. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11322. * @param [result] - The object into which to store the result.
  11323. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11324. */
  11325. static unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum;
  11326. /**
  11327. * Gets the orthographic projection matrix computed from the view frustum.
  11328. */
  11329. readonly projectionMatrix: Matrix4;
  11330. /**
  11331. * Creates a culling volume for this frustum.
  11332. * @example
  11333. * // Check if a bounding volume intersects the frustum.
  11334. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11335. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11336. * @param position - The eye position.
  11337. * @param direction - The view direction.
  11338. * @param up - The up direction.
  11339. * @returns A culling volume at the given position and orientation.
  11340. */
  11341. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11342. /**
  11343. * Returns the pixel's width and height in meters.
  11344. * @example
  11345. * // Example 1
  11346. * // Get the width and height of a pixel.
  11347. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11348. * @param drawingBufferWidth - The width of the drawing buffer.
  11349. * @param drawingBufferHeight - The height of the drawing buffer.
  11350. * @param distance - The distance to the near plane in meters.
  11351. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11352. * @param result - The object onto which to store the result.
  11353. * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
  11354. */
  11355. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11356. /**
  11357. * Returns a duplicate of a OrthographicFrustum instance.
  11358. * @param [result] - The object onto which to store the result.
  11359. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11360. */
  11361. clone(result?: OrthographicFrustum): OrthographicFrustum;
  11362. /**
  11363. * Compares the provided OrthographicFrustum componentwise and returns
  11364. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11365. * @param [other] - The right hand side OrthographicFrustum.
  11366. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11367. */
  11368. equals(other?: OrthographicFrustum): boolean;
  11369. /**
  11370. * Compares the provided OrthographicFrustum componentwise and returns
  11371. * <code>true</code> if they pass an absolute or relative tolerance test,
  11372. * <code>false</code> otherwise.
  11373. * @param other - The right hand side OrthographicFrustum.
  11374. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11375. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11376. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11377. */
  11378. equalsEpsilon(other: OrthographicFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11379. }
  11380. /**
  11381. * The viewing frustum is defined by 6 planes.
  11382. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11383. * define the unit vector normal to the plane, and the w component is the distance of the
  11384. * plane from the origin/camera position.
  11385. * @example
  11386. * var maxRadii = ellipsoid.maximumRadius;
  11387. *
  11388. * var frustum = new Cesium.OrthographicOffCenterFrustum();
  11389. * frustum.right = maxRadii * Cesium.Math.PI;
  11390. * frustum.left = -c.frustum.right;
  11391. * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
  11392. * frustum.bottom = -c.frustum.top;
  11393. * frustum.near = 0.01 * maxRadii;
  11394. * frustum.far = 50.0 * maxRadii;
  11395. * @param [options] - An object with the following properties:
  11396. * @param [options.left] - The left clipping plane distance.
  11397. * @param [options.right] - The right clipping plane distance.
  11398. * @param [options.top] - The top clipping plane distance.
  11399. * @param [options.bottom] - The bottom clipping plane distance.
  11400. * @param [options.near = 1.0] - The near clipping plane distance.
  11401. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11402. */
  11403. export class OrthographicOffCenterFrustum {
  11404. constructor(options?: {
  11405. left?: number;
  11406. right?: number;
  11407. top?: number;
  11408. bottom?: number;
  11409. near?: number;
  11410. far?: number;
  11411. });
  11412. /**
  11413. * The left clipping plane.
  11414. */
  11415. left: number;
  11416. /**
  11417. * The right clipping plane.
  11418. */
  11419. right: number;
  11420. /**
  11421. * The top clipping plane.
  11422. */
  11423. top: number;
  11424. /**
  11425. * The bottom clipping plane.
  11426. */
  11427. bottom: number;
  11428. /**
  11429. * The distance of the near plane.
  11430. */
  11431. near: number;
  11432. /**
  11433. * The distance of the far plane.
  11434. */
  11435. far: number;
  11436. /**
  11437. * Gets the orthographic projection matrix computed from the view frustum.
  11438. */
  11439. readonly projectionMatrix: Matrix4;
  11440. /**
  11441. * Creates a culling volume for this frustum.
  11442. * @example
  11443. * // Check if a bounding volume intersects the frustum.
  11444. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11445. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11446. * @param position - The eye position.
  11447. * @param direction - The view direction.
  11448. * @param up - The up direction.
  11449. * @returns A culling volume at the given position and orientation.
  11450. */
  11451. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11452. /**
  11453. * Returns the pixel's width and height in meters.
  11454. * @example
  11455. * // Example 1
  11456. * // Get the width and height of a pixel.
  11457. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11458. * @param drawingBufferWidth - The width of the drawing buffer.
  11459. * @param drawingBufferHeight - The height of the drawing buffer.
  11460. * @param distance - The distance to the near plane in meters.
  11461. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11462. * @param result - The object onto which to store the result.
  11463. * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
  11464. */
  11465. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11466. /**
  11467. * Returns a duplicate of a OrthographicOffCenterFrustum instance.
  11468. * @param [result] - The object onto which to store the result.
  11469. * @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
  11470. */
  11471. clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum;
  11472. /**
  11473. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11474. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11475. * @param [other] - The right hand side OrthographicOffCenterFrustum.
  11476. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11477. */
  11478. equals(other?: OrthographicOffCenterFrustum): boolean;
  11479. /**
  11480. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11481. * <code>true</code> if they pass an absolute or relative tolerance test,
  11482. * <code>false</code> otherwise.
  11483. * @param other - The right hand side OrthographicOffCenterFrustum.
  11484. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11485. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11486. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11487. */
  11488. equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11489. }
  11490. export namespace Packable {
  11491. /**
  11492. * The number of elements used to pack the object into an array.
  11493. */
  11494. var packedLength: number;
  11495. /**
  11496. * Stores the provided instance into the provided array.
  11497. * @param value - The value to pack.
  11498. * @param array - The array to pack into.
  11499. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11500. */
  11501. function pack(value: any, array: number[], startingIndex?: number): void;
  11502. /**
  11503. * Retrieves an instance from a packed array.
  11504. * @param array - The packed array.
  11505. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11506. * @param [result] - The object into which to store the result.
  11507. * @returns The modified result parameter or a new Object instance if one was not provided.
  11508. */
  11509. function unpack(array: number[], startingIndex?: number, result?: any): any;
  11510. }
  11511. /**
  11512. * Static interface for types which can store their values as packed
  11513. * elements in an array. These methods and properties are expected to be
  11514. * defined on a constructor function.
  11515. */
  11516. export interface Packable {
  11517. }
  11518. /**
  11519. * Static interface for {@link Packable} types which are interpolated in a
  11520. * different representation than their packed value. These methods and
  11521. * properties are expected to be defined on a constructor function.
  11522. */
  11523. export namespace PackableForInterpolation {
  11524. /**
  11525. * The number of elements used to store the object into an array in its interpolatable form.
  11526. */
  11527. var packedInterpolationLength: number;
  11528. /**
  11529. * Converts a packed array into a form suitable for interpolation.
  11530. * @param packedArray - The packed array.
  11531. * @param [startingIndex = 0] - The index of the first element to be converted.
  11532. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  11533. * @param [result] - The object into which to store the result.
  11534. */
  11535. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  11536. /**
  11537. * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.
  11538. * @param array - The array previously packed for interpolation.
  11539. * @param sourceArray - The original packed array.
  11540. * @param [startingIndex = 0] - The startingIndex used to convert the array.
  11541. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  11542. * @param [result] - The object into which to store the result.
  11543. * @returns The modified result parameter or a new Object instance if one was not provided.
  11544. */
  11545. function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any;
  11546. }
  11547. /**
  11548. * Provides geocoding via a {@link https://pelias.io/|Pelias} server.
  11549. * @example
  11550. * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
  11551. * var viewer = new Cesium.Viewer('cesiumContainer', {
  11552. * geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({
  11553. * url: 'https://api.geocode.earth/v1/',
  11554. * queryParameters: {
  11555. * api_key: '<Your geocode.earth API key>'
  11556. * }
  11557. * }))
  11558. * });
  11559. * @param url - The endpoint to the Pelias server.
  11560. */
  11561. export class PeliasGeocoderService {
  11562. constructor(url: Resource | string);
  11563. /**
  11564. * The Resource used to access the Pelias endpoint.
  11565. */
  11566. readonly url: Resource;
  11567. /**
  11568. * @param query - The query to be sent to the geocoder service
  11569. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  11570. */
  11571. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  11572. }
  11573. /**
  11574. * The viewing frustum is defined by 6 planes.
  11575. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11576. * define the unit vector normal to the plane, and the w component is the distance of the
  11577. * plane from the origin/camera position.
  11578. * @example
  11579. * var frustum = new Cesium.PerspectiveFrustum({
  11580. * fov : Cesium.Math.PI_OVER_THREE,
  11581. * aspectRatio : canvas.clientWidth / canvas.clientHeight
  11582. * near : 1.0,
  11583. * far : 1000.0
  11584. * });
  11585. * @param [options] - An object with the following properties:
  11586. * @param [options.fov] - The angle of the field of view (FOV), in radians.
  11587. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11588. * @param [options.near = 1.0] - The distance of the near plane.
  11589. * @param [options.far = 500000000.0] - The distance of the far plane.
  11590. * @param [options.xOffset = 0.0] - The offset in the x direction.
  11591. * @param [options.yOffset = 0.0] - The offset in the y direction.
  11592. */
  11593. export class PerspectiveFrustum {
  11594. constructor(options?: {
  11595. fov?: number;
  11596. aspectRatio?: number;
  11597. near?: number;
  11598. far?: number;
  11599. xOffset?: number;
  11600. yOffset?: number;
  11601. });
  11602. /**
  11603. * The angle of the field of view (FOV), in radians. This angle will be used
  11604. * as the horizontal FOV if the width is greater than the height, otherwise
  11605. * it will be the vertical FOV.
  11606. */
  11607. fov: number;
  11608. /**
  11609. * The aspect ratio of the frustum's width to it's height.
  11610. */
  11611. aspectRatio: number;
  11612. /**
  11613. * The distance of the near plane.
  11614. */
  11615. near: number;
  11616. /**
  11617. * The distance of the far plane.
  11618. */
  11619. far: number;
  11620. /**
  11621. * Offsets the frustum in the x direction.
  11622. */
  11623. xOffset: number;
  11624. /**
  11625. * Offsets the frustum in the y direction.
  11626. */
  11627. yOffset: number;
  11628. /**
  11629. * The number of elements used to pack the object into an array.
  11630. */
  11631. static packedLength: number;
  11632. /**
  11633. * Stores the provided instance into the provided array.
  11634. * @param value - The value to pack.
  11635. * @param array - The array to pack into.
  11636. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11637. * @returns The array that was packed into
  11638. */
  11639. static pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[];
  11640. /**
  11641. * Retrieves an instance from a packed array.
  11642. * @param array - The packed array.
  11643. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11644. * @param [result] - The object into which to store the result.
  11645. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11646. */
  11647. static unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum;
  11648. /**
  11649. * Gets the perspective projection matrix computed from the view frustum.
  11650. */
  11651. readonly projectionMatrix: Matrix4;
  11652. /**
  11653. * The perspective projection matrix computed from the view frustum with an infinite far plane.
  11654. */
  11655. readonly infiniteProjectionMatrix: Matrix4;
  11656. /**
  11657. * Gets the angle of the vertical field of view, in radians.
  11658. */
  11659. readonly fovy: number;
  11660. /**
  11661. * Creates a culling volume for this frustum.
  11662. * @example
  11663. * // Check if a bounding volume intersects the frustum.
  11664. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11665. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11666. * @param position - The eye position.
  11667. * @param direction - The view direction.
  11668. * @param up - The up direction.
  11669. * @returns A culling volume at the given position and orientation.
  11670. */
  11671. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11672. /**
  11673. * Returns the pixel's width and height in meters.
  11674. * @example
  11675. * // Example 1
  11676. * // Get the width and height of a pixel.
  11677. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  11678. * @example
  11679. * // Example 2
  11680. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  11681. * // For example, get the size of a pixel of an image on a billboard.
  11682. * var position = camera.position;
  11683. * var direction = camera.direction;
  11684. * var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  11685. * var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  11686. * var distance = Cesium.Cartesian3.magnitude(toCenterProj);
  11687. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  11688. * @param drawingBufferWidth - The width of the drawing buffer.
  11689. * @param drawingBufferHeight - The height of the drawing buffer.
  11690. * @param distance - The distance to the near plane in meters.
  11691. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11692. * @param result - The object onto which to store the result.
  11693. * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
  11694. */
  11695. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11696. /**
  11697. * Returns a duplicate of a PerspectiveFrustum instance.
  11698. * @param [result] - The object onto which to store the result.
  11699. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11700. */
  11701. clone(result?: PerspectiveFrustum): PerspectiveFrustum;
  11702. /**
  11703. * Compares the provided PerspectiveFrustum componentwise and returns
  11704. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11705. * @param [other] - The right hand side PerspectiveFrustum.
  11706. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11707. */
  11708. equals(other?: PerspectiveFrustum): boolean;
  11709. /**
  11710. * Compares the provided PerspectiveFrustum componentwise and returns
  11711. * <code>true</code> if they pass an absolute or relative tolerance test,
  11712. * <code>false</code> otherwise.
  11713. * @param other - The right hand side PerspectiveFrustum.
  11714. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11715. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11716. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11717. */
  11718. equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11719. }
  11720. /**
  11721. * The viewing frustum is defined by 6 planes.
  11722. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11723. * define the unit vector normal to the plane, and the w component is the distance of the
  11724. * plane from the origin/camera position.
  11725. * @example
  11726. * var frustum = new Cesium.PerspectiveOffCenterFrustum({
  11727. * left : -1.0,
  11728. * right : 1.0,
  11729. * top : 1.0,
  11730. * bottom : -1.0,
  11731. * near : 1.0,
  11732. * far : 100.0
  11733. * });
  11734. * @param [options] - An object with the following properties:
  11735. * @param [options.left] - The left clipping plane distance.
  11736. * @param [options.right] - The right clipping plane distance.
  11737. * @param [options.top] - The top clipping plane distance.
  11738. * @param [options.bottom] - The bottom clipping plane distance.
  11739. * @param [options.near = 1.0] - The near clipping plane distance.
  11740. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11741. */
  11742. export class PerspectiveOffCenterFrustum {
  11743. constructor(options?: {
  11744. left?: number;
  11745. right?: number;
  11746. top?: number;
  11747. bottom?: number;
  11748. near?: number;
  11749. far?: number;
  11750. });
  11751. /**
  11752. * Defines the left clipping plane.
  11753. */
  11754. left: number;
  11755. /**
  11756. * Defines the right clipping plane.
  11757. */
  11758. right: number;
  11759. /**
  11760. * Defines the top clipping plane.
  11761. */
  11762. top: number;
  11763. /**
  11764. * Defines the bottom clipping plane.
  11765. */
  11766. bottom: number;
  11767. /**
  11768. * The distance of the near plane.
  11769. */
  11770. near: number;
  11771. /**
  11772. * The distance of the far plane.
  11773. */
  11774. far: number;
  11775. /**
  11776. * Gets the perspective projection matrix computed from the view frustum.
  11777. */
  11778. readonly projectionMatrix: Matrix4;
  11779. /**
  11780. * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
  11781. */
  11782. readonly infiniteProjectionMatrix: Matrix4;
  11783. /**
  11784. * Creates a culling volume for this frustum.
  11785. * @example
  11786. * // Check if a bounding volume intersects the frustum.
  11787. * var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11788. * var intersect = cullingVolume.computeVisibility(boundingVolume);
  11789. * @param position - The eye position.
  11790. * @param direction - The view direction.
  11791. * @param up - The up direction.
  11792. * @returns A culling volume at the given position and orientation.
  11793. */
  11794. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11795. /**
  11796. * Returns the pixel's width and height in meters.
  11797. * @example
  11798. * // Example 1
  11799. * // Get the width and height of a pixel.
  11800. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  11801. * @example
  11802. * // Example 2
  11803. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  11804. * // For example, get the size of a pixel of an image on a billboard.
  11805. * var position = camera.position;
  11806. * var direction = camera.direction;
  11807. * var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  11808. * var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  11809. * var distance = Cesium.Cartesian3.magnitude(toCenterProj);
  11810. * var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  11811. * @param drawingBufferWidth - The width of the drawing buffer.
  11812. * @param drawingBufferHeight - The height of the drawing buffer.
  11813. * @param distance - The distance to the near plane in meters.
  11814. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11815. * @param result - The object onto which to store the result.
  11816. * @returns The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
  11817. */
  11818. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11819. /**
  11820. * Returns a duplicate of a PerspectiveOffCenterFrustum instance.
  11821. * @param [result] - The object onto which to store the result.
  11822. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11823. */
  11824. clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum;
  11825. /**
  11826. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11827. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11828. * @param [other] - The right hand side PerspectiveOffCenterFrustum.
  11829. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11830. */
  11831. equals(other?: PerspectiveOffCenterFrustum): boolean;
  11832. /**
  11833. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  11834. * <code>true</code> if they pass an absolute or relative tolerance test,
  11835. * <code>false</code> otherwise.
  11836. * @param other - The right hand side PerspectiveOffCenterFrustum.
  11837. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11838. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11839. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11840. */
  11841. equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11842. }
  11843. /**
  11844. * A utility class for generating custom map pins as canvas elements.
  11845. * <br /><br />
  11846. * <div align='center'>
  11847. * <img src='Images/PinBuilder.png' width='500'/><br />
  11848. * Example pins generated using both the maki icon set, which ships with Cesium, and single character text.
  11849. * </div>
  11850. */
  11851. export class PinBuilder {
  11852. constructor();
  11853. /**
  11854. * Creates an empty pin of the specified color and size.
  11855. * @param color - The color of the pin.
  11856. * @param size - The size of the pin, in pixels.
  11857. * @returns The canvas element that represents the generated pin.
  11858. */
  11859. fromColor(color: Color, size: number): HTMLCanvasElement;
  11860. /**
  11861. * Creates a pin with the specified icon, color, and size.
  11862. * @param url - The url of the image to be stamped onto the pin.
  11863. * @param color - The color of the pin.
  11864. * @param size - The size of the pin, in pixels.
  11865. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11866. */
  11867. fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11868. /**
  11869. * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.
  11870. * @param id - The id of the maki icon to be stamped onto the pin.
  11871. * @param color - The color of the pin.
  11872. * @param size - The size of the pin, in pixels.
  11873. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  11874. */
  11875. fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  11876. /**
  11877. * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible
  11878. * while still being contained completely within the pin.
  11879. * @param text - The text to be stamped onto the pin.
  11880. * @param color - The color of the pin.
  11881. * @param size - The size of the pin, in pixels.
  11882. * @returns The canvas element that represents the generated pin.
  11883. */
  11884. fromText(text: string, color: Color, size: number): HTMLCanvasElement;
  11885. }
  11886. /**
  11887. * The format of a pixel, i.e., the number of components it has and what they represent.
  11888. */
  11889. export enum PixelFormat {
  11890. /**
  11891. * A pixel format containing a depth value.
  11892. */
  11893. DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT,
  11894. /**
  11895. * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
  11896. */
  11897. DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL,
  11898. /**
  11899. * A pixel format containing an alpha channel.
  11900. */
  11901. ALPHA = WebGLConstants.ALPHA,
  11902. /**
  11903. * A pixel format containing red, green, and blue channels.
  11904. */
  11905. RGB = WebGLConstants.RGB,
  11906. /**
  11907. * A pixel format containing red, green, blue, and alpha channels.
  11908. */
  11909. RGBA = WebGLConstants.RGBA,
  11910. /**
  11911. * A pixel format containing a luminance (intensity) channel.
  11912. */
  11913. LUMINANCE = WebGLConstants.LUMINANCE,
  11914. /**
  11915. * A pixel format containing luminance (intensity) and alpha channels.
  11916. */
  11917. LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA,
  11918. /**
  11919. * A pixel format containing red, green, and blue channels that is DXT1 compressed.
  11920. */
  11921. RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
  11922. /**
  11923. * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
  11924. */
  11925. RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
  11926. /**
  11927. * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
  11928. */
  11929. RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
  11930. /**
  11931. * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
  11932. */
  11933. RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
  11934. /**
  11935. * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
  11936. */
  11937. RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
  11938. /**
  11939. * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
  11940. */
  11941. RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
  11942. /**
  11943. * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
  11944. */
  11945. RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
  11946. /**
  11947. * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
  11948. */
  11949. RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
  11950. /**
  11951. * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.
  11952. */
  11953. RGBA_ASTC = WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,
  11954. /**
  11955. * A pixel format containing red, green, and blue channels that is ETC1 compressed.
  11956. */
  11957. RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,
  11958. /**
  11959. * A pixel format containing red, green, and blue channels that is ETC2 compressed.
  11960. */
  11961. RGB8_ETC2 = WebGLConstants.COMPRESSED_RGB8_ETC2,
  11962. /**
  11963. * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.
  11964. */
  11965. RGBA8_ETC2_EAC = WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,
  11966. /**
  11967. * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.
  11968. */
  11969. RGBA_BC7 = WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM
  11970. }
  11971. /**
  11972. * A plane in Hessian Normal Form defined by
  11973. * <pre>
  11974. * ax + by + cz + d = 0
  11975. * </pre>
  11976. * where (a, b, c) is the plane's <code>normal</code>, d is the signed
  11977. * <code>distance</code> to the plane, and (x, y, z) is any point on
  11978. * the plane.
  11979. * @example
  11980. * // The plane x=0
  11981. * var plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
  11982. * @param normal - The plane's normal (normalized).
  11983. * @param distance - The shortest distance from the origin to the plane. The sign of
  11984. * <code>distance</code> determines which side of the plane the origin
  11985. * is on. If <code>distance</code> is positive, the origin is in the half-space
  11986. * in the direction of the normal; if negative, the origin is in the half-space
  11987. * opposite to the normal; if zero, the plane passes through the origin.
  11988. */
  11989. export class Plane {
  11990. constructor(normal: Cartesian3, distance: number);
  11991. /**
  11992. * The plane's normal.
  11993. */
  11994. normal: Cartesian3;
  11995. /**
  11996. * The shortest distance from the origin to the plane. The sign of
  11997. * <code>distance</code> determines which side of the plane the origin
  11998. * is on. If <code>distance</code> is positive, the origin is in the half-space
  11999. * in the direction of the normal; if negative, the origin is in the half-space
  12000. * opposite to the normal; if zero, the plane passes through the origin.
  12001. */
  12002. distance: number;
  12003. /**
  12004. * Creates a plane from a normal and a point on the plane.
  12005. * @example
  12006. * var point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  12007. * var normal = ellipsoid.geodeticSurfaceNormal(point);
  12008. * var tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
  12009. * @param point - The point on the plane.
  12010. * @param normal - The plane's normal (normalized).
  12011. * @param [result] - The object onto which to store the result.
  12012. * @returns A new plane instance or the modified result parameter.
  12013. */
  12014. static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane;
  12015. /**
  12016. * Creates a plane from the general equation
  12017. * @param coefficients - The plane's normal (normalized).
  12018. * @param [result] - The object onto which to store the result.
  12019. * @returns A new plane instance or the modified result parameter.
  12020. */
  12021. static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane;
  12022. /**
  12023. * Computes the signed shortest distance of a point to a plane.
  12024. * The sign of the distance determines which side of the plane the point
  12025. * is on. If the distance is positive, the point is in the half-space
  12026. * in the direction of the normal; if negative, the point is in the half-space
  12027. * opposite to the normal; if zero, the plane passes through the point.
  12028. * @param plane - The plane.
  12029. * @param point - The point.
  12030. * @returns The signed shortest distance of the point to the plane.
  12031. */
  12032. static getPointDistance(plane: Plane, point: Cartesian3): number;
  12033. /**
  12034. * Projects a point onto the plane.
  12035. * @param plane - The plane to project the point onto
  12036. * @param point - The point to project onto the plane
  12037. * @param [result] - The result point. If undefined, a new Cartesian3 will be created.
  12038. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  12039. */
  12040. static projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3;
  12041. /**
  12042. * Transforms the plane by the given transformation matrix.
  12043. * @param plane - The plane.
  12044. * @param transform - The transformation matrix.
  12045. * @param [result] - The object into which to store the result.
  12046. * @returns The plane transformed by the given transformation matrix.
  12047. */
  12048. static transform(plane: Plane, transform: Matrix4, result?: Plane): Plane;
  12049. /**
  12050. * Duplicates a Plane instance.
  12051. * @param plane - The plane to duplicate.
  12052. * @param [result] - The object onto which to store the result.
  12053. * @returns The modified result parameter or a new Plane instance if one was not provided.
  12054. */
  12055. static clone(plane: Plane, result?: Plane): Plane;
  12056. /**
  12057. * Compares the provided Planes by normal and distance and returns
  12058. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12059. * @param left - The first plane.
  12060. * @param right - The second plane.
  12061. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  12062. */
  12063. static equals(left: Plane, right: Plane): boolean;
  12064. /**
  12065. * A constant initialized to the XY plane passing through the origin, with normal in positive Z.
  12066. */
  12067. static readonly ORIGIN_XY_PLANE: Plane;
  12068. /**
  12069. * A constant initialized to the YZ plane passing through the origin, with normal in positive X.
  12070. */
  12071. static readonly ORIGIN_YZ_PLANE: Plane;
  12072. /**
  12073. * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
  12074. */
  12075. static readonly ORIGIN_ZX_PLANE: Plane;
  12076. }
  12077. /**
  12078. * Describes geometry representing a plane centered at the origin, with a unit width and length.
  12079. * @example
  12080. * var planeGeometry = new Cesium.PlaneGeometry({
  12081. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  12082. * });
  12083. * @param [options] - Object with the following properties:
  12084. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12085. */
  12086. export class PlaneGeometry {
  12087. constructor(options?: {
  12088. vertexFormat?: VertexFormat;
  12089. });
  12090. /**
  12091. * The number of elements used to pack the object into an array.
  12092. */
  12093. static packedLength: number;
  12094. /**
  12095. * Stores the provided instance into the provided array.
  12096. * @param value - The value to pack.
  12097. * @param array - The array to pack into.
  12098. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12099. * @returns The array that was packed into
  12100. */
  12101. static pack(value: PlaneGeometry, array: number[], startingIndex?: number): number[];
  12102. /**
  12103. * Retrieves an instance from a packed array.
  12104. * @param array - The packed array.
  12105. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12106. * @param [result] - The object into which to store the result.
  12107. * @returns The modified result parameter or a new PlaneGeometry instance if one was not provided.
  12108. */
  12109. static unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry;
  12110. /**
  12111. * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
  12112. * @param planeGeometry - A description of the plane.
  12113. * @returns The computed vertices and indices.
  12114. */
  12115. static createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined;
  12116. }
  12117. /**
  12118. * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
  12119. */
  12120. export class PlaneOutlineGeometry {
  12121. constructor();
  12122. /**
  12123. * The number of elements used to pack the object into an array.
  12124. */
  12125. static packedLength: number;
  12126. /**
  12127. * Stores the provided instance into the provided array.
  12128. * @param value - The value to pack.
  12129. * @param array - The array to pack into.
  12130. * @returns The array that was packed into
  12131. */
  12132. static pack(value: PlaneOutlineGeometry, array: number[]): number[];
  12133. /**
  12134. * Retrieves an instance from a packed array.
  12135. * @param array - The packed array.
  12136. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12137. * @param [result] - The object into which to store the result.
  12138. * @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
  12139. */
  12140. static unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry;
  12141. /**
  12142. * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
  12143. * @returns The computed vertices and indices.
  12144. */
  12145. static createGeometry(): Geometry | undefined;
  12146. }
  12147. /**
  12148. * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  12149. * @example
  12150. * // 1. create a polygon from points
  12151. * var polygon = new Cesium.PolygonGeometry({
  12152. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12153. * Cesium.Cartesian3.fromDegreesArray([
  12154. * -72.0, 40.0,
  12155. * -70.0, 35.0,
  12156. * -75.0, 30.0,
  12157. * -70.0, 30.0,
  12158. * -68.0, 40.0
  12159. * ])
  12160. * )
  12161. * });
  12162. * var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12163. *
  12164. * // 2. create a nested polygon with holes
  12165. * var polygonWithHole = new Cesium.PolygonGeometry({
  12166. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12167. * Cesium.Cartesian3.fromDegreesArray([
  12168. * -109.0, 30.0,
  12169. * -95.0, 30.0,
  12170. * -95.0, 40.0,
  12171. * -109.0, 40.0
  12172. * ]),
  12173. * [new Cesium.PolygonHierarchy(
  12174. * Cesium.Cartesian3.fromDegreesArray([
  12175. * -107.0, 31.0,
  12176. * -107.0, 39.0,
  12177. * -97.0, 39.0,
  12178. * -97.0, 31.0
  12179. * ]),
  12180. * [new Cesium.PolygonHierarchy(
  12181. * Cesium.Cartesian3.fromDegreesArray([
  12182. * -105.0, 33.0,
  12183. * -99.0, 33.0,
  12184. * -99.0, 37.0,
  12185. * -105.0, 37.0
  12186. * ]),
  12187. * [new Cesium.PolygonHierarchy(
  12188. * Cesium.Cartesian3.fromDegreesArray([
  12189. * -103.0, 34.0,
  12190. * -101.0, 34.0,
  12191. * -101.0, 36.0,
  12192. * -103.0, 36.0
  12193. * ])
  12194. * )]
  12195. * )]
  12196. * )]
  12197. * )
  12198. * });
  12199. * var geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
  12200. *
  12201. * // 3. create extruded polygon
  12202. * var extrudedPolygon = new Cesium.PolygonGeometry({
  12203. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12204. * Cesium.Cartesian3.fromDegreesArray([
  12205. * -72.0, 40.0,
  12206. * -70.0, 35.0,
  12207. * -75.0, 30.0,
  12208. * -70.0, 30.0,
  12209. * -68.0, 40.0
  12210. * ])
  12211. * ),
  12212. * extrudedHeight: 300000
  12213. * });
  12214. * var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
  12215. * @param options - Object with the following properties:
  12216. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12217. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12218. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12219. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12220. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12221. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12222. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12223. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12224. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12225. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12226. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12227. */
  12228. export class PolygonGeometry {
  12229. constructor(options: {
  12230. polygonHierarchy: PolygonHierarchy;
  12231. height?: number;
  12232. extrudedHeight?: number;
  12233. vertexFormat?: VertexFormat;
  12234. stRotation?: number;
  12235. ellipsoid?: Ellipsoid;
  12236. granularity?: number;
  12237. perPositionHeight?: boolean;
  12238. closeTop?: boolean;
  12239. closeBottom?: boolean;
  12240. arcType?: ArcType;
  12241. });
  12242. /**
  12243. * The number of elements used to pack the object into an array.
  12244. */
  12245. packedLength: number;
  12246. /**
  12247. * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  12248. * @example
  12249. * // create a polygon from points
  12250. * var polygon = Cesium.PolygonGeometry.fromPositions({
  12251. * positions : Cesium.Cartesian3.fromDegreesArray([
  12252. * -72.0, 40.0,
  12253. * -70.0, 35.0,
  12254. * -75.0, 30.0,
  12255. * -70.0, 30.0,
  12256. * -68.0, 40.0
  12257. * ])
  12258. * });
  12259. * var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12260. * @param options - Object with the following properties:
  12261. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12262. * @param [options.height = 0.0] - The height of the polygon.
  12263. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12264. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12265. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12266. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12267. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12268. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12269. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12270. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12271. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12272. */
  12273. static fromPositions(options: {
  12274. positions: Cartesian3[];
  12275. height?: number;
  12276. extrudedHeight?: number;
  12277. vertexFormat?: VertexFormat;
  12278. stRotation?: number;
  12279. ellipsoid?: Ellipsoid;
  12280. granularity?: number;
  12281. perPositionHeight?: boolean;
  12282. closeTop?: boolean;
  12283. closeBottom?: boolean;
  12284. arcType?: ArcType;
  12285. }): PolygonGeometry;
  12286. /**
  12287. * Stores the provided instance into the provided array.
  12288. * @param value - The value to pack.
  12289. * @param array - The array to pack into.
  12290. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12291. * @returns The array that was packed into
  12292. */
  12293. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  12294. /**
  12295. * Retrieves an instance from a packed array.
  12296. * @param array - The packed array.
  12297. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12298. * @param [result] - The object into which to store the result.
  12299. */
  12300. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  12301. /**
  12302. * Returns the bounding rectangle given the provided options
  12303. * @param options - Object with the following properties:
  12304. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12305. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
  12306. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12307. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12308. * @param [result] - An object in which to store the result.
  12309. * @returns The result rectangle
  12310. */
  12311. static computeRectangle(options: {
  12312. polygonHierarchy: PolygonHierarchy;
  12313. granularity?: number;
  12314. arcType?: ArcType;
  12315. ellipsoid?: Ellipsoid;
  12316. }, result?: Rectangle): Rectangle;
  12317. /**
  12318. * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
  12319. * @param polygonGeometry - A description of the polygon.
  12320. * @returns The computed vertices and indices.
  12321. */
  12322. static createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined;
  12323. }
  12324. /**
  12325. * An hierarchy of linear rings which define a polygon and its holes.
  12326. * The holes themselves may also have holes which nest inner polygons.
  12327. * @param [positions] - A linear ring defining the outer boundary of the polygon or hole.
  12328. * @param [holes] - An array of polygon hierarchies defining holes in the polygon.
  12329. */
  12330. export class PolygonHierarchy {
  12331. constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]);
  12332. /**
  12333. * A linear ring defining the outer boundary of the polygon or hole.
  12334. */
  12335. positions: Cartesian3[];
  12336. /**
  12337. * An array of polygon hierarchies defining holes in the polygon.
  12338. */
  12339. holes: PolygonHierarchy[];
  12340. }
  12341. /**
  12342. * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
  12343. * @example
  12344. * // 1. create a polygon outline from points
  12345. * var polygon = new Cesium.PolygonOutlineGeometry({
  12346. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12347. * Cesium.Cartesian3.fromDegreesArray([
  12348. * -72.0, 40.0,
  12349. * -70.0, 35.0,
  12350. * -75.0, 30.0,
  12351. * -70.0, 30.0,
  12352. * -68.0, 40.0
  12353. * ])
  12354. * )
  12355. * });
  12356. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12357. *
  12358. * // 2. create a nested polygon with holes outline
  12359. * var polygonWithHole = new Cesium.PolygonOutlineGeometry({
  12360. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12361. * Cesium.Cartesian3.fromDegreesArray([
  12362. * -109.0, 30.0,
  12363. * -95.0, 30.0,
  12364. * -95.0, 40.0,
  12365. * -109.0, 40.0
  12366. * ]),
  12367. * [new Cesium.PolygonHierarchy(
  12368. * Cesium.Cartesian3.fromDegreesArray([
  12369. * -107.0, 31.0,
  12370. * -107.0, 39.0,
  12371. * -97.0, 39.0,
  12372. * -97.0, 31.0
  12373. * ]),
  12374. * [new Cesium.PolygonHierarchy(
  12375. * Cesium.Cartesian3.fromDegreesArray([
  12376. * -105.0, 33.0,
  12377. * -99.0, 33.0,
  12378. * -99.0, 37.0,
  12379. * -105.0, 37.0
  12380. * ]),
  12381. * [new Cesium.PolygonHierarchy(
  12382. * Cesium.Cartesian3.fromDegreesArray([
  12383. * -103.0, 34.0,
  12384. * -101.0, 34.0,
  12385. * -101.0, 36.0,
  12386. * -103.0, 36.0
  12387. * ])
  12388. * )]
  12389. * )]
  12390. * )]
  12391. * )
  12392. * });
  12393. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);
  12394. *
  12395. * // 3. create extruded polygon outline
  12396. * var extrudedPolygon = new Cesium.PolygonOutlineGeometry({
  12397. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12398. * Cesium.Cartesian3.fromDegreesArray([
  12399. * -72.0, 40.0,
  12400. * -70.0, 35.0,
  12401. * -75.0, 30.0,
  12402. * -70.0, 30.0,
  12403. * -68.0, 40.0
  12404. * ])
  12405. * ),
  12406. * extrudedHeight: 300000
  12407. * });
  12408. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
  12409. * @param options - Object with the following properties:
  12410. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12411. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12412. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12413. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12414. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12415. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12416. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12417. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12418. */
  12419. export class PolygonOutlineGeometry {
  12420. constructor(options: {
  12421. polygonHierarchy: PolygonHierarchy;
  12422. height?: number;
  12423. extrudedHeight?: number;
  12424. vertexFormat?: VertexFormat;
  12425. ellipsoid?: Ellipsoid;
  12426. granularity?: number;
  12427. perPositionHeight?: boolean;
  12428. arcType?: ArcType;
  12429. });
  12430. /**
  12431. * The number of elements used to pack the object into an array.
  12432. */
  12433. packedLength: number;
  12434. /**
  12435. * Stores the provided instance into the provided array.
  12436. * @param value - The value to pack.
  12437. * @param array - The array to pack into.
  12438. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12439. * @returns The array that was packed into
  12440. */
  12441. static pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  12442. /**
  12443. * Retrieves an instance from a packed array.
  12444. * @param array - The packed array.
  12445. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12446. * @param [result] - The object into which to store the result.
  12447. * @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
  12448. */
  12449. static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry;
  12450. /**
  12451. * A description of a polygon outline from an array of positions.
  12452. * @example
  12453. * // create a polygon from points
  12454. * var polygon = Cesium.PolygonOutlineGeometry.fromPositions({
  12455. * positions : Cesium.Cartesian3.fromDegreesArray([
  12456. * -72.0, 40.0,
  12457. * -70.0, 35.0,
  12458. * -75.0, 30.0,
  12459. * -70.0, 30.0,
  12460. * -68.0, 40.0
  12461. * ])
  12462. * });
  12463. * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12464. * @param options - Object with the following properties:
  12465. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12466. * @param [options.height = 0.0] - The height of the polygon.
  12467. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12468. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12469. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12470. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12471. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
  12472. */
  12473. static fromPositions(options: {
  12474. positions: Cartesian3[];
  12475. height?: number;
  12476. extrudedHeight?: number;
  12477. ellipsoid?: Ellipsoid;
  12478. granularity?: number;
  12479. perPositionHeight?: boolean;
  12480. arcType?: ArcType;
  12481. }): PolygonOutlineGeometry;
  12482. /**
  12483. * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
  12484. * @param polygonGeometry - A description of the polygon outline.
  12485. * @returns The computed vertices and indices.
  12486. */
  12487. static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined;
  12488. }
  12489. /**
  12490. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  12491. * and each additional position defines a line segment from the previous position. The polyline is capable of
  12492. * displaying with a material.
  12493. * @example
  12494. * // A polyline with two connected line segments
  12495. * var polyline = new Cesium.PolylineGeometry({
  12496. * positions : Cesium.Cartesian3.fromDegreesArray([
  12497. * 0.0, 0.0,
  12498. * 5.0, 0.0,
  12499. * 5.0, 5.0
  12500. * ]),
  12501. * width : 10.0
  12502. * });
  12503. * var geometry = Cesium.PolylineGeometry.createGeometry(polyline);
  12504. * @param options - Object with the following properties:
  12505. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  12506. * @param [options.width = 1.0] - The width in pixels.
  12507. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  12508. * @param [options.colorsPerVertex = false] - A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
  12509. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  12510. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
  12511. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12512. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12513. */
  12514. export class PolylineGeometry {
  12515. constructor(options: {
  12516. positions: Cartesian3[];
  12517. width?: number;
  12518. colors?: Color[];
  12519. colorsPerVertex?: boolean;
  12520. arcType?: ArcType;
  12521. granularity?: number;
  12522. vertexFormat?: VertexFormat;
  12523. ellipsoid?: Ellipsoid;
  12524. });
  12525. /**
  12526. * The number of elements used to pack the object into an array.
  12527. */
  12528. packedLength: number;
  12529. /**
  12530. * Stores the provided instance into the provided array.
  12531. * @param value - The value to pack.
  12532. * @param array - The array to pack into.
  12533. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12534. * @returns The array that was packed into
  12535. */
  12536. static pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[];
  12537. /**
  12538. * Retrieves an instance from a packed array.
  12539. * @param array - The packed array.
  12540. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12541. * @param [result] - The object into which to store the result.
  12542. * @returns The modified result parameter or a new PolylineGeometry instance if one was not provided.
  12543. */
  12544. static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry;
  12545. /**
  12546. * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
  12547. * @param polylineGeometry - A description of the polyline.
  12548. * @returns The computed vertices and indices.
  12549. */
  12550. static createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined;
  12551. }
  12552. /**
  12553. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12554. * @example
  12555. * function computeCircle(radius) {
  12556. * var positions = [];
  12557. * for (var i = 0; i < 360; i++) {
  12558. * var radians = Cesium.Math.toRadians(i);
  12559. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12560. * }
  12561. * return positions;
  12562. * }
  12563. *
  12564. * var volume = new Cesium.PolylineVolumeGeometry({
  12565. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  12566. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12567. * -72.0, 40.0,
  12568. * -70.0, 35.0
  12569. * ]),
  12570. * shapePositions : computeCircle(100000.0)
  12571. * });
  12572. * @param options - Object with the following properties:
  12573. * @param options.polylinePositions - An array of {@link Cartesian3} positions that define the center of the polyline volume.
  12574. * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
  12575. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12576. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12577. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12578. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12579. */
  12580. export class PolylineVolumeGeometry {
  12581. constructor(options: {
  12582. polylinePositions: Cartesian3[];
  12583. shapePositions: Cartesian2[];
  12584. ellipsoid?: Ellipsoid;
  12585. granularity?: number;
  12586. vertexFormat?: VertexFormat;
  12587. cornerType?: CornerType;
  12588. });
  12589. /**
  12590. * The number of elements used to pack the object into an array.
  12591. */
  12592. packedLength: number;
  12593. /**
  12594. * Stores the provided instance into the provided array.
  12595. * @param value - The value to pack.
  12596. * @param array - The array to pack into.
  12597. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12598. * @returns The array that was packed into
  12599. */
  12600. static pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[];
  12601. /**
  12602. * Retrieves an instance from a packed array.
  12603. * @param array - The packed array.
  12604. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12605. * @param [result] - The object into which to store the result.
  12606. * @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
  12607. */
  12608. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry;
  12609. /**
  12610. * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12611. * @param polylineVolumeGeometry - A description of the polyline volume.
  12612. * @returns The computed vertices and indices.
  12613. */
  12614. static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined;
  12615. }
  12616. /**
  12617. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12618. * @example
  12619. * function computeCircle(radius) {
  12620. * var positions = [];
  12621. * for (var i = 0; i < 360; i++) {
  12622. * var radians = Cesium.Math.toRadians(i);
  12623. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12624. * }
  12625. * return positions;
  12626. * }
  12627. *
  12628. * var volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
  12629. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12630. * -72.0, 40.0,
  12631. * -70.0, 35.0
  12632. * ]),
  12633. * shapePositions : computeCircle(100000.0)
  12634. * });
  12635. * @param options - Object with the following properties:
  12636. * @param options.polylinePositions - An array of positions that define the center of the polyline volume.
  12637. * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline
  12638. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12639. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12640. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12641. */
  12642. export class PolylineVolumeOutlineGeometry {
  12643. constructor(options: {
  12644. polylinePositions: Cartesian3[];
  12645. shapePositions: Cartesian2[];
  12646. ellipsoid?: Ellipsoid;
  12647. granularity?: number;
  12648. cornerType?: CornerType;
  12649. });
  12650. /**
  12651. * The number of elements used to pack the object into an array.
  12652. */
  12653. packedLength: number;
  12654. /**
  12655. * Stores the provided instance into the provided array.
  12656. * @param value - The value to pack.
  12657. * @param array - The array to pack into.
  12658. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12659. * @returns The array that was packed into
  12660. */
  12661. static pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[];
  12662. /**
  12663. * Retrieves an instance from a packed array.
  12664. * @param array - The packed array.
  12665. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12666. * @param [result] - The object into which to store the result.
  12667. * @returns The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.
  12668. */
  12669. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry;
  12670. /**
  12671. * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12672. * @param polylineVolumeOutlineGeometry - A description of the polyline volume outline.
  12673. * @returns The computed vertices and indices.
  12674. */
  12675. static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined;
  12676. }
  12677. /**
  12678. * The type of a geometric primitive, i.e., points, lines, and triangles.
  12679. */
  12680. export enum PrimitiveType {
  12681. /**
  12682. * Points primitive where each vertex (or index) is a separate point.
  12683. */
  12684. POINTS = WebGLConstants.POINTS,
  12685. /**
  12686. * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
  12687. */
  12688. LINES = WebGLConstants.LINES,
  12689. /**
  12690. * Line loop primitive where each vertex (or index) after the first connects a line to
  12691. * the previous vertex, and the last vertex implicitly connects to the first.
  12692. */
  12693. LINE_LOOP = WebGLConstants.LINE_LOOP,
  12694. /**
  12695. * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
  12696. */
  12697. LINE_STRIP = WebGLConstants.LINE_STRIP,
  12698. /**
  12699. * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
  12700. */
  12701. TRIANGLES = WebGLConstants.TRIANGLES,
  12702. /**
  12703. * Triangle strip primitive where each vertex (or index) after the first two connect to
  12704. * the previous two vertices forming a triangle. For example, this can be used to model a wall.
  12705. */
  12706. TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP,
  12707. /**
  12708. * Triangle fan primitive where each vertex (or index) after the first two connect to
  12709. * the previous vertex and the first vertex forming a triangle. For example, this can be used
  12710. * to model a cone or circle.
  12711. */
  12712. TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN
  12713. }
  12714. /**
  12715. * Base class for proxying requested made by {@link Resource}.
  12716. */
  12717. export class Proxy {
  12718. constructor();
  12719. /**
  12720. * Get the final URL to use to request a given resource.
  12721. * @param resource - The resource to request.
  12722. * @returns proxied resource
  12723. */
  12724. getURL(resource: string): string;
  12725. }
  12726. /**
  12727. * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
  12728. */
  12729. export namespace QuadraticRealPolynomial {
  12730. /**
  12731. * Provides the discriminant of the quadratic equation from the supplied coefficients.
  12732. * @param a - The coefficient of the 2nd order monomial.
  12733. * @param b - The coefficient of the 1st order monomial.
  12734. * @param c - The coefficient of the 0th order monomial.
  12735. * @returns The value of the discriminant.
  12736. */
  12737. function computeDiscriminant(a: number, b: number, c: number): number;
  12738. /**
  12739. * Provides the real valued roots of the quadratic polynomial with the provided coefficients.
  12740. * @param a - The coefficient of the 2nd order monomial.
  12741. * @param b - The coefficient of the 1st order monomial.
  12742. * @param c - The coefficient of the 0th order monomial.
  12743. * @returns The real valued roots.
  12744. */
  12745. function computeRealRoots(a: number, b: number, c: number): number[];
  12746. }
  12747. /**
  12748. * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized
  12749. * mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed
  12750. * as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner
  12751. * of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile
  12752. * and 32767 at the maximum height in the tile.
  12753. * @example
  12754. * var data = new Cesium.QuantizedMeshTerrainData({
  12755. * minimumHeight : -100,
  12756. * maximumHeight : 2101,
  12757. * quantizedVertices : new Uint16Array([// order is SW NW SE NE
  12758. * // longitude
  12759. * 0, 0, 32767, 32767,
  12760. * // latitude
  12761. * 0, 32767, 0, 32767,
  12762. * // heights
  12763. * 16384, 0, 32767, 16384]),
  12764. * indices : new Uint16Array([0, 3, 1,
  12765. * 0, 2, 3]),
  12766. * boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),
  12767. * orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),
  12768. * horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),
  12769. * westIndices : [0, 1],
  12770. * southIndices : [0, 1],
  12771. * eastIndices : [2, 3],
  12772. * northIndices : [1, 3],
  12773. * westSkirtHeight : 1.0,
  12774. * southSkirtHeight : 1.0,
  12775. * eastSkirtHeight : 1.0,
  12776. * northSkirtHeight : 1.0
  12777. * });
  12778. * @param options - Object with the following properties:
  12779. * @param options.quantizedVertices - The buffer containing the quantized mesh.
  12780. * @param options.indices - The indices specifying how the quantized vertices are linked
  12781. * together into triangles. Each three indices specifies one triangle.
  12782. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid.
  12783. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid.
  12784. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh.
  12785. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh.
  12786. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point
  12787. * is below the horizon, the entire tile is assumed to be below the horizon as well.
  12788. * The point is expressed in ellipsoid-scaled coordinates.
  12789. * @param options.westIndices - The indices of the vertices on the western edge of the tile.
  12790. * @param options.southIndices - The indices of the vertices on the southern edge of the tile.
  12791. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile.
  12792. * @param options.northIndices - The indices of the vertices on the northern edge of the tile.
  12793. * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile.
  12794. * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile.
  12795. * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile.
  12796. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile.
  12797. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  12798. * If a child's bit is set, geometry will be requested for that tile as well when it
  12799. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  12800. * instead upsampled from the parent. The bit values are as follows:
  12801. * <table>
  12802. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  12803. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  12804. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  12805. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  12806. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  12807. * </table>
  12808. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  12809. * otherwise, false.
  12810. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding
  12811. * @param [options.waterMask] - The buffer containing the watermask.
  12812. * @param [options.credits] - Array of credits for this tile.
  12813. */
  12814. export class QuantizedMeshTerrainData {
  12815. constructor(options: {
  12816. quantizedVertices: Uint16Array;
  12817. indices: Uint16Array | Uint32Array;
  12818. minimumHeight: number;
  12819. maximumHeight: number;
  12820. boundingSphere: BoundingSphere;
  12821. orientedBoundingBox?: OrientedBoundingBox;
  12822. horizonOcclusionPoint: Cartesian3;
  12823. westIndices: number[];
  12824. southIndices: number[];
  12825. eastIndices: number[];
  12826. northIndices: number[];
  12827. westSkirtHeight: number;
  12828. southSkirtHeight: number;
  12829. eastSkirtHeight: number;
  12830. northSkirtHeight: number;
  12831. childTileMask?: number;
  12832. createdByUpsampling?: boolean;
  12833. encodedNormals?: Uint8Array;
  12834. waterMask?: Uint8Array;
  12835. credits?: Credit[];
  12836. });
  12837. /**
  12838. * An array of credits for this tile.
  12839. */
  12840. credits: Credit[];
  12841. /**
  12842. * The water mask included in this terrain data, if any. A water mask is a rectangular
  12843. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  12844. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  12845. */
  12846. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  12847. /**
  12848. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  12849. * vertices in this instance, interpolated if necessary.
  12850. * @param tilingScheme - The tiling scheme of this terrain data.
  12851. * @param thisX - The X coordinate of this tile in the tiling scheme.
  12852. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  12853. * @param thisLevel - The level of this tile in the tiling scheme.
  12854. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12855. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  12856. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  12857. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  12858. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  12859. * deferred.
  12860. */
  12861. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<QuantizedMeshTerrainData> | undefined;
  12862. /**
  12863. * Computes the terrain height at a specified longitude and latitude.
  12864. * @param rectangle - The rectangle covered by this terrain data.
  12865. * @param longitude - The longitude in radians.
  12866. * @param latitude - The latitude in radians.
  12867. * @returns The terrain height at the specified position. The position is clamped to
  12868. * the rectangle, so expect incorrect results for positions far outside the rectangle.
  12869. */
  12870. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  12871. /**
  12872. * Determines if a given child tile is available, based on the
  12873. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  12874. * to be one of the four children of this tile. If non-child tile coordinates are
  12875. * given, the availability of the southeast child tile is returned.
  12876. * @param thisX - The tile X coordinate of this (the parent) tile.
  12877. * @param thisY - The tile Y coordinate of this (the parent) tile.
  12878. * @param childX - The tile X coordinate of the child tile to check for availability.
  12879. * @param childY - The tile Y coordinate of the child tile to check for availability.
  12880. * @returns True if the child tile is available; otherwise, false.
  12881. */
  12882. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  12883. /**
  12884. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  12885. * terrain data. If this value is false, the data was obtained from some other source, such
  12886. * as by downloading it from a remote server. This method should return true for instances
  12887. * returned from a call to {@link HeightmapTerrainData#upsample}.
  12888. * @returns True if this instance was created by upsampling; otherwise, false.
  12889. */
  12890. wasCreatedByUpsampling(): boolean;
  12891. }
  12892. /**
  12893. * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
  12894. */
  12895. export namespace QuarticRealPolynomial {
  12896. /**
  12897. * Provides the discriminant of the quartic equation from the supplied coefficients.
  12898. * @param a - The coefficient of the 4th order monomial.
  12899. * @param b - The coefficient of the 3rd order monomial.
  12900. * @param c - The coefficient of the 2nd order monomial.
  12901. * @param d - The coefficient of the 1st order monomial.
  12902. * @param e - The coefficient of the 0th order monomial.
  12903. * @returns The value of the discriminant.
  12904. */
  12905. function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number;
  12906. /**
  12907. * Provides the real valued roots of the quartic polynomial with the provided coefficients.
  12908. * @param a - The coefficient of the 4th order monomial.
  12909. * @param b - The coefficient of the 3rd order monomial.
  12910. * @param c - The coefficient of the 2nd order monomial.
  12911. * @param d - The coefficient of the 1st order monomial.
  12912. * @param e - The coefficient of the 0th order monomial.
  12913. * @returns The real valued roots.
  12914. */
  12915. function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[];
  12916. }
  12917. /**
  12918. * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
  12919. * @param [x = 0.0] - The X component.
  12920. * @param [y = 0.0] - The Y component.
  12921. * @param [z = 0.0] - The Z component.
  12922. * @param [w = 0.0] - The W component.
  12923. */
  12924. export class Quaternion {
  12925. constructor(x?: number, y?: number, z?: number, w?: number);
  12926. /**
  12927. * The X component.
  12928. */
  12929. x: number;
  12930. /**
  12931. * The Y component.
  12932. */
  12933. y: number;
  12934. /**
  12935. * The Z component.
  12936. */
  12937. z: number;
  12938. /**
  12939. * The W component.
  12940. */
  12941. w: number;
  12942. /**
  12943. * Computes a quaternion representing a rotation around an axis.
  12944. * @param axis - The axis of rotation.
  12945. * @param angle - The angle in radians to rotate around the axis.
  12946. * @param [result] - The object onto which to store the result.
  12947. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12948. */
  12949. static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
  12950. /**
  12951. * Computes a Quaternion from the provided Matrix3 instance.
  12952. * @param matrix - The rotation matrix.
  12953. * @param [result] - The object onto which to store the result.
  12954. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12955. */
  12956. static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
  12957. /**
  12958. * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
  12959. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  12960. * the positive x axis.
  12961. * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll.
  12962. * @param [result] - The object onto which to store the result.
  12963. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  12964. */
  12965. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
  12966. /**
  12967. * The number of elements used to pack the object into an array.
  12968. */
  12969. static packedLength: number;
  12970. /**
  12971. * Stores the provided instance into the provided array.
  12972. * @param value - The value to pack.
  12973. * @param array - The array to pack into.
  12974. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12975. * @returns The array that was packed into
  12976. */
  12977. static pack(value: Quaternion, array: number[], startingIndex?: number): number[];
  12978. /**
  12979. * Retrieves an instance from a packed array.
  12980. * @param array - The packed array.
  12981. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12982. * @param [result] - The object into which to store the result.
  12983. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  12984. */
  12985. static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
  12986. /**
  12987. * The number of elements used to store the object into an array in its interpolatable form.
  12988. */
  12989. static packedInterpolationLength: number;
  12990. /**
  12991. * Converts a packed array into a form suitable for interpolation.
  12992. * @param packedArray - The packed array.
  12993. * @param [startingIndex = 0] - The index of the first element to be converted.
  12994. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  12995. * @param [result] - The object into which to store the result.
  12996. */
  12997. static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  12998. /**
  12999. * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
  13000. * @param array - The array previously packed for interpolation.
  13001. * @param sourceArray - The original packed array.
  13002. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  13003. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  13004. * @param [result] - The object into which to store the result.
  13005. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13006. */
  13007. static unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion;
  13008. /**
  13009. * Duplicates a Quaternion instance.
  13010. * @param quaternion - The quaternion to duplicate.
  13011. * @param [result] - The object onto which to store the result.
  13012. * @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
  13013. */
  13014. static clone(quaternion: Quaternion, result?: Quaternion): Quaternion;
  13015. /**
  13016. * Computes the conjugate of the provided quaternion.
  13017. * @param quaternion - The quaternion to conjugate.
  13018. * @param result - The object onto which to store the result.
  13019. * @returns The modified result parameter.
  13020. */
  13021. static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13022. /**
  13023. * Computes magnitude squared for the provided quaternion.
  13024. * @param quaternion - The quaternion to conjugate.
  13025. * @returns The magnitude squared.
  13026. */
  13027. static magnitudeSquared(quaternion: Quaternion): number;
  13028. /**
  13029. * Computes magnitude for the provided quaternion.
  13030. * @param quaternion - The quaternion to conjugate.
  13031. * @returns The magnitude.
  13032. */
  13033. static magnitude(quaternion: Quaternion): number;
  13034. /**
  13035. * Computes the normalized form of the provided quaternion.
  13036. * @param quaternion - The quaternion to normalize.
  13037. * @param result - The object onto which to store the result.
  13038. * @returns The modified result parameter.
  13039. */
  13040. static normalize(quaternion: Quaternion, result: Quaternion): Quaternion;
  13041. /**
  13042. * Computes the inverse of the provided quaternion.
  13043. * @param quaternion - The quaternion to normalize.
  13044. * @param result - The object onto which to store the result.
  13045. * @returns The modified result parameter.
  13046. */
  13047. static inverse(quaternion: Quaternion, result: Quaternion): Quaternion;
  13048. /**
  13049. * Computes the componentwise sum of two quaternions.
  13050. * @param left - The first quaternion.
  13051. * @param right - The second quaternion.
  13052. * @param result - The object onto which to store the result.
  13053. * @returns The modified result parameter.
  13054. */
  13055. static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13056. /**
  13057. * Computes the componentwise difference of two quaternions.
  13058. * @param left - The first quaternion.
  13059. * @param right - The second quaternion.
  13060. * @param result - The object onto which to store the result.
  13061. * @returns The modified result parameter.
  13062. */
  13063. static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13064. /**
  13065. * Negates the provided quaternion.
  13066. * @param quaternion - The quaternion to be negated.
  13067. * @param result - The object onto which to store the result.
  13068. * @returns The modified result parameter.
  13069. */
  13070. static negate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13071. /**
  13072. * Computes the dot (scalar) product of two quaternions.
  13073. * @param left - The first quaternion.
  13074. * @param right - The second quaternion.
  13075. * @returns The dot product.
  13076. */
  13077. static dot(left: Quaternion, right: Quaternion): number;
  13078. /**
  13079. * Computes the product of two quaternions.
  13080. * @param left - The first quaternion.
  13081. * @param right - The second quaternion.
  13082. * @param result - The object onto which to store the result.
  13083. * @returns The modified result parameter.
  13084. */
  13085. static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13086. /**
  13087. * Multiplies the provided quaternion componentwise by the provided scalar.
  13088. * @param quaternion - The quaternion to be scaled.
  13089. * @param scalar - The scalar to multiply with.
  13090. * @param result - The object onto which to store the result.
  13091. * @returns The modified result parameter.
  13092. */
  13093. static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13094. /**
  13095. * Divides the provided quaternion componentwise by the provided scalar.
  13096. * @param quaternion - The quaternion to be divided.
  13097. * @param scalar - The scalar to divide by.
  13098. * @param result - The object onto which to store the result.
  13099. * @returns The modified result parameter.
  13100. */
  13101. static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13102. /**
  13103. * Computes the axis of rotation of the provided quaternion.
  13104. * @param quaternion - The quaternion to use.
  13105. * @param result - The object onto which to store the result.
  13106. * @returns The modified result parameter.
  13107. */
  13108. static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13109. /**
  13110. * Computes the angle of rotation of the provided quaternion.
  13111. * @param quaternion - The quaternion to use.
  13112. * @returns The angle of rotation.
  13113. */
  13114. static computeAngle(quaternion: Quaternion): number;
  13115. /**
  13116. * Computes the linear interpolation or extrapolation at t using the provided quaternions.
  13117. * @param start - The value corresponding to t at 0.0.
  13118. * @param end - The value corresponding to t at 1.0.
  13119. * @param t - The point along t at which to interpolate.
  13120. * @param result - The object onto which to store the result.
  13121. * @returns The modified result parameter.
  13122. */
  13123. static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13124. /**
  13125. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13126. * @param start - The value corresponding to t at 0.0.
  13127. * @param end - The value corresponding to t at 1.0.
  13128. * @param t - The point along t at which to interpolate.
  13129. * @param result - The object onto which to store the result.
  13130. * @returns The modified result parameter.
  13131. */
  13132. static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13133. /**
  13134. * The logarithmic quaternion function.
  13135. * @param quaternion - The unit quaternion.
  13136. * @param result - The object onto which to store the result.
  13137. * @returns The modified result parameter.
  13138. */
  13139. static log(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13140. /**
  13141. * The exponential quaternion function.
  13142. * @param cartesian - The cartesian.
  13143. * @param result - The object onto which to store the result.
  13144. * @returns The modified result parameter.
  13145. */
  13146. static exp(cartesian: Cartesian3, result: Quaternion): Quaternion;
  13147. /**
  13148. * Computes an inner quadrangle point.
  13149. * <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>
  13150. * @param q0 - The first quaternion.
  13151. * @param q1 - The second quaternion.
  13152. * @param q2 - The third quaternion.
  13153. * @param result - The object onto which to store the result.
  13154. * @returns The modified result parameter.
  13155. */
  13156. static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion;
  13157. /**
  13158. * Computes the spherical quadrangle interpolation between quaternions.
  13159. * @example
  13160. * // 1. compute the squad interpolation between two quaternions on a curve
  13161. * var s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());
  13162. * var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());
  13163. * var q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());
  13164. *
  13165. * // 2. compute the squad interpolation as above but where the first quaternion is a end point.
  13166. * var s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());
  13167. * var q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());
  13168. * @param q0 - The first quaternion.
  13169. * @param q1 - The second quaternion.
  13170. * @param s0 - The first inner quadrangle.
  13171. * @param s1 - The second inner quadrangle.
  13172. * @param t - The time in [0,1] used to interpolate.
  13173. * @param result - The object onto which to store the result.
  13174. * @returns The modified result parameter.
  13175. */
  13176. static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13177. /**
  13178. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13179. * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.
  13180. * @param start - The value corresponding to t at 0.0.
  13181. * @param end - The value corresponding to t at 1.0.
  13182. * @param t - The point along t at which to interpolate.
  13183. * @param result - The object onto which to store the result.
  13184. * @returns The modified result parameter.
  13185. */
  13186. static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13187. /**
  13188. * Computes the spherical quadrangle interpolation between quaternions.
  13189. * An implementation that is faster than {@link Quaternion#squad}, but less accurate.
  13190. * @param q0 - The first quaternion.
  13191. * @param q1 - The second quaternion.
  13192. * @param s0 - The first inner quadrangle.
  13193. * @param s1 - The second inner quadrangle.
  13194. * @param t - The time in [0,1] used to interpolate.
  13195. * @param result - The object onto which to store the result.
  13196. * @returns The modified result parameter or a new instance if none was provided.
  13197. */
  13198. static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13199. /**
  13200. * Compares the provided quaternions componentwise and returns
  13201. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13202. * @param [left] - The first quaternion.
  13203. * @param [right] - The second quaternion.
  13204. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13205. */
  13206. static equals(left?: Quaternion, right?: Quaternion): boolean;
  13207. /**
  13208. * Compares the provided quaternions componentwise and returns
  13209. * <code>true</code> if they are within the provided epsilon,
  13210. * <code>false</code> otherwise.
  13211. * @param [left] - The first quaternion.
  13212. * @param [right] - The second quaternion.
  13213. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13214. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13215. */
  13216. static equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean;
  13217. /**
  13218. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
  13219. */
  13220. static readonly ZERO: Quaternion;
  13221. /**
  13222. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
  13223. */
  13224. static readonly IDENTITY: Quaternion;
  13225. /**
  13226. * Duplicates this Quaternion instance.
  13227. * @param [result] - The object onto which to store the result.
  13228. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13229. */
  13230. clone(result?: Quaternion): Quaternion;
  13231. /**
  13232. * Compares this and the provided quaternion componentwise and returns
  13233. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13234. * @param [right] - The right hand side quaternion.
  13235. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13236. */
  13237. equals(right?: Quaternion): boolean;
  13238. /**
  13239. * Compares this and the provided quaternion componentwise and returns
  13240. * <code>true</code> if they are within the provided epsilon,
  13241. * <code>false</code> otherwise.
  13242. * @param [right] - The right hand side quaternion.
  13243. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13244. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13245. */
  13246. equalsEpsilon(right?: Quaternion, epsilon?: number): boolean;
  13247. /**
  13248. * Returns a string representing this quaternion in the format (x, y, z, w).
  13249. * @returns A string representing this Quaternion.
  13250. */
  13251. toString(): string;
  13252. }
  13253. /**
  13254. * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.
  13255. * The generated curve is in the class C<sup>1</sup>.
  13256. * @param options - Object with the following properties:
  13257. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  13258. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  13259. * @param options.points - The array of {@link Quaternion} control points.
  13260. */
  13261. export class QuaternionSpline {
  13262. constructor(options: {
  13263. times: number[];
  13264. points: Quaternion[];
  13265. });
  13266. /**
  13267. * An array of times for the control points.
  13268. */
  13269. readonly times: number[];
  13270. /**
  13271. * An array of {@link Quaternion} control points.
  13272. */
  13273. readonly points: Quaternion[];
  13274. /**
  13275. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  13276. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  13277. * @param time - The time.
  13278. * @returns The index for the element at the start of the interval.
  13279. */
  13280. findTimeInterval(time: number): number;
  13281. /**
  13282. * Wraps the given time to the period covered by the spline.
  13283. * @param time - The time.
  13284. * @returns The time, wrapped around to the updated animation.
  13285. */
  13286. wrapTime(time: number): number;
  13287. /**
  13288. * Clamps the given time to the period covered by the spline.
  13289. * @param time - The time.
  13290. * @returns The time, clamped to the animation period.
  13291. */
  13292. clampTime(time: number): number;
  13293. /**
  13294. * Evaluates the curve at a given time.
  13295. * @param time - The time at which to evaluate the curve.
  13296. * @param [result] - The object onto which to store the result.
  13297. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  13298. */
  13299. evaluate(time: number, result?: Quaternion): Quaternion;
  13300. }
  13301. /**
  13302. * A queue that can enqueue items at the end, and dequeue items from the front.
  13303. */
  13304. export class Queue {
  13305. constructor();
  13306. /**
  13307. * The length of the queue.
  13308. */
  13309. readonly length: number;
  13310. /**
  13311. * Enqueues the specified item.
  13312. * @param item - The item to enqueue.
  13313. */
  13314. enqueue(item: any): void;
  13315. /**
  13316. * Dequeues an item. Returns undefined if the queue is empty.
  13317. * @returns The the dequeued item.
  13318. */
  13319. dequeue(): any;
  13320. /**
  13321. * Returns the item at the front of the queue. Returns undefined if the queue is empty.
  13322. * @returns The item at the front of the queue.
  13323. */
  13324. peek(): any;
  13325. /**
  13326. * Check whether this queue contains the specified item.
  13327. * @param item - The item to search for.
  13328. */
  13329. contains(item: any): void;
  13330. /**
  13331. * Remove all items from the queue.
  13332. */
  13333. clear(): void;
  13334. /**
  13335. * Sort the items in the queue in-place.
  13336. * @param compareFunction - A function that defines the sort order.
  13337. */
  13338. sort(compareFunction: Queue.Comparator): void;
  13339. }
  13340. export namespace Queue {
  13341. /**
  13342. * A function used to compare two items while sorting a queue.
  13343. * @example
  13344. * function compareNumbers(a, b) {
  13345. * return a - b;
  13346. * }
  13347. * @param a - An item in the array.
  13348. * @param b - An item in the array.
  13349. */
  13350. type Comparator = (a: any, b: any) => number;
  13351. }
  13352. /**
  13353. * Represents a ray that extends infinitely from the provided origin in the provided direction.
  13354. * @param [origin = Cartesian3.ZERO] - The origin of the ray.
  13355. * @param [direction = Cartesian3.ZERO] - The direction of the ray.
  13356. */
  13357. export class Ray {
  13358. constructor(origin?: Cartesian3, direction?: Cartesian3);
  13359. /**
  13360. * The origin of the ray.
  13361. */
  13362. origin: Cartesian3;
  13363. /**
  13364. * The direction of the ray.
  13365. */
  13366. direction: Cartesian3;
  13367. /**
  13368. * Duplicates a Ray instance.
  13369. * @param ray - The ray to duplicate.
  13370. * @param [result] - The object onto which to store the result.
  13371. * @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
  13372. */
  13373. static clone(ray: Ray, result?: Ray): Ray;
  13374. /**
  13375. * Computes the point along the ray given by r(t) = o + t*d,
  13376. * where o is the origin of the ray and d is the direction.
  13377. * @example
  13378. * //Get the first intersection point of a ray and an ellipsoid.
  13379. * var intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
  13380. * var point = Cesium.Ray.getPoint(ray, intersection.start);
  13381. * @param ray - The ray.
  13382. * @param t - A scalar value.
  13383. * @param [result] - The object in which the result will be stored.
  13384. * @returns The modified result parameter, or a new instance if none was provided.
  13385. */
  13386. static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3;
  13387. }
  13388. /**
  13389. * A two dimensional region specified as longitude and latitude coordinates.
  13390. * @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi].
  13391. * @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13392. * @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi].
  13393. * @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13394. */
  13395. export class Rectangle {
  13396. constructor(west?: number, south?: number, east?: number, north?: number);
  13397. /**
  13398. * The westernmost longitude in radians in the range [-Pi, Pi].
  13399. */
  13400. west: number;
  13401. /**
  13402. * The southernmost latitude in radians in the range [-Pi/2, Pi/2].
  13403. */
  13404. south: number;
  13405. /**
  13406. * The easternmost longitude in radians in the range [-Pi, Pi].
  13407. */
  13408. east: number;
  13409. /**
  13410. * The northernmost latitude in radians in the range [-Pi/2, Pi/2].
  13411. */
  13412. north: number;
  13413. /**
  13414. * Gets the width of the rectangle in radians.
  13415. */
  13416. readonly width: number;
  13417. /**
  13418. * Gets the height of the rectangle in radians.
  13419. */
  13420. readonly height: number;
  13421. /**
  13422. * The number of elements used to pack the object into an array.
  13423. */
  13424. static packedLength: number;
  13425. /**
  13426. * Stores the provided instance into the provided array.
  13427. * @param value - The value to pack.
  13428. * @param array - The array to pack into.
  13429. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13430. * @returns The array that was packed into
  13431. */
  13432. static pack(value: Rectangle, array: number[], startingIndex?: number): number[];
  13433. /**
  13434. * Retrieves an instance from a packed array.
  13435. * @param array - The packed array.
  13436. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13437. * @param [result] - The object into which to store the result.
  13438. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13439. */
  13440. static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle;
  13441. /**
  13442. * Computes the width of a rectangle in radians.
  13443. * @param rectangle - The rectangle to compute the width of.
  13444. * @returns The width.
  13445. */
  13446. static computeWidth(rectangle: Rectangle): number;
  13447. /**
  13448. * Computes the height of a rectangle in radians.
  13449. * @param rectangle - The rectangle to compute the height of.
  13450. * @returns The height.
  13451. */
  13452. static computeHeight(rectangle: Rectangle): number;
  13453. /**
  13454. * Creates a rectangle given the boundary longitude and latitude in degrees.
  13455. * @example
  13456. * var rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
  13457. * @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0].
  13458. * @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0].
  13459. * @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0].
  13460. * @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0].
  13461. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13462. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13463. */
  13464. static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13465. /**
  13466. * Creates a rectangle given the boundary longitude and latitude in radians.
  13467. * @example
  13468. * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
  13469. * @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI].
  13470. * @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13471. * @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI].
  13472. * @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13473. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13474. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13475. */
  13476. static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13477. /**
  13478. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13479. * @param cartographics - The list of Cartographic instances.
  13480. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13481. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13482. */
  13483. static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle;
  13484. /**
  13485. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13486. * @param cartesians - The list of Cartesian instances.
  13487. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on.
  13488. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13489. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13490. */
  13491. static fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
  13492. /**
  13493. * Duplicates a Rectangle.
  13494. * @param rectangle - The rectangle to clone.
  13495. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13496. * @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
  13497. */
  13498. static clone(rectangle: Rectangle, result?: Rectangle): Rectangle;
  13499. /**
  13500. * Compares the provided Rectangles componentwise and returns
  13501. * <code>true</code> if they pass an absolute or relative tolerance test,
  13502. * <code>false</code> otherwise.
  13503. * @param [left] - The first Rectangle.
  13504. * @param [right] - The second Rectangle.
  13505. * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing.
  13506. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13507. */
  13508. static equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean;
  13509. /**
  13510. * Duplicates this Rectangle.
  13511. * @param [result] - The object onto which to store the result.
  13512. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13513. */
  13514. clone(result?: Rectangle): Rectangle;
  13515. /**
  13516. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13517. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13518. * @param [other] - The Rectangle to compare.
  13519. * @returns <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.
  13520. */
  13521. equals(other?: Rectangle): boolean;
  13522. /**
  13523. * Compares the provided rectangles and returns <code>true</code> if they are equal,
  13524. * <code>false</code> otherwise.
  13525. * @param [left] - The first Rectangle.
  13526. * @param [right] - The second Rectangle.
  13527. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  13528. */
  13529. static equals(left?: Rectangle, right?: Rectangle): boolean;
  13530. /**
  13531. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13532. * <code>true</code> if they are within the provided epsilon,
  13533. * <code>false</code> otherwise.
  13534. * @param [other] - The Rectangle to compare.
  13535. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13536. * @returns <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.
  13537. */
  13538. equalsEpsilon(other?: Rectangle, epsilon?: number): boolean;
  13539. /**
  13540. * Checks a Rectangle's properties and throws if they are not in valid ranges.
  13541. * @param rectangle - The rectangle to validate
  13542. */
  13543. static validate(rectangle: Rectangle): void;
  13544. /**
  13545. * Computes the southwest corner of a rectangle.
  13546. * @param rectangle - The rectangle for which to find the corner
  13547. * @param [result] - The object onto which to store the result.
  13548. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13549. */
  13550. static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13551. /**
  13552. * Computes the northwest corner of a rectangle.
  13553. * @param rectangle - The rectangle for which to find the corner
  13554. * @param [result] - The object onto which to store the result.
  13555. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13556. */
  13557. static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13558. /**
  13559. * Computes the northeast corner of a rectangle.
  13560. * @param rectangle - The rectangle for which to find the corner
  13561. * @param [result] - The object onto which to store the result.
  13562. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13563. */
  13564. static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13565. /**
  13566. * Computes the southeast corner of a rectangle.
  13567. * @param rectangle - The rectangle for which to find the corner
  13568. * @param [result] - The object onto which to store the result.
  13569. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13570. */
  13571. static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13572. /**
  13573. * Computes the center of a rectangle.
  13574. * @param rectangle - The rectangle for which to find the center
  13575. * @param [result] - The object onto which to store the result.
  13576. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13577. */
  13578. static center(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13579. /**
  13580. * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
  13581. * latitude and longitude in radians and produces a correct intersection, taking into account the fact that
  13582. * the same angle can be represented with multiple values as well as the wrapping of longitude at the
  13583. * anti-meridian. For a simple intersection that ignores these factors and can be used with projected
  13584. * coordinates, see {@link Rectangle.simpleIntersection}.
  13585. * @param rectangle - On rectangle to find an intersection
  13586. * @param otherRectangle - Another rectangle to find an intersection
  13587. * @param [result] - The object onto which to store the result.
  13588. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13589. */
  13590. static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13591. /**
  13592. * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
  13593. * does not attempt to put the angular coordinates into a consistent range or to account for crossing the
  13594. * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
  13595. * and longitude (i.e. projected coordinates).
  13596. * @param rectangle - On rectangle to find an intersection
  13597. * @param otherRectangle - Another rectangle to find an intersection
  13598. * @param [result] - The object onto which to store the result.
  13599. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13600. */
  13601. static simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13602. /**
  13603. * Computes a rectangle that is the union of two rectangles.
  13604. * @param rectangle - A rectangle to enclose in rectangle.
  13605. * @param otherRectangle - A rectangle to enclose in a rectangle.
  13606. * @param [result] - The object onto which to store the result.
  13607. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13608. */
  13609. static union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle;
  13610. /**
  13611. * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
  13612. * @param rectangle - A rectangle to expand.
  13613. * @param cartographic - A cartographic to enclose in a rectangle.
  13614. * @param [result] - The object onto which to store the result.
  13615. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13616. */
  13617. static expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle;
  13618. /**
  13619. * Returns true if the cartographic is on or inside the rectangle, false otherwise.
  13620. * @param rectangle - The rectangle
  13621. * @param cartographic - The cartographic to test.
  13622. * @returns true if the provided cartographic is inside the rectangle, false otherwise.
  13623. */
  13624. static contains(rectangle: Rectangle, cartographic: Cartographic): boolean;
  13625. /**
  13626. * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
  13627. * {@link BoundingSphere#fromPoints}. Sampling is necessary to account
  13628. * for rectangles that cover the poles or cross the equator.
  13629. * @param rectangle - The rectangle to subsample.
  13630. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  13631. * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid.
  13632. * @param [result] - The array of Cartesians onto which to store the result.
  13633. * @returns The modified result parameter or a new Array of Cartesians instances if none was provided.
  13634. */
  13635. static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[];
  13636. /**
  13637. * The largest possible rectangle.
  13638. */
  13639. static readonly MAX_VALUE: Rectangle;
  13640. }
  13641. /**
  13642. * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  13643. * @example
  13644. * // 1. create a rectangle
  13645. * var rectangle = new Cesium.RectangleGeometry({
  13646. * ellipsoid : Cesium.Ellipsoid.WGS84,
  13647. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13648. * height : 10000.0
  13649. * });
  13650. * var geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  13651. *
  13652. * // 2. create an extruded rectangle without a top
  13653. * var rectangle = new Cesium.RectangleGeometry({
  13654. * ellipsoid : Cesium.Ellipsoid.WGS84,
  13655. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13656. * height : 10000.0,
  13657. * extrudedHeight: 300000
  13658. * });
  13659. * var geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  13660. * @param options - Object with the following properties:
  13661. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13662. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  13663. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13664. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13665. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13666. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13667. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  13668. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13669. */
  13670. export class RectangleGeometry {
  13671. constructor(options: {
  13672. rectangle: Rectangle;
  13673. vertexFormat?: VertexFormat;
  13674. ellipsoid?: Ellipsoid;
  13675. granularity?: number;
  13676. height?: number;
  13677. rotation?: number;
  13678. stRotation?: number;
  13679. extrudedHeight?: number;
  13680. });
  13681. /**
  13682. * The number of elements used to pack the object into an array.
  13683. */
  13684. static packedLength: number;
  13685. /**
  13686. * Stores the provided instance into the provided array.
  13687. * @param value - The value to pack.
  13688. * @param array - The array to pack into.
  13689. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13690. * @returns The array that was packed into
  13691. */
  13692. static pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[];
  13693. /**
  13694. * Retrieves an instance from a packed array.
  13695. * @param array - The packed array.
  13696. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13697. * @param [result] - The object into which to store the result.
  13698. * @returns The modified result parameter or a new RectangleGeometry instance if one was not provided.
  13699. */
  13700. static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry;
  13701. /**
  13702. * Computes the bounding rectangle based on the provided options
  13703. * @param options - Object with the following properties:
  13704. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13705. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13706. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13707. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13708. * @param [result] - An object in which to store the result.
  13709. * @returns The result rectangle
  13710. */
  13711. static computeRectangle(options: {
  13712. rectangle: Rectangle;
  13713. ellipsoid?: Ellipsoid;
  13714. granularity?: number;
  13715. rotation?: number;
  13716. }, result?: Rectangle): Rectangle;
  13717. /**
  13718. * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
  13719. * @param rectangleGeometry - A description of the rectangle.
  13720. * @returns The computed vertices and indices.
  13721. */
  13722. static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined;
  13723. }
  13724. /**
  13725. * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
  13726. * @example
  13727. * var rectangle = new Cesium.RectangleOutlineGeometry({
  13728. * ellipsoid : Cesium.Ellipsoid.WGS84,
  13729. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  13730. * height : 10000.0
  13731. * });
  13732. * var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
  13733. * @param options - Object with the following properties:
  13734. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  13735. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  13736. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  13737. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  13738. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  13739. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  13740. */
  13741. export class RectangleOutlineGeometry {
  13742. constructor(options: {
  13743. rectangle: Rectangle;
  13744. ellipsoid?: Ellipsoid;
  13745. granularity?: number;
  13746. height?: number;
  13747. rotation?: number;
  13748. extrudedHeight?: number;
  13749. });
  13750. /**
  13751. * The number of elements used to pack the object into an array.
  13752. */
  13753. static packedLength: number;
  13754. /**
  13755. * Stores the provided instance into the provided array.
  13756. * @param value - The value to pack.
  13757. * @param array - The array to pack into.
  13758. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13759. * @returns The array that was packed into
  13760. */
  13761. static pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[];
  13762. /**
  13763. * Retrieves an instance from a packed array.
  13764. * @param array - The packed array.
  13765. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13766. * @param [result] - The object into which to store the result.
  13767. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13768. */
  13769. static unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry;
  13770. /**
  13771. * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
  13772. * @param rectangleGeometry - A description of the rectangle outline.
  13773. * @returns The computed vertices and indices.
  13774. */
  13775. static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined;
  13776. }
  13777. /**
  13778. * Constants for identifying well-known reference frames.
  13779. */
  13780. export enum ReferenceFrame {
  13781. /**
  13782. * The fixed frame.
  13783. */
  13784. FIXED = 0,
  13785. /**
  13786. * The inertial frame.
  13787. */
  13788. INERTIAL = 1
  13789. }
  13790. /**
  13791. * Stores information for making a request. In general this does not need to be constructed directly.
  13792. * @param [options] - An object with the following properties:
  13793. * @param [options.url] - The url to request.
  13794. * @param [options.requestFunction] - The function that makes the actual data request.
  13795. * @param [options.cancelFunction] - The function that is called when the request is cancelled.
  13796. * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame.
  13797. * @param [options.priority = 0.0] - The initial priority of the request.
  13798. * @param [options.throttle = false] - Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.
  13799. * @param [options.throttleByServer = false] - Whether to throttle the request by server.
  13800. * @param [options.type = RequestType.OTHER] - The type of request.
  13801. */
  13802. export class Request {
  13803. constructor(options?: {
  13804. url?: string;
  13805. requestFunction?: Request.RequestCallback;
  13806. cancelFunction?: Request.CancelCallback;
  13807. priorityFunction?: Request.PriorityCallback;
  13808. priority?: number;
  13809. throttle?: boolean;
  13810. throttleByServer?: boolean;
  13811. type?: RequestType;
  13812. });
  13813. /**
  13814. * The URL to request.
  13815. */
  13816. url: string;
  13817. /**
  13818. * The function that makes the actual data request.
  13819. */
  13820. requestFunction: Request.RequestCallback;
  13821. /**
  13822. * The function that is called when the request is cancelled.
  13823. */
  13824. cancelFunction: Request.CancelCallback;
  13825. /**
  13826. * The function that is called to update the request's priority, which occurs once per frame.
  13827. */
  13828. priorityFunction: Request.PriorityCallback;
  13829. /**
  13830. * Priority is a unit-less value where lower values represent higher priority.
  13831. * For world-based objects, this is usually the distance from the camera.
  13832. * A request that does not have a priority function defaults to a priority of 0.
  13833. *
  13834. * If priorityFunction is defined, this value is updated every frame with the result of that call.
  13835. */
  13836. priority: number;
  13837. /**
  13838. * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
  13839. * request will be throttled and sent based on priority.
  13840. */
  13841. readonly throttle: boolean;
  13842. /**
  13843. * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
  13844. * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
  13845. * to <code>true</code> is preferable for requests going through HTTP/1 servers.
  13846. */
  13847. readonly throttleByServer: boolean;
  13848. /**
  13849. * Type of request.
  13850. */
  13851. readonly type: RequestType;
  13852. /**
  13853. * The current state of the request.
  13854. */
  13855. readonly state: RequestState;
  13856. /**
  13857. * Duplicates a Request instance.
  13858. * @param [result] - The object onto which to store the result.
  13859. * @returns The modified result parameter or a new Resource instance if one was not provided.
  13860. */
  13861. clone(result?: Request): Request;
  13862. }
  13863. export namespace Request {
  13864. /**
  13865. * The function that makes the actual data request.
  13866. */
  13867. type RequestCallback = () => Promise<void>;
  13868. /**
  13869. * The function that is called when the request is cancelled.
  13870. */
  13871. type CancelCallback = () => void;
  13872. /**
  13873. * The function that is called to update the request's priority, which occurs once per frame.
  13874. */
  13875. type PriorityCallback = () => number;
  13876. }
  13877. /**
  13878. * An event that is raised when a request encounters an error.
  13879. * @param [statusCode] - The HTTP error status code, such as 404.
  13880. * @param [response] - The response included along with the error.
  13881. * @param [responseHeaders] - The response headers, represented either as an object literal or as a
  13882. * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
  13883. */
  13884. export class RequestErrorEvent {
  13885. constructor(statusCode?: number, response?: any, responseHeaders?: string | any);
  13886. /**
  13887. * The HTTP error status code, such as 404. If the error does not have a particular
  13888. * HTTP code, this property will be undefined.
  13889. */
  13890. statusCode: number;
  13891. /**
  13892. * The response included along with the error. If the error does not include a response,
  13893. * this property will be undefined.
  13894. */
  13895. response: any;
  13896. /**
  13897. * The headers included in the response, represented as an object literal of key/value pairs.
  13898. * If the error does not include any headers, this property will be undefined.
  13899. */
  13900. responseHeaders: any;
  13901. /**
  13902. * Creates a string representing this RequestErrorEvent.
  13903. * @returns A string representing the provided RequestErrorEvent.
  13904. */
  13905. toString(): string;
  13906. }
  13907. /**
  13908. * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
  13909. * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
  13910. * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
  13911. * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired.
  13912. */
  13913. export namespace RequestScheduler {
  13914. /**
  13915. * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
  13916. */
  13917. var maximumRequests: number;
  13918. /**
  13919. * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
  13920. * listed in {@link requestsByServer} do not observe this limit.
  13921. */
  13922. var maximumRequestsPerServer: number;
  13923. /**
  13924. * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
  13925. * @example
  13926. * RequestScheduler.requestsByServer = {
  13927. * 'api.cesium.com:443': 18,
  13928. * 'assets.cesium.com:443': 18
  13929. * };
  13930. */
  13931. var requestsByServer: any;
  13932. /**
  13933. * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
  13934. */
  13935. var throttleRequests: boolean;
  13936. }
  13937. /**
  13938. * State of the request.
  13939. */
  13940. export enum RequestState {
  13941. /**
  13942. * Initial unissued state.
  13943. */
  13944. UNISSUED = 0,
  13945. /**
  13946. * Issued but not yet active. Will become active when open slots are available.
  13947. */
  13948. ISSUED = 1,
  13949. /**
  13950. * Actual http request has been sent.
  13951. */
  13952. ACTIVE = 2,
  13953. /**
  13954. * Request completed successfully.
  13955. */
  13956. RECEIVED = 3,
  13957. /**
  13958. * Request was cancelled, either explicitly or automatically because of low priority.
  13959. */
  13960. CANCELLED = 4,
  13961. /**
  13962. * Request failed.
  13963. */
  13964. FAILED = 5
  13965. }
  13966. /**
  13967. * An enum identifying the type of request. Used for finer grained logging and priority sorting.
  13968. */
  13969. export enum RequestType {
  13970. /**
  13971. * Terrain request.
  13972. */
  13973. TERRAIN = 0,
  13974. /**
  13975. * Imagery request.
  13976. */
  13977. IMAGERY = 1,
  13978. /**
  13979. * 3D Tiles request.
  13980. */
  13981. TILES3D = 2,
  13982. /**
  13983. * Other request.
  13984. */
  13985. OTHER = 3
  13986. }
  13987. /**
  13988. * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests.
  13989. * @example
  13990. * function refreshTokenRetryCallback(resource, error) {
  13991. * if (error.statusCode === 403) {
  13992. * // 403 status code means a new token should be generated
  13993. * return getNewAccessToken()
  13994. * .then(function(token) {
  13995. * resource.queryParameters.access_token = token;
  13996. * return true;
  13997. * })
  13998. * .otherwise(function() {
  13999. * return false;
  14000. * });
  14001. * }
  14002. *
  14003. * return false;
  14004. * }
  14005. *
  14006. * var resource = new Resource({
  14007. * url: 'http://server.com/path/to/resource.json',
  14008. * proxy: new DefaultProxy('/proxy/'),
  14009. * headers: {
  14010. * 'X-My-Header': 'valueOfHeader'
  14011. * },
  14012. * queryParameters: {
  14013. * 'access_token': '123-435-456-000'
  14014. * },
  14015. * retryCallback: refreshTokenRetryCallback,
  14016. * retryAttempts: 1
  14017. * });
  14018. * @param options - A url or an object with the following properties
  14019. * @param options.url - The url of the resource.
  14020. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14021. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14022. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14023. * @param [options.proxy] - A proxy to be used when loading the resource.
  14024. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14025. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14026. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14027. */
  14028. export class Resource {
  14029. constructor(options: {
  14030. url: string;
  14031. queryParameters?: any;
  14032. templateValues?: any;
  14033. headers?: any;
  14034. proxy?: Proxy;
  14035. retryCallback?: Resource.RetryCallback;
  14036. retryAttempts?: number;
  14037. request?: Request;
  14038. });
  14039. /**
  14040. * Additional HTTP headers that will be sent with the request.
  14041. */
  14042. headers: any;
  14043. /**
  14044. * A Request object that will be used. Intended for internal use only.
  14045. */
  14046. request: Request;
  14047. /**
  14048. * A proxy to be used when loading the resource.
  14049. */
  14050. proxy: Proxy;
  14051. /**
  14052. * Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried.
  14053. */
  14054. retryCallback: (...params: any[]) => any;
  14055. /**
  14056. * The number of times the retryCallback should be called before giving up.
  14057. */
  14058. retryAttempts: number;
  14059. /**
  14060. * Returns true if blobs are supported.
  14061. */
  14062. static readonly isBlobSupported: boolean;
  14063. /**
  14064. * Query parameters appended to the url.
  14065. */
  14066. readonly queryParameters: any;
  14067. /**
  14068. * The key/value pairs used to replace template parameters in the url.
  14069. */
  14070. readonly templateValues: any;
  14071. /**
  14072. * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
  14073. */
  14074. url: string;
  14075. /**
  14076. * The file extension of the resource.
  14077. */
  14078. readonly extension: string;
  14079. /**
  14080. * True if the Resource refers to a data URI.
  14081. */
  14082. isDataUri: boolean;
  14083. /**
  14084. * True if the Resource refers to a blob URI.
  14085. */
  14086. isBlobUri: boolean;
  14087. /**
  14088. * True if the Resource refers to a cross origin URL.
  14089. */
  14090. isCrossOriginUrl: boolean;
  14091. /**
  14092. * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
  14093. */
  14094. hasHeaders: boolean;
  14095. /**
  14096. * Override Object#toString so that implicit string conversion gives the
  14097. * complete URL represented by this Resource.
  14098. * @returns The URL represented by this Resource
  14099. */
  14100. toString(): string;
  14101. /**
  14102. * Returns the url, optional with the query string and processed by a proxy.
  14103. * @param [query = false] - If true, the query string is included.
  14104. * @param [proxy = false] - If true, the url is processed by the proxy object, if defined.
  14105. * @returns The url with all the requested components.
  14106. */
  14107. getUrlComponent(query?: boolean, proxy?: boolean): string;
  14108. /**
  14109. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14110. * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.
  14111. * @param params - The query parameters
  14112. * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined.
  14113. */
  14114. setQueryParameters(params: any, useAsDefault?: boolean): void;
  14115. /**
  14116. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14117. * as opposed to adding them one at a time to the queryParameters property.
  14118. * @param params - The query parameters
  14119. */
  14120. appendQueryParameters(params: any): void;
  14121. /**
  14122. * Combines the specified object and the existing template values. This allows you to add many values at once,
  14123. * as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended.
  14124. * @param template - The template values
  14125. * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined.
  14126. */
  14127. setTemplateValues(template: any, useAsDefault?: boolean): void;
  14128. /**
  14129. * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
  14130. * @param options - An object with the following properties
  14131. * @param [options.url] - The url that will be resolved relative to the url of the current instance.
  14132. * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance.
  14133. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance.
  14134. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14135. * @param [options.proxy] - A proxy to be used when loading the resource.
  14136. * @param [options.retryCallback] - The function to call when loading the resource fails.
  14137. * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up.
  14138. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14139. * @param [options.preserveQueryParameters = false] - If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource.
  14140. * @returns The resource derived from the current one.
  14141. */
  14142. getDerivedResource(options: {
  14143. url?: string;
  14144. queryParameters?: any;
  14145. templateValues?: any;
  14146. headers?: any;
  14147. proxy?: Proxy;
  14148. retryCallback?: Resource.RetryCallback;
  14149. retryAttempts?: number;
  14150. request?: Request;
  14151. preserveQueryParameters?: boolean;
  14152. }): Resource;
  14153. /**
  14154. * Duplicates a Resource instance.
  14155. * @param [result] - The object onto which to store the result.
  14156. * @returns The modified result parameter or a new Resource instance if one was not provided.
  14157. */
  14158. clone(result?: Resource): Resource;
  14159. /**
  14160. * Returns the base path of the Resource.
  14161. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  14162. * @returns The base URI of the resource
  14163. */
  14164. getBaseUri(includeQuery?: boolean): string;
  14165. /**
  14166. * Appends a forward slash to the URL.
  14167. */
  14168. appendForwardSlash(): void;
  14169. /**
  14170. * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
  14171. * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
  14172. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14173. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14174. * @example
  14175. * // load a single URL asynchronously
  14176. * resource.fetchArrayBuffer().then(function(arrayBuffer) {
  14177. * // use the data
  14178. * }).otherwise(function(error) {
  14179. * // an error occurred
  14180. * });
  14181. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14182. */
  14183. fetchArrayBuffer(): Promise<ArrayBuffer> | undefined;
  14184. /**
  14185. * Creates a Resource and calls fetchArrayBuffer() on it.
  14186. * @param options - A url or an object with the following properties
  14187. * @param options.url - The url of the resource.
  14188. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14189. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14190. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14191. * @param [options.proxy] - A proxy to be used when loading the resource.
  14192. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14193. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14194. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14195. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14196. */
  14197. static fetchArrayBuffer(options: {
  14198. url: string;
  14199. queryParameters?: any;
  14200. templateValues?: any;
  14201. headers?: any;
  14202. proxy?: Proxy;
  14203. retryCallback?: Resource.RetryCallback;
  14204. retryAttempts?: number;
  14205. request?: Request;
  14206. }): Promise<ArrayBuffer> | undefined;
  14207. /**
  14208. * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
  14209. * a Blob once loaded, or reject if the resource failed to load. The data is loaded
  14210. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14211. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14212. * @example
  14213. * // load a single URL asynchronously
  14214. * resource.fetchBlob().then(function(blob) {
  14215. * // use the data
  14216. * }).otherwise(function(error) {
  14217. * // an error occurred
  14218. * });
  14219. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14220. */
  14221. fetchBlob(): Promise<Blob> | undefined;
  14222. /**
  14223. * Creates a Resource and calls fetchBlob() on it.
  14224. * @param options - A url or an object with the following properties
  14225. * @param options.url - The url of the resource.
  14226. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14227. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14228. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14229. * @param [options.proxy] - A proxy to be used when loading the resource.
  14230. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14231. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14232. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14233. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14234. */
  14235. static fetchBlob(options: {
  14236. url: string;
  14237. queryParameters?: any;
  14238. templateValues?: any;
  14239. headers?: any;
  14240. proxy?: Proxy;
  14241. retryCallback?: Resource.RetryCallback;
  14242. retryAttempts?: number;
  14243. request?: Request;
  14244. }): Promise<Blob> | undefined;
  14245. /**
  14246. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  14247. * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if <code>preferImageBitmap</code> is true and the browser supports <code>createImageBitmap</code> or otherwise an
  14248. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  14249. * @example
  14250. * // load a single image asynchronously
  14251. * resource.fetchImage().then(function(image) {
  14252. * // use the loaded image
  14253. * }).otherwise(function(error) {
  14254. * // an error occurred
  14255. * });
  14256. *
  14257. * // load several images in parallel
  14258. * when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  14259. * // images is an array containing all the loaded images
  14260. * });
  14261. * @param [options] - An object with the following properties.
  14262. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14263. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14264. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  14265. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.
  14266. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14267. */
  14268. fetchImage(options?: {
  14269. preferBlob?: boolean;
  14270. preferImageBitmap?: boolean;
  14271. flipY?: boolean;
  14272. skipColorSpaceConversion?: boolean;
  14273. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  14274. /**
  14275. * Creates a Resource and calls fetchImage() on it.
  14276. * @param options - A url or an object with the following properties
  14277. * @param options.url - The url of the resource.
  14278. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14279. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14280. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14281. * @param [options.proxy] - A proxy to be used when loading the resource.
  14282. * @param [options.flipY = false] - Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>.
  14283. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14284. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14285. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14286. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14287. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14288. * @param [options.skipColorSpaceConversion = false] - If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports <code>createImageBitmap</code>.
  14289. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14290. */
  14291. static fetchImage(options: {
  14292. url: string;
  14293. queryParameters?: any;
  14294. templateValues?: any;
  14295. headers?: any;
  14296. proxy?: Proxy;
  14297. flipY?: boolean;
  14298. retryCallback?: Resource.RetryCallback;
  14299. retryAttempts?: number;
  14300. request?: Request;
  14301. preferBlob?: boolean;
  14302. preferImageBitmap?: boolean;
  14303. skipColorSpaceConversion?: boolean;
  14304. }): Promise<ImageBitmap> | Promise<HTMLImageElement> | undefined;
  14305. /**
  14306. * Asynchronously loads the given resource as text. Returns a promise that will resolve to
  14307. * a String once loaded, or reject if the resource failed to load. The data is loaded
  14308. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14309. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14310. * @example
  14311. * // load text from a URL, setting a custom header
  14312. * var resource = new Resource({
  14313. * url: 'http://someUrl.com/someJson.txt',
  14314. * headers: {
  14315. * 'X-Custom-Header' : 'some value'
  14316. * }
  14317. * });
  14318. * resource.fetchText().then(function(text) {
  14319. * // Do something with the text
  14320. * }).otherwise(function(error) {
  14321. * // an error occurred
  14322. * });
  14323. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14324. */
  14325. fetchText(): Promise<string> | undefined;
  14326. /**
  14327. * Creates a Resource and calls fetchText() on it.
  14328. * @param options - A url or an object with the following properties
  14329. * @param options.url - The url of the resource.
  14330. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14331. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14332. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14333. * @param [options.proxy] - A proxy to be used when loading the resource.
  14334. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14335. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14336. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14337. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14338. */
  14339. static fetchText(options: {
  14340. url: string;
  14341. queryParameters?: any;
  14342. templateValues?: any;
  14343. headers?: any;
  14344. proxy?: Proxy;
  14345. retryCallback?: Resource.RetryCallback;
  14346. retryAttempts?: number;
  14347. request?: Request;
  14348. }): Promise<string> | undefined;
  14349. /**
  14350. * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
  14351. * a JSON object once loaded, or reject if the resource failed to load. The data is loaded
  14352. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14353. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
  14354. * adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not
  14355. * already specified.
  14356. * @example
  14357. * resource.fetchJson().then(function(jsonData) {
  14358. * // Do something with the JSON object
  14359. * }).otherwise(function(error) {
  14360. * // an error occurred
  14361. * });
  14362. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14363. */
  14364. fetchJson(): Promise<any> | undefined;
  14365. /**
  14366. * Creates a Resource and calls fetchJson() on it.
  14367. * @param options - A url or an object with the following properties
  14368. * @param options.url - The url of the resource.
  14369. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14370. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14371. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14372. * @param [options.proxy] - A proxy to be used when loading the resource.
  14373. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14374. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14375. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14376. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14377. */
  14378. static fetchJson(options: {
  14379. url: string;
  14380. queryParameters?: any;
  14381. templateValues?: any;
  14382. headers?: any;
  14383. proxy?: Proxy;
  14384. retryCallback?: Resource.RetryCallback;
  14385. retryAttempts?: number;
  14386. request?: Request;
  14387. }): Promise<any> | undefined;
  14388. /**
  14389. * Asynchronously loads the given resource as XML. Returns a promise that will resolve to
  14390. * an XML Document once loaded, or reject if the resource failed to load. The data is loaded
  14391. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14392. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14393. * @example
  14394. * // load XML from a URL, setting a custom header
  14395. * Cesium.loadXML('http://someUrl.com/someXML.xml', {
  14396. * 'X-Custom-Header' : 'some value'
  14397. * }).then(function(document) {
  14398. * // Do something with the document
  14399. * }).otherwise(function(error) {
  14400. * // an error occurred
  14401. * });
  14402. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14403. */
  14404. fetchXML(): Promise<XMLDocument> | undefined;
  14405. /**
  14406. * Creates a Resource and calls fetchXML() on it.
  14407. * @param options - A url or an object with the following properties
  14408. * @param options.url - The url of the resource.
  14409. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14410. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14411. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14412. * @param [options.proxy] - A proxy to be used when loading the resource.
  14413. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14414. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14415. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14416. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14417. */
  14418. static fetchXML(options: {
  14419. url: string;
  14420. queryParameters?: any;
  14421. templateValues?: any;
  14422. headers?: any;
  14423. proxy?: Proxy;
  14424. retryCallback?: Resource.RetryCallback;
  14425. retryAttempts?: number;
  14426. request?: Request;
  14427. }): Promise<XMLDocument> | undefined;
  14428. /**
  14429. * Requests a resource using JSONP.
  14430. * @example
  14431. * // load a data asynchronously
  14432. * resource.fetchJsonp().then(function(data) {
  14433. * // use the loaded data
  14434. * }).otherwise(function(error) {
  14435. * // an error occurred
  14436. * });
  14437. * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14438. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14439. */
  14440. fetchJsonp(callbackParameterName?: string): Promise<any> | undefined;
  14441. /**
  14442. * Creates a Resource from a URL and calls fetchJsonp() on it.
  14443. * @param options - A url or an object with the following properties
  14444. * @param options.url - The url of the resource.
  14445. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14446. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14447. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14448. * @param [options.proxy] - A proxy to be used when loading the resource.
  14449. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14450. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14451. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14452. * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14453. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14454. */
  14455. static fetchJsonp(options: {
  14456. url: string;
  14457. queryParameters?: any;
  14458. templateValues?: any;
  14459. headers?: any;
  14460. proxy?: Proxy;
  14461. retryCallback?: Resource.RetryCallback;
  14462. retryAttempts?: number;
  14463. request?: Request;
  14464. callbackParameterName?: string;
  14465. }): Promise<any> | undefined;
  14466. /**
  14467. * Asynchronously loads the given resource. Returns a promise that will resolve to
  14468. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14469. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14470. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
  14471. * the more specific functions eg. fetchJson, fetchBlob, etc.
  14472. * @example
  14473. * resource.fetch()
  14474. * .then(function(body) {
  14475. * // use the data
  14476. * }).otherwise(function(error) {
  14477. * // an error occurred
  14478. * });
  14479. * @param [options] - Object with the following properties:
  14480. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14481. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14482. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14483. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14484. */
  14485. fetch(options?: {
  14486. responseType?: string;
  14487. headers?: any;
  14488. overrideMimeType?: string;
  14489. }): Promise<any> | undefined;
  14490. /**
  14491. * Creates a Resource from a URL and calls fetch() on it.
  14492. * @param options - A url or an object with the following properties
  14493. * @param options.url - The url of the resource.
  14494. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14495. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14496. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14497. * @param [options.proxy] - A proxy to be used when loading the resource.
  14498. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14499. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14500. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14501. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14502. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14503. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14504. */
  14505. static fetch(options: {
  14506. url: string;
  14507. queryParameters?: any;
  14508. templateValues?: any;
  14509. headers?: any;
  14510. proxy?: Proxy;
  14511. retryCallback?: Resource.RetryCallback;
  14512. retryAttempts?: number;
  14513. request?: Request;
  14514. responseType?: string;
  14515. overrideMimeType?: string;
  14516. }): Promise<any> | undefined;
  14517. /**
  14518. * Asynchronously deletes the given resource. Returns a promise that will resolve to
  14519. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14520. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14521. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14522. * @example
  14523. * resource.delete()
  14524. * .then(function(body) {
  14525. * // use the data
  14526. * }).otherwise(function(error) {
  14527. * // an error occurred
  14528. * });
  14529. * @param [options] - Object with the following properties:
  14530. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14531. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14532. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14533. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14534. */
  14535. delete(options?: {
  14536. responseType?: string;
  14537. headers?: any;
  14538. overrideMimeType?: string;
  14539. }): Promise<any> | undefined;
  14540. /**
  14541. * Creates a Resource from a URL and calls delete() on it.
  14542. * @param options - A url or an object with the following properties
  14543. * @param options.url - The url of the resource.
  14544. * @param [options.data] - Data that is posted with the resource.
  14545. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14546. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14547. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14548. * @param [options.proxy] - A proxy to be used when loading the resource.
  14549. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14550. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14551. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14552. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14553. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14554. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14555. */
  14556. static delete(options: {
  14557. url: string;
  14558. data?: any;
  14559. queryParameters?: any;
  14560. templateValues?: any;
  14561. headers?: any;
  14562. proxy?: Proxy;
  14563. retryCallback?: Resource.RetryCallback;
  14564. retryAttempts?: number;
  14565. request?: Request;
  14566. responseType?: string;
  14567. overrideMimeType?: string;
  14568. }): Promise<any> | undefined;
  14569. /**
  14570. * Asynchronously gets headers the given resource. Returns a promise that will resolve to
  14571. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14572. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14573. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14574. * @example
  14575. * resource.head()
  14576. * .then(function(headers) {
  14577. * // use the data
  14578. * }).otherwise(function(error) {
  14579. * // an error occurred
  14580. * });
  14581. * @param [options] - Object with the following properties:
  14582. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14583. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14584. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14585. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14586. */
  14587. head(options?: {
  14588. responseType?: string;
  14589. headers?: any;
  14590. overrideMimeType?: string;
  14591. }): Promise<any> | undefined;
  14592. /**
  14593. * Creates a Resource from a URL and calls head() on it.
  14594. * @param options - A url or an object with the following properties
  14595. * @param options.url - The url of the resource.
  14596. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14597. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14598. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14599. * @param [options.proxy] - A proxy to be used when loading the resource.
  14600. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14601. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14602. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14603. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14604. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14605. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14606. */
  14607. static head(options: {
  14608. url: string;
  14609. queryParameters?: any;
  14610. templateValues?: any;
  14611. headers?: any;
  14612. proxy?: Proxy;
  14613. retryCallback?: Resource.RetryCallback;
  14614. retryAttempts?: number;
  14615. request?: Request;
  14616. responseType?: string;
  14617. overrideMimeType?: string;
  14618. }): Promise<any> | undefined;
  14619. /**
  14620. * Asynchronously gets options the given resource. Returns a promise that will resolve to
  14621. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14622. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14623. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14624. * @example
  14625. * resource.options()
  14626. * .then(function(headers) {
  14627. * // use the data
  14628. * }).otherwise(function(error) {
  14629. * // an error occurred
  14630. * });
  14631. * @param [options] - Object with the following properties:
  14632. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14633. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14634. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14635. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14636. */
  14637. options(options?: {
  14638. responseType?: string;
  14639. headers?: any;
  14640. overrideMimeType?: string;
  14641. }): Promise<any> | undefined;
  14642. /**
  14643. * Creates a Resource from a URL and calls options() on it.
  14644. * @param options - A url or an object with the following properties
  14645. * @param options.url - The url of the resource.
  14646. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14647. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14648. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14649. * @param [options.proxy] - A proxy to be used when loading the resource.
  14650. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14651. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14652. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14653. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14654. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14655. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14656. */
  14657. static options(options: {
  14658. url: string;
  14659. queryParameters?: any;
  14660. templateValues?: any;
  14661. headers?: any;
  14662. proxy?: Proxy;
  14663. retryCallback?: Resource.RetryCallback;
  14664. retryAttempts?: number;
  14665. request?: Request;
  14666. responseType?: string;
  14667. overrideMimeType?: string;
  14668. }): Promise<any> | undefined;
  14669. /**
  14670. * Asynchronously posts data to the given resource. Returns a promise that will resolve to
  14671. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14672. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14673. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14674. * @example
  14675. * resource.post(data)
  14676. * .then(function(result) {
  14677. * // use the result
  14678. * }).otherwise(function(error) {
  14679. * // an error occurred
  14680. * });
  14681. * @param data - Data that is posted with the resource.
  14682. * @param [options] - Object with the following properties:
  14683. * @param [options.data] - Data that is posted with the resource.
  14684. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14685. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14686. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14687. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14688. */
  14689. post(data: any, options?: {
  14690. data?: any;
  14691. responseType?: string;
  14692. headers?: any;
  14693. overrideMimeType?: string;
  14694. }): Promise<any> | undefined;
  14695. /**
  14696. * Creates a Resource from a URL and calls post() on it.
  14697. * @param options - A url or an object with the following properties
  14698. * @param options.url - The url of the resource.
  14699. * @param options.data - Data that is posted with the resource.
  14700. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14701. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14702. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14703. * @param [options.proxy] - A proxy to be used when loading the resource.
  14704. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14705. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14706. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14707. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14708. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14709. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14710. */
  14711. static post(options: {
  14712. url: string;
  14713. data: any;
  14714. queryParameters?: any;
  14715. templateValues?: any;
  14716. headers?: any;
  14717. proxy?: Proxy;
  14718. retryCallback?: Resource.RetryCallback;
  14719. retryAttempts?: number;
  14720. request?: Request;
  14721. responseType?: string;
  14722. overrideMimeType?: string;
  14723. }): Promise<any> | undefined;
  14724. /**
  14725. * Asynchronously puts data to the given resource. Returns a promise that will resolve to
  14726. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14727. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14728. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14729. * @example
  14730. * resource.put(data)
  14731. * .then(function(result) {
  14732. * // use the result
  14733. * }).otherwise(function(error) {
  14734. * // an error occurred
  14735. * });
  14736. * @param data - Data that is posted with the resource.
  14737. * @param [options] - Object with the following properties:
  14738. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14739. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14740. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14741. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14742. */
  14743. put(data: any, options?: {
  14744. responseType?: string;
  14745. headers?: any;
  14746. overrideMimeType?: string;
  14747. }): Promise<any> | undefined;
  14748. /**
  14749. * Creates a Resource from a URL and calls put() on it.
  14750. * @param options - A url or an object with the following properties
  14751. * @param options.url - The url of the resource.
  14752. * @param options.data - Data that is posted with the resource.
  14753. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14754. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14755. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14756. * @param [options.proxy] - A proxy to be used when loading the resource.
  14757. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14758. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14759. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14760. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14761. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14762. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14763. */
  14764. static put(options: {
  14765. url: string;
  14766. data: any;
  14767. queryParameters?: any;
  14768. templateValues?: any;
  14769. headers?: any;
  14770. proxy?: Proxy;
  14771. retryCallback?: Resource.RetryCallback;
  14772. retryAttempts?: number;
  14773. request?: Request;
  14774. responseType?: string;
  14775. overrideMimeType?: string;
  14776. }): Promise<any> | undefined;
  14777. /**
  14778. * Asynchronously patches data to the given resource. Returns a promise that will resolve to
  14779. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14780. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14781. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14782. * @example
  14783. * resource.patch(data)
  14784. * .then(function(result) {
  14785. * // use the result
  14786. * }).otherwise(function(error) {
  14787. * // an error occurred
  14788. * });
  14789. * @param data - Data that is posted with the resource.
  14790. * @param [options] - Object with the following properties:
  14791. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14792. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14793. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14794. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14795. */
  14796. patch(data: any, options?: {
  14797. responseType?: string;
  14798. headers?: any;
  14799. overrideMimeType?: string;
  14800. }): Promise<any> | undefined;
  14801. /**
  14802. * Creates a Resource from a URL and calls patch() on it.
  14803. * @param options - A url or an object with the following properties
  14804. * @param options.url - The url of the resource.
  14805. * @param options.data - Data that is posted with the resource.
  14806. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14807. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14808. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14809. * @param [options.proxy] - A proxy to be used when loading the resource.
  14810. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14811. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14812. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14813. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14814. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14815. * @returns a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
  14816. */
  14817. static patch(options: {
  14818. url: string;
  14819. data: any;
  14820. queryParameters?: any;
  14821. templateValues?: any;
  14822. headers?: any;
  14823. proxy?: Proxy;
  14824. retryCallback?: Resource.RetryCallback;
  14825. retryAttempts?: number;
  14826. request?: Request;
  14827. responseType?: string;
  14828. overrideMimeType?: string;
  14829. }): Promise<any> | undefined;
  14830. /**
  14831. * A resource instance initialized to the current browser location
  14832. */
  14833. static readonly DEFAULT: Resource;
  14834. }
  14835. export namespace Resource {
  14836. /**
  14837. * A function that returns the value of the property.
  14838. * @param [resource] - The resource that failed to load.
  14839. * @param [error] - The error that occurred during the loading of the resource.
  14840. */
  14841. type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise<boolean>;
  14842. }
  14843. /**
  14844. * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
  14845. * out of memory, could not compile shader, etc. If a function may throw this
  14846. * exception, the calling code should be prepared to catch it.
  14847. * <br /><br />
  14848. * On the other hand, a {@link DeveloperError} indicates an exception due
  14849. * to a developer error, e.g., invalid argument, that usually indicates a bug in the
  14850. * calling code.
  14851. * @param [message] - The error message for this exception.
  14852. */
  14853. export class RuntimeError extends Error {
  14854. constructor(message?: string);
  14855. /**
  14856. * 'RuntimeError' indicating that this exception was thrown due to a runtime error.
  14857. */
  14858. readonly name: string;
  14859. /**
  14860. * The explanation for why this exception was thrown.
  14861. */
  14862. readonly message: string;
  14863. /**
  14864. * The stack trace of this exception, if available.
  14865. */
  14866. readonly stack: string;
  14867. }
  14868. /**
  14869. * Handles user input events. Custom functions can be added to be executed on
  14870. * when the user enters input.
  14871. * @param [element = document] - The element to add events to.
  14872. */
  14873. export class ScreenSpaceEventHandler {
  14874. constructor(element?: HTMLCanvasElement);
  14875. /**
  14876. * Set a function to be executed on an input event.
  14877. * @param action - Function to be executed when the input event occurs.
  14878. * @param type - The ScreenSpaceEventType of input event.
  14879. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14880. * event occurs.
  14881. */
  14882. setInputAction(action: (...params: any[]) => any, type: number, modifier?: number): void;
  14883. /**
  14884. * Returns the function to be executed on an input event.
  14885. * @param type - The ScreenSpaceEventType of input event.
  14886. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14887. * event occurs.
  14888. * @returns The function to be executed on an input event.
  14889. */
  14890. getInputAction(type: number, modifier?: number): (...params: any[]) => any;
  14891. /**
  14892. * Removes the function to be executed on an input event.
  14893. * @param type - The ScreenSpaceEventType of input event.
  14894. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  14895. * event occurs.
  14896. */
  14897. removeInputAction(type: number, modifier?: number): void;
  14898. /**
  14899. * Returns true if this object was destroyed; otherwise, false.
  14900. * <br /><br />
  14901. * If this object was destroyed, it should not be used; calling any function other than
  14902. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  14903. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  14904. */
  14905. isDestroyed(): boolean;
  14906. /**
  14907. * Removes listeners held by this object.
  14908. * <br /><br />
  14909. * Once an object is destroyed, it should not be used; calling any function other than
  14910. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  14911. * assign the return value (<code>undefined</code>) to the object as done in the example.
  14912. * @example
  14913. * handler = handler && handler.destroy();
  14914. */
  14915. destroy(): void;
  14916. /**
  14917. * The amount of time, in milliseconds, that mouse events will be disabled after
  14918. * receiving any touch events, such that any emulated mouse events will be ignored.
  14919. */
  14920. static mouseEmulationIgnoreMilliseconds: number;
  14921. /**
  14922. * The amount of time, in milliseconds, before a touch on the screen becomes a
  14923. * touch and hold.
  14924. */
  14925. static touchHoldDelayMilliseconds: number;
  14926. }
  14927. /**
  14928. * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
  14929. */
  14930. export enum ScreenSpaceEventType {
  14931. /**
  14932. * Represents a mouse left button down event.
  14933. */
  14934. LEFT_DOWN = 0,
  14935. /**
  14936. * Represents a mouse left button up event.
  14937. */
  14938. LEFT_UP = 1,
  14939. /**
  14940. * Represents a mouse left click event.
  14941. */
  14942. LEFT_CLICK = 2,
  14943. /**
  14944. * Represents a mouse left double click event.
  14945. */
  14946. LEFT_DOUBLE_CLICK = 3,
  14947. /**
  14948. * Represents a mouse left button down event.
  14949. */
  14950. RIGHT_DOWN = 5,
  14951. /**
  14952. * Represents a mouse right button up event.
  14953. */
  14954. RIGHT_UP = 6,
  14955. /**
  14956. * Represents a mouse right click event.
  14957. */
  14958. RIGHT_CLICK = 7,
  14959. /**
  14960. * Represents a mouse middle button down event.
  14961. */
  14962. MIDDLE_DOWN = 10,
  14963. /**
  14964. * Represents a mouse middle button up event.
  14965. */
  14966. MIDDLE_UP = 11,
  14967. /**
  14968. * Represents a mouse middle click event.
  14969. */
  14970. MIDDLE_CLICK = 12,
  14971. /**
  14972. * Represents a mouse move event.
  14973. */
  14974. MOUSE_MOVE = 15,
  14975. /**
  14976. * Represents a mouse wheel event.
  14977. */
  14978. WHEEL = 16,
  14979. /**
  14980. * Represents the start of a two-finger event on a touch surface.
  14981. */
  14982. PINCH_START = 17,
  14983. /**
  14984. * Represents the end of a two-finger event on a touch surface.
  14985. */
  14986. PINCH_END = 18,
  14987. /**
  14988. * Represents a change of a two-finger event on a touch surface.
  14989. */
  14990. PINCH_MOVE = 19
  14991. }
  14992. /**
  14993. * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
  14994. * @example
  14995. * var instance = new Cesium.GeometryInstance({
  14996. * geometry : new Cesium.BoxGeometry({
  14997. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  14998. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  14999. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  15000. * }),
  15001. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  15002. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  15003. * id : 'box',
  15004. * attributes : {
  15005. * show : new Cesium.ShowGeometryInstanceAttribute(false)
  15006. * }
  15007. * });
  15008. * @param [show = true] - Determines if the geometry instance will be shown.
  15009. */
  15010. export class ShowGeometryInstanceAttribute {
  15011. constructor(show?: boolean);
  15012. /**
  15013. * The values for the attributes stored in a typed array.
  15014. */
  15015. value: Uint8Array;
  15016. /**
  15017. * The datatype of each component in the attribute, e.g., individual elements in
  15018. * {@link ColorGeometryInstanceAttribute#value}.
  15019. */
  15020. readonly componentDatatype: ComponentDatatype;
  15021. /**
  15022. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  15023. */
  15024. readonly componentsPerAttribute: number;
  15025. /**
  15026. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  15027. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  15028. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  15029. */
  15030. readonly normalize: boolean;
  15031. /**
  15032. * Converts a boolean show to a typed array that can be used to assign a show attribute.
  15033. * @example
  15034. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  15035. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
  15036. * @param show - The show value.
  15037. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  15038. * @returns The modified result parameter or a new instance if result was undefined.
  15039. */
  15040. static toValue(show: boolean, result?: Uint8Array): Uint8Array;
  15041. }
  15042. /**
  15043. * Contains functions for finding the Cartesian coordinates of the sun and the moon in the
  15044. * Earth-centered inertial frame.
  15045. */
  15046. export namespace Simon1994PlanetaryPositions {
  15047. /**
  15048. * Computes the position of the Sun in the Earth-centered inertial frame
  15049. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15050. * @param [result] - The object onto which to store the result.
  15051. * @returns Calculated sun position
  15052. */
  15053. function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15054. /**
  15055. * Computes the position of the Moon in the Earth-centered inertial frame
  15056. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15057. * @param [result] - The object onto which to store the result.
  15058. * @returns Calculated moon position
  15059. */
  15060. function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15061. }
  15062. /**
  15063. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  15064. * and each additional position defines a line segment from the previous position.
  15065. * @example
  15066. * // A polyline with two connected line segments
  15067. * var polyline = new Cesium.SimplePolylineGeometry({
  15068. * positions : Cesium.Cartesian3.fromDegreesArray([
  15069. * 0.0, 0.0,
  15070. * 5.0, 0.0,
  15071. * 5.0, 5.0
  15072. * ])
  15073. * });
  15074. * var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
  15075. * @param options - Object with the following properties:
  15076. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  15077. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  15078. * @param [options.colorsPerVertex = false] - A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
  15079. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  15080. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
  15081. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  15082. */
  15083. export class SimplePolylineGeometry {
  15084. constructor(options: {
  15085. positions: Cartesian3[];
  15086. colors?: Color[];
  15087. colorsPerVertex?: boolean;
  15088. arcType?: ArcType;
  15089. granularity?: number;
  15090. ellipsoid?: Ellipsoid;
  15091. });
  15092. /**
  15093. * The number of elements used to pack the object into an array.
  15094. */
  15095. packedLength: number;
  15096. /**
  15097. * Stores the provided instance into the provided array.
  15098. * @param value - The value to pack.
  15099. * @param array - The array to pack into.
  15100. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15101. * @returns The array that was packed into
  15102. */
  15103. static pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[];
  15104. /**
  15105. * Retrieves an instance from a packed array.
  15106. * @param array - The packed array.
  15107. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15108. * @param [result] - The object into which to store the result.
  15109. * @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
  15110. */
  15111. static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry;
  15112. /**
  15113. * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
  15114. * @param simplePolylineGeometry - A description of the polyline.
  15115. * @returns The computed vertices and indices.
  15116. */
  15117. static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined;
  15118. }
  15119. /**
  15120. * A description of a sphere centered at the origin.
  15121. * @example
  15122. * var sphere = new Cesium.SphereGeometry({
  15123. * radius : 100.0,
  15124. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  15125. * });
  15126. * var geometry = Cesium.SphereGeometry.createGeometry(sphere);
  15127. * @param [options] - Object with the following properties:
  15128. * @param [options.radius = 1.0] - The radius of the sphere.
  15129. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  15130. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  15131. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  15132. */
  15133. export class SphereGeometry {
  15134. constructor(options?: {
  15135. radius?: number;
  15136. stackPartitions?: number;
  15137. slicePartitions?: number;
  15138. vertexFormat?: VertexFormat;
  15139. });
  15140. /**
  15141. * The number of elements used to pack the object into an array.
  15142. */
  15143. static packedLength: number;
  15144. /**
  15145. * Stores the provided instance into the provided array.
  15146. * @param value - The value to pack.
  15147. * @param array - The array to pack into.
  15148. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15149. * @returns The array that was packed into
  15150. */
  15151. static pack(value: SphereGeometry, array: number[], startingIndex?: number): number[];
  15152. /**
  15153. * Retrieves an instance from a packed array.
  15154. * @param array - The packed array.
  15155. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15156. * @param [result] - The object into which to store the result.
  15157. * @returns The modified result parameter or a new SphereGeometry instance if one was not provided.
  15158. */
  15159. static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry;
  15160. /**
  15161. * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
  15162. * @param sphereGeometry - A description of the sphere.
  15163. * @returns The computed vertices and indices.
  15164. */
  15165. static createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined;
  15166. }
  15167. /**
  15168. * A description of the outline of a sphere.
  15169. * @example
  15170. * var sphere = new Cesium.SphereOutlineGeometry({
  15171. * radius : 100.0,
  15172. * stackPartitions : 6,
  15173. * slicePartitions: 5
  15174. * });
  15175. * var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
  15176. * @param [options] - Object with the following properties:
  15177. * @param [options.radius = 1.0] - The radius of the sphere.
  15178. * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines).
  15179. * @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines).
  15180. * @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature .
  15181. */
  15182. export class SphereOutlineGeometry {
  15183. constructor(options?: {
  15184. radius?: number;
  15185. stackPartitions?: number;
  15186. slicePartitions?: number;
  15187. subdivisions?: number;
  15188. });
  15189. /**
  15190. * The number of elements used to pack the object into an array.
  15191. */
  15192. static packedLength: number;
  15193. /**
  15194. * Stores the provided instance into the provided array.
  15195. * @param value - The value to pack.
  15196. * @param array - The array to pack into.
  15197. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15198. * @returns The array that was packed into
  15199. */
  15200. static pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[];
  15201. /**
  15202. * Retrieves an instance from a packed array.
  15203. * @param array - The packed array.
  15204. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15205. * @param [result] - The object into which to store the result.
  15206. * @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
  15207. */
  15208. static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry;
  15209. /**
  15210. * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
  15211. * @param sphereGeometry - A description of the sphere outline.
  15212. * @returns The computed vertices and indices.
  15213. */
  15214. static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined;
  15215. }
  15216. /**
  15217. * A set of curvilinear 3-dimensional coordinates.
  15218. * @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  15219. * @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis.
  15220. * @param [magnitude = 1.0] - The linear coordinate measured from the origin.
  15221. */
  15222. export class Spherical {
  15223. constructor(clock?: number, cone?: number, magnitude?: number);
  15224. /**
  15225. * The clock component.
  15226. */
  15227. clock: number;
  15228. /**
  15229. * The cone component.
  15230. */
  15231. cone: number;
  15232. /**
  15233. * The magnitude component.
  15234. */
  15235. magnitude: number;
  15236. /**
  15237. * Converts the provided Cartesian3 into Spherical coordinates.
  15238. * @param cartesian3 - The Cartesian3 to be converted to Spherical.
  15239. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  15240. * @returns The modified result parameter, or a new instance if one was not provided.
  15241. */
  15242. static fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical;
  15243. /**
  15244. * Creates a duplicate of a Spherical.
  15245. * @param spherical - The spherical to clone.
  15246. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15247. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
  15248. */
  15249. static clone(spherical: Spherical, result?: Spherical): Spherical;
  15250. /**
  15251. * Computes the normalized version of the provided spherical.
  15252. * @param spherical - The spherical to be normalized.
  15253. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15254. * @returns The modified result parameter or a new instance if result was undefined.
  15255. */
  15256. static normalize(spherical: Spherical, result?: Spherical): Spherical;
  15257. /**
  15258. * Returns true if the first spherical is equal to the second spherical, false otherwise.
  15259. * @param left - The first Spherical to be compared.
  15260. * @param right - The second Spherical to be compared.
  15261. * @returns true if the first spherical is equal to the second spherical, false otherwise.
  15262. */
  15263. static equals(left: Spherical, right: Spherical): boolean;
  15264. /**
  15265. * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15266. * @param left - The first Spherical to be compared.
  15267. * @param right - The second Spherical to be compared.
  15268. * @param [epsilon = 0.0] - The epsilon to compare against.
  15269. * @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15270. */
  15271. static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean;
  15272. /**
  15273. * Returns true if this spherical is equal to the provided spherical, false otherwise.
  15274. * @param other - The Spherical to be compared.
  15275. * @returns true if this spherical is equal to the provided spherical, false otherwise.
  15276. */
  15277. equals(other: Spherical): boolean;
  15278. /**
  15279. * Creates a duplicate of this Spherical.
  15280. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15281. * @returns The modified result parameter or a new instance if result was undefined.
  15282. */
  15283. clone(result?: Spherical): Spherical;
  15284. /**
  15285. * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15286. * @param other - The Spherical to be compared.
  15287. * @param epsilon - The epsilon to compare against.
  15288. * @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15289. */
  15290. equalsEpsilon(other: Spherical, epsilon: number): boolean;
  15291. /**
  15292. * Returns a string representing this instance in the format (clock, cone, magnitude).
  15293. * @returns A string representing this instance.
  15294. */
  15295. toString(): string;
  15296. }
  15297. /**
  15298. * Creates a curve parameterized and evaluated by time. This type describes an interface
  15299. * and is not intended to be instantiated directly.
  15300. */
  15301. export class Spline {
  15302. constructor();
  15303. /**
  15304. * An array of times for the control points.
  15305. */
  15306. times: number[];
  15307. /**
  15308. * An array of control points.
  15309. */
  15310. points: Cartesian3[] | Quaternion[];
  15311. /**
  15312. * Evaluates the curve at a given time.
  15313. * @param time - The time at which to evaluate the curve.
  15314. * @param [result] - The object onto which to store the result.
  15315. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  15316. */
  15317. evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[];
  15318. /**
  15319. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  15320. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  15321. * @param time - The time.
  15322. * @param startIndex - The index from which to start the search.
  15323. * @returns The index for the element at the start of the interval.
  15324. */
  15325. findTimeInterval(time: number, startIndex: number): number;
  15326. /**
  15327. * Wraps the given time to the period covered by the spline.
  15328. * @param time - The time.
  15329. * @returns The time, wrapped around the animation period.
  15330. */
  15331. wrapTime(time: number): number;
  15332. /**
  15333. * Clamps the given time to the period covered by the spline.
  15334. * @param time - The time.
  15335. * @returns The time, clamped to the animation period.
  15336. */
  15337. clampTime(time: number): number;
  15338. }
  15339. /**
  15340. * A wrapper around a web worker that allows scheduling tasks for a given worker,
  15341. * returning results asynchronously via a promise.
  15342. *
  15343. * The Worker is not constructed until a task is scheduled.
  15344. * @param workerPath - The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder.
  15345. * @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded,
  15346. * scheduleTask will not queue any more tasks, allowing
  15347. * work to be rescheduled in future frames.
  15348. */
  15349. export class TaskProcessor {
  15350. constructor(workerPath: string, maximumActiveTasks?: number);
  15351. /**
  15352. * Schedule a task to be processed by the web worker asynchronously. If there are currently more
  15353. * tasks active than the maximum set by the constructor, will immediately return undefined.
  15354. * Otherwise, returns a promise that will resolve to the result posted back by the worker when
  15355. * finished.
  15356. * @example
  15357. * var taskProcessor = new Cesium.TaskProcessor('myWorkerPath');
  15358. * var promise = taskProcessor.scheduleTask({
  15359. * someParameter : true,
  15360. * another : 'hello'
  15361. * });
  15362. * if (!Cesium.defined(promise)) {
  15363. * // too many active tasks - try again later
  15364. * } else {
  15365. * Cesium.when(promise, function(result) {
  15366. * // use the result of the task
  15367. * });
  15368. * }
  15369. * @param parameters - Any input data that will be posted to the worker.
  15370. * @param [transferableObjects] - An array of objects contained in parameters that should be
  15371. * transferred to the worker instead of copied.
  15372. * @returns Either a promise that will resolve to the result when available, or undefined
  15373. * if there are too many active tasks,
  15374. */
  15375. scheduleTask(parameters: any, transferableObjects?: object[]): Promise<object> | undefined;
  15376. /**
  15377. * Posts a message to a web worker with configuration to initialize loading
  15378. * and compiling a web assembly module asychronously, as well as an optional
  15379. * fallback JavaScript module to use if Web Assembly is not supported.
  15380. * @param [webAssemblyOptions] - An object with the following properties:
  15381. * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module.
  15382. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file.
  15383. * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported.
  15384. * @returns A promise that resolves to the result when the web worker has loaded and compiled the web assembly module and is ready to process tasks.
  15385. */
  15386. initWebAssemblyModule(webAssemblyOptions?: {
  15387. modulePath?: string;
  15388. wasmBinaryFile?: string;
  15389. fallbackModulePath?: string;
  15390. }): Promise<object>;
  15391. /**
  15392. * Returns true if this object was destroyed; otherwise, false.
  15393. * <br /><br />
  15394. * If this object was destroyed, it should not be used; calling any function other than
  15395. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15396. * @returns True if this object was destroyed; otherwise, false.
  15397. */
  15398. isDestroyed(): boolean;
  15399. /**
  15400. * Destroys this object. This will immediately terminate the Worker.
  15401. * <br /><br />
  15402. * Once an object is destroyed, it should not be used; calling any function other than
  15403. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15404. */
  15405. destroy(): void;
  15406. }
  15407. /**
  15408. * Terrain data for a single tile. This type describes an
  15409. * interface and is not intended to be instantiated directly.
  15410. */
  15411. export class TerrainData {
  15412. constructor();
  15413. /**
  15414. * An array of credits for this tile.
  15415. */
  15416. credits: Credit[];
  15417. /**
  15418. * The water mask included in this terrain data, if any. A water mask is a rectangular
  15419. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  15420. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  15421. */
  15422. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  15423. /**
  15424. * Computes the terrain height at a specified longitude and latitude.
  15425. * @param rectangle - The rectangle covered by this terrain data.
  15426. * @param longitude - The longitude in radians.
  15427. * @param latitude - The latitude in radians.
  15428. * @returns The terrain height at the specified position. If the position
  15429. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  15430. * incorrect for positions far outside the rectangle.
  15431. */
  15432. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  15433. /**
  15434. * Determines if a given child tile is available, based on the
  15435. * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed
  15436. * to be one of the four children of this tile. If non-child tile coordinates are
  15437. * given, the availability of the southeast child tile is returned.
  15438. * @param thisX - The tile X coordinate of this (the parent) tile.
  15439. * @param thisY - The tile Y coordinate of this (the parent) tile.
  15440. * @param childX - The tile X coordinate of the child tile to check for availability.
  15441. * @param childY - The tile Y coordinate of the child tile to check for availability.
  15442. * @returns True if the child tile is available; otherwise, false.
  15443. */
  15444. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  15445. /**
  15446. * Upsamples this terrain data for use by a descendant tile.
  15447. * @param tilingScheme - The tiling scheme of this terrain data.
  15448. * @param thisX - The X coordinate of this tile in the tiling scheme.
  15449. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  15450. * @param thisLevel - The level of this tile in the tiling scheme.
  15451. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15452. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15453. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  15454. * @returns A promise for upsampled terrain data for the descendant tile,
  15455. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  15456. * deferred.
  15457. */
  15458. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData> | undefined;
  15459. /**
  15460. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  15461. * terrain data. If this value is false, the data was obtained from some other source, such
  15462. * as by downloading it from a remote server. This method should return true for instances
  15463. * returned from a call to {@link TerrainData#upsample}.
  15464. * @returns True if this instance was created by upsampling; otherwise, false.
  15465. */
  15466. wasCreatedByUpsampling(): boolean;
  15467. }
  15468. /**
  15469. * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
  15470. * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an
  15471. * interface and is not intended to be instantiated directly.
  15472. */
  15473. export class TerrainProvider {
  15474. constructor();
  15475. /**
  15476. * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
  15477. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  15478. * are passed an instance of {@link TileProviderError}.
  15479. */
  15480. readonly errorEvent: Event;
  15481. /**
  15482. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  15483. * the source of the terrain. This function should
  15484. * not be called before {@link TerrainProvider#ready} returns true.
  15485. */
  15486. readonly credit: Credit;
  15487. /**
  15488. * Gets the tiling scheme used by the provider. This function should
  15489. * not be called before {@link TerrainProvider#ready} returns true.
  15490. */
  15491. readonly tilingScheme: TilingScheme;
  15492. /**
  15493. * Gets a value indicating whether or not the provider is ready for use.
  15494. */
  15495. readonly ready: boolean;
  15496. /**
  15497. * Gets a promise that resolves to true when the provider is ready for use.
  15498. */
  15499. readonly readyPromise: Promise<boolean>;
  15500. /**
  15501. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  15502. * indicates which areas of the globe are water rather than land, so they can be rendered
  15503. * as a reflective surface with animated waves. This function should not be
  15504. * called before {@link TerrainProvider#ready} returns true.
  15505. */
  15506. readonly hasWaterMask: boolean;
  15507. /**
  15508. * Gets a value indicating whether or not the requested tiles include vertex normals.
  15509. * This function should not be called before {@link TerrainProvider#ready} returns true.
  15510. */
  15511. readonly hasVertexNormals: boolean;
  15512. /**
  15513. * Gets an object that can be used to determine availability of terrain from this provider, such as
  15514. * at points and in rectangles. This function should not be called before
  15515. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  15516. * information is not available.
  15517. */
  15518. readonly availability: TileAvailability;
  15519. /**
  15520. * Gets a list of indices for a triangle mesh representing a regular grid. Calling
  15521. * this function multiple times with the same grid width and height returns the
  15522. * same list of indices. The total number of vertices must be less than or equal
  15523. * to 65536.
  15524. * @param width - The number of vertices in the regular grid in the horizontal direction.
  15525. * @param height - The number of vertices in the regular grid in the vertical direction.
  15526. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
  15527. */
  15528. static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array;
  15529. /**
  15530. * Specifies the quality of terrain created from heightmaps. A value of 1.0 will
  15531. * ensure that adjacent heightmap vertices are separated by no more than
  15532. * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.
  15533. * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
  15534. * screen pixels between adjacent heightmap vertices and thus rendering more quickly.
  15535. */
  15536. static heightmapTerrainQuality: number;
  15537. /**
  15538. * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
  15539. * @param ellipsoid - The ellipsoid to which the terrain is attached.
  15540. * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile.
  15541. * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero.
  15542. * @returns An estimated geometric error.
  15543. */
  15544. static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number;
  15545. /**
  15546. * Requests the geometry for a given tile. This function should not be called before
  15547. * {@link TerrainProvider#ready} returns true. The result must include terrain data and
  15548. * may optionally include a water mask and an indication of which child tiles are available.
  15549. * @param x - The X coordinate of the tile for which to request geometry.
  15550. * @param y - The Y coordinate of the tile for which to request geometry.
  15551. * @param level - The level of the tile for which to request geometry.
  15552. * @param [request] - The request object. Intended for internal use only.
  15553. * @returns A promise for the requested geometry. If this method
  15554. * returns undefined instead of a promise, it is an indication that too many requests are already
  15555. * pending and the request will be retried later.
  15556. */
  15557. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  15558. /**
  15559. * Gets the maximum geometric error allowed in a tile at a given level. This function should not be
  15560. * called before {@link TerrainProvider#ready} returns true.
  15561. * @param level - The tile level for which to get the maximum geometric error.
  15562. * @returns The maximum geometric error.
  15563. */
  15564. getLevelMaximumGeometricError(level: number): number;
  15565. /**
  15566. * Determines whether data for a tile is available to be loaded.
  15567. * @param x - The X coordinate of the tile for which to request geometry.
  15568. * @param y - The Y coordinate of the tile for which to request geometry.
  15569. * @param level - The level of the tile for which to request geometry.
  15570. * @returns Undefined if not supported by the terrain provider, otherwise true or false.
  15571. */
  15572. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  15573. /**
  15574. * Makes sure we load availability data for a tile
  15575. * @param x - The X coordinate of the tile for which to request geometry.
  15576. * @param y - The Y coordinate of the tile for which to request geometry.
  15577. * @param level - The level of the tile for which to request geometry.
  15578. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  15579. */
  15580. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  15581. }
  15582. /**
  15583. * Reports the availability of tiles in a {@link TilingScheme}.
  15584. * @param tilingScheme - The tiling scheme in which to report availability.
  15585. * @param maximumLevel - The maximum tile level that is potentially available.
  15586. */
  15587. export class TileAvailability {
  15588. constructor(tilingScheme: TilingScheme, maximumLevel: number);
  15589. /**
  15590. * Marks a rectangular range of tiles in a particular level as being available. For best performance,
  15591. * add your ranges in order of increasing level.
  15592. * @param level - The level.
  15593. * @param startX - The X coordinate of the first available tiles at the level.
  15594. * @param startY - The Y coordinate of the first available tiles at the level.
  15595. * @param endX - The X coordinate of the last available tiles at the level.
  15596. * @param endY - The Y coordinate of the last available tiles at the level.
  15597. */
  15598. addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void;
  15599. /**
  15600. * Determines the level of the most detailed tile covering the position. This function
  15601. * usually completes in time logarithmic to the number of rectangles added with
  15602. * {@link TileAvailability#addAvailableTileRange}.
  15603. * @param position - The position for which to determine the maximum available level. The height component is ignored.
  15604. * @returns The level of the most detailed tile covering the position.
  15605. */
  15606. computeMaximumLevelAtPosition(position: Cartographic): number;
  15607. /**
  15608. * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed
  15609. * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this
  15610. * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function
  15611. * usually completes in time logarithmic to the number of rectangles added with
  15612. * {@link TileAvailability#addAvailableTileRange}.
  15613. * @param rectangle - The rectangle.
  15614. * @returns The best available level for the entire rectangle.
  15615. */
  15616. computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number;
  15617. /**
  15618. * Determines if a particular tile is available.
  15619. * @param level - The tile level to check.
  15620. * @param x - The X coordinate of the tile to check.
  15621. * @param y - The Y coordinate of the tile to check.
  15622. * @returns True if the tile is available; otherwise, false.
  15623. */
  15624. isTileAvailable(level: number, x: number, y: number): boolean;
  15625. /**
  15626. * Computes a bit mask indicating which of a tile's four children exist.
  15627. * If a child's bit is set, a tile is available for that child. If it is cleared,
  15628. * the tile is not available. The bit values are as follows:
  15629. * <table>
  15630. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  15631. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  15632. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  15633. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  15634. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  15635. * </table>
  15636. * @param level - The level of the parent tile.
  15637. * @param x - The X coordinate of the parent tile.
  15638. * @param y - The Y coordinate of the parent tile.
  15639. * @returns The bit mask indicating child availability.
  15640. */
  15641. computeChildMaskForTile(level: number, x: number, y: number): number;
  15642. }
  15643. /**
  15644. * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.
  15645. * @param provider - The imagery or terrain provider that experienced the error.
  15646. * @param message - A message describing the error.
  15647. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error
  15648. * is not specific to a particular tile.
  15649. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error
  15650. * is not specific to a particular tile.
  15651. * @param [level] - The level of the tile that experienced the error, or undefined if the error
  15652. * is not specific to a particular tile.
  15653. * @param [timesRetried = 0] - The number of times this operation has been retried.
  15654. * @param [error] - The error or exception that occurred, if any.
  15655. */
  15656. export class TileProviderError {
  15657. constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error);
  15658. /**
  15659. * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.
  15660. */
  15661. provider: ImageryProvider | TerrainProvider;
  15662. /**
  15663. * The message describing the error.
  15664. */
  15665. message: string;
  15666. /**
  15667. * The X coordinate of the tile that experienced the error. If the error is not specific
  15668. * to a particular tile, this property will be undefined.
  15669. */
  15670. x: number;
  15671. /**
  15672. * The Y coordinate of the tile that experienced the error. If the error is not specific
  15673. * to a particular tile, this property will be undefined.
  15674. */
  15675. y: number;
  15676. /**
  15677. * The level-of-detail of the tile that experienced the error. If the error is not specific
  15678. * to a particular tile, this property will be undefined.
  15679. */
  15680. level: number;
  15681. /**
  15682. * The number of times this operation has been retried.
  15683. */
  15684. timesRetried: number;
  15685. /**
  15686. * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider
  15687. * will set the initial value of this property before raising the event, but any listeners
  15688. * can change it. The value after the last listener is invoked will be acted upon.
  15689. */
  15690. retry: boolean;
  15691. /**
  15692. * The error or exception that occurred, if any.
  15693. */
  15694. error: Error;
  15695. /**
  15696. * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by
  15697. * logging the error to the console if the event has no listeners. This method also tracks the number
  15698. * of times the operation has been retried and will automatically retry if requested to do so by the
  15699. * event listeners.
  15700. * @param previousError - The error instance returned by this function the last
  15701. * time it was called for this error, or undefined if this is the first time this error has
  15702. * occurred.
  15703. * @param provider - The imagery or terrain provider that encountered the error.
  15704. * @param event - The event to raise to inform listeners of the error.
  15705. * @param message - The message describing the error.
  15706. * @param x - The X coordinate of the tile that experienced the error, or undefined if the
  15707. * error is not specific to a particular tile.
  15708. * @param y - The Y coordinate of the tile that experienced the error, or undefined if the
  15709. * error is not specific to a particular tile.
  15710. * @param level - The level-of-detail of the tile that experienced the error, or undefined if the
  15711. * error is not specific to a particular tile.
  15712. * @param retryFunction - The function to call to retry the operation. If undefined, the
  15713. * operation will not be retried.
  15714. * @param [errorDetails] - The error or exception that occurred, if any.
  15715. * @returns The error instance that was passed to the event listeners and that
  15716. * should be passed to this function the next time it is called for the same error in order
  15717. * to track retry counts.
  15718. */
  15719. static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError;
  15720. /**
  15721. * Handles success of an operation by resetting the retry count of a previous error, if any. This way,
  15722. * if the error occurs again in the future, the listeners will be informed that it has not yet been retried.
  15723. * @param previousError - The previous error, or undefined if this operation has
  15724. * not previously resulted in an error.
  15725. */
  15726. static handleSuccess(previousError: TileProviderError): void;
  15727. }
  15728. export namespace TileProviderError {
  15729. /**
  15730. * A function that will be called to retry the operation.
  15731. */
  15732. type RetryFunction = () => void;
  15733. }
  15734. /**
  15735. * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero,
  15736. * the coarsest, least-detailed level, the number of tiles is configurable.
  15737. * At level of detail one, each of the level zero tiles has four children, two in each direction.
  15738. * At level of detail two, each of the level one tiles has four children, two in each direction.
  15739. * This continues for as many levels as are present in the geometry or imagery source.
  15740. */
  15741. export class TilingScheme {
  15742. constructor();
  15743. /**
  15744. * Gets the ellipsoid that is tiled by the tiling scheme.
  15745. */
  15746. ellipsoid: Ellipsoid;
  15747. /**
  15748. * Gets the rectangle, in radians, covered by this tiling scheme.
  15749. */
  15750. rectangle: Rectangle;
  15751. /**
  15752. * Gets the map projection used by the tiling scheme.
  15753. */
  15754. projection: MapProjection;
  15755. /**
  15756. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  15757. * @param level - The level-of-detail.
  15758. * @returns The number of tiles in the X direction at the given level.
  15759. */
  15760. getNumberOfXTilesAtLevel(level: number): number;
  15761. /**
  15762. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  15763. * @param level - The level-of-detail.
  15764. * @returns The number of tiles in the Y direction at the given level.
  15765. */
  15766. getNumberOfYTilesAtLevel(level: number): number;
  15767. /**
  15768. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  15769. * of this tiling scheme.
  15770. * @param rectangle - The rectangle to transform.
  15771. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15772. * should be created.
  15773. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  15774. * is undefined.
  15775. */
  15776. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  15777. /**
  15778. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  15779. * of the tiling scheme.
  15780. * @param x - The integer x coordinate of the tile.
  15781. * @param y - The integer y coordinate of the tile.
  15782. * @param level - The tile level-of-detail. Zero is the least detailed.
  15783. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15784. * should be created.
  15785. * @returns The specified 'result', or a new object containing the rectangle
  15786. * if 'result' is undefined.
  15787. */
  15788. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15789. /**
  15790. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  15791. * @param x - The integer x coordinate of the tile.
  15792. * @param y - The integer y coordinate of the tile.
  15793. * @param level - The tile level-of-detail. Zero is the least detailed.
  15794. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15795. * should be created.
  15796. * @returns The specified 'result', or a new object containing the rectangle
  15797. * if 'result' is undefined.
  15798. */
  15799. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  15800. /**
  15801. * Calculates the tile x, y coordinates of the tile containing
  15802. * a given cartographic position.
  15803. * @param position - The position.
  15804. * @param level - The tile level-of-detail. Zero is the least detailed.
  15805. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  15806. * should be created.
  15807. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  15808. * if 'result' is undefined.
  15809. */
  15810. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  15811. }
  15812. /**
  15813. * An interval defined by a start and a stop time; optionally including those times as part of the interval.
  15814. * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.
  15815. * @example
  15816. * // Create an instance that spans August 1st, 1980 and is associated
  15817. * // with a Cartesian position.
  15818. * var timeInterval = new Cesium.TimeInterval({
  15819. * start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),
  15820. * stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),
  15821. * isStartIncluded : true,
  15822. * isStopIncluded : false,
  15823. * data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082)
  15824. * });
  15825. * @example
  15826. * // Create two instances from ISO 8601 intervals with associated numeric data
  15827. * // then compute their intersection, summing the data they contain.
  15828. * var left = Cesium.TimeInterval.fromIso8601({
  15829. * iso8601 : '2000/2010',
  15830. * data : 2
  15831. * });
  15832. *
  15833. * var right = Cesium.TimeInterval.fromIso8601({
  15834. * iso8601 : '1995/2005',
  15835. * data : 3
  15836. * });
  15837. *
  15838. * //The result of the below intersection will be an interval equivalent to
  15839. * //var intersection = Cesium.TimeInterval.fromIso8601({
  15840. * // iso8601 : '2000/2005',
  15841. * // data : 5
  15842. * //});
  15843. * var intersection = new Cesium.TimeInterval();
  15844. * Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {
  15845. * return leftData + rightData;
  15846. * });
  15847. * @example
  15848. * // Check if an interval contains a specific time.
  15849. * var dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z');
  15850. * var containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);
  15851. * @param [options] - Object with the following properties:
  15852. * @param [options.start = new JulianDate()] - The start time of the interval.
  15853. * @param [options.stop = new JulianDate()] - The stop time of the interval.
  15854. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15855. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15856. * @param [options.data] - Arbitrary data associated with this interval.
  15857. */
  15858. export class TimeInterval {
  15859. constructor(options?: {
  15860. start?: JulianDate;
  15861. stop?: JulianDate;
  15862. isStartIncluded?: boolean;
  15863. isStopIncluded?: boolean;
  15864. data?: any;
  15865. });
  15866. /**
  15867. * Gets or sets the start time of this interval.
  15868. */
  15869. start: JulianDate;
  15870. /**
  15871. * Gets or sets the stop time of this interval.
  15872. */
  15873. stop: JulianDate;
  15874. /**
  15875. * Gets or sets the data associated with this interval.
  15876. */
  15877. data: any;
  15878. /**
  15879. * Gets or sets whether or not the start time is included in this interval.
  15880. */
  15881. isStartIncluded: boolean;
  15882. /**
  15883. * Gets or sets whether or not the stop time is included in this interval.
  15884. */
  15885. isStopIncluded: boolean;
  15886. /**
  15887. * Gets whether or not this interval is empty.
  15888. */
  15889. readonly isEmpty: boolean;
  15890. /**
  15891. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
  15892. * @param options - Object with the following properties:
  15893. * @param options.iso8601 - An ISO 8601 interval.
  15894. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  15895. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  15896. * @param [options.data] - Arbitrary data associated with this interval.
  15897. * @param [result] - An existing instance to use for the result.
  15898. * @returns The modified result parameter or a new instance if none was provided.
  15899. */
  15900. static fromIso8601(options: {
  15901. iso8601: string;
  15902. isStartIncluded?: boolean;
  15903. isStopIncluded?: boolean;
  15904. data?: any;
  15905. }, result?: TimeInterval): TimeInterval;
  15906. /**
  15907. * Creates an ISO8601 representation of the provided interval.
  15908. * @param timeInterval - The interval to be converted.
  15909. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  15910. * @returns The ISO8601 representation of the provided interval.
  15911. */
  15912. static toIso8601(timeInterval: TimeInterval, precision?: number): string;
  15913. /**
  15914. * Duplicates the provided instance.
  15915. * @param [timeInterval] - The instance to clone.
  15916. * @param [result] - An existing instance to use for the result.
  15917. * @returns The modified result parameter or a new instance if none was provided.
  15918. */
  15919. static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval;
  15920. /**
  15921. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15922. * @param [left] - The first instance.
  15923. * @param [right] - The second instance.
  15924. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15925. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  15926. */
  15927. static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  15928. /**
  15929. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  15930. * each other. That is, in order for the dates to be considered equal (and for
  15931. * this function to return <code>true</code>), the absolute value of the difference between them, in
  15932. * seconds, must be less than <code>epsilon</code>.
  15933. * @param [left] - The first instance.
  15934. * @param [right] - The second instance.
  15935. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  15936. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15937. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  15938. */
  15939. static equalsEpsilon(left?: TimeInterval, right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  15940. /**
  15941. * Computes the intersection of two intervals, optionally merging their data.
  15942. * @param left - The first interval.
  15943. * @param [right] - The second interval.
  15944. * @param [result] - An existing instance to use for the result.
  15945. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  15946. * @returns The modified result parameter.
  15947. */
  15948. static intersect(left: TimeInterval, right?: TimeInterval, result?: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval;
  15949. /**
  15950. * Checks if the specified date is inside the provided interval.
  15951. * @param timeInterval - The interval.
  15952. * @param julianDate - The date to check.
  15953. * @returns <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.
  15954. */
  15955. static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean;
  15956. /**
  15957. * Duplicates this instance.
  15958. * @param [result] - An existing instance to use for the result.
  15959. * @returns The modified result parameter or a new instance if none was provided.
  15960. */
  15961. clone(result?: TimeInterval): TimeInterval;
  15962. /**
  15963. * Compares this instance against the provided instance componentwise and returns
  15964. * <code>true</code> if they are equal, <code>false</code> otherwise.
  15965. * @param [right] - The right hand side interval.
  15966. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15967. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  15968. */
  15969. equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  15970. /**
  15971. * Compares this instance against the provided instance componentwise and returns
  15972. * <code>true</code> if they are within the provided epsilon,
  15973. * <code>false</code> otherwise.
  15974. * @param [right] - The right hand side interval.
  15975. * @param [epsilon = 0] - The epsilon to use for equality testing.
  15976. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  15977. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  15978. */
  15979. equalsEpsilon(right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  15980. /**
  15981. * Creates a string representing this TimeInterval in ISO8601 format.
  15982. * @returns A string representing this TimeInterval in ISO8601 format.
  15983. */
  15984. toString(): string;
  15985. /**
  15986. * An immutable empty interval.
  15987. */
  15988. static readonly EMPTY: TimeInterval;
  15989. }
  15990. export namespace TimeInterval {
  15991. /**
  15992. * Function interface for merging interval data.
  15993. * @param leftData - The first data instance.
  15994. * @param rightData - The second data instance.
  15995. */
  15996. type MergeCallback = (leftData: any, rightData: any) => any;
  15997. /**
  15998. * Function interface for comparing interval data.
  15999. * @param leftData - The first data instance.
  16000. * @param rightData - The second data instance.
  16001. */
  16002. type DataComparer = (leftData: any, rightData: any) => boolean;
  16003. }
  16004. /**
  16005. * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.
  16006. * @param [intervals] - An array of intervals to add to the collection.
  16007. */
  16008. export class TimeIntervalCollection {
  16009. constructor(intervals?: TimeInterval[]);
  16010. /**
  16011. * Gets an event that is raised whenever the collection of intervals change.
  16012. */
  16013. readonly changedEvent: Event;
  16014. /**
  16015. * Gets the start time of the collection.
  16016. */
  16017. readonly start: JulianDate;
  16018. /**
  16019. * Gets whether or not the start time is included in the collection.
  16020. */
  16021. readonly isStartIncluded: boolean;
  16022. /**
  16023. * Gets the stop time of the collection.
  16024. */
  16025. readonly stop: JulianDate;
  16026. /**
  16027. * Gets whether or not the stop time is included in the collection.
  16028. */
  16029. readonly isStopIncluded: boolean;
  16030. /**
  16031. * Gets the number of intervals in the collection.
  16032. */
  16033. readonly length: number;
  16034. /**
  16035. * Gets whether or not the collection is empty.
  16036. */
  16037. readonly isEmpty: boolean;
  16038. /**
  16039. * Compares this instance against the provided instance componentwise and returns
  16040. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16041. * @param [right] - The right hand side collection.
  16042. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16043. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16044. */
  16045. equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean;
  16046. /**
  16047. * Gets the interval at the specified index.
  16048. * @param index - The index of the interval to retrieve.
  16049. * @returns The interval at the specified index, or <code>undefined</code> if no interval exists as that index.
  16050. */
  16051. get(index: number): TimeInterval | undefined;
  16052. /**
  16053. * Removes all intervals from the collection.
  16054. */
  16055. removeAll(): void;
  16056. /**
  16057. * Finds and returns the interval that contains the specified date.
  16058. * @param date - The date to search for.
  16059. * @returns The interval containing the specified date, <code>undefined</code> if no such interval exists.
  16060. */
  16061. findIntervalContainingDate(date: JulianDate): TimeInterval | undefined;
  16062. /**
  16063. * Finds and returns the data for the interval that contains the specified date.
  16064. * @param date - The date to search for.
  16065. * @returns The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.
  16066. */
  16067. findDataForIntervalContainingDate(date: JulianDate): any;
  16068. /**
  16069. * Checks if the specified date is inside this collection.
  16070. * @param julianDate - The date to check.
  16071. * @returns <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.
  16072. */
  16073. contains(julianDate: JulianDate): boolean;
  16074. /**
  16075. * Finds and returns the index of the interval in the collection that contains the specified date.
  16076. * @param date - The date to search for.
  16077. * @returns The index of the interval that contains the specified date, if no such interval exists,
  16078. * it returns a negative number which is the bitwise complement of the index of the next interval that
  16079. * starts after the date, or if no interval starts after the specified date, the bitwise complement of
  16080. * the length of the collection.
  16081. */
  16082. indexOf(date: JulianDate): number;
  16083. /**
  16084. * Returns the first interval in the collection that matches the specified parameters.
  16085. * All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.
  16086. * @param [options] - Object with the following properties:
  16087. * @param [options.start] - The start time of the interval.
  16088. * @param [options.stop] - The stop time of the interval.
  16089. * @param [options.isStartIncluded] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16090. * @param [options.isStopIncluded] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16091. * @returns The first interval in the collection that matches the specified parameters.
  16092. */
  16093. findInterval(options?: {
  16094. start?: JulianDate;
  16095. stop?: JulianDate;
  16096. isStartIncluded?: boolean;
  16097. isStopIncluded?: boolean;
  16098. }): TimeInterval | undefined;
  16099. /**
  16100. * Adds an interval to the collection, merging intervals that contain the same data and
  16101. * splitting intervals of different data as needed in order to maintain a non-overlapping collection.
  16102. * The data in the new interval takes precedence over any existing intervals in the collection.
  16103. * @param interval - The interval to add.
  16104. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16105. */
  16106. addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void;
  16107. /**
  16108. * Removes the specified interval from this interval collection, creating a hole over the specified interval.
  16109. * The data property of the input interval is ignored.
  16110. * @param interval - The interval to remove.
  16111. * @returns <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.
  16112. */
  16113. removeInterval(interval: TimeInterval): boolean;
  16114. /**
  16115. * Creates a new instance that is the intersection of this collection and the provided collection.
  16116. * @param other - The collection to intersect with.
  16117. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16118. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  16119. * @returns A new TimeIntervalCollection which is the intersection of this collection and the provided collection.
  16120. */
  16121. intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection;
  16122. /**
  16123. * Creates a new instance from a JulianDate array.
  16124. * @param options - Object with the following properties:
  16125. * @param options.julianDates - An array of ISO 8601 dates.
  16126. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16127. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16128. * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.
  16129. * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.
  16130. * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.
  16131. * @param [result] - An existing instance to use for the result.
  16132. * @returns The modified result parameter or a new instance if none was provided.
  16133. */
  16134. static fromJulianDateArray(options: {
  16135. julianDates: JulianDate[];
  16136. isStartIncluded?: boolean;
  16137. isStopIncluded?: boolean;
  16138. leadingInterval?: boolean;
  16139. trailingInterval?: boolean;
  16140. dataCallback?: (...params: any[]) => any;
  16141. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16142. /**
  16143. * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).
  16144. * @param options - Object with the following properties:
  16145. * @param options.iso8601 - An ISO 8601 interval.
  16146. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16147. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16148. * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.
  16149. * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.
  16150. * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.
  16151. * @param [result] - An existing instance to use for the result.
  16152. * @returns The modified result parameter or a new instance if none was provided.
  16153. */
  16154. static fromIso8601(options: {
  16155. iso8601: string;
  16156. isStartIncluded?: boolean;
  16157. isStopIncluded?: boolean;
  16158. leadingInterval?: boolean;
  16159. trailingInterval?: boolean;
  16160. dataCallback?: (...params: any[]) => any;
  16161. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16162. /**
  16163. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.
  16164. * @param options - Object with the following properties:
  16165. * @param options.iso8601Dates - An array of ISO 8601 dates.
  16166. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16167. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16168. * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.
  16169. * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.
  16170. * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.
  16171. * @param [result] - An existing instance to use for the result.
  16172. * @returns The modified result parameter or a new instance if none was provided.
  16173. */
  16174. static fromIso8601DateArray(options: {
  16175. iso8601Dates: string[];
  16176. isStartIncluded?: boolean;
  16177. isStopIncluded?: boolean;
  16178. leadingInterval?: boolean;
  16179. trailingInterval?: boolean;
  16180. dataCallback?: (...params: any[]) => any;
  16181. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16182. /**
  16183. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.
  16184. * @param options - Object with the following properties:
  16185. * @param options.epoch - An date that the durations are relative to.
  16186. * @param options.iso8601Durations - An array of ISO 8601 durations.
  16187. * @param [options.relativeToPrevious = false] - <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.
  16188. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16189. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16190. * @param [options.leadingInterval = false] - <code>true</code> if you want to add a interval from Iso8601.MINIMUM_VALUE to start time, <code>false</code> otherwise.
  16191. * @param [options.trailingInterval = false] - <code>true</code> if you want to add a interval from stop time to Iso8601.MAXIMUM_VALUE, <code>false</code> otherwise.
  16192. * @param [options.dataCallback] - A function that will be return the data that is called with each interval before it is added to the collection. If unspecified, the data will be the index in the collection.
  16193. * @param [result] - An existing instance to use for the result.
  16194. * @returns The modified result parameter or a new instance if none was provided.
  16195. */
  16196. static fromIso8601DurationArray(options: {
  16197. epoch: JulianDate;
  16198. iso8601Durations: string;
  16199. relativeToPrevious?: boolean;
  16200. isStartIncluded?: boolean;
  16201. isStopIncluded?: boolean;
  16202. leadingInterval?: boolean;
  16203. trailingInterval?: boolean;
  16204. dataCallback?: (...params: any[]) => any;
  16205. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16206. }
  16207. /**
  16208. * Provides the type of time standards which JulianDate can take as input.
  16209. */
  16210. export enum TimeStandard {
  16211. /**
  16212. * Represents the coordinated Universal Time (UTC) time standard.
  16213. *
  16214. * UTC is related to TAI according to the relationship
  16215. * <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap
  16216. * seconds which have been introduced as of the time in TAI.
  16217. */
  16218. UTC = 0,
  16219. /**
  16220. * Represents the International Atomic Time (TAI) time standard.
  16221. * TAI is the principal time standard to which the other time standards are related.
  16222. */
  16223. TAI = 1
  16224. }
  16225. /**
  16226. * Contains functions for transforming positions to various reference frames.
  16227. */
  16228. export namespace Transforms {
  16229. /**
  16230. * Generates a function that computes a 4x4 transformation matrix from a reference frame
  16231. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16232. * @param firstAxis - name of the first axis of the local reference frame. Must be
  16233. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16234. * @param secondAxis - name of the second axis of the local reference frame. Must be
  16235. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16236. * @returns The function that will computes a
  16237. * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,
  16238. */
  16239. function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame;
  16240. /**
  16241. * Computes a 4x4 transformation matrix from a reference frame
  16242. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16243. * @param origin - The center point of the local reference frame.
  16244. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16245. * @param [result] - The object onto which to store the result.
  16246. */
  16247. type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4;
  16248. /**
  16249. * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
  16250. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16251. * The local axes are defined as:
  16252. * <ul>
  16253. * <li>The <code>x</code> axis points in the local east direction.</li>
  16254. * <li>The <code>y</code> axis points in the local north direction.</li>
  16255. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16256. * </ul>
  16257. * @example
  16258. * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16259. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16260. * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  16261. * @param origin - The center point of the local reference frame.
  16262. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16263. * @param [result] - The object onto which to store the result.
  16264. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16265. */
  16266. function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16267. /**
  16268. * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes
  16269. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16270. * The local axes are defined as:
  16271. * <ul>
  16272. * <li>The <code>x</code> axis points in the local north direction.</li>
  16273. * <li>The <code>y</code> axis points in the local east direction.</li>
  16274. * <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>
  16275. * </ul>
  16276. * @example
  16277. * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
  16278. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16279. * var transform = Cesium.Transforms.northEastDownToFixedFrame(center);
  16280. * @param origin - The center point of the local reference frame.
  16281. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16282. * @param [result] - The object onto which to store the result.
  16283. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16284. */
  16285. function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16286. /**
  16287. * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes
  16288. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16289. * The local axes are defined as:
  16290. * <ul>
  16291. * <li>The <code>x</code> axis points in the local north direction.</li>
  16292. * <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16293. * <li>The <code>z</code> axis points in the local east direction.</li>
  16294. * </ul>
  16295. * @example
  16296. * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
  16297. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16298. * var transform = Cesium.Transforms.northUpEastToFixedFrame(center);
  16299. * @param origin - The center point of the local reference frame.
  16300. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16301. * @param [result] - The object onto which to store the result.
  16302. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16303. */
  16304. function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16305. /**
  16306. * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes
  16307. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16308. * The local axes are defined as:
  16309. * <ul>
  16310. * <li>The <code>x</code> axis points in the local north direction.</li>
  16311. * <li>The <code>y</code> axis points in the local west direction.</li>
  16312. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16313. * </ul>
  16314. * @example
  16315. * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16316. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16317. * var transform = Cesium.Transforms.northWestUpToFixedFrame(center);
  16318. * @param origin - The center point of the local reference frame.
  16319. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16320. * @param [result] - The object onto which to store the result.
  16321. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16322. */
  16323. function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16324. /**
  16325. * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
  16326. * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north
  16327. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16328. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16329. * @example
  16330. * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16331. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16332. * var heading = -Cesium.Math.PI_OVER_TWO;
  16333. * var pitch = Cesium.Math.PI_OVER_FOUR;
  16334. * var roll = 0.0;
  16335. * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  16336. * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);
  16337. * @param origin - The center point of the local reference frame.
  16338. * @param headingPitchRoll - The heading, pitch, and roll.
  16339. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16340. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16341. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16342. * @param [result] - The object onto which to store the result.
  16343. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16344. */
  16345. function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4;
  16346. /**
  16347. * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
  16348. * centered at the provided origin. Heading is the rotation from the local north
  16349. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16350. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16351. * @example
  16352. * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16353. * var center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16354. * var heading = -Cesium.Math.PI_OVER_TWO;
  16355. * var pitch = Cesium.Math.PI_OVER_FOUR;
  16356. * var roll = 0.0;
  16357. * var hpr = new HeadingPitchRoll(heading, pitch, roll);
  16358. * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);
  16359. * @param origin - The center point of the local reference frame.
  16360. * @param headingPitchRoll - The heading, pitch, and roll.
  16361. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16362. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16363. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16364. * @param [result] - The object onto which to store the result.
  16365. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  16366. */
  16367. function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion;
  16368. /**
  16369. * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north
  16370. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16371. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16372. * @param transform - The transform
  16373. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16374. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16375. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16376. * @param [result] - The object onto which to store the result.
  16377. * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided.
  16378. */
  16379. function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll;
  16380. /**
  16381. * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the
  16382. * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.
  16383. * @example
  16384. * //Set the view to the inertial frame.
  16385. * scene.postUpdate.addEventListener(function(scene, time) {
  16386. * var now = Cesium.JulianDate.now();
  16387. * var offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());
  16388. * var transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));
  16389. * var inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());
  16390. * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
  16391. * camera.lookAtTransform(transform, offset);
  16392. * });
  16393. * @param date - The time at which to compute the rotation matrix.
  16394. * @param [result] - The object onto which to store the result.
  16395. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16396. */
  16397. function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16398. /**
  16399. * Preloads the data necessary to transform between the ICRF and Fixed axes, in either
  16400. * direction, over a given interval. This function returns a promise that, when resolved,
  16401. * indicates that the preload has completed.
  16402. * @example
  16403. * var interval = new Cesium.TimeInterval(...);
  16404. * when(Cesium.Transforms.preloadIcrfFixed(interval), function() {
  16405. * // the data is now loaded
  16406. * });
  16407. * @param timeInterval - The interval to preload.
  16408. * @returns A promise that, when resolved, indicates that the preload has completed
  16409. * and evaluation of the transformation between the fixed and ICRF axes will
  16410. * no longer return undefined for a time inside the interval.
  16411. */
  16412. function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>;
  16413. /**
  16414. * Computes a rotation matrix to transform a point or vector from the International Celestial
  16415. * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)
  16416. * at a given time. This function may return undefined if the data necessary to
  16417. * do the transformation is not yet loaded.
  16418. * @example
  16419. * scene.postUpdate.addEventListener(function(scene, time) {
  16420. * // View in ICRF.
  16421. * var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
  16422. * if (Cesium.defined(icrfToFixed)) {
  16423. * var offset = Cesium.Cartesian3.clone(camera.position);
  16424. * var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
  16425. * camera.lookAtTransform(transform, offset);
  16426. * }
  16427. * });
  16428. * @param date - The time at which to compute the rotation matrix.
  16429. * @param [result] - The object onto which to store the result. If this parameter is
  16430. * not specified, a new instance is created and returned.
  16431. * @returns The rotation matrix, or undefined if the data necessary to do the
  16432. * transformation is not yet loaded.
  16433. */
  16434. function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16435. /**
  16436. * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)
  16437. * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes
  16438. * at a given time. This function may return undefined if the data necessary to
  16439. * do the transformation is not yet loaded.
  16440. * @example
  16441. * // Transform a point from the ICRF axes to the Fixed axes.
  16442. * var now = Cesium.JulianDate.now();
  16443. * var pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16444. * var fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);
  16445. * var pointInInertial = new Cesium.Cartesian3();
  16446. * if (Cesium.defined(fixedToIcrf)) {
  16447. * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
  16448. * }
  16449. * @param date - The time at which to compute the rotation matrix.
  16450. * @param [result] - The object onto which to store the result. If this parameter is
  16451. * not specified, a new instance is created and returned.
  16452. * @returns The rotation matrix, or undefined if the data necessary to do the
  16453. * transformation is not yet loaded.
  16454. */
  16455. function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16456. /**
  16457. * Transform a point from model coordinates to window coordinates.
  16458. * @param modelViewProjectionMatrix - The 4x4 model-view-projection matrix.
  16459. * @param viewportTransformation - The 4x4 viewport transformation.
  16460. * @param point - The point to transform.
  16461. * @param [result] - The object onto which to store the result.
  16462. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  16463. */
  16464. function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2;
  16465. /**
  16466. * Transform a position and velocity to a rotation matrix.
  16467. * @param position - The position to transform.
  16468. * @param velocity - The velocity vector to transform.
  16469. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16470. * @param [result] - The object onto which to store the result.
  16471. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16472. */
  16473. function rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix3): Matrix3;
  16474. }
  16475. /**
  16476. * An affine transformation defined by a translation, rotation, and scale.
  16477. * @param [translation = Cartesian3.ZERO] - A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.
  16478. * @param [rotation = Quaternion.IDENTITY] - A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.
  16479. * @param [scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.
  16480. */
  16481. export class TranslationRotationScale {
  16482. constructor(translation?: Cartesian3, rotation?: Quaternion, scale?: Cartesian3);
  16483. /**
  16484. * Gets or sets the (x, y, z) translation to apply to the node.
  16485. */
  16486. translation: Cartesian3;
  16487. /**
  16488. * Gets or sets the (x, y, z, w) rotation to apply to the node.
  16489. */
  16490. rotation: Quaternion;
  16491. /**
  16492. * Gets or sets the (x, y, z) scaling to apply to the node.
  16493. */
  16494. scale: Cartesian3;
  16495. /**
  16496. * Compares this instance against the provided instance and returns
  16497. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16498. * @param [right] - The right hand side TranslationRotationScale.
  16499. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16500. */
  16501. equals(right?: TranslationRotationScale): boolean;
  16502. }
  16503. /**
  16504. * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve
  16505. * a system of linear equations where the coefficient matrix is a tridiagonal matrix.
  16506. */
  16507. export namespace TridiagonalSystemSolver {
  16508. /**
  16509. * Solves a tridiagonal system of linear equations.
  16510. * @example
  16511. * var lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
  16512. * var diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
  16513. * var upperDiagonal = [1.0, 1.0, 1.0, 1.0];
  16514. * var rightHandSide = [
  16515. * new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),
  16516. * new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
  16517. * new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),
  16518. * new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
  16519. * new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)
  16520. * ];
  16521. *
  16522. * var solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);
  16523. * @param diagonal - An array with length <code>n</code> that contains the diagonal of the coefficient matrix.
  16524. * @param lower - An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.
  16525. * @param upper - An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.
  16526. * @param right - An array of Cartesians with length <code>n</code> that is the right side of the system of equations.
  16527. * @returns An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.
  16528. */
  16529. function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[];
  16530. }
  16531. /**
  16532. * A singleton that contains all of the servers that are trusted. Credentials will be sent with
  16533. * any requests to these servers.
  16534. */
  16535. export namespace TrustedServers {
  16536. /**
  16537. * Adds a trusted server to the registry
  16538. * @example
  16539. * // Add a trusted server
  16540. * TrustedServers.add('my.server.com', 80);
  16541. * @param host - The host to be added.
  16542. * @param port - The port used to access the host.
  16543. */
  16544. function add(host: string, port: number): void;
  16545. /**
  16546. * Removes a trusted server from the registry
  16547. * @example
  16548. * // Remove a trusted server
  16549. * TrustedServers.remove('my.server.com', 80);
  16550. * @param host - The host to be removed.
  16551. * @param port - The port used to access the host.
  16552. */
  16553. function remove(host: string, port: number): void;
  16554. /**
  16555. * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
  16556. * @example
  16557. * // Add server
  16558. * TrustedServers.add('my.server.com', 81);
  16559. *
  16560. * // Check if server is trusted
  16561. * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
  16562. * // my.server.com:81 is trusted
  16563. * }
  16564. * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
  16565. * // my.server.com isn't trusted
  16566. * }
  16567. * @param url - The url to be tested against the trusted list
  16568. * @returns Returns true if url is trusted, false otherwise.
  16569. */
  16570. function contains(url: string): boolean;
  16571. /**
  16572. * Clears the registry
  16573. * @example
  16574. * // Remove a trusted server
  16575. * TrustedServers.clear();
  16576. */
  16577. function clear(): void;
  16578. }
  16579. /**
  16580. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  16581. * retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}.
  16582. * @example
  16583. * var terrainProvider = new Cesium.VRTheWorldTerrainProvider({
  16584. * url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/'
  16585. * });
  16586. * viewer.terrainProvider = terrainProvider;
  16587. * @param options - Object with the following properties:
  16588. * @param options.url - The URL of the VR-TheWorld TileMap.
  16589. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not
  16590. * specified, the WGS84 ellipsoid is used.
  16591. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  16592. */
  16593. export class VRTheWorldTerrainProvider {
  16594. constructor(options: {
  16595. url: Resource | string;
  16596. ellipsoid?: Ellipsoid;
  16597. credit?: Credit | string;
  16598. });
  16599. /**
  16600. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  16601. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  16602. * are passed an instance of {@link TileProviderError}.
  16603. */
  16604. readonly errorEvent: Event;
  16605. /**
  16606. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  16607. * the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16608. */
  16609. readonly credit: Credit;
  16610. /**
  16611. * Gets the tiling scheme used by this provider. This function should
  16612. * not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16613. */
  16614. readonly tilingScheme: GeographicTilingScheme;
  16615. /**
  16616. * Gets a value indicating whether or not the provider is ready for use.
  16617. */
  16618. readonly ready: boolean;
  16619. /**
  16620. * Gets a promise that resolves to true when the provider is ready for use.
  16621. */
  16622. readonly readyPromise: Promise<boolean>;
  16623. /**
  16624. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  16625. * indicates which areas of the globe are water rather than land, so they can be rendered
  16626. * as a reflective surface with animated waves. This function should not be
  16627. * called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16628. */
  16629. readonly hasWaterMask: boolean;
  16630. /**
  16631. * Gets a value indicating whether or not the requested tiles include vertex normals.
  16632. * This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  16633. */
  16634. readonly hasVertexNormals: boolean;
  16635. /**
  16636. * Gets an object that can be used to determine availability of terrain from this provider, such as
  16637. * at points and in rectangles. This function should not be called before
  16638. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  16639. * information is not available.
  16640. */
  16641. readonly availability: TileAvailability;
  16642. /**
  16643. * Requests the geometry for a given tile. This function should not be called before
  16644. * {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain
  16645. * data and indicates that all child tiles are available.
  16646. * @param x - The X coordinate of the tile for which to request geometry.
  16647. * @param y - The Y coordinate of the tile for which to request geometry.
  16648. * @param level - The level of the tile for which to request geometry.
  16649. * @param [request] - The request object. Intended for internal use only.
  16650. * @returns A promise for the requested geometry. If this method
  16651. * returns undefined instead of a promise, it is an indication that too many requests are already
  16652. * pending and the request will be retried later.
  16653. */
  16654. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  16655. /**
  16656. * Gets the maximum geometric error allowed in a tile at a given level.
  16657. * @param level - The tile level for which to get the maximum geometric error.
  16658. * @returns The maximum geometric error.
  16659. */
  16660. getLevelMaximumGeometricError(level: number): number;
  16661. /**
  16662. * Determines whether data for a tile is available to be loaded.
  16663. * @param x - The X coordinate of the tile for which to request geometry.
  16664. * @param y - The Y coordinate of the tile for which to request geometry.
  16665. * @param level - The level of the tile for which to request geometry.
  16666. * @returns Undefined if not supported, otherwise true or false.
  16667. */
  16668. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  16669. /**
  16670. * Makes sure we load availability data for a tile
  16671. * @param x - The X coordinate of the tile for which to request geometry.
  16672. * @param y - The Y coordinate of the tile for which to request geometry.
  16673. * @param level - The level of the tile for which to request geometry.
  16674. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  16675. */
  16676. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  16677. }
  16678. /**
  16679. * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
  16680. * to a {@link Geometry} to request that certain properties be computed, e.g., just position,
  16681. * position and normal, etc.
  16682. * @example
  16683. * // Create a vertex format with position and 2D texture coordinate attributes.
  16684. * var format = new Cesium.VertexFormat({
  16685. * position : true,
  16686. * st : true
  16687. * });
  16688. * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
  16689. */
  16690. export class VertexFormat {
  16691. constructor(options?: any);
  16692. /**
  16693. * When <code>true</code>, the vertex has a 3D position attribute.
  16694. * <p>
  16695. * 64-bit floating-point (for precision). 3 components per attribute.
  16696. * </p>
  16697. */
  16698. position: boolean;
  16699. /**
  16700. * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.
  16701. * <p>
  16702. * 32-bit floating-point. 3 components per attribute.
  16703. * </p>
  16704. */
  16705. normal: boolean;
  16706. /**
  16707. * When <code>true</code>, the vertex has a 2D texture coordinate attribute.
  16708. * <p>
  16709. * 32-bit floating-point. 2 components per attribute
  16710. * </p>
  16711. */
  16712. st: boolean;
  16713. /**
  16714. * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16715. * <p>
  16716. * 32-bit floating-point. 3 components per attribute.
  16717. * </p>
  16718. */
  16719. bitangent: boolean;
  16720. /**
  16721. * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  16722. * <p>
  16723. * 32-bit floating-point. 3 components per attribute.
  16724. * </p>
  16725. */
  16726. tangent: boolean;
  16727. /**
  16728. * When <code>true</code>, the vertex has an RGB color attribute.
  16729. * <p>
  16730. * 8-bit unsigned byte. 3 components per attribute.
  16731. * </p>
  16732. */
  16733. color: boolean;
  16734. /**
  16735. * An immutable vertex format with only a position attribute.
  16736. */
  16737. static readonly POSITION_ONLY: VertexFormat;
  16738. /**
  16739. * An immutable vertex format with position and normal attributes.
  16740. * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.
  16741. */
  16742. static readonly POSITION_AND_NORMAL: VertexFormat;
  16743. /**
  16744. * An immutable vertex format with position, normal, and st attributes.
  16745. * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}
  16746. * is <code>TEXTURED/code>.
  16747. */
  16748. static readonly POSITION_NORMAL_AND_ST: VertexFormat;
  16749. /**
  16750. * An immutable vertex format with position and st attributes.
  16751. * This is compatible with {@link EllipsoidSurfaceAppearance}.
  16752. */
  16753. static readonly POSITION_AND_ST: VertexFormat;
  16754. /**
  16755. * An immutable vertex format with position and color attributes.
  16756. */
  16757. static readonly POSITION_AND_COLOR: VertexFormat;
  16758. /**
  16759. * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
  16760. */
  16761. static readonly ALL: VertexFormat;
  16762. /**
  16763. * An immutable vertex format with position, normal, and st attributes.
  16764. * This is compatible with most appearances and materials; however
  16765. * normal and st attributes are not always required. When this is
  16766. * known in advance, another <code>VertexFormat</code> should be used.
  16767. */
  16768. static readonly DEFAULT: VertexFormat;
  16769. /**
  16770. * The number of elements used to pack the object into an array.
  16771. */
  16772. static packedLength: number;
  16773. /**
  16774. * Stores the provided instance into the provided array.
  16775. * @param value - The value to pack.
  16776. * @param array - The array to pack into.
  16777. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16778. * @returns The array that was packed into
  16779. */
  16780. static pack(value: VertexFormat, array: number[], startingIndex?: number): number[];
  16781. /**
  16782. * Retrieves an instance from a packed array.
  16783. * @param array - The packed array.
  16784. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16785. * @param [result] - The object into which to store the result.
  16786. * @returns The modified result parameter or a new VertexFormat instance if one was not provided.
  16787. */
  16788. static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat;
  16789. /**
  16790. * Duplicates a VertexFormat instance.
  16791. * @param vertexFormat - The vertex format to duplicate.
  16792. * @param [result] - The object onto which to store the result.
  16793. * @returns The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
  16794. */
  16795. static clone(vertexFormat: VertexFormat, result?: VertexFormat): VertexFormat;
  16796. }
  16797. /**
  16798. * Synchronizes a video element with a simulation clock.
  16799. * @param [options] - Object with the following properties:
  16800. * @param [options.clock] - The clock instance used to drive the video.
  16801. * @param [options.element] - The video element to be synchronized.
  16802. * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video.
  16803. * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge.
  16804. */
  16805. export class VideoSynchronizer {
  16806. constructor(options?: {
  16807. clock?: Clock;
  16808. element?: HTMLVideoElement;
  16809. epoch?: JulianDate;
  16810. tolerance?: number;
  16811. });
  16812. /**
  16813. * Gets or sets the simulation time that marks the start of the video.
  16814. */
  16815. epoch: JulianDate;
  16816. /**
  16817. * Gets or sets the amount of time in seconds the video's currentTime
  16818. * and the clock's currentTime can diverge before a video seek is performed.
  16819. * Lower values make the synchronization more accurate but video
  16820. * performance might suffer. Higher values provide better performance
  16821. * but at the cost of accuracy.
  16822. */
  16823. tolerance: number;
  16824. /**
  16825. * Gets or sets the clock used to drive the video element.
  16826. */
  16827. clock: Clock;
  16828. /**
  16829. * Gets or sets the video element to synchronize.
  16830. */
  16831. element: HTMLVideoElement;
  16832. /**
  16833. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  16834. */
  16835. destroy(): void;
  16836. /**
  16837. * Returns true if this object was destroyed; otherwise, false.
  16838. * @returns True if this object was destroyed; otherwise, false.
  16839. */
  16840. isDestroyed(): boolean;
  16841. }
  16842. /**
  16843. * This enumerated type is used in determining to what extent an object, the occludee,
  16844. * is visible during horizon culling. An occluder may fully block an occludee, in which case
  16845. * it has no visibility, may partially block an occludee from view, or may not block it at all,
  16846. * leading to full visibility.
  16847. */
  16848. export enum Visibility {
  16849. /**
  16850. * Represents that no part of an object is visible.
  16851. */
  16852. NONE = -1,
  16853. /**
  16854. * Represents that part, but not all, of an object is visible
  16855. */
  16856. PARTIAL = 0,
  16857. /**
  16858. * Represents that an object is visible in its entirety.
  16859. */
  16860. FULL = 1
  16861. }
  16862. /**
  16863. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  16864. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16865. * @example
  16866. * // create a wall that spans from ground level to 10000 meters
  16867. * var wall = new Cesium.WallGeometry({
  16868. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  16869. * 19.0, 47.0, 10000.0,
  16870. * 19.0, 48.0, 10000.0,
  16871. * 20.0, 48.0, 10000.0,
  16872. * 20.0, 47.0, 10000.0,
  16873. * 19.0, 47.0, 10000.0
  16874. * ])
  16875. * });
  16876. * var geometry = Cesium.WallGeometry.createGeometry(wall);
  16877. * @param options - Object with the following properties:
  16878. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16879. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  16880. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  16881. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16882. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  16883. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16884. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16885. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  16886. */
  16887. export class WallGeometry {
  16888. constructor(options: {
  16889. positions: Cartesian3[];
  16890. granularity?: number;
  16891. maximumHeights?: number[];
  16892. minimumHeights?: number[];
  16893. ellipsoid?: Ellipsoid;
  16894. vertexFormat?: VertexFormat;
  16895. });
  16896. /**
  16897. * The number of elements used to pack the object into an array.
  16898. */
  16899. packedLength: number;
  16900. /**
  16901. * Stores the provided instance into the provided array.
  16902. * @param value - The value to pack.
  16903. * @param array - The array to pack into.
  16904. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16905. * @returns The array that was packed into
  16906. */
  16907. static pack(value: WallGeometry, array: number[], startingIndex?: number): number[];
  16908. /**
  16909. * Retrieves an instance from a packed array.
  16910. * @param array - The packed array.
  16911. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  16912. * @param [result] - The object into which to store the result.
  16913. * @returns The modified result parameter or a new WallGeometry instance if one was not provided.
  16914. */
  16915. static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry;
  16916. /**
  16917. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  16918. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16919. * @example
  16920. * // create a wall that spans from 10000 meters to 20000 meters
  16921. * var wall = Cesium.WallGeometry.fromConstantHeights({
  16922. * positions : Cesium.Cartesian3.fromDegreesArray([
  16923. * 19.0, 47.0,
  16924. * 19.0, 48.0,
  16925. * 20.0, 48.0,
  16926. * 20.0, 47.0,
  16927. * 19.0, 47.0,
  16928. * ]),
  16929. * minimumHeight : 20000.0,
  16930. * maximumHeight : 10000.0
  16931. * });
  16932. * var geometry = Cesium.WallGeometry.createGeometry(wall);
  16933. * @param options - Object with the following properties:
  16934. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16935. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  16936. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16937. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  16938. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16939. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16940. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  16941. */
  16942. static fromConstantHeights(options: {
  16943. positions: Cartesian3[];
  16944. maximumHeight?: number;
  16945. minimumHeight?: number;
  16946. ellipsoid?: Ellipsoid;
  16947. vertexFormat?: VertexFormat;
  16948. }): WallGeometry;
  16949. /**
  16950. * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
  16951. * @param wallGeometry - A description of the wall.
  16952. * @returns The computed vertices and indices.
  16953. */
  16954. static createGeometry(wallGeometry: WallGeometry): Geometry | undefined;
  16955. }
  16956. /**
  16957. * A description of a wall outline. A wall is defined by a series of points,
  16958. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  16959. * @example
  16960. * // create a wall outline that spans from ground level to 10000 meters
  16961. * var wall = new Cesium.WallOutlineGeometry({
  16962. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  16963. * 19.0, 47.0, 10000.0,
  16964. * 19.0, 48.0, 10000.0,
  16965. * 20.0, 48.0, 10000.0,
  16966. * 20.0, 47.0, 10000.0,
  16967. * 19.0, 47.0, 10000.0
  16968. * ])
  16969. * });
  16970. * var geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  16971. * @param options - Object with the following properties:
  16972. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  16973. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  16974. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  16975. * wall at <code>positions</code>. If undefined, the height of each position in used.
  16976. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  16977. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  16978. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  16979. */
  16980. export class WallOutlineGeometry {
  16981. constructor(options: {
  16982. positions: Cartesian3[];
  16983. granularity?: number;
  16984. maximumHeights?: number[];
  16985. minimumHeights?: number[];
  16986. ellipsoid?: Ellipsoid;
  16987. });
  16988. /**
  16989. * The number of elements used to pack the object into an array.
  16990. */
  16991. packedLength: number;
  16992. /**
  16993. * Stores the provided instance into the provided array.
  16994. * @param value - The value to pack.
  16995. * @param array - The array to pack into.
  16996. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  16997. * @returns The array that was packed into
  16998. */
  16999. static pack(value: WallOutlineGeometry, array: number[], startingIndex?: number): number[];
  17000. /**
  17001. * Retrieves an instance from a packed array.
  17002. * @param array - The packed array.
  17003. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17004. * @param [result] - The object into which to store the result.
  17005. * @returns The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
  17006. */
  17007. static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry;
  17008. /**
  17009. * A description of a walloutline. A wall is defined by a series of points,
  17010. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17011. * @example
  17012. * // create a wall that spans from 10000 meters to 20000 meters
  17013. * var wall = Cesium.WallOutlineGeometry.fromConstantHeights({
  17014. * positions : Cesium.Cartesian3.fromDegreesArray([
  17015. * 19.0, 47.0,
  17016. * 19.0, 48.0,
  17017. * 20.0, 48.0,
  17018. * 20.0, 47.0,
  17019. * 19.0, 47.0,
  17020. * ]),
  17021. * minimumHeight : 20000.0,
  17022. * maximumHeight : 10000.0
  17023. * });
  17024. * var geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  17025. * @param options - Object with the following properties:
  17026. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17027. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  17028. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17029. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  17030. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17031. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17032. */
  17033. static fromConstantHeights(options: {
  17034. positions: Cartesian3[];
  17035. maximumHeight?: number;
  17036. minimumHeight?: number;
  17037. ellipsoid?: Ellipsoid;
  17038. }): WallOutlineGeometry;
  17039. /**
  17040. * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
  17041. * @param wallGeometry - A description of the wall outline.
  17042. * @returns The computed vertices and indices.
  17043. */
  17044. static createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined;
  17045. }
  17046. /**
  17047. * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This
  17048. * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using
  17049. * the spherical (rather than ellipsoidal) equations.
  17050. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  17051. */
  17052. export class WebMercatorProjection {
  17053. constructor(ellipsoid?: Ellipsoid);
  17054. /**
  17055. * Gets the {@link Ellipsoid}.
  17056. */
  17057. readonly ellipsoid: Ellipsoid;
  17058. /**
  17059. * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
  17060. * in the range -PI/2 to PI/2.
  17061. * @param mercatorAngle - The angle to convert.
  17062. * @returns The geodetic latitude in radians.
  17063. */
  17064. static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number;
  17065. /**
  17066. * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
  17067. * angle in the range -PI to PI.
  17068. * @param latitude - The geodetic latitude in radians.
  17069. * @returns The Mercator angle.
  17070. */
  17071. static geodeticLatitudeToMercatorAngle(latitude: number): number;
  17072. /**
  17073. * The maximum latitude (both North and South) supported by a Web Mercator
  17074. * (EPSG:3857) projection. Technically, the Mercator projection is defined
  17075. * for any latitude up to (but not including) 90 degrees, but it makes sense
  17076. * to cut it off sooner because it grows exponentially with increasing latitude.
  17077. * The logic behind this particular cutoff value, which is the one used by
  17078. * Google Maps, Bing Maps, and Esri, is that it makes the projection
  17079. * square. That is, the rectangle is equal in the X and Y directions.
  17080. *
  17081. * The constant value is computed by calling:
  17082. * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
  17083. */
  17084. static MaximumLatitude: number;
  17085. /**
  17086. * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
  17087. * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
  17088. * is copied unmodified to the Z coordinate.
  17089. * @param cartographic - The cartographic coordinates in radians.
  17090. * @param [result] - The instance to which to copy the result, or undefined if a
  17091. * new instance should be created.
  17092. * @returns The equivalent web mercator X, Y, Z coordinates, in meters.
  17093. */
  17094. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  17095. /**
  17096. * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
  17097. * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
  17098. * height.
  17099. * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters.
  17100. * @param [result] - The instance to which to copy the result, or undefined if a
  17101. * new instance should be created.
  17102. * @returns The equivalent cartographic coordinates.
  17103. */
  17104. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  17105. }
  17106. /**
  17107. * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is
  17108. * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.
  17109. * @param [options] - Object with the following properties:
  17110. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  17111. * the WGS84 ellipsoid.
  17112. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of
  17113. * the tile tree.
  17114. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  17115. * the tile tree.
  17116. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the
  17117. * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire
  17118. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  17119. * direction, resulting in a square projection.
  17120. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the
  17121. * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire
  17122. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  17123. * direction, resulting in a square projection.
  17124. */
  17125. export class WebMercatorTilingScheme {
  17126. constructor(options?: {
  17127. ellipsoid?: Ellipsoid;
  17128. numberOfLevelZeroTilesX?: number;
  17129. numberOfLevelZeroTilesY?: number;
  17130. rectangleSouthwestInMeters?: Cartesian2;
  17131. rectangleNortheastInMeters?: Cartesian2;
  17132. });
  17133. /**
  17134. * Gets the ellipsoid that is tiled by this tiling scheme.
  17135. */
  17136. ellipsoid: Ellipsoid;
  17137. /**
  17138. * Gets the rectangle, in radians, covered by this tiling scheme.
  17139. */
  17140. rectangle: Rectangle;
  17141. /**
  17142. * Gets the map projection used by this tiling scheme.
  17143. */
  17144. projection: MapProjection;
  17145. /**
  17146. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  17147. * @param level - The level-of-detail.
  17148. * @returns The number of tiles in the X direction at the given level.
  17149. */
  17150. getNumberOfXTilesAtLevel(level: number): number;
  17151. /**
  17152. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  17153. * @param level - The level-of-detail.
  17154. * @returns The number of tiles in the Y direction at the given level.
  17155. */
  17156. getNumberOfYTilesAtLevel(level: number): number;
  17157. /**
  17158. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  17159. * of this tiling scheme.
  17160. * @param rectangle - The rectangle to transform.
  17161. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17162. * should be created.
  17163. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  17164. * is undefined.
  17165. */
  17166. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  17167. /**
  17168. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  17169. * of the tiling scheme.
  17170. * @param x - The integer x coordinate of the tile.
  17171. * @param y - The integer y coordinate of the tile.
  17172. * @param level - The tile level-of-detail. Zero is the least detailed.
  17173. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17174. * should be created.
  17175. * @returns The specified 'result', or a new object containing the rectangle
  17176. * if 'result' is undefined.
  17177. */
  17178. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17179. /**
  17180. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  17181. * @param x - The integer x coordinate of the tile.
  17182. * @param y - The integer y coordinate of the tile.
  17183. * @param level - The tile level-of-detail. Zero is the least detailed.
  17184. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17185. * should be created.
  17186. * @returns The specified 'result', or a new object containing the rectangle
  17187. * if 'result' is undefined.
  17188. */
  17189. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17190. /**
  17191. * Calculates the tile x, y coordinates of the tile containing
  17192. * a given cartographic position.
  17193. * @param position - The position.
  17194. * @param level - The tile level-of-detail. Zero is the least detailed.
  17195. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17196. * should be created.
  17197. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  17198. * if 'result' is undefined.
  17199. */
  17200. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  17201. }
  17202. /**
  17203. * A spline that linearly interpolates over an array of weight values used by morph targets.
  17204. * @example
  17205. * var times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  17206. * var weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
  17207. * var spline = new Cesium.WeightSpline({
  17208. * times : times,
  17209. * weights : weights
  17210. * });
  17211. *
  17212. * var p0 = spline.evaluate(times[0]);
  17213. * @param options - Object with the following properties:
  17214. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  17215. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  17216. * @param options.weights - The array of floating-point control weights given. The weights are ordered such
  17217. * that all weights for the targets are given in chronological order and order in which they appear in
  17218. * the glTF from which the morph targets come. This means for 2 targets, weights = [w(0,0), w(0,1), w(1,0), w(1,1) ...]
  17219. * where i and j in w(i,j) are the time indices and target indices, respectively.
  17220. */
  17221. export class WeightSpline {
  17222. constructor(options: {
  17223. times: number[];
  17224. weights: number[];
  17225. });
  17226. /**
  17227. * An array of times for the control weights.
  17228. */
  17229. readonly times: number[];
  17230. /**
  17231. * An array of floating-point array control weights.
  17232. */
  17233. readonly weights: number[];
  17234. /**
  17235. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  17236. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  17237. * @param time - The time.
  17238. * @returns The index for the element at the start of the interval.
  17239. */
  17240. findTimeInterval(time: number): number;
  17241. /**
  17242. * Wraps the given time to the period covered by the spline.
  17243. * @param time - The time.
  17244. * @returns The time, wrapped around to the updated animation.
  17245. */
  17246. wrapTime(time: number): number;
  17247. /**
  17248. * Clamps the given time to the period covered by the spline.
  17249. * @param time - The time.
  17250. * @returns The time, clamped to the animation period.
  17251. */
  17252. clampTime(time: number): number;
  17253. /**
  17254. * Evaluates the curve at a given time.
  17255. * @param time - The time at which to evaluate the curve.
  17256. * @param [result] - The object onto which to store the result.
  17257. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  17258. */
  17259. evaluate(time: number, result?: number[]): number[];
  17260. }
  17261. /**
  17262. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  17263. */
  17264. export enum WindingOrder {
  17265. /**
  17266. * Vertices are in clockwise order.
  17267. */
  17268. CLOCKWISE = WebGLConstants.CW,
  17269. /**
  17270. * Vertices are in counter-clockwise order.
  17271. */
  17272. COUNTER_CLOCKWISE = WebGLConstants.CCW
  17273. }
  17274. /**
  17275. * Computes the barycentric coordinates for a point with respect to a triangle.
  17276. * @example
  17277. * // Returns Cartesian3.UNIT_X
  17278. * var p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);
  17279. * var b = Cesium.barycentricCoordinates(p,
  17280. * new Cesium.Cartesian3(-1.0, 0.0, 0.0),
  17281. * new Cesium.Cartesian3( 1.0, 0.0, 0.0),
  17282. * new Cesium.Cartesian3( 0.0, 1.0, 1.0));
  17283. * @param point - The point to test.
  17284. * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis.
  17285. * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis.
  17286. * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis.
  17287. * @param [result] - The object onto which to store the result.
  17288. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  17289. */
  17290. export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3;
  17291. /**
  17292. * Finds an item in a sorted array.
  17293. * @example
  17294. * // Create a comparator function to search through an array of numbers.
  17295. * function comparator(a, b) {
  17296. * return a - b;
  17297. * };
  17298. * var numbers = [0, 2, 4, 6, 8];
  17299. * var index = Cesium.binarySearch(numbers, 6, comparator); // 3
  17300. * @param array - The sorted array to search.
  17301. * @param itemToFind - The item to find in the array.
  17302. * @param comparator - The function to use to compare the item to
  17303. * elements in the array.
  17304. * @returns The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code>
  17305. * does not exist, the return value is a negative number which is the bitwise complement (~)
  17306. * of the index before which the itemToFind should be inserted in order to maintain the
  17307. * sorted order of the array.
  17308. */
  17309. export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number;
  17310. /**
  17311. * A function used to compare two items while performing a binary search.
  17312. * @example
  17313. * function compareNumbers(a, b) {
  17314. * return a - b;
  17315. * }
  17316. * @param a - An item in the array.
  17317. * @param b - The item being searched for.
  17318. */
  17319. export type binarySearchComparator = (a: any, b: any) => number;
  17320. /**
  17321. * Given a relative URL under the Cesium base URL, returns an absolute URL.
  17322. * @example
  17323. * var viewer = new Cesium.Viewer("cesiumContainer", {
  17324. * imageryProvider: new Cesium.TileMapServiceImageryProvider({
  17325. * url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
  17326. * }),
  17327. * baseLayerPicker: false,
  17328. * });
  17329. * @param relativeUrl - The relative path.
  17330. * @returns The absolutely URL representation of the provided path.
  17331. */
  17332. export function buildModuleUrl(relativeUrl: string): string;
  17333. /**
  17334. * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}.
  17335. * @param requestID - The value returned by {@link requestAnimationFrame}.
  17336. */
  17337. export function cancelAnimationFrame(requestID: number): void;
  17338. /**
  17339. * Clones an object, returning a new object containing the same properties.
  17340. * @param object - The object to clone.
  17341. * @param [deep = false] - If true, all properties will be deep cloned recursively.
  17342. * @returns The cloned object.
  17343. */
  17344. export function clone(object: any, deep?: boolean): any;
  17345. /**
  17346. * Merges two objects, copying their properties onto a new combined object. When two objects have the same
  17347. * property, the value of the property on the first object is used. If either object is undefined,
  17348. * it will be treated as an empty object.
  17349. * @example
  17350. * var object1 = {
  17351. * propOne : 1,
  17352. * propTwo : {
  17353. * value1 : 10
  17354. * }
  17355. * }
  17356. * var object2 = {
  17357. * propTwo : 2
  17358. * }
  17359. * var final = Cesium.combine(object1, object2);
  17360. *
  17361. * // final === {
  17362. * // propOne : 1,
  17363. * // propTwo : {
  17364. * // value1 : 10
  17365. * // }
  17366. * // }
  17367. * @param [object1] - The first object to merge.
  17368. * @param [object2] - The second object to merge.
  17369. * @param [deep = false] - Perform a recursive merge.
  17370. * @returns The combined object containing all properties from both objects.
  17371. */
  17372. export function combine(object1?: any, object2?: any, deep?: boolean): any;
  17373. /**
  17374. * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time.
  17375. * @example
  17376. * this.guid = Cesium.createGuid();
  17377. */
  17378. export function createGuid(): string;
  17379. /**
  17380. * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.
  17381. * @example
  17382. * // Create Cesium World Terrain with default settings
  17383. * var viewer = new Cesium.Viewer('cesiumContainer', {
  17384. * terrainProvider : Cesium.createWorldTerrain();
  17385. * });
  17386. * @example
  17387. * // Create Cesium World Terrain with water and normals.
  17388. * var viewer = new Cesium.Viewer('cesiumContainer', {
  17389. * terrainProvider : Cesium.createWorldTerrain({
  17390. * requestWaterMask : true,
  17391. * requestVertexNormals : true
  17392. * });
  17393. * });
  17394. * @param [options] - Object with the following properties:
  17395. * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available.
  17396. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available.
  17397. */
  17398. export function createWorldTerrain(options?: {
  17399. requestVertexNormals?: boolean;
  17400. requestWaterMask?: boolean;
  17401. }): CesiumTerrainProvider;
  17402. /**
  17403. * Returns the first parameter if not undefined, otherwise the second parameter.
  17404. * Useful for setting a default value for a parameter.
  17405. * @example
  17406. * param = Cesium.defaultValue(param, 'default');
  17407. * @returns Returns the first parameter if not undefined, otherwise the second parameter.
  17408. */
  17409. export function defaultValue(a: any, b: any): any;
  17410. /**
  17411. * @example
  17412. * if (Cesium.defined(positions)) {
  17413. * doSomething();
  17414. * } else {
  17415. * doSomethingElse();
  17416. * }
  17417. * @param value - The object.
  17418. * @returns Returns true if the object is defined, returns false otherwise.
  17419. */
  17420. export function defined(value: any): boolean;
  17421. /**
  17422. * Destroys an object. Each of the object's functions, including functions in its prototype,
  17423. * is replaced with a function that throws a {@link DeveloperError}, except for the object's
  17424. * <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.
  17425. * The object's properties are removed with <code>delete</code>.
  17426. * <br /><br />
  17427. * This function is used by objects that hold native resources, e.g., WebGL resources, which
  17428. * need to be explicitly released. Client code calls an object's <code>destroy</code> function,
  17429. * which then releases the native resource and calls <code>destroyObject</code> to put itself
  17430. * in a destroyed state.
  17431. * @example
  17432. * // How a texture would destroy itself.
  17433. * this.destroy = function () {
  17434. * _gl.deleteTexture(_texture);
  17435. * return Cesium.destroyObject(this);
  17436. * };
  17437. * @param object - The object to destroy.
  17438. * @param [message] - The message to include in the exception that is thrown if
  17439. * a destroyed object's function is called.
  17440. */
  17441. export function destroyObject(object: any, message?: string): void;
  17442. /**
  17443. * Formats an error object into a String. If available, uses name, message, and stack
  17444. * properties, otherwise, falls back on toString().
  17445. * @param object - The item to find in the array.
  17446. * @returns A string containing the formatted error.
  17447. */
  17448. export function formatError(object: any): string;
  17449. /**
  17450. * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.
  17451. * @example
  17452. * //absolute Uri will be "https://test.com/awesome.png";
  17453. * var absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');
  17454. * @param relative - The relative Uri.
  17455. * @param [base] - The base Uri.
  17456. * @returns The absolute Uri of the given relative Uri.
  17457. */
  17458. export function getAbsoluteUri(relative: string, base?: string): string;
  17459. /**
  17460. * Given a URI, returns the base path of the URI.
  17461. * @example
  17462. * // basePath will be "/Gallery/";
  17463. * var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');
  17464. *
  17465. * // basePath will be "/Gallery/?value=true&example=false";
  17466. * var basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);
  17467. * @param uri - The Uri.
  17468. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  17469. * @returns The base path of the Uri.
  17470. */
  17471. export function getBaseUri(uri: string, includeQuery?: boolean): string;
  17472. /**
  17473. * Given a URI, returns the extension of the URI.
  17474. * @example
  17475. * //extension will be "czml";
  17476. * var extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');
  17477. * @param uri - The Uri.
  17478. * @returns The extension of the Uri.
  17479. */
  17480. export function getExtensionFromUri(uri: string): string;
  17481. /**
  17482. * Given a URI, returns the last segment of the URI, removing any path or query information.
  17483. * @example
  17484. * //fileName will be"simple.czml";
  17485. * var fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');
  17486. * @param uri - The Uri.
  17487. * @returns The last segment of the Uri.
  17488. */
  17489. export function getFilenameFromUri(uri: string): string;
  17490. /**
  17491. * Extract a pixel array from a loaded image. Draws the image
  17492. * into a canvas so it can read the pixels back.
  17493. * @param image - The image to extract pixels from.
  17494. * @param width - The width of the image. If not defined, then image.width is assigned.
  17495. * @param height - The height of the image. If not defined, then image.height is assigned.
  17496. * @returns The pixels of the image.
  17497. */
  17498. export function getImagePixels(image: HTMLImageElement, width: number, height: number): ImageData;
  17499. /**
  17500. * Gets a timestamp that can be used in measuring the time between events. Timestamps
  17501. * are expressed in milliseconds, but it is not specified what the milliseconds are
  17502. * measured from. This function uses performance.now() if it is available, or Date.now()
  17503. * otherwise.
  17504. * @returns The timestamp in milliseconds since some unspecified reference time.
  17505. */
  17506. export function getTimestamp(): number;
  17507. /**
  17508. * Determines if a given date is a leap year.
  17509. * @example
  17510. * var leapYear = Cesium.isLeapYear(2000); // true
  17511. * @param year - The year to be tested.
  17512. * @returns True if <code>year</code> is a leap year.
  17513. */
  17514. export function isLeapYear(year: number): boolean;
  17515. /**
  17516. * A stable merge sort.
  17517. * @example
  17518. * // Assume array contains BoundingSpheres in world coordinates.
  17519. * // Sort them in ascending order of distance from the camera.
  17520. * var position = camera.positionWC;
  17521. * Cesium.mergeSort(array, function(a, b, position) {
  17522. * return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position);
  17523. * }, position);
  17524. * @param array - The array to sort.
  17525. * @param comparator - The function to use to compare elements in the array.
  17526. * @param [userDefinedObject] - Any item to pass as the third parameter to <code>comparator</code>.
  17527. */
  17528. export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void;
  17529. /**
  17530. * A function used to compare two items while performing a merge sort.
  17531. * @example
  17532. * function compareNumbers(a, b, userDefinedObject) {
  17533. * return a - b;
  17534. * }
  17535. * @param a - An item in the array.
  17536. * @param b - An item in the array.
  17537. * @param [userDefinedObject] - An object that was passed to {@link mergeSort}.
  17538. */
  17539. export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number;
  17540. /**
  17541. * Converts an object representing a set of name/value pairs into a query string,
  17542. * with names and values encoded properly for use in a URL. Values that are arrays
  17543. * will produce multiple values with the same name.
  17544. * @example
  17545. * var str = Cesium.objectToQuery({
  17546. * key1 : 'some value',
  17547. * key2 : 'a/b',
  17548. * key3 : ['x', 'y']
  17549. * });
  17550. * @param obj - The object containing data to encode.
  17551. * @returns An encoded query string.
  17552. */
  17553. export function objectToQuery(obj: any): string;
  17554. /**
  17555. * Determines if a point is inside a triangle.
  17556. * @example
  17557. * // Returns true
  17558. * var p = new Cesium.Cartesian2(0.25, 0.25);
  17559. * var b = Cesium.pointInsideTriangle(p,
  17560. * new Cesium.Cartesian2(0.0, 0.0),
  17561. * new Cesium.Cartesian2(1.0, 0.0),
  17562. * new Cesium.Cartesian2(0.0, 1.0));
  17563. * @param point - The point to test.
  17564. * @param p0 - The first point of the triangle.
  17565. * @param p1 - The second point of the triangle.
  17566. * @param p2 - The third point of the triangle.
  17567. * @returns <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.
  17568. */
  17569. export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean;
  17570. /**
  17571. * Parses a query string into an object, where the keys and values of the object are the
  17572. * name/value pairs from the query string, decoded. If a name appears multiple times,
  17573. * the value in the object will be an array of values.
  17574. * @example
  17575. * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
  17576. * // obj will be:
  17577. * // {
  17578. * // key1 : 'some value',
  17579. * // key2 : 'a/b',
  17580. * // key3 : ['x', 'y']
  17581. * // }
  17582. * @param queryString - The query string.
  17583. * @returns An object containing the parameters parsed from the query string.
  17584. */
  17585. export function queryToObject(queryString: string): any;
  17586. /**
  17587. * A browser-independent function to request a new animation frame. This is used to create
  17588. * an application's draw loop as shown in the example below.
  17589. * @example
  17590. * // Create a draw loop using requestAnimationFrame. The
  17591. * // tick callback function is called for every animation frame.
  17592. * function tick() {
  17593. * scene.render();
  17594. * Cesium.requestAnimationFrame(tick);
  17595. * }
  17596. * tick();
  17597. * @param callback - The function to call when the next frame should be drawn.
  17598. * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request.
  17599. */
  17600. export function requestAnimationFrame(callback: requestAnimationFrameCallback): number;
  17601. /**
  17602. * A function that will be called when the next frame should be drawn.
  17603. * @param timestamp - A timestamp for the frame, in milliseconds.
  17604. */
  17605. export type requestAnimationFrameCallback = (timestamp: number) => void;
  17606. /**
  17607. * Initiates a terrain height query for an array of {@link Cartographic} positions by
  17608. * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation
  17609. * matches the triangles used to render the terrain at the specified level. The query
  17610. * happens asynchronously, so this function returns a promise that is resolved when
  17611. * the query completes. Each point height is modified in place. If a height can not be
  17612. * determined because no terrain data is available for the specified level at that location,
  17613. * or another error occurs, the height is set to undefined. As is typical of the
  17614. * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid
  17615. * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other
  17616. * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the
  17617. * terrain level of detail as input, if you need to get the altitude of the terrain as precisely
  17618. * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.
  17619. * @example
  17620. * // Query the terrain height of two Cartographic positions
  17621. * var terrainProvider = Cesium.createWorldTerrain();
  17622. * var positions = [
  17623. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  17624. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  17625. * ];
  17626. * var promise = Cesium.sampleTerrain(terrainProvider, 11, positions);
  17627. * Cesium.when(promise, function(updatedPositions) {
  17628. * // positions[0].height and positions[1].height have been updated.
  17629. * // updatedPositions is just a reference to positions.
  17630. * });
  17631. * @param terrainProvider - The terrain provider from which to query heights.
  17632. * @param level - The terrain level-of-detail from which to query terrain heights.
  17633. * @param positions - The positions to update with terrain heights.
  17634. * @returns A promise that resolves to the provided list of positions when terrain the query has completed.
  17635. */
  17636. export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>;
  17637. /**
  17638. * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
  17639. * @example
  17640. * // Query the terrain height of two Cartographic positions
  17641. * var terrainProvider = Cesium.createWorldTerrain();
  17642. * var positions = [
  17643. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  17644. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  17645. * ];
  17646. * var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  17647. * Cesium.when(promise, function(updatedPositions) {
  17648. * // positions[0].height and positions[1].height have been updated.
  17649. * // updatedPositions is just a reference to positions.
  17650. * });
  17651. * @param terrainProvider - The terrain provider from which to query heights.
  17652. * @param positions - The positions to update with terrain heights.
  17653. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This
  17654. * promise will reject if the terrain provider's `availability` property is undefined.
  17655. */
  17656. export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>;
  17657. /**
  17658. * Subdivides an array into a number of smaller, equal sized arrays.
  17659. * @param array - The array to divide.
  17660. * @param numberOfArrays - The number of arrays to divide the provided array into.
  17661. */
  17662. export function subdivideArray(array: any[], numberOfArrays: number): void;
  17663. /**
  17664. * Writes the given text into a new canvas. The canvas will be sized to fit the text.
  17665. * If text is blank, returns undefined.
  17666. * @param text - The text to write.
  17667. * @param [options] - Object with the following properties:
  17668. * @param [options.font = '10px sans-serif'] - The CSS font to use.
  17669. * @param [options.textBaseline = 'bottom'] - The baseline of the text.
  17670. * @param [options.fill = true] - Whether to fill the text.
  17671. * @param [options.stroke = false] - Whether to stroke the text.
  17672. * @param [options.fillColor = Color.WHITE] - The fill color.
  17673. * @param [options.strokeColor = Color.BLACK] - The stroke color.
  17674. * @param [options.strokeWidth = 1] - The stroke width.
  17675. * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas.
  17676. * @param [options.padding = 0] - The pixel size of the padding to add around the text.
  17677. * @returns A new canvas with the given text drawn into it. The dimensions object
  17678. * from measureText will also be added to the returned canvas. If text is
  17679. * blank, returns undefined.
  17680. */
  17681. export function writeTextToCanvas(text: string, options?: {
  17682. font?: string;
  17683. textBaseline?: string;
  17684. fill?: boolean;
  17685. stroke?: boolean;
  17686. fillColor?: Color;
  17687. strokeColor?: Color;
  17688. strokeWidth?: number;
  17689. backgroundColor?: Color;
  17690. padding?: number;
  17691. }): HTMLCanvasElement | undefined;
  17692. export namespace BillboardGraphics {
  17693. /**
  17694. * Initialization options for the BillboardGraphics constructor
  17695. * @property [show = true] - A boolean Property specifying the visibility of the billboard.
  17696. * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard.
  17697. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size.
  17698. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  17699. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  17700. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  17701. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  17702. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  17703. * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image.
  17704. * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis.
  17705. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation.
  17706. * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters.
  17707. * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size.
  17708. * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size.
  17709. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera.
  17710. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  17711. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  17712. * @property [imageSubRegion] - A Property specifying a {@link BoundingRectangle} that defines a sub-region of the image to use for the billboard, rather than the entire image, measured in pixels from the bottom-left.
  17713. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed.
  17714. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  17715. */
  17716. type ConstructorOptions = {
  17717. show?: Property | boolean;
  17718. image?: Property | string | HTMLCanvasElement;
  17719. scale?: Property | number;
  17720. pixelOffset?: Property | Cartesian2;
  17721. eyeOffset?: Property | Cartesian3;
  17722. horizontalOrigin?: Property | HorizontalOrigin;
  17723. verticalOrigin?: Property | VerticalOrigin;
  17724. heightReference?: Property | HeightReference;
  17725. color?: Property | Color;
  17726. rotation?: Property | number;
  17727. alignedAxis?: Property | Cartesian3;
  17728. sizeInMeters?: Property | boolean;
  17729. width?: Property | number;
  17730. height?: Property | number;
  17731. scaleByDistance?: Property | NearFarScalar;
  17732. translucencyByDistance?: Property | NearFarScalar;
  17733. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  17734. imageSubRegion?: Property | BoundingRectangle;
  17735. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  17736. disableDepthTestDistance?: Property | number;
  17737. };
  17738. }
  17739. /**
  17740. * Describes a two dimensional icon located at the position of the containing {@link Entity}.
  17741. * <p>
  17742. * <div align='center'>
  17743. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  17744. * Example billboards
  17745. * </div>
  17746. * </p>
  17747. * @param [options] - Object describing initialization options
  17748. */
  17749. export class BillboardGraphics {
  17750. constructor(options?: BillboardGraphics.ConstructorOptions);
  17751. /**
  17752. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17753. */
  17754. readonly definitionChanged: Event;
  17755. /**
  17756. * Gets or sets the boolean Property specifying the visibility of the billboard.
  17757. */
  17758. show: Property | undefined;
  17759. /**
  17760. * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.
  17761. */
  17762. image: Property | undefined;
  17763. /**
  17764. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  17765. * A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.
  17766. * <p>
  17767. * <div align='center'>
  17768. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  17769. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.
  17770. * </div>
  17771. * </p>
  17772. */
  17773. scale: Property | undefined;
  17774. /**
  17775. * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space
  17776. * from the origin of this billboard. This is commonly used to align multiple billboards and labels at
  17777. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  17778. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  17779. * <p>
  17780. * <div align='center'>
  17781. * <table border='0' cellpadding='5'><tr>
  17782. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  17783. * <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td>
  17784. * </tr></table>
  17785. * The billboard's origin is indicated by the yellow point.
  17786. * </div>
  17787. * </p>
  17788. */
  17789. pixelOffset: Property | undefined;
  17790. /**
  17791. * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.
  17792. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  17793. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  17794. * <p>
  17795. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  17796. * arrange a billboard above its corresponding 3D model.
  17797. * </p>
  17798. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  17799. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  17800. * <p>
  17801. * <div align='center'>
  17802. * <table border='0' cellpadding='5'><tr>
  17803. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  17804. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  17805. * </tr></table>
  17806. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>
  17807. * </div>
  17808. * </p>
  17809. */
  17810. eyeOffset: Property | undefined;
  17811. /**
  17812. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  17813. */
  17814. horizontalOrigin: Property | undefined;
  17815. /**
  17816. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  17817. */
  17818. verticalOrigin: Property | undefined;
  17819. /**
  17820. * Gets or sets the Property specifying the {@link HeightReference}.
  17821. */
  17822. heightReference: Property | undefined;
  17823. /**
  17824. * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.
  17825. * This has two common use cases. First, the same white texture may be used by many different billboards,
  17826. * each with a different color, to create colored billboards. Second, the color's alpha component can be
  17827. * used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard
  17828. * transparent, and <code>1.0</code> makes the billboard opaque.
  17829. * <p>
  17830. * <div align='center'>
  17831. * <table border='0' cellpadding='5'><tr>
  17832. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  17833. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  17834. * </tr></table>
  17835. * </div>
  17836. * </p>
  17837. */
  17838. color: Property | undefined;
  17839. /**
  17840. * Gets or sets the numeric Property specifying the rotation of the image
  17841. * counter clockwise from the <code>alignedAxis</code>.
  17842. */
  17843. rotation: Property | undefined;
  17844. /**
  17845. * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation
  17846. * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.
  17847. */
  17848. alignedAxis: Property | undefined;
  17849. /**
  17850. * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.
  17851. */
  17852. sizeInMeters: Property | undefined;
  17853. /**
  17854. * Gets or sets the numeric Property specifying the width of the billboard in pixels.
  17855. * When undefined, the native width is used.
  17856. */
  17857. width: Property | undefined;
  17858. /**
  17859. * Gets or sets the numeric Property specifying the height of the billboard in pixels.
  17860. * When undefined, the native height is used.
  17861. */
  17862. height: Property | undefined;
  17863. /**
  17864. * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.
  17865. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  17866. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17867. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17868. * Outside of these ranges the billboard's scale remains clamped to the nearest bound.
  17869. */
  17870. scaleByDistance: Property | undefined;
  17871. /**
  17872. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.
  17873. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  17874. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17875. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17876. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound.
  17877. */
  17878. translucencyByDistance: Property | undefined;
  17879. /**
  17880. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.
  17881. * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  17882. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  17883. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  17884. * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound.
  17885. */
  17886. pixelOffsetScaleByDistance: Property | undefined;
  17887. /**
  17888. * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a
  17889. * sub-region of the <code>image</code> to use for the billboard, rather than the entire image,
  17890. * measured in pixels from the bottom-left.
  17891. */
  17892. imageSubRegion: Property | undefined;
  17893. /**
  17894. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.
  17895. */
  17896. distanceDisplayCondition: Property | undefined;
  17897. /**
  17898. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  17899. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  17900. */
  17901. disableDepthTestDistance: Property | undefined;
  17902. /**
  17903. * Duplicates this instance.
  17904. * @param [result] - The object onto which to store the result.
  17905. * @returns The modified result parameter or a new instance if one was not provided.
  17906. */
  17907. clone(result?: BillboardGraphics): BillboardGraphics;
  17908. /**
  17909. * Assigns each unassigned property on this object to the value
  17910. * of the same property on the provided source object.
  17911. * @param source - The object to be merged into this object.
  17912. */
  17913. merge(source: BillboardGraphics): void;
  17914. }
  17915. /**
  17916. * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.
  17917. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  17918. * @param entityCollection - The entityCollection to visualize.
  17919. */
  17920. export class BillboardVisualizer {
  17921. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  17922. /**
  17923. * Updates the primitives created by this visualizer to match their
  17924. * Entity counterpart at the given time.
  17925. * @param time - The time to update to.
  17926. * @returns This function always returns true.
  17927. */
  17928. update(time: JulianDate): boolean;
  17929. /**
  17930. * Returns true if this object was destroyed; otherwise, false.
  17931. * @returns True if this object was destroyed; otherwise, false.
  17932. */
  17933. isDestroyed(): boolean;
  17934. /**
  17935. * Removes and destroys all primitives created by this instance.
  17936. */
  17937. destroy(): void;
  17938. }
  17939. /**
  17940. * A {@link GeometryUpdater} for boxes.
  17941. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  17942. * @param entity - The entity containing the geometry to be visualized.
  17943. * @param scene - The scene where visualization is taking place.
  17944. */
  17945. export class BoxGeometryUpdater {
  17946. constructor(entity: Entity, scene: Scene);
  17947. /**
  17948. * Creates the geometry instance which represents the fill of the geometry.
  17949. * @param time - The time to use when retrieving initial attribute values.
  17950. * @returns The geometry instance representing the filled portion of the geometry.
  17951. */
  17952. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  17953. /**
  17954. * Creates the geometry instance which represents the outline of the geometry.
  17955. * @param time - The time to use when retrieving initial attribute values.
  17956. * @returns The geometry instance representing the outline portion of the geometry.
  17957. */
  17958. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  17959. }
  17960. export namespace BoxGraphics {
  17961. /**
  17962. * Initialization options for the BoxGraphics constructor
  17963. * @property [show = true] - A boolean Property specifying the visibility of the box.
  17964. * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box.
  17965. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  17966. * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material.
  17967. * @property [material = Color.WHITE] - A Property specifying the material used to fill the box.
  17968. * @property [outline = false] - A boolean Property specifying whether the box is outlined.
  17969. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  17970. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  17971. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources.
  17972. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed.
  17973. */
  17974. type ConstructorOptions = {
  17975. show?: Property | boolean;
  17976. dimensions?: Property | Cartesian3;
  17977. heightReference?: Property | HeightReference;
  17978. fill?: Property | boolean;
  17979. material?: MaterialProperty | Color;
  17980. outline?: Property | boolean;
  17981. outlineColor?: Property | Color;
  17982. outlineWidth?: Property | number;
  17983. shadows?: Property | ShadowMode;
  17984. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  17985. };
  17986. }
  17987. /**
  17988. * Describes a box. The center position and orientation are determined by the containing {@link Entity}.
  17989. * @param [options] - Object describing initialization options
  17990. */
  17991. export class BoxGraphics {
  17992. constructor(options?: BoxGraphics.ConstructorOptions);
  17993. /**
  17994. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  17995. */
  17996. readonly definitionChanged: Event;
  17997. /**
  17998. * Gets or sets the boolean Property specifying the visibility of the box.
  17999. */
  18000. show: Property | undefined;
  18001. /**
  18002. * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.
  18003. */
  18004. dimensions: Property | undefined;
  18005. /**
  18006. * Gets or sets the Property specifying the {@link HeightReference}.
  18007. */
  18008. heightReference: Property | undefined;
  18009. /**
  18010. * Gets or sets the boolean Property specifying whether the box is filled with the provided material.
  18011. */
  18012. fill: Property | undefined;
  18013. /**
  18014. * Gets or sets the material used to fill the box.
  18015. */
  18016. material: MaterialProperty | undefined;
  18017. /**
  18018. * Gets or sets the Property specifying whether the box is outlined.
  18019. */
  18020. outline: Property | undefined;
  18021. /**
  18022. * Gets or sets the Property specifying the {@link Color} of the outline.
  18023. */
  18024. outlineColor: Property | undefined;
  18025. /**
  18026. * Gets or sets the numeric Property specifying the width of the outline.
  18027. * <p>
  18028. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  18029. * </p>
  18030. */
  18031. outlineWidth: Property | undefined;
  18032. /**
  18033. * Get or sets the enum Property specifying whether the box
  18034. * casts or receives shadows from light sources.
  18035. */
  18036. shadows: Property | undefined;
  18037. /**
  18038. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.
  18039. */
  18040. distanceDisplayCondition: Property | undefined;
  18041. /**
  18042. * Duplicates this instance.
  18043. * @param [result] - The object onto which to store the result.
  18044. * @returns The modified result parameter or a new instance if one was not provided.
  18045. */
  18046. clone(result?: BoxGraphics): BoxGraphics;
  18047. /**
  18048. * Assigns each unassigned property on this object to the value
  18049. * of the same property on the provided source object.
  18050. * @param source - The object to be merged into this object.
  18051. */
  18052. merge(source: BoxGraphics): void;
  18053. }
  18054. /**
  18055. * A {@link Property} whose value is lazily evaluated by a callback function.
  18056. * @param callback - The function to be called when the property is evaluated.
  18057. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  18058. */
  18059. export class CallbackProperty {
  18060. constructor(callback: CallbackProperty.Callback, isConstant: boolean);
  18061. /**
  18062. * Gets a value indicating if this property is constant.
  18063. */
  18064. readonly isConstant: boolean;
  18065. /**
  18066. * Gets the event that is raised whenever the definition of this property changes.
  18067. * The definition is changed whenever setCallback is called.
  18068. */
  18069. readonly definitionChanged: Event;
  18070. /**
  18071. * Gets the value of the property.
  18072. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  18073. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18074. * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.
  18075. */
  18076. getValue(time?: JulianDate, result?: any): any;
  18077. /**
  18078. * Sets the callback to be used.
  18079. * @param callback - The function to be called when the property is evaluated.
  18080. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  18081. */
  18082. setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void;
  18083. /**
  18084. * Compares this property to the provided property and returns
  18085. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18086. * @param [other] - The other property.
  18087. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18088. */
  18089. equals(other?: Property): boolean;
  18090. }
  18091. export namespace CallbackProperty {
  18092. /**
  18093. * A function that returns the value of the property.
  18094. * @param [time] - The time for which to retrieve the value.
  18095. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18096. */
  18097. type Callback = (time?: JulianDate, result?: any) => any;
  18098. }
  18099. export namespace Cesium3DTilesetGraphics {
  18100. /**
  18101. * Initialization options for the Cesium3DTilesetGraphics constructor
  18102. * @property [show = true] - A boolean Property specifying the visibility of the tileset.
  18103. * @property [uri] - A string or Resource Property specifying the URI of the tileset.
  18104. * @property [maximumScreenSpaceError] - A number or Property specifying the maximum screen space error used to drive level of detail refinement.
  18105. */
  18106. type ConstructorOptions = {
  18107. show?: Property | boolean;
  18108. uri?: Property | string | Resource;
  18109. maximumScreenSpaceError?: Property | number;
  18110. };
  18111. }
  18112. /**
  18113. * A 3D Tiles tileset represented by an {@link Entity}.
  18114. * The tileset modelMatrix is determined by the containing Entity position and orientation
  18115. * or is left unset if position is undefined.
  18116. * @param [options] - Object describing initialization options
  18117. */
  18118. export class Cesium3DTilesetGraphics {
  18119. constructor(options?: Cesium3DTilesetGraphics.ConstructorOptions);
  18120. /**
  18121. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18122. */
  18123. readonly definitionChanged: Event;
  18124. /**
  18125. * Gets or sets the boolean Property specifying the visibility of the model.
  18126. */
  18127. show: Property | undefined;
  18128. /**
  18129. * Gets or sets the string Property specifying the URI of the glTF asset.
  18130. */
  18131. uri: Property | undefined;
  18132. /**
  18133. * Gets or sets the maximum screen space error used to drive level of detail refinement.
  18134. */
  18135. maximumScreenSpaceError: Property | undefined;
  18136. /**
  18137. * Duplicates this instance.
  18138. * @param [result] - The object onto which to store the result.
  18139. * @returns The modified result parameter or a new instance if one was not provided.
  18140. */
  18141. clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics;
  18142. /**
  18143. * Assigns each unassigned property on this object to the value
  18144. * of the same property on the provided source object.
  18145. * @param source - The object to be merged into this object.
  18146. */
  18147. merge(source: Cesium3DTilesetGraphics): void;
  18148. }
  18149. /**
  18150. * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}.
  18151. * @param scene - The scene the primitives will be rendered in.
  18152. * @param entityCollection - The entityCollection to visualize.
  18153. */
  18154. export class Cesium3DTilesetVisualizer {
  18155. constructor(scene: Scene, entityCollection: EntityCollection);
  18156. /**
  18157. * Updates models created this visualizer to match their
  18158. * Entity counterpart at the given time.
  18159. * @param time - The time to update to.
  18160. * @returns This function always returns true.
  18161. */
  18162. update(time: JulianDate): boolean;
  18163. /**
  18164. * Returns true if this object was destroyed; otherwise, false.
  18165. * @returns True if this object was destroyed; otherwise, false.
  18166. */
  18167. isDestroyed(): boolean;
  18168. /**
  18169. * Removes and destroys all primitives created by this instance.
  18170. */
  18171. destroy(): void;
  18172. }
  18173. /**
  18174. * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms.
  18175. * @param [options] - Object with the following properties:
  18176. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  18177. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  18178. * @param [options.repeat = new Cartesian2(2.0, 2.0)] - A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18179. */
  18180. export class CheckerboardMaterialProperty {
  18181. constructor(options?: {
  18182. evenColor?: Property | Color;
  18183. oddColor?: Property | Color;
  18184. repeat?: Property | Cartesian2;
  18185. });
  18186. /**
  18187. * Gets a value indicating if this property is constant. A property is considered
  18188. * constant if getValue always returns the same result for the current definition.
  18189. */
  18190. readonly isConstant: boolean;
  18191. /**
  18192. * Gets the event that is raised whenever the definition of this property changes.
  18193. * The definition is considered to have changed if a call to getValue would return
  18194. * a different result for the same time.
  18195. */
  18196. readonly definitionChanged: Event;
  18197. /**
  18198. * Gets or sets the Property specifying the first {@link Color}.
  18199. */
  18200. evenColor: Property | undefined;
  18201. /**
  18202. * Gets or sets the Property specifying the second {@link Color}.
  18203. */
  18204. oddColor: Property | undefined;
  18205. /**
  18206. * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18207. */
  18208. repeat: Property | undefined;
  18209. /**
  18210. * Gets the {@link Material} type at the provided time.
  18211. * @param time - The time for which to retrieve the type.
  18212. * @returns The type of material.
  18213. */
  18214. getType(time: JulianDate): string;
  18215. /**
  18216. * Gets the value of the property at the provided time.
  18217. * @param time - The time for which to retrieve the value.
  18218. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18219. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18220. */
  18221. getValue(time: JulianDate, result?: any): any;
  18222. /**
  18223. * Compares this property to the provided property and returns
  18224. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18225. * @param [other] - The other property.
  18226. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18227. */
  18228. equals(other?: Property): boolean;
  18229. }
  18230. /**
  18231. * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.
  18232. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  18233. */
  18234. export class ColorMaterialProperty {
  18235. constructor(color?: Property | Color);
  18236. /**
  18237. * Gets a value indicating if this property is constant. A property is considered
  18238. * constant if getValue always returns the same result for the current definition.
  18239. */
  18240. readonly isConstant: boolean;
  18241. /**
  18242. * Gets the event that is raised whenever the definition of this property changes.
  18243. * The definition is considered to have changed if a call to getValue would return
  18244. * a different result for the same time.
  18245. */
  18246. readonly definitionChanged: Event;
  18247. /**
  18248. * Gets or sets the {@link Color} {@link Property}.
  18249. */
  18250. color: Property | undefined;
  18251. /**
  18252. * Gets the {@link Material} type at the provided time.
  18253. * @param time - The time for which to retrieve the type.
  18254. * @returns The type of material.
  18255. */
  18256. getType(time: JulianDate): string;
  18257. /**
  18258. * Gets the value of the property at the provided time.
  18259. * @param time - The time for which to retrieve the value.
  18260. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18261. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18262. */
  18263. getValue(time: JulianDate, result?: any): any;
  18264. /**
  18265. * Compares this property to the provided property and returns
  18266. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18267. * @param [other] - The other property.
  18268. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18269. */
  18270. equals(other?: Property): boolean;
  18271. }
  18272. /**
  18273. * Non-destructively composites multiple {@link EntityCollection} instances into a single collection.
  18274. * If a Entity with the same ID exists in multiple collections, it is non-destructively
  18275. * merged into a single new entity instance. If an entity has the same property in multiple
  18276. * collections, the property of the Entity in the last collection of the list it
  18277. * belongs to is used. CompositeEntityCollection can be used almost anywhere that a
  18278. * EntityCollection is used.
  18279. * @param [collections] - The initial list of EntityCollection instances to merge.
  18280. * @param [owner] - The data source (or composite entity collection) which created this collection.
  18281. */
  18282. export class CompositeEntityCollection {
  18283. constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection);
  18284. /**
  18285. * Gets the event that is fired when entities are added or removed from the collection.
  18286. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  18287. */
  18288. readonly collectionChanged: Event;
  18289. /**
  18290. * Gets a globally unique identifier for this collection.
  18291. */
  18292. readonly id: string;
  18293. /**
  18294. * Gets the array of Entity instances in the collection.
  18295. * This array should not be modified directly.
  18296. */
  18297. readonly values: Entity[];
  18298. /**
  18299. * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it.
  18300. */
  18301. readonly owner: DataSource | CompositeEntityCollection;
  18302. /**
  18303. * Adds a collection to the composite.
  18304. * @param collection - the collection to add.
  18305. * @param [index] - the index to add the collection at. If omitted, the collection will
  18306. * added on top of all existing collections.
  18307. */
  18308. addCollection(collection: EntityCollection, index?: number): void;
  18309. /**
  18310. * Removes a collection from this composite, if present.
  18311. * @param collection - The collection to remove.
  18312. * @returns true if the collection was in the composite and was removed,
  18313. * false if the collection was not in the composite.
  18314. */
  18315. removeCollection(collection: EntityCollection): boolean;
  18316. /**
  18317. * Removes all collections from this composite.
  18318. */
  18319. removeAllCollections(): void;
  18320. /**
  18321. * Checks to see if the composite contains a given collection.
  18322. * @param collection - the collection to check for.
  18323. * @returns true if the composite contains the collection, false otherwise.
  18324. */
  18325. containsCollection(collection: EntityCollection): boolean;
  18326. /**
  18327. * Returns true if the provided entity is in this collection, false otherwise.
  18328. * @param entity - The entity.
  18329. * @returns true if the provided entity is in this collection, false otherwise.
  18330. */
  18331. contains(entity: Entity): boolean;
  18332. /**
  18333. * Determines the index of a given collection in the composite.
  18334. * @param collection - The collection to find the index of.
  18335. * @returns The index of the collection in the composite, or -1 if the collection does not exist in the composite.
  18336. */
  18337. indexOfCollection(collection: EntityCollection): number;
  18338. /**
  18339. * Gets a collection by index from the composite.
  18340. * @param index - the index to retrieve.
  18341. */
  18342. getCollection(index: number): void;
  18343. /**
  18344. * Gets the number of collections in this composite.
  18345. */
  18346. getCollectionsLength(): void;
  18347. /**
  18348. * Raises a collection up one position in the composite.
  18349. * @param collection - the collection to move.
  18350. */
  18351. raiseCollection(collection: EntityCollection): void;
  18352. /**
  18353. * Lowers a collection down one position in the composite.
  18354. * @param collection - the collection to move.
  18355. */
  18356. lowerCollection(collection: EntityCollection): void;
  18357. /**
  18358. * Raises a collection to the top of the composite.
  18359. * @param collection - the collection to move.
  18360. */
  18361. raiseCollectionToTop(collection: EntityCollection): void;
  18362. /**
  18363. * Lowers a collection to the bottom of the composite.
  18364. * @param collection - the collection to move.
  18365. */
  18366. lowerCollectionToBottom(collection: EntityCollection): void;
  18367. /**
  18368. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  18369. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  18370. * point a single event will be raised that covers all suspended operations.
  18371. * This allows for many items to be added and removed efficiently.
  18372. * While events are suspended, recompositing of the collections will
  18373. * also be suspended, as this can be a costly operation.
  18374. * This function can be safely called multiple times as long as there
  18375. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18376. */
  18377. suspendEvents(): void;
  18378. /**
  18379. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  18380. * when an item is added or removed. Any modifications made while while events were suspended
  18381. * will be triggered as a single event when this function is called. This function also ensures
  18382. * the collection is recomposited if events are also resumed.
  18383. * This function is reference counted and can safely be called multiple times as long as there
  18384. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18385. */
  18386. resumeEvents(): void;
  18387. /**
  18388. * Computes the maximum availability of the entities in the collection.
  18389. * If the collection contains a mix of infinitely available data and non-infinite data,
  18390. * It will return the interval pertaining to the non-infinite data only. If all
  18391. * data is infinite, an infinite interval will be returned.
  18392. * @returns The availability of entities in the collection.
  18393. */
  18394. computeAvailability(): TimeInterval;
  18395. /**
  18396. * Gets an entity with the specified id.
  18397. * @param id - The id of the entity to retrieve.
  18398. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  18399. */
  18400. getById(id: string): Entity | undefined;
  18401. }
  18402. /**
  18403. * A {@link CompositeProperty} which is also a {@link MaterialProperty}.
  18404. */
  18405. export class CompositeMaterialProperty {
  18406. constructor();
  18407. /**
  18408. * Gets a value indicating if this property is constant. A property is considered
  18409. * constant if getValue always returns the same result for the current definition.
  18410. */
  18411. readonly isConstant: boolean;
  18412. /**
  18413. * Gets the event that is raised whenever the definition of this property changes.
  18414. * The definition is changed whenever setValue is called with data different
  18415. * than the current value.
  18416. */
  18417. readonly definitionChanged: Event;
  18418. /**
  18419. * Gets the interval collection.
  18420. */
  18421. intervals: TimeIntervalCollection;
  18422. /**
  18423. * Gets the {@link Material} type at the provided time.
  18424. * @param time - The time for which to retrieve the type.
  18425. * @returns The type of material.
  18426. */
  18427. getType(time: JulianDate): string;
  18428. /**
  18429. * Gets the value of the property at the provided time.
  18430. * @param time - The time for which to retrieve the value.
  18431. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18432. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18433. */
  18434. getValue(time: JulianDate, result?: any): any;
  18435. /**
  18436. * Compares this property to the provided property and returns
  18437. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18438. * @param [other] - The other property.
  18439. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18440. */
  18441. equals(other?: Property): boolean;
  18442. }
  18443. /**
  18444. * A {@link CompositeProperty} which is also a {@link PositionProperty}.
  18445. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18446. */
  18447. export class CompositePositionProperty {
  18448. constructor(referenceFrame?: ReferenceFrame);
  18449. /**
  18450. * Gets a value indicating if this property is constant. A property is considered
  18451. * constant if getValue always returns the same result for the current definition.
  18452. */
  18453. readonly isConstant: boolean;
  18454. /**
  18455. * Gets the event that is raised whenever the definition of this property changes.
  18456. * The definition is changed whenever setValue is called with data different
  18457. * than the current value.
  18458. */
  18459. readonly definitionChanged: Event;
  18460. /**
  18461. * Gets the interval collection.
  18462. */
  18463. intervals: TimeIntervalCollection;
  18464. /**
  18465. * Gets or sets the reference frame which this position presents itself as.
  18466. * Each PositionProperty making up this object has it's own reference frame,
  18467. * so this property merely exposes a "preferred" reference frame for clients
  18468. * to use.
  18469. */
  18470. referenceFrame: ReferenceFrame;
  18471. /**
  18472. * Gets the value of the property at the provided time in the fixed frame.
  18473. * @param time - The time for which to retrieve the value.
  18474. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18475. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18476. */
  18477. getValue(time: JulianDate, result?: any): any;
  18478. /**
  18479. * Gets the value of the property at the provided time and in the provided reference frame.
  18480. * @param time - The time for which to retrieve the value.
  18481. * @param referenceFrame - The desired referenceFrame of the result.
  18482. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18483. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18484. */
  18485. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  18486. /**
  18487. * Compares this property to the provided property and returns
  18488. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18489. * @param [other] - The other property.
  18490. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18491. */
  18492. equals(other?: Property): boolean;
  18493. }
  18494. /**
  18495. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  18496. * data property of each {@link TimeInterval} is another Property instance which is
  18497. * evaluated at the provided time.
  18498. * @example
  18499. * var constantProperty = ...;
  18500. * var sampledProperty = ...;
  18501. *
  18502. * //Create a composite property from two previously defined properties
  18503. * //where the property is valid on August 1st, 2012 and uses a constant
  18504. * //property for the first half of the day and a sampled property for the
  18505. * //remaining half.
  18506. * var composite = new Cesium.CompositeProperty();
  18507. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18508. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',
  18509. * data : constantProperty
  18510. * }));
  18511. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18512. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',
  18513. * isStartIncluded : false,
  18514. * isStopIncluded : false,
  18515. * data : sampledProperty
  18516. * }));
  18517. */
  18518. export class CompositeProperty {
  18519. constructor();
  18520. /**
  18521. * Gets a value indicating if this property is constant. A property is considered
  18522. * constant if getValue always returns the same result for the current definition.
  18523. */
  18524. readonly isConstant: boolean;
  18525. /**
  18526. * Gets the event that is raised whenever the definition of this property changes.
  18527. * The definition is changed whenever setValue is called with data different
  18528. * than the current value.
  18529. */
  18530. readonly definitionChanged: Event;
  18531. /**
  18532. * Gets the interval collection.
  18533. */
  18534. intervals: TimeIntervalCollection;
  18535. /**
  18536. * Gets the value of the property at the provided time.
  18537. * @param time - The time for which to retrieve the value.
  18538. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18539. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18540. */
  18541. getValue(time: JulianDate, result?: any): any;
  18542. /**
  18543. * Compares this property to the provided property and returns
  18544. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18545. * @param [other] - The other property.
  18546. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18547. */
  18548. equals(other?: Property): boolean;
  18549. }
  18550. /**
  18551. * A {@link PositionProperty} whose value does not change in respect to the
  18552. * {@link ReferenceFrame} in which is it defined.
  18553. * @param [value] - The property value.
  18554. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18555. */
  18556. export class ConstantPositionProperty {
  18557. constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame);
  18558. /**
  18559. * Gets a value indicating if this property is constant. A property is considered
  18560. * constant if getValue always returns the same result for the current definition.
  18561. */
  18562. readonly isConstant: boolean;
  18563. /**
  18564. * Gets the event that is raised whenever the definition of this property changes.
  18565. * The definition is considered to have changed if a call to getValue would return
  18566. * a different result for the same time.
  18567. */
  18568. readonly definitionChanged: Event;
  18569. /**
  18570. * Gets the reference frame in which the position is defined.
  18571. */
  18572. referenceFrame: ReferenceFrame;
  18573. /**
  18574. * Gets the value of the property at the provided time in the fixed frame.
  18575. * @param time - The time for which to retrieve the value.
  18576. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18577. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18578. */
  18579. getValue(time: JulianDate, result?: any): any;
  18580. /**
  18581. * Sets the value of the property.
  18582. * @param value - The property value.
  18583. * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined.
  18584. */
  18585. setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void;
  18586. /**
  18587. * Gets the value of the property at the provided time and in the provided reference frame.
  18588. * @param time - The time for which to retrieve the value.
  18589. * @param referenceFrame - The desired referenceFrame of the result.
  18590. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18591. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18592. */
  18593. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  18594. /**
  18595. * Compares this property to the provided property and returns
  18596. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18597. * @param [other] - The other property.
  18598. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18599. */
  18600. equals(other?: Property): boolean;
  18601. }
  18602. /**
  18603. * A {@link Property} whose value does not change with respect to simulation time.
  18604. * @param [value] - The property value.
  18605. */
  18606. export class ConstantProperty {
  18607. constructor(value?: any);
  18608. /**
  18609. * Gets a value indicating if this property is constant.
  18610. * This property always returns <code>true</code>.
  18611. */
  18612. readonly isConstant: boolean;
  18613. /**
  18614. * Gets the event that is raised whenever the definition of this property changes.
  18615. * The definition is changed whenever setValue is called with data different
  18616. * than the current value.
  18617. */
  18618. readonly definitionChanged: Event;
  18619. /**
  18620. * Gets the value of the property.
  18621. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  18622. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18623. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18624. */
  18625. getValue(time?: JulianDate, result?: any): any;
  18626. /**
  18627. * Sets the value of the property.
  18628. * @param value - The property value.
  18629. */
  18630. setValue(value: any): void;
  18631. /**
  18632. * Compares this property to the provided property and returns
  18633. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18634. * @param [other] - The other property.
  18635. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18636. */
  18637. equals(other?: Property): boolean;
  18638. /**
  18639. * Gets this property's value.
  18640. * @returns This property's value.
  18641. */
  18642. valueOf(): any;
  18643. /**
  18644. * Creates a string representing this property's value.
  18645. * @returns A string representing the property's value.
  18646. */
  18647. toString(): string;
  18648. }
  18649. /**
  18650. * A {@link GeometryUpdater} for corridors.
  18651. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18652. * @param entity - The entity containing the geometry to be visualized.
  18653. * @param scene - The scene where visualization is taking place.
  18654. */
  18655. export class CorridorGeometryUpdater {
  18656. constructor(entity: Entity, scene: Scene);
  18657. /**
  18658. * Creates the geometry instance which represents the fill of the geometry.
  18659. * @param time - The time to use when retrieving initial attribute values.
  18660. * @returns The geometry instance representing the filled portion of the geometry.
  18661. */
  18662. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18663. /**
  18664. * Creates the geometry instance which represents the outline of the geometry.
  18665. * @param time - The time to use when retrieving initial attribute values.
  18666. * @returns The geometry instance representing the outline portion of the geometry.
  18667. */
  18668. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18669. }
  18670. export namespace CorridorGraphics {
  18671. /**
  18672. * Initialization options for the CorridorGraphics constructor
  18673. * @property [show = true] - A boolean Property specifying the visibility of the corridor.
  18674. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  18675. * @property [width] - A numeric Property specifying the distance between the edges of the corridor.
  18676. * @property [height = 0] - A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.
  18677. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18678. * @property [extrudedHeight] - A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.
  18679. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  18680. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  18681. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the distance between each latitude and longitude.
  18682. * @property [fill = true] - A boolean Property specifying whether the corridor is filled with the provided material.
  18683. * @property [material = Color.WHITE] - A Property specifying the material used to fill the corridor.
  18684. * @property [outline = false] - A boolean Property specifying whether the corridor is outlined.
  18685. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18686. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18687. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the corridor casts or receives shadows from light sources.
  18688. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this corridor will be displayed.
  18689. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  18690. * @property [zIndex] - A Property specifying the zIndex of the corridor, used for ordering. Only has an effect if height and extrudedHeight are undefined, and if the corridor is static.
  18691. */
  18692. type ConstructorOptions = {
  18693. show?: Property | boolean;
  18694. positions?: Property | Cartesian3;
  18695. width?: Property | number;
  18696. height?: Property | number;
  18697. heightReference?: Property | HeightReference;
  18698. extrudedHeight?: Property | number;
  18699. extrudedHeightReference?: Property | HeightReference;
  18700. cornerType?: Property | CornerType;
  18701. granularity?: Property | number;
  18702. fill?: Property | boolean;
  18703. material?: MaterialProperty | Color;
  18704. outline?: Property | boolean;
  18705. outlineColor?: Property | Color;
  18706. outlineWidth?: Property | number;
  18707. shadows?: Property | ShadowMode;
  18708. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18709. classificationType?: Property | ClassificationType;
  18710. zIndex?: ConstantProperty | number;
  18711. };
  18712. }
  18713. /**
  18714. * Describes a corridor, which is a shape defined by a centerline and width that
  18715. * conforms to the curvature of the globe. It can be placed on the surface or at altitude
  18716. * and can optionally be extruded into a volume.
  18717. * @param [options] - Object describing initialization options
  18718. */
  18719. export class CorridorGraphics {
  18720. constructor(options?: CorridorGraphics.ConstructorOptions);
  18721. /**
  18722. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18723. */
  18724. readonly definitionChanged: Event;
  18725. /**
  18726. * Gets or sets the boolean Property specifying the visibility of the corridor.
  18727. */
  18728. show: Property | undefined;
  18729. /**
  18730. * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  18731. */
  18732. positions: Property | undefined;
  18733. /**
  18734. * Gets or sets the numeric Property specifying the width of the outline.
  18735. */
  18736. width: Property | undefined;
  18737. /**
  18738. * Gets or sets the numeric Property specifying the altitude of the corridor.
  18739. */
  18740. height: Property | undefined;
  18741. /**
  18742. * Gets or sets the Property specifying the {@link HeightReference}.
  18743. */
  18744. heightReference: Property | undefined;
  18745. /**
  18746. * Gets or sets the numeric Property specifying the altitude of the corridor extrusion.
  18747. * Setting this property creates a corridor shaped volume starting at height and ending
  18748. * at this altitude.
  18749. */
  18750. extrudedHeight: Property | undefined;
  18751. /**
  18752. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  18753. */
  18754. extrudedHeightReference: Property | undefined;
  18755. /**
  18756. * Gets or sets the {@link CornerType} Property specifying how corners are styled.
  18757. */
  18758. cornerType: Property | undefined;
  18759. /**
  18760. * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.
  18761. */
  18762. granularity: Property | undefined;
  18763. /**
  18764. * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.
  18765. */
  18766. fill: Property | undefined;
  18767. /**
  18768. * Gets or sets the Property specifying the material used to fill the corridor.
  18769. */
  18770. material: MaterialProperty | undefined;
  18771. /**
  18772. * Gets or sets the Property specifying whether the corridor is outlined.
  18773. */
  18774. outline: Property | undefined;
  18775. /**
  18776. * Gets or sets the Property specifying the {@link Color} of the outline.
  18777. */
  18778. outlineColor: Property | undefined;
  18779. /**
  18780. * Gets or sets the numeric Property specifying the width of the outline.
  18781. * <p>
  18782. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  18783. * </p>
  18784. */
  18785. outlineWidth: Property | undefined;
  18786. /**
  18787. * Get or sets the enum Property specifying whether the corridor
  18788. * casts or receives shadows from light sources.
  18789. */
  18790. shadows: Property | undefined;
  18791. /**
  18792. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed.
  18793. */
  18794. distanceDisplayCondition: Property | undefined;
  18795. /**
  18796. * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  18797. */
  18798. classificationType: Property | undefined;
  18799. /**
  18800. * Gets or sets the zIndex Property specifying the ordering of the corridor. Only has an effect if the coridor is static and neither height or exturdedHeight are specified.
  18801. */
  18802. zIndex: ConstantProperty | undefined;
  18803. /**
  18804. * Duplicates this instance.
  18805. * @param [result] - The object onto which to store the result.
  18806. * @returns The modified result parameter or a new instance if one was not provided.
  18807. */
  18808. clone(result?: CorridorGraphics): CorridorGraphics;
  18809. /**
  18810. * Assigns each unassigned property on this object to the value
  18811. * of the same property on the provided source object.
  18812. * @param source - The object to be merged into this object.
  18813. */
  18814. merge(source: CorridorGraphics): void;
  18815. }
  18816. /**
  18817. * A {@link DataSource} implementation which can be used to manually manage a group of entities.
  18818. * @example
  18819. * var dataSource = new Cesium.CustomDataSource('myData');
  18820. *
  18821. * var entity = dataSource.entities.add({
  18822. * position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
  18823. * billboard : {
  18824. * image : 'image.png'
  18825. * }
  18826. * });
  18827. *
  18828. * viewer.dataSources.add(dataSource);
  18829. * @param [name] - A human-readable name for this instance.
  18830. */
  18831. export class CustomDataSource {
  18832. constructor(name?: string);
  18833. /**
  18834. * Gets or sets a human-readable name for this instance.
  18835. */
  18836. name: string;
  18837. /**
  18838. * Gets or sets the clock for this instance.
  18839. */
  18840. clock: DataSourceClock;
  18841. /**
  18842. * Gets the collection of {@link Entity} instances.
  18843. */
  18844. entities: EntityCollection;
  18845. /**
  18846. * Gets or sets whether the data source is currently loading data.
  18847. */
  18848. isLoading: boolean;
  18849. /**
  18850. * Gets an event that will be raised when the underlying data changes.
  18851. */
  18852. changedEvent: Event;
  18853. /**
  18854. * Gets an event that will be raised if an error is encountered during processing.
  18855. */
  18856. errorEvent: Event;
  18857. /**
  18858. * Gets an event that will be raised when the data source either starts or stops loading.
  18859. */
  18860. loadingEvent: Event;
  18861. /**
  18862. * Gets whether or not this data source should be displayed.
  18863. */
  18864. show: boolean;
  18865. /**
  18866. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  18867. */
  18868. clustering: EntityCluster;
  18869. /**
  18870. * Updates the data source to the provided time. This function is optional and
  18871. * is not required to be implemented. It is provided for data sources which
  18872. * retrieve data based on the current animation time or scene state.
  18873. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  18874. * @param time - The simulation time.
  18875. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  18876. */
  18877. update(time: JulianDate): boolean;
  18878. }
  18879. /**
  18880. * A {@link GeometryUpdater} for cylinders.
  18881. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18882. * @param entity - The entity containing the geometry to be visualized.
  18883. * @param scene - The scene where visualization is taking place.
  18884. */
  18885. export class CylinderGeometryUpdater {
  18886. constructor(entity: Entity, scene: Scene);
  18887. /**
  18888. * Creates the geometry instance which represents the fill of the geometry.
  18889. * @param time - The time to use when retrieving initial attribute values.
  18890. * @returns The geometry instance representing the filled portion of the geometry.
  18891. */
  18892. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18893. /**
  18894. * Creates the geometry instance which represents the outline of the geometry.
  18895. * @param time - The time to use when retrieving initial attribute values.
  18896. * @returns The geometry instance representing the outline portion of the geometry.
  18897. */
  18898. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18899. }
  18900. export namespace CylinderGraphics {
  18901. /**
  18902. * Initialization options for the CylinderGraphics constructor
  18903. * @property [show = true] - A boolean Property specifying the visibility of the cylinder.
  18904. * @property [length] - A numeric Property specifying the length of the cylinder.
  18905. * @property [topRadius] - A numeric Property specifying the radius of the top of the cylinder.
  18906. * @property [bottomRadius] - A numeric Property specifying the radius of the bottom of the cylinder.
  18907. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  18908. * @property [fill = true] - A boolean Property specifying whether the cylinder is filled with the provided material.
  18909. * @property [material = Color.WHITE] - A Property specifying the material used to fill the cylinder.
  18910. * @property [outline = false] - A boolean Property specifying whether the cylinder is outlined.
  18911. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18912. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18913. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  18914. * @property [slices = 128] - The number of edges around the perimeter of the cylinder.
  18915. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the cylinder casts or receives shadows from light sources.
  18916. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this cylinder will be displayed.
  18917. */
  18918. type ConstructorOptions = {
  18919. show?: Property | boolean;
  18920. length?: Property | number;
  18921. topRadius?: Property | number;
  18922. bottomRadius?: Property | number;
  18923. heightReference?: Property | HeightReference;
  18924. fill?: Property | boolean;
  18925. material?: MaterialProperty | Color;
  18926. outline?: Property | boolean;
  18927. outlineColor?: Property | Color;
  18928. outlineWidth?: Property | number;
  18929. numberOfVerticalLines?: Property | number;
  18930. slices?: Property | number;
  18931. shadows?: Property | ShadowMode;
  18932. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18933. };
  18934. }
  18935. /**
  18936. * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.
  18937. * The center position and orientation are determined by the containing {@link Entity}.
  18938. * @param [options] - Object describing initialization options
  18939. */
  18940. export class CylinderGraphics {
  18941. constructor(options?: CylinderGraphics.ConstructorOptions);
  18942. /**
  18943. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18944. */
  18945. readonly definitionChanged: Event;
  18946. /**
  18947. * Gets or sets the boolean Property specifying the visibility of the cylinder.
  18948. */
  18949. show: Property | undefined;
  18950. /**
  18951. * Gets or sets the numeric Property specifying the length of the cylinder.
  18952. */
  18953. length: Property | undefined;
  18954. /**
  18955. * Gets or sets the numeric Property specifying the radius of the top of the cylinder.
  18956. */
  18957. topRadius: Property | undefined;
  18958. /**
  18959. * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder.
  18960. */
  18961. bottomRadius: Property | undefined;
  18962. /**
  18963. * Gets or sets the Property specifying the {@link HeightReference}.
  18964. */
  18965. heightReference: Property | undefined;
  18966. /**
  18967. * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material.
  18968. */
  18969. fill: Property | undefined;
  18970. /**
  18971. * Gets or sets the Property specifying the material used to fill the cylinder.
  18972. */
  18973. material: MaterialProperty | undefined;
  18974. /**
  18975. * Gets or sets the boolean Property specifying whether the cylinder is outlined.
  18976. */
  18977. outline: Property | undefined;
  18978. /**
  18979. * Gets or sets the Property specifying the {@link Color} of the outline.
  18980. */
  18981. outlineColor: Property | undefined;
  18982. /**
  18983. * Gets or sets the numeric Property specifying the width of the outline.
  18984. * <p>
  18985. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  18986. * </p>
  18987. */
  18988. outlineWidth: Property | undefined;
  18989. /**
  18990. * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.
  18991. */
  18992. numberOfVerticalLines: Property | undefined;
  18993. /**
  18994. * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder.
  18995. */
  18996. slices: Property | undefined;
  18997. /**
  18998. * Get or sets the enum Property specifying whether the cylinder
  18999. * casts or receives shadows from light sources.
  19000. */
  19001. shadows: Property | undefined;
  19002. /**
  19003. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed.
  19004. */
  19005. distanceDisplayCondition: Property | undefined;
  19006. /**
  19007. * Duplicates this instance.
  19008. * @param [result] - The object onto which to store the result.
  19009. * @returns The modified result parameter or a new instance if one was not provided.
  19010. */
  19011. clone(result?: CylinderGraphics): CylinderGraphics;
  19012. /**
  19013. * Assigns each unassigned property on this object to the value
  19014. * of the same property on the provided source object.
  19015. * @param source - The object to be merged into this object.
  19016. */
  19017. merge(source: CylinderGraphics): void;
  19018. }
  19019. export namespace CzmlDataSource {
  19020. /**
  19021. * Initialization options for the `load` method.
  19022. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  19023. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  19024. */
  19025. type LoadOptions = {
  19026. sourceUri?: Resource | string;
  19027. credit?: Credit | string;
  19028. };
  19029. }
  19030. /**
  19031. * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}.
  19032. * @param [name] - An optional name for the data source. This value will be overwritten if a loaded document contains a name.
  19033. */
  19034. export class CzmlDataSource {
  19035. constructor(name?: string);
  19036. /**
  19037. * Creates a Promise to a new instance loaded with the provided CZML data.
  19038. * @param czml - A url or CZML object to be processed.
  19039. * @param [options] - An object specifying configuration options
  19040. * @returns A promise that resolves to the new instance once the data is processed.
  19041. */
  19042. static load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19043. /**
  19044. * Gets a human-readable name for this instance.
  19045. */
  19046. name: string;
  19047. /**
  19048. * Gets the clock settings defined by the loaded CZML. If no clock is explicitly
  19049. * defined in the CZML, the combined availability of all objects is returned. If
  19050. * only static data exists, this value is undefined.
  19051. */
  19052. clock: DataSourceClock;
  19053. /**
  19054. * Gets the collection of {@link Entity} instances.
  19055. */
  19056. entities: EntityCollection;
  19057. /**
  19058. * Gets a value indicating if the data source is currently loading data.
  19059. */
  19060. isLoading: boolean;
  19061. /**
  19062. * Gets an event that will be raised when the underlying data changes.
  19063. */
  19064. changedEvent: Event;
  19065. /**
  19066. * Gets an event that will be raised if an error is encountered during processing.
  19067. */
  19068. errorEvent: Event;
  19069. /**
  19070. * Gets an event that will be raised when the data source either starts or stops loading.
  19071. */
  19072. loadingEvent: Event;
  19073. /**
  19074. * Gets whether or not this data source should be displayed.
  19075. */
  19076. show: boolean;
  19077. /**
  19078. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19079. */
  19080. clustering: EntityCluster;
  19081. /**
  19082. * Gets the credit that will be displayed for the data source
  19083. */
  19084. credit: Credit;
  19085. /**
  19086. * Gets the array of CZML processing functions.
  19087. */
  19088. static updaters: any[];
  19089. /**
  19090. * Processes the provided url or CZML object without clearing any existing data.
  19091. * @param czml - A url or CZML object to be processed.
  19092. * @param [options] - An object with the following properties:
  19093. * @param [options.sourceUri] - Overrides the url to use for resolving relative links.
  19094. * @returns A promise that resolves to this instances once the data is processed.
  19095. */
  19096. process(czml: Resource | string | any, options?: {
  19097. sourceUri?: string;
  19098. }): Promise<CzmlDataSource>;
  19099. /**
  19100. * Loads the provided url or CZML object, replacing any existing data.
  19101. * @param czml - A url or CZML object to be processed.
  19102. * @param [options] - An object specifying configuration options
  19103. * @returns A promise that resolves to this instances once the data is processed.
  19104. */
  19105. load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19106. /**
  19107. * Updates the data source to the provided time. This function is optional and
  19108. * is not required to be implemented. It is provided for data sources which
  19109. * retrieve data based on the current animation time or scene state.
  19110. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19111. * @param time - The simulation time.
  19112. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19113. */
  19114. update(time: JulianDate): boolean;
  19115. /**
  19116. * A helper function used by custom CZML updater functions
  19117. * which creates or updates a {@link Property} from a CZML packet.
  19118. * @param type - The constructor function for the property being processed.
  19119. * @param object - The object on which the property will be added or updated.
  19120. * @param propertyName - The name of the property on the object.
  19121. * @param packetData - The CZML packet being processed.
  19122. * @param interval - A constraining interval for which the data is valid.
  19123. * @param sourceUri - The originating uri of the data being processed.
  19124. * @param entityCollection - The collection being processsed.
  19125. */
  19126. static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19127. /**
  19128. * A helper function used by custom CZML updater functions
  19129. * which creates or updates a {@link PositionProperty} from a CZML packet.
  19130. * @param object - The object on which the property will be added or updated.
  19131. * @param propertyName - The name of the property on the object.
  19132. * @param packetData - The CZML packet being processed.
  19133. * @param interval - A constraining interval for which the data is valid.
  19134. * @param sourceUri - The originating uri of the data being processed.
  19135. * @param entityCollection - The collection being processsed.
  19136. */
  19137. static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19138. /**
  19139. * A helper function used by custom CZML updater functions
  19140. * which creates or updates a {@link MaterialProperty} from a CZML packet.
  19141. * @param object - The object on which the property will be added or updated.
  19142. * @param propertyName - The name of the property on the object.
  19143. * @param packetData - The CZML packet being processed.
  19144. * @param interval - A constraining interval for which the data is valid.
  19145. * @param sourceUri - The originating uri of the data being processed.
  19146. * @param entityCollection - The collection being processsed.
  19147. */
  19148. static processMaterialPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19149. }
  19150. /**
  19151. * Defines the interface for data sources, which turn arbitrary data into a
  19152. * {@link EntityCollection} for generic consumption. This object is an interface
  19153. * for documentation purposes and is not intended to be instantiated directly.
  19154. */
  19155. export class DataSource {
  19156. constructor();
  19157. /**
  19158. * Gets a human-readable name for this instance.
  19159. */
  19160. name: string;
  19161. /**
  19162. * Gets the preferred clock settings for this data source.
  19163. */
  19164. clock: DataSourceClock;
  19165. /**
  19166. * Gets the collection of {@link Entity} instances.
  19167. */
  19168. entities: EntityCollection;
  19169. /**
  19170. * Gets a value indicating if the data source is currently loading data.
  19171. */
  19172. isLoading: boolean;
  19173. /**
  19174. * Gets an event that will be raised when the underlying data changes.
  19175. */
  19176. changedEvent: Event;
  19177. /**
  19178. * Gets an event that will be raised if an error is encountered during processing.
  19179. */
  19180. errorEvent: Event;
  19181. /**
  19182. * Gets an event that will be raised when the value of isLoading changes.
  19183. */
  19184. loadingEvent: Event;
  19185. /**
  19186. * Gets whether or not this data source should be displayed.
  19187. */
  19188. show: boolean;
  19189. /**
  19190. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19191. */
  19192. clustering: EntityCluster;
  19193. /**
  19194. * Updates the data source to the provided time. This function is optional and
  19195. * is not required to be implemented. It is provided for data sources which
  19196. * retrieve data based on the current animation time or scene state.
  19197. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19198. * @param time - The simulation time.
  19199. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19200. */
  19201. update(time: JulianDate): boolean;
  19202. }
  19203. /**
  19204. * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied
  19205. * to the {@link Clock} when the DataSource is loaded.
  19206. */
  19207. export class DataSourceClock {
  19208. constructor();
  19209. /**
  19210. * Gets the event that is raised whenever a new property is assigned.
  19211. */
  19212. readonly definitionChanged: Event;
  19213. /**
  19214. * Gets or sets the desired start time of the clock.
  19215. * See {@link Clock#startTime}.
  19216. */
  19217. startTime: JulianDate;
  19218. /**
  19219. * Gets or sets the desired stop time of the clock.
  19220. * See {@link Clock#stopTime}.
  19221. */
  19222. stopTime: JulianDate;
  19223. /**
  19224. * Gets or sets the desired current time when this data source is loaded.
  19225. * See {@link Clock#currentTime}.
  19226. */
  19227. currentTime: JulianDate;
  19228. /**
  19229. * Gets or sets the desired clock range setting.
  19230. * See {@link Clock#clockRange}.
  19231. */
  19232. clockRange: ClockRange;
  19233. /**
  19234. * Gets or sets the desired clock step setting.
  19235. * See {@link Clock#clockStep}.
  19236. */
  19237. clockStep: ClockStep;
  19238. /**
  19239. * Gets or sets the desired clock multiplier.
  19240. * See {@link Clock#multiplier}.
  19241. */
  19242. multiplier: number;
  19243. /**
  19244. * Duplicates a DataSourceClock instance.
  19245. * @param [result] - The object onto which to store the result.
  19246. * @returns The modified result parameter or a new instance if one was not provided.
  19247. */
  19248. clone(result?: DataSourceClock): DataSourceClock;
  19249. /**
  19250. * Returns true if this DataSourceClock is equivalent to the other
  19251. * @param other - The other DataSourceClock to compare to.
  19252. * @returns <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
  19253. */
  19254. equals(other: DataSourceClock): boolean;
  19255. /**
  19256. * Assigns each unassigned property on this object to the value
  19257. * of the same property on the provided source object.
  19258. * @param source - The object to be merged into this object.
  19259. */
  19260. merge(source: DataSourceClock): void;
  19261. /**
  19262. * Gets the value of this clock instance as a {@link Clock} object.
  19263. * @returns The modified result parameter or a new instance if one was not provided.
  19264. */
  19265. getValue(): Clock;
  19266. }
  19267. /**
  19268. * A collection of {@link DataSource} instances.
  19269. */
  19270. export class DataSourceCollection {
  19271. constructor();
  19272. /**
  19273. * Gets the number of data sources in this collection.
  19274. */
  19275. readonly length: number;
  19276. /**
  19277. * An event that is raised when a data source is added to the collection.
  19278. * Event handlers are passed the data source that was added.
  19279. */
  19280. readonly dataSourceAdded: Event;
  19281. /**
  19282. * An event that is raised when a data source is removed from the collection.
  19283. * Event handlers are passed the data source that was removed.
  19284. */
  19285. readonly dataSourceRemoved: Event;
  19286. /**
  19287. * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source
  19288. * that was moved, its new index after the move, and its old index prior to the move.
  19289. */
  19290. readonly dataSourceMoved: Event;
  19291. /**
  19292. * Adds a data source to the collection.
  19293. * @param dataSource - A data source or a promise to a data source to add to the collection.
  19294. * When passing a promise, the data source will not actually be added
  19295. * to the collection until the promise resolves successfully.
  19296. * @returns A Promise that resolves once the data source has been added to the collection.
  19297. */
  19298. add(dataSource: DataSource | Promise<DataSource>): Promise<DataSource>;
  19299. /**
  19300. * Removes a data source from this collection, if present.
  19301. * @param dataSource - The data source to remove.
  19302. * @param [destroy = false] - Whether to destroy the data source in addition to removing it.
  19303. * @returns true if the data source was in the collection and was removed,
  19304. * false if the data source was not in the collection.
  19305. */
  19306. remove(dataSource: DataSource, destroy?: boolean): boolean;
  19307. /**
  19308. * Removes all data sources from this collection.
  19309. * @param [destroy = false] - whether to destroy the data sources in addition to removing them.
  19310. */
  19311. removeAll(destroy?: boolean): void;
  19312. /**
  19313. * Checks to see if the collection contains a given data source.
  19314. * @param dataSource - The data source to check for.
  19315. * @returns true if the collection contains the data source, false otherwise.
  19316. */
  19317. contains(dataSource: DataSource): boolean;
  19318. /**
  19319. * Determines the index of a given data source in the collection.
  19320. * @param dataSource - The data source to find the index of.
  19321. * @returns The index of the data source in the collection, or -1 if the data source does not exist in the collection.
  19322. */
  19323. indexOf(dataSource: DataSource): number;
  19324. /**
  19325. * Gets a data source by index from the collection.
  19326. * @param index - the index to retrieve.
  19327. * @returns The data source at the specified index.
  19328. */
  19329. get(index: number): DataSource;
  19330. /**
  19331. * Gets a data source by name from the collection.
  19332. * @param name - The name to retrieve.
  19333. * @returns A list of all data sources matching the provided name.
  19334. */
  19335. getByName(name: string): DataSource[];
  19336. /**
  19337. * Raises a data source up one position in the collection.
  19338. * @param dataSource - The data source to move.
  19339. */
  19340. raise(dataSource: DataSource): void;
  19341. /**
  19342. * Lowers a data source down one position in the collection.
  19343. * @param dataSource - The data source to move.
  19344. */
  19345. lower(dataSource: DataSource): void;
  19346. /**
  19347. * Raises a data source to the top of the collection.
  19348. * @param dataSource - The data source to move.
  19349. */
  19350. raiseToTop(dataSource: DataSource): void;
  19351. /**
  19352. * Lowers a data source to the bottom of the collection.
  19353. * @param dataSource - The data source to move.
  19354. */
  19355. lowerToBottom(dataSource: DataSource): void;
  19356. /**
  19357. * Returns true if this object was destroyed; otherwise, false.
  19358. * If this object was destroyed, it should not be used; calling any function other than
  19359. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19360. * @returns true if this object was destroyed; otherwise, false.
  19361. */
  19362. isDestroyed(): boolean;
  19363. /**
  19364. * Destroys the resources held by all data sources in this collection. Explicitly destroying this
  19365. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  19366. * collector. Once this object is destroyed, it should not be used; calling any function other than
  19367. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19368. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19369. * @example
  19370. * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
  19371. */
  19372. destroy(): void;
  19373. }
  19374. /**
  19375. * Visualizes a collection of {@link DataSource} instances.
  19376. * @param options - Object with the following properties:
  19377. * @param options.scene - The scene in which to display the data.
  19378. * @param options.dataSourceCollection - The data sources to display.
  19379. * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization.
  19380. * If undefined, all standard visualizers are used.
  19381. */
  19382. export class DataSourceDisplay {
  19383. constructor(options: {
  19384. scene: Scene;
  19385. dataSourceCollection: DataSourceCollection;
  19386. visualizersCallback?: DataSourceDisplay.VisualizersCallback;
  19387. });
  19388. /**
  19389. * Gets or sets the default function which creates an array of visualizers used for visualization.
  19390. * By default, this function uses all standard visualizers.
  19391. */
  19392. static defaultVisualizersCallback(): void;
  19393. /**
  19394. * Gets the scene associated with this display.
  19395. */
  19396. scene: Scene;
  19397. /**
  19398. * Gets the collection of data sources to display.
  19399. */
  19400. dataSources: DataSourceCollection;
  19401. /**
  19402. * Gets the default data source instance which can be used to
  19403. * manually create and visualize entities not tied to
  19404. * a specific data source. This instance is always available
  19405. * and does not appear in the list dataSources collection.
  19406. */
  19407. defaultDataSource: CustomDataSource;
  19408. /**
  19409. * Gets a value indicating whether or not all entities in the data source are ready
  19410. */
  19411. readonly ready: boolean;
  19412. /**
  19413. * Returns true if this object was destroyed; otherwise, false.
  19414. * <br /><br />
  19415. * If this object was destroyed, it should not be used; calling any function other than
  19416. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19417. * @returns True if this object was destroyed; otherwise, false.
  19418. */
  19419. isDestroyed(): boolean;
  19420. /**
  19421. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  19422. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  19423. * <br /><br />
  19424. * Once an object is destroyed, it should not be used; calling any function other than
  19425. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19426. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19427. * @example
  19428. * dataSourceDisplay = dataSourceDisplay.destroy();
  19429. */
  19430. destroy(): void;
  19431. /**
  19432. * Updates the display to the provided time.
  19433. * @param time - The simulation time.
  19434. * @returns True if all data sources are ready to be displayed, false otherwise.
  19435. */
  19436. update(time: JulianDate): boolean;
  19437. }
  19438. export namespace DataSourceDisplay {
  19439. /**
  19440. * A function which creates an array of visualizers used for visualization.
  19441. * @example
  19442. * function createVisualizers(scene, dataSource) {
  19443. * return [new Cesium.BillboardVisualizer(scene, dataSource.entities)];
  19444. * }
  19445. * @param scene - The scene to create visualizers for.
  19446. * @param dataSource - The data source to create visualizers for.
  19447. */
  19448. type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[];
  19449. }
  19450. /**
  19451. * A {@link GeometryUpdater} for ellipses.
  19452. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19453. * @param entity - The entity containing the geometry to be visualized.
  19454. * @param scene - The scene where visualization is taking place.
  19455. */
  19456. export class EllipseGeometryUpdater {
  19457. constructor(entity: Entity, scene: Scene);
  19458. /**
  19459. * Creates the geometry instance which represents the fill of the geometry.
  19460. * @param time - The time to use when retrieving initial attribute values.
  19461. * @returns The geometry instance representing the filled portion of the geometry.
  19462. */
  19463. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19464. /**
  19465. * Creates the geometry instance which represents the outline of the geometry.
  19466. * @param time - The time to use when retrieving initial attribute values.
  19467. * @returns The geometry instance representing the outline portion of the geometry.
  19468. */
  19469. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19470. /**
  19471. * Gets a value indicating if the geometry should be drawn on terrain.
  19472. */
  19473. readonly onTerrain: boolean;
  19474. }
  19475. export namespace EllipseGraphics {
  19476. /**
  19477. * Initialization options for the EllipseGraphics constructor
  19478. * @property [show = true] - A boolean Property specifying the visibility of the ellipse.
  19479. * @property [semiMajorAxis] - The numeric Property specifying the semi-major axis.
  19480. * @property [semiMinorAxis] - The numeric Property specifying the semi-minor axis.
  19481. * @property [height = 0] - A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface.
  19482. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  19483. * @property [extrudedHeight] - A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface.
  19484. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  19485. * @property [rotation = 0.0] - A numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19486. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19487. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the ellipse.
  19488. * @property [fill = true] - A boolean Property specifying whether the ellipse is filled with the provided material.
  19489. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipse.
  19490. * @property [outline = false] - A boolean Property specifying whether the ellipse is outlined.
  19491. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19492. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19493. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19494. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipse casts or receives shadows from light sources.
  19495. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipse will be displayed.
  19496. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19497. * @property [zIndex = 0] - A property specifying the zIndex of the Ellipse. Used for ordering ground geometry. Only has an effect if the ellipse is constant and neither height or exturdedHeight are specified.
  19498. */
  19499. type ConstructorOptions = {
  19500. show?: Property | boolean;
  19501. semiMajorAxis?: Property | number;
  19502. semiMinorAxis?: Property | number;
  19503. height?: Property | number;
  19504. heightReference?: Property | HeightReference;
  19505. extrudedHeight?: Property | number;
  19506. extrudedHeightReference?: Property | HeightReference;
  19507. rotation?: Property | number;
  19508. stRotation?: Property | number;
  19509. granularity?: Property | number;
  19510. fill?: Property | boolean;
  19511. material?: MaterialProperty | Color;
  19512. outline?: Property | boolean;
  19513. outlineColor?: Property | Color;
  19514. outlineWidth?: Property | number;
  19515. numberOfVerticalLines?: Property | number;
  19516. shadows?: Property | ShadowMode;
  19517. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19518. classificationType?: Property | ClassificationType;
  19519. zIndex?: ConstantProperty | number;
  19520. };
  19521. }
  19522. /**
  19523. * Describes an ellipse defined by a center point and semi-major and semi-minor axes.
  19524. * The ellipse conforms to the curvature of the globe and can be placed on the surface or
  19525. * at altitude and can optionally be extruded into a volume.
  19526. * The center point is determined by the containing {@link Entity}.
  19527. * @param [options] - Object describing initialization options
  19528. */
  19529. export class EllipseGraphics {
  19530. constructor(options?: EllipseGraphics.ConstructorOptions);
  19531. /**
  19532. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19533. */
  19534. readonly definitionChanged: Event;
  19535. /**
  19536. * Gets or sets the boolean Property specifying the visibility of the ellipse.
  19537. */
  19538. show: Property | undefined;
  19539. /**
  19540. * Gets or sets the numeric Property specifying the semi-major axis.
  19541. */
  19542. semiMajorAxis: Property | undefined;
  19543. /**
  19544. * Gets or sets the numeric Property specifying the semi-minor axis.
  19545. */
  19546. semiMinorAxis: Property | undefined;
  19547. /**
  19548. * Gets or sets the numeric Property specifying the altitude of the ellipse.
  19549. */
  19550. height: Property | undefined;
  19551. /**
  19552. * Gets or sets the Property specifying the {@link HeightReference}.
  19553. */
  19554. heightReference: Property | undefined;
  19555. /**
  19556. * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion.
  19557. * Setting this property creates volume starting at height and ending at this altitude.
  19558. */
  19559. extrudedHeight: Property | undefined;
  19560. /**
  19561. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  19562. */
  19563. extrudedHeightReference: Property | undefined;
  19564. /**
  19565. * Gets or sets the numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19566. */
  19567. rotation: Property | undefined;
  19568. /**
  19569. * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19570. */
  19571. stRotation: Property | undefined;
  19572. /**
  19573. * Gets or sets the numeric Property specifying the angular distance between points on the ellipse.
  19574. */
  19575. granularity: Property | undefined;
  19576. /**
  19577. * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material.
  19578. */
  19579. fill: Property | undefined;
  19580. /**
  19581. * Gets or sets the Property specifying the material used to fill the ellipse.
  19582. */
  19583. material: MaterialProperty | undefined;
  19584. /**
  19585. * Gets or sets the Property specifying whether the ellipse is outlined.
  19586. */
  19587. outline: Property | undefined;
  19588. /**
  19589. * Gets or sets the Property specifying the {@link Color} of the outline.
  19590. */
  19591. outlineColor: Property | undefined;
  19592. /**
  19593. * Gets or sets the numeric Property specifying the width of the outline.
  19594. * <p>
  19595. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  19596. * </p>
  19597. */
  19598. outlineWidth: Property | undefined;
  19599. /**
  19600. * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19601. */
  19602. numberOfVerticalLines: Property | undefined;
  19603. /**
  19604. * Get or sets the enum Property specifying whether the ellipse
  19605. * casts or receives shadows from light sources.
  19606. */
  19607. shadows: Property | undefined;
  19608. /**
  19609. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed.
  19610. */
  19611. distanceDisplayCondition: Property | undefined;
  19612. /**
  19613. * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19614. */
  19615. classificationType: Property | undefined;
  19616. /**
  19617. * Gets or sets the zIndex Property specifying the ellipse ordering. Only has an effect if the ellipse is constant and neither height or extrudedHeight are specified
  19618. */
  19619. zIndex: ConstantProperty | undefined;
  19620. /**
  19621. * Duplicates this instance.
  19622. * @param [result] - The object onto which to store the result.
  19623. * @returns The modified result parameter or a new instance if one was not provided.
  19624. */
  19625. clone(result?: EllipseGraphics): EllipseGraphics;
  19626. /**
  19627. * Assigns each unassigned property on this object to the value
  19628. * of the same property on the provided source object.
  19629. * @param source - The object to be merged into this object.
  19630. */
  19631. merge(source: EllipseGraphics): void;
  19632. }
  19633. /**
  19634. * A {@link GeometryUpdater} for ellipsoids.
  19635. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19636. * @param entity - The entity containing the geometry to be visualized.
  19637. * @param scene - The scene where visualization is taking place.
  19638. */
  19639. export class EllipsoidGeometryUpdater {
  19640. constructor(entity: Entity, scene: Scene);
  19641. /**
  19642. * Creates the geometry instance which represents the fill of the geometry.
  19643. * @param time - The time to use when retrieving initial attribute values.
  19644. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  19645. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  19646. * @returns The geometry instance representing the filled portion of the geometry.
  19647. */
  19648. createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  19649. /**
  19650. * Creates the geometry instance which represents the outline of the geometry.
  19651. * @param time - The time to use when retrieving initial attribute values.
  19652. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  19653. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  19654. * @returns The geometry instance representing the outline portion of the geometry.
  19655. */
  19656. createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  19657. }
  19658. export namespace EllipsoidGraphics {
  19659. /**
  19660. * Initialization options for the EllipsoidGraphics constructor
  19661. * @property [show = true] - A boolean Property specifying the visibility of the ellipsoid.
  19662. * @property [radii] - A {@link Cartesian3} Property specifying the radii of the ellipsoid.
  19663. * @property [innerRadii] - A {@link Cartesian3} Property specifying the inner radii of the ellipsoid.
  19664. * @property [minimumClock = 0.0] - A Property specifying the minimum clock angle of the ellipsoid.
  19665. * @property [maximumClock = 2*PI] - A Property specifying the maximum clock angle of the ellipsoid.
  19666. * @property [minimumCone = 0.0] - A Property specifying the minimum cone angle of the ellipsoid.
  19667. * @property [maximumCone = PI] - A Property specifying the maximum cone angle of the ellipsoid.
  19668. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  19669. * @property [fill = true] - A boolean Property specifying whether the ellipsoid is filled with the provided material.
  19670. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipsoid.
  19671. * @property [outline = false] - A boolean Property specifying whether the ellipsoid is outlined.
  19672. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19673. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19674. * @property [stackPartitions = 64] - A Property specifying the number of stacks.
  19675. * @property [slicePartitions = 64] - A Property specifying the number of radial slices.
  19676. * @property [subdivisions = 128] - A Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  19677. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipsoid casts or receives shadows from light sources.
  19678. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipsoid will be displayed.
  19679. */
  19680. type ConstructorOptions = {
  19681. show?: Property | boolean;
  19682. radii?: Property | Cartesian3;
  19683. innerRadii?: Property | Cartesian3;
  19684. minimumClock?: Property | number;
  19685. maximumClock?: Property | number;
  19686. minimumCone?: Property | number;
  19687. maximumCone?: Property | number;
  19688. heightReference?: Property | HeightReference;
  19689. fill?: Property | boolean;
  19690. material?: MaterialProperty | Color;
  19691. outline?: Property | boolean;
  19692. outlineColor?: Property | Color;
  19693. outlineWidth?: Property | number;
  19694. stackPartitions?: Property | number;
  19695. slicePartitions?: Property | number;
  19696. subdivisions?: Property | number;
  19697. shadows?: Property | ShadowMode;
  19698. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19699. };
  19700. }
  19701. /**
  19702. * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}.
  19703. * @param [options] - Object describing initialization options
  19704. */
  19705. export class EllipsoidGraphics {
  19706. constructor(options?: EllipsoidGraphics.ConstructorOptions);
  19707. /**
  19708. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19709. */
  19710. readonly definitionChanged: Event;
  19711. /**
  19712. * Gets or sets the boolean Property specifying the visibility of the ellipsoid.
  19713. */
  19714. show: Property | undefined;
  19715. /**
  19716. * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid.
  19717. */
  19718. radii: Property | undefined;
  19719. /**
  19720. * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid.
  19721. */
  19722. innerRadii: Property | undefined;
  19723. /**
  19724. * Gets or sets the Property specifying the minimum clock angle of the ellipsoid.
  19725. */
  19726. minimumClock: Property | undefined;
  19727. /**
  19728. * Gets or sets the Property specifying the maximum clock angle of the ellipsoid.
  19729. */
  19730. maximumClock: Property | undefined;
  19731. /**
  19732. * Gets or sets the Property specifying the minimum cone angle of the ellipsoid.
  19733. */
  19734. minimumCone: Property | undefined;
  19735. /**
  19736. * Gets or sets the Property specifying the maximum cone angle of the ellipsoid.
  19737. */
  19738. maximumCone: Property | undefined;
  19739. /**
  19740. * Gets or sets the Property specifying the {@link HeightReference}.
  19741. */
  19742. heightReference: Property | undefined;
  19743. /**
  19744. * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material.
  19745. */
  19746. fill: Property | undefined;
  19747. /**
  19748. * Gets or sets the Property specifying the material used to fill the ellipsoid.
  19749. */
  19750. material: MaterialProperty;
  19751. /**
  19752. * Gets or sets the Property specifying whether the ellipsoid is outlined.
  19753. */
  19754. outline: Property | undefined;
  19755. /**
  19756. * Gets or sets the Property specifying the {@link Color} of the outline.
  19757. */
  19758. outlineColor: Property | undefined;
  19759. /**
  19760. * Gets or sets the numeric Property specifying the width of the outline.
  19761. * <p>
  19762. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  19763. * </p>
  19764. */
  19765. outlineWidth: Property | undefined;
  19766. /**
  19767. * Gets or sets the Property specifying the number of stacks.
  19768. */
  19769. stackPartitions: Property | undefined;
  19770. /**
  19771. * Gets or sets the Property specifying the number of radial slices per 360 degrees.
  19772. */
  19773. slicePartitions: Property | undefined;
  19774. /**
  19775. * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  19776. */
  19777. subdivisions: Property | undefined;
  19778. /**
  19779. * Get or sets the enum Property specifying whether the ellipsoid
  19780. * casts or receives shadows from light sources.
  19781. */
  19782. shadows: Property | undefined;
  19783. /**
  19784. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed.
  19785. */
  19786. distanceDisplayCondition: Property | undefined;
  19787. /**
  19788. * Duplicates this instance.
  19789. * @param [result] - The object onto which to store the result.
  19790. * @returns The modified result parameter or a new instance if one was not provided.
  19791. */
  19792. clone(result?: EllipsoidGraphics): EllipsoidGraphics;
  19793. /**
  19794. * Assigns each unassigned property on this object to the value
  19795. * of the same property on the provided source object.
  19796. * @param source - The object to be merged into this object.
  19797. */
  19798. merge(source: EllipsoidGraphics): void;
  19799. }
  19800. export namespace Entity {
  19801. /**
  19802. * Initialization options for the Entity constructor
  19803. * @property [id] - A unique identifier for this object. If none is provided, a GUID is generated.
  19804. * @property [name] - A human readable name to display to users. It does not have to be unique.
  19805. * @property [availability] - The availability, if any, associated with this object.
  19806. * @property [show] - A boolean value indicating if the entity and its children are displayed.
  19807. * @property [description] - A string Property specifying an HTML description for this entity.
  19808. * @property [position] - A Property specifying the entity position.
  19809. * @property [orientation] - A Property specifying the entity orientation.
  19810. * @property [viewFrom] - A suggested initial offset for viewing this object.
  19811. * @property [parent] - A parent entity to associate with this entity.
  19812. * @property [billboard] - A billboard to associate with this entity.
  19813. * @property [box] - A box to associate with this entity.
  19814. * @property [corridor] - A corridor to associate with this entity.
  19815. * @property [cylinder] - A cylinder to associate with this entity.
  19816. * @property [ellipse] - A ellipse to associate with this entity.
  19817. * @property [ellipsoid] - A ellipsoid to associate with this entity.
  19818. * @property [label] - A options.label to associate with this entity.
  19819. * @property [model] - A model to associate with this entity.
  19820. * @property [tileset] - A 3D Tiles tileset to associate with this entity.
  19821. * @property [path] - A path to associate with this entity.
  19822. * @property [plane] - A plane to associate with this entity.
  19823. * @property [point] - A point to associate with this entity.
  19824. * @property [polygon] - A polygon to associate with this entity.
  19825. * @property [polyline] - A polyline to associate with this entity.
  19826. * @property [properties] - Arbitrary properties to associate with this entity.
  19827. * @property [polylineVolume] - A polylineVolume to associate with this entity.
  19828. * @property [rectangle] - A rectangle to associate with this entity.
  19829. * @property [wall] - A wall to associate with this entity.
  19830. */
  19831. type ConstructorOptions = {
  19832. id?: string;
  19833. name?: string;
  19834. availability?: TimeIntervalCollection;
  19835. show?: boolean;
  19836. description?: Property | string;
  19837. position?: PositionProperty | Cartesian3;
  19838. orientation?: Property;
  19839. viewFrom?: Property;
  19840. parent?: Entity;
  19841. billboard?: BillboardGraphics | BillboardGraphics.ConstructorOptions;
  19842. box?: BoxGraphics | BoxGraphics.ConstructorOptions;
  19843. corridor?: CorridorGraphics | CorridorGraphics.ConstructorOptions;
  19844. cylinder?: CylinderGraphics | CylinderGraphics.ConstructorOptions;
  19845. ellipse?: EllipseGraphics | EllipseGraphics.ConstructorOptions;
  19846. ellipsoid?: EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions;
  19847. label?: LabelGraphics | LabelGraphics.ConstructorOptions;
  19848. model?: ModelGraphics | ModelGraphics.ConstructorOptions;
  19849. tileset?: Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions;
  19850. path?: PathGraphics | PathGraphics.ConstructorOptions;
  19851. plane?: PlaneGraphics | PlaneGraphics.ConstructorOptions;
  19852. point?: PointGraphics | PointGraphics.ConstructorOptions;
  19853. polygon?: PolygonGraphics | PolygonGraphics.ConstructorOptions;
  19854. polyline?: PolylineGraphics | PolylineGraphics.ConstructorOptions;
  19855. properties?: PropertyBag | {
  19856. [key: string]: any;
  19857. };
  19858. polylineVolume?: PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions;
  19859. rectangle?: RectangleGraphics | RectangleGraphics.ConstructorOptions;
  19860. wall?: WallGraphics | WallGraphics.ConstructorOptions;
  19861. };
  19862. }
  19863. /**
  19864. * Entity instances aggregate multiple forms of visualization into a single high-level object.
  19865. * They can be created manually and added to {@link Viewer#entities} or be produced by
  19866. * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}.
  19867. * @param [options] - Object describing initialization options
  19868. */
  19869. export class Entity {
  19870. constructor(options?: Entity.ConstructorOptions);
  19871. /**
  19872. * Gets or sets the entity collection that this entity belongs to.
  19873. */
  19874. entityCollection: EntityCollection;
  19875. /**
  19876. * The availability, if any, associated with this object.
  19877. * If availability is undefined, it is assumed that this object's
  19878. * other properties will return valid data for any provided time.
  19879. * If availability exists, the objects other properties will only
  19880. * provide valid data if queried within the given interval.
  19881. */
  19882. availability: TimeIntervalCollection | undefined;
  19883. /**
  19884. * Gets the unique ID associated with this object.
  19885. */
  19886. id: string;
  19887. /**
  19888. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19889. */
  19890. readonly definitionChanged: Event;
  19891. /**
  19892. * Gets or sets the name of the object. The name is intended for end-user
  19893. * consumption and does not need to be unique.
  19894. */
  19895. name: string | undefined;
  19896. /**
  19897. * Gets or sets whether this entity should be displayed. When set to true,
  19898. * the entity is only displayed if the parent entity's show property is also true.
  19899. */
  19900. show: boolean;
  19901. /**
  19902. * Gets whether this entity is being displayed, taking into account
  19903. * the visibility of any ancestor entities.
  19904. */
  19905. isShowing: boolean;
  19906. /**
  19907. * Gets or sets the parent object.
  19908. */
  19909. parent: Entity | undefined;
  19910. /**
  19911. * Gets the names of all properties registered on this instance.
  19912. */
  19913. propertyNames: string[];
  19914. /**
  19915. * Gets or sets the billboard.
  19916. */
  19917. billboard: BillboardGraphics | undefined;
  19918. /**
  19919. * Gets or sets the box.
  19920. */
  19921. box: BoxGraphics | undefined;
  19922. /**
  19923. * Gets or sets the corridor.
  19924. */
  19925. corridor: CorridorGraphics | undefined;
  19926. /**
  19927. * Gets or sets the cylinder.
  19928. */
  19929. cylinder: CylinderGraphics | undefined;
  19930. /**
  19931. * Gets or sets the description.
  19932. */
  19933. description: Property | undefined;
  19934. /**
  19935. * Gets or sets the ellipse.
  19936. */
  19937. ellipse: EllipseGraphics | undefined;
  19938. /**
  19939. * Gets or sets the ellipsoid.
  19940. */
  19941. ellipsoid: EllipsoidGraphics | undefined;
  19942. /**
  19943. * Gets or sets the label.
  19944. */
  19945. label: LabelGraphics | undefined;
  19946. /**
  19947. * Gets or sets the model.
  19948. */
  19949. model: ModelGraphics | undefined;
  19950. /**
  19951. * Gets or sets the tileset.
  19952. */
  19953. tileset: Cesium3DTilesetGraphics | undefined;
  19954. /**
  19955. * Gets or sets the orientation.
  19956. */
  19957. orientation: Property | undefined;
  19958. /**
  19959. * Gets or sets the path.
  19960. */
  19961. path: PathGraphics | undefined;
  19962. /**
  19963. * Gets or sets the plane.
  19964. */
  19965. plane: PlaneGraphics | undefined;
  19966. /**
  19967. * Gets or sets the point graphic.
  19968. */
  19969. point: PointGraphics | undefined;
  19970. /**
  19971. * Gets or sets the polygon.
  19972. */
  19973. polygon: PolygonGraphics | undefined;
  19974. /**
  19975. * Gets or sets the polyline.
  19976. */
  19977. polyline: PolylineGraphics | undefined;
  19978. /**
  19979. * Gets or sets the polyline volume.
  19980. */
  19981. polylineVolume: PolylineVolumeGraphics | undefined;
  19982. /**
  19983. * Gets or sets the bag of arbitrary properties associated with this entity.
  19984. */
  19985. properties: PropertyBag | undefined;
  19986. /**
  19987. * Gets or sets the position.
  19988. */
  19989. position: PositionProperty | undefined;
  19990. /**
  19991. * Gets or sets the rectangle.
  19992. */
  19993. rectangle: RectangleGraphics | undefined;
  19994. /**
  19995. * Gets or sets the suggested initial offset when tracking this object.
  19996. * The offset is typically defined in the east-north-up reference frame,
  19997. * but may be another frame depending on the object's velocity.
  19998. */
  19999. viewFrom: Property | undefined;
  20000. /**
  20001. * Gets or sets the wall.
  20002. */
  20003. wall: WallGraphics | undefined;
  20004. /**
  20005. * Given a time, returns true if this object should have data during that time.
  20006. * @param time - The time to check availability for.
  20007. * @returns true if the object should have data during the provided time, false otherwise.
  20008. */
  20009. isAvailable(time: JulianDate): boolean;
  20010. /**
  20011. * Adds a property to this object. Once a property is added, it can be
  20012. * observed with {@link Entity#definitionChanged} and composited
  20013. * with {@link CompositeEntityCollection}
  20014. * @param propertyName - The name of the property to add.
  20015. */
  20016. addProperty(propertyName: string): void;
  20017. /**
  20018. * Removed a property previously added with addProperty.
  20019. * @param propertyName - The name of the property to remove.
  20020. */
  20021. removeProperty(propertyName: string): void;
  20022. /**
  20023. * Assigns each unassigned property on this object to the value
  20024. * of the same property on the provided source object.
  20025. * @param source - The object to be merged into this object.
  20026. */
  20027. merge(source: Entity): void;
  20028. /**
  20029. * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position
  20030. * are undefined.
  20031. * @param time - The time to retrieve model matrix for.
  20032. * @param [result] - The object onto which to store the result.
  20033. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined.
  20034. */
  20035. computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4;
  20036. /**
  20037. * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles.
  20038. * If this feature is not supported, Entities with non-color materials but no `height` will
  20039. * instead be rendered as if height is 0.
  20040. * @param scene - The current scene.
  20041. * @returns Whether or not the current scene supports materials for entities on terrain.
  20042. */
  20043. static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean;
  20044. /**
  20045. * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles.
  20046. * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at
  20047. * the provided heights and using the `arcType` parameter instead of clamped to the ground.
  20048. * @param scene - The current scene.
  20049. * @returns Whether or not the current scene supports polylines on terrain or 3D TIles.
  20050. */
  20051. static supportsPolylinesOnTerrain(scene: Scene): boolean;
  20052. }
  20053. /**
  20054. * Defines how screen space objects (billboards, points, labels) are clustered.
  20055. * @param [options] - An object with the following properties:
  20056. * @param [options.enabled = false] - Whether or not to enable clustering.
  20057. * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box.
  20058. * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered.
  20059. * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity.
  20060. * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity.
  20061. * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity.
  20062. * @param [options.show = true] - Determines if the entities in the cluster will be shown.
  20063. */
  20064. export class EntityCluster {
  20065. constructor(options?: {
  20066. enabled?: boolean;
  20067. pixelRange?: number;
  20068. minimumClusterSize?: number;
  20069. clusterBillboards?: boolean;
  20070. clusterLabels?: boolean;
  20071. clusterPoints?: boolean;
  20072. show?: boolean;
  20073. });
  20074. /**
  20075. * Determines if entities in this collection will be shown.
  20076. */
  20077. show: boolean;
  20078. /**
  20079. * Gets or sets whether clustering is enabled.
  20080. */
  20081. enabled: boolean;
  20082. /**
  20083. * Gets or sets the pixel range to extend the screen space bounding box.
  20084. */
  20085. pixelRange: number;
  20086. /**
  20087. * Gets or sets the minimum number of screen space objects that can be clustered.
  20088. */
  20089. minimumClusterSize: number;
  20090. /**
  20091. * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.
  20092. */
  20093. clusterEvent: Event;
  20094. /**
  20095. * Gets or sets whether clustering billboard entities is enabled.
  20096. */
  20097. clusterBillboards: boolean;
  20098. /**
  20099. * Gets or sets whether clustering labels entities is enabled.
  20100. */
  20101. clusterLabels: boolean;
  20102. /**
  20103. * Gets or sets whether clustering point entities is enabled.
  20104. */
  20105. clusterPoints: boolean;
  20106. /**
  20107. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  20108. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  20109. * <p>
  20110. * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
  20111. * from a data source collection and added to another.
  20112. * </p>
  20113. */
  20114. destroy(): void;
  20115. }
  20116. export namespace EntityCluster {
  20117. /**
  20118. * A event listener function used to style clusters.
  20119. * @example
  20120. * // The default cluster values.
  20121. * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
  20122. * cluster.label.show = true;
  20123. * cluster.label.text = entities.length.toLocaleString();
  20124. * });
  20125. * @param clusteredEntities - An array of the entities contained in the cluster.
  20126. * @param cluster - An object containing billboard, label, and point properties. The values are the same as
  20127. * billboard, label and point entities, but must be the values of the ConstantProperty.
  20128. */
  20129. type newClusterCallback = (clusteredEntities: Entity[], cluster: any) => void;
  20130. }
  20131. /**
  20132. * An observable collection of {@link Entity} instances where each entity has a unique id.
  20133. * @param [owner] - The data source (or composite entity collection) which created this collection.
  20134. */
  20135. export class EntityCollection {
  20136. constructor(owner?: DataSource | CompositeEntityCollection);
  20137. /**
  20138. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  20139. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  20140. * point a single event will be raised that covers all suspended operations.
  20141. * This allows for many items to be added and removed efficiently.
  20142. * This function can be safely called multiple times as long as there
  20143. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  20144. */
  20145. suspendEvents(): void;
  20146. /**
  20147. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  20148. * when an item is added or removed. Any modifications made while while events were suspended
  20149. * will be triggered as a single event when this function is called.
  20150. * This function is reference counted and can safely be called multiple times as long as there
  20151. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  20152. */
  20153. resumeEvents(): void;
  20154. /**
  20155. * The signature of the event generated by {@link EntityCollection#collectionChanged}.
  20156. * @param collection - The collection that triggered the event.
  20157. * @param added - The array of {@link Entity} instances that have been added to the collection.
  20158. * @param removed - The array of {@link Entity} instances that have been removed from the collection.
  20159. * @param changed - The array of {@link Entity} instances that have been modified.
  20160. */
  20161. static collectionChangedEventCallback(collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]): void;
  20162. /**
  20163. * Gets the event that is fired when entities are added or removed from the collection.
  20164. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  20165. */
  20166. readonly collectionChanged: Event;
  20167. /**
  20168. * Gets a globally unique identifier for this collection.
  20169. */
  20170. readonly id: string;
  20171. /**
  20172. * Gets the array of Entity instances in the collection.
  20173. * This array should not be modified directly.
  20174. */
  20175. readonly values: Entity[];
  20176. /**
  20177. * Gets whether or not this entity collection should be
  20178. * displayed. When true, each entity is only displayed if
  20179. * its own show property is also true.
  20180. */
  20181. show: boolean;
  20182. /**
  20183. * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
  20184. */
  20185. readonly owner: DataSource | CompositeEntityCollection;
  20186. /**
  20187. * Computes the maximum availability of the entities in the collection.
  20188. * If the collection contains a mix of infinitely available data and non-infinite data,
  20189. * it will return the interval pertaining to the non-infinite data only. If all
  20190. * data is infinite, an infinite interval will be returned.
  20191. * @returns The availability of entities in the collection.
  20192. */
  20193. computeAvailability(): TimeInterval;
  20194. /**
  20195. * Add an entity to the collection.
  20196. * @param entity - The entity to be added.
  20197. * @returns The entity that was added.
  20198. */
  20199. add(entity: Entity | Entity.ConstructorOptions): Entity;
  20200. /**
  20201. * Removes an entity from the collection.
  20202. * @param entity - The entity to be removed.
  20203. * @returns true if the item was removed, false if it did not exist in the collection.
  20204. */
  20205. remove(entity: Entity): boolean;
  20206. /**
  20207. * Returns true if the provided entity is in this collection, false otherwise.
  20208. * @param entity - The entity.
  20209. * @returns true if the provided entity is in this collection, false otherwise.
  20210. */
  20211. contains(entity: Entity): boolean;
  20212. /**
  20213. * Removes an entity with the provided id from the collection.
  20214. * @param id - The id of the entity to remove.
  20215. * @returns true if the item was removed, false if no item with the provided id existed in the collection.
  20216. */
  20217. removeById(id: string): boolean;
  20218. /**
  20219. * Removes all Entities from the collection.
  20220. */
  20221. removeAll(): void;
  20222. /**
  20223. * Gets an entity with the specified id.
  20224. * @param id - The id of the entity to retrieve.
  20225. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  20226. */
  20227. getById(id: string): Entity | undefined;
  20228. /**
  20229. * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.
  20230. * @param id - The id of the entity to retrieve or create.
  20231. * @returns The new or existing object.
  20232. */
  20233. getOrCreateEntity(id: string): Entity;
  20234. }
  20235. /**
  20236. * A utility object for tracking an entity with the camera.
  20237. * @param entity - The entity to track with the camera.
  20238. * @param scene - The scene to use.
  20239. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use for orienting the camera.
  20240. */
  20241. export class EntityView {
  20242. constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid);
  20243. /**
  20244. * The entity to track with the camera.
  20245. */
  20246. entity: Entity;
  20247. /**
  20248. * The scene in which to track the object.
  20249. */
  20250. scene: Scene;
  20251. /**
  20252. * The ellipsoid to use for orienting the camera.
  20253. */
  20254. ellipsoid: Ellipsoid;
  20255. /**
  20256. * The bounding sphere of the object.
  20257. */
  20258. boundingSphere: BoundingSphere;
  20259. /**
  20260. * Gets or sets a camera offset that will be used to
  20261. * initialize subsequent EntityViews.
  20262. */
  20263. static defaultOffset3D: Cartesian3;
  20264. /**
  20265. * Should be called each animation frame to update the camera
  20266. * to the latest settings.
  20267. * @param time - The current animation time.
  20268. * @param [boundingSphere] - bounding sphere of the object.
  20269. */
  20270. update(time: JulianDate, boundingSphere?: BoundingSphere): void;
  20271. }
  20272. export namespace GeoJsonDataSource {
  20273. /**
  20274. * Initialization options for the `load` method.
  20275. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  20276. * @property [markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20277. * @property [markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20278. * @property [markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20279. * @property [stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20280. * @property [strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20281. * @property [fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20282. * @property [clampToGround = GeoJsonDataSource.clampToGround] - true if we want the geometry features (polygons or linestrings) clamped to the ground.
  20283. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20284. */
  20285. type LoadOptions = {
  20286. sourceUri?: string;
  20287. markerSize?: number;
  20288. markerSymbol?: string;
  20289. markerColor?: Color;
  20290. stroke?: Color;
  20291. strokeWidth?: number;
  20292. fill?: Color;
  20293. clampToGround?: boolean;
  20294. credit?: Credit | string;
  20295. };
  20296. /**
  20297. * This callback is displayed as part of the GeoJsonDataSource class.
  20298. * @param properties - The properties of the feature.
  20299. * @param nameProperty - The property key that Cesium estimates to have the name of the feature.
  20300. */
  20301. type describe = (properties: any, nameProperty: string) => void;
  20302. }
  20303. /**
  20304. * A {@link DataSource} which processes both
  20305. * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data.
  20306. * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they
  20307. * are present.
  20308. * @example
  20309. * var viewer = new Cesium.Viewer('cesiumContainer');
  20310. * viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {
  20311. * stroke: Cesium.Color.HOTPINK,
  20312. * fill: Cesium.Color.PINK,
  20313. * strokeWidth: 3,
  20314. * markerSymbol: '?'
  20315. * }));
  20316. * @param [name] - The name of this data source. If undefined, a name will be taken from
  20317. * the name of the GeoJSON file.
  20318. */
  20319. export class GeoJsonDataSource {
  20320. constructor(name?: string);
  20321. /**
  20322. * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
  20323. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20324. * @param [options] - An object specifying configuration options
  20325. * @returns A promise that will resolve when the data is loaded.
  20326. */
  20327. static load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20328. /**
  20329. * Gets or sets the default size of the map pin created for each point, in pixels.
  20330. */
  20331. static markerSize: number;
  20332. /**
  20333. * Gets or sets the default symbol of the map pin created for each point.
  20334. * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character,
  20335. * or blank if no symbol is to be used.
  20336. */
  20337. static markerSymbol: string;
  20338. /**
  20339. * Gets or sets the default color of the map pin created for each point.
  20340. */
  20341. static markerColor: Color;
  20342. /**
  20343. * Gets or sets the default color of polylines and polygon outlines.
  20344. */
  20345. static stroke: Color;
  20346. /**
  20347. * Gets or sets the default width of polylines and polygon outlines.
  20348. */
  20349. static strokeWidth: number;
  20350. /**
  20351. * Gets or sets default color for polygon interiors.
  20352. */
  20353. static fill: Color;
  20354. /**
  20355. * Gets or sets default of whether to clamp to the ground.
  20356. */
  20357. static clampToGround: boolean;
  20358. /**
  20359. * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate
  20360. * and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which
  20361. * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name,
  20362. * for example 'EPSG:4326'.
  20363. */
  20364. static crsNames: any;
  20365. /**
  20366. * Gets an object that maps the href property of a crs link to a callback function
  20367. * which takes the crs properties object and returns a Promise that resolves
  20368. * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20369. * Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming
  20370. * the link has a type specified.
  20371. */
  20372. static crsLinkHrefs: any;
  20373. /**
  20374. * Gets an object that maps the type property of a crs link to a callback function
  20375. * which takes the crs properties object and returns a Promise that resolves
  20376. * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20377. * Items in <code>crsLinkHrefs</code> take precedence over this object.
  20378. */
  20379. static crsLinkTypes: any;
  20380. /**
  20381. * Gets or sets a human-readable name for this instance.
  20382. */
  20383. name: string;
  20384. /**
  20385. * This DataSource only defines static data, therefore this property is always undefined.
  20386. */
  20387. clock: DataSourceClock;
  20388. /**
  20389. * Gets the collection of {@link Entity} instances.
  20390. */
  20391. entities: EntityCollection;
  20392. /**
  20393. * Gets a value indicating if the data source is currently loading data.
  20394. */
  20395. isLoading: boolean;
  20396. /**
  20397. * Gets an event that will be raised when the underlying data changes.
  20398. */
  20399. changedEvent: Event;
  20400. /**
  20401. * Gets an event that will be raised if an error is encountered during processing.
  20402. */
  20403. errorEvent: Event;
  20404. /**
  20405. * Gets an event that will be raised when the data source either starts or stops loading.
  20406. */
  20407. loadingEvent: Event;
  20408. /**
  20409. * Gets whether or not this data source should be displayed.
  20410. */
  20411. show: boolean;
  20412. /**
  20413. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20414. */
  20415. clustering: EntityCluster;
  20416. /**
  20417. * Gets the credit that will be displayed for the data source
  20418. */
  20419. credit: Credit;
  20420. /**
  20421. * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.
  20422. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20423. * @param [options] - An object with the following properties:
  20424. * @param [options.sourceUri] - Overrides the url to use for resolving relative links.
  20425. * @param [options.describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string),
  20426. * which converts the properties into an html description.
  20427. * @param [options.markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20428. * @param [options.markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20429. * @param [options.markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20430. * @param [options.stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20431. * @param [options.strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20432. * @param [options.fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20433. * @param [options.clampToGround = GeoJsonDataSource.clampToGround] - true if we want the features clamped to the ground.
  20434. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  20435. * @returns a promise that will resolve when the GeoJSON is loaded.
  20436. */
  20437. load(data: Resource | string | any, options?: {
  20438. sourceUri?: string;
  20439. describe?: GeoJsonDataSource.describe;
  20440. markerSize?: number;
  20441. markerSymbol?: string;
  20442. markerColor?: Color;
  20443. stroke?: Color;
  20444. strokeWidth?: number;
  20445. fill?: Color;
  20446. clampToGround?: boolean;
  20447. credit?: Credit | string;
  20448. }): Promise<GeoJsonDataSource>;
  20449. /**
  20450. * Updates the data source to the provided time. This function is optional and
  20451. * is not required to be implemented. It is provided for data sources which
  20452. * retrieve data based on the current animation time or scene state.
  20453. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  20454. * @param time - The simulation time.
  20455. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20456. */
  20457. update(time: JulianDate): boolean;
  20458. }
  20459. /**
  20460. * An abstract class for updating geometry entities.
  20461. * @param options - An object with the following properties:
  20462. * @param options.entity - The entity containing the geometry to be visualized.
  20463. * @param options.scene - The scene where visualization is taking place.
  20464. * @param options.geometryOptions - Options for the geometry
  20465. * @param options.geometryPropertyName - The geometry property name
  20466. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20467. */
  20468. export class GeometryUpdater {
  20469. constructor(options: {
  20470. entity: Entity;
  20471. scene: Scene;
  20472. geometryOptions: any;
  20473. geometryPropertyName: string;
  20474. observedPropertyNames: string[];
  20475. });
  20476. /**
  20477. * Gets the unique ID associated with this updater
  20478. */
  20479. readonly id: string;
  20480. /**
  20481. * Gets the entity associated with this geometry.
  20482. */
  20483. readonly entity: Entity;
  20484. /**
  20485. * Gets a value indicating if the geometry has a fill component.
  20486. */
  20487. readonly fillEnabled: boolean;
  20488. /**
  20489. * Gets a value indicating if fill visibility varies with simulation time.
  20490. */
  20491. readonly hasConstantFill: boolean;
  20492. /**
  20493. * Gets the material property used to fill the geometry.
  20494. */
  20495. readonly fillMaterialProperty: MaterialProperty;
  20496. /**
  20497. * Gets a value indicating if the geometry has an outline component.
  20498. */
  20499. readonly outlineEnabled: boolean;
  20500. /**
  20501. * Gets a value indicating if the geometry has an outline component.
  20502. */
  20503. readonly hasConstantOutline: boolean;
  20504. /**
  20505. * Gets the {@link Color} property for the geometry outline.
  20506. */
  20507. readonly outlineColorProperty: Property;
  20508. /**
  20509. * Gets the constant with of the geometry outline, in pixels.
  20510. * This value is only valid if isDynamic is false.
  20511. */
  20512. readonly outlineWidth: number;
  20513. /**
  20514. * Gets the property specifying whether the geometry
  20515. * casts or receives shadows from light sources.
  20516. */
  20517. readonly shadowsProperty: Property;
  20518. /**
  20519. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  20520. */
  20521. readonly distanceDisplayConditionProperty: Property;
  20522. /**
  20523. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  20524. */
  20525. readonly classificationTypeProperty: Property;
  20526. /**
  20527. * Gets a value indicating if the geometry is time-varying.
  20528. * If true, all visualization is delegated to a DynamicGeometryUpdater
  20529. * returned by GeometryUpdater#createDynamicUpdater.
  20530. */
  20531. readonly isDynamic: boolean;
  20532. /**
  20533. * Gets a value indicating if the geometry is closed.
  20534. * This property is only valid for static geometry.
  20535. */
  20536. readonly isClosed: boolean;
  20537. /**
  20538. * Gets an event that is raised whenever the public properties
  20539. * of this updater change.
  20540. */
  20541. readonly geometryChanged: boolean;
  20542. /**
  20543. * Checks if the geometry is outlined at the provided time.
  20544. * @param time - The time for which to retrieve visibility.
  20545. * @returns true if geometry is outlined at the provided time, false otherwise.
  20546. */
  20547. isOutlineVisible(time: JulianDate): boolean;
  20548. /**
  20549. * Checks if the geometry is filled at the provided time.
  20550. * @param time - The time for which to retrieve visibility.
  20551. * @returns true if geometry is filled at the provided time, false otherwise.
  20552. */
  20553. isFilled(time: JulianDate): boolean;
  20554. /**
  20555. * Creates the geometry instance which represents the fill of the geometry.
  20556. * @param time - The time to use when retrieving initial attribute values.
  20557. * @returns The geometry instance representing the filled portion of the geometry.
  20558. */
  20559. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  20560. /**
  20561. * Creates the geometry instance which represents the outline of the geometry.
  20562. * @param time - The time to use when retrieving initial attribute values.
  20563. * @returns The geometry instance representing the outline portion of the geometry.
  20564. */
  20565. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  20566. /**
  20567. * Returns true if this object was destroyed; otherwise, false.
  20568. * @returns True if this object was destroyed; otherwise, false.
  20569. */
  20570. isDestroyed(): boolean;
  20571. /**
  20572. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20573. */
  20574. destroy(): void;
  20575. }
  20576. /**
  20577. * A general purpose visualizer for geometry represented by {@link Primitive} instances.
  20578. * @param scene - The scene the primitives will be rendered in.
  20579. * @param entityCollection - The entityCollection to visualize.
  20580. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  20581. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  20582. */
  20583. export class GeometryVisualizer {
  20584. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  20585. /**
  20586. * Updates all of the primitives created by this visualizer to match their
  20587. * Entity counterpart at the given time.
  20588. * @param time - The time to update to.
  20589. * @returns True if the visualizer successfully updated to the provided time,
  20590. * false if the visualizer is waiting for asynchronous primitives to be created.
  20591. */
  20592. update(time: JulianDate): boolean;
  20593. /**
  20594. * Returns true if this object was destroyed; otherwise, false.
  20595. * @returns True if this object was destroyed; otherwise, false.
  20596. */
  20597. isDestroyed(): boolean;
  20598. /**
  20599. * Removes and destroys all primitives created by this instance.
  20600. */
  20601. destroy(): void;
  20602. }
  20603. /**
  20604. * A {@link MaterialProperty} that maps to grid {@link Material} uniforms.
  20605. * @param [options] - Object with the following properties:
  20606. * @param [options.color = Color.WHITE] - A Property specifying the grid {@link Color}.
  20607. * @param [options.cellAlpha = 0.1] - A numeric Property specifying cell alpha values.
  20608. * @param [options.lineCount = new Cartesian2(8, 8)] - A {@link Cartesian2} Property specifying the number of grid lines along each axis.
  20609. * @param [options.lineThickness = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  20610. * @param [options.lineOffset = new Cartesian2(0.0, 0.0)] - A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.
  20611. */
  20612. export class GridMaterialProperty {
  20613. constructor(options?: {
  20614. color?: Property | Color;
  20615. cellAlpha?: Property | number;
  20616. lineCount?: Property | Cartesian2;
  20617. lineThickness?: Property | Cartesian2;
  20618. lineOffset?: Property | Cartesian2;
  20619. });
  20620. /**
  20621. * Gets a value indicating if this property is constant. A property is considered
  20622. * constant if getValue always returns the same result for the current definition.
  20623. */
  20624. readonly isConstant: boolean;
  20625. /**
  20626. * Gets the event that is raised whenever the definition of this property changes.
  20627. * The definition is considered to have changed if a call to getValue would return
  20628. * a different result for the same time.
  20629. */
  20630. readonly definitionChanged: Event;
  20631. /**
  20632. * Gets or sets the Property specifying the grid {@link Color}.
  20633. */
  20634. color: Property | undefined;
  20635. /**
  20636. * Gets or sets the numeric Property specifying cell alpha values.
  20637. */
  20638. cellAlpha: Property | undefined;
  20639. /**
  20640. * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis.
  20641. */
  20642. lineCount: Property | undefined;
  20643. /**
  20644. * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  20645. */
  20646. lineThickness: Property | undefined;
  20647. /**
  20648. * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis.
  20649. */
  20650. lineOffset: Property | undefined;
  20651. /**
  20652. * Gets the {@link Material} type at the provided time.
  20653. * @param time - The time for which to retrieve the type.
  20654. * @returns The type of material.
  20655. */
  20656. getType(time: JulianDate): string;
  20657. /**
  20658. * Gets the value of the property at the provided time.
  20659. * @param time - The time for which to retrieve the value.
  20660. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  20661. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  20662. */
  20663. getValue(time: JulianDate, result?: any): any;
  20664. /**
  20665. * Compares this property to the provided property and returns
  20666. * <code>true</code> if they are equal, <code>false</code> otherwise.
  20667. * @param [other] - The other property.
  20668. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  20669. */
  20670. equals(other?: Property): boolean;
  20671. }
  20672. /**
  20673. * An abstract class for updating ground geometry entities.
  20674. * @param options - An object with the following properties:
  20675. * @param options.entity - The entity containing the geometry to be visualized.
  20676. * @param options.scene - The scene where visualization is taking place.
  20677. * @param options.geometryOptions - Options for the geometry
  20678. * @param options.geometryPropertyName - The geometry property name
  20679. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20680. */
  20681. export class GroundGeometryUpdater {
  20682. constructor(options: {
  20683. entity: Entity;
  20684. scene: Scene;
  20685. geometryOptions: any;
  20686. geometryPropertyName: string;
  20687. observedPropertyNames: string[];
  20688. });
  20689. /**
  20690. * Gets the zindex
  20691. */
  20692. readonly zIndex: number;
  20693. /**
  20694. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20695. */
  20696. destroy(): void;
  20697. }
  20698. /**
  20699. * A {@link MaterialProperty} that maps to image {@link Material} uniforms.
  20700. * @param [options] - Object with the following properties:
  20701. * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video.
  20702. * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  20703. * @param [options.color = Color.WHITE] - The color applied to the image
  20704. * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections)
  20705. */
  20706. export class ImageMaterialProperty {
  20707. constructor(options?: {
  20708. image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  20709. repeat?: Property | Cartesian2;
  20710. color?: Property | Color;
  20711. transparent?: Property | boolean;
  20712. });
  20713. /**
  20714. * Gets a value indicating if this property is constant. A property is considered
  20715. * constant if getValue always returns the same result for the current definition.
  20716. */
  20717. readonly isConstant: boolean;
  20718. /**
  20719. * Gets the event that is raised whenever the definition of this property changes.
  20720. * The definition is considered to have changed if a call to getValue would return
  20721. * a different result for the same time.
  20722. */
  20723. readonly definitionChanged: Event;
  20724. /**
  20725. * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.
  20726. */
  20727. image: Property | undefined;
  20728. /**
  20729. * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  20730. */
  20731. repeat: Property | undefined;
  20732. /**
  20733. * Gets or sets the Color Property specifying the desired color applied to the image.
  20734. */
  20735. color: Property | undefined;
  20736. /**
  20737. * Gets or sets the Boolean Property specifying whether the image has transparency
  20738. */
  20739. transparent: Property | undefined;
  20740. /**
  20741. * Gets the {@link Material} type at the provided time.
  20742. * @param time - The time for which to retrieve the type.
  20743. * @returns The type of material.
  20744. */
  20745. getType(time: JulianDate): string;
  20746. /**
  20747. * Gets the value of the property at the provided time.
  20748. * @param time - The time for which to retrieve the value.
  20749. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  20750. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  20751. */
  20752. getValue(time: JulianDate, result?: any): any;
  20753. /**
  20754. * Compares this property to the provided property and returns
  20755. * <code>true</code> if they are equal, <code>false</code> otherwise.
  20756. * @param [other] - The other property.
  20757. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  20758. */
  20759. equals(other?: Property): boolean;
  20760. }
  20761. /**
  20762. * Representation of <Camera> from KML
  20763. * @param position - camera position
  20764. * @param headingPitchRoll - camera orientation
  20765. */
  20766. export class KmlCamera {
  20767. constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll);
  20768. }
  20769. export namespace KmlDataSource {
  20770. /**
  20771. * Initialization options for the `load` method.
  20772. * @property camera - The camera that is used for viewRefreshModes and sending camera properties to network links.
  20773. * @property canvas - The canvas that is used for sending viewer properties to network links.
  20774. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  20775. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  20776. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20777. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20778. */
  20779. type LoadOptions = {
  20780. camera: Camera;
  20781. canvas: HTMLCanvasElement;
  20782. sourceUri?: string;
  20783. clampToGround?: boolean;
  20784. ellipsoid?: Ellipsoid;
  20785. credit?: Credit | string;
  20786. };
  20787. }
  20788. /**
  20789. * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
  20790. * <p>
  20791. * KML support in Cesium is incomplete, but a large amount of the standard,
  20792. * as well as Google's <code>gx</code> extension namespace, is supported. See Github issue
  20793. * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
  20794. * detailed list of what is and isn't support. Cesium will also write information to the
  20795. * console when it encounters most unsupported features.
  20796. * </p>
  20797. * <p>
  20798. * Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
  20799. * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
  20800. * under the <code>kml</code> property.
  20801. * </p>
  20802. * @example
  20803. * var viewer = new Cesium.Viewer('cesiumContainer');
  20804. * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',
  20805. * {
  20806. * camera: viewer.scene.camera,
  20807. * canvas: viewer.scene.canvas
  20808. * })
  20809. * );
  20810. * @param options - An object with the following properties:
  20811. * @param options.camera - The camera that is used for viewRefreshModes and sending camera properties to network links.
  20812. * @param options.canvas - The canvas that is used for sending viewer properties to network links.
  20813. * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20814. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  20815. */
  20816. export class KmlDataSource {
  20817. constructor(options: {
  20818. camera: Camera;
  20819. canvas: HTMLCanvasElement;
  20820. ellipsoid?: Ellipsoid;
  20821. credit?: Credit | string;
  20822. });
  20823. /**
  20824. * Creates a Promise to a new instance loaded with the provided KML data.
  20825. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  20826. * @param [options] - An object specifying configuration options
  20827. * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded.
  20828. */
  20829. static load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise<KmlDataSource>;
  20830. /**
  20831. * Gets or sets a human-readable name for this instance.
  20832. * This will be automatically be set to the KML document name on load.
  20833. */
  20834. name: string;
  20835. /**
  20836. * Gets the clock settings defined by the loaded KML. This represents the total
  20837. * availability interval for all time-dynamic data. If the KML does not contain
  20838. * time-dynamic data, this value is undefined.
  20839. */
  20840. clock: DataSourceClock;
  20841. /**
  20842. * Gets the collection of {@link Entity} instances.
  20843. */
  20844. entities: EntityCollection;
  20845. /**
  20846. * Gets a value indicating if the data source is currently loading data.
  20847. */
  20848. isLoading: boolean;
  20849. /**
  20850. * Gets an event that will be raised when the underlying data changes.
  20851. */
  20852. changedEvent: Event;
  20853. /**
  20854. * Gets an event that will be raised if an error is encountered during processing.
  20855. */
  20856. errorEvent: Event;
  20857. /**
  20858. * Gets an event that will be raised when the data source either starts or stops loading.
  20859. */
  20860. loadingEvent: Event;
  20861. /**
  20862. * Gets an event that will be raised when the data source refreshes a network link.
  20863. */
  20864. refreshEvent: Event;
  20865. /**
  20866. * Gets an event that will be raised when the data source finds an unsupported node type.
  20867. */
  20868. unsupportedNodeEvent: Event;
  20869. /**
  20870. * Gets whether or not this data source should be displayed.
  20871. */
  20872. show: boolean;
  20873. /**
  20874. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20875. */
  20876. clustering: EntityCluster;
  20877. /**
  20878. * Gets the credit that will be displayed for the data source
  20879. */
  20880. credit: Credit;
  20881. /**
  20882. * Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.
  20883. */
  20884. kmlTours: KmlTour[];
  20885. /**
  20886. * Asynchronously loads the provided KML data, replacing any existing data.
  20887. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  20888. * @param [options] - An object with the following properties:
  20889. * @param [options.sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  20890. * @param [options.clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground. If true, lines will use corridors so use Entity.corridor instead of Entity.polyline.
  20891. * @param [options.ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  20892. * @returns A promise that will resolve to this instances once the KML is loaded.
  20893. */
  20894. load(data: Resource | string | Document | Blob, options?: {
  20895. sourceUri?: Resource | string;
  20896. clampToGround?: boolean;
  20897. ellipsoid?: Ellipsoid;
  20898. }): Promise<KmlDataSource>;
  20899. /**
  20900. * Updates any NetworkLink that require updating.
  20901. * @param time - The simulation time.
  20902. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20903. */
  20904. update(time: JulianDate): boolean;
  20905. }
  20906. /**
  20907. * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.
  20908. */
  20909. export class KmlFeatureData {
  20910. constructor();
  20911. /**
  20912. * Gets the atom syndication format author field.
  20913. */
  20914. author: KmlFeatureData.Author;
  20915. /**
  20916. * Gets the link.
  20917. */
  20918. link: KmlFeatureData.Link;
  20919. /**
  20920. * Gets the unstructured address field.
  20921. */
  20922. address: string;
  20923. /**
  20924. * Gets the phone number.
  20925. */
  20926. phoneNumber: string;
  20927. /**
  20928. * Gets the snippet.
  20929. */
  20930. snippet: string;
  20931. /**
  20932. * Gets the extended data, parsed into a JSON object.
  20933. * Currently only the <code>Data</code> property is supported.
  20934. * <code>SchemaData</code> and custom data are ignored.
  20935. */
  20936. extendedData: string;
  20937. }
  20938. export namespace KmlFeatureData {
  20939. /**
  20940. * @property name - Gets the name.
  20941. * @property uri - Gets the URI.
  20942. * @property age - Gets the email.
  20943. */
  20944. type Author = {
  20945. name: string;
  20946. uri: string;
  20947. age: number;
  20948. };
  20949. /**
  20950. * @property href - Gets the href.
  20951. * @property hreflang - Gets the language of the linked resource.
  20952. * @property rel - Gets the link relation.
  20953. * @property type - Gets the link type.
  20954. * @property title - Gets the link title.
  20955. * @property length - Gets the link length.
  20956. */
  20957. type Link = {
  20958. href: string;
  20959. hreflang: string;
  20960. rel: string;
  20961. type: string;
  20962. title: string;
  20963. length: string;
  20964. };
  20965. }
  20966. /**
  20967. * @param position - camera position
  20968. * @param headingPitchRange - camera orientation
  20969. */
  20970. export class KmlLookAt {
  20971. constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange);
  20972. }
  20973. /**
  20974. * Describes a KmlTour, which uses KmlTourFlyTo, and KmlTourWait to
  20975. * guide the camera to a specified destinations on given time intervals.
  20976. * @param name - name parsed from KML
  20977. * @param id - id parsed from KML
  20978. * @param playlist - array with KmlTourFlyTos and KmlTourWaits
  20979. */
  20980. export class KmlTour {
  20981. constructor(name: string, id: string, playlist: any[]);
  20982. /**
  20983. * Id of kml gx:Tour entry
  20984. */
  20985. id: string;
  20986. /**
  20987. * Tour name
  20988. */
  20989. name: string;
  20990. /**
  20991. * Index of current entry from playlist
  20992. */
  20993. playlistIndex: number;
  20994. /**
  20995. * Array of playlist entries
  20996. */
  20997. playlist: any[];
  20998. /**
  20999. * Event will be called when tour starts to play,
  21000. * before any playlist entry starts to play.
  21001. */
  21002. tourStart: Event;
  21003. /**
  21004. * Event will be called when all playlist entries are
  21005. * played, or tour playback being canceled.
  21006. *
  21007. * If tour playback was terminated, event callback will
  21008. * be called with terminated=true parameter.
  21009. */
  21010. tourEnd: Event;
  21011. /**
  21012. * Event will be called when entry from playlist starts to play.
  21013. *
  21014. * Event callback will be called with curent entry as first parameter.
  21015. */
  21016. entryStart: Event;
  21017. /**
  21018. * Event will be called when entry from playlist ends to play.
  21019. *
  21020. * Event callback will be called with following parameters:
  21021. * 1. entry - entry
  21022. * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}
  21023. */
  21024. entryEnd: Event;
  21025. /**
  21026. * Add entry to this tour playlist.
  21027. * @param entry - an entry to add to the playlist.
  21028. */
  21029. addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void;
  21030. /**
  21031. * Play this tour.
  21032. * @param viewer - viewer widget.
  21033. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo}
  21034. * options for FlyTo playlist entries.
  21035. */
  21036. play(viewer: Viewer, cameraOptions?: any): void;
  21037. /**
  21038. * Stop curently playing tour.
  21039. */
  21040. stop(): void;
  21041. }
  21042. /**
  21043. * Transitions the KmlTour to the next destination. This transition is facilitated
  21044. * using a specified flyToMode over a given number of seconds.
  21045. * @param duration - entry duration
  21046. * @param flyToMode - KML fly to mode: bounce, smooth, etc
  21047. * @param view - KmlCamera or KmlLookAt
  21048. */
  21049. export class KmlTourFlyTo {
  21050. constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt);
  21051. /**
  21052. * Play this playlist entry
  21053. * @param done - function which will be called when playback ends
  21054. * @param camera - Cesium camera
  21055. * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo}
  21056. */
  21057. play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void;
  21058. /**
  21059. * Stop execution of curent entry. Cancel camera flyTo
  21060. */
  21061. stop(): void;
  21062. /**
  21063. * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}
  21064. * depends on this.view type.
  21065. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo}
  21066. * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options
  21067. */
  21068. getCameraOptions(cameraOptions: any): any;
  21069. }
  21070. export namespace KmlTourFlyTo {
  21071. /**
  21072. * A function that will be executed when the flight completes.
  21073. * @param terminated - true if {@link KmlTourFlyTo#stop} was
  21074. * called before entry done playback.
  21075. */
  21076. type DoneCallback = (terminated: boolean) => void;
  21077. }
  21078. /**
  21079. * Pauses the KmlTour for a given number of seconds.
  21080. * @param duration - entry duration
  21081. */
  21082. export class KmlTourWait {
  21083. constructor(duration: number);
  21084. /**
  21085. * Play this playlist entry
  21086. * @param done - function which will be called when playback ends
  21087. */
  21088. play(done: KmlTourWait.DoneCallback): void;
  21089. /**
  21090. * Stop execution of curent entry, cancel curent timeout
  21091. */
  21092. stop(): void;
  21093. }
  21094. export namespace KmlTourWait {
  21095. /**
  21096. * A function which will be called when playback ends.
  21097. * @param terminated - true if {@link KmlTourWait#stop} was
  21098. * called before entry done playback.
  21099. */
  21100. type DoneCallback = (terminated: boolean) => void;
  21101. }
  21102. export namespace LabelGraphics {
  21103. /**
  21104. * Initialization options for the LabelGraphics constructor
  21105. * @property [show = true] - A boolean Property specifying the visibility of the label.
  21106. * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported.
  21107. * @property [font = '30px sans-serif'] - A Property specifying the CSS font.
  21108. * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}.
  21109. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text.
  21110. * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label.
  21111. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}.
  21112. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.
  21113. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  21114. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  21115. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  21116. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  21117. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21118. * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}.
  21119. * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}.
  21120. * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width.
  21121. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  21122. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  21123. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera.
  21124. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed.
  21125. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  21126. */
  21127. type ConstructorOptions = {
  21128. show?: Property | boolean;
  21129. text?: Property | string;
  21130. font?: Property | string;
  21131. style?: Property | LabelStyle;
  21132. scale?: Property | number;
  21133. showBackground?: Property | boolean;
  21134. backgroundColor?: Property | Color;
  21135. backgroundPadding?: Property | Cartesian2;
  21136. pixelOffset?: Property | Cartesian2;
  21137. eyeOffset?: Property | Cartesian3;
  21138. horizontalOrigin?: Property | HorizontalOrigin;
  21139. verticalOrigin?: Property | VerticalOrigin;
  21140. heightReference?: Property | HeightReference;
  21141. fillColor?: Property | Color;
  21142. outlineColor?: Property | Color;
  21143. outlineWidth?: Property | number;
  21144. translucencyByDistance?: Property | NearFarScalar;
  21145. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  21146. scaleByDistance?: Property | NearFarScalar;
  21147. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21148. disableDepthTestDistance?: Property | number;
  21149. };
  21150. }
  21151. /**
  21152. * Describes a two dimensional label located at the position of the containing {@link Entity}.
  21153. * <p>
  21154. * <div align='center'>
  21155. * <img src='Images/Label.png' width='400' height='300' /><br />
  21156. * Example labels
  21157. * </div>
  21158. * </p>
  21159. * @param [options] - Object describing initialization options
  21160. */
  21161. export class LabelGraphics {
  21162. constructor(options?: LabelGraphics.ConstructorOptions);
  21163. /**
  21164. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21165. */
  21166. readonly definitionChanged: Event;
  21167. /**
  21168. * Gets or sets the boolean Property specifying the visibility of the label.
  21169. */
  21170. show: Property | undefined;
  21171. /**
  21172. * Gets or sets the string Property specifying the text of the label.
  21173. * Explicit newlines '\n' are supported.
  21174. */
  21175. text: Property | undefined;
  21176. /**
  21177. * Gets or sets the string Property specifying the font in CSS syntax.
  21178. */
  21179. font: Property | undefined;
  21180. /**
  21181. * Gets or sets the Property specifying the {@link LabelStyle}.
  21182. */
  21183. style: Property | undefined;
  21184. /**
  21185. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  21186. * A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.
  21187. * <p>
  21188. * <div align='center'>
  21189. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  21190. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  21191. * and <code>2.0</code>.
  21192. * </div>
  21193. * </p>
  21194. */
  21195. scale: Property | undefined;
  21196. /**
  21197. * Gets or sets the boolean Property specifying the visibility of the background behind the label.
  21198. */
  21199. showBackground: Property | undefined;
  21200. /**
  21201. * Gets or sets the Property specifying the background {@link Color}.
  21202. */
  21203. backgroundColor: Property | undefined;
  21204. /**
  21205. * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical
  21206. * background padding in pixels.
  21207. */
  21208. backgroundPadding: Property | undefined;
  21209. /**
  21210. * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space
  21211. * from the origin of this label. This is commonly used to align multiple labels and labels at
  21212. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  21213. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  21214. * <p>
  21215. * <div align='center'>
  21216. * <table border='0' cellpadding='5'><tr>
  21217. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  21218. * <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td>
  21219. * </tr></table>
  21220. * The label's origin is indicated by the yellow point.
  21221. * </div>
  21222. * </p>
  21223. */
  21224. pixelOffset: Property | undefined;
  21225. /**
  21226. * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.
  21227. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  21228. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  21229. * <p>
  21230. * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to
  21231. * arrange a label above its corresponding 3D model.
  21232. * </p>
  21233. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  21234. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  21235. * <p>
  21236. * <div align='center'>
  21237. * <table border='0' cellpadding='5'><tr>
  21238. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  21239. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  21240. * </tr></table>
  21241. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  21242. * </div>
  21243. * </p>
  21244. */
  21245. eyeOffset: Property | undefined;
  21246. /**
  21247. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  21248. */
  21249. horizontalOrigin: Property | undefined;
  21250. /**
  21251. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  21252. */
  21253. verticalOrigin: Property | undefined;
  21254. /**
  21255. * Gets or sets the Property specifying the {@link HeightReference}.
  21256. */
  21257. heightReference: Property | undefined;
  21258. /**
  21259. * Gets or sets the Property specifying the fill {@link Color}.
  21260. */
  21261. fillColor: Property | undefined;
  21262. /**
  21263. * Gets or sets the Property specifying the outline {@link Color}.
  21264. */
  21265. outlineColor: Property | undefined;
  21266. /**
  21267. * Gets or sets the numeric Property specifying the outline width.
  21268. */
  21269. outlineWidth: Property | undefined;
  21270. /**
  21271. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.
  21272. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21273. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21274. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21275. * Outside of these ranges the label's translucency remains clamped to the nearest bound.
  21276. */
  21277. translucencyByDistance: Property | undefined;
  21278. /**
  21279. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.
  21280. * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  21281. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21282. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21283. * Outside of these ranges the label's pixel offset remains clamped to the nearest bound.
  21284. */
  21285. pixelOffsetScaleByDistance: Property | undefined;
  21286. /**
  21287. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  21288. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  21289. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21290. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21291. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  21292. * scaleByDistance will be disabled.
  21293. */
  21294. scaleByDistance: Property | undefined;
  21295. /**
  21296. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.
  21297. */
  21298. distanceDisplayCondition: Property | undefined;
  21299. /**
  21300. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21301. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21302. */
  21303. disableDepthTestDistance: Property | undefined;
  21304. /**
  21305. * Duplicates this instance.
  21306. * @param [result] - The object onto which to store the result.
  21307. * @returns The modified result parameter or a new instance if one was not provided.
  21308. */
  21309. clone(result?: LabelGraphics): LabelGraphics;
  21310. /**
  21311. * Assigns each unassigned property on this object to the value
  21312. * of the same property on the provided source object.
  21313. * @param source - The object to be merged into this object.
  21314. */
  21315. merge(source: LabelGraphics): void;
  21316. }
  21317. /**
  21318. * A {@link Visualizer} which maps the {@link LabelGraphics} instance
  21319. * in {@link Entity#label} to a {@link Label}.
  21320. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21321. * @param entityCollection - The entityCollection to visualize.
  21322. */
  21323. export class LabelVisualizer {
  21324. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21325. /**
  21326. * Updates the primitives created by this visualizer to match their
  21327. * Entity counterpart at the given time.
  21328. * @param time - The time to update to.
  21329. * @returns This function always returns true.
  21330. */
  21331. update(time: JulianDate): boolean;
  21332. /**
  21333. * Returns true if this object was destroyed; otherwise, false.
  21334. * @returns True if this object was destroyed; otherwise, false.
  21335. */
  21336. isDestroyed(): boolean;
  21337. /**
  21338. * Removes and destroys all primitives created by this instance.
  21339. */
  21340. destroy(): void;
  21341. }
  21342. /**
  21343. * The interface for all {@link Property} objects that represent {@link Material} uniforms.
  21344. * This type defines an interface and cannot be instantiated directly.
  21345. */
  21346. export class MaterialProperty {
  21347. constructor();
  21348. /**
  21349. * Gets a value indicating if this property is constant. A property is considered
  21350. * constant if getValue always returns the same result for the current definition.
  21351. */
  21352. readonly isConstant: boolean;
  21353. /**
  21354. * Gets the event that is raised whenever the definition of this property changes.
  21355. * The definition is considered to have changed if a call to getValue would return
  21356. * a different result for the same time.
  21357. */
  21358. readonly definitionChanged: Event;
  21359. /**
  21360. * Gets the {@link Material} type at the provided time.
  21361. * @param time - The time for which to retrieve the type.
  21362. * @returns The type of material.
  21363. */
  21364. getType(time: JulianDate): string;
  21365. /**
  21366. * Gets the value of the property at the provided time.
  21367. * @param time - The time for which to retrieve the value.
  21368. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21369. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21370. */
  21371. getValue(time: JulianDate, result?: any): any;
  21372. /**
  21373. * Compares this property to the provided property and returns
  21374. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21375. * @param [other] - The other property.
  21376. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21377. */
  21378. equals(other?: Property): boolean;
  21379. }
  21380. export namespace ModelGraphics {
  21381. /**
  21382. * Initialization options for the ModelGraphics constructor
  21383. * @property [show = true] - A boolean Property specifying the visibility of the model.
  21384. * @property [uri] - A string or Resource Property specifying the URI of the glTF asset.
  21385. * @property [scale = 1.0] - A numeric Property specifying a uniform linear scale.
  21386. * @property [minimumPixelSize = 0.0] - A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.
  21387. * @property [maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  21388. * @property [incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  21389. * @property [runAnimations = true] - A boolean Property specifying if glTF animations specified in the model should be started.
  21390. * @property [clampAnimations = true] - A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21391. * @property [shadows = ShadowMode.ENABLED] - An enum Property specifying whether the model casts or receives shadows from light sources.
  21392. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21393. * @property [silhouetteColor = Color.RED] - A Property specifying the {@link Color} of the silhouette.
  21394. * @property [silhouetteSize = 0.0] - A numeric Property specifying the size of the silhouette in pixels.
  21395. * @property [color = Color.WHITE] - A Property specifying the {@link Color} that blends with the model's rendered color.
  21396. * @property [colorBlendMode = ColorBlendMode.HIGHLIGHT] - An enum Property specifying how the color blends with the model.
  21397. * @property [colorBlendAmount = 0.5] - A numeric Property specifying the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
  21398. * @property [imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - A property specifying the contribution from diffuse and specular image-based lighting.
  21399. * @property [lightColor] - A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21400. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this model will be displayed.
  21401. * @property [nodeTransformations] - An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node. The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
  21402. * @property [articulations] - An object, where keys are composed of an articulation name, a single space, and a stage name, and the values are numeric properties.
  21403. * @property [clippingPlanes] - A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21404. */
  21405. type ConstructorOptions = {
  21406. show?: Property | boolean;
  21407. uri?: Property | string | Resource;
  21408. scale?: Property | number;
  21409. minimumPixelSize?: Property | number;
  21410. maximumScale?: Property | number;
  21411. incrementallyLoadTextures?: Property | boolean;
  21412. runAnimations?: Property | boolean;
  21413. clampAnimations?: Property | boolean;
  21414. shadows?: Property | ShadowMode;
  21415. heightReference?: Property | HeightReference;
  21416. silhouetteColor?: Property | Color;
  21417. silhouetteSize?: Property | number;
  21418. color?: Property | Color;
  21419. colorBlendMode?: Property | ColorBlendMode;
  21420. colorBlendAmount?: Property | number;
  21421. imageBasedLightingFactor?: Property | Cartesian2;
  21422. lightColor?: Property | Color;
  21423. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21424. nodeTransformations?: PropertyBag | {
  21425. [key: string]: TranslationRotationScale;
  21426. };
  21427. articulations?: PropertyBag | {
  21428. [key: string]: number;
  21429. };
  21430. clippingPlanes?: Property | ClippingPlaneCollection;
  21431. };
  21432. }
  21433. /**
  21434. * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  21435. * The position and orientation of the model is determined by the containing {@link Entity}.
  21436. * <p>
  21437. * Cesium includes support for glTF geometry, materials, animations, and skinning.
  21438. * Cameras and lights are not currently supported.
  21439. * </p>
  21440. * @param [options] - Object describing initialization options
  21441. */
  21442. export class ModelGraphics {
  21443. constructor(options?: ModelGraphics.ConstructorOptions);
  21444. /**
  21445. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21446. */
  21447. readonly definitionChanged: Event;
  21448. /**
  21449. * Gets or sets the boolean Property specifying the visibility of the model.
  21450. */
  21451. show: Property | undefined;
  21452. /**
  21453. * Gets or sets the string Property specifying the URI of the glTF asset.
  21454. */
  21455. uri: Property | undefined;
  21456. /**
  21457. * Gets or sets the numeric Property specifying a uniform linear scale
  21458. * for this model. Values greater than 1.0 increase the size of the model while
  21459. * values less than 1.0 decrease it.
  21460. */
  21461. scale: Property | undefined;
  21462. /**
  21463. * Gets or sets the numeric Property specifying the approximate minimum
  21464. * pixel size of the model regardless of zoom. This can be used to ensure that
  21465. * a model is visible even when the viewer zooms out. When <code>0.0</code>,
  21466. * no minimum size is enforced.
  21467. */
  21468. minimumPixelSize: Property | undefined;
  21469. /**
  21470. * Gets or sets the numeric Property specifying the maximum scale
  21471. * size of a model. This property is used as an upper limit for
  21472. * {@link ModelGraphics#minimumPixelSize}.
  21473. */
  21474. maximumScale: Property | undefined;
  21475. /**
  21476. * Get or sets the boolean Property specifying whether textures
  21477. * may continue to stream in after the model is loaded.
  21478. */
  21479. incrementallyLoadTextures: Property | undefined;
  21480. /**
  21481. * Gets or sets the boolean Property specifying if glTF animations should be run.
  21482. */
  21483. runAnimations: Property | undefined;
  21484. /**
  21485. * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21486. */
  21487. clampAnimations: Property | undefined;
  21488. /**
  21489. * Get or sets the enum Property specifying whether the model
  21490. * casts or receives shadows from light sources.
  21491. */
  21492. shadows: Property | undefined;
  21493. /**
  21494. * Gets or sets the Property specifying the {@link HeightReference}.
  21495. */
  21496. heightReference: Property | undefined;
  21497. /**
  21498. * Gets or sets the Property specifying the {@link Color} of the silhouette.
  21499. */
  21500. silhouetteColor: Property | undefined;
  21501. /**
  21502. * Gets or sets the numeric Property specifying the size of the silhouette in pixels.
  21503. */
  21504. silhouetteSize: Property | undefined;
  21505. /**
  21506. * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.
  21507. */
  21508. color: Property | undefined;
  21509. /**
  21510. * Gets or sets the enum Property specifying how the color blends with the model.
  21511. */
  21512. colorBlendMode: Property | undefined;
  21513. /**
  21514. * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.
  21515. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  21516. * any value in-between resulting in a mix of the two.
  21517. */
  21518. colorBlendAmount: Property | undefined;
  21519. /**
  21520. * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color.
  21521. */
  21522. imageBasedLightingFactor: Property | undefined;
  21523. /**
  21524. * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21525. */
  21526. lightColor: Property | undefined;
  21527. /**
  21528. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.
  21529. */
  21530. distanceDisplayCondition: Property | undefined;
  21531. /**
  21532. * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  21533. * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
  21534. * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
  21535. */
  21536. nodeTransformations: PropertyBag;
  21537. /**
  21538. * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  21539. * composed as the name of the articulation, a single space, and the name of the stage.
  21540. */
  21541. articulations: PropertyBag;
  21542. /**
  21543. * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21544. */
  21545. clippingPlanes: Property | undefined;
  21546. /**
  21547. * Duplicates this instance.
  21548. * @param [result] - The object onto which to store the result.
  21549. * @returns The modified result parameter or a new instance if one was not provided.
  21550. */
  21551. clone(result?: ModelGraphics): ModelGraphics;
  21552. /**
  21553. * Assigns each unassigned property on this object to the value
  21554. * of the same property on the provided source object.
  21555. * @param source - The object to be merged into this object.
  21556. */
  21557. merge(source: ModelGraphics): void;
  21558. }
  21559. /**
  21560. * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}.
  21561. * @param scene - The scene the primitives will be rendered in.
  21562. * @param entityCollection - The entityCollection to visualize.
  21563. */
  21564. export class ModelVisualizer {
  21565. constructor(scene: Scene, entityCollection: EntityCollection);
  21566. /**
  21567. * Updates models created this visualizer to match their
  21568. * Entity counterpart at the given time.
  21569. * @param time - The time to update to.
  21570. * @returns This function always returns true.
  21571. */
  21572. update(time: JulianDate): boolean;
  21573. /**
  21574. * Returns true if this object was destroyed; otherwise, false.
  21575. * @returns True if this object was destroyed; otherwise, false.
  21576. */
  21577. isDestroyed(): boolean;
  21578. /**
  21579. * Removes and destroys all primitives created by this instance.
  21580. */
  21581. destroy(): void;
  21582. }
  21583. /**
  21584. * A {@link Property} that produces {@link TranslationRotationScale} data.
  21585. * @param [options] - Object with the following properties:
  21586. * @param [options.translation = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  21587. * @param [options.rotation = Quaternion.IDENTITY] - A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  21588. * @param [options.scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.
  21589. */
  21590. export class NodeTransformationProperty {
  21591. constructor(options?: {
  21592. translation?: Property | Cartesian3;
  21593. rotation?: Property | Quaternion;
  21594. scale?: Property | Cartesian3;
  21595. });
  21596. /**
  21597. * Gets a value indicating if this property is constant. A property is considered
  21598. * constant if getValue always returns the same result for the current definition.
  21599. */
  21600. readonly isConstant: boolean;
  21601. /**
  21602. * Gets the event that is raised whenever the definition of this property changes.
  21603. * The definition is considered to have changed if a call to getValue would return
  21604. * a different result for the same time.
  21605. */
  21606. readonly definitionChanged: Event;
  21607. /**
  21608. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  21609. */
  21610. translation: Property | undefined;
  21611. /**
  21612. * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  21613. */
  21614. rotation: Property | undefined;
  21615. /**
  21616. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.
  21617. */
  21618. scale: Property | undefined;
  21619. /**
  21620. * Gets the value of the property at the provided time.
  21621. * @param time - The time for which to retrieve the value.
  21622. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21623. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21624. */
  21625. getValue(time: JulianDate, result?: TranslationRotationScale): TranslationRotationScale;
  21626. /**
  21627. * Compares this property to the provided property and returns
  21628. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21629. * @param [other] - The other property.
  21630. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21631. */
  21632. equals(other?: Property): boolean;
  21633. }
  21634. export namespace PathGraphics {
  21635. /**
  21636. * Initialization options for the PathGraphics constructor
  21637. * @property [show = true] - A boolean Property specifying the visibility of the path.
  21638. * @property [leadTime] - A Property specifying the number of seconds in front the object to show.
  21639. * @property [trailTime] - A Property specifying the number of seconds behind of the object to show.
  21640. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  21641. * @property [resolution = 60] - A numeric Property specifying the maximum number of seconds to step when sampling the position.
  21642. * @property [material = Color.WHITE] - A Property specifying the material used to draw the path.
  21643. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this path will be displayed.
  21644. */
  21645. type ConstructorOptions = {
  21646. show?: Property | boolean;
  21647. leadTime?: Property | number;
  21648. trailTime?: Property | number;
  21649. width?: Property | number;
  21650. resolution?: Property | number;
  21651. material?: MaterialProperty | Color;
  21652. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21653. };
  21654. }
  21655. /**
  21656. * Describes a polyline defined as the path made by an {@link Entity} as it moves over time.
  21657. * @param [options] - Object describing initialization options
  21658. */
  21659. export class PathGraphics {
  21660. constructor(options?: PathGraphics.ConstructorOptions);
  21661. /**
  21662. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21663. */
  21664. readonly definitionChanged: Event;
  21665. /**
  21666. * Gets or sets the boolean Property specifying the visibility of the path.
  21667. */
  21668. show: Property | undefined;
  21669. /**
  21670. * Gets or sets the Property specifying the number of seconds in front of the object to show.
  21671. */
  21672. leadTime: Property | undefined;
  21673. /**
  21674. * Gets or sets the Property specifying the number of seconds behind the object to show.
  21675. */
  21676. trailTime: Property | undefined;
  21677. /**
  21678. * Gets or sets the numeric Property specifying the width in pixels.
  21679. */
  21680. width: Property | undefined;
  21681. /**
  21682. * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
  21683. */
  21684. resolution: Property | undefined;
  21685. /**
  21686. * Gets or sets the Property specifying the material used to draw the path.
  21687. */
  21688. material: MaterialProperty;
  21689. /**
  21690. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.
  21691. */
  21692. distanceDisplayCondition: Property | undefined;
  21693. /**
  21694. * Duplicates this instance.
  21695. * @param [result] - The object onto which to store the result.
  21696. * @returns The modified result parameter or a new instance if one was not provided.
  21697. */
  21698. clone(result?: PathGraphics): PathGraphics;
  21699. /**
  21700. * Assigns each unassigned property on this object to the value
  21701. * of the same property on the provided source object.
  21702. * @param source - The object to be merged into this object.
  21703. */
  21704. merge(source: PathGraphics): void;
  21705. }
  21706. /**
  21707. * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}.
  21708. * @param scene - The scene the primitives will be rendered in.
  21709. * @param entityCollection - The entityCollection to visualize.
  21710. */
  21711. export class PathVisualizer {
  21712. constructor(scene: Scene, entityCollection: EntityCollection);
  21713. /**
  21714. * Updates all of the primitives created by this visualizer to match their
  21715. * Entity counterpart at the given time.
  21716. * @param time - The time to update to.
  21717. * @returns This function always returns true.
  21718. */
  21719. update(time: JulianDate): boolean;
  21720. /**
  21721. * Returns true if this object was destroyed; otherwise, false.
  21722. * @returns True if this object was destroyed; otherwise, false.
  21723. */
  21724. isDestroyed(): boolean;
  21725. /**
  21726. * Removes and destroys all primitives created by this instance.
  21727. */
  21728. destroy(): void;
  21729. }
  21730. /**
  21731. * A {@link GeometryUpdater} for planes.
  21732. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  21733. * @param entity - The entity containing the geometry to be visualized.
  21734. * @param scene - The scene where visualization is taking place.
  21735. */
  21736. export class PlaneGeometryUpdater {
  21737. constructor(entity: Entity, scene: Scene);
  21738. /**
  21739. * Creates the geometry instance which represents the fill of the geometry.
  21740. * @param time - The time to use when retrieving initial attribute values.
  21741. * @returns The geometry instance representing the filled portion of the geometry.
  21742. */
  21743. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  21744. /**
  21745. * Creates the geometry instance which represents the outline of the geometry.
  21746. * @param time - The time to use when retrieving initial attribute values.
  21747. * @returns The geometry instance representing the outline portion of the geometry.
  21748. */
  21749. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  21750. }
  21751. export namespace PlaneGraphics {
  21752. /**
  21753. * Initialization options for the PlaneGraphics constructor
  21754. * @property [show = true] - A boolean Property specifying the visibility of the plane.
  21755. * @property [plane] - A {@link Plane} Property specifying the normal and distance for the plane.
  21756. * @property [dimensions] - A {@link Cartesian2} Property specifying the width and height of the plane.
  21757. * @property [fill = true] - A boolean Property specifying whether the plane is filled with the provided material.
  21758. * @property [material = Color.WHITE] - A Property specifying the material used to fill the plane.
  21759. * @property [outline = false] - A boolean Property specifying whether the plane is outlined.
  21760. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21761. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  21762. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the plane casts or receives shadows from light sources.
  21763. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this plane will be displayed.
  21764. */
  21765. type ConstructorOptions = {
  21766. show?: Property | boolean;
  21767. plane?: Property | Plane;
  21768. dimensions?: Property | Cartesian2;
  21769. fill?: Property | boolean;
  21770. material?: MaterialProperty | Color;
  21771. outline?: Property | boolean;
  21772. outlineColor?: Property | Color;
  21773. outlineWidth?: Property | number;
  21774. shadows?: Property | ShadowMode;
  21775. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21776. };
  21777. }
  21778. /**
  21779. * Describes a plane. The center position and orientation are determined by the containing {@link Entity}.
  21780. * @param [options] - Object describing initialization options
  21781. */
  21782. export class PlaneGraphics {
  21783. constructor(options?: PlaneGraphics.ConstructorOptions);
  21784. /**
  21785. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21786. */
  21787. readonly definitionChanged: Event;
  21788. /**
  21789. * Gets or sets the boolean Property specifying the visibility of the plane.
  21790. */
  21791. show: Property | undefined;
  21792. /**
  21793. * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane.
  21794. */
  21795. plane: Property | undefined;
  21796. /**
  21797. * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane.
  21798. */
  21799. dimensions: Property | undefined;
  21800. /**
  21801. * Gets or sets the boolean Property specifying whether the plane is filled with the provided material.
  21802. */
  21803. fill: Property | undefined;
  21804. /**
  21805. * Gets or sets the material used to fill the plane.
  21806. */
  21807. material: MaterialProperty;
  21808. /**
  21809. * Gets or sets the Property specifying whether the plane is outlined.
  21810. */
  21811. outline: Property | undefined;
  21812. /**
  21813. * Gets or sets the Property specifying the {@link Color} of the outline.
  21814. */
  21815. outlineColor: Property | undefined;
  21816. /**
  21817. * Gets or sets the numeric Property specifying the width of the outline.
  21818. * <p>
  21819. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  21820. * </p>
  21821. */
  21822. outlineWidth: Property | undefined;
  21823. /**
  21824. * Get or sets the enum Property specifying whether the plane
  21825. * casts or receives shadows from light sources.
  21826. */
  21827. shadows: Property | undefined;
  21828. /**
  21829. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed.
  21830. */
  21831. distanceDisplayCondition: Property | undefined;
  21832. /**
  21833. * Duplicates this instance.
  21834. * @param [result] - The object onto which to store the result.
  21835. * @returns The modified result parameter or a new instance if one was not provided.
  21836. */
  21837. clone(result?: PlaneGraphics): PlaneGraphics;
  21838. /**
  21839. * Assigns each unassigned property on this object to the value
  21840. * of the same property on the provided source object.
  21841. * @param source - The object to be merged into this object.
  21842. */
  21843. merge(source: PlaneGraphics): void;
  21844. }
  21845. export namespace PointGraphics {
  21846. /**
  21847. * Initialization options for the PointGraphics constructor
  21848. * @property [show = true] - A boolean Property specifying the visibility of the point.
  21849. * @property [pixelSize = 1] - A numeric Property specifying the size in pixels.
  21850. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21851. * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point.
  21852. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  21853. * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels.
  21854. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance.
  21855. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  21856. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed.
  21857. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  21858. */
  21859. type ConstructorOptions = {
  21860. show?: Property | boolean;
  21861. pixelSize?: Property | number;
  21862. heightReference?: Property | HeightReference;
  21863. color?: Property | Color;
  21864. outlineColor?: Property | Color;
  21865. outlineWidth?: Property | number;
  21866. scaleByDistance?: Property | NearFarScalar;
  21867. translucencyByDistance?: Property | NearFarScalar;
  21868. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21869. disableDepthTestDistance?: Property | number;
  21870. };
  21871. }
  21872. /**
  21873. * Describes a graphical point located at the position of the containing {@link Entity}.
  21874. * @param [options] - Object describing initialization options
  21875. */
  21876. export class PointGraphics {
  21877. constructor(options?: PointGraphics.ConstructorOptions);
  21878. /**
  21879. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21880. */
  21881. readonly definitionChanged: Event;
  21882. /**
  21883. * Gets or sets the boolean Property specifying the visibility of the point.
  21884. */
  21885. show: Property | undefined;
  21886. /**
  21887. * Gets or sets the numeric Property specifying the size in pixels.
  21888. */
  21889. pixelSize: Property | undefined;
  21890. /**
  21891. * Gets or sets the Property specifying the {@link HeightReference}.
  21892. */
  21893. heightReference: Property | undefined;
  21894. /**
  21895. * Gets or sets the Property specifying the {@link Color} of the point.
  21896. */
  21897. color: Property | undefined;
  21898. /**
  21899. * Gets or sets the Property specifying the {@link Color} of the outline.
  21900. */
  21901. outlineColor: Property | undefined;
  21902. /**
  21903. * Gets or sets the numeric Property specifying the the outline width in pixels.
  21904. */
  21905. outlineWidth: Property | undefined;
  21906. /**
  21907. * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.
  21908. * If undefined, a constant size is used.
  21909. */
  21910. scaleByDistance: Property | undefined;
  21911. /**
  21912. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.
  21913. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21914. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21915. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21916. * Outside of these ranges the points's translucency remains clamped to the nearest bound.
  21917. */
  21918. translucencyByDistance: Property | undefined;
  21919. /**
  21920. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.
  21921. */
  21922. distanceDisplayCondition: Property | undefined;
  21923. /**
  21924. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21925. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21926. */
  21927. disableDepthTestDistance: Property | undefined;
  21928. /**
  21929. * Duplicates this instance.
  21930. * @param [result] - The object onto which to store the result.
  21931. * @returns The modified result parameter or a new instance if one was not provided.
  21932. */
  21933. clone(result?: PointGraphics): PointGraphics;
  21934. /**
  21935. * Assigns each unassigned property on this object to the value
  21936. * of the same property on the provided source object.
  21937. * @param source - The object to be merged into this object.
  21938. */
  21939. merge(source: PointGraphics): void;
  21940. }
  21941. /**
  21942. * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.
  21943. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21944. * @param entityCollection - The entityCollection to visualize.
  21945. */
  21946. export class PointVisualizer {
  21947. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21948. /**
  21949. * Updates the primitives created by this visualizer to match their
  21950. * Entity counterpart at the given time.
  21951. * @param time - The time to update to.
  21952. * @returns This function always returns true.
  21953. */
  21954. update(time: JulianDate): boolean;
  21955. /**
  21956. * Returns true if this object was destroyed; otherwise, false.
  21957. * @returns True if this object was destroyed; otherwise, false.
  21958. */
  21959. isDestroyed(): boolean;
  21960. /**
  21961. * Removes and destroys all primitives created by this instance.
  21962. */
  21963. destroy(): void;
  21964. }
  21965. /**
  21966. * A {@link GeometryUpdater} for polygons.
  21967. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  21968. * @param entity - The entity containing the geometry to be visualized.
  21969. * @param scene - The scene where visualization is taking place.
  21970. */
  21971. export class PolygonGeometryUpdater {
  21972. constructor(entity: Entity, scene: Scene);
  21973. /**
  21974. * Creates the geometry instance which represents the fill of the geometry.
  21975. * @param time - The time to use when retrieving initial attribute values.
  21976. * @returns The geometry instance representing the filled portion of the geometry.
  21977. */
  21978. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  21979. /**
  21980. * Creates the geometry instance which represents the outline of the geometry.
  21981. * @param time - The time to use when retrieving initial attribute values.
  21982. * @returns The geometry instance representing the outline portion of the geometry.
  21983. */
  21984. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  21985. }
  21986. export namespace PolygonGraphics {
  21987. /**
  21988. * Initialization options for the PolygonGraphics constructor
  21989. * @property [show = true] - A boolean Property specifying the visibility of the polygon.
  21990. * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}.
  21991. * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.
  21992. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21993. * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.
  21994. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  21995. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  21996. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  21997. * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material.
  21998. * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon.
  21999. * @property [outline = false] - A boolean Property specifying whether the polygon is outlined.
  22000. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22001. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22002. * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used.
  22003. * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open.
  22004. * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  22005. * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow.
  22006. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources.
  22007. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed.
  22008. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  22009. * @property [zIndex = 0] - A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.
  22010. */
  22011. type ConstructorOptions = {
  22012. show?: Property | boolean;
  22013. hierarchy?: Property | PolygonHierarchy;
  22014. height?: Property | number;
  22015. heightReference?: Property | HeightReference;
  22016. extrudedHeight?: Property | number;
  22017. extrudedHeightReference?: Property | HeightReference;
  22018. stRotation?: Property | number;
  22019. granularity?: Property | number;
  22020. fill?: Property | boolean;
  22021. material?: MaterialProperty | Color;
  22022. outline?: Property | boolean;
  22023. outlineColor?: Property | Color;
  22024. outlineWidth?: Property | number;
  22025. perPositionHeight?: Property | boolean;
  22026. closeTop?: boolean | boolean;
  22027. closeBottom?: boolean | boolean;
  22028. arcType?: Property | ArcType;
  22029. shadows?: Property | ShadowMode;
  22030. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22031. classificationType?: Property | ClassificationType;
  22032. zIndex?: ConstantProperty | number;
  22033. };
  22034. }
  22035. /**
  22036. * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.
  22037. * The polygon conforms to the curvature of the globe and can be placed on the surface or
  22038. * at altitude and can optionally be extruded into a volume.
  22039. * @param [options] - Object describing initialization options
  22040. */
  22041. export class PolygonGraphics {
  22042. constructor(options?: PolygonGraphics.ConstructorOptions);
  22043. /**
  22044. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22045. */
  22046. readonly definitionChanged: Event;
  22047. /**
  22048. * Gets or sets the boolean Property specifying the visibility of the polygon.
  22049. */
  22050. show: Property | undefined;
  22051. /**
  22052. * Gets or sets the Property specifying the {@link PolygonHierarchy}.
  22053. */
  22054. hierarchy: Property | undefined;
  22055. /**
  22056. * Gets or sets the numeric Property specifying the constant altitude of the polygon.
  22057. */
  22058. height: Property | undefined;
  22059. /**
  22060. * Gets or sets the Property specifying the {@link HeightReference}.
  22061. */
  22062. heightReference: Property | undefined;
  22063. /**
  22064. * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.
  22065. * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.
  22066. * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.
  22067. */
  22068. extrudedHeight: Property | undefined;
  22069. /**
  22070. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  22071. */
  22072. extrudedHeightReference: Property | undefined;
  22073. /**
  22074. * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north.
  22075. */
  22076. stRotation: Property | undefined;
  22077. /**
  22078. * Gets or sets the numeric Property specifying the angular distance between points on the polygon.
  22079. */
  22080. granularity: Property | undefined;
  22081. /**
  22082. * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.
  22083. */
  22084. fill: Property | undefined;
  22085. /**
  22086. * Gets or sets the Property specifying the material used to fill the polygon.
  22087. */
  22088. material: MaterialProperty;
  22089. /**
  22090. * Gets or sets the Property specifying whether the polygon is outlined.
  22091. */
  22092. outline: Property | undefined;
  22093. /**
  22094. * Gets or sets the Property specifying the {@link Color} of the outline.
  22095. */
  22096. outlineColor: Property | undefined;
  22097. /**
  22098. * Gets or sets the numeric Property specifying the width of the outline.
  22099. * <p>
  22100. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  22101. * </p>
  22102. */
  22103. outlineWidth: Property | undefined;
  22104. /**
  22105. * Gets or sets the boolean specifying whether or not the the height of each position is used.
  22106. * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.
  22107. * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.
  22108. */
  22109. perPositionHeight: Property | undefined;
  22110. /**
  22111. * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.
  22112. */
  22113. closeTop: Property | undefined;
  22114. /**
  22115. * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.
  22116. */
  22117. closeBottom: Property | undefined;
  22118. /**
  22119. * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.
  22120. */
  22121. arcType: Property | undefined;
  22122. /**
  22123. * Get or sets the enum Property specifying whether the polygon
  22124. * casts or receives shadows from light sources.
  22125. */
  22126. shadows: Property | undefined;
  22127. /**
  22128. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.
  22129. */
  22130. distanceDisplayCondition: Property | undefined;
  22131. /**
  22132. * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  22133. */
  22134. classificationType: Property | undefined;
  22135. /**
  22136. * Gets or sets the zIndex Prperty specifying the ordering of ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.
  22137. */
  22138. zIndex: ConstantProperty | undefined;
  22139. /**
  22140. * Duplicates this instance.
  22141. * @param [result] - The object onto which to store the result.
  22142. * @returns The modified result parameter or a new instance if one was not provided.
  22143. */
  22144. clone(result?: PolygonGraphics): PolygonGraphics;
  22145. /**
  22146. * Assigns each unassigned property on this object to the value
  22147. * of the same property on the provided source object.
  22148. * @param source - The object to be merged into this object.
  22149. */
  22150. merge(source: PolygonGraphics): void;
  22151. }
  22152. /**
  22153. * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.
  22154. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  22155. */
  22156. export class PolylineArrowMaterialProperty {
  22157. constructor(color?: Property | Color);
  22158. /**
  22159. * Gets a value indicating if this property is constant. A property is considered
  22160. * constant if getValue always returns the same result for the current definition.
  22161. */
  22162. readonly isConstant: boolean;
  22163. /**
  22164. * Gets the event that is raised whenever the definition of this property changes.
  22165. * The definition is considered to have changed if a call to getValue would return
  22166. * a different result for the same time.
  22167. */
  22168. readonly definitionChanged: Event;
  22169. /**
  22170. * Gets or sets the {@link Color} {@link Property}.
  22171. */
  22172. color: Property | undefined;
  22173. /**
  22174. * Gets the {@link Material} type at the provided time.
  22175. * @param time - The time for which to retrieve the type.
  22176. * @returns The type of material.
  22177. */
  22178. getType(time: JulianDate): string;
  22179. /**
  22180. * Gets the value of the property at the provided time.
  22181. * @param time - The time for which to retrieve the value.
  22182. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22183. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22184. */
  22185. getValue(time: JulianDate, result?: any): any;
  22186. /**
  22187. * Compares this property to the provided property and returns
  22188. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22189. * @param [other] - The other property.
  22190. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22191. */
  22192. equals(other?: Property): boolean;
  22193. }
  22194. /**
  22195. * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.
  22196. * @param [options] - Object with the following properties:
  22197. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22198. * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line.
  22199. * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels.
  22200. * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash
  22201. */
  22202. export class PolylineDashMaterialProperty {
  22203. constructor(options?: {
  22204. color?: Property | Color;
  22205. gapColor?: Property | Color;
  22206. dashLength?: Property | number;
  22207. dashPattern?: Property | number;
  22208. });
  22209. /**
  22210. * Gets a value indicating if this property is constant. A property is considered
  22211. * constant if getValue always returns the same result for the current definition.
  22212. */
  22213. readonly isConstant: boolean;
  22214. /**
  22215. * Gets the event that is raised whenever the definition of this property changes.
  22216. * The definition is considered to have changed if a call to getValue would return
  22217. * a different result for the same time.
  22218. */
  22219. readonly definitionChanged: Event;
  22220. /**
  22221. * Gets or sets the Property specifying the {@link Color} of the line.
  22222. */
  22223. color: Property | undefined;
  22224. /**
  22225. * Gets or sets the Property specifying the {@link Color} of the gaps in the line.
  22226. */
  22227. gapColor: Property | undefined;
  22228. /**
  22229. * Gets or sets the numeric Property specifying the length of a dash cycle
  22230. */
  22231. dashLength: Property | undefined;
  22232. /**
  22233. * Gets or sets the numeric Property specifying a dash pattern
  22234. */
  22235. dashPattern: Property | undefined;
  22236. /**
  22237. * Gets the {@link Material} type at the provided time.
  22238. * @param time - The time for which to retrieve the type.
  22239. * @returns The type of material.
  22240. */
  22241. getType(time: JulianDate): string;
  22242. /**
  22243. * Gets the value of the property at the provided time.
  22244. * @param time - The time for which to retrieve the value.
  22245. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22246. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22247. */
  22248. getValue(time: JulianDate, result?: any): any;
  22249. /**
  22250. * Compares this property to the provided property and returns
  22251. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22252. * @param [other] - The other property.
  22253. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22254. */
  22255. equals(other?: Property): boolean;
  22256. }
  22257. /**
  22258. * A {@link GeometryUpdater} for polylines.
  22259. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22260. * @param entity - The entity containing the geometry to be visualized.
  22261. * @param scene - The scene where visualization is taking place.
  22262. */
  22263. export class PolylineGeometryUpdater {
  22264. constructor(entity: Entity, scene: Scene);
  22265. /**
  22266. * Gets the unique ID associated with this updater
  22267. */
  22268. readonly id: string;
  22269. /**
  22270. * Gets the entity associated with this geometry.
  22271. */
  22272. readonly entity: Entity;
  22273. /**
  22274. * Gets a value indicating if the geometry has a fill component.
  22275. */
  22276. readonly fillEnabled: boolean;
  22277. /**
  22278. * Gets a value indicating if fill visibility varies with simulation time.
  22279. */
  22280. readonly hasConstantFill: boolean;
  22281. /**
  22282. * Gets the material property used to fill the geometry.
  22283. */
  22284. readonly fillMaterialProperty: MaterialProperty;
  22285. /**
  22286. * Gets the material property used to fill the geometry when it fails the depth test.
  22287. */
  22288. readonly depthFailMaterialProperty: MaterialProperty;
  22289. /**
  22290. * Gets a value indicating if the geometry has an outline component.
  22291. */
  22292. readonly outlineEnabled: boolean;
  22293. /**
  22294. * Gets a value indicating if outline visibility varies with simulation time.
  22295. */
  22296. readonly hasConstantOutline: boolean;
  22297. /**
  22298. * Gets the {@link Color} property for the geometry outline.
  22299. */
  22300. readonly outlineColorProperty: Property;
  22301. /**
  22302. * Gets the property specifying whether the geometry
  22303. * casts or receives shadows from light sources.
  22304. */
  22305. readonly shadowsProperty: Property;
  22306. /**
  22307. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  22308. */
  22309. readonly distanceDisplayConditionProperty: Property;
  22310. /**
  22311. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  22312. */
  22313. readonly classificationTypeProperty: Property;
  22314. /**
  22315. * Gets a value indicating if the geometry is time-varying.
  22316. * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
  22317. * returned by GeometryUpdater#createDynamicUpdater.
  22318. */
  22319. readonly isDynamic: boolean;
  22320. /**
  22321. * Gets a value indicating if the geometry is closed.
  22322. * This property is only valid for static geometry.
  22323. */
  22324. readonly isClosed: boolean;
  22325. /**
  22326. * Gets an event that is raised whenever the public properties
  22327. * of this updater change.
  22328. */
  22329. readonly geometryChanged: boolean;
  22330. /**
  22331. * Gets a value indicating if the path of the line.
  22332. */
  22333. readonly arcType: ArcType;
  22334. /**
  22335. * Gets a value indicating if the geometry is clamped to the ground.
  22336. * Returns false if polylines on terrain is not supported.
  22337. */
  22338. readonly clampToGround: boolean;
  22339. /**
  22340. * Gets the zindex
  22341. */
  22342. readonly zIndex: number;
  22343. /**
  22344. * Checks if the geometry is outlined at the provided time.
  22345. * @param time - The time for which to retrieve visibility.
  22346. * @returns true if geometry is outlined at the provided time, false otherwise.
  22347. */
  22348. isOutlineVisible(time: JulianDate): boolean;
  22349. /**
  22350. * Checks if the geometry is filled at the provided time.
  22351. * @param time - The time for which to retrieve visibility.
  22352. * @returns true if geometry is filled at the provided time, false otherwise.
  22353. */
  22354. isFilled(time: JulianDate): boolean;
  22355. /**
  22356. * Creates the geometry instance which represents the fill of the geometry.
  22357. * @param time - The time to use when retrieving initial attribute values.
  22358. * @returns The geometry instance representing the filled portion of the geometry.
  22359. */
  22360. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22361. /**
  22362. * Creates the geometry instance which represents the outline of the geometry.
  22363. * @param time - The time to use when retrieving initial attribute values.
  22364. * @returns The geometry instance representing the outline portion of the geometry.
  22365. */
  22366. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22367. /**
  22368. * Returns true if this object was destroyed; otherwise, false.
  22369. * @returns True if this object was destroyed; otherwise, false.
  22370. */
  22371. isDestroyed(): boolean;
  22372. /**
  22373. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  22374. */
  22375. destroy(): void;
  22376. }
  22377. /**
  22378. * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.
  22379. * @param [options] - Object with the following properties:
  22380. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22381. * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width.
  22382. * @param [options.taperPower = 1.0] - A numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.
  22383. */
  22384. export class PolylineGlowMaterialProperty {
  22385. constructor(options?: {
  22386. color?: Property | Color;
  22387. glowPower?: Property | number;
  22388. taperPower?: Property | number;
  22389. });
  22390. /**
  22391. * Gets a value indicating if this property is constant. A property is considered
  22392. * constant if getValue always returns the same result for the current definition.
  22393. */
  22394. readonly isConstant: boolean;
  22395. /**
  22396. * Gets the event that is raised whenever the definition of this property changes.
  22397. * The definition is considered to have changed if a call to getValue would return
  22398. * a different result for the same time.
  22399. */
  22400. readonly definitionChanged: Event;
  22401. /**
  22402. * Gets or sets the Property specifying the {@link Color} of the line.
  22403. */
  22404. color: Property | undefined;
  22405. /**
  22406. * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).
  22407. */
  22408. glowPower: Property | undefined;
  22409. /**
  22410. * Gets or sets the numeric Property specifying the strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.
  22411. */
  22412. taperPower: Property | undefined;
  22413. /**
  22414. * Gets the {@link Material} type at the provided time.
  22415. * @param time - The time for which to retrieve the type.
  22416. * @returns The type of material.
  22417. */
  22418. getType(time: JulianDate): string;
  22419. /**
  22420. * Gets the value of the property at the provided time.
  22421. * @param time - The time for which to retrieve the value.
  22422. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22423. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22424. */
  22425. getValue(time: JulianDate, result?: any): any;
  22426. /**
  22427. * Compares this property to the provided property and returns
  22428. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22429. * @param [other] - The other property.
  22430. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22431. */
  22432. equals(other?: Property): boolean;
  22433. }
  22434. export namespace PolylineGraphics {
  22435. /**
  22436. * Initialization options for the PolylineGraphics constructor
  22437. * @property [show = true] - A boolean Property specifying the visibility of the polyline.
  22438. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip.
  22439. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  22440. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE.
  22441. * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline.
  22442. * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain.
  22443. * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  22444. * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground.
  22445. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources.
  22446. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed.
  22447. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22448. * @property [zIndex = 0] - A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported.
  22449. */
  22450. type ConstructorOptions = {
  22451. show?: Property | boolean;
  22452. positions?: Property | Cartesian3[];
  22453. width?: Property | number;
  22454. granularity?: Property | number;
  22455. material?: MaterialProperty | Color;
  22456. depthFailMaterial?: MaterialProperty | Color;
  22457. arcType?: Property | ArcType;
  22458. clampToGround?: Property | boolean;
  22459. shadows?: Property | ShadowMode;
  22460. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22461. classificationType?: Property | ClassificationType;
  22462. zIndex?: Property | number;
  22463. };
  22464. }
  22465. /**
  22466. * Describes a polyline. The first two positions define a line segment,
  22467. * and each additional position defines a line segment from the previous position. The segments
  22468. * can be linear connected points, great arcs, or clamped to terrain.
  22469. * @param [options] - Object describing initialization options
  22470. */
  22471. export class PolylineGraphics {
  22472. constructor(options?: PolylineGraphics.ConstructorOptions);
  22473. /**
  22474. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22475. */
  22476. readonly definitionChanged: Event;
  22477. /**
  22478. * Gets or sets the boolean Property specifying the visibility of the polyline.
  22479. */
  22480. show: Property | undefined;
  22481. /**
  22482. * Gets or sets the Property specifying the array of {@link Cartesian3}
  22483. * positions that define the line strip.
  22484. */
  22485. positions: Property | undefined;
  22486. /**
  22487. * Gets or sets the numeric Property specifying the width in pixels.
  22488. */
  22489. width: Property | undefined;
  22490. /**
  22491. * Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false.
  22492. */
  22493. granularity: Property | undefined;
  22494. /**
  22495. * Gets or sets the Property specifying the material used to draw the polyline.
  22496. */
  22497. material: MaterialProperty;
  22498. /**
  22499. * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.
  22500. * <p>
  22501. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  22502. * there may be artifacts.
  22503. * </p>
  22504. */
  22505. depthFailMaterial: MaterialProperty;
  22506. /**
  22507. * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.
  22508. */
  22509. arcType: Property | undefined;
  22510. /**
  22511. * Gets or sets the boolean Property specifying whether the polyline
  22512. * should be clamped to the ground.
  22513. */
  22514. clampToGround: Property | undefined;
  22515. /**
  22516. * Get or sets the enum Property specifying whether the polyline
  22517. * casts or receives shadows from light sources.
  22518. */
  22519. shadows: Property | undefined;
  22520. /**
  22521. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.
  22522. */
  22523. distanceDisplayCondition: Property | undefined;
  22524. /**
  22525. * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22526. */
  22527. classificationType: Property | undefined;
  22528. /**
  22529. * Gets or sets the zIndex Property specifying the ordering of the polyline. Only has an effect if `clampToGround` is true and polylines on terrain is supported.
  22530. */
  22531. zIndex: ConstantProperty | undefined;
  22532. /**
  22533. * Duplicates this instance.
  22534. * @param [result] - The object onto which to store the result.
  22535. * @returns The modified result parameter or a new instance if one was not provided.
  22536. */
  22537. clone(result?: PolylineGraphics): PolylineGraphics;
  22538. /**
  22539. * Assigns each unassigned property on this object to the value
  22540. * of the same property on the provided source object.
  22541. * @param source - The object to be merged into this object.
  22542. */
  22543. merge(source: PolylineGraphics): void;
  22544. }
  22545. /**
  22546. * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.
  22547. * @param [options] - Object with the following properties:
  22548. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22549. * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22550. * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels.
  22551. */
  22552. export class PolylineOutlineMaterialProperty {
  22553. constructor(options?: {
  22554. color?: Property | Color;
  22555. outlineColor?: Property | Color;
  22556. outlineWidth?: Property | number;
  22557. });
  22558. /**
  22559. * Gets a value indicating if this property is constant. A property is considered
  22560. * constant if getValue always returns the same result for the current definition.
  22561. */
  22562. readonly isConstant: boolean;
  22563. /**
  22564. * Gets the event that is raised whenever the definition of this property changes.
  22565. * The definition is considered to have changed if a call to getValue would return
  22566. * a different result for the same time.
  22567. */
  22568. readonly definitionChanged: Event;
  22569. /**
  22570. * Gets or sets the Property specifying the {@link Color} of the line.
  22571. */
  22572. color: Property | undefined;
  22573. /**
  22574. * Gets or sets the Property specifying the {@link Color} of the outline.
  22575. */
  22576. outlineColor: Property | undefined;
  22577. /**
  22578. * Gets or sets the numeric Property specifying the width of the outline.
  22579. */
  22580. outlineWidth: Property | undefined;
  22581. /**
  22582. * Gets the {@link Material} type at the provided time.
  22583. * @param time - The time for which to retrieve the type.
  22584. * @returns The type of material.
  22585. */
  22586. getType(time: JulianDate): string;
  22587. /**
  22588. * Gets the value of the property at the provided time.
  22589. * @param time - The time for which to retrieve the value.
  22590. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22591. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22592. */
  22593. getValue(time: JulianDate, result?: any): any;
  22594. /**
  22595. * Compares this property to the provided property and returns
  22596. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22597. * @param [other] - The other property.
  22598. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22599. */
  22600. equals(other?: Property): boolean;
  22601. }
  22602. /**
  22603. * A visualizer for polylines represented by {@link Primitive} instances.
  22604. * @param scene - The scene the primitives will be rendered in.
  22605. * @param entityCollection - The entityCollection to visualize.
  22606. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  22607. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  22608. */
  22609. export class PolylineVisualizer {
  22610. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  22611. /**
  22612. * Updates all of the primitives created by this visualizer to match their
  22613. * Entity counterpart at the given time.
  22614. * @param time - The time to update to.
  22615. * @returns True if the visualizer successfully updated to the provided time,
  22616. * false if the visualizer is waiting for asynchronous primitives to be created.
  22617. */
  22618. update(time: JulianDate): boolean;
  22619. /**
  22620. * Returns true if this object was destroyed; otherwise, false.
  22621. * @returns True if this object was destroyed; otherwise, false.
  22622. */
  22623. isDestroyed(): boolean;
  22624. /**
  22625. * Removes and destroys all primitives created by this instance.
  22626. */
  22627. destroy(): void;
  22628. }
  22629. /**
  22630. * A {@link GeometryUpdater} for polyline volumes.
  22631. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22632. * @param entity - The entity containing the geometry to be visualized.
  22633. * @param scene - The scene where visualization is taking place.
  22634. */
  22635. export class PolylineVolumeGeometryUpdater {
  22636. constructor(entity: Entity, scene: Scene);
  22637. /**
  22638. * Creates the geometry instance which represents the fill of the geometry.
  22639. * @param time - The time to use when retrieving initial attribute values.
  22640. * @returns The geometry instance representing the filled portion of the geometry.
  22641. */
  22642. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22643. /**
  22644. * Creates the geometry instance which represents the outline of the geometry.
  22645. * @param time - The time to use when retrieving initial attribute values.
  22646. * @returns The geometry instance representing the outline portion of the geometry.
  22647. */
  22648. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22649. }
  22650. export namespace PolylineVolumeGraphics {
  22651. /**
  22652. * Initialization options for the PolylineVolumeGraphics constructor
  22653. * @property [show = true] - A boolean Property specifying the visibility of the volume.
  22654. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the line strip.
  22655. * @property [shape] - A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  22656. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  22657. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  22658. * @property [fill = true] - A boolean Property specifying whether the volume is filled with the provided material.
  22659. * @property [material = Color.WHITE] - A Property specifying the material used to fill the volume.
  22660. * @property [outline = false] - A boolean Property specifying whether the volume is outlined.
  22661. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22662. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22663. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the volume casts or receives shadows from light sources.
  22664. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this volume will be displayed.
  22665. */
  22666. type ConstructorOptions = {
  22667. show?: Property | boolean;
  22668. positions?: Property | Cartesian3[];
  22669. shape?: Property | Cartesian2[];
  22670. cornerType?: Property | CornerType;
  22671. granularity?: Property | number;
  22672. fill?: Property | boolean;
  22673. material?: MaterialProperty | Color;
  22674. outline?: Property | boolean;
  22675. outlineColor?: Property | Color;
  22676. outlineWidth?: Property | number;
  22677. shadows?: Property | ShadowMode;
  22678. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22679. };
  22680. }
  22681. /**
  22682. * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.
  22683. * The resulting volume conforms to the curvature of the globe.
  22684. * @param [options] - Object describing initialization options
  22685. */
  22686. export class PolylineVolumeGraphics {
  22687. constructor(options?: PolylineVolumeGraphics.ConstructorOptions);
  22688. /**
  22689. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22690. */
  22691. readonly definitionChanged: Event;
  22692. /**
  22693. * Gets or sets the boolean Property specifying the visibility of the volume.
  22694. */
  22695. show: Property | undefined;
  22696. /**
  22697. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip.
  22698. */
  22699. positions: Property | undefined;
  22700. /**
  22701. * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  22702. */
  22703. shape: Property | undefined;
  22704. /**
  22705. * Gets or sets the {@link CornerType} Property specifying the style of the corners.
  22706. */
  22707. cornerType: Property | undefined;
  22708. /**
  22709. * Gets or sets the numeric Property specifying the angular distance between points on the volume.
  22710. */
  22711. granularity: Property | undefined;
  22712. /**
  22713. * Gets or sets the boolean Property specifying whether the volume is filled with the provided material.
  22714. */
  22715. fill: Property | undefined;
  22716. /**
  22717. * Gets or sets the Property specifying the material used to fill the volume.
  22718. */
  22719. material: MaterialProperty;
  22720. /**
  22721. * Gets or sets the Property specifying whether the volume is outlined.
  22722. */
  22723. outline: Property | undefined;
  22724. /**
  22725. * Gets or sets the Property specifying the {@link Color} of the outline.
  22726. */
  22727. outlineColor: Property | undefined;
  22728. /**
  22729. * Gets or sets the numeric Property specifying the width of the outline.
  22730. * <p>
  22731. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  22732. * </p>
  22733. */
  22734. outlineWidth: Property | undefined;
  22735. /**
  22736. * Get or sets the enum Property specifying whether the volume
  22737. * casts or receives shadows from light sources.
  22738. */
  22739. shadows: Property | undefined;
  22740. /**
  22741. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed.
  22742. */
  22743. distanceDisplayCondition: Property | undefined;
  22744. /**
  22745. * Duplicates this instance.
  22746. * @param [result] - The object onto which to store the result.
  22747. * @returns The modified result parameter or a new instance if one was not provided.
  22748. */
  22749. clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics;
  22750. /**
  22751. * Assigns each unassigned property on this object to the value
  22752. * of the same property on the provided source object.
  22753. * @param source - The object to be merged into this object.
  22754. */
  22755. merge(source: PolylineVolumeGraphics): void;
  22756. }
  22757. /**
  22758. * The interface for all {@link Property} objects that define a world
  22759. * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.
  22760. * This type defines an interface and cannot be instantiated directly.
  22761. */
  22762. export class PositionProperty {
  22763. constructor();
  22764. /**
  22765. * Gets a value indicating if this property is constant. A property is considered
  22766. * constant if getValue always returns the same result for the current definition.
  22767. */
  22768. readonly isConstant: boolean;
  22769. /**
  22770. * Gets the event that is raised whenever the definition of this property changes.
  22771. * The definition is considered to have changed if a call to getValue would return
  22772. * a different result for the same time.
  22773. */
  22774. readonly definitionChanged: Event;
  22775. /**
  22776. * Gets the reference frame that the position is defined in.
  22777. */
  22778. referenceFrame: ReferenceFrame;
  22779. /**
  22780. * Gets the value of the property at the provided time in the fixed frame.
  22781. * @param time - The time for which to retrieve the value.
  22782. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22783. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22784. */
  22785. getValue(time: JulianDate, result?: Cartesian3): Cartesian3;
  22786. /**
  22787. * Gets the value of the property at the provided time and in the provided reference frame.
  22788. * @param time - The time for which to retrieve the value.
  22789. * @param referenceFrame - The desired referenceFrame of the result.
  22790. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22791. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22792. */
  22793. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  22794. /**
  22795. * Compares this property to the provided property and returns
  22796. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22797. * @param [other] - The other property.
  22798. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22799. */
  22800. equals(other?: Property): boolean;
  22801. }
  22802. /**
  22803. * A {@link Property} whose value is an array whose items are the computed value
  22804. * of other PositionProperty instances.
  22805. * @param [value] - An array of Property instances.
  22806. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  22807. */
  22808. export class PositionPropertyArray {
  22809. constructor(value?: Property[], referenceFrame?: ReferenceFrame);
  22810. /**
  22811. * Gets a value indicating if this property is constant. This property
  22812. * is considered constant if all property items in the array are constant.
  22813. */
  22814. readonly isConstant: boolean;
  22815. /**
  22816. * Gets the event that is raised whenever the definition of this property changes.
  22817. * The definition is changed whenever setValue is called with data different
  22818. * than the current value or one of the properties in the array also changes.
  22819. */
  22820. readonly definitionChanged: Event;
  22821. /**
  22822. * Gets the reference frame in which the position is defined.
  22823. */
  22824. referenceFrame: ReferenceFrame;
  22825. /**
  22826. * Gets the value of the property.
  22827. * @param time - The time for which to retrieve the value.
  22828. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22829. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22830. */
  22831. getValue(time: JulianDate, result?: Cartesian3[]): Cartesian3[];
  22832. /**
  22833. * Gets the value of the property at the provided time and in the provided reference frame.
  22834. * @param time - The time for which to retrieve the value.
  22835. * @param referenceFrame - The desired referenceFrame of the result.
  22836. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22837. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22838. */
  22839. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[];
  22840. /**
  22841. * Sets the value of the property.
  22842. * @param value - An array of Property instances.
  22843. */
  22844. setValue(value: Property[]): void;
  22845. /**
  22846. * Compares this property to the provided property and returns
  22847. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22848. * @param [other] - The other property.
  22849. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22850. */
  22851. equals(other?: Property): boolean;
  22852. }
  22853. /**
  22854. * The interface for all properties, which represent a value that can optionally vary over time.
  22855. * This type defines an interface and cannot be instantiated directly.
  22856. */
  22857. export class Property {
  22858. constructor();
  22859. /**
  22860. * Gets a value indicating if this property is constant. A property is considered
  22861. * constant if getValue always returns the same result for the current definition.
  22862. */
  22863. readonly isConstant: boolean;
  22864. /**
  22865. * Gets the event that is raised whenever the definition of this property changes.
  22866. * The definition is considered to have changed if a call to getValue would return
  22867. * a different result for the same time.
  22868. */
  22869. readonly definitionChanged: Event;
  22870. /**
  22871. * Gets the value of the property at the provided time.
  22872. * @param time - The time for which to retrieve the value.
  22873. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22874. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22875. */
  22876. getValue(time: JulianDate, result?: any): any;
  22877. /**
  22878. * Compares this property to the provided property and returns
  22879. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22880. * @param [other] - The other property.
  22881. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22882. */
  22883. equals(other?: Property): boolean;
  22884. }
  22885. /**
  22886. * A {@link Property} whose value is an array whose items are the computed value
  22887. * of other property instances.
  22888. * @param [value] - An array of Property instances.
  22889. */
  22890. export class PropertyArray {
  22891. constructor(value?: Property[]);
  22892. /**
  22893. * Gets a value indicating if this property is constant. This property
  22894. * is considered constant if all property items in the array are constant.
  22895. */
  22896. readonly isConstant: boolean;
  22897. /**
  22898. * Gets the event that is raised whenever the definition of this property changes.
  22899. * The definition is changed whenever setValue is called with data different
  22900. * than the current value or one of the properties in the array also changes.
  22901. */
  22902. readonly definitionChanged: Event;
  22903. /**
  22904. * Gets the value of the property.
  22905. * @param time - The time for which to retrieve the value.
  22906. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22907. * @returns The modified result parameter, which is an array of values produced by evaluating each of the contained properties at the given time or a new instance if the result parameter was not supplied.
  22908. */
  22909. getValue(time: JulianDate, result?: object[]): object[];
  22910. /**
  22911. * Sets the value of the property.
  22912. * @param value - An array of Property instances.
  22913. */
  22914. setValue(value: Property[]): void;
  22915. /**
  22916. * Compares this property to the provided property and returns
  22917. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22918. * @param [other] - The other property.
  22919. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22920. */
  22921. equals(other?: Property): boolean;
  22922. }
  22923. export interface PropertyBag extends DictionaryLike {
  22924. }
  22925. /**
  22926. * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.
  22927. * @param [value] - An object, containing key-value mapping of property names to properties.
  22928. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  22929. */
  22930. export class PropertyBag implements DictionaryLike {
  22931. constructor(value?: any, createPropertyCallback?: (...params: any[]) => any);
  22932. /**
  22933. * Gets the names of all properties registered on this instance.
  22934. */
  22935. propertyNames: any[];
  22936. /**
  22937. * Gets a value indicating if this property is constant. This property
  22938. * is considered constant if all property items in this object are constant.
  22939. */
  22940. readonly isConstant: boolean;
  22941. /**
  22942. * Gets the event that is raised whenever the set of properties contained in this
  22943. * object changes, or one of the properties itself changes.
  22944. */
  22945. readonly definitionChanged: Event;
  22946. /**
  22947. * Determines if this object has defined a property with the given name.
  22948. * @param propertyName - The name of the property to check for.
  22949. * @returns True if this object has defined a property with the given name, false otherwise.
  22950. */
  22951. hasProperty(propertyName: string): boolean;
  22952. /**
  22953. * Adds a property to this object.
  22954. * @param propertyName - The name of the property to add.
  22955. * @param [value] - The value of the new property, if provided.
  22956. * @param [createPropertyCallback] - A function that will be called when the value of this new property is set to a value that is not a Property.
  22957. */
  22958. addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void;
  22959. /**
  22960. * Removed a property previously added with addProperty.
  22961. * @param propertyName - The name of the property to remove.
  22962. */
  22963. removeProperty(propertyName: string): void;
  22964. /**
  22965. * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall
  22966. * result will be an object, mapping property names to those values.
  22967. * @param time - The time for which to retrieve the value.
  22968. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22969. * Note that any properties in result which are not part of this PropertyBag will be left as-is.
  22970. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22971. */
  22972. getValue(time: JulianDate, result?: any): any;
  22973. /**
  22974. * Assigns each unassigned property on this object to the value
  22975. * of the same property on the provided source object.
  22976. * @param source - The object to be merged into this object.
  22977. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  22978. */
  22979. merge(source: any, createPropertyCallback?: (...params: any[]) => any): void;
  22980. /**
  22981. * Compares this property to the provided property and returns
  22982. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22983. * @param [other] - The other property.
  22984. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22985. */
  22986. equals(other?: Property): boolean;
  22987. }
  22988. /**
  22989. * A {@link GeometryUpdater} for rectangles.
  22990. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22991. * @param entity - The entity containing the geometry to be visualized.
  22992. * @param scene - The scene where visualization is taking place.
  22993. */
  22994. export class RectangleGeometryUpdater {
  22995. constructor(entity: Entity, scene: Scene);
  22996. /**
  22997. * Creates the geometry instance which represents the fill of the geometry.
  22998. * @param time - The time to use when retrieving initial attribute values.
  22999. * @returns The geometry instance representing the filled portion of the geometry.
  23000. */
  23001. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23002. /**
  23003. * Creates the geometry instance which represents the outline of the geometry.
  23004. * @param time - The time to use when retrieving initial attribute values.
  23005. * @returns The geometry instance representing the outline portion of the geometry.
  23006. */
  23007. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23008. }
  23009. export namespace RectangleGraphics {
  23010. /**
  23011. * Initialization options for the RectangleGraphics constructor
  23012. * @property [show = true] - A boolean Property specifying the visibility of the rectangle.
  23013. * @property [coordinates] - The Property specifying the {@link Rectangle}.
  23014. * @property [height = 0] - A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface.
  23015. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  23016. * @property [extrudedHeight] - A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface.
  23017. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  23018. * @property [rotation = 0.0] - A numeric property specifying the rotation of the rectangle clockwise from north.
  23019. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  23020. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the rectangle.
  23021. * @property [fill = true] - A boolean Property specifying whether the rectangle is filled with the provided material.
  23022. * @property [material = Color.WHITE] - A Property specifying the material used to fill the rectangle.
  23023. * @property [outline = false] - A boolean Property specifying whether the rectangle is outlined.
  23024. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23025. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23026. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the rectangle casts or receives shadows from light sources.
  23027. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this rectangle will be displayed.
  23028. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  23029. * @property [zIndex = 0] - A Property specifying the zIndex used for ordering ground geometry. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified.
  23030. */
  23031. type ConstructorOptions = {
  23032. show?: Property | boolean;
  23033. coordinates?: Property | Rectangle;
  23034. height?: Property | number;
  23035. heightReference?: Property | HeightReference;
  23036. extrudedHeight?: Property | number;
  23037. extrudedHeightReference?: Property | HeightReference;
  23038. rotation?: Property | number;
  23039. stRotation?: Property | number;
  23040. granularity?: Property | number;
  23041. fill?: Property | boolean;
  23042. material?: MaterialProperty | Color;
  23043. outline?: Property | boolean;
  23044. outlineColor?: Property | Color;
  23045. outlineWidth?: Property | number;
  23046. shadows?: Property | ShadowMode;
  23047. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23048. classificationType?: Property | ClassificationType;
  23049. zIndex?: Property | number;
  23050. };
  23051. }
  23052. /**
  23053. * Describes graphics for a {@link Rectangle}.
  23054. * The rectangle conforms to the curvature of the globe and can be placed on the surface or
  23055. * at altitude and can optionally be extruded into a volume.
  23056. * @param [options] - Object describing initialization options
  23057. */
  23058. export class RectangleGraphics {
  23059. constructor(options?: RectangleGraphics.ConstructorOptions);
  23060. /**
  23061. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23062. */
  23063. readonly definitionChanged: Event;
  23064. /**
  23065. * Gets or sets the boolean Property specifying the visibility of the rectangle.
  23066. */
  23067. show: Property | undefined;
  23068. /**
  23069. * Gets or sets the Property specifying the {@link Rectangle}.
  23070. */
  23071. coordinates: Property | undefined;
  23072. /**
  23073. * Gets or sets the numeric Property specifying the altitude of the rectangle.
  23074. */
  23075. height: Property | undefined;
  23076. /**
  23077. * Gets or sets the Property specifying the {@link HeightReference}.
  23078. */
  23079. heightReference: Property | undefined;
  23080. /**
  23081. * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion.
  23082. * Setting this property creates volume starting at height and ending at this altitude.
  23083. */
  23084. extrudedHeight: Property | undefined;
  23085. /**
  23086. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  23087. */
  23088. extrudedHeightReference: Property | undefined;
  23089. /**
  23090. * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north.
  23091. */
  23092. rotation: Property | undefined;
  23093. /**
  23094. * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  23095. */
  23096. stRotation: Property | undefined;
  23097. /**
  23098. * Gets or sets the numeric Property specifying the angular distance between points on the rectangle.
  23099. */
  23100. granularity: Property | undefined;
  23101. /**
  23102. * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material.
  23103. */
  23104. fill: Property | undefined;
  23105. /**
  23106. * Gets or sets the Property specifying the material used to fill the rectangle.
  23107. */
  23108. material: MaterialProperty;
  23109. /**
  23110. * Gets or sets the Property specifying whether the rectangle is outlined.
  23111. */
  23112. outline: Property | undefined;
  23113. /**
  23114. * Gets or sets the Property specifying the {@link Color} of the outline.
  23115. */
  23116. outlineColor: Property | undefined;
  23117. /**
  23118. * Gets or sets the numeric Property specifying the width of the outline.
  23119. * <p>
  23120. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  23121. * </p>
  23122. */
  23123. outlineWidth: Property | undefined;
  23124. /**
  23125. * Get or sets the enum Property specifying whether the rectangle
  23126. * casts or receives shadows from light sources.
  23127. */
  23128. shadows: Property | undefined;
  23129. /**
  23130. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed.
  23131. */
  23132. distanceDisplayCondition: Property | undefined;
  23133. /**
  23134. * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  23135. */
  23136. classificationType: Property | undefined;
  23137. /**
  23138. * Gets or sets the zIndex Property specifying the ordering of the rectangle. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified.
  23139. */
  23140. zIndex: ConstantProperty | undefined;
  23141. /**
  23142. * Duplicates this instance.
  23143. * @param [result] - The object onto which to store the result.
  23144. * @returns The modified result parameter or a new instance if one was not provided.
  23145. */
  23146. clone(result?: RectangleGraphics): RectangleGraphics;
  23147. /**
  23148. * Assigns each unassigned property on this object to the value
  23149. * of the same property on the provided source object.
  23150. * @param source - The object to be merged into this object.
  23151. */
  23152. merge(source: RectangleGraphics): void;
  23153. }
  23154. /**
  23155. * A {@link Property} which transparently links to another property on a provided object.
  23156. * @example
  23157. * var collection = new Cesium.EntityCollection();
  23158. *
  23159. * //Create a new entity and assign a billboard scale.
  23160. * var object1 = new Cesium.Entity({id:'object1'});
  23161. * object1.billboard = new Cesium.BillboardGraphics();
  23162. * object1.billboard.scale = new Cesium.ConstantProperty(2.0);
  23163. * collection.add(object1);
  23164. *
  23165. * //Create a second entity and reference the scale from the first one.
  23166. * var object2 = new Cesium.Entity({id:'object2'});
  23167. * object2.model = new Cesium.ModelGraphics();
  23168. * object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']);
  23169. * collection.add(object2);
  23170. *
  23171. * //Create a third object, but use the fromString helper function.
  23172. * var object3 = new Cesium.Entity({id:'object3'});
  23173. * object3.billboard = new Cesium.BillboardGraphics();
  23174. * object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale');
  23175. * collection.add(object3);
  23176. *
  23177. * //You can refer to an entity with a # or . in id and property names by escaping them.
  23178. * var object4 = new Cesium.Entity({id:'#object.4'});
  23179. * object4.billboard = new Cesium.BillboardGraphics();
  23180. * object4.billboard.scale = new Cesium.ConstantProperty(2.0);
  23181. * collection.add(object4);
  23182. *
  23183. * var object5 = new Cesium.Entity({id:'object5'});
  23184. * object5.billboard = new Cesium.BillboardGraphics();
  23185. * object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale');
  23186. * collection.add(object5);
  23187. * @param targetCollection - The entity collection which will be used to resolve the reference.
  23188. * @param targetId - The id of the entity which is being referenced.
  23189. * @param targetPropertyNames - The names of the property on the target entity which we will use.
  23190. */
  23191. export class ReferenceProperty {
  23192. constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string[]);
  23193. /**
  23194. * Gets a value indicating if this property is constant.
  23195. */
  23196. readonly isConstant: boolean;
  23197. /**
  23198. * Gets the event that is raised whenever the definition of this property changes.
  23199. * The definition is changed whenever the referenced property's definition is changed.
  23200. */
  23201. readonly definitionChanged: Event;
  23202. /**
  23203. * Gets the reference frame that the position is defined in.
  23204. * This property is only valid if the referenced property is a {@link PositionProperty}.
  23205. */
  23206. readonly referenceFrame: ReferenceFrame;
  23207. /**
  23208. * Gets the id of the entity being referenced.
  23209. */
  23210. readonly targetId: string;
  23211. /**
  23212. * Gets the collection containing the entity being referenced.
  23213. */
  23214. readonly targetCollection: EntityCollection;
  23215. /**
  23216. * Gets the array of property names used to retrieve the referenced property.
  23217. */
  23218. readonly targetPropertyNames: string[];
  23219. /**
  23220. * Gets the resolved instance of the underlying referenced property.
  23221. */
  23222. readonly resolvedProperty: Property | undefined;
  23223. /**
  23224. * Creates a new instance given the entity collection that will
  23225. * be used to resolve it and a string indicating the target entity id and property.
  23226. * The format of the string is "objectId#foo.bar", where # separates the id from
  23227. * property path and . separates sub-properties. If the reference identifier or
  23228. * or any sub-properties contains a # . or \ they must be escaped.
  23229. * @returns A new instance of ReferenceProperty.
  23230. */
  23231. static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty;
  23232. /**
  23233. * Gets the value of the property at the provided time.
  23234. * @param time - The time for which to retrieve the value.
  23235. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23236. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23237. */
  23238. getValue(time: JulianDate, result?: any): any;
  23239. /**
  23240. * Gets the value of the property at the provided time and in the provided reference frame.
  23241. * This method is only valid if the property being referenced is a {@link PositionProperty}.
  23242. * @param time - The time for which to retrieve the value.
  23243. * @param referenceFrame - The desired referenceFrame of the result.
  23244. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23245. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23246. */
  23247. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23248. /**
  23249. * Gets the {@link Material} type at the provided time.
  23250. * This method is only valid if the property being referenced is a {@link MaterialProperty}.
  23251. * @param time - The time for which to retrieve the type.
  23252. * @returns The type of material.
  23253. */
  23254. getType(time: JulianDate): string;
  23255. /**
  23256. * Compares this property to the provided property and returns
  23257. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23258. * @param [other] - The other property.
  23259. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23260. */
  23261. equals(other?: Property): boolean;
  23262. }
  23263. export namespace Rotation {
  23264. /**
  23265. * The number of elements used to pack the object into an array.
  23266. */
  23267. var packedLength: number;
  23268. /**
  23269. * Stores the provided instance into the provided array.
  23270. * @param value - The value to pack.
  23271. * @param array - The array to pack into.
  23272. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  23273. * @returns The array that was packed into
  23274. */
  23275. function pack(value: Rotation, array: number[], startingIndex?: number): number[];
  23276. /**
  23277. * Retrieves an instance from a packed array.
  23278. * @param array - The packed array.
  23279. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  23280. * @param [result] - The object into which to store the result.
  23281. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23282. */
  23283. function unpack(array: number[], startingIndex?: number, result?: Rotation): Rotation;
  23284. /**
  23285. * Converts a packed array into a form suitable for interpolation.
  23286. * @param packedArray - The packed array.
  23287. * @param [startingIndex = 0] - The index of the first element to be converted.
  23288. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  23289. * @param [result] - The object into which to store the result.
  23290. */
  23291. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  23292. /**
  23293. * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}.
  23294. * @param array - The array previously packed for interpolation.
  23295. * @param sourceArray - The original packed array.
  23296. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  23297. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  23298. * @param [result] - The object into which to store the result.
  23299. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23300. */
  23301. function unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Rotation): Rotation;
  23302. }
  23303. /**
  23304. * Represents a {@link Packable} number that always interpolates values
  23305. * towards the shortest angle of rotation. This object is never used directly
  23306. * but is instead passed to the constructor of {@link SampledProperty}
  23307. * in order to represent a two-dimensional angle of rotation.
  23308. * @example
  23309. * var time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');
  23310. * var time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');
  23311. * var time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');
  23312. *
  23313. * var property = new Cesium.SampledProperty(Cesium.Rotation);
  23314. * property.addSample(time1, 0);
  23315. * property.addSample(time3, Cesium.Math.toRadians(350));
  23316. *
  23317. * //Getting the value at time2 will equal 355 degrees instead
  23318. * //of 175 degrees (which is what you get if you construct
  23319. * //a SampledProperty(Number) instead. Note, the actual
  23320. * //return value is in radians, not degrees.
  23321. * property.getValue(time2);
  23322. */
  23323. export interface Rotation {
  23324. }
  23325. /**
  23326. * A {@link SampledProperty} which is also a {@link PositionProperty}.
  23327. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23328. * @param [numberOfDerivatives = 0] - The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...
  23329. */
  23330. export class SampledPositionProperty {
  23331. constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number);
  23332. /**
  23333. * Gets a value indicating if this property is constant. A property is considered
  23334. * constant if getValue always returns the same result for the current definition.
  23335. */
  23336. readonly isConstant: boolean;
  23337. /**
  23338. * Gets the event that is raised whenever the definition of this property changes.
  23339. * The definition is considered to have changed if a call to getValue would return
  23340. * a different result for the same time.
  23341. */
  23342. readonly definitionChanged: Event;
  23343. /**
  23344. * Gets the reference frame in which the position is defined.
  23345. */
  23346. referenceFrame: ReferenceFrame;
  23347. /**
  23348. * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23349. */
  23350. readonly interpolationDegree: number;
  23351. /**
  23352. * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23353. */
  23354. readonly interpolationAlgorithm: InterpolationAlgorithm;
  23355. /**
  23356. * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc.
  23357. */
  23358. numberOfDerivatives: number;
  23359. /**
  23360. * Gets or sets the type of extrapolation to perform when a value
  23361. * is requested at a time after any available samples.
  23362. */
  23363. forwardExtrapolationType: ExtrapolationType;
  23364. /**
  23365. * Gets or sets the amount of time to extrapolate forward before
  23366. * the property becomes undefined. A value of 0 will extrapolate forever.
  23367. */
  23368. forwardExtrapolationDuration: number;
  23369. /**
  23370. * Gets or sets the type of extrapolation to perform when a value
  23371. * is requested at a time before any available samples.
  23372. */
  23373. backwardExtrapolationType: ExtrapolationType;
  23374. /**
  23375. * Gets or sets the amount of time to extrapolate backward
  23376. * before the property becomes undefined. A value of 0 will extrapolate forever.
  23377. */
  23378. backwardExtrapolationDuration: number;
  23379. /**
  23380. * Gets the position at the provided time.
  23381. * @param time - The time for which to retrieve the value.
  23382. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23383. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23384. */
  23385. getValue(time: JulianDate, result?: Cartesian3): Cartesian3;
  23386. /**
  23387. * Gets the position at the provided time and in the provided reference frame.
  23388. * @param time - The time for which to retrieve the value.
  23389. * @param referenceFrame - The desired referenceFrame of the result.
  23390. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23391. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23392. */
  23393. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23394. /**
  23395. * Sets the algorithm and degree to use when interpolating a position.
  23396. * @param [options] - Object with the following properties:
  23397. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23398. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23399. */
  23400. setInterpolationOptions(options?: {
  23401. interpolationAlgorithm?: InterpolationAlgorithm;
  23402. interpolationDegree?: number;
  23403. }): void;
  23404. /**
  23405. * Adds a new sample.
  23406. * @param time - The sample time.
  23407. * @param position - The position at the provided time.
  23408. * @param [derivatives] - The array of derivative values at the provided time.
  23409. */
  23410. addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void;
  23411. /**
  23412. * Adds multiple samples via parallel arrays.
  23413. * @param times - An array of JulianDate instances where each index is a sample time.
  23414. * @param positions - An array of Cartesian3 position instances, where each value corresponds to the provided time index.
  23415. * @param [derivatives] - An array where each value is another array containing derivatives for the corresponding time index.
  23416. */
  23417. addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void;
  23418. /**
  23419. * Adds samples as a single packed array where each new sample is represented as a date,
  23420. * followed by the packed representation of the corresponding value and derivatives.
  23421. * @param packedSamples - The array of packed samples.
  23422. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23423. */
  23424. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23425. /**
  23426. * Removes a sample at the given time, if present.
  23427. * @param time - The sample time.
  23428. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23429. */
  23430. removeSample(time: JulianDate): boolean;
  23431. /**
  23432. * Removes all samples for the given time interval.
  23433. * @param time - The time interval for which to remove all samples.
  23434. */
  23435. removeSamples(time: TimeInterval): void;
  23436. /**
  23437. * Compares this property to the provided property and returns
  23438. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23439. * @param [other] - The other property.
  23440. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23441. */
  23442. equals(other?: Property): boolean;
  23443. }
  23444. /**
  23445. * A {@link Property} whose value is interpolated for a given time from the
  23446. * provided set of samples and specified interpolation algorithm and degree.
  23447. * @example
  23448. * //Create a linearly interpolated Cartesian2
  23449. * var property = new Cesium.SampledProperty(Cesium.Cartesian2);
  23450. *
  23451. * //Populate it with data
  23452. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));
  23453. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));
  23454. *
  23455. * //Retrieve an interpolated value
  23456. * var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));
  23457. * @example
  23458. * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
  23459. * var property = new Cesium.SampledProperty(Number);
  23460. * property.setInterpolationOptions({
  23461. * interpolationDegree : 3,
  23462. * interpolationAlgorithm : Cesium.HermitePolynomialApproximation
  23463. * });
  23464. *
  23465. * //Populate it with data
  23466. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);
  23467. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);
  23468. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);
  23469. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);
  23470. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);
  23471. *
  23472. * //Samples can be added in any order.
  23473. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);
  23474. *
  23475. * //Retrieve an interpolated value
  23476. * var result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));
  23477. * @param type - The type of property.
  23478. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types.
  23479. */
  23480. export class SampledProperty {
  23481. constructor(type: number | Packable, derivativeTypes?: Packable[]);
  23482. /**
  23483. * Gets a value indicating if this property is constant. A property is considered
  23484. * constant if getValue always returns the same result for the current definition.
  23485. */
  23486. readonly isConstant: boolean;
  23487. /**
  23488. * Gets the event that is raised whenever the definition of this property changes.
  23489. * The definition is considered to have changed if a call to getValue would return
  23490. * a different result for the same time.
  23491. */
  23492. readonly definitionChanged: Event;
  23493. /**
  23494. * Gets the type of property.
  23495. */
  23496. type: any;
  23497. /**
  23498. * Gets the derivative types used by this property.
  23499. */
  23500. derivativeTypes: Packable[];
  23501. /**
  23502. * Gets the degree of interpolation to perform when retrieving a value.
  23503. */
  23504. interpolationDegree: number;
  23505. /**
  23506. * Gets the interpolation algorithm to use when retrieving a value.
  23507. */
  23508. interpolationAlgorithm: InterpolationAlgorithm;
  23509. /**
  23510. * Gets or sets the type of extrapolation to perform when a value
  23511. * is requested at a time after any available samples.
  23512. */
  23513. forwardExtrapolationType: ExtrapolationType;
  23514. /**
  23515. * Gets or sets the amount of time to extrapolate forward before
  23516. * the property becomes undefined. A value of 0 will extrapolate forever.
  23517. */
  23518. forwardExtrapolationDuration: number;
  23519. /**
  23520. * Gets or sets the type of extrapolation to perform when a value
  23521. * is requested at a time before any available samples.
  23522. */
  23523. backwardExtrapolationType: ExtrapolationType;
  23524. /**
  23525. * Gets or sets the amount of time to extrapolate backward
  23526. * before the property becomes undefined. A value of 0 will extrapolate forever.
  23527. */
  23528. backwardExtrapolationDuration: number;
  23529. /**
  23530. * Gets the value of the property at the provided time.
  23531. * @param time - The time for which to retrieve the value.
  23532. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23533. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23534. */
  23535. getValue(time: JulianDate, result?: any): any;
  23536. /**
  23537. * Sets the algorithm and degree to use when interpolating a value.
  23538. * @param [options] - Object with the following properties:
  23539. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23540. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23541. */
  23542. setInterpolationOptions(options?: {
  23543. interpolationAlgorithm?: InterpolationAlgorithm;
  23544. interpolationDegree?: number;
  23545. }): void;
  23546. /**
  23547. * Adds a new sample.
  23548. * @param time - The sample time.
  23549. * @param value - The value at the provided time.
  23550. * @param [derivatives] - The array of derivatives at the provided time.
  23551. */
  23552. addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void;
  23553. /**
  23554. * Adds an array of samples.
  23555. * @param times - An array of JulianDate instances where each index is a sample time.
  23556. * @param values - The array of values, where each value corresponds to the provided times index.
  23557. * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index.
  23558. */
  23559. addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void;
  23560. /**
  23561. * Adds samples as a single packed array where each new sample is represented as a date,
  23562. * followed by the packed representation of the corresponding value and derivatives.
  23563. * @param packedSamples - The array of packed samples.
  23564. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23565. */
  23566. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23567. /**
  23568. * Removes a sample at the given time, if present.
  23569. * @param time - The sample time.
  23570. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23571. */
  23572. removeSample(time: JulianDate): boolean;
  23573. /**
  23574. * Removes all samples for the given time interval.
  23575. * @param time - The time interval for which to remove all samples.
  23576. */
  23577. removeSamples(time: TimeInterval): void;
  23578. /**
  23579. * Compares this property to the provided property and returns
  23580. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23581. * @param [other] - The other property.
  23582. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23583. */
  23584. equals(other?: Property): boolean;
  23585. }
  23586. /**
  23587. * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms.
  23588. * @param [options] - Object with the following properties:
  23589. * @param [options.orientation = StripeOrientation.HORIZONTAL] - A Property specifying the {@link StripeOrientation}.
  23590. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  23591. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  23592. * @param [options.offset = 0] - A numeric Property specifying how far into the pattern to start the material.
  23593. * @param [options.repeat = 1] - A numeric Property specifying how many times the stripes repeat.
  23594. */
  23595. export class StripeMaterialProperty {
  23596. constructor(options?: {
  23597. orientation?: Property | StripeOrientation;
  23598. evenColor?: Property | Color;
  23599. oddColor?: Property | Color;
  23600. offset?: Property | number;
  23601. repeat?: Property | number;
  23602. });
  23603. /**
  23604. * Gets a value indicating if this property is constant. A property is considered
  23605. * constant if getValue always returns the same result for the current definition.
  23606. */
  23607. readonly isConstant: boolean;
  23608. /**
  23609. * Gets the event that is raised whenever the definition of this property changes.
  23610. * The definition is considered to have changed if a call to getValue would return
  23611. * a different result for the same time.
  23612. */
  23613. readonly definitionChanged: Event;
  23614. /**
  23615. * Gets or sets the Property specifying the {@link StripeOrientation}/
  23616. */
  23617. orientation: Property | undefined;
  23618. /**
  23619. * Gets or sets the Property specifying the first {@link Color}.
  23620. */
  23621. evenColor: Property | undefined;
  23622. /**
  23623. * Gets or sets the Property specifying the second {@link Color}.
  23624. */
  23625. oddColor: Property | undefined;
  23626. /**
  23627. * Gets or sets the numeric Property specifying the point into the pattern
  23628. * to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning
  23629. * of the odd color, 2.0 being the even color again, and any multiple or fractional values
  23630. * being in between.
  23631. */
  23632. offset: Property | undefined;
  23633. /**
  23634. * Gets or sets the numeric Property specifying how many times the stripes repeat.
  23635. */
  23636. repeat: Property | undefined;
  23637. /**
  23638. * Gets the {@link Material} type at the provided time.
  23639. * @param time - The time for which to retrieve the type.
  23640. * @returns The type of material.
  23641. */
  23642. getType(time: JulianDate): string;
  23643. /**
  23644. * Gets the value of the property at the provided time.
  23645. * @param time - The time for which to retrieve the value.
  23646. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23647. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23648. */
  23649. getValue(time: JulianDate, result?: any): any;
  23650. /**
  23651. * Compares this property to the provided property and returns
  23652. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23653. * @param [other] - The other property.
  23654. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23655. */
  23656. equals(other?: Property): boolean;
  23657. }
  23658. /**
  23659. * Defined the orientation of stripes in {@link StripeMaterialProperty}.
  23660. */
  23661. export enum StripeOrientation {
  23662. /**
  23663. * Horizontal orientation.
  23664. */
  23665. HORIZONTAL = 0,
  23666. /**
  23667. * Vertical orientation.
  23668. */
  23669. VERTICAL = 1
  23670. }
  23671. /**
  23672. * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}.
  23673. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23674. */
  23675. export class TimeIntervalCollectionPositionProperty {
  23676. constructor(referenceFrame?: ReferenceFrame);
  23677. /**
  23678. * Gets a value indicating if this property is constant. A property is considered
  23679. * constant if getValue always returns the same result for the current definition.
  23680. */
  23681. readonly isConstant: boolean;
  23682. /**
  23683. * Gets the event that is raised whenever the definition of this property changes.
  23684. * The definition is considered to have changed if a call to getValue would return
  23685. * a different result for the same time.
  23686. */
  23687. readonly definitionChanged: Event;
  23688. /**
  23689. * Gets the interval collection.
  23690. */
  23691. intervals: TimeIntervalCollection;
  23692. /**
  23693. * Gets the reference frame in which the position is defined.
  23694. */
  23695. referenceFrame: ReferenceFrame;
  23696. /**
  23697. * Gets the value of the property at the provided time in the fixed frame.
  23698. * @param time - The time for which to retrieve the value.
  23699. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23700. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23701. */
  23702. getValue(time: JulianDate, result?: any): any;
  23703. /**
  23704. * Gets the value of the property at the provided time and in the provided reference frame.
  23705. * @param time - The time for which to retrieve the value.
  23706. * @param referenceFrame - The desired referenceFrame of the result.
  23707. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23708. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23709. */
  23710. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23711. /**
  23712. * Compares this property to the provided property and returns
  23713. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23714. * @param [other] - The other property.
  23715. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23716. */
  23717. equals(other?: Property): boolean;
  23718. }
  23719. /**
  23720. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  23721. * data property of each {@link TimeInterval} represents the value at time.
  23722. * @example
  23723. * //Create a Cartesian2 interval property which contains data on August 1st, 2012
  23724. * //and uses a different value every 6 hours.
  23725. * var composite = new Cesium.TimeIntervalCollectionProperty();
  23726. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23727. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',
  23728. * isStartIncluded : true,
  23729. * isStopIncluded : false,
  23730. * data : new Cesium.Cartesian2(2.0, 3.4)
  23731. * }));
  23732. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23733. * iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',
  23734. * isStartIncluded : true,
  23735. * isStopIncluded : false,
  23736. * data : new Cesium.Cartesian2(12.0, 2.7)
  23737. * }));
  23738. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23739. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',
  23740. * isStartIncluded : true,
  23741. * isStopIncluded : false,
  23742. * data : new Cesium.Cartesian2(5.0, 12.4)
  23743. * }));
  23744. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  23745. * iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',
  23746. * isStartIncluded : true,
  23747. * isStopIncluded : true,
  23748. * data : new Cesium.Cartesian2(85.0, 4.1)
  23749. * }));
  23750. */
  23751. export class TimeIntervalCollectionProperty {
  23752. constructor();
  23753. /**
  23754. * Gets a value indicating if this property is constant. A property is considered
  23755. * constant if getValue always returns the same result for the current definition.
  23756. */
  23757. readonly isConstant: boolean;
  23758. /**
  23759. * Gets the event that is raised whenever the definition of this property changes.
  23760. * The definition is changed whenever setValue is called with data different
  23761. * than the current value.
  23762. */
  23763. readonly definitionChanged: Event;
  23764. /**
  23765. * Gets the interval collection.
  23766. */
  23767. intervals: TimeIntervalCollection;
  23768. /**
  23769. * Gets the value of the property at the provided time.
  23770. * @param time - The time for which to retrieve the value.
  23771. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23772. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23773. */
  23774. getValue(time: JulianDate, result?: any): any;
  23775. /**
  23776. * Compares this property to the provided property and returns
  23777. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23778. * @param [other] - The other property.
  23779. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23780. */
  23781. equals(other?: Property): boolean;
  23782. }
  23783. /**
  23784. * A {@link Property} which evaluates to a {@link Quaternion} rotation
  23785. * based on the velocity of the provided {@link PositionProperty}.
  23786. * @example
  23787. * //Create an entity with position and orientation.
  23788. * var position = new Cesium.SampledProperty();
  23789. * position.addSamples(...);
  23790. * var entity = viewer.entities.add({
  23791. * position : position,
  23792. * orientation : new Cesium.VelocityOrientationProperty(position)
  23793. * }));
  23794. * @param [position] - The position property used to compute the orientation.
  23795. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up.
  23796. */
  23797. export class VelocityOrientationProperty {
  23798. constructor(position?: PositionProperty, ellipsoid?: Ellipsoid);
  23799. /**
  23800. * Gets a value indicating if this property is constant.
  23801. */
  23802. readonly isConstant: boolean;
  23803. /**
  23804. * Gets the event that is raised whenever the definition of this property changes.
  23805. */
  23806. readonly definitionChanged: Event;
  23807. /**
  23808. * Gets or sets the position property used to compute orientation.
  23809. */
  23810. position: Property | undefined;
  23811. /**
  23812. * Gets or sets the ellipsoid used to determine which way is up.
  23813. */
  23814. ellipsoid: Property | undefined;
  23815. /**
  23816. * Gets the value of the property at the provided time.
  23817. * @param [time] - The time for which to retrieve the value.
  23818. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23819. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23820. */
  23821. getValue(time?: JulianDate, result?: Quaternion): Quaternion;
  23822. /**
  23823. * Compares this property to the provided property and returns
  23824. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23825. * @param [other] - The other property.
  23826. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23827. */
  23828. equals(other?: Property): boolean;
  23829. }
  23830. /**
  23831. * A {@link Property} which evaluates to a {@link Cartesian3} vector
  23832. * based on the velocity of the provided {@link PositionProperty}.
  23833. * @example
  23834. * //Create an entity with a billboard rotated to match its velocity.
  23835. * var position = new Cesium.SampledProperty();
  23836. * position.addSamples(...);
  23837. * var entity = viewer.entities.add({
  23838. * position : position,
  23839. * billboard : {
  23840. * image : 'image.png',
  23841. * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector
  23842. * }
  23843. * }));
  23844. * @param [position] - The position property used to compute the velocity.
  23845. * @param [normalize = true] - Whether to normalize the computed velocity vector.
  23846. */
  23847. export class VelocityVectorProperty {
  23848. constructor(position?: PositionProperty, normalize?: boolean);
  23849. /**
  23850. * Gets a value indicating if this property is constant.
  23851. */
  23852. readonly isConstant: boolean;
  23853. /**
  23854. * Gets the event that is raised whenever the definition of this property changes.
  23855. */
  23856. readonly definitionChanged: Event;
  23857. /**
  23858. * Gets or sets the position property used to compute the velocity vector.
  23859. */
  23860. position: Property | undefined;
  23861. /**
  23862. * Gets or sets whether the vector produced by this property
  23863. * will be normalized or not.
  23864. */
  23865. normalize: boolean;
  23866. /**
  23867. * Gets the value of the property at the provided time.
  23868. * @param [time] - The time for which to retrieve the value.
  23869. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23870. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23871. */
  23872. getValue(time?: JulianDate, result?: Cartesian3): Cartesian3;
  23873. /**
  23874. * Compares this property to the provided property and returns
  23875. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23876. * @param [other] - The other property.
  23877. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23878. */
  23879. equals(other?: Property): boolean;
  23880. }
  23881. /**
  23882. * Defines the interface for visualizers. Visualizers are plug-ins to
  23883. * {@link DataSourceDisplay} that render data associated with
  23884. * {@link DataSource} instances.
  23885. * This object is an interface for documentation purposes and is not intended
  23886. * to be instantiated directly.
  23887. */
  23888. export class Visualizer {
  23889. constructor();
  23890. /**
  23891. * Updates the visualization to the provided time.
  23892. * @param time - The time.
  23893. * @returns True if the display was updated to the provided time,
  23894. * false if the visualizer is waiting for an asynchronous operation to
  23895. * complete before data can be updated.
  23896. */
  23897. update(time: JulianDate): boolean;
  23898. /**
  23899. * Returns true if this object was destroyed; otherwise, false.
  23900. * @returns True if this object was destroyed; otherwise, false.
  23901. */
  23902. isDestroyed(): boolean;
  23903. /**
  23904. * Removes all visualization and cleans up any resources associated with this instance.
  23905. */
  23906. destroy(): void;
  23907. }
  23908. /**
  23909. * A {@link GeometryUpdater} for walls.
  23910. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  23911. * @param entity - The entity containing the geometry to be visualized.
  23912. * @param scene - The scene where visualization is taking place.
  23913. */
  23914. export class WallGeometryUpdater {
  23915. constructor(entity: Entity, scene: Scene);
  23916. /**
  23917. * Creates the geometry instance which represents the fill of the geometry.
  23918. * @param time - The time to use when retrieving initial attribute values.
  23919. * @returns The geometry instance representing the filled portion of the geometry.
  23920. */
  23921. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23922. /**
  23923. * Creates the geometry instance which represents the outline of the geometry.
  23924. * @param time - The time to use when retrieving initial attribute values.
  23925. * @returns The geometry instance representing the outline portion of the geometry.
  23926. */
  23927. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23928. }
  23929. export namespace WallGraphics {
  23930. /**
  23931. * Initialization options for the WallGraphics constructor
  23932. * @property [show = true] - A boolean Property specifying the visibility of the wall.
  23933. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  23934. * @property [minimumHeights] - A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.
  23935. * @property [maximumHeights] - A Property specifying an array of heights to be used for the top of the wall instead of the height of each position.
  23936. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  23937. * @property [fill = true] - A boolean Property specifying whether the wall is filled with the provided material.
  23938. * @property [material = Color.WHITE] - A Property specifying the material used to fill the wall.
  23939. * @property [outline = false] - A boolean Property specifying whether the wall is outlined.
  23940. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23941. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23942. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the wall casts or receives shadows from light sources.
  23943. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this wall will be displayed.
  23944. */
  23945. type ConstructorOptions = {
  23946. show?: Property | boolean;
  23947. positions?: Property | Cartesian3[];
  23948. minimumHeights?: Property | number[];
  23949. maximumHeights?: Property | number[];
  23950. granularity?: Property | number;
  23951. fill?: Property | boolean;
  23952. material?: MaterialProperty | Color;
  23953. outline?: Property | boolean;
  23954. outlineColor?: Property | Color;
  23955. outlineWidth?: Property | number;
  23956. shadows?: Property | ShadowMode;
  23957. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23958. };
  23959. }
  23960. /**
  23961. * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.
  23962. * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.
  23963. * @param [options] - Object describing initialization options
  23964. */
  23965. export class WallGraphics {
  23966. constructor(options?: WallGraphics.ConstructorOptions);
  23967. /**
  23968. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23969. */
  23970. readonly definitionChanged: Event;
  23971. /**
  23972. * Gets or sets the boolean Property specifying the visibility of the wall.
  23973. */
  23974. show: Property | undefined;
  23975. /**
  23976. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  23977. */
  23978. positions: Property | undefined;
  23979. /**
  23980. * Gets or sets the Property specifying an array of heights to be used for the bottom of the wall instead of the surface of the globe.
  23981. * If defined, the array must be the same length as {@link Wall#positions}.
  23982. */
  23983. minimumHeights: Property | undefined;
  23984. /**
  23985. * Gets or sets the Property specifying an array of heights to be used for the top of the wall instead of the height of each position.
  23986. * If defined, the array must be the same length as {@link Wall#positions}.
  23987. */
  23988. maximumHeights: Property | undefined;
  23989. /**
  23990. * Gets or sets the numeric Property specifying the angular distance between points on the wall.
  23991. */
  23992. granularity: Property | undefined;
  23993. /**
  23994. * Gets or sets the boolean Property specifying whether the wall is filled with the provided material.
  23995. */
  23996. fill: Property | undefined;
  23997. /**
  23998. * Gets or sets the Property specifying the material used to fill the wall.
  23999. */
  24000. material: MaterialProperty;
  24001. /**
  24002. * Gets or sets the Property specifying whether the wall is outlined.
  24003. */
  24004. outline: Property | undefined;
  24005. /**
  24006. * Gets or sets the Property specifying the {@link Color} of the outline.
  24007. */
  24008. outlineColor: Property | undefined;
  24009. /**
  24010. * Gets or sets the numeric Property specifying the width of the outline.
  24011. * <p>
  24012. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  24013. * </p>
  24014. */
  24015. outlineWidth: Property | undefined;
  24016. /**
  24017. * Get or sets the enum Property specifying whether the wall
  24018. * casts or receives shadows from light sources.
  24019. */
  24020. shadows: Property | undefined;
  24021. /**
  24022. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed.
  24023. */
  24024. distanceDisplayCondition: Property | undefined;
  24025. /**
  24026. * Duplicates this instance.
  24027. * @param [result] - The object onto which to store the result.
  24028. * @returns The modified result parameter or a new instance if one was not provided.
  24029. */
  24030. clone(result?: WallGraphics): WallGraphics;
  24031. /**
  24032. * Assigns each unassigned property on this object to the value
  24033. * of the same property on the provided source object.
  24034. * @param source - The object to be merged into this object.
  24035. */
  24036. merge(source: WallGraphics): void;
  24037. }
  24038. /**
  24039. * @property kml - The generated KML.
  24040. * @property externalFiles - An object dictionary of external files
  24041. */
  24042. export type exportKmlResultKml = {
  24043. kml: string;
  24044. externalFiles: {
  24045. [key: string]: Blob;
  24046. };
  24047. };
  24048. /**
  24049. * @property kmz - The generated kmz file.
  24050. */
  24051. export type exportKmlResultKmz = {
  24052. kmz: Blob;
  24053. };
  24054. /**
  24055. * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries
  24056. * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For
  24057. * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at
  24058. * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties
  24059. * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using
  24060. * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported
  24061. * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary
  24062. * color is used. Canvas objects are exported as PNG images.
  24063. * @example
  24064. * Cesium.exportKml({
  24065. * entities: entityCollection
  24066. * })
  24067. * .then(function(result) {
  24068. * // The XML string is in result.kml
  24069. *
  24070. * var externalFiles = result.externalFiles
  24071. * for(var file in externalFiles) {
  24072. * // file is the name of the file used in the KML document as the href
  24073. * // externalFiles[file] is a blob with the contents of the file
  24074. * }
  24075. * });
  24076. * @param options - An object with the following properties:
  24077. * @param options.entities - The EntityCollection to export as KML.
  24078. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file.
  24079. * @param [options.modelCallback] - A callback that will be called with a {@link ModelGraphics} instance and should return the URI to use in the KML. Required if a model exists in the entity collection.
  24080. * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML.
  24081. * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability.
  24082. * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML.
  24083. * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file.
  24084. * @returns A promise that resolved to an object containing the KML string and a dictionary of external file blobs, or a kmz file as a blob if options.kmz is true.
  24085. */
  24086. export function exportKml(options: {
  24087. entities: EntityCollection;
  24088. ellipsoid?: Ellipsoid;
  24089. modelCallback?: exportKmlModelCallback;
  24090. time?: JulianDate;
  24091. defaultAvailability?: TimeInterval;
  24092. sampleDuration?: number;
  24093. kmz?: boolean;
  24094. }): Promise<exportKmlResultKml | exportKmlResultKmz>;
  24095. /**
  24096. * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document.
  24097. * It can also be used to add additional files to the <code>externalFiles</code> object, which is the list of files embedded in the exported KMZ,
  24098. * or otherwise returned with the KML string when exporting.
  24099. * @param model - The ModelGraphics instance for an Entity.
  24100. * @param time - The time that any properties should use to get the value.
  24101. * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob.
  24102. */
  24103. export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string;
  24104. /**
  24105. * The data type of a pixel.
  24106. */
  24107. export enum PixelDatatype {
  24108. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  24109. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  24110. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  24111. FLOAT = WebGLConstants.FLOAT,
  24112. HALF_FLOAT = WebGLConstants.HALF_FLOAT_OES,
  24113. UNSIGNED_INT_24_8 = WebGLConstants.UNSIGNED_INT_24_8,
  24114. UNSIGNED_SHORT_4_4_4_4 = WebGLConstants.UNSIGNED_SHORT_4_4_4_4,
  24115. UNSIGNED_SHORT_5_5_5_1 = WebGLConstants.UNSIGNED_SHORT_5_5_5_1,
  24116. UNSIGNED_SHORT_5_6_5 = WebGLConstants.UNSIGNED_SHORT_5_6_5
  24117. }
  24118. /**
  24119. * Enumerates all possible filters used when magnifying WebGL textures.
  24120. */
  24121. export enum TextureMagnificationFilter {
  24122. /**
  24123. * Samples the texture by returning the closest pixel.
  24124. */
  24125. NEAREST = WebGLConstants.NEAREST,
  24126. /**
  24127. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  24128. */
  24129. LINEAR = WebGLConstants.LINEAR
  24130. }
  24131. /**
  24132. * Enumerates all possible filters used when minifying WebGL textures.
  24133. */
  24134. export enum TextureMinificationFilter {
  24135. /**
  24136. * Samples the texture by returning the closest pixel.
  24137. */
  24138. NEAREST = WebGLConstants.NEAREST,
  24139. /**
  24140. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  24141. */
  24142. LINEAR = WebGLConstants.LINEAR,
  24143. /**
  24144. * Selects the nearest mip level and applies nearest sampling within that level.
  24145. * <p>
  24146. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24147. * </p>
  24148. */
  24149. NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST,
  24150. /**
  24151. * Selects the nearest mip level and applies linear sampling within that level.
  24152. * <p>
  24153. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24154. * </p>
  24155. */
  24156. LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST,
  24157. /**
  24158. * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.
  24159. * <p>
  24160. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  24161. * </p>
  24162. * <p>
  24163. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24164. * </p>
  24165. */
  24166. NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR,
  24167. /**
  24168. * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.
  24169. * <p>
  24170. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  24171. * </p>
  24172. * <p>
  24173. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24174. * </p>
  24175. */
  24176. LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR
  24177. }
  24178. /**
  24179. * An appearance defines the full GLSL vertex and fragment shaders and the
  24180. * render state used to draw a {@link Primitive}. All appearances implement
  24181. * this base <code>Appearance</code> interface.
  24182. * @param [options] - Object with the following properties:
  24183. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.
  24184. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.
  24185. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  24186. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  24187. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  24188. * @param [options.renderState] - Optional render state to override the default render state.
  24189. */
  24190. export class Appearance {
  24191. constructor(options?: {
  24192. translucent?: boolean;
  24193. closed?: boolean;
  24194. material?: Material;
  24195. vertexShaderSource?: string;
  24196. fragmentShaderSource?: string;
  24197. renderState?: any;
  24198. });
  24199. /**
  24200. * The material used to determine the fragment color. Unlike other {@link Appearance}
  24201. * properties, this is not read-only, so an appearance's material can change on the fly.
  24202. */
  24203. material: Material;
  24204. /**
  24205. * When <code>true</code>, the geometry is expected to appear translucent.
  24206. */
  24207. translucent: boolean;
  24208. /**
  24209. * The GLSL source code for the vertex shader.
  24210. */
  24211. readonly vertexShaderSource: string;
  24212. /**
  24213. * The GLSL source code for the fragment shader. The full fragment shader
  24214. * source is built procedurally taking into account the {@link Appearance#material}.
  24215. * Use {@link Appearance#getFragmentShaderSource} to get the full source.
  24216. */
  24217. readonly fragmentShaderSource: string;
  24218. /**
  24219. * The WebGL fixed-function state to use when rendering the geometry.
  24220. */
  24221. readonly renderState: any;
  24222. /**
  24223. * When <code>true</code>, the geometry is expected to be closed.
  24224. */
  24225. readonly closed: boolean;
  24226. /**
  24227. * Procedurally creates the full GLSL fragment shader source for this appearance
  24228. * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.
  24229. * @returns The full GLSL fragment shader source.
  24230. */
  24231. getFragmentShaderSource(): string;
  24232. /**
  24233. * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.
  24234. * @returns <code>true</code> if the appearance is translucent.
  24235. */
  24236. isTranslucent(): boolean;
  24237. /**
  24238. * Creates a render state. This is not the final render state instance; instead,
  24239. * it can contain a subset of render state properties identical to the render state
  24240. * created in the context.
  24241. * @returns The render state.
  24242. */
  24243. getRenderState(): any;
  24244. }
  24245. export namespace ArcGisMapServerImageryProvider {
  24246. /**
  24247. * Initialization options for the ArcGisMapServerImageryProvider constructor
  24248. * @property url - The URL of the ArcGIS MapServer service.
  24249. * @property [token] - The ArcGIS token used to authenticate with the ArcGIS MapServer service.
  24250. * @property [tileDiscardPolicy] - The policy that determines if a tile
  24251. * is invalid and should be discarded. If this value is not specified, a default
  24252. * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a
  24253. * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case,
  24254. * we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200),
  24255. * (80,110), and (160, 130). If all of these pixels are transparent, the discard check is
  24256. * disabled and no tiles are discarded. If any of them have a non-transparent color, any
  24257. * tile that has the same values in these pixel locations is discarded. The end result of
  24258. * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure
  24259. * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this
  24260. * parameter.
  24261. * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached
  24262. * tiles are used if they are available. If false, any pre-cached tiles are ignored and the
  24263. * 'export' service is used.
  24264. * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown.
  24265. * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke
  24266. * the Identify service on the MapServer and return the features included in the response. If false,
  24267. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24268. * without communicating with the server. Set this property to false if you don't want this provider's features to
  24269. * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object.
  24270. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing
  24271. * a tiled layer.
  24272. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  24273. * This parameter is ignored when accessing a tiled server.
  24274. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified and used,
  24275. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  24276. * parameter is specified, the WGS84 ellipsoid is used.
  24277. * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.
  24278. * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24279. * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24280. * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing
  24281. * a tiled server.
  24282. */
  24283. type ConstructorOptions = {
  24284. url: Resource | string;
  24285. token?: string;
  24286. tileDiscardPolicy?: TileDiscardPolicy;
  24287. usePreCachedTilesIfAvailable?: boolean;
  24288. layers?: string;
  24289. enablePickFeatures?: boolean;
  24290. rectangle?: Rectangle;
  24291. tilingScheme?: TilingScheme;
  24292. ellipsoid?: Ellipsoid;
  24293. credit?: Credit | string;
  24294. tileWidth?: number;
  24295. tileHeight?: number;
  24296. maximumLevel?: number;
  24297. };
  24298. }
  24299. /**
  24300. * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
  24301. * used, if available.
  24302. * @example
  24303. * var esri = new Cesium.ArcGisMapServerImageryProvider({
  24304. * url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
  24305. * });
  24306. * @param options - Object describing initialization options
  24307. */
  24308. export class ArcGisMapServerImageryProvider {
  24309. constructor(options: ArcGisMapServerImageryProvider.ConstructorOptions);
  24310. /**
  24311. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  24312. * 1.0 representing fully opaque.
  24313. */
  24314. defaultAlpha: number | undefined;
  24315. /**
  24316. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  24317. * 1.0 representing fully opaque.
  24318. */
  24319. defaultNightAlpha: number | undefined;
  24320. /**
  24321. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  24322. * 1.0 representing fully opaque.
  24323. */
  24324. defaultDayAlpha: number | undefined;
  24325. /**
  24326. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  24327. * makes the imagery darker while greater than 1.0 makes it brighter.
  24328. */
  24329. defaultBrightness: number | undefined;
  24330. /**
  24331. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  24332. * the contrast while greater than 1.0 increases it.
  24333. */
  24334. defaultContrast: number | undefined;
  24335. /**
  24336. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  24337. */
  24338. defaultHue: number | undefined;
  24339. /**
  24340. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  24341. * saturation while greater than 1.0 increases it.
  24342. */
  24343. defaultSaturation: number | undefined;
  24344. /**
  24345. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  24346. */
  24347. defaultGamma: number | undefined;
  24348. /**
  24349. * The default texture minification filter to apply to this provider.
  24350. */
  24351. defaultMinificationFilter: TextureMinificationFilter;
  24352. /**
  24353. * The default texture magnification filter to apply to this provider.
  24354. */
  24355. defaultMagnificationFilter: TextureMagnificationFilter;
  24356. /**
  24357. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will
  24358. * invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false,
  24359. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24360. * without communicating with the server.
  24361. */
  24362. enablePickFeatures: boolean;
  24363. /**
  24364. * Gets the URL of the ArcGIS MapServer.
  24365. */
  24366. readonly url: string;
  24367. /**
  24368. * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service.
  24369. */
  24370. readonly token: string;
  24371. /**
  24372. * Gets the proxy used by this provider.
  24373. */
  24374. readonly proxy: Proxy;
  24375. /**
  24376. * Gets the width of each tile, in pixels. This function should
  24377. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24378. */
  24379. readonly tileWidth: number;
  24380. /**
  24381. * Gets the height of each tile, in pixels. This function should
  24382. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24383. */
  24384. readonly tileHeight: number;
  24385. /**
  24386. * Gets the maximum level-of-detail that can be requested. This function should
  24387. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24388. */
  24389. readonly maximumLevel: number | undefined;
  24390. /**
  24391. * Gets the minimum level-of-detail that can be requested. This function should
  24392. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24393. */
  24394. readonly minimumLevel: number;
  24395. /**
  24396. * Gets the tiling scheme used by this provider. This function should
  24397. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24398. */
  24399. readonly tilingScheme: TilingScheme;
  24400. /**
  24401. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  24402. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24403. */
  24404. readonly rectangle: Rectangle;
  24405. /**
  24406. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  24407. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  24408. * returns undefined, no tiles are filtered. This function should
  24409. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24410. */
  24411. readonly tileDiscardPolicy: TileDiscardPolicy;
  24412. /**
  24413. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  24414. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  24415. * are passed an instance of {@link TileProviderError}.
  24416. */
  24417. readonly errorEvent: Event;
  24418. /**
  24419. * Gets a value indicating whether or not the provider is ready for use.
  24420. */
  24421. readonly ready: boolean;
  24422. /**
  24423. * Gets a promise that resolves to true when the provider is ready for use.
  24424. */
  24425. readonly readyPromise: Promise<boolean>;
  24426. /**
  24427. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  24428. * the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24429. */
  24430. readonly credit: Credit;
  24431. /**
  24432. * Gets a value indicating whether this imagery provider is using pre-cached tiles from the
  24433. * ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function
  24434. * will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does
  24435. * not have pre-cached tiles.
  24436. */
  24437. readonly usingPrecachedTiles: boolean;
  24438. /**
  24439. * Gets a value indicating whether or not the images provided by this imagery provider
  24440. * include an alpha channel. If this property is false, an alpha channel, if present, will
  24441. * be ignored. If this property is true, any images without an alpha channel will be treated
  24442. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  24443. * and texture upload time are reduced.
  24444. */
  24445. readonly hasAlphaChannel: boolean;
  24446. /**
  24447. * Gets the comma-separated list of layer IDs to show.
  24448. */
  24449. layers: string;
  24450. /**
  24451. * Gets the credits to be displayed when a given tile is displayed.
  24452. * @param x - The tile X coordinate.
  24453. * @param y - The tile Y coordinate.
  24454. * @param level - The tile level;
  24455. * @returns The credits to be displayed when the tile is displayed.
  24456. */
  24457. getTileCredits(x: number, y: number, level: number): Credit[];
  24458. /**
  24459. * Requests the image for a given tile. This function should
  24460. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24461. * @param x - The tile X coordinate.
  24462. * @param y - The tile Y coordinate.
  24463. * @param level - The tile level.
  24464. * @param [request] - The request object. Intended for internal use only.
  24465. * @returns A promise for the image that will resolve when the image is available, or
  24466. * undefined if there are too many active requests to the server, and the request
  24467. * should be retried later. The resolved image may be either an
  24468. * Image or a Canvas DOM object.
  24469. */
  24470. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  24471. /**
  24472. * /**
  24473. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  24474. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  24475. * @param x - The tile X coordinate.
  24476. * @param y - The tile Y coordinate.
  24477. * @param level - The tile level.
  24478. * @param longitude - The longitude at which to pick features.
  24479. * @param latitude - The latitude at which to pick features.
  24480. * @returns A promise for the picked features that will resolve when the asynchronous
  24481. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  24482. * instances. The array may be empty if no features are found at the given location.
  24483. */
  24484. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  24485. }
  24486. /**
  24487. * An enum describing the x, y, and z axes and helper conversion functions.
  24488. */
  24489. export enum Axis {
  24490. /**
  24491. * Denotes the x-axis.
  24492. */
  24493. X = 0,
  24494. /**
  24495. * Denotes the y-axis.
  24496. */
  24497. Y = 1,
  24498. /**
  24499. * Denotes the z-axis.
  24500. */
  24501. Z = 2
  24502. }
  24503. /**
  24504. * A viewport-aligned image positioned in the 3D scene, that is created
  24505. * and rendered using a {@link BillboardCollection}. A billboard is created and its initial
  24506. * properties are set by calling {@link BillboardCollection#add}.
  24507. * <br /><br />
  24508. * <div align='center'>
  24509. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  24510. * Example billboards
  24511. * </div>
  24512. */
  24513. export class Billboard {
  24514. constructor();
  24515. /**
  24516. * Determines if this billboard will be shown. Use this to hide or show a billboard, instead
  24517. * of removing it and re-adding it to the collection.
  24518. */
  24519. show: boolean;
  24520. /**
  24521. * Gets or sets the Cartesian position of this billboard.
  24522. */
  24523. position: Cartesian3;
  24524. /**
  24525. * Gets or sets the height reference of this billboard.
  24526. */
  24527. heightReference: HeightReference;
  24528. /**
  24529. * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used
  24530. * to align multiple billboards and labels at the same position, e.g., an image and text. The
  24531. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  24532. * left to right, and <code>y</code> increases from top to bottom.
  24533. * <br /><br />
  24534. * <div align='center'>
  24535. * <table border='0' cellpadding='5'><tr>
  24536. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  24537. * <td align='center'><code>b.pixeloffset = new Cartesian2(50, 25);</code><br/><img src='Images/Billboard.setPixelOffset.x50y-25.png' width='250' height='188' /></td>
  24538. * </tr></table>
  24539. * The billboard's origin is indicated by the yellow point.
  24540. * </div>
  24541. */
  24542. pixelOffset: Cartesian2;
  24543. /**
  24544. * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.
  24545. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  24546. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24547. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24548. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined,
  24549. * scaleByDistance will be disabled.
  24550. * @example
  24551. * // Example 1.
  24552. * // Set a billboard's scaleByDistance to scale by 1.5 when the
  24553. * // camera is 1500 meters from the billboard and disappear as
  24554. * // the camera distance approaches 8.0e6 meters.
  24555. * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  24556. * @example
  24557. * // Example 2.
  24558. * // disable scaling by distance
  24559. * b.scaleByDistance = undefined;
  24560. */
  24561. scaleByDistance: NearFarScalar;
  24562. /**
  24563. * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.
  24564. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  24565. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24566. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24567. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined,
  24568. * translucencyByDistance will be disabled.
  24569. * @example
  24570. * // Example 1.
  24571. * // Set a billboard's translucency to 1.0 when the
  24572. * // camera is 1500 meters from the billboard and disappear as
  24573. * // the camera distance approaches 8.0e6 meters.
  24574. * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  24575. * @example
  24576. * // Example 2.
  24577. * // disable translucency by distance
  24578. * b.translucencyByDistance = undefined;
  24579. */
  24580. translucencyByDistance: NearFarScalar;
  24581. /**
  24582. * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.
  24583. * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  24584. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  24585. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  24586. * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined,
  24587. * pixelOffsetScaleByDistance will be disabled.
  24588. * @example
  24589. * // Example 1.
  24590. * // Set a billboard's pixel offset scale to 0.0 when the
  24591. * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels
  24592. * // in the y direction the camera distance approaches 8.0e6 meters.
  24593. * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  24594. * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  24595. * @example
  24596. * // Example 2.
  24597. * // disable pixel offset by distance
  24598. * b.pixelOffsetScaleByDistance = undefined;
  24599. */
  24600. pixelOffsetScaleByDistance: NearFarScalar;
  24601. /**
  24602. * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed
  24603. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  24604. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  24605. * which is typically meters.
  24606. * <br /><br />
  24607. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  24608. * arrange a billboard above its corresponding 3D model.
  24609. * <br /><br />
  24610. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  24611. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  24612. * <br /><br />
  24613. * <div align='center'>
  24614. * <table border='0' cellpadding='5'><tr>
  24615. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  24616. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  24617. * </tr></table>
  24618. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  24619. * </div>
  24620. */
  24621. eyeOffset: Cartesian3;
  24622. /**
  24623. * Gets or sets the horizontal origin of this billboard, which determines if the billboard is
  24624. * to the left, center, or right of its anchor position.
  24625. * <br /><br />
  24626. * <div align='center'>
  24627. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  24628. * </div>
  24629. * @example
  24630. * // Use a bottom, left origin
  24631. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  24632. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  24633. */
  24634. horizontalOrigin: HorizontalOrigin;
  24635. /**
  24636. * Gets or sets the vertical origin of this billboard, which determines if the billboard is
  24637. * to the above, below, or at the center of its anchor position.
  24638. * <br /><br />
  24639. * <div align='center'>
  24640. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  24641. * </div>
  24642. * @example
  24643. * // Use a bottom, left origin
  24644. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  24645. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  24646. */
  24647. verticalOrigin: VerticalOrigin;
  24648. /**
  24649. * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.
  24650. * A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than
  24651. * <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks
  24652. * the billboard.
  24653. * <br /><br />
  24654. * <div align='center'>
  24655. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  24656. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  24657. * and <code>2.0</code>.
  24658. * </div>
  24659. */
  24660. scale: number;
  24661. /**
  24662. * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First,
  24663. * the same white texture may be used by many different billboards, each with a different color, to create
  24664. * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below.
  24665. * An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.
  24666. * <br /><br />
  24667. * <div align='center'>
  24668. * <table border='0' cellpadding='5'><tr>
  24669. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  24670. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  24671. * </tr></table>
  24672. * </div>
  24673. * <br />
  24674. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  24675. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  24676. * (no intensity) to <code>1.0</code> (full intensity).
  24677. * @example
  24678. * // Example 1. Assign yellow.
  24679. * b.color = Cesium.Color.YELLOW;
  24680. * @example
  24681. * // Example 2. Make a billboard 50% translucent.
  24682. * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  24683. */
  24684. color: Color;
  24685. /**
  24686. * Gets or sets the rotation angle in radians.
  24687. */
  24688. rotation: number;
  24689. /**
  24690. * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.
  24691. * The default is the zero vector, which means the billboard is aligned to the screen up vector.
  24692. * @example
  24693. * // Example 1.
  24694. * // Have the billboard up vector point north
  24695. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  24696. * @example
  24697. * // Example 2.
  24698. * // Have the billboard point east.
  24699. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  24700. * billboard.rotation = -Cesium.Math.PI_OVER_TWO;
  24701. * @example
  24702. * // Example 3.
  24703. * // Reset the aligned axis
  24704. * billboard.alignedAxis = Cesium.Cartesian3.ZERO;
  24705. */
  24706. alignedAxis: Cartesian3;
  24707. /**
  24708. * Gets or sets a width for the billboard. If undefined, the image width will be used.
  24709. */
  24710. width: number;
  24711. /**
  24712. * Gets or sets a height for the billboard. If undefined, the image height will be used.
  24713. */
  24714. height: number;
  24715. /**
  24716. * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;
  24717. * otherwise, the size is in pixels.
  24718. */
  24719. sizeInMeters: boolean;
  24720. /**
  24721. * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.
  24722. */
  24723. distanceDisplayCondition: DistanceDisplayCondition;
  24724. /**
  24725. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  24726. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  24727. */
  24728. disableDepthTestDistance: number;
  24729. /**
  24730. * Gets or sets the user-defined object returned when the billboard is picked.
  24731. */
  24732. id: any;
  24733. /**
  24734. * <p>
  24735. * Gets or sets the image to be used for this billboard. If a texture has already been created for the
  24736. * given image, the existing texture is used.
  24737. * </p>
  24738. * <p>
  24739. * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,
  24740. * a canvas, or another billboard's image property (from the same billboard collection).
  24741. * </p>
  24742. * @example
  24743. * // load an image from a URL
  24744. * b.image = 'some/image/url.png';
  24745. *
  24746. * // assuming b1 and b2 are billboards in the same billboard collection,
  24747. * // use the same image for both billboards.
  24748. * b2.image = b1.image;
  24749. */
  24750. image: string;
  24751. /**
  24752. * When <code>true</code>, this billboard is ready to render, i.e., the image
  24753. * has been downloaded and the WebGL resources are created.
  24754. */
  24755. readonly ready: boolean;
  24756. /**
  24757. * <p>
  24758. * Sets the image to be used for this billboard. If a texture has already been created for the
  24759. * given id, the existing texture is used.
  24760. * </p>
  24761. * <p>
  24762. * This function is useful for dynamically creating textures that are shared across many billboards.
  24763. * Only the first billboard will actually call the function and create the texture, while subsequent
  24764. * billboards created with the same id will simply re-use the existing texture.
  24765. * </p>
  24766. * <p>
  24767. * To load an image from a URL, setting the {@link Billboard#image} property is more convenient.
  24768. * </p>
  24769. * @example
  24770. * // create a billboard image dynamically
  24771. * function drawImage(id) {
  24772. * // create and draw an image using a canvas
  24773. * var canvas = document.createElement('canvas');
  24774. * var context2D = canvas.getContext('2d');
  24775. * // ... draw image
  24776. * return canvas;
  24777. * }
  24778. * // drawImage will be called to create the texture
  24779. * b.setImage('myImage', drawImage);
  24780. *
  24781. * // subsequent billboards created in the same collection using the same id will use the existing
  24782. * // texture, without the need to create the canvas or draw the image
  24783. * b2.setImage('myImage', drawImage);
  24784. * @param id - The id of the image. This can be any string that uniquely identifies the image.
  24785. * @param image - The image to load. This parameter
  24786. * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,
  24787. * or a function which will be called to create the image if it hasn't been loaded already.
  24788. */
  24789. setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void;
  24790. /**
  24791. * Uses a sub-region of the image with the given id as the image for this billboard,
  24792. * measured in pixels from the bottom-left.
  24793. * @param id - The id of the image to use.
  24794. * @param subRegion - The sub-region of the image.
  24795. */
  24796. setImageSubRegion(id: string, subRegion: BoundingRectangle): void;
  24797. /**
  24798. * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.
  24799. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  24800. * left to right, and <code>y</code> increases from top to bottom.
  24801. * @example
  24802. * console.log(b.computeScreenSpacePosition(scene).toString());
  24803. * @param scene - The scene.
  24804. * @param [result] - The object onto which to store the result.
  24805. * @returns The screen-space position of the billboard.
  24806. */
  24807. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  24808. /**
  24809. * Determines if this billboard equals another billboard. Billboards are equal if all their properties
  24810. * are equal. Billboards in different collections can be equal.
  24811. * @param other - The billboard to compare for equality.
  24812. * @returns <code>true</code> if the billboards are equal; otherwise, <code>false</code>.
  24813. */
  24814. equals(other: Billboard): boolean;
  24815. }
  24816. export namespace Billboard {
  24817. /**
  24818. * A function that creates an image.
  24819. * @param id - The identifier of the image to load.
  24820. */
  24821. type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise<HTMLImageElement | HTMLCanvasElement>;
  24822. }
  24823. /**
  24824. * A renderable collection of billboards. Billboards are viewport-aligned
  24825. * images positioned in the 3D scene.
  24826. * <br /><br />
  24827. * <div align='center'>
  24828. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  24829. * Example billboards
  24830. * </div>
  24831. * <br /><br />
  24832. * Billboards are added and removed from the collection using {@link BillboardCollection#add}
  24833. * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures
  24834. * for images with the same identifier.
  24835. * @example
  24836. * // Create a billboard collection with two billboards
  24837. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  24838. * billboards.add({
  24839. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  24840. * image : 'url/to/image'
  24841. * });
  24842. * billboards.add({
  24843. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  24844. * image : 'url/to/another/image'
  24845. * });
  24846. * @param [options] - Object with the following properties:
  24847. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates.
  24848. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  24849. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
  24850. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default
  24851. * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,
  24852. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  24853. * @param [options.show = true] - Determines if the billboards in the collection will be shown.
  24854. */
  24855. export class BillboardCollection {
  24856. constructor(options?: {
  24857. modelMatrix?: Matrix4;
  24858. debugShowBoundingVolume?: boolean;
  24859. scene?: Scene;
  24860. blendOption?: BlendOption;
  24861. show?: boolean;
  24862. });
  24863. /**
  24864. * Determines if billboards in this collection will be shown.
  24865. */
  24866. show: boolean;
  24867. /**
  24868. * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.
  24869. * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  24870. * Local reference frames can be used by providing a different transformation matrix, like that returned
  24871. * by {@link Transforms.eastNorthUpToFixedFrame}.
  24872. * @example
  24873. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  24874. * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  24875. * billboards.add({
  24876. * image : 'url/to/image',
  24877. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  24878. * });
  24879. * billboards.add({
  24880. * image : 'url/to/image',
  24881. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  24882. * });
  24883. * billboards.add({
  24884. * image : 'url/to/image',
  24885. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  24886. * });
  24887. * billboards.add({
  24888. * image : 'url/to/image',
  24889. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  24890. * });
  24891. */
  24892. modelMatrix: Matrix4;
  24893. /**
  24894. * This property is for debugging only; it is not for production use nor is it optimized.
  24895. * <p>
  24896. * Draws the bounding sphere for each draw command in the primitive.
  24897. * </p>
  24898. */
  24899. debugShowBoundingVolume: boolean;
  24900. /**
  24901. * This property is for debugging only; it is not for production use nor is it optimized.
  24902. * <p>
  24903. * Draws the texture atlas for this BillboardCollection as a fullscreen quad.
  24904. * </p>
  24905. */
  24906. debugShowTextureAtlas: boolean;
  24907. /**
  24908. * The billboard blending option. The default is used for rendering both opaque and translucent billboards.
  24909. * However, if either all of the billboards are completely opaque or all are completely translucent,
  24910. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  24911. * performance by up to 2x.
  24912. */
  24913. blendOption: BlendOption;
  24914. /**
  24915. * Returns the number of billboards in this collection. This is commonly used with
  24916. * {@link BillboardCollection#get} to iterate over all the billboards
  24917. * in the collection.
  24918. */
  24919. length: number;
  24920. /**
  24921. * Creates and adds a billboard with the specified initial properties to the collection.
  24922. * The added billboard is returned so it can be modified or removed from the collection later.
  24923. * @example
  24924. * // Example 1: Add a billboard, specifying all the default values.
  24925. * var b = billboards.add({
  24926. * show : true,
  24927. * position : Cesium.Cartesian3.ZERO,
  24928. * pixelOffset : Cesium.Cartesian2.ZERO,
  24929. * eyeOffset : Cesium.Cartesian3.ZERO,
  24930. * heightReference : Cesium.HeightReference.NONE,
  24931. * horizontalOrigin : Cesium.HorizontalOrigin.CENTER,
  24932. * verticalOrigin : Cesium.VerticalOrigin.CENTER,
  24933. * scale : 1.0,
  24934. * image : 'url/to/image',
  24935. * imageSubRegion : undefined,
  24936. * color : Cesium.Color.WHITE,
  24937. * id : undefined,
  24938. * rotation : 0.0,
  24939. * alignedAxis : Cesium.Cartesian3.ZERO,
  24940. * width : undefined,
  24941. * height : undefined,
  24942. * scaleByDistance : undefined,
  24943. * translucencyByDistance : undefined,
  24944. * pixelOffsetScaleByDistance : undefined,
  24945. * sizeInMeters : false,
  24946. * distanceDisplayCondition : undefined
  24947. * });
  24948. * @example
  24949. * // Example 2: Specify only the billboard's cartographic position.
  24950. * var b = billboards.add({
  24951. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  24952. * });
  24953. * @param [options] - A template describing the billboard's properties as shown in Example 1.
  24954. * @returns The billboard that was added to the collection.
  24955. */
  24956. add(options?: any): Billboard;
  24957. /**
  24958. * Removes a billboard from the collection.
  24959. * @example
  24960. * var b = billboards.add(...);
  24961. * billboards.remove(b); // Returns true
  24962. * @param billboard - The billboard to remove.
  24963. * @returns <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.
  24964. */
  24965. remove(billboard: Billboard): boolean;
  24966. /**
  24967. * Removes all billboards from the collection.
  24968. * @example
  24969. * billboards.add(...);
  24970. * billboards.add(...);
  24971. * billboards.removeAll();
  24972. */
  24973. removeAll(): void;
  24974. /**
  24975. * Check whether this collection contains a given billboard.
  24976. * @param [billboard] - The billboard to check for.
  24977. * @returns true if this collection contains the billboard, false otherwise.
  24978. */
  24979. contains(billboard?: Billboard): boolean;
  24980. /**
  24981. * Returns the billboard in the collection at the specified index. Indices are zero-based
  24982. * and increase as billboards are added. Removing a billboard shifts all billboards after
  24983. * it to the left, changing their indices. This function is commonly used with
  24984. * {@link BillboardCollection#length} to iterate over all the billboards
  24985. * in the collection.
  24986. * @example
  24987. * // Toggle the show property of every billboard in the collection
  24988. * var len = billboards.length;
  24989. * for (var i = 0; i < len; ++i) {
  24990. * var b = billboards.get(i);
  24991. * b.show = !b.show;
  24992. * }
  24993. * @param index - The zero-based index of the billboard.
  24994. * @returns The billboard at the specified index.
  24995. */
  24996. get(index: number): Billboard;
  24997. /**
  24998. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  24999. * get the draw commands needed to render this primitive.
  25000. * <p>
  25001. * Do not call this function directly. This is documented just to
  25002. * list the exceptions that may be propagated when the scene is rendered:
  25003. * </p>
  25004. */
  25005. update(): void;
  25006. /**
  25007. * Returns true if this object was destroyed; otherwise, false.
  25008. * <br /><br />
  25009. * If this object was destroyed, it should not be used; calling any function other than
  25010. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  25011. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  25012. */
  25013. isDestroyed(): boolean;
  25014. /**
  25015. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  25016. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  25017. * <br /><br />
  25018. * Once an object is destroyed, it should not be used; calling any function other than
  25019. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  25020. * assign the return value (<code>undefined</code>) to the object as done in the example.
  25021. * @example
  25022. * billboards = billboards && billboards.destroy();
  25023. */
  25024. destroy(): void;
  25025. }
  25026. export namespace BingMapsImageryProvider {
  25027. /**
  25028. * Initialization options for the BingMapsImageryProvider constructor
  25029. * @property url - The url of the Bing Maps server hosting the imagery.
  25030. * @property key - The Bing Maps key for your application, which can be
  25031. * created at {@link https://www.bingmapsportal.com/}.
  25032. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'.
  25033. * By default, tiles are loaded using the same protocol as the page.
  25034. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load.
  25035. * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not
  25036. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  25037. * for information on the supported cultures.
  25038. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  25039. * @property [tileDiscardPolicy] - The policy that determines if a tile
  25040. * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy}
  25041. * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.
  25042. * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.
  25043. */
  25044. type ConstructorOptions = {
  25045. url: Resource | string;
  25046. key: string;
  25047. tileProtocol?: string;
  25048. mapStyle?: BingMapsStyle;
  25049. culture?: string;
  25050. ellipsoid?: Ellipsoid;
  25051. tileDiscardPolicy?: TileDiscardPolicy;
  25052. };
  25053. }
  25054. /**
  25055. * Provides tiled imagery using the Bing Maps Imagery REST API.
  25056. * @example
  25057. * var bing = new Cesium.BingMapsImageryProvider({
  25058. * url : 'https://dev.virtualearth.net',
  25059. * key : 'get-yours-at-https://www.bingmapsportal.com/',
  25060. * mapStyle : Cesium.BingMapsStyle.AERIAL
  25061. * });
  25062. * @param options - Object describing initialization options
  25063. */
  25064. export class BingMapsImageryProvider {
  25065. constructor(options: BingMapsImageryProvider.ConstructorOptions);
  25066. /**
  25067. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  25068. * 1.0 representing fully opaque.
  25069. */
  25070. defaultAlpha: number | undefined;
  25071. /**
  25072. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  25073. * 1.0 representing fully opaque.
  25074. */
  25075. defaultNightAlpha: number | undefined;
  25076. /**
  25077. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  25078. * 1.0 representing fully opaque.
  25079. */
  25080. defaultDayAlpha: number | undefined;
  25081. /**
  25082. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  25083. * makes the imagery darker while greater than 1.0 makes it brighter.
  25084. */
  25085. defaultBrightness: number | undefined;
  25086. /**
  25087. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  25088. * the contrast while greater than 1.0 increases it.
  25089. */
  25090. defaultContrast: number | undefined;
  25091. /**
  25092. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  25093. */
  25094. defaultHue: number | undefined;
  25095. /**
  25096. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  25097. * saturation while greater than 1.0 increases it.
  25098. */
  25099. defaultSaturation: number | undefined;
  25100. /**
  25101. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  25102. */
  25103. defaultGamma: number | undefined;
  25104. /**
  25105. * The default texture minification filter to apply to this provider.
  25106. */
  25107. defaultMinificationFilter: TextureMinificationFilter;
  25108. /**
  25109. * The default texture magnification filter to apply to this provider.
  25110. */
  25111. defaultMagnificationFilter: TextureMagnificationFilter;
  25112. /**
  25113. * Gets the name of the BingMaps server url hosting the imagery.
  25114. */
  25115. readonly url: string;
  25116. /**
  25117. * Gets the proxy used by this provider.
  25118. */
  25119. readonly proxy: Proxy;
  25120. /**
  25121. * Gets the Bing Maps key.
  25122. */
  25123. readonly key: string;
  25124. /**
  25125. * Gets the type of Bing Maps imagery to load.
  25126. */
  25127. readonly mapStyle: BingMapsStyle;
  25128. /**
  25129. * The culture to use when requesting Bing Maps imagery. Not
  25130. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  25131. * for information on the supported cultures.
  25132. */
  25133. readonly culture: string;
  25134. /**
  25135. * Gets the width of each tile, in pixels. This function should
  25136. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25137. */
  25138. readonly tileWidth: number;
  25139. /**
  25140. * Gets the height of each tile, in pixels. This function should
  25141. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25142. */
  25143. readonly tileHeight: number;
  25144. /**
  25145. * Gets the maximum level-of-detail that can be requested. This function should
  25146. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25147. */
  25148. readonly maximumLevel: number | undefined;
  25149. /**
  25150. * Gets the minimum level-of-detail that can be requested. This function should
  25151. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25152. */
  25153. readonly minimumLevel: number;
  25154. /**
  25155. * Gets the tiling scheme used by this provider. This function should
  25156. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25157. */
  25158. readonly tilingScheme: TilingScheme;
  25159. /**
  25160. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  25161. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25162. */
  25163. readonly rectangle: Rectangle;
  25164. /**
  25165. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  25166. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  25167. * returns undefined, no tiles are filtered. This function should
  25168. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25169. */
  25170. readonly tileDiscardPolicy: TileDiscardPolicy;
  25171. /**
  25172. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  25173. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  25174. * are passed an instance of {@link TileProviderError}.
  25175. */
  25176. readonly errorEvent: Event;
  25177. /**
  25178. * Gets a value indicating whether or not the provider is ready for use.
  25179. */
  25180. readonly ready: boolean;
  25181. /**
  25182. * Gets a promise that resolves to true when the provider is ready for use.
  25183. */
  25184. readonly readyPromise: Promise<boolean>;
  25185. /**
  25186. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  25187. * the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true.
  25188. */
  25189. readonly credit: Credit;
  25190. /**
  25191. * Gets a value indicating whether or not the images provided by this imagery provider
  25192. * include an alpha channel. If this property is false, an alpha channel, if present, will
  25193. * be ignored. If this property is true, any images without an alpha channel will be treated
  25194. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  25195. * and texture upload time.
  25196. */
  25197. readonly hasAlphaChannel: boolean;
  25198. /**
  25199. * Gets the credits to be displayed when a given tile is displayed.
  25200. * @param x - The tile X coordinate.
  25201. * @param y - The tile Y coordinate.
  25202. * @param level - The tile level;
  25203. * @returns The credits to be displayed when the tile is displayed.
  25204. */
  25205. getTileCredits(x: number, y: number, level: number): Credit[];
  25206. /**
  25207. * Requests the image for a given tile. This function should
  25208. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25209. * @param x - The tile X coordinate.
  25210. * @param y - The tile Y coordinate.
  25211. * @param level - The tile level.
  25212. * @param [request] - The request object. Intended for internal use only.
  25213. * @returns A promise for the image that will resolve when the image is available, or
  25214. * undefined if there are too many active requests to the server, and the request
  25215. * should be retried later. The resolved image may be either an
  25216. * Image or a Canvas DOM object.
  25217. */
  25218. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  25219. /**
  25220. * Picking features is not currently supported by this imagery provider, so this function simply returns
  25221. * undefined.
  25222. * @param x - The tile X coordinate.
  25223. * @param y - The tile Y coordinate.
  25224. * @param level - The tile level.
  25225. * @param longitude - The longitude at which to pick features.
  25226. * @param latitude - The latitude at which to pick features.
  25227. * @returns A promise for the picked features that will resolve when the asynchronous
  25228. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  25229. * instances. The array may be empty if no features are found at the given location.
  25230. * It may also be undefined if picking is not supported.
  25231. */
  25232. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  25233. /**
  25234. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  25235. * from a Bing Maps server.
  25236. * @param x - The tile's x coordinate.
  25237. * @param y - The tile's y coordinate.
  25238. * @param level - The tile's zoom level.
  25239. */
  25240. static tileXYToQuadKey(x: number, y: number, level: number): void;
  25241. /**
  25242. * Converts a tile's quadkey used to request an image from a Bing Maps server into the
  25243. * (x, y, level) position.
  25244. * @param quadkey - The tile's quad key
  25245. */
  25246. static quadKeyToTileXY(quadkey: string): void;
  25247. /**
  25248. * Gets or sets the URL to the Bing logo for display in the credit.
  25249. */
  25250. static logoUrl: string;
  25251. }
  25252. /**
  25253. * The types of imagery provided by Bing Maps.
  25254. */
  25255. export enum BingMapsStyle {
  25256. /**
  25257. * Aerial imagery.
  25258. */
  25259. AERIAL = "Aerial",
  25260. /**
  25261. * Aerial imagery with a road overlay.
  25262. */
  25263. AERIAL_WITH_LABELS = "AerialWithLabels",
  25264. /**
  25265. * Aerial imagery with a road overlay.
  25266. */
  25267. AERIAL_WITH_LABELS_ON_DEMAND = "AerialWithLabelsOnDemand",
  25268. /**
  25269. * Roads without additional imagery.
  25270. */
  25271. ROAD = "Road",
  25272. /**
  25273. * Roads without additional imagery.
  25274. */
  25275. ROAD_ON_DEMAND = "RoadOnDemand",
  25276. /**
  25277. * A dark version of the road maps.
  25278. */
  25279. CANVAS_DARK = "CanvasDark",
  25280. /**
  25281. * A lighter version of the road maps.
  25282. */
  25283. CANVAS_LIGHT = "CanvasLight",
  25284. /**
  25285. * A grayscale version of the road maps.
  25286. */
  25287. CANVAS_GRAY = "CanvasGray",
  25288. /**
  25289. * Ordnance Survey imagery. This imagery is visible only for the London, UK area.
  25290. */
  25291. ORDNANCE_SURVEY = "OrdnanceSurvey",
  25292. /**
  25293. * Collins Bart imagery.
  25294. */
  25295. COLLINS_BART = "CollinsBart"
  25296. }
  25297. /**
  25298. * Determines how two pixels' values are combined.
  25299. */
  25300. export enum BlendEquation {
  25301. /**
  25302. * Pixel values are added componentwise. This is used in additive blending for translucency.
  25303. */
  25304. ADD = WebGLConstants.FUNC_ADD,
  25305. /**
  25306. * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.
  25307. */
  25308. SUBTRACT = WebGLConstants.FUNC_SUBTRACT,
  25309. /**
  25310. * Pixel values are subtracted componentwise (destination - source).
  25311. */
  25312. REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT,
  25313. /**
  25314. * Pixel values are given to the minimum function (min(source, destination)).
  25315. *
  25316. * This equation operates on each pixel color component.
  25317. */
  25318. MIN = WebGLConstants.MIN,
  25319. /**
  25320. * Pixel values are given to the maximum function (max(source, destination)).
  25321. *
  25322. * This equation operates on each pixel color component.
  25323. */
  25324. MAX = WebGLConstants.MAX
  25325. }
  25326. /**
  25327. * Determines how blending factors are computed.
  25328. */
  25329. export enum BlendFunction {
  25330. /**
  25331. * The blend factor is zero.
  25332. */
  25333. ZERO = WebGLConstants.ZERO,
  25334. /**
  25335. * The blend factor is one.
  25336. */
  25337. ONE = WebGLConstants.ONE,
  25338. /**
  25339. * The blend factor is the source color.
  25340. */
  25341. SOURCE_COLOR = WebGLConstants.SRC_COLOR,
  25342. /**
  25343. * The blend factor is one minus the source color.
  25344. */
  25345. ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR,
  25346. /**
  25347. * The blend factor is the destination color.
  25348. */
  25349. DESTINATION_COLOR = WebGLConstants.DST_COLOR,
  25350. /**
  25351. * The blend factor is one minus the destination color.
  25352. */
  25353. ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR,
  25354. /**
  25355. * The blend factor is the source alpha.
  25356. */
  25357. SOURCE_ALPHA = WebGLConstants.SRC_ALPHA,
  25358. /**
  25359. * The blend factor is one minus the source alpha.
  25360. */
  25361. ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA,
  25362. /**
  25363. * The blend factor is the destination alpha.
  25364. */
  25365. DESTINATION_ALPHA = WebGLConstants.DST_ALPHA,
  25366. /**
  25367. * The blend factor is one minus the destination alpha.
  25368. */
  25369. ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA,
  25370. /**
  25371. * The blend factor is the constant color.
  25372. */
  25373. CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR,
  25374. /**
  25375. * The blend factor is one minus the constant color.
  25376. */
  25377. ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR,
  25378. /**
  25379. * The blend factor is the constant alpha.
  25380. */
  25381. CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA,
  25382. /**
  25383. * The blend factor is one minus the constant alpha.
  25384. */
  25385. ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,
  25386. /**
  25387. * The blend factor is the saturated source alpha.
  25388. */
  25389. SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE
  25390. }
  25391. /**
  25392. * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.
  25393. */
  25394. export enum BlendOption {
  25395. /**
  25396. * The billboards, points, or labels in the collection are completely opaque.
  25397. */
  25398. OPAQUE = 0,
  25399. /**
  25400. * The billboards, points, or labels in the collection are completely translucent.
  25401. */
  25402. TRANSLUCENT = 1,
  25403. /**
  25404. * The billboards, points, or labels in the collection are both opaque and translucent.
  25405. */
  25406. OPAQUE_AND_TRANSLUCENT = 2
  25407. }
  25408. /**
  25409. * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the
  25410. * <code>enabled</code> flag to define the full blending state for combining source and
  25411. * destination fragments when rendering.
  25412. * <p>
  25413. * This is a helper when using custom render states with {@link Appearance#renderState}.
  25414. * </p>
  25415. */
  25416. export namespace BlendingState {
  25417. /**
  25418. * Blending is disabled.
  25419. */
  25420. const DISABLED: any;
  25421. /**
  25422. * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.
  25423. */
  25424. const ALPHA_BLEND: any;
  25425. /**
  25426. * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.
  25427. */
  25428. const PRE_MULTIPLIED_ALPHA_BLEND: any;
  25429. /**
  25430. * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.
  25431. */
  25432. const ADDITIVE_BLEND: any;
  25433. }
  25434. /**
  25435. * A ParticleEmitter that emits particles within a box.
  25436. * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box.
  25437. * @param dimensions - The width, height and depth dimensions of the box.
  25438. */
  25439. export class BoxEmitter {
  25440. constructor(dimensions: Cartesian3);
  25441. /**
  25442. * The width, height and depth dimensions of the box in meters.
  25443. */
  25444. dimensions: Cartesian3;
  25445. }
  25446. /**
  25447. * The camera is defined by a position, orientation, and view frustum.
  25448. * <br /><br />
  25449. * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
  25450. * <br /><br />
  25451. * The viewing frustum is defined by 6 planes.
  25452. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  25453. * define the unit vector normal to the plane, and the w component is the distance of the
  25454. * plane from the origin/camera position.
  25455. * @example
  25456. * // Create a camera looking down the negative z-axis, positioned at the origin,
  25457. * // with a field of view of 60 degrees, and 1:1 aspect ratio.
  25458. * var camera = new Cesium.Camera(scene);
  25459. * camera.position = new Cesium.Cartesian3();
  25460. * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
  25461. * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
  25462. * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
  25463. * camera.frustum.near = 1.0;
  25464. * camera.frustum.far = 2.0;
  25465. * @param scene - The scene.
  25466. */
  25467. export class Camera {
  25468. constructor(scene: Scene);
  25469. /**
  25470. * The position of the camera.
  25471. */
  25472. position: Cartesian3;
  25473. /**
  25474. * The view direction of the camera.
  25475. */
  25476. direction: Cartesian3;
  25477. /**
  25478. * The up direction of the camera.
  25479. */
  25480. up: Cartesian3;
  25481. /**
  25482. * The right direction of the camera.
  25483. */
  25484. right: Cartesian3;
  25485. /**
  25486. * The region of space in view.
  25487. */
  25488. frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum;
  25489. /**
  25490. * The default amount to move the camera when an argument is not
  25491. * provided to the move methods.
  25492. */
  25493. defaultMoveAmount: number;
  25494. /**
  25495. * The default amount to rotate the camera when an argument is not
  25496. * provided to the look methods.
  25497. */
  25498. defaultLookAmount: number;
  25499. /**
  25500. * The default amount to rotate the camera when an argument is not
  25501. * provided to the rotate methods.
  25502. */
  25503. defaultRotateAmount: number;
  25504. /**
  25505. * The default amount to move the camera when an argument is not
  25506. * provided to the zoom methods.
  25507. */
  25508. defaultZoomAmount: number;
  25509. /**
  25510. * If set, the camera will not be able to rotate past this axis in either direction.
  25511. */
  25512. constrainedAxis: Cartesian3;
  25513. /**
  25514. * The factor multiplied by the the map size used to determine where to clamp the camera position
  25515. * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
  25516. */
  25517. maximumZoomFactor: number;
  25518. /**
  25519. * The amount the camera has to change before the <code>changed</code> event is raised. The value is a percentage in the [0, 1] range.
  25520. */
  25521. percentageChanged: number;
  25522. /**
  25523. * The default rectangle the camera will view on creation.
  25524. */
  25525. static DEFAULT_VIEW_RECTANGLE: Rectangle;
  25526. /**
  25527. * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
  25528. * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
  25529. * will move it further away from the extent, and a value less than zero will move it close to the extent.
  25530. */
  25531. static DEFAULT_VIEW_FACTOR: number;
  25532. /**
  25533. * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
  25534. */
  25535. static DEFAULT_OFFSET: HeadingPitchRange;
  25536. /**
  25537. * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
  25538. */
  25539. readonly transform: Matrix4;
  25540. /**
  25541. * Gets the inverse camera transform.
  25542. */
  25543. readonly inverseTransform: Matrix4;
  25544. /**
  25545. * Gets the view matrix.
  25546. */
  25547. readonly viewMatrix: Matrix4;
  25548. /**
  25549. * Gets the inverse view matrix.
  25550. */
  25551. readonly inverseViewMatrix: Matrix4;
  25552. /**
  25553. * Gets the {@link Cartographic} position of the camera, with longitude and latitude
  25554. * expressed in radians and height in meters. In 2D and Columbus View, it is possible
  25555. * for the returned longitude and latitude to be outside the range of valid longitudes
  25556. * and latitudes when the camera is outside the map.
  25557. */
  25558. readonly positionCartographic: Cartographic;
  25559. /**
  25560. * Gets the position of the camera in world coordinates.
  25561. */
  25562. readonly positionWC: Cartesian3;
  25563. /**
  25564. * Gets the view direction of the camera in world coordinates.
  25565. */
  25566. readonly directionWC: Cartesian3;
  25567. /**
  25568. * Gets the up direction of the camera in world coordinates.
  25569. */
  25570. readonly upWC: Cartesian3;
  25571. /**
  25572. * Gets the right direction of the camera in world coordinates.
  25573. */
  25574. readonly rightWC: Cartesian3;
  25575. /**
  25576. * Gets the camera heading in radians.
  25577. */
  25578. readonly heading: number;
  25579. /**
  25580. * Gets the camera pitch in radians.
  25581. */
  25582. readonly pitch: number;
  25583. /**
  25584. * Gets the camera roll in radians.
  25585. */
  25586. readonly roll: number;
  25587. /**
  25588. * Gets the event that will be raised at when the camera starts to move.
  25589. */
  25590. readonly moveStart: Event;
  25591. /**
  25592. * Gets the event that will be raised when the camera has stopped moving.
  25593. */
  25594. readonly moveEnd: Event;
  25595. /**
  25596. * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
  25597. */
  25598. readonly changed: Event;
  25599. /**
  25600. * Sets the camera position, orientation and transform.
  25601. * @example
  25602. * // 1. Set position with a top-down view
  25603. * viewer.camera.setView({
  25604. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  25605. * });
  25606. *
  25607. * // 2 Set view with heading, pitch and roll
  25608. * viewer.camera.setView({
  25609. * destination : cartesianPosition,
  25610. * orientation: {
  25611. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  25612. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  25613. * roll : 0.0 // default value
  25614. * }
  25615. * });
  25616. *
  25617. * // 3. Change heading, pitch and roll with the camera position remaining the same.
  25618. * viewer.camera.setView({
  25619. * orientation: {
  25620. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  25621. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  25622. * roll : 0.0 // default value
  25623. * }
  25624. * });
  25625. *
  25626. *
  25627. * // 4. View rectangle with a top-down view
  25628. * viewer.camera.setView({
  25629. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  25630. * });
  25631. *
  25632. * // 5. Set position with an orientation using unit vectors.
  25633. * viewer.camera.setView({
  25634. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25635. * orientation : {
  25636. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  25637. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  25638. * }
  25639. * });
  25640. * @param options - Object with the following properties:
  25641. * @param [options.destination] - The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.
  25642. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  25643. * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive
  25644. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  25645. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera.
  25646. * @param [options.convert] - Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.
  25647. */
  25648. setView(options: {
  25649. destination?: Cartesian3 | Rectangle;
  25650. orientation?: any;
  25651. endTransform?: Matrix4;
  25652. convert?: boolean;
  25653. }): void;
  25654. /**
  25655. * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
  25656. * the default view for the 3D scene. The home view for 2D and columbus view shows the
  25657. * entire map.
  25658. * @param [duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo}
  25659. */
  25660. flyHome(duration?: number): void;
  25661. /**
  25662. * Transform a vector or point from world coordinates to the camera's reference frame.
  25663. * @param cartesian - The vector or point to transform.
  25664. * @param [result] - The object onto which to store the result.
  25665. * @returns The transformed vector or point.
  25666. */
  25667. worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  25668. /**
  25669. * Transform a point from world coordinates to the camera's reference frame.
  25670. * @param cartesian - The point to transform.
  25671. * @param [result] - The object onto which to store the result.
  25672. * @returns The transformed point.
  25673. */
  25674. worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25675. /**
  25676. * Transform a vector from world coordinates to the camera's reference frame.
  25677. * @param cartesian - The vector to transform.
  25678. * @param [result] - The object onto which to store the result.
  25679. * @returns The transformed vector.
  25680. */
  25681. worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25682. /**
  25683. * Transform a vector or point from the camera's reference frame to world coordinates.
  25684. * @param cartesian - The vector or point to transform.
  25685. * @param [result] - The object onto which to store the result.
  25686. * @returns The transformed vector or point.
  25687. */
  25688. cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  25689. /**
  25690. * Transform a point from the camera's reference frame to world coordinates.
  25691. * @param cartesian - The point to transform.
  25692. * @param [result] - The object onto which to store the result.
  25693. * @returns The transformed point.
  25694. */
  25695. cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25696. /**
  25697. * Transform a vector from the camera's reference frame to world coordinates.
  25698. * @param cartesian - The vector to transform.
  25699. * @param [result] - The object onto which to store the result.
  25700. * @returns The transformed vector.
  25701. */
  25702. cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  25703. /**
  25704. * Translates the camera's position by <code>amount</code> along <code>direction</code>.
  25705. * @param direction - The direction to move.
  25706. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25707. */
  25708. move(direction: Cartesian3, amount?: number): void;
  25709. /**
  25710. * Translates the camera's position by <code>amount</code> along the camera's view vector.
  25711. * When in 2D mode, this will zoom in the camera instead of translating the camera's position.
  25712. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25713. */
  25714. moveForward(amount?: number): void;
  25715. /**
  25716. * Translates the camera's position by <code>amount</code> along the opposite direction
  25717. * of the camera's view vector.
  25718. * When in 2D mode, this will zoom out the camera instead of translating the camera's position.
  25719. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25720. */
  25721. moveBackward(amount?: number): void;
  25722. /**
  25723. * Translates the camera's position by <code>amount</code> along the camera's up vector.
  25724. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25725. */
  25726. moveUp(amount?: number): void;
  25727. /**
  25728. * Translates the camera's position by <code>amount</code> along the opposite direction
  25729. * of the camera's up vector.
  25730. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25731. */
  25732. moveDown(amount?: number): void;
  25733. /**
  25734. * Translates the camera's position by <code>amount</code> along the camera's right vector.
  25735. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25736. */
  25737. moveRight(amount?: number): void;
  25738. /**
  25739. * Translates the camera's position by <code>amount</code> along the opposite direction
  25740. * of the camera's right vector.
  25741. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  25742. */
  25743. moveLeft(amount?: number): void;
  25744. /**
  25745. * Rotates the camera around its up vector by amount, in radians, in the opposite direction
  25746. * of its right vector if not in 2D mode.
  25747. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25748. */
  25749. lookLeft(amount?: number): void;
  25750. /**
  25751. * Rotates the camera around its up vector by amount, in radians, in the direction
  25752. * of its right vector if not in 2D mode.
  25753. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25754. */
  25755. lookRight(amount?: number): void;
  25756. /**
  25757. * Rotates the camera around its right vector by amount, in radians, in the direction
  25758. * of its up vector if not in 2D mode.
  25759. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25760. */
  25761. lookUp(amount?: number): void;
  25762. /**
  25763. * Rotates the camera around its right vector by amount, in radians, in the opposite direction
  25764. * of its up vector if not in 2D mode.
  25765. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25766. */
  25767. lookDown(amount?: number): void;
  25768. /**
  25769. * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
  25770. * @param axis - The axis to rotate around.
  25771. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25772. */
  25773. look(axis: Cartesian3, angle?: number): void;
  25774. /**
  25775. * Rotate the camera counter-clockwise around its direction vector by amount, in radians.
  25776. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25777. */
  25778. twistLeft(amount?: number): void;
  25779. /**
  25780. * Rotate the camera clockwise around its direction vector by amount, in radians.
  25781. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  25782. */
  25783. twistRight(amount?: number): void;
  25784. /**
  25785. * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
  25786. * of the camera's position to the center of the camera's reference frame remains the same.
  25787. * @param axis - The axis to rotate around given in world coordinates.
  25788. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25789. */
  25790. rotate(axis: Cartesian3, angle?: number): void;
  25791. /**
  25792. * Rotates the camera around the center of the camera's reference frame by angle downwards.
  25793. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25794. */
  25795. rotateDown(angle?: number): void;
  25796. /**
  25797. * Rotates the camera around the center of the camera's reference frame by angle upwards.
  25798. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25799. */
  25800. rotateUp(angle?: number): void;
  25801. /**
  25802. * Rotates the camera around the center of the camera's reference frame by angle to the right.
  25803. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25804. */
  25805. rotateRight(angle?: number): void;
  25806. /**
  25807. * Rotates the camera around the center of the camera's reference frame by angle to the left.
  25808. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  25809. */
  25810. rotateLeft(angle?: number): void;
  25811. /**
  25812. * Zooms <code>amount</code> along the camera's view vector.
  25813. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  25814. */
  25815. zoomIn(amount?: number): void;
  25816. /**
  25817. * Zooms <code>amount</code> along the opposite direction of
  25818. * the camera's view vector.
  25819. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  25820. */
  25821. zoomOut(amount?: number): void;
  25822. /**
  25823. * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
  25824. * Columbus view, this is the distance to the map.
  25825. * @returns The magnitude of the position.
  25826. */
  25827. getMagnitude(): number;
  25828. /**
  25829. * Sets the camera position and orientation using a target and offset. The target must be given in
  25830. * world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target.
  25831. * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset
  25832. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  25833. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25834. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  25835. *
  25836. * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  25837. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  25838. * determined from the offset, the heading will be north.
  25839. * @example
  25840. * // 1. Using a cartesian offset
  25841. * var center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
  25842. * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  25843. *
  25844. * // 2. Using a HeadingPitchRange offset
  25845. * var center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  25846. * var heading = Cesium.Math.toRadians(50.0);
  25847. * var pitch = Cesium.Math.toRadians(-20.0);
  25848. * var range = 5000.0;
  25849. * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
  25850. * @param target - The target position in world coordinates.
  25851. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target.
  25852. */
  25853. lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void;
  25854. /**
  25855. * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
  25856. * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset
  25857. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  25858. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  25859. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  25860. *
  25861. * In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the
  25862. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  25863. * determined from the offset, the heading will be north.
  25864. * @example
  25865. * // 1. Using a cartesian offset
  25866. * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
  25867. * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  25868. *
  25869. * // 2. Using a HeadingPitchRange offset
  25870. * var transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
  25871. * var heading = Cesium.Math.toRadians(50.0);
  25872. * var pitch = Cesium.Math.toRadians(-20.0);
  25873. * var range = 5000.0;
  25874. * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
  25875. * @param transform - The transformation matrix defining the reference frame.
  25876. * @param [offset] - The offset from the target in a reference frame centered at the target.
  25877. */
  25878. lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void;
  25879. /**
  25880. * Get the camera position needed to view a rectangle on an ellipsoid or map
  25881. * @param rectangle - The rectangle to view.
  25882. * @param [result] - The camera position needed to view the rectangle
  25883. * @returns The camera position needed to view the rectangle
  25884. */
  25885. getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3;
  25886. /**
  25887. * Pick an ellipsoid or map.
  25888. * @example
  25889. * var canvas = viewer.scene.canvas;
  25890. * var center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
  25891. * var ellipsoid = viewer.scene.globe.ellipsoid;
  25892. * var result = viewer.camera.pickEllipsoid(center, ellipsoid);
  25893. * @param windowPosition - The x and y coordinates of a pixel.
  25894. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick.
  25895. * @param [result] - The object onto which to store the result.
  25896. * @returns If the ellipsoid or map was picked,
  25897. * returns the point on the surface of the ellipsoid or map in world
  25898. * coordinates. If the ellipsoid or map was not picked, returns undefined.
  25899. */
  25900. pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined;
  25901. /**
  25902. * Create a ray from the camera position through the pixel at <code>windowPosition</code>
  25903. * in world coordinates.
  25904. * @param windowPosition - The x and y coordinates of a pixel.
  25905. * @param [result] - The object onto which to store the result.
  25906. * @returns Returns the {@link Cartesian3} position and direction of the ray.
  25907. */
  25908. getPickRay(windowPosition: Cartesian2, result?: Ray): Ray;
  25909. /**
  25910. * Return the distance from the camera to the front of the bounding sphere.
  25911. * @param boundingSphere - The bounding sphere in world coordinates.
  25912. * @returns The distance to the bounding sphere.
  25913. */
  25914. distanceToBoundingSphere(boundingSphere: BoundingSphere): number;
  25915. /**
  25916. * Return the pixel size in meters.
  25917. * @param boundingSphere - The bounding sphere in world coordinates.
  25918. * @param drawingBufferWidth - The drawing buffer width.
  25919. * @param drawingBufferHeight - The drawing buffer height.
  25920. * @returns The pixel size in meters.
  25921. */
  25922. getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number;
  25923. /**
  25924. * Cancels the current camera flight and leaves the camera at its current location.
  25925. * If no flight is in progress, this this function does nothing.
  25926. */
  25927. cancelFlight(): void;
  25928. /**
  25929. * Completes the current camera flight and moves the camera immediately to its final destination.
  25930. * If no flight is in progress, this this function does nothing.
  25931. */
  25932. completeFlight(): void;
  25933. /**
  25934. * Flies the camera from its current position to a new position.
  25935. * @example
  25936. * // 1. Fly to a position with a top-down view
  25937. * viewer.camera.flyTo({
  25938. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  25939. * });
  25940. *
  25941. * // 2. Fly to a Rectangle with a top-down view
  25942. * viewer.camera.flyTo({
  25943. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  25944. * });
  25945. *
  25946. * // 3. Fly to a position with an orientation using unit vectors.
  25947. * viewer.camera.flyTo({
  25948. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25949. * orientation : {
  25950. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  25951. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  25952. * }
  25953. * });
  25954. *
  25955. * // 4. Fly to a position with an orientation using heading, pitch and roll.
  25956. * viewer.camera.flyTo({
  25957. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  25958. * orientation : {
  25959. * heading : Cesium.Math.toRadians(175.0),
  25960. * pitch : Cesium.Math.toRadians(-35.0),
  25961. * roll : 0.0
  25962. * }
  25963. * });
  25964. * @param options - Object with the following properties:
  25965. * @param options.destination - The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.
  25966. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  25967. * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive
  25968. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  25969. * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.
  25970. * @param [options.complete] - The function to execute when the flight is complete.
  25971. * @param [options.cancel] - The function to execute if the flight is cancelled.
  25972. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  25973. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  25974. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  25975. * @param [options.flyOverLongitude] - There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.
  25976. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  25977. * @param [options.convert] - Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.
  25978. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  25979. */
  25980. flyTo(options: {
  25981. destination: Cartesian3 | Rectangle;
  25982. orientation?: any;
  25983. duration?: number;
  25984. complete?: Camera.FlightCompleteCallback;
  25985. cancel?: Camera.FlightCancelledCallback;
  25986. endTransform?: Matrix4;
  25987. maximumHeight?: number;
  25988. pitchAdjustHeight?: number;
  25989. flyOverLongitude?: number;
  25990. flyOverLongitudeWeight?: number;
  25991. convert?: boolean;
  25992. easingFunction?: EasingFunction.Callback;
  25993. }): void;
  25994. /**
  25995. * Sets the camera so that the current view contains the provided bounding sphere.
  25996. *
  25997. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  25998. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  25999. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26000. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  26001. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  26002. *
  26003. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  26004. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  26005. * determined from the offset, the heading will be north.</p>
  26006. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  26007. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  26008. */
  26009. viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void;
  26010. /**
  26011. * Flies the camera to a location where the current view contains the provided bounding sphere.
  26012. *
  26013. * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  26014. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  26015. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26016. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  26017. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  26018. *
  26019. * <p>In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the
  26020. * target will be the range. The heading will be aligned to local north.</p>
  26021. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  26022. * @param [options] - Object with the following properties:
  26023. * @param [options.duration] - The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.
  26024. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  26025. * @param [options.complete] - The function to execute when the flight is complete.
  26026. * @param [options.cancel] - The function to execute if the flight is cancelled.
  26027. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  26028. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  26029. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  26030. * @param [options.flyOverLongitude] - There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.
  26031. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  26032. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  26033. */
  26034. flyToBoundingSphere(boundingSphere: BoundingSphere, options?: {
  26035. duration?: number;
  26036. offset?: HeadingPitchRange;
  26037. complete?: Camera.FlightCompleteCallback;
  26038. cancel?: Camera.FlightCancelledCallback;
  26039. endTransform?: Matrix4;
  26040. maximumHeight?: number;
  26041. pitchAdjustHeight?: number;
  26042. flyOverLongitude?: number;
  26043. flyOverLongitudeWeight?: number;
  26044. easingFunction?: EasingFunction.Callback;
  26045. }): void;
  26046. /**
  26047. * Computes the approximate visible rectangle on the ellipsoid.
  26048. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that you want to know the visible region.
  26049. * @param [result] - The rectangle in which to store the result
  26050. * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all.
  26051. */
  26052. computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined;
  26053. /**
  26054. * Switches the frustum/projection to perspective.
  26055. *
  26056. * This function is a no-op in 2D which must always be orthographic.
  26057. */
  26058. switchToPerspectiveFrustum(): void;
  26059. /**
  26060. * Switches the frustum/projection to orthographic.
  26061. *
  26062. * This function is a no-op in 2D which will always be orthographic.
  26063. */
  26064. switchToOrthographicFrustum(): void;
  26065. }
  26066. export namespace Camera {
  26067. /**
  26068. * A function that will execute when a flight completes.
  26069. */
  26070. type FlightCompleteCallback = () => void;
  26071. /**
  26072. * A function that will execute when a flight is cancelled.
  26073. */
  26074. type FlightCancelledCallback = () => void;
  26075. }
  26076. /**
  26077. * Aggregates input events. For example, suppose the following inputs are received between frames:
  26078. * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into
  26079. * one event with a start and end position of the mouse.
  26080. * @param [canvas = document] - The element to handle events for.
  26081. */
  26082. export class CameraEventAggregator {
  26083. constructor(canvas?: HTMLCanvasElement);
  26084. /**
  26085. * Gets the current mouse position.
  26086. */
  26087. currentMousePosition: Cartesian2;
  26088. /**
  26089. * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
  26090. */
  26091. anyButtonDown: boolean;
  26092. /**
  26093. * Gets if a mouse button down or touch has started and has been moved.
  26094. * @param type - The camera event type.
  26095. * @param [modifier] - The keyboard modifier.
  26096. * @returns Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>
  26097. */
  26098. isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  26099. /**
  26100. * Gets the aggregated start and end position of the current event.
  26101. * @param type - The camera event type.
  26102. * @param [modifier] - The keyboard modifier.
  26103. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.
  26104. */
  26105. getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any;
  26106. /**
  26107. * Gets the start and end position of the last move event (not the aggregated event).
  26108. * @param type - The camera event type.
  26109. * @param [modifier] - The keyboard modifier.
  26110. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.
  26111. */
  26112. getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined;
  26113. /**
  26114. * Gets whether the mouse button is down or a touch has started.
  26115. * @param type - The camera event type.
  26116. * @param [modifier] - The keyboard modifier.
  26117. * @returns Whether the mouse button is down or a touch has started.
  26118. */
  26119. isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  26120. /**
  26121. * Gets the mouse position that started the aggregation.
  26122. * @param type - The camera event type.
  26123. * @param [modifier] - The keyboard modifier.
  26124. * @returns The mouse position.
  26125. */
  26126. getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2;
  26127. /**
  26128. * Gets the time the button was pressed or the touch was started.
  26129. * @param type - The camera event type.
  26130. * @param [modifier] - The keyboard modifier.
  26131. * @returns The time the button was pressed or the touch was started.
  26132. */
  26133. getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  26134. /**
  26135. * Gets the time the button was released or the touch was ended.
  26136. * @param type - The camera event type.
  26137. * @param [modifier] - The keyboard modifier.
  26138. * @returns The time the button was released or the touch was ended.
  26139. */
  26140. getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  26141. /**
  26142. * Signals that all of the events have been handled and the aggregator should be reset to handle new events.
  26143. */
  26144. reset(): void;
  26145. /**
  26146. * Returns true if this object was destroyed; otherwise, false.
  26147. * <br /><br />
  26148. * If this object was destroyed, it should not be used; calling any function other than
  26149. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26150. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  26151. */
  26152. isDestroyed(): boolean;
  26153. /**
  26154. * Removes mouse listeners held by this object.
  26155. * <br /><br />
  26156. * Once an object is destroyed, it should not be used; calling any function other than
  26157. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26158. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26159. * @example
  26160. * handler = handler && handler.destroy();
  26161. */
  26162. destroy(): void;
  26163. }
  26164. /**
  26165. * Enumerates the available input for interacting with the camera.
  26166. */
  26167. export enum CameraEventType {
  26168. /**
  26169. * A left mouse button press followed by moving the mouse and releasing the button.
  26170. */
  26171. LEFT_DRAG = 0,
  26172. /**
  26173. * A right mouse button press followed by moving the mouse and releasing the button.
  26174. */
  26175. RIGHT_DRAG = 1,
  26176. /**
  26177. * A middle mouse button press followed by moving the mouse and releasing the button.
  26178. */
  26179. MIDDLE_DRAG = 2,
  26180. /**
  26181. * Scrolling the middle mouse button.
  26182. */
  26183. WHEEL = 3,
  26184. /**
  26185. * A two-finger touch on a touch surface.
  26186. */
  26187. PINCH = 4
  26188. }
  26189. /**
  26190. * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded;
  26191. * the content is loaded on-demand when needed based on the view.
  26192. * <p>
  26193. * Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.
  26194. * </p>
  26195. */
  26196. export class Cesium3DTile {
  26197. constructor();
  26198. /**
  26199. * The local transform of this tile.
  26200. */
  26201. transform: Matrix4;
  26202. /**
  26203. * The final computed transform of this tile.
  26204. */
  26205. readonly computedTransform: Matrix4;
  26206. /**
  26207. * The error, in meters, introduced if this tile is rendered and its children are not.
  26208. * This is used to compute screen space error, i.e., the error measured in pixels.
  26209. */
  26210. readonly geometricError: number;
  26211. /**
  26212. * Gets the tile's children.
  26213. */
  26214. readonly children: Cesium3DTile[];
  26215. /**
  26216. * This tile's parent or <code>undefined</code> if this tile is the root.
  26217. * <p>
  26218. * When a tile's content points to an external tileset JSON file, the external tileset's
  26219. * root tile's parent is not <code>undefined</code>; instead, the parent references
  26220. * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged.
  26221. * </p>
  26222. */
  26223. readonly parent: Cesium3DTile;
  26224. /**
  26225. * The time in seconds after the tile's content is ready when the content expires and new content is requested.
  26226. */
  26227. expireDuration: number;
  26228. /**
  26229. * The date when the content expires and new content is requested.
  26230. */
  26231. expireDate: JulianDate;
  26232. /**
  26233. * The tileset containing this tile.
  26234. */
  26235. readonly tileset: Cesium3DTileset;
  26236. /**
  26237. * The tile's content. This represents the actual tile's payload,
  26238. * not the content's metadata in the tileset JSON file.
  26239. */
  26240. readonly content: Cesium3DTileContent;
  26241. /**
  26242. * Get the bounding sphere derived from the tile's bounding volume.
  26243. */
  26244. readonly boundingSphere: BoundingSphere;
  26245. /**
  26246. * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata.
  26247. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  26248. */
  26249. readonly extras: any;
  26250. }
  26251. /**
  26252. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  26253. * the original feature, e.g. glTF material or per-point color in the tile.
  26254. * <p>
  26255. * When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the
  26256. * <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.
  26257. * </p>
  26258. * <p>
  26259. * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the
  26260. * tileset's color blend mode.
  26261. * </p>
  26262. * <pre><code>
  26263. * "techniques": {
  26264. * "technique0": {
  26265. * "parameters": {
  26266. * "diffuse": {
  26267. * "semantic": "_3DTILESDIFFUSE",
  26268. * "type": 35666
  26269. * }
  26270. * }
  26271. * }
  26272. * }
  26273. * </code></pre>
  26274. */
  26275. export enum Cesium3DTileColorBlendMode {
  26276. /**
  26277. * Multiplies the source color by the feature color.
  26278. */
  26279. HIGHLIGHT = 0,
  26280. /**
  26281. * Replaces the source color with the feature color.
  26282. */
  26283. REPLACE = 1,
  26284. /**
  26285. * Blends the source color and feature color together.
  26286. */
  26287. MIX = 2
  26288. }
  26289. /**
  26290. * The content of a tile in a {@link Cesium3DTileset}.
  26291. * <p>
  26292. * Derived classes of this interface provide access to individual features in the tile.
  26293. * Access derived objects through {@link Cesium3DTile#content}.
  26294. * </p>
  26295. * <p>
  26296. * This type describes an interface and is not intended to be instantiated directly.
  26297. * </p>
  26298. */
  26299. export class Cesium3DTileContent {
  26300. constructor();
  26301. /**
  26302. * Gets the number of features in the tile.
  26303. */
  26304. readonly featuresLength: number;
  26305. /**
  26306. * Gets the number of points in the tile.
  26307. * <p>
  26308. * Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which
  26309. * equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.
  26310. * </p>
  26311. */
  26312. readonly pointsLength: number;
  26313. /**
  26314. * Gets the number of triangles in the tile.
  26315. */
  26316. readonly trianglesLength: number;
  26317. /**
  26318. * Gets the tile's geometry memory in bytes.
  26319. */
  26320. readonly geometryByteLength: number;
  26321. /**
  26322. * Gets the tile's texture memory in bytes.
  26323. */
  26324. readonly texturesByteLength: number;
  26325. /**
  26326. * Gets the amount of memory used by the batch table textures, in bytes.
  26327. */
  26328. readonly batchTableByteLength: number;
  26329. /**
  26330. * Gets the array of {@link Cesium3DTileContent} objects for contents that contain other contents, such as composite tiles. The inner contents may in turn have inner contents, such as a composite tile that contains a composite tile.
  26331. */
  26332. readonly innerContents: any[];
  26333. /**
  26334. * Gets the promise that will be resolved when the tile's content is ready to render.
  26335. */
  26336. readonly readyPromise: Promise<Cesium3DTileContent>;
  26337. /**
  26338. * Gets the tileset for this tile.
  26339. */
  26340. readonly tileset: Cesium3DTileset;
  26341. /**
  26342. * Gets the tile containing this content.
  26343. */
  26344. readonly tile: Cesium3DTile;
  26345. /**
  26346. * Gets the url of the tile's content.
  26347. */
  26348. readonly url: string;
  26349. /**
  26350. * Returns whether the feature has this property.
  26351. * @param batchId - The batchId for the feature.
  26352. * @param name - The case-sensitive name of the property.
  26353. * @returns <code>true</code> if the feature has this property; otherwise, <code>false</code>.
  26354. */
  26355. hasProperty(batchId: number, name: string): boolean;
  26356. /**
  26357. * Returns the {@link Cesium3DTileFeature} object for the feature with the
  26358. * given <code>batchId</code>. This object is used to get and modify the
  26359. * feature's properties.
  26360. * <p>
  26361. * Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
  26362. * </p>
  26363. * @param batchId - The batchId for the feature.
  26364. * @returns The corresponding {@link Cesium3DTileFeature} object.
  26365. */
  26366. getFeature(batchId: number): Cesium3DTileFeature;
  26367. }
  26368. /**
  26369. * A feature of a {@link Cesium3DTileset}.
  26370. * <p>
  26371. * Provides access to a feature's properties stored in the tile's batch table, as well
  26372. * as the ability to show/hide a feature and change its highlight color via
  26373. * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively.
  26374. * </p>
  26375. * <p>
  26376. * Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's
  26377. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26378. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26379. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26380. * </p>
  26381. * <p>
  26382. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26383. * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  26384. * </p>
  26385. * @example
  26386. * // On mouse over, display all the properties for a feature in the console log.
  26387. * handler.setInputAction(function(movement) {
  26388. * var feature = scene.pick(movement.endPosition);
  26389. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  26390. * var propertyNames = feature.getPropertyNames();
  26391. * var length = propertyNames.length;
  26392. * for (var i = 0; i < length; ++i) {
  26393. * var propertyName = propertyNames[i];
  26394. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26395. * }
  26396. * }
  26397. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26398. */
  26399. export class Cesium3DTileFeature {
  26400. constructor();
  26401. /**
  26402. * Gets or sets if the feature will be shown. This is set for all features
  26403. * when a style's show is evaluated.
  26404. */
  26405. show: boolean;
  26406. /**
  26407. * Gets or sets the highlight color multiplied with the feature's color. When
  26408. * this is white, the feature's color is not changed. This is set for all features
  26409. * when a style's color is evaluated.
  26410. */
  26411. color: Color;
  26412. /**
  26413. * Gets a typed array containing the ECEF positions of the polyline.
  26414. * Returns undefined if {@link Cesium3DTileset#vectorKeepDecodedPositions} is false
  26415. * or the feature is not a polyline in a vector tile.
  26416. */
  26417. polylinePositions: Float64Array;
  26418. /**
  26419. * Gets the tileset containing the feature.
  26420. */
  26421. readonly tileset: Cesium3DTileset;
  26422. /**
  26423. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26424. * the tileset containing the feature.
  26425. */
  26426. readonly primitive: Cesium3DTileset;
  26427. /**
  26428. * Returns whether the feature contains this property. This includes properties from this feature's
  26429. * class and inherited classes when using a batch table hierarchy.
  26430. * @param name - The case-sensitive name of the property.
  26431. * @returns Whether the feature contains this property.
  26432. */
  26433. hasProperty(name: string): boolean;
  26434. /**
  26435. * Returns an array of property names for the feature. This includes properties from this feature's
  26436. * class and inherited classes when using a batch table hierarchy.
  26437. * @param [results] - An array into which to store the results.
  26438. * @returns The names of the feature's properties.
  26439. */
  26440. getPropertyNames(results?: string[]): string[];
  26441. /**
  26442. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26443. * class and inherited classes when using a batch table hierarchy.
  26444. * @example
  26445. * // Display all the properties for a feature in the console log.
  26446. * var propertyNames = feature.getPropertyNames();
  26447. * var length = propertyNames.length;
  26448. * for (var i = 0; i < length; ++i) {
  26449. * var propertyName = propertyNames[i];
  26450. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26451. * }
  26452. * @param name - The case-sensitive name of the property.
  26453. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  26454. */
  26455. getProperty(name: string): any;
  26456. /**
  26457. * Sets the value of the feature's property with the given name.
  26458. * <p>
  26459. * If a property with the given name doesn't exist, it is created.
  26460. * </p>
  26461. * @example
  26462. * var height = feature.getProperty('Height'); // e.g., the height of a building
  26463. * @example
  26464. * var name = 'clicked';
  26465. * if (feature.getProperty(name)) {
  26466. * console.log('already clicked');
  26467. * } else {
  26468. * feature.setProperty(name, true);
  26469. * console.log('first click');
  26470. * }
  26471. * @param name - The case-sensitive name of the property.
  26472. * @param value - The value of the property that will be copied.
  26473. */
  26474. setProperty(name: string, value: any): void;
  26475. }
  26476. /**
  26477. * A point feature of a {@link Cesium3DTileset}.
  26478. * <p>
  26479. * Provides access to a feature's properties stored in the tile's batch table, as well
  26480. * as the ability to show/hide a feature and change its point properties
  26481. * </p>
  26482. * <p>
  26483. * Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's
  26484. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26485. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26486. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26487. * </p>
  26488. * <p>
  26489. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26490. * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  26491. * </p>
  26492. * @example
  26493. * // On mouse over, display all the properties for a feature in the console log.
  26494. * handler.setInputAction(function(movement) {
  26495. * var feature = scene.pick(movement.endPosition);
  26496. * if (feature instanceof Cesium.Cesium3DTilePointFeature) {
  26497. * var propertyNames = feature.getPropertyNames();
  26498. * var length = propertyNames.length;
  26499. * for (var i = 0; i < length; ++i) {
  26500. * var propertyName = propertyNames[i];
  26501. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26502. * }
  26503. * }
  26504. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26505. */
  26506. export class Cesium3DTilePointFeature {
  26507. constructor();
  26508. /**
  26509. * Gets or sets if the feature will be shown. This is set for all features
  26510. * when a style's show is evaluated.
  26511. */
  26512. show: boolean;
  26513. /**
  26514. * Gets or sets the color of the point of this feature.
  26515. * <p>
  26516. * Only applied when <code>image</code> is <code>undefined</code>.
  26517. * </p>
  26518. */
  26519. color: Color;
  26520. /**
  26521. * Gets or sets the point size of this feature.
  26522. * <p>
  26523. * Only applied when <code>image</code> is <code>undefined</code>.
  26524. * </p>
  26525. */
  26526. pointSize: number;
  26527. /**
  26528. * Gets or sets the point outline color of this feature.
  26529. * <p>
  26530. * Only applied when <code>image</code> is <code>undefined</code>.
  26531. * </p>
  26532. */
  26533. pointOutlineColor: Color;
  26534. /**
  26535. * Gets or sets the point outline width in pixels of this feature.
  26536. * <p>
  26537. * Only applied when <code>image</code> is <code>undefined</code>.
  26538. * </p>
  26539. */
  26540. pointOutlineWidth: number;
  26541. /**
  26542. * Gets or sets the label color of this feature.
  26543. * <p>
  26544. * The color will be applied to the label if <code>labelText</code> is defined.
  26545. * </p>
  26546. */
  26547. labelColor: Color;
  26548. /**
  26549. * Gets or sets the label outline color of this feature.
  26550. * <p>
  26551. * The outline color will be applied to the label if <code>labelText</code> is defined.
  26552. * </p>
  26553. */
  26554. labelOutlineColor: Color;
  26555. /**
  26556. * Gets or sets the outline width in pixels of this feature.
  26557. * <p>
  26558. * The outline width will be applied to the point if <code>labelText</code> is defined.
  26559. * </p>
  26560. */
  26561. labelOutlineWidth: number;
  26562. /**
  26563. * Gets or sets the font of this feature.
  26564. * <p>
  26565. * Only applied when the <code>labelText</code> is defined.
  26566. * </p>
  26567. */
  26568. font: string;
  26569. /**
  26570. * Gets or sets the fill and outline style of this feature.
  26571. * <p>
  26572. * Only applied when <code>labelText</code> is defined.
  26573. * </p>
  26574. */
  26575. labelStyle: LabelStyle;
  26576. /**
  26577. * Gets or sets the text for this feature.
  26578. */
  26579. labelText: string;
  26580. /**
  26581. * Gets or sets the background color of the text for this feature.
  26582. * <p>
  26583. * Only applied when <code>labelText</code> is defined.
  26584. * </p>
  26585. */
  26586. backgroundColor: Color;
  26587. /**
  26588. * Gets or sets the background padding of the text for this feature.
  26589. * <p>
  26590. * Only applied when <code>labelText</code> is defined.
  26591. * </p>
  26592. */
  26593. backgroundPadding: Cartesian2;
  26594. /**
  26595. * Gets or sets whether to display the background of the text for this feature.
  26596. * <p>
  26597. * Only applied when <code>labelText</code> is defined.
  26598. * </p>
  26599. */
  26600. backgroundEnabled: boolean;
  26601. /**
  26602. * Gets or sets the near and far scaling properties for this feature.
  26603. */
  26604. scaleByDistance: NearFarScalar;
  26605. /**
  26606. * Gets or sets the near and far translucency properties for this feature.
  26607. */
  26608. translucencyByDistance: NearFarScalar;
  26609. /**
  26610. * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.
  26611. */
  26612. distanceDisplayCondition: DistanceDisplayCondition;
  26613. /**
  26614. * Gets or sets the height offset in meters of this feature.
  26615. */
  26616. heightOffset: number;
  26617. /**
  26618. * Gets or sets whether the anchor line is displayed.
  26619. * <p>
  26620. * Only applied when <code>heightOffset</code> is defined.
  26621. * </p>
  26622. */
  26623. anchorLineEnabled: boolean;
  26624. /**
  26625. * Gets or sets the color for the anchor line.
  26626. * <p>
  26627. * Only applied when <code>heightOffset</code> is defined.
  26628. * </p>
  26629. */
  26630. anchorLineColor: Color;
  26631. /**
  26632. * Gets or sets the image of this feature.
  26633. */
  26634. image: string;
  26635. /**
  26636. * Gets or sets the distance where depth testing will be disabled.
  26637. */
  26638. disableDepthTestDistance: number;
  26639. /**
  26640. * Gets or sets the horizontal origin of this point, which determines if the point is
  26641. * to the left, center, or right of its anchor position.
  26642. */
  26643. horizontalOrigin: HorizontalOrigin;
  26644. /**
  26645. * Gets or sets the vertical origin of this point, which determines if the point is
  26646. * to the bottom, center, or top of its anchor position.
  26647. */
  26648. verticalOrigin: VerticalOrigin;
  26649. /**
  26650. * Gets or sets the horizontal origin of this point's text, which determines if the point's text is
  26651. * to the left, center, or right of its anchor position.
  26652. */
  26653. labelHorizontalOrigin: HorizontalOrigin;
  26654. /**
  26655. * Get or sets the vertical origin of this point's text, which determines if the point's text is
  26656. * to the bottom, center, top, or baseline of it's anchor point.
  26657. */
  26658. labelVerticalOrigin: VerticalOrigin;
  26659. /**
  26660. * Gets the tileset containing the feature.
  26661. */
  26662. readonly tileset: Cesium3DTileset;
  26663. /**
  26664. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26665. * the tileset containing the feature.
  26666. */
  26667. readonly primitive: Cesium3DTileset;
  26668. /**
  26669. * Returns whether the feature contains this property. This includes properties from this feature's
  26670. * class and inherited classes when using a batch table hierarchy.
  26671. * @param name - The case-sensitive name of the property.
  26672. * @returns Whether the feature contains this property.
  26673. */
  26674. hasProperty(name: string): boolean;
  26675. /**
  26676. * Returns an array of property names for the feature. This includes properties from this feature's
  26677. * class and inherited classes when using a batch table hierarchy.
  26678. * @param [results] - An array into which to store the results.
  26679. * @returns The names of the feature's properties.
  26680. */
  26681. getPropertyNames(results?: string[]): string[];
  26682. /**
  26683. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26684. * class and inherited classes when using a batch table hierarchy.
  26685. * @example
  26686. * // Display all the properties for a feature in the console log.
  26687. * var propertyNames = feature.getPropertyNames();
  26688. * var length = propertyNames.length;
  26689. * for (var i = 0; i < length; ++i) {
  26690. * var propertyName = propertyNames[i];
  26691. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26692. * }
  26693. * @param name - The case-sensitive name of the property.
  26694. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  26695. */
  26696. getProperty(name: string): any;
  26697. /**
  26698. * Sets the value of the feature's property with the given name.
  26699. * <p>
  26700. * If a property with the given name doesn't exist, it is created.
  26701. * </p>
  26702. * @example
  26703. * var height = feature.getProperty('Height'); // e.g., the height of a building
  26704. * @example
  26705. * var name = 'clicked';
  26706. * if (feature.getProperty(name)) {
  26707. * console.log('already clicked');
  26708. * } else {
  26709. * feature.setProperty(name, true);
  26710. * console.log('first click');
  26711. * }
  26712. * @param name - The case-sensitive name of the property.
  26713. * @param value - The value of the property that will be copied.
  26714. */
  26715. setProperty(name: string, value: any): void;
  26716. }
  26717. /**
  26718. * A style that is applied to a {@link Cesium3DTileset}.
  26719. * <p>
  26720. * Evaluates an expression defined using the
  26721. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  26722. * </p>
  26723. * @example
  26724. * tileset.style = new Cesium.Cesium3DTileStyle({
  26725. * color : {
  26726. * conditions : [
  26727. * ['${Height} >= 100', 'color("purple", 0.5)'],
  26728. * ['${Height} >= 50', 'color("red")'],
  26729. * ['true', 'color("blue")']
  26730. * ]
  26731. * },
  26732. * show : '${Height} > 0',
  26733. * meta : {
  26734. * description : '"Building id ${id} has height ${Height}."'
  26735. * }
  26736. * });
  26737. * @example
  26738. * tileset.style = new Cesium.Cesium3DTileStyle({
  26739. * color : 'vec4(${Temperature})',
  26740. * pointSize : '${Temperature} * 2.0'
  26741. * });
  26742. * @param [style] - The url of a style or an object defining a style.
  26743. */
  26744. export class Cesium3DTileStyle {
  26745. constructor(style?: Resource | string | any);
  26746. /**
  26747. * Gets the object defining the style using the
  26748. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  26749. */
  26750. readonly style: any;
  26751. /**
  26752. * When <code>true</code>, the style is ready and its expressions can be evaluated. When
  26753. * a style is constructed with an object, as opposed to a url, this is <code>true</code> immediately.
  26754. */
  26755. readonly ready: boolean;
  26756. /**
  26757. * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated.
  26758. */
  26759. readonly readyPromise: Promise<Cesium3DTileStyle>;
  26760. /**
  26761. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>show</code> property. Alternatively a boolean, string, or object defining a show style can be used.
  26762. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26763. * <p>
  26764. * The expression must return or convert to a <code>Boolean</code>.
  26765. * </p>
  26766. * <p>
  26767. * This expression is applicable to all tile formats.
  26768. * </p>
  26769. * @example
  26770. * var style = new Cesium3DTileStyle({
  26771. * show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'
  26772. * });
  26773. * style.show.evaluate(feature); // returns true or false depending on the feature's properties
  26774. * @example
  26775. * var style = new Cesium.Cesium3DTileStyle();
  26776. * // Override show expression with a custom function
  26777. * style.show = {
  26778. * evaluate : function(feature) {
  26779. * return true;
  26780. * }
  26781. * };
  26782. * @example
  26783. * var style = new Cesium.Cesium3DTileStyle();
  26784. * // Override show expression with a boolean
  26785. * style.show = true;
  26786. * };
  26787. * @example
  26788. * var style = new Cesium.Cesium3DTileStyle();
  26789. * // Override show expression with a string
  26790. * style.show = '${Height} > 0';
  26791. * };
  26792. * @example
  26793. * var style = new Cesium.Cesium3DTileStyle();
  26794. * // Override show expression with a condition
  26795. * style.show = {
  26796. * conditions: [
  26797. * ['${height} > 2', 'false'],
  26798. * ['true', 'true']
  26799. * ];
  26800. * };
  26801. */
  26802. show: StyleExpression;
  26803. /**
  26804. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>color</code> property. Alternatively a string or object defining a color style can be used.
  26805. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26806. * <p>
  26807. * The expression must return a <code>Color</code>.
  26808. * </p>
  26809. * <p>
  26810. * This expression is applicable to all tile formats.
  26811. * </p>
  26812. * @example
  26813. * var style = new Cesium3DTileStyle({
  26814. * color : '(${Temperature} > 90) ? color("red") : color("white")'
  26815. * });
  26816. * style.color.evaluateColor(feature, result); // returns a Cesium.Color object
  26817. * @example
  26818. * var style = new Cesium.Cesium3DTileStyle();
  26819. * // Override color expression with a custom function
  26820. * style.color = {
  26821. * evaluateColor : function(feature, result) {
  26822. * return Cesium.Color.clone(Cesium.Color.WHITE, result);
  26823. * }
  26824. * };
  26825. * @example
  26826. * var style = new Cesium.Cesium3DTileStyle();
  26827. * // Override color expression with a string
  26828. * style.color = 'color("blue")';
  26829. * @example
  26830. * var style = new Cesium.Cesium3DTileStyle();
  26831. * // Override color expression with a condition
  26832. * style.color = {
  26833. * conditions : [
  26834. * ['${height} > 2', 'color("cyan")'],
  26835. * ['true', 'color("blue")']
  26836. * ]
  26837. * };
  26838. */
  26839. color: StyleExpression;
  26840. /**
  26841. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointSize</code> property. Alternatively a string or object defining a point size style can be used.
  26842. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26843. * <p>
  26844. * The expression must return a <code>Number</code>.
  26845. * </p>
  26846. * <p>
  26847. * This expression is only applicable to point features in a Vector tile or a Point Cloud tile.
  26848. * </p>
  26849. * @example
  26850. * var style = new Cesium3DTileStyle({
  26851. * pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'
  26852. * });
  26853. * style.pointSize.evaluate(feature); // returns a Number
  26854. * @example
  26855. * var style = new Cesium.Cesium3DTileStyle();
  26856. * // Override pointSize expression with a custom function
  26857. * style.pointSize = {
  26858. * evaluate : function(feature) {
  26859. * return 1.0;
  26860. * }
  26861. * };
  26862. * @example
  26863. * var style = new Cesium.Cesium3DTileStyle();
  26864. * // Override pointSize expression with a number
  26865. * style.pointSize = 1.0;
  26866. * @example
  26867. * var style = new Cesium.Cesium3DTileStyle();
  26868. * // Override pointSize expression with a string
  26869. * style.pointSize = '${height} / 10';
  26870. * @example
  26871. * var style = new Cesium.Cesium3DTileStyle();
  26872. * // Override pointSize expression with a condition
  26873. * style.pointSize = {
  26874. * conditions : [
  26875. * ['${height} > 2', '1.0'],
  26876. * ['true', '2.0']
  26877. * ]
  26878. * };
  26879. */
  26880. pointSize: StyleExpression;
  26881. /**
  26882. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineColor</code> property. Alternatively a string or object defining a color style can be used.
  26883. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26884. * <p>
  26885. * The expression must return a <code>Color</code>.
  26886. * </p>
  26887. * <p>
  26888. * This expression is only applicable to point features in a Vector tile.
  26889. * </p>
  26890. * @example
  26891. * var style = new Cesium.Cesium3DTileStyle();
  26892. * // Override pointOutlineColor expression with a string
  26893. * style.pointOutlineColor = 'color("blue")';
  26894. * @example
  26895. * var style = new Cesium.Cesium3DTileStyle();
  26896. * // Override pointOutlineColor expression with a condition
  26897. * style.pointOutlineColor = {
  26898. * conditions : [
  26899. * ['${height} > 2', 'color("cyan")'],
  26900. * ['true', 'color("blue")']
  26901. * ]
  26902. * };
  26903. */
  26904. pointOutlineColor: StyleExpression;
  26905. /**
  26906. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>pointOutlineWidth</code> property. Alternatively a string or object defining a number style can be used.
  26907. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26908. * <p>
  26909. * The expression must return a <code>Number</code>.
  26910. * </p>
  26911. * <p>
  26912. * This expression is only applicable to point features in a Vector tile.
  26913. * </p>
  26914. * @example
  26915. * var style = new Cesium.Cesium3DTileStyle();
  26916. * // Override pointOutlineWidth expression with a string
  26917. * style.pointOutlineWidth = '5';
  26918. * @example
  26919. * var style = new Cesium.Cesium3DTileStyle();
  26920. * // Override pointOutlineWidth expression with a condition
  26921. * style.pointOutlineWidth = {
  26922. * conditions : [
  26923. * ['${height} > 2', '5'],
  26924. * ['true', '0']
  26925. * ]
  26926. * };
  26927. */
  26928. pointOutlineWidth: StyleExpression;
  26929. /**
  26930. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelColor</code> property. Alternatively a string or object defining a color style can be used.
  26931. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26932. * <p>
  26933. * The expression must return a <code>Color</code>.
  26934. * </p>
  26935. * <p>
  26936. * This expression is only applicable to point features in a Vector tile.
  26937. * </p>
  26938. * @example
  26939. * var style = new Cesium.Cesium3DTileStyle();
  26940. * // Override labelColor expression with a string
  26941. * style.labelColor = 'color("blue")';
  26942. * @example
  26943. * var style = new Cesium.Cesium3DTileStyle();
  26944. * // Override labelColor expression with a condition
  26945. * style.labelColor = {
  26946. * conditions : [
  26947. * ['${height} > 2', 'color("cyan")'],
  26948. * ['true', 'color("blue")']
  26949. * ]
  26950. * };
  26951. */
  26952. labelColor: StyleExpression;
  26953. /**
  26954. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineColor</code> property. Alternatively a string or object defining a color style can be used.
  26955. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26956. * <p>
  26957. * The expression must return a <code>Color</code>.
  26958. * </p>
  26959. * <p>
  26960. * This expression is only applicable to point features in a Vector tile.
  26961. * </p>
  26962. * @example
  26963. * var style = new Cesium.Cesium3DTileStyle();
  26964. * // Override labelOutlineColor expression with a string
  26965. * style.labelOutlineColor = 'color("blue")';
  26966. * @example
  26967. * var style = new Cesium.Cesium3DTileStyle();
  26968. * // Override labelOutlineColor expression with a condition
  26969. * style.labelOutlineColor = {
  26970. * conditions : [
  26971. * ['${height} > 2', 'color("cyan")'],
  26972. * ['true', 'color("blue")']
  26973. * ]
  26974. * };
  26975. */
  26976. labelOutlineColor: StyleExpression;
  26977. /**
  26978. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelOutlineWidth</code> property. Alternatively a string or object defining a number style can be used.
  26979. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  26980. * <p>
  26981. * The expression must return a <code>Number</code>.
  26982. * </p>
  26983. * <p>
  26984. * This expression is only applicable to point features in a Vector tile.
  26985. * </p>
  26986. * @example
  26987. * var style = new Cesium.Cesium3DTileStyle();
  26988. * // Override labelOutlineWidth expression with a string
  26989. * style.labelOutlineWidth = '5';
  26990. * @example
  26991. * var style = new Cesium.Cesium3DTileStyle();
  26992. * // Override labelOutlineWidth expression with a condition
  26993. * style.labelOutlineWidth = {
  26994. * conditions : [
  26995. * ['${height} > 2', '5'],
  26996. * ['true', '0']
  26997. * ]
  26998. * };
  26999. */
  27000. labelOutlineWidth: StyleExpression;
  27001. /**
  27002. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>font</code> property. Alternatively a string or object defining a string style can be used.
  27003. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27004. * <p>
  27005. * The expression must return a <code>String</code>.
  27006. * </p>
  27007. * <p>
  27008. * This expression is only applicable to point features in a Vector tile.
  27009. * </p>
  27010. * @example
  27011. * var style = new Cesium3DTileStyle({
  27012. * font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"'
  27013. * });
  27014. * style.font.evaluate(feature); // returns a String
  27015. * @example
  27016. * var style = new Cesium.Cesium3DTileStyle();
  27017. * // Override font expression with a custom function
  27018. * style.font = {
  27019. * evaluate : function(feature) {
  27020. * return '24px Helvetica';
  27021. * }
  27022. * };
  27023. */
  27024. font: StyleExpression;
  27025. /**
  27026. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>label style</code> property. Alternatively a string or object defining a number style can be used.
  27027. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27028. * <p>
  27029. * The expression must return a <code>LabelStyle</code>.
  27030. * </p>
  27031. * <p>
  27032. * This expression is only applicable to point features in a Vector tile.
  27033. * </p>
  27034. * @example
  27035. * var style = new Cesium3DTileStyle({
  27036. * labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL
  27037. * });
  27038. * style.labelStyle.evaluate(feature); // returns a LabelStyle
  27039. * @example
  27040. * var style = new Cesium.Cesium3DTileStyle();
  27041. * // Override labelStyle expression with a custom function
  27042. * style.labelStyle = {
  27043. * evaluate : function(feature) {
  27044. * return LabelStyle.FILL;
  27045. * }
  27046. * };
  27047. */
  27048. labelStyle: StyleExpression;
  27049. /**
  27050. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelText</code> property. Alternatively a string or object defining a string style can be used.
  27051. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27052. * <p>
  27053. * The expression must return a <code>String</code>.
  27054. * </p>
  27055. * <p>
  27056. * This expression is only applicable to point features in a Vector tile.
  27057. * </p>
  27058. * @example
  27059. * var style = new Cesium3DTileStyle({
  27060. * labelText : '(${Temperature} > 90) ? ">90" : "<=90"'
  27061. * });
  27062. * style.labelText.evaluate(feature); // returns a String
  27063. * @example
  27064. * var style = new Cesium.Cesium3DTileStyle();
  27065. * // Override labelText expression with a custom function
  27066. * style.labelText = {
  27067. * evaluate : function(feature) {
  27068. * return 'Example label text';
  27069. * }
  27070. * };
  27071. */
  27072. labelText: StyleExpression;
  27073. /**
  27074. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundColor</code> property. Alternatively a string or object defining a color style can be used.
  27075. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27076. * <p>
  27077. * The expression must return a <code>Color</code>.
  27078. * </p>
  27079. * <p>
  27080. * This expression is only applicable to point features in a Vector tile.
  27081. * </p>
  27082. * @example
  27083. * var style = new Cesium.Cesium3DTileStyle();
  27084. * // Override backgroundColor expression with a string
  27085. * style.backgroundColor = 'color("blue")';
  27086. * @example
  27087. * var style = new Cesium.Cesium3DTileStyle();
  27088. * // Override backgroundColor expression with a condition
  27089. * style.backgroundColor = {
  27090. * conditions : [
  27091. * ['${height} > 2', 'color("cyan")'],
  27092. * ['true', 'color("blue")']
  27093. * ]
  27094. * };
  27095. */
  27096. backgroundColor: StyleExpression;
  27097. /**
  27098. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundPadding</code> property. Alternatively a string or object defining a vec2 style can be used.
  27099. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27100. * <p>
  27101. * The expression must return a <code>Cartesian2</code>.
  27102. * </p>
  27103. * <p>
  27104. * This expression is only applicable to point features in a Vector tile.
  27105. * </p>
  27106. * @example
  27107. * var style = new Cesium.Cesium3DTileStyle();
  27108. * // Override backgroundPadding expression with a string
  27109. * style.backgroundPadding = 'vec2(5.0, 7.0)';
  27110. * style.backgroundPadding.evaluate(feature); // returns a Cartesian2
  27111. */
  27112. backgroundPadding: StyleExpression;
  27113. /**
  27114. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>backgroundEnabled</code> property. Alternatively a string or object defining a boolean style can be used.
  27115. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27116. * <p>
  27117. * The expression must return a <code>Boolean</code>.
  27118. * </p>
  27119. * <p>
  27120. * This expression is only applicable to point features in a Vector tile.
  27121. * </p>
  27122. * @example
  27123. * var style = new Cesium.Cesium3DTileStyle();
  27124. * // Override backgroundEnabled expression with a string
  27125. * style.backgroundEnabled = 'true';
  27126. * @example
  27127. * var style = new Cesium.Cesium3DTileStyle();
  27128. * // Override backgroundEnabled expression with a condition
  27129. * style.backgroundEnabled = {
  27130. * conditions : [
  27131. * ['${height} > 2', 'true'],
  27132. * ['true', 'false']
  27133. * ]
  27134. * };
  27135. */
  27136. backgroundEnabled: StyleExpression;
  27137. /**
  27138. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>scaleByDistance</code> property. Alternatively a string or object defining a vec4 style can be used.
  27139. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27140. * <p>
  27141. * The expression must return a <code>Cartesian4</code>.
  27142. * </p>
  27143. * <p>
  27144. * This expression is only applicable to point features in a Vector tile.
  27145. * </p>
  27146. * @example
  27147. * var style = new Cesium.Cesium3DTileStyle();
  27148. * // Override scaleByDistance expression with a string
  27149. * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';
  27150. * style.scaleByDistance.evaluate(feature); // returns a Cartesian4
  27151. */
  27152. scaleByDistance: StyleExpression;
  27153. /**
  27154. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>translucencyByDistance</code> property. Alternatively a string or object defining a vec4 style can be used.
  27155. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27156. * <p>
  27157. * The expression must return a <code>Cartesian4</code>.
  27158. * </p>
  27159. * <p>
  27160. * This expression is only applicable to point features in a Vector tile.
  27161. * </p>
  27162. * @example
  27163. * var style = new Cesium.Cesium3DTileStyle();
  27164. * // Override translucencyByDistance expression with a string
  27165. * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';
  27166. * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4
  27167. */
  27168. translucencyByDistance: StyleExpression;
  27169. /**
  27170. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>distanceDisplayCondition</code> property. Alternatively a string or object defining a vec2 style can be used.
  27171. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27172. * <p>
  27173. * The expression must return a <code>Cartesian2</code>.
  27174. * </p>
  27175. * <p>
  27176. * This expression is only applicable to point features in a Vector tile.
  27177. * </p>
  27178. * @example
  27179. * var style = new Cesium.Cesium3DTileStyle();
  27180. * // Override distanceDisplayCondition expression with a string
  27181. * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';
  27182. * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2
  27183. */
  27184. distanceDisplayCondition: StyleExpression;
  27185. /**
  27186. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>heightOffset</code> property. Alternatively a string or object defining a number style can be used.
  27187. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27188. * <p>
  27189. * The expression must return a <code>Number</code>.
  27190. * </p>
  27191. * <p>
  27192. * This expression is only applicable to point features in a Vector tile.
  27193. * </p>
  27194. * @example
  27195. * var style = new Cesium.Cesium3DTileStyle();
  27196. * // Override heightOffset expression with a string
  27197. * style.heightOffset = '2.0';
  27198. * @example
  27199. * var style = new Cesium.Cesium3DTileStyle();
  27200. * // Override heightOffset expression with a condition
  27201. * style.heightOffset = {
  27202. * conditions : [
  27203. * ['${height} > 2', '4.0'],
  27204. * ['true', '2.0']
  27205. * ]
  27206. * };
  27207. */
  27208. heightOffset: StyleExpression;
  27209. /**
  27210. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineEnabled</code> property. Alternatively a string or object defining a boolean style can be used.
  27211. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27212. * <p>
  27213. * The expression must return a <code>Boolean</code>.
  27214. * </p>
  27215. * <p>
  27216. * This expression is only applicable to point features in a Vector tile.
  27217. * </p>
  27218. * @example
  27219. * var style = new Cesium.Cesium3DTileStyle();
  27220. * // Override anchorLineEnabled expression with a string
  27221. * style.anchorLineEnabled = 'true';
  27222. * @example
  27223. * var style = new Cesium.Cesium3DTileStyle();
  27224. * // Override anchorLineEnabled expression with a condition
  27225. * style.anchorLineEnabled = {
  27226. * conditions : [
  27227. * ['${height} > 2', 'true'],
  27228. * ['true', 'false']
  27229. * ]
  27230. * };
  27231. */
  27232. anchorLineEnabled: StyleExpression;
  27233. /**
  27234. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>anchorLineColor</code> property. Alternatively a string or object defining a color style can be used.
  27235. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27236. * <p>
  27237. * The expression must return a <code>Color</code>.
  27238. * </p>
  27239. * <p>
  27240. * This expression is only applicable to point features in a Vector tile.
  27241. * </p>
  27242. * @example
  27243. * var style = new Cesium.Cesium3DTileStyle();
  27244. * // Override anchorLineColor expression with a string
  27245. * style.anchorLineColor = 'color("blue")';
  27246. * @example
  27247. * var style = new Cesium.Cesium3DTileStyle();
  27248. * // Override anchorLineColor expression with a condition
  27249. * style.anchorLineColor = {
  27250. * conditions : [
  27251. * ['${height} > 2', 'color("cyan")'],
  27252. * ['true', 'color("blue")']
  27253. * ]
  27254. * };
  27255. */
  27256. anchorLineColor: StyleExpression;
  27257. /**
  27258. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>image</code> property. Alternatively a string or object defining a string style can be used.
  27259. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27260. * <p>
  27261. * The expression must return a <code>String</code>.
  27262. * </p>
  27263. * <p>
  27264. * This expression is only applicable to point features in a Vector tile.
  27265. * </p>
  27266. * @example
  27267. * var style = new Cesium3DTileStyle({
  27268. * image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"'
  27269. * });
  27270. * style.image.evaluate(feature); // returns a String
  27271. * @example
  27272. * var style = new Cesium.Cesium3DTileStyle();
  27273. * // Override image expression with a custom function
  27274. * style.image = {
  27275. * evaluate : function(feature) {
  27276. * return '/url/to/image';
  27277. * }
  27278. * };
  27279. */
  27280. image: StyleExpression;
  27281. /**
  27282. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>disableDepthTestDistance</code> property. Alternatively a string or object defining a number style can be used.
  27283. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27284. * <p>
  27285. * The expression must return a <code>Number</code>.
  27286. * </p>
  27287. * <p>
  27288. * This expression is only applicable to point features in a Vector tile.
  27289. * </p>
  27290. * @example
  27291. * var style = new Cesium.Cesium3DTileStyle();
  27292. * // Override disableDepthTestDistance expression with a string
  27293. * style.disableDepthTestDistance = '1000.0';
  27294. * style.disableDepthTestDistance.evaluate(feature); // returns a Number
  27295. */
  27296. disableDepthTestDistance: StyleExpression;
  27297. /**
  27298. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>horizontalOrigin</code> property. Alternatively a string or object defining a number style can be used.
  27299. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27300. * <p>
  27301. * The expression must return a <code>HorizontalOrigin</code>.
  27302. * </p>
  27303. * <p>
  27304. * This expression is only applicable to point features in a Vector tile.
  27305. * </p>
  27306. * @example
  27307. * var style = new Cesium3DTileStyle({
  27308. * horizontalOrigin : HorizontalOrigin.LEFT
  27309. * });
  27310. * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27311. * @example
  27312. * var style = new Cesium.Cesium3DTileStyle();
  27313. * // Override horizontalOrigin expression with a custom function
  27314. * style.horizontalOrigin = {
  27315. * evaluate : function(feature) {
  27316. * return HorizontalOrigin.CENTER;
  27317. * }
  27318. * };
  27319. */
  27320. horizontalOrigin: StyleExpression;
  27321. /**
  27322. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>verticalOrigin</code> property. Alternatively a string or object defining a number style can be used.
  27323. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27324. * <p>
  27325. * The expression must return a <code>VerticalOrigin</code>.
  27326. * </p>
  27327. * <p>
  27328. * This expression is only applicable to point features in a Vector tile.
  27329. * </p>
  27330. * @example
  27331. * var style = new Cesium3DTileStyle({
  27332. * verticalOrigin : VerticalOrigin.TOP
  27333. * });
  27334. * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27335. * @example
  27336. * var style = new Cesium.Cesium3DTileStyle();
  27337. * // Override verticalOrigin expression with a custom function
  27338. * style.verticalOrigin = {
  27339. * evaluate : function(feature) {
  27340. * return VerticalOrigin.CENTER;
  27341. * }
  27342. * };
  27343. */
  27344. verticalOrigin: StyleExpression;
  27345. /**
  27346. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelHorizontalOrigin</code> property. Alternatively a string or object defining a number style can be used.
  27347. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27348. * <p>
  27349. * The expression must return a <code>HorizontalOrigin</code>.
  27350. * </p>
  27351. * <p>
  27352. * This expression is only applicable to point features in a Vector tile.
  27353. * </p>
  27354. * @example
  27355. * var style = new Cesium3DTileStyle({
  27356. * labelHorizontalOrigin : HorizontalOrigin.LEFT
  27357. * });
  27358. * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27359. * @example
  27360. * var style = new Cesium.Cesium3DTileStyle();
  27361. * // Override labelHorizontalOrigin expression with a custom function
  27362. * style.labelHorizontalOrigin = {
  27363. * evaluate : function(feature) {
  27364. * return HorizontalOrigin.CENTER;
  27365. * }
  27366. * };
  27367. */
  27368. labelHorizontalOrigin: StyleExpression;
  27369. /**
  27370. * Gets or sets the {@link StyleExpression} object used to evaluate the style's <code>labelVerticalOrigin</code> property. Alternatively a string or object defining a number style can be used.
  27371. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27372. * <p>
  27373. * The expression must return a <code>VerticalOrigin</code>.
  27374. * </p>
  27375. * <p>
  27376. * This expression is only applicable to point features in a Vector tile.
  27377. * </p>
  27378. * @example
  27379. * var style = new Cesium3DTileStyle({
  27380. * labelVerticalOrigin : VerticalOrigin.TOP
  27381. * });
  27382. * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27383. * @example
  27384. * var style = new Cesium.Cesium3DTileStyle();
  27385. * // Override labelVerticalOrigin expression with a custom function
  27386. * style.labelVerticalOrigin = {
  27387. * evaluate : function(feature) {
  27388. * return VerticalOrigin.CENTER;
  27389. * }
  27390. * };
  27391. */
  27392. labelVerticalOrigin: StyleExpression;
  27393. /**
  27394. * Gets or sets the object containing application-specific expression that can be explicitly
  27395. * evaluated, e.g., for display in a UI.
  27396. * @example
  27397. * var style = new Cesium3DTileStyle({
  27398. * meta : {
  27399. * description : '"Building id ${id} has height ${Height}."'
  27400. * }
  27401. * });
  27402. * style.meta.description.evaluate(feature); // returns a String with the substituted variables
  27403. */
  27404. meta: StyleExpression;
  27405. }
  27406. /**
  27407. * A {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},
  27408. * used for streaming massive heterogeneous 3D geospatial datasets.
  27409. * @example
  27410. * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27411. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  27412. * }));
  27413. * @example
  27414. * // Common setting for the skipLevelOfDetail optimization
  27415. * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27416. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  27417. * skipLevelOfDetail : true,
  27418. * baseScreenSpaceError : 1024,
  27419. * skipScreenSpaceErrorFactor : 16,
  27420. * skipLevels : 1,
  27421. * immediatelyLoadDesiredLevelOfDetail : false,
  27422. * loadSiblings : false,
  27423. * cullWithChildrenBounds : true
  27424. * }));
  27425. * @example
  27426. * // Common settings for the dynamicScreenSpaceError optimization
  27427. * var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  27428. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  27429. * dynamicScreenSpaceError : true,
  27430. * dynamicScreenSpaceErrorDensity : 0.00278,
  27431. * dynamicScreenSpaceErrorFactor : 4.0,
  27432. * dynamicScreenSpaceErrorHeightFalloff : 0.25
  27433. * }));
  27434. * @param options - Object with the following properties:
  27435. * @param options.url - The url to a tileset JSON file.
  27436. * @param [options.show = true] - Determines if the tileset will be shown.
  27437. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the tileset's root tile.
  27438. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources.
  27439. * @param [options.maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement.
  27440. * @param [options.maximumMemoryUsage = 512] - The maximum amount of memory in MB that can be used by the tileset.
  27441. * @param [options.cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes.
  27442. * @param [options.cullRequestsWhileMoving = true] - Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.
  27443. * @param [options.cullRequestsWhileMovingMultiplier = 60.0] - Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  27444. * @param [options.preloadWhenHidden = false] - Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
  27445. * @param [options.preloadFlightDestinations = true] - Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
  27446. * @param [options.preferLeaves = false] - Optimization option. Prefer loading of leaves first.
  27447. * @param [options.dynamicScreenSpaceError = false] - Optimization option. Reduce the screen space error for tiles that are further away from the camera.
  27448. * @param [options.dynamicScreenSpaceErrorDensity = 0.00278] - Density used to adjust the dynamic screen space error, similar to fog density.
  27449. * @param [options.dynamicScreenSpaceErrorFactor = 4.0] - A factor used to increase the computed dynamic screen space error.
  27450. * @param [options.dynamicScreenSpaceErrorHeightFalloff = 0.25] - A ratio of the tileset's height at which the density starts to falloff.
  27451. * @param [options.progressiveResolutionHeightFraction = 0.3] - Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
  27452. * @param [options.foveatedScreenSpaceError = true] - Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the screen space error for tiles around the edge of the screen. Screen space error returns to normal once all the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
  27453. * @param [options.foveatedConeSize = 0.1] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred. Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and their screen space error. This is controlled by {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}. Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, disabling the effect.
  27454. * @param [options.foveatedMinimumScreenSpaceErrorRelaxation = 0.0] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone. The screen space error will be raised starting with tileset value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
  27455. * @param [options.foveatedInterpolationCallback = Math.lerp] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone, interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}
  27456. * @param [options.foveatedTimeDelay = 0.2] - Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how long in seconds to wait after the camera stops moving before deferred tiles start loading in. This time delay prevents requesting tiles around the edges of the screen when the camera is moving. Setting this to 0.0 will immediately request all tiles in any given view.
  27457. * @param [options.skipLevelOfDetail = false] - Optimization option. Determines if level of detail skipping should be applied during the traversal.
  27458. * @param [options.baseScreenSpaceError = 1024] - When <code>skipLevelOfDetail</code> is <code>true</code>, the screen space error that must be reached before skipping levels of detail.
  27459. * @param [options.skipScreenSpaceErrorFactor = 16] - When <code>skipLevelOfDetail</code> is <code>true</code>, a multiplier defining the minimum screen space error to skip. Used in conjunction with <code>skipLevels</code> to determine which tiles to load.
  27460. * @param [options.skipLevels = 1] - When <code>skipLevelOfDetail</code> is <code>true</code>, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with <code>skipScreenSpaceErrorFactor</code> to determine which tiles to load.
  27461. * @param [options.immediatelyLoadDesiredLevelOfDetail = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.
  27462. * @param [options.loadSiblings = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
  27463. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  27464. * @param [options.classificationType] - Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.
  27465. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe.
  27466. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
  27467. * @param [options.imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - Scales the diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.
  27468. * @param [options.lightColor] - The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  27469. * @param [options.luminanceAtZenith = 0.2] - The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  27470. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  27471. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  27472. * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the glTF material's doubleSided property; when false, back face culling is disabled.
  27473. * @param [options.showOutline = true] - Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
  27474. * @param [options.vectorClassificationOnly = false] - Indicates that only the tileset's vector tiles should be used for classification.
  27475. * @param [options.vectorKeepDecodedPositions = false] - Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
  27476. * @param [options.debugHeatmapTilePropertyName] - The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.
  27477. * @param [options.debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering.
  27478. * @param [options.debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile.
  27479. * @param [options.debugWireframe = false] - For debugging only. When true, render's each tile's content as a wireframe.
  27480. * @param [options.debugShowBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile.
  27481. * @param [options.debugShowContentBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile's content.
  27482. * @param [options.debugShowViewerRequestVolume = false] - For debugging only. When true, renders the viewer request volume for each tile.
  27483. * @param [options.debugShowGeometricError = false] - For debugging only. When true, draws labels to indicate the geometric error of each tile.
  27484. * @param [options.debugShowRenderingStatistics = false] - For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
  27485. * @param [options.debugShowMemoryUsage = false] - For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
  27486. * @param [options.debugShowUrl = false] - For debugging only. When true, draws labels to indicate the url of each tile.
  27487. */
  27488. export class Cesium3DTileset {
  27489. constructor(options: {
  27490. url: Resource | string | Promise<Resource> | Promise<string>;
  27491. show?: boolean;
  27492. modelMatrix?: Matrix4;
  27493. shadows?: ShadowMode;
  27494. maximumScreenSpaceError?: number;
  27495. maximumMemoryUsage?: number;
  27496. cullWithChildrenBounds?: boolean;
  27497. cullRequestsWhileMoving?: boolean;
  27498. cullRequestsWhileMovingMultiplier?: number;
  27499. preloadWhenHidden?: boolean;
  27500. preloadFlightDestinations?: boolean;
  27501. preferLeaves?: boolean;
  27502. dynamicScreenSpaceError?: boolean;
  27503. dynamicScreenSpaceErrorDensity?: number;
  27504. dynamicScreenSpaceErrorFactor?: number;
  27505. dynamicScreenSpaceErrorHeightFalloff?: number;
  27506. progressiveResolutionHeightFraction?: number;
  27507. foveatedScreenSpaceError?: boolean;
  27508. foveatedConeSize?: number;
  27509. foveatedMinimumScreenSpaceErrorRelaxation?: number;
  27510. foveatedInterpolationCallback?: Cesium3DTileset.foveatedInterpolationCallback;
  27511. foveatedTimeDelay?: number;
  27512. skipLevelOfDetail?: boolean;
  27513. baseScreenSpaceError?: number;
  27514. skipScreenSpaceErrorFactor?: number;
  27515. skipLevels?: number;
  27516. immediatelyLoadDesiredLevelOfDetail?: boolean;
  27517. loadSiblings?: boolean;
  27518. clippingPlanes?: ClippingPlaneCollection;
  27519. classificationType?: ClassificationType;
  27520. ellipsoid?: Ellipsoid;
  27521. pointCloudShading?: any;
  27522. imageBasedLightingFactor?: Cartesian2;
  27523. lightColor?: Cartesian3;
  27524. luminanceAtZenith?: number;
  27525. sphericalHarmonicCoefficients?: Cartesian3[];
  27526. specularEnvironmentMaps?: string;
  27527. backFaceCulling?: boolean;
  27528. showOutline?: boolean;
  27529. vectorClassificationOnly?: boolean;
  27530. vectorKeepDecodedPositions?: boolean;
  27531. debugHeatmapTilePropertyName?: string;
  27532. debugFreezeFrame?: boolean;
  27533. debugColorizeTiles?: boolean;
  27534. debugWireframe?: boolean;
  27535. debugShowBoundingVolume?: boolean;
  27536. debugShowContentBoundingVolume?: boolean;
  27537. debugShowViewerRequestVolume?: boolean;
  27538. debugShowGeometricError?: boolean;
  27539. debugShowRenderingStatistics?: boolean;
  27540. debugShowMemoryUsage?: boolean;
  27541. debugShowUrl?: boolean;
  27542. });
  27543. /**
  27544. * Optimization option. Don't request tiles that will likely be unused when they come back because of the camera's movement. This optimization only applies to stationary tilesets.
  27545. */
  27546. cullRequestsWhileMoving: boolean;
  27547. /**
  27548. * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  27549. */
  27550. cullRequestsWhileMovingMultiplier: number;
  27551. /**
  27552. * Optimization option. If between (0.0, 0.5], tiles at or above the screen space error for the reduced screen resolution of <code>progressiveResolutionHeightFraction*screenHeight</code> will be prioritized first. This can help get a quick layer of tiles down while full resolution tiles continue to load.
  27553. */
  27554. progressiveResolutionHeightFraction: number;
  27555. /**
  27556. * Optimization option. Prefer loading of leaves first.
  27557. */
  27558. preferLeaves: boolean;
  27559. /**
  27560. * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
  27561. */
  27562. preloadWhenHidden: boolean;
  27563. /**
  27564. * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.
  27565. */
  27566. preloadFlightDestinations: boolean;
  27567. /**
  27568. * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further
  27569. * away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer
  27570. * tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance.
  27571. * The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking
  27572. * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.
  27573. */
  27574. dynamicScreenSpaceError: boolean;
  27575. /**
  27576. * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the
  27577. * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all
  27578. * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
  27579. */
  27580. foveatedScreenSpaceError: boolean;
  27581. /**
  27582. * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone,
  27583. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  27584. */
  27585. foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback;
  27586. /**
  27587. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control
  27588. * how long in seconds to wait after the camera stops moving before deferred tiles start loading in.
  27589. * This time delay prevents requesting tiles around the edges of the screen when the camera is moving.
  27590. * Setting this to 0.0 will immediately request all tiles in any given view.
  27591. */
  27592. foveatedTimeDelay: number;
  27593. /**
  27594. * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this
  27595. * value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion.
  27596. * The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically.
  27597. * This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles
  27598. * beyond a certain distance all roughly having an error of 1.0.
  27599. * <p>
  27600. * The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the
  27601. * final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.
  27602. * </p>
  27603. * <p>
  27604. * Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera.
  27605. * It is analogous to moving fog closer to the camera.
  27606. * </p>
  27607. */
  27608. dynamicScreenSpaceErrorDensity: number;
  27609. /**
  27610. * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles
  27611. * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.
  27612. */
  27613. dynamicScreenSpaceErrorFactor: number;
  27614. /**
  27615. * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the
  27616. * full computed density is applied, otherwise the density falls off. This has the effect of higher density at
  27617. * street level views.
  27618. * <p>
  27619. * Valid values are between 0.0 and 1.0.
  27620. * </p>
  27621. */
  27622. dynamicScreenSpaceErrorHeightFalloff: number;
  27623. /**
  27624. * Determines whether the tileset casts or receives shadows from light sources.
  27625. * <p>
  27626. * Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view.
  27627. * </p>
  27628. * <p>
  27629. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  27630. * </p>
  27631. */
  27632. shadows: ShadowMode;
  27633. /**
  27634. * Determines if the tileset will be shown.
  27635. */
  27636. show: boolean;
  27637. /**
  27638. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  27639. * the original feature, e.g. glTF material or per-point color in the tile.
  27640. */
  27641. colorBlendMode: Cesium3DTileColorBlendMode;
  27642. /**
  27643. * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>.
  27644. * A value of 0.0 results in the source color while a value of 1.0 results in the feature color, with any value in-between
  27645. * resulting in a mix of the source color and feature color.
  27646. */
  27647. colorBlendAmount: number;
  27648. /**
  27649. * Options for controlling point size based on geometric error and eye dome lighting.
  27650. */
  27651. pointCloudShading: PointCloudShading;
  27652. /**
  27653. * The event fired to indicate progress of loading new tiles. This event is fired when a new tile
  27654. * is requested, when a requested tile is finished downloading, and when a downloaded tile has been
  27655. * processed and is ready to render.
  27656. * <p>
  27657. * The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles
  27658. * processing, <code>numberOfTilesProcessing</code> are passed to the event listener.
  27659. * </p>
  27660. * <p>
  27661. * This event is fired at the end of the frame after the scene is rendered.
  27662. * </p>
  27663. * @example
  27664. * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
  27665. * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
  27666. * console.log('Stopped loading');
  27667. * return;
  27668. * }
  27669. *
  27670. * console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing);
  27671. * });
  27672. */
  27673. loadProgress: Event;
  27674. /**
  27675. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset
  27676. * is completely loaded for this view.
  27677. * <p>
  27678. * This event is fired at the end of the frame after the scene is rendered.
  27679. * </p>
  27680. * @example
  27681. * tileset.allTilesLoaded.addEventListener(function() {
  27682. * console.log('All tiles are loaded');
  27683. * });
  27684. */
  27685. allTilesLoaded: Event;
  27686. /**
  27687. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
  27688. * is fired once when all tiles in the initial view are loaded.
  27689. * <p>
  27690. * This event is fired at the end of the frame after the scene is rendered.
  27691. * </p>
  27692. * @example
  27693. * tileset.initialTilesLoaded.addEventListener(function() {
  27694. * console.log('Initial tiles are loaded');
  27695. * });
  27696. */
  27697. initialTilesLoaded: Event;
  27698. /**
  27699. * The event fired to indicate that a tile's content was loaded.
  27700. * <p>
  27701. * The loaded {@link Cesium3DTile} is passed to the event listener.
  27702. * </p>
  27703. * <p>
  27704. * This event is fired during the tileset traversal while the frame is being rendered
  27705. * so that updates to the tile take effect in the same frame. Do not create or modify
  27706. * Cesium entities or primitives during the event listener.
  27707. * </p>
  27708. * @example
  27709. * tileset.tileLoad.addEventListener(function(tile) {
  27710. * console.log('A tile was loaded.');
  27711. * });
  27712. */
  27713. tileLoad: Event;
  27714. /**
  27715. * The event fired to indicate that a tile's content was unloaded.
  27716. * <p>
  27717. * The unloaded {@link Cesium3DTile} is passed to the event listener.
  27718. * </p>
  27719. * <p>
  27720. * This event is fired immediately before the tile's content is unloaded while the frame is being
  27721. * rendered so that the event listener has access to the tile's content. Do not create
  27722. * or modify Cesium entities or primitives during the event listener.
  27723. * </p>
  27724. * @example
  27725. * tileset.tileUnload.addEventListener(function(tile) {
  27726. * console.log('A tile was unloaded from the cache.');
  27727. * });
  27728. */
  27729. tileUnload: Event;
  27730. /**
  27731. * The event fired to indicate that a tile's content failed to load.
  27732. * <p>
  27733. * If there are no event listeners, error messages will be logged to the console.
  27734. * </p>
  27735. * <p>
  27736. * The error object passed to the listener contains two properties:
  27737. * <ul>
  27738. * <li><code>url</code>: the url of the failed tile.</li>
  27739. * <li><code>message</code>: the error message.</li>
  27740. * </ul>
  27741. * <p>
  27742. * If the <code>3DTILES_multiple_contents</code> extension is used, this event is raised once per inner content with errors.
  27743. * </p>
  27744. * @example
  27745. * tileset.tileFailed.addEventListener(function(error) {
  27746. * console.log('An error occurred loading tile: ' + error.url);
  27747. * console.log('Error: ' + error.message);
  27748. * });
  27749. */
  27750. tileFailed: Event;
  27751. /**
  27752. * This event fires once for each visible tile in a frame. This can be used to manually
  27753. * style a tileset.
  27754. * <p>
  27755. * The visible {@link Cesium3DTile} is passed to the event listener.
  27756. * </p>
  27757. * <p>
  27758. * This event is fired during the tileset traversal while the frame is being rendered
  27759. * so that updates to the tile take effect in the same frame. Do not create or modify
  27760. * Cesium entities or primitives during the event listener.
  27761. * </p>
  27762. * @example
  27763. * tileset.tileVisible.addEventListener(function(tile) {
  27764. * if (tile.content instanceof Cesium.Batched3DModel3DTileContent) {
  27765. * console.log('A Batched 3D Model tile is visible.');
  27766. * }
  27767. * });
  27768. * @example
  27769. * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
  27770. * tileset.style = new Cesium.Cesium3DTileStyle({
  27771. * color : 'color("red")'
  27772. * });
  27773. * tileset.tileVisible.addEventListener(function(tile) {
  27774. * var content = tile.content;
  27775. * var featuresLength = content.featuresLength;
  27776. * for (var i = 0; i < featuresLength; i+=2) {
  27777. * content.getFeature(i).color = Cesium.Color.fromRandom();
  27778. * }
  27779. * });
  27780. */
  27781. tileVisible: Event;
  27782. /**
  27783. * Optimization option. Determines if level of detail skipping should be applied during the traversal.
  27784. * <p>
  27785. * The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require
  27786. * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped
  27787. * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when
  27788. * using this optimization.
  27789. * </p>
  27790. */
  27791. skipLevelOfDetail: boolean;
  27792. /**
  27793. * The screen space error that must be reached before skipping levels of detail.
  27794. * <p>
  27795. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27796. * </p>
  27797. */
  27798. baseScreenSpaceError: number;
  27799. /**
  27800. * Multiplier defining the minimum screen space error to skip.
  27801. * For example, if a tile has screen space error of 100, no tiles will be loaded unless they
  27802. * are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>.
  27803. * <p>
  27804. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27805. * </p>
  27806. */
  27807. skipScreenSpaceErrorFactor: number;
  27808. /**
  27809. * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped.
  27810. * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.
  27811. * <p>
  27812. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27813. * </p>
  27814. */
  27815. skipLevels: number;
  27816. /**
  27817. * When true, only tiles that meet the maximum screen space error will ever be downloaded.
  27818. * Skipping factors are ignored and just the desired tiles are loaded.
  27819. * <p>
  27820. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27821. * </p>
  27822. */
  27823. immediatelyLoadDesiredLevelOfDetail: boolean;
  27824. /**
  27825. * Determines whether siblings of visible tiles are always downloaded during traversal.
  27826. * This may be useful for ensuring that tiles are already available when the viewer turns left/right.
  27827. * <p>
  27828. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  27829. * </p>
  27830. */
  27831. loadSiblings: boolean;
  27832. /**
  27833. * The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  27834. * <p>
  27835. * For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code> will make the
  27836. * model much darker. Here, increasing the intensity of the light source will make the model brighter.
  27837. * </p>
  27838. */
  27839. lightColor: Cartesian3;
  27840. /**
  27841. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  27842. * This is used when {@link Cesium3DTileset#specularEnvironmentMaps} and {@link Cesium3DTileset#sphericalHarmonicCoefficients} are not defined.
  27843. */
  27844. luminanceAtZenith: number;
  27845. /**
  27846. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  27847. * computed from the atmosphere color is used.
  27848. * <p>
  27849. * There are nine <code>Cartesian3</code> coefficients.
  27850. * The order of the coefficients is: L<sub>00</sub>, L<sub>1-1</sub>, L<sub>10</sub>, L<sub>11</sub>, L<sub>2-2</sub>, L<sub>2-1</sub>, L<sub>20</sub>, L<sub>21</sub>, L<sub>22</sub>
  27851. * </p>
  27852. *
  27853. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  27854. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  27855. * supplied to {@link Cesium3DTileset#specularEnvironmentMaps}.
  27856. */
  27857. sphericalHarmonicCoefficients: Cartesian3[];
  27858. /**
  27859. * A URL to a KTX file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  27860. */
  27861. specularEnvironmentMaps: string;
  27862. /**
  27863. * Whether to cull back-facing geometry. When true, back face culling is determined
  27864. * by the glTF material's doubleSided property; when false, back face culling is disabled.
  27865. */
  27866. backFaceCulling: boolean;
  27867. /**
  27868. * Whether to display the outline for models using the
  27869. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.
  27870. * When true, outlines are displayed. When false, outlines are not displayed.
  27871. */
  27872. readonly showOutline: boolean;
  27873. /**
  27874. * This property is for debugging only; it is not optimized for production use.
  27875. * <p>
  27876. * Determines if only the tiles from last frame should be used for rendering. This
  27877. * effectively "freezes" the tileset to the previous frame so it is possible to zoom
  27878. * out and see what was rendered.
  27879. * </p>
  27880. */
  27881. debugFreezeFrame: boolean;
  27882. /**
  27883. * This property is for debugging only; it is not optimized for production use.
  27884. * <p>
  27885. * When true, assigns a random color to each tile. This is useful for visualizing
  27886. * what features belong to what tiles, especially with additive refinement where features
  27887. * from parent tiles may be interleaved with features from child tiles.
  27888. * </p>
  27889. */
  27890. debugColorizeTiles: boolean;
  27891. /**
  27892. * This property is for debugging only; it is not optimized for production use.
  27893. * <p>
  27894. * When true, renders each tile's content as a wireframe.
  27895. * </p>
  27896. */
  27897. debugWireframe: boolean;
  27898. /**
  27899. * This property is for debugging only; it is not optimized for production use.
  27900. * <p>
  27901. * When true, renders the bounding volume for each visible tile. The bounding volume is
  27902. * white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the
  27903. * screen space error and are still refining to their descendants are yellow.
  27904. * </p>
  27905. */
  27906. debugShowBoundingVolume: boolean;
  27907. /**
  27908. * This property is for debugging only; it is not optimized for production use.
  27909. * <p>
  27910. * When true, renders the bounding volume for each visible tile's content. The bounding volume is
  27911. * blue if the tile has a content bounding volume; otherwise it is red.
  27912. * </p>
  27913. */
  27914. debugShowContentBoundingVolume: boolean;
  27915. /**
  27916. * This property is for debugging only; it is not optimized for production use.
  27917. * <p>
  27918. * When true, renders the viewer request volume for each tile.
  27919. * </p>
  27920. */
  27921. debugShowViewerRequestVolume: boolean;
  27922. /**
  27923. * This property is for debugging only; it is not optimized for production use.
  27924. * <p>
  27925. * When true, draws labels to indicate the geometric error of each tile.
  27926. * </p>
  27927. */
  27928. debugShowGeometricError: boolean;
  27929. /**
  27930. * This property is for debugging only; it is not optimized for production use.
  27931. * <p>
  27932. * When true, draws labels to indicate the number of commands, points, triangles and features of each tile.
  27933. * </p>
  27934. */
  27935. debugShowRenderingStatistics: boolean;
  27936. /**
  27937. * This property is for debugging only; it is not optimized for production use.
  27938. * <p>
  27939. * When true, draws labels to indicate the geometry and texture memory usage of each tile.
  27940. * </p>
  27941. */
  27942. debugShowMemoryUsage: boolean;
  27943. /**
  27944. * This property is for debugging only; it is not optimized for production use.
  27945. * <p>
  27946. * When true, draws labels to indicate the url of each tile.
  27947. * </p>
  27948. */
  27949. debugShowUrl: boolean;
  27950. /**
  27951. * Function for examining vector lines as they are being streamed.
  27952. */
  27953. examineVectorLinesFunction: (...params: any[]) => any;
  27954. /**
  27955. * Gets the tileset's asset object property, which contains metadata about the tileset.
  27956. * <p>
  27957. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-asset|asset schema reference}
  27958. * in the 3D Tiles spec for the full set of properties.
  27959. * </p>
  27960. */
  27961. readonly asset: any;
  27962. /**
  27963. * Gets the tileset's extensions object property.
  27964. */
  27965. readonly extensions: any;
  27966. /**
  27967. * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  27968. */
  27969. clippingPlanes: ClippingPlaneCollection;
  27970. /**
  27971. * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
  27972. * <p>
  27973. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-properties|properties schema reference}
  27974. * in the 3D Tiles spec for the full set of properties.
  27975. * </p>
  27976. * @example
  27977. * console.log('Maximum building height: ' + tileset.properties.height.maximum);
  27978. * console.log('Minimum building height: ' + tileset.properties.height.minimum);
  27979. */
  27980. readonly properties: any;
  27981. /**
  27982. * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render.
  27983. * This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved.
  27984. */
  27985. readonly ready: boolean;
  27986. /**
  27987. * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render.
  27988. * <p>
  27989. * This promise is resolved at the end of the frame before the first frame the tileset is rendered in.
  27990. * </p>
  27991. * @example
  27992. * tileset.readyPromise.then(function(tileset) {
  27993. * // tile.properties is not defined until readyPromise resolves.
  27994. * var properties = tileset.properties;
  27995. * if (Cesium.defined(properties)) {
  27996. * for (var name in properties) {
  27997. * console.log(properties[name]);
  27998. * }
  27999. * }
  28000. * });
  28001. */
  28002. readonly readyPromise: Promise<Cesium3DTileset>;
  28003. /**
  28004. * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is
  28005. * completely loaded for this view.
  28006. */
  28007. readonly tilesLoaded: boolean;
  28008. /**
  28009. * The resource used to fetch the tileset JSON file
  28010. */
  28011. readonly resource: Resource;
  28012. /**
  28013. * The base path that non-absolute paths in tileset JSON file are relative to.
  28014. */
  28015. readonly basePath: string;
  28016. /**
  28017. * The style, defined using the
  28018. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},
  28019. * applied to each feature in the tileset.
  28020. * <p>
  28021. * Assign <code>undefined</code> to remove the style, which will restore the visual
  28022. * appearance of the tileset to its default when no style was applied.
  28023. * </p>
  28024. * <p>
  28025. * The style is applied to a tile before the {@link Cesium3DTileset#tileVisible}
  28026. * event is raised, so code in <code>tileVisible</code> can manually set a feature's
  28027. * properties (e.g. color and show) after the style is applied. When
  28028. * a new style is assigned any manually set properties are overwritten.
  28029. * </p>
  28030. * <p>
  28031. * Use an always "true" condition to specify the Color for all objects that are not
  28032. * overridden by pre-existing conditions. Otherwise, the default color Cesium.Color.White
  28033. * will be used. Similarly, use an always "true" condition to specify the show property
  28034. * for all objects that are not overridden by pre-existing conditions. Otherwise, the
  28035. * default show value true will be used.
  28036. * </p>
  28037. * @example
  28038. * tileset.style = new Cesium.Cesium3DTileStyle({
  28039. * color : {
  28040. * conditions : [
  28041. * ['${Height} >= 100', 'color("purple", 0.5)'],
  28042. * ['${Height} >= 50', 'color("red")'],
  28043. * ['true', 'color("blue")']
  28044. * ]
  28045. * },
  28046. * show : '${Height} > 0',
  28047. * meta : {
  28048. * description : '"Building id ${id} has height ${Height}."'
  28049. * }
  28050. * });
  28051. */
  28052. style: Cesium3DTileStyle | undefined;
  28053. /**
  28054. * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile
  28055. * refines to its descendants, and therefore plays a major role in balancing performance with visual quality.
  28056. * <p>
  28057. * A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a
  28058. * radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds
  28059. * <code>maximumScreenSpaceError</code> the tile refines to its descendants.
  28060. * </p>
  28061. * <p>
  28062. * Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance.
  28063. * Higher values provide better performance but lower visual quality.
  28064. * </p>
  28065. */
  28066. maximumScreenSpaceError: number;
  28067. /**
  28068. * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from
  28069. * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also
  28070. * includes per-point metadata.
  28071. * <p>
  28072. * Tiles not in view are unloaded to enforce this.
  28073. * </p>
  28074. * <p>
  28075. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  28076. * </p>
  28077. * <p>
  28078. * If tiles sized more than <code>maximumMemoryUsage</code> are needed
  28079. * to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},
  28080. * for the current view, then the memory usage of the tiles loaded will exceed
  28081. * <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but
  28082. * 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When
  28083. * these tiles go out of view, they will be unloaded.
  28084. * </p>
  28085. */
  28086. maximumMemoryUsage: number;
  28087. /**
  28088. * The root tile.
  28089. */
  28090. readonly root: Cesium3DTile;
  28091. /**
  28092. * The tileset's bounding sphere.
  28093. * @example
  28094. * var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
  28095. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  28096. * }));
  28097. *
  28098. * tileset.readyPromise.then(function(tileset) {
  28099. * // Set the camera to view the newly added tileset
  28100. * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
  28101. * });
  28102. */
  28103. readonly boundingSphere: BoundingSphere;
  28104. /**
  28105. * A 4x4 transformation matrix that transforms the entire tileset.
  28106. * @example
  28107. * // Adjust a tileset's height from the globe's surface.
  28108. * var heightOffset = 20.0;
  28109. * var boundingSphere = tileset.boundingSphere;
  28110. * var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  28111. * var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
  28112. * var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
  28113. * var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  28114. * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  28115. */
  28116. modelMatrix: Matrix4;
  28117. /**
  28118. * Returns the time, in milliseconds, since the tileset was loaded and first updated.
  28119. */
  28120. readonly timeSinceLoad: number;
  28121. /**
  28122. * The total amount of GPU memory in bytes used by the tileset. This value is estimated from
  28123. * geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also
  28124. * includes per-point metadata.
  28125. */
  28126. readonly totalMemoryUsageInBytes: number;
  28127. /**
  28128. * Determines whether terrain, 3D Tiles or both will be classified by this tileset.
  28129. * <p>
  28130. * This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data
  28131. * must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets.
  28132. * </p>
  28133. * <p>
  28134. * When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF:
  28135. * <ul>
  28136. * <li>POSITION and _BATCHID semantics are required.</li>
  28137. * <li>All indices with the same batch id must occupy contiguous sections of the index buffer.</li>
  28138. * <li>All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.</li>
  28139. * <li>The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.</li>
  28140. * <li>Only one node is supported.</li>
  28141. * <li>Only one mesh per node is supported.</li>
  28142. * <li>Only one primitive per mesh is supported.</li>
  28143. * </ul>
  28144. * </p>
  28145. */
  28146. readonly classificationType: ClassificationType;
  28147. /**
  28148. * Gets an ellipsoid describing the shape of the globe.
  28149. */
  28150. readonly ellipsoid: Ellipsoid;
  28151. /**
  28152. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred.
  28153. * Tiles that are inside this cone are loaded immediately. Tiles outside the cone are potentially deferred based on how far outside the cone they are and {@link Cesium3DTileset#foveatedInterpolationCallback} and {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation}.
  28154. * Setting this to 0.0 means the cone will be the line formed by the camera position and its view direction. Setting this to 1.0 means the cone encompasses the entire field of view of the camera, essentially disabling the effect.
  28155. */
  28156. foveatedConeSize: number;
  28157. /**
  28158. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone.
  28159. * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
  28160. */
  28161. foveatedMinimumScreenSpaceErrorRelaxation: number;
  28162. /**
  28163. * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata.
  28164. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  28165. */
  28166. readonly extras: any;
  28167. /**
  28168. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  28169. * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  28170. */
  28171. imageBasedLightingFactor: Cartesian2;
  28172. /**
  28173. * Indicates that only the tileset's vector tiles should be used for classification.
  28174. */
  28175. vectorClassificationOnly: boolean;
  28176. /**
  28177. * Whether vector tiles should keep decoded positions in memory.
  28178. * This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
  28179. */
  28180. vectorKeepDecodedPositions: boolean;
  28181. /**
  28182. * Provides a hook to override the method used to request the tileset json
  28183. * useful when fetching tilesets from remote servers
  28184. * @param tilesetUrl - The url of the json file to be fetched
  28185. * @returns A promise that resolves with the fetched json data
  28186. */
  28187. static loadJson(tilesetUrl: Resource | string): Promise<object>;
  28188. /**
  28189. * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all
  28190. * features to re-evaluate the style in the next frame each is visible.
  28191. */
  28192. makeStyleDirty(): void;
  28193. /**
  28194. * Unloads all tiles that weren't selected the previous frame. This can be used to
  28195. * explicitly manage the tile cache and reduce the total number of tiles loaded below
  28196. * {@link Cesium3DTileset#maximumMemoryUsage}.
  28197. * <p>
  28198. * Tile unloads occur at the next frame to keep all the WebGL delete calls
  28199. * within the render loop.
  28200. * </p>
  28201. */
  28202. trimLoadedTiles(): void;
  28203. /**
  28204. * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  28205. * @param extensionName - The name of the extension to check.
  28206. * @returns <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  28207. */
  28208. hasExtension(extensionName: string): boolean;
  28209. /**
  28210. * Returns true if this object was destroyed; otherwise, false.
  28211. * <br /><br />
  28212. * If this object was destroyed, it should not be used; calling any function other than
  28213. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28214. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28215. */
  28216. isDestroyed(): boolean;
  28217. /**
  28218. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28219. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28220. * <br /><br />
  28221. * Once an object is destroyed, it should not be used; calling any function other than
  28222. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28223. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28224. * @example
  28225. * tileset = tileset && tileset.destroy();
  28226. */
  28227. destroy(): void;
  28228. }
  28229. export namespace Cesium3DTileset {
  28230. /**
  28231. * Optimization option. Used as a callback when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control how much to raise the screen space error for tiles outside the foveated cone,
  28232. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  28233. * @param p - The start value to interpolate.
  28234. * @param q - The end value to interpolate.
  28235. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  28236. */
  28237. type foveatedInterpolationCallback = (p: number, q: number, time: number) => number;
  28238. }
  28239. /**
  28240. * A ParticleEmitter that emits particles from a circle.
  28241. * Particles will be positioned within a circle and have initial velocities going along the z vector.
  28242. * @param [radius = 1.0] - The radius of the circle in meters.
  28243. */
  28244. export class CircleEmitter {
  28245. constructor(radius?: number);
  28246. /**
  28247. * The radius of the circle in meters.
  28248. */
  28249. radius: number;
  28250. /**
  28251. * The angle of the cone in radians.
  28252. */
  28253. angle: number;
  28254. }
  28255. /**
  28256. * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.
  28257. * <p>
  28258. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  28259. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  28260. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  28261. * and match most of them and add a new geometry or appearance independently of each other.
  28262. * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using
  28263. * ClassificationPrimitive directly.
  28264. * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.
  28265. * </p>
  28266. * <p>
  28267. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  28268. * will be rendering artifacts for some viewing angles.
  28269. * </p>
  28270. * <p>
  28271. * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.
  28272. * </p>
  28273. * <p>
  28274. * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},
  28275. * are also valid if they are extruded volumes; otherwise, they will not be rendered.
  28276. * </p>
  28277. * @param [options] - Object with the following properties:
  28278. * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one.
  28279. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.
  28280. * @param [options.show = true] - Determines if this primitive will be shown.
  28281. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28282. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  28283. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  28284. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28285. * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  28286. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  28287. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  28288. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  28289. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on
  28290. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  28291. */
  28292. export class ClassificationPrimitive {
  28293. constructor(options?: {
  28294. geometryInstances?: any[] | GeometryInstance;
  28295. appearance?: Appearance;
  28296. show?: boolean;
  28297. vertexCacheOptimize?: boolean;
  28298. interleave?: boolean;
  28299. compressVertices?: boolean;
  28300. releaseGeometryInstances?: boolean;
  28301. allowPicking?: boolean;
  28302. asynchronous?: boolean;
  28303. classificationType?: ClassificationType;
  28304. debugShowBoundingVolume?: boolean;
  28305. debugShowShadowVolume?: boolean;
  28306. });
  28307. /**
  28308. * The geometry instance rendered with this primitive. This may
  28309. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  28310. * is <code>true</code> when the primitive is constructed.
  28311. * <p>
  28312. * Changing this property after the primitive is rendered has no effect.
  28313. * </p>
  28314. * <p>
  28315. * Because of the rendering technique used, all geometry instances must be the same color.
  28316. * If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown
  28317. * on the first attempt to render.
  28318. * </p>
  28319. */
  28320. readonly geometryInstances: any[] | GeometryInstance;
  28321. /**
  28322. * Determines if the primitive will be shown. This affects all geometry
  28323. * instances in the primitive.
  28324. */
  28325. show: boolean;
  28326. /**
  28327. * Determines whether terrain, 3D Tiles or both will be classified.
  28328. */
  28329. classificationType: ClassificationType;
  28330. /**
  28331. * This property is for debugging only; it is not for production use nor is it optimized.
  28332. * <p>
  28333. * Draws the bounding sphere for each draw command in the primitive.
  28334. * </p>
  28335. */
  28336. debugShowBoundingVolume: boolean;
  28337. /**
  28338. * This property is for debugging only; it is not for production use nor is it optimized.
  28339. * <p>
  28340. * Draws the shadow volume for each geometry in the primitive.
  28341. * </p>
  28342. */
  28343. debugShowShadowVolume: boolean;
  28344. /**
  28345. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28346. */
  28347. readonly vertexCacheOptimize: boolean;
  28348. /**
  28349. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  28350. */
  28351. readonly interleave: boolean;
  28352. /**
  28353. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28354. */
  28355. readonly releaseGeometryInstances: boolean;
  28356. /**
  28357. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  28358. */
  28359. readonly allowPicking: boolean;
  28360. /**
  28361. * Determines if the geometry instances will be created and batched on a web worker.
  28362. */
  28363. readonly asynchronous: boolean;
  28364. /**
  28365. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  28366. */
  28367. readonly compressVertices: boolean;
  28368. /**
  28369. * Determines if the primitive is complete and ready to render. If this property is
  28370. * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}
  28371. * is called.
  28372. */
  28373. readonly ready: boolean;
  28374. /**
  28375. * Gets a promise that resolves when the primitive is ready to render.
  28376. */
  28377. readonly readyPromise: Promise<ClassificationPrimitive>;
  28378. /**
  28379. * Determines if ClassificationPrimitive rendering is supported.
  28380. * @param scene - The scene.
  28381. * @returns <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>
  28382. */
  28383. static isSupported(scene: Scene): boolean;
  28384. /**
  28385. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  28386. * get the draw commands needed to render this primitive.
  28387. * <p>
  28388. * Do not call this function directly. This is documented just to
  28389. * list the exceptions that may be propagated when the scene is rendered:
  28390. * </p>
  28391. */
  28392. update(): void;
  28393. /**
  28394. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  28395. * @example
  28396. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  28397. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  28398. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  28399. * @param id - The id of the {@link GeometryInstance}.
  28400. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  28401. */
  28402. getGeometryInstanceAttributes(id: any): any;
  28403. /**
  28404. * Returns true if this object was destroyed; otherwise, false.
  28405. * <p>
  28406. * If this object was destroyed, it should not be used; calling any function other than
  28407. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28408. * </p>
  28409. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28410. */
  28411. isDestroyed(): boolean;
  28412. /**
  28413. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28414. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28415. * <p>
  28416. * Once an object is destroyed, it should not be used; calling any function other than
  28417. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28418. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28419. * </p>
  28420. * @example
  28421. * e = e && e.destroy();
  28422. */
  28423. destroy(): void;
  28424. }
  28425. /**
  28426. * Whether a classification affects terrain, 3D Tiles or both.
  28427. */
  28428. export enum ClassificationType {
  28429. /**
  28430. * Only terrain will be classified.
  28431. */
  28432. TERRAIN = 0,
  28433. /**
  28434. * Only 3D Tiles will be classified.
  28435. */
  28436. CESIUM_3D_TILE = 1,
  28437. /**
  28438. * Both terrain and 3D Tiles will be classified.
  28439. */
  28440. BOTH = 2
  28441. }
  28442. /**
  28443. * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
  28444. * Compatible with mathematics functions in {@link Plane}
  28445. * @param normal - The plane's normal (normalized).
  28446. * @param distance - The shortest distance from the origin to the plane. The sign of
  28447. * <code>distance</code> determines which side of the plane the origin
  28448. * is on. If <code>distance</code> is positive, the origin is in the half-space
  28449. * in the direction of the normal; if negative, the origin is in the half-space
  28450. * opposite to the normal; if zero, the plane passes through the origin.
  28451. */
  28452. export class ClippingPlane {
  28453. constructor(normal: Cartesian3, distance: number);
  28454. /**
  28455. * The shortest distance from the origin to the plane. The sign of
  28456. * <code>distance</code> determines which side of the plane the origin
  28457. * is on. If <code>distance</code> is positive, the origin is in the half-space
  28458. * in the direction of the normal; if negative, the origin is in the half-space
  28459. * opposite to the normal; if zero, the plane passes through the origin.
  28460. */
  28461. distance: number;
  28462. /**
  28463. * The plane's normal.
  28464. */
  28465. normal: Cartesian3;
  28466. /**
  28467. * Create a ClippingPlane from a Plane object.
  28468. * @param plane - The plane containing parameters to copy
  28469. * @param [result] - The object on which to store the result
  28470. * @returns The ClippingPlane generated from the plane's parameters.
  28471. */
  28472. static fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane;
  28473. /**
  28474. * Clones the ClippingPlane without setting its ownership.
  28475. * @param clippingPlane - The ClippingPlane to be cloned
  28476. * @param [result] - The object on which to store the cloned parameters.
  28477. * @returns a clone of the input ClippingPlane
  28478. */
  28479. static clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane;
  28480. }
  28481. /**
  28482. * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the
  28483. * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.
  28484. * <p>
  28485. * In general the clipping planes' coordinates are relative to the object they're attached to, so a plane with distance set to 0 will clip
  28486. * through the center of the object.
  28487. * </p>
  28488. * <p>
  28489. * For 3D Tiles, the root tile's transform is used to position the clipping planes. If a transform is not defined, the root tile's {@link Cesium3DTile#boundingSphere} is used instead.
  28490. * </p>
  28491. * @example
  28492. * // This clipping plane's distance is positive, which means its normal
  28493. * // is facing the origin. This will clip everything that is behind
  28494. * // the plane, which is anything with y coordinate < -5.
  28495. * var clippingPlanes = new Cesium.ClippingPlaneCollection({
  28496. * planes : [
  28497. * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)
  28498. * ],
  28499. * });
  28500. * // Create an entity and attach the ClippingPlaneCollection to the model.
  28501. * var entity = viewer.entities.add({
  28502. * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),
  28503. * model : {
  28504. * uri : 'model.gltf',
  28505. * minimumPixelSize : 128,
  28506. * maximumScale : 20000,
  28507. * clippingPlanes : clippingPlanes
  28508. * }
  28509. * });
  28510. * viewer.zoomTo(entity);
  28511. * @param [options] - Object with the following properties:
  28512. * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.
  28513. * @param [options.enabled = true] - Determines whether the clipping planes are active.
  28514. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.
  28515. * @param [options.unionClippingRegions = false] - If true, a region will be clipped if it is on the outside of any plane in the collection. Otherwise, a region will only be clipped if it is on the outside of every plane.
  28516. * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped.
  28517. * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  28518. */
  28519. export class ClippingPlaneCollection {
  28520. constructor(options?: {
  28521. planes?: ClippingPlane[];
  28522. enabled?: boolean;
  28523. modelMatrix?: Matrix4;
  28524. unionClippingRegions?: boolean;
  28525. edgeColor?: Color;
  28526. edgeWidth?: number;
  28527. });
  28528. /**
  28529. * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
  28530. * original coordinate system.
  28531. */
  28532. modelMatrix: Matrix4;
  28533. /**
  28534. * The color applied to highlight the edge along which an object is clipped.
  28535. */
  28536. edgeColor: Color;
  28537. /**
  28538. * The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  28539. */
  28540. edgeWidth: number;
  28541. /**
  28542. * An event triggered when a new clipping plane is added to the collection. Event handlers
  28543. * are passed the new plane and the index at which it was added.
  28544. */
  28545. planeAdded: Event;
  28546. /**
  28547. * An event triggered when a new clipping plane is removed from the collection. Event handlers
  28548. * are passed the new plane and the index from which it was removed.
  28549. */
  28550. planeRemoved: Event;
  28551. /**
  28552. * Returns the number of planes in this collection. This is commonly used with
  28553. * {@link ClippingPlaneCollection#get} to iterate over all the planes
  28554. * in the collection.
  28555. */
  28556. readonly length: number;
  28557. /**
  28558. * If true, a region will be clipped if it is on the outside of any plane in the
  28559. * collection. Otherwise, a region will only be clipped if it is on the
  28560. * outside of every plane.
  28561. */
  28562. unionClippingRegions: boolean;
  28563. /**
  28564. * If true, clipping will be enabled.
  28565. */
  28566. enabled: boolean;
  28567. /**
  28568. * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering
  28569. * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify
  28570. * how modify the clipping behavior of multiple planes.
  28571. * @param plane - The ClippingPlane to add to the collection.
  28572. */
  28573. add(plane: ClippingPlane): void;
  28574. /**
  28575. * Returns the plane in the collection at the specified index. Indices are zero-based
  28576. * and increase as planes are added. Removing a plane shifts all planes after
  28577. * it to the left, changing their indices. This function is commonly used with
  28578. * {@link ClippingPlaneCollection#length} to iterate over all the planes
  28579. * in the collection.
  28580. * @param index - The zero-based index of the plane.
  28581. * @returns The ClippingPlane at the specified index.
  28582. */
  28583. get(index: number): ClippingPlane;
  28584. /**
  28585. * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.
  28586. * @param [clippingPlane] - The ClippingPlane to check for.
  28587. * @returns true if this collection contains the ClippingPlane, false otherwise.
  28588. */
  28589. contains(clippingPlane?: ClippingPlane): boolean;
  28590. /**
  28591. * Removes the first occurrence of the given ClippingPlane from the collection.
  28592. * @returns <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.
  28593. */
  28594. remove(clippingPlane: ClippingPlane): boolean;
  28595. /**
  28596. * Removes all planes from the collection.
  28597. */
  28598. removeAll(): void;
  28599. /**
  28600. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  28601. * build the resources for clipping planes.
  28602. * <p>
  28603. * Do not call this function directly.
  28604. * </p>
  28605. */
  28606. update(): void;
  28607. /**
  28608. * Returns true if this object was destroyed; otherwise, false.
  28609. * <br /><br />
  28610. * If this object was destroyed, it should not be used; calling any function other than
  28611. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28612. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28613. */
  28614. isDestroyed(): boolean;
  28615. /**
  28616. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28617. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28618. * <br /><br />
  28619. * Once an object is destroyed, it should not be used; calling any function other than
  28620. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28621. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28622. * @example
  28623. * clippingPlanes = clippingPlanes && clippingPlanes.destroy();
  28624. */
  28625. destroy(): void;
  28626. }
  28627. /**
  28628. * A renderable collection of clouds in the 3D scene.
  28629. * <br /><br />
  28630. * <div align='center'>
  28631. * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />
  28632. * Example cumulus clouds
  28633. * </div>
  28634. * <br /><br />
  28635. * Clouds are added and removed from the collection using {@link CloudCollection#add}
  28636. * and {@link CloudCollection#remove}.
  28637. * @example
  28638. * // Create a cloud collection with two cumulus clouds
  28639. * var clouds = scene.primitives.add(new Cesium.CloudCollection());
  28640. * clouds.add({
  28641. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  28642. * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 8.0)
  28643. * });
  28644. * clouds.add({
  28645. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  28646. * maximumSize: new Cesium.Cartesian3(15.0, 9.0, 9.0),
  28647. * slice: 0.5
  28648. * });
  28649. * @param [options] - Object with the following properties:
  28650. * @param [options.show = true] - Whether to display the clouds.
  28651. * @param [options.noiseDetail = 16.0] - Desired amount of detail in the noise texture.
  28652. * @param [options.noiseOffset = Cartesian3.ZERO] - Desired translation of data in noise texture.
  28653. * @param [options.debugBillboards = false] - For debugging only. Determines if the billboards are rendered with an opaque color.
  28654. * @param [options.debugEllipsoids = false] - For debugging only. Determines if the clouds will be rendered as opaque ellipsoids.
  28655. */
  28656. export class CloudCollection {
  28657. constructor(options?: {
  28658. show?: boolean;
  28659. noiseDetail?: number;
  28660. noiseOffset?: number;
  28661. debugBillboards?: boolean;
  28662. debugEllipsoids?: boolean;
  28663. });
  28664. /**
  28665. * <p>
  28666. * Controls the amount of detail captured in the precomputed noise texture
  28667. * used to render the cumulus clouds. In order for the texture to be tileable,
  28668. * this must be a power of two. For best results, set this to be a power of two
  28669. * between <code>8.0</code> and <code>32.0</code> (inclusive).
  28670. * </p>
  28671. *
  28672. * <div align='center'>
  28673. * <table border='0' cellpadding='5'><tr>
  28674. * <td align='center'>
  28675. * <code>clouds.noiseDetail = 8.0;</code><br/>
  28676. * <img src='Images/CloudCollection.noiseDetail8.png' width='250' height='158' />
  28677. * </td>
  28678. * <td align='center'>
  28679. * <code>clouds.noiseDetail = 32.0;</code><br/>
  28680. * <img src='Images/CloudCollection.noiseDetail32.png' width='250' height='158' />
  28681. * </td>
  28682. * </tr></table>
  28683. * </div>
  28684. */
  28685. noiseDetail: number;
  28686. /**
  28687. * <p>
  28688. * Applies a translation to noise texture coordinates to generate different data.
  28689. * This can be modified if the default noise does not generate good-looking clouds.
  28690. * </p>
  28691. *
  28692. * <div align='center'>
  28693. * <table border='0' cellpadding='5'><tr>
  28694. * <td align='center'>
  28695. * <code>default</code><br/>
  28696. * <img src='Images/CloudCollection.noiseOffsetdefault.png' width='250' height='158' />
  28697. * </td>
  28698. * <td align='center'>
  28699. * <code>clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);</code><br/>
  28700. * <img src='Images/CloudCollection.noiseOffsetx10y20z10.png' width='250' height='158' />
  28701. * </td>
  28702. * </tr></table>
  28703. * </div>
  28704. */
  28705. noiseOffset: Cartesian3;
  28706. /**
  28707. * Determines if billboards in this collection will be shown.
  28708. */
  28709. show: boolean;
  28710. /**
  28711. * This property is for debugging only; it is not for production use nor is it optimized.
  28712. * <p>
  28713. * Renders the billboards with one opaque color for the sake of debugging.
  28714. * </p>
  28715. */
  28716. debugBillboards: boolean;
  28717. /**
  28718. * This property is for debugging only; it is not for production use nor is it optimized.
  28719. * <p>
  28720. * Draws the clouds as opaque, monochrome ellipsoids for the sake of debugging.
  28721. * If <code>debugBillboards</code> is also true, then the ellipsoids will draw on top of the billboards.
  28722. * </p>
  28723. */
  28724. debugEllipsoids: boolean;
  28725. /**
  28726. * Returns the number of clouds in this collection.
  28727. */
  28728. length: number;
  28729. /**
  28730. * Creates and adds a cloud with the specified initial properties to the collection.
  28731. * The added cloud is returned so it can be modified or removed from the collection later.
  28732. * @example
  28733. * // Example 1: Add a cumulus cloud, specifying all the default values.
  28734. * var c = clouds.add({
  28735. * show : true,
  28736. * position : Cesium.Cartesian3.ZERO,
  28737. * scale : new Cesium.Cartesian2(20.0, 12.0),
  28738. * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 12.0),
  28739. * slice: -1.0,
  28740. * cloudType : CloudType.CUMULUS
  28741. * });
  28742. * @example
  28743. * // Example 2: Specify only the cloud's cartographic position.
  28744. * var c = clouds.add({
  28745. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  28746. * });
  28747. * @param [options] - A template describing the cloud's properties as shown in Example 1.
  28748. * @returns The cloud that was added to the collection.
  28749. */
  28750. add(options?: any): CumulusCloud;
  28751. /**
  28752. * Removes a cloud from the collection.
  28753. * @example
  28754. * var c = clouds.add(...);
  28755. * clouds.remove(c); // Returns true
  28756. * @param cloud - The cloud to remove.
  28757. * @returns <code>true</code> if the cloud was removed; <code>false</code> if the cloud was not found in the collection.
  28758. */
  28759. remove(cloud: CumulusCloud): boolean;
  28760. /**
  28761. * Removes all clouds from the collection.
  28762. * @example
  28763. * clouds.add(...);
  28764. * clouds.add(...);
  28765. * clouds.removeAll();
  28766. */
  28767. removeAll(): void;
  28768. /**
  28769. * Check whether this collection contains a given cloud.
  28770. * @param [cloud] - The cloud to check for.
  28771. * @returns true if this collection contains the cloud, false otherwise.
  28772. */
  28773. contains(cloud?: CumulusCloud): boolean;
  28774. /**
  28775. * Returns the cloud in the collection at the specified index. Indices are zero-based
  28776. * and increase as clouds are added. Removing a cloud shifts all clouds after
  28777. * it to the left, changing their indices. This function is commonly used with
  28778. * {@link CloudCollection#length} to iterate over all the clouds in the collection.
  28779. * @example
  28780. * // Toggle the show property of every cloud in the collection
  28781. * var len = clouds.length;
  28782. * for (var i = 0; i < len; ++i) {
  28783. * var c = clouds.get(i);
  28784. * c.show = !c.show;
  28785. * }
  28786. * @param index - The zero-based index of the cloud.
  28787. * @returns The cloud at the specified index.
  28788. */
  28789. get(index: number): CumulusCloud;
  28790. /**
  28791. * Returns true if this object was destroyed; otherwise, false.
  28792. * <br /><br />
  28793. * If this object was destroyed, it should not be used; calling any function other than
  28794. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28795. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28796. */
  28797. isDestroyed(): boolean;
  28798. /**
  28799. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28800. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28801. * <br /><br />
  28802. * Once an object is destroyed, it should not be used; calling any function other than
  28803. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28804. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28805. * @example
  28806. * clouds = clouds && clouds.destroy();
  28807. */
  28808. destroy(): void;
  28809. }
  28810. /**
  28811. * Specifies the type of the cloud that is added to a {@link CloudCollection} in {@link CloudCollection#add}.
  28812. */
  28813. export enum CloudType {
  28814. /**
  28815. * Cumulus cloud.
  28816. */
  28817. CUMULUS = 0
  28818. }
  28819. /**
  28820. * Defines different modes for blending between a target color and a primitive's source color.
  28821. *
  28822. * HIGHLIGHT multiplies the source color by the target color
  28823. * REPLACE replaces the source color with the target color
  28824. * MIX blends the source color and target color together
  28825. */
  28826. export enum ColorBlendMode {
  28827. HIGHLIGHT = 0,
  28828. REPLACE = 1,
  28829. MIX = 2
  28830. }
  28831. /**
  28832. * An expression for a style applied to a {@link Cesium3DTileset}.
  28833. * <p>
  28834. * Evaluates a conditions expression defined using the
  28835. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  28836. * </p>
  28837. * <p>
  28838. * Implements the {@link StyleExpression} interface.
  28839. * </p>
  28840. * @example
  28841. * var expression = new Cesium.ConditionsExpression({
  28842. * conditions : [
  28843. * ['${Area} > 10, 'color("#FF0000")'],
  28844. * ['${id} !== "1"', 'color("#00FF00")'],
  28845. * ['true', 'color("#FFFFFF")']
  28846. * ]
  28847. * });
  28848. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  28849. * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language.
  28850. * @param [defines] - Defines in the style.
  28851. */
  28852. export class ConditionsExpression {
  28853. constructor(conditionsExpression?: any, defines?: any);
  28854. /**
  28855. * Gets the conditions expression defined in the 3D Tiles Styling language.
  28856. */
  28857. readonly conditionsExpression: any;
  28858. /**
  28859. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  28860. * the expression in the
  28861. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  28862. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  28863. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  28864. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  28865. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  28866. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  28867. * @param feature - The feature whose properties may be used as variables in the expression.
  28868. * @param [result] - The object onto which to store the result.
  28869. * @returns The result of evaluating the expression.
  28870. */
  28871. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  28872. /**
  28873. * Evaluates the result of a Color expression, using the values defined by a feature.
  28874. * <p>
  28875. * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.
  28876. * </p>
  28877. * @param feature - The feature whose properties may be used as variables in the expression.
  28878. * @param [result] - The object in which to store the result
  28879. * @returns The modified result parameter or a new Color instance if one was not provided.
  28880. */
  28881. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  28882. }
  28883. /**
  28884. * A ParticleEmitter that emits particles within a cone.
  28885. * Particles will be positioned at the tip of the cone and have initial velocities going towards the base.
  28886. * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians.
  28887. */
  28888. export class ConeEmitter {
  28889. constructor(angle?: number);
  28890. }
  28891. /**
  28892. * The credit display is responsible for displaying credits on screen.
  28893. * @example
  28894. * var creditDisplay = new Cesium.CreditDisplay(creditContainer);
  28895. * @param container - The HTML element where credits will be displayed
  28896. * @param [delimiter = ' • '] - The string to separate text credits
  28897. * @param [viewport = document.body] - The HTML element that will contain the credits popup
  28898. */
  28899. export class CreditDisplay {
  28900. constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement);
  28901. /**
  28902. * The HTML element where credits will be displayed.
  28903. */
  28904. container: HTMLElement;
  28905. /**
  28906. * Adds a credit to the list of current credits to be displayed in the credit container
  28907. * @param credit - The credit to display
  28908. */
  28909. addCredit(credit: Credit): void;
  28910. /**
  28911. * Adds credits that will persist until they are removed
  28912. * @param credit - The credit to added to defaults
  28913. */
  28914. addDefaultCredit(credit: Credit): void;
  28915. /**
  28916. * Removes a default credit
  28917. * @param credit - The credit to be removed from defaults
  28918. */
  28919. removeDefaultCredit(credit: Credit): void;
  28920. /**
  28921. * Updates the credit display before a new frame is rendered.
  28922. */
  28923. update(): void;
  28924. /**
  28925. * Resets the credit display to a beginning of frame state, clearing out current credits.
  28926. */
  28927. beginFrame(): void;
  28928. /**
  28929. * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.
  28930. */
  28931. endFrame(): void;
  28932. /**
  28933. * Destroys the resources held by this object. Destroying an object allows for deterministic
  28934. * release of resources, instead of relying on the garbage collector to destroy this object.
  28935. * <br /><br />
  28936. * Once an object is destroyed, it should not be used; calling any function other than
  28937. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28938. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28939. */
  28940. destroy(): void;
  28941. /**
  28942. * Returns true if this object was destroyed; otherwise, false.
  28943. * <br /><br />
  28944. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28945. */
  28946. isDestroyed(): boolean;
  28947. /**
  28948. * Gets or sets the Cesium logo credit.
  28949. */
  28950. static cesiumCredit: Credit;
  28951. }
  28952. /**
  28953. * Determines which triangles, if any, are culled.
  28954. */
  28955. export enum CullFace {
  28956. /**
  28957. * Front-facing triangles are culled.
  28958. */
  28959. FRONT = WebGLConstants.FRONT,
  28960. /**
  28961. * Back-facing triangles are culled.
  28962. */
  28963. BACK = WebGLConstants.BACK,
  28964. /**
  28965. * Both front-facing and back-facing triangles are culled.
  28966. */
  28967. FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK
  28968. }
  28969. /**
  28970. * A cumulus cloud billboard positioned in the 3D scene, that is created and rendered using a {@link CloudCollection}.
  28971. * A cloud is created and its initial properties are set by calling {@link CloudCollection#add}.
  28972. * and {@link CloudCollection#remove}.
  28973. * <br /><br />
  28974. * <div align='center'>
  28975. * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />
  28976. * Example cumulus clouds
  28977. * </div>
  28978. */
  28979. export class CumulusCloud {
  28980. constructor();
  28981. /**
  28982. * Determines if this cumulus cloud will be shown. Use this to hide or show a cloud, instead
  28983. * of removing it and re-adding it to the collection.
  28984. */
  28985. show: boolean;
  28986. /**
  28987. * Gets or sets the Cartesian position of this cumulus cloud.
  28988. */
  28989. position: Cartesian3;
  28990. /**
  28991. * <p>Gets or sets the scale of the cumulus cloud billboard in meters.
  28992. * The <code>scale</code> property will affect the size of the billboard,
  28993. * but not the cloud's actual appearance.</p>
  28994. * <div align='center'>
  28995. * <table border='0' cellpadding='5'><tr>
  28996. * <td align='center'>
  28997. * <code>cloud.scale = new Cesium.Cartesian2(12, 8);</code><br/>
  28998. * <img src='Images/CumulusCloud.scalex12y8.png' width='250' height='158' />
  28999. * </td>
  29000. * <td align='center'>
  29001. * <code>cloud.scale = new Cesium.Cartesian2(24, 10);</code><br/>
  29002. * <img src='Images/CumulusCloud.scalex24y10.png' width='250' height='158' />
  29003. * </td>
  29004. * </tr></table>
  29005. * </div>
  29006. *
  29007. * <p>To modify the cloud's appearance, modify its <code>maximumSize</code>
  29008. * and <code>slice</code> properties.</p>
  29009. */
  29010. scale: Cartesian2;
  29011. /**
  29012. * <p>Gets or sets the maximum size of the cumulus cloud rendered on the billboard.
  29013. * This defines a maximum ellipsoid volume that the cloud can appear in.
  29014. * Rather than guaranteeing a specific size, this specifies a boundary for the
  29015. * cloud to appear in, and changing it can affect the shape of the cloud.</p>
  29016. * <p>Changing the z-value of <code>maximumSize</code> has the most dramatic effect
  29017. * on the cloud's appearance because it changes the depth of the cloud, and thus the
  29018. * positions at which the cloud-shaping texture is sampled.</p>
  29019. * <div align='center'>
  29020. * <table border='0' cellpadding='5'>
  29021. * <tr>
  29022. * <td align='center'>
  29023. * <code>cloud.maximumSize = new Cesium.Cartesian3(14, 9, 10);</code><br/>
  29024. * <img src='Images/CumulusCloud.maximumSizex14y9z10.png' width='250' height='158' />
  29025. * </td>
  29026. * <td align='center'>
  29027. * <code>cloud.maximumSize.x = 25;</code><br/>
  29028. * <img src='Images/CumulusCloud.maximumSizex25.png' width='250' height='158' />
  29029. * </td>
  29030. * </tr>
  29031. * <tr>
  29032. * <td align='center'>
  29033. * <code>cloud.maximumSize.y = 5;</code><br/>
  29034. * <img src='Images/CumulusCloud.maximumSizey5.png' width='250' height='158' />
  29035. * </td>
  29036. * <td align='center'>
  29037. * <code>cloud.maximumSize.z = 17;</code><br/>
  29038. * <img src='Images/CumulusCloud.maximumSizez17.png' width='250' height='158' />
  29039. * </td>
  29040. * </tr>
  29041. * </table>
  29042. * </div>
  29043. *
  29044. * <p>To modify the billboard's actual size, modify the cloud's <code>scale</code> property.</p>
  29045. */
  29046. maximumSize: Cartesian3;
  29047. /**
  29048. * <p>Gets or sets the "slice" of the cloud that is rendered on the billboard, i.e.
  29049. * the specific cross-section of the cloud chosen for the billboard's appearance.
  29050. * Given a value between 0 and 1, the slice specifies how deeply into the cloud
  29051. * to intersect based on its maximum size in the z-direction.</p>
  29052. * <div align='center'>
  29053. * <table border='0' cellpadding='5'><tr>
  29054. * <td align='center'><code>cloud.slice = 0.32;</code><br/><img src='Images/CumulusCloud.slice0.32.png' width='250' height='158' /></td>
  29055. * <td align='center'><code>cloud.slice = 0.5;</code><br/><img src='Images/CumulusCloud.slice0.5.png' width='250' height='158' /></td>
  29056. * <td align='center'><code>cloud.slice = 0.6;</code><br/><img src='Images/CumulusCloud.slice0.6.png' width='250' height='158' /></td>
  29057. * </tr></table>
  29058. * </div>
  29059. *
  29060. * <br />
  29061. * <p>Due to the nature in which this slice is calculated,
  29062. * values below <code>0.2</code> may result in cross-sections that are too small,
  29063. * and the edge of the ellipsoid will be visible. Similarly, values above <code>0.7</code>
  29064. * will cause the cloud to appear smaller. Values outside the range <code>[0.1, 0.9]</code>
  29065. * should be avoided entirely because they do not produce desirable results.</p>
  29066. *
  29067. * <div align='center'>
  29068. * <table border='0' cellpadding='5'><tr>
  29069. * <td align='center'><code>cloud.slice = 0.08;</code><br/><img src='Images/CumulusCloud.slice0.08.png' width='250' height='158' /></td>
  29070. * <td align='center'><code>cloud.slice = 0.8;</code><br/><img src='Images/CumulusCloud.slice0.8.png' width='250' height='158' /></td>
  29071. * </tr></table>
  29072. * </div>
  29073. *
  29074. * <p>If <code>slice</code> is set to a negative number, the cloud will not render a cross-section.
  29075. * Instead, it will render the outside of the ellipsoid that is visible. For clouds with
  29076. * small values of `maximumSize.z`, this can produce good-looking results, but for larger
  29077. * clouds, this can result in a cloud that is undesirably warped to the ellipsoid volume.</p>
  29078. *
  29079. * <div align='center'>
  29080. * <table border='0' cellpadding='5'><tr>
  29081. * <td align='center'>
  29082. * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 18;</code><br/>
  29083. * <img src='Images/CumulusCloud.slice-1z18.png' width='250' height='158' />
  29084. * </td>
  29085. * <td align='center'>
  29086. * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 30;</code><br/>
  29087. * <img src='Images/CumulusCloud.slice-1z30.png' width='250' height='158' /></td>
  29088. * </tr></table>
  29089. * </div>
  29090. */
  29091. slice: number;
  29092. /**
  29093. * Gets or sets the brightness of the cloud. This can be used to give clouds
  29094. * a darker, grayer appearance.
  29095. * <br /><br />
  29096. * <div align='center'>
  29097. * <table border='0' cellpadding='5'><tr>
  29098. * <td align='center'><code>cloud.brightness = 1.0;</code><br/><img src='Images/CumulusCloud.brightness1.png' width='250' height='158' /></td>
  29099. * <td align='center'><code>cloud.brightness = 0.6;</code><br/><img src='Images/CumulusCloud.brightness0.6.png' width='250' height='158' /></td>
  29100. * <td align='center'><code>cloud.brightness = 0.0;</code><br/><img src='Images/CumulusCloud.brightness0.png' width='250' height='158' /></td>
  29101. * </tr></table>
  29102. * </div>
  29103. */
  29104. brightness: number;
  29105. }
  29106. /**
  29107. * Visualizes a vertex attribute by displaying it as a color for debugging.
  29108. * <p>
  29109. * Components for well-known unit-length vectors, i.e., <code>normal</code>,
  29110. * <code>tangent</code>, and <code>bitangent</code>, are scaled and biased
  29111. * from [-1.0, 1.0] to (-1.0, 1.0).
  29112. * </p>
  29113. * @example
  29114. * var primitive = new Cesium.Primitive({
  29115. * geometryInstances : // ...
  29116. * appearance : new Cesium.DebugAppearance({
  29117. * attributeName : 'normal'
  29118. * })
  29119. * });
  29120. * @param options - Object with the following properties:
  29121. * @param options.attributeName - The name of the attribute to visualize.
  29122. * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute.
  29123. * @param [options.glslDatatype = 'vec3'] - The GLSL datatype of the attribute. Supported datatypes are <code>float</code>, <code>vec2</code>, <code>vec3</code>, and <code>vec4</code>.
  29124. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  29125. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  29126. * @param [options.renderState] - Optional render state to override the default render state.
  29127. */
  29128. export class DebugAppearance {
  29129. constructor(options: {
  29130. attributeName: string;
  29131. perInstanceAttribute?: boolean;
  29132. glslDatatype?: string;
  29133. vertexShaderSource?: string;
  29134. fragmentShaderSource?: string;
  29135. renderState?: any;
  29136. });
  29137. /**
  29138. * This property is part of the {@link Appearance} interface, but is not
  29139. * used by {@link DebugAppearance} since a fully custom fragment shader is used.
  29140. */
  29141. material: Material;
  29142. /**
  29143. * When <code>true</code>, the geometry is expected to appear translucent.
  29144. */
  29145. translucent: boolean;
  29146. /**
  29147. * The GLSL source code for the vertex shader.
  29148. */
  29149. readonly vertexShaderSource: string;
  29150. /**
  29151. * The GLSL source code for the fragment shader. The full fragment shader
  29152. * source is built procedurally taking into account the {@link DebugAppearance#material}.
  29153. * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source.
  29154. */
  29155. readonly fragmentShaderSource: string;
  29156. /**
  29157. * The WebGL fixed-function state to use when rendering the geometry.
  29158. */
  29159. readonly renderState: any;
  29160. /**
  29161. * When <code>true</code>, the geometry is expected to be closed.
  29162. */
  29163. readonly closed: boolean;
  29164. /**
  29165. * The name of the attribute being visualized.
  29166. */
  29167. readonly attributeName: string;
  29168. /**
  29169. * The GLSL datatype of the attribute being visualized.
  29170. */
  29171. readonly glslDatatype: string;
  29172. /**
  29173. * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just
  29174. * {@link DebugAppearance#fragmentShaderSource}.
  29175. * @returns The full GLSL fragment shader source.
  29176. */
  29177. getFragmentShaderSource(): string;
  29178. /**
  29179. * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}.
  29180. * @returns <code>true</code> if the appearance is translucent.
  29181. */
  29182. isTranslucent(): boolean;
  29183. /**
  29184. * Creates a render state. This is not the final render state instance; instead,
  29185. * it can contain a subset of render state properties identical to the render state
  29186. * created in the context.
  29187. * @returns The render state.
  29188. */
  29189. getRenderState(): any;
  29190. }
  29191. /**
  29192. * Draws the outline of the camera's view frustum.
  29193. * @example
  29194. * primitives.add(new Cesium.DebugCameraPrimitive({
  29195. * camera : camera,
  29196. * color : Cesium.Color.YELLOW
  29197. * }));
  29198. * @param options - Object with the following properties:
  29199. * @param options.camera - The camera.
  29200. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.
  29201. * @param [options.color = Color.CYAN] - The color of the debug outline.
  29202. * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes.
  29203. * @param [options.show = true] - Determines if this primitive will be shown.
  29204. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}.
  29205. */
  29206. export class DebugCameraPrimitive {
  29207. constructor(options: {
  29208. camera: Camera;
  29209. frustumSplits?: number[];
  29210. color?: Color;
  29211. updateOnChange?: boolean;
  29212. show?: boolean;
  29213. id?: any;
  29214. });
  29215. /**
  29216. * Determines if this primitive will be shown.
  29217. */
  29218. show: boolean;
  29219. /**
  29220. * User-defined value returned when the primitive is picked.
  29221. */
  29222. id: any;
  29223. /**
  29224. * Returns true if this object was destroyed; otherwise, false.
  29225. * <p>
  29226. * If this object was destroyed, it should not be used; calling any function other than
  29227. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29228. * </p>
  29229. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29230. */
  29231. isDestroyed(): boolean;
  29232. /**
  29233. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29234. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29235. * <p>
  29236. * Once an object is destroyed, it should not be used; calling any function other than
  29237. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29238. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29239. * </p>
  29240. * @example
  29241. * p = p && p.destroy();
  29242. */
  29243. destroy(): void;
  29244. }
  29245. /**
  29246. * Draws the axes of a reference frame defined by a matrix that transforms to world
  29247. * coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is
  29248. * a primitives <code>modelMatrix</code>.
  29249. * <p>
  29250. * The X axis is red; Y is green; and Z is blue.
  29251. * </p>
  29252. * <p>
  29253. * This is for debugging only; it is not optimized for production use.
  29254. * </p>
  29255. * @example
  29256. * primitives.add(new Cesium.DebugModelMatrixPrimitive({
  29257. * modelMatrix : primitive.modelMatrix, // primitive to debug
  29258. * length : 100000.0,
  29259. * width : 10.0
  29260. * }));
  29261. * @param [options] - Object with the following properties:
  29262. * @param [options.length = 10000000.0] - The length of the axes in meters.
  29263. * @param [options.width = 2.0] - The width of the axes in pixels.
  29264. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  29265. * @param [options.show = true] - Determines if this primitive will be shown.
  29266. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}
  29267. */
  29268. export class DebugModelMatrixPrimitive {
  29269. constructor(options?: {
  29270. length?: number;
  29271. width?: number;
  29272. modelMatrix?: Matrix4;
  29273. show?: boolean;
  29274. id?: any;
  29275. });
  29276. /**
  29277. * The length of the axes in meters.
  29278. */
  29279. length: number;
  29280. /**
  29281. * The width of the axes in pixels.
  29282. */
  29283. width: number;
  29284. /**
  29285. * Determines if this primitive will be shown.
  29286. */
  29287. show: boolean;
  29288. /**
  29289. * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  29290. */
  29291. modelMatrix: Matrix4;
  29292. /**
  29293. * User-defined value returned when the primitive is picked.
  29294. */
  29295. id: any;
  29296. /**
  29297. * Returns true if this object was destroyed; otherwise, false.
  29298. * <p>
  29299. * If this object was destroyed, it should not be used; calling any function other than
  29300. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29301. * </p>
  29302. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29303. */
  29304. isDestroyed(): boolean;
  29305. /**
  29306. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29307. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29308. * <p>
  29309. * Once an object is destroyed, it should not be used; calling any function other than
  29310. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29311. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29312. * </p>
  29313. * @example
  29314. * p = p && p.destroy();
  29315. */
  29316. destroy(): void;
  29317. }
  29318. /**
  29319. * Determines the function used to compare two depths for the depth test.
  29320. */
  29321. export enum DepthFunction {
  29322. /**
  29323. * The depth test never passes.
  29324. */
  29325. NEVER = WebGLConstants.NEVER,
  29326. /**
  29327. * The depth test passes if the incoming depth is less than the stored depth.
  29328. */
  29329. LESS = WebGLConstants.LESS,
  29330. /**
  29331. * The depth test passes if the incoming depth is equal to the stored depth.
  29332. */
  29333. EQUAL = WebGLConstants.EQUAL,
  29334. /**
  29335. * The depth test passes if the incoming depth is less than or equal to the stored depth.
  29336. */
  29337. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  29338. /**
  29339. * The depth test passes if the incoming depth is greater than the stored depth.
  29340. */
  29341. GREATER = WebGLConstants.GREATER,
  29342. /**
  29343. * The depth test passes if the incoming depth is not equal to the stored depth.
  29344. */
  29345. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  29346. /**
  29347. * The depth test passes if the incoming depth is greater than or equal to the stored depth.
  29348. */
  29349. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  29350. /**
  29351. * The depth test always passes.
  29352. */
  29353. ALWAYS = WebGLConstants.ALWAYS
  29354. }
  29355. /**
  29356. * A light that gets emitted in a single direction from infinitely far away.
  29357. * @param options - Object with the following properties:
  29358. * @param options.direction - The direction in which light gets emitted.
  29359. * @param [options.color = Color.WHITE] - The color of the light.
  29360. * @param [options.intensity = 1.0] - The intensity of the light.
  29361. */
  29362. export class DirectionalLight {
  29363. constructor(options: {
  29364. direction: Cartesian3;
  29365. color?: Color;
  29366. intensity?: number;
  29367. });
  29368. /**
  29369. * The direction in which light gets emitted.
  29370. */
  29371. direction: Cartesian3;
  29372. /**
  29373. * The color of the light.
  29374. */
  29375. color: Color;
  29376. /**
  29377. * The intensity of the light.
  29378. */
  29379. intensity: number;
  29380. }
  29381. /**
  29382. * A policy for discarding tile images that contain no data (and so aren't actually images).
  29383. * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is
  29384. * expected to be used in place of any empty tile images by the image loading code.
  29385. */
  29386. export class DiscardEmptyTileImagePolicy {
  29387. constructor();
  29388. /**
  29389. * Determines if the discard policy is ready to process images.
  29390. * @returns True if the discard policy is ready to process images; otherwise, false.
  29391. */
  29392. isReady(): boolean;
  29393. /**
  29394. * Given a tile image, decide whether to discard that image.
  29395. * @param image - An image to test.
  29396. * @returns True if the image should be discarded; otherwise, false.
  29397. */
  29398. shouldDiscardImage(image: HTMLImageElement): boolean;
  29399. /**
  29400. * Default value for representing an empty image.
  29401. */
  29402. static readonly EMPTY_IMAGE: HTMLImageElement;
  29403. }
  29404. /**
  29405. * A policy for discarding tile images that match a known image containing a
  29406. * "missing" image.
  29407. * @param options - Object with the following properties:
  29408. * @param options.missingImageUrl - The URL of the known missing image.
  29409. * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to
  29410. * compare against the missing image.
  29411. * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled
  29412. * if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the
  29413. * discard check will proceed no matter the values of the pixelsToCheck.
  29414. */
  29415. export class DiscardMissingTileImagePolicy {
  29416. constructor(options: {
  29417. missingImageUrl: Resource | string;
  29418. pixelsToCheck: Cartesian2[];
  29419. disableCheckIfAllPixelsAreTransparent?: boolean;
  29420. });
  29421. /**
  29422. * Determines if the discard policy is ready to process images.
  29423. * @returns True if the discard policy is ready to process images; otherwise, false.
  29424. */
  29425. isReady(): boolean;
  29426. /**
  29427. * Given a tile image, decide whether to discard that image.
  29428. * @param image - An image to test.
  29429. * @returns True if the image should be discarded; otherwise, false.
  29430. */
  29431. shouldDiscardImage(image: HTMLImageElement): boolean;
  29432. }
  29433. /**
  29434. * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry}
  29435. * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance}
  29436. * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires
  29437. * fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>,
  29438. * <code>tangent</code>, and <code>bitangent</code>.
  29439. * @example
  29440. * var primitive = new Cesium.Primitive({
  29441. * geometryInstances : new Cesium.GeometryInstance({
  29442. * geometry : new Cesium.PolygonGeometry({
  29443. * vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
  29444. * // ...
  29445. * })
  29446. * }),
  29447. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  29448. * material : Cesium.Material.fromType('Stripe')
  29449. * })
  29450. * });
  29451. * @param [options] - Object with the following properties:
  29452. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  29453. * @param [options.faceForward = options.aboveGround] - When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.
  29454. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled.
  29455. * @param [options.aboveGround = false] - When <code>true</code>, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.
  29456. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  29457. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  29458. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  29459. * @param [options.renderState] - Optional render state to override the default render state.
  29460. */
  29461. export class EllipsoidSurfaceAppearance {
  29462. constructor(options?: {
  29463. flat?: boolean;
  29464. faceForward?: boolean;
  29465. translucent?: boolean;
  29466. aboveGround?: boolean;
  29467. material?: Material;
  29468. vertexShaderSource?: string;
  29469. fragmentShaderSource?: string;
  29470. renderState?: any;
  29471. });
  29472. /**
  29473. * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance}
  29474. * properties, this is not read-only, so an appearance's material can change on the fly.
  29475. */
  29476. material: Material;
  29477. /**
  29478. * When <code>true</code>, the geometry is expected to appear translucent.
  29479. */
  29480. translucent: boolean;
  29481. /**
  29482. * The GLSL source code for the vertex shader.
  29483. */
  29484. readonly vertexShaderSource: string;
  29485. /**
  29486. * The GLSL source code for the fragment shader. The full fragment shader
  29487. * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material},
  29488. * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}.
  29489. * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source.
  29490. */
  29491. readonly fragmentShaderSource: string;
  29492. /**
  29493. * The WebGL fixed-function state to use when rendering the geometry.
  29494. * <p>
  29495. * The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance}
  29496. * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent}
  29497. * and {@link EllipsoidSurfaceAppearance#aboveGround}.
  29498. * </p>
  29499. */
  29500. readonly renderState: any;
  29501. /**
  29502. * When <code>true</code>, the geometry is expected to be closed so
  29503. * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.
  29504. * If the viewer enters the geometry, it will not be visible.
  29505. */
  29506. readonly closed: boolean;
  29507. /**
  29508. * The {@link VertexFormat} that this appearance instance is compatible with.
  29509. * A geometry can have more vertex attributes and still be compatible - at a
  29510. * potential performance cost - but it can't have less.
  29511. */
  29512. readonly vertexFormat: VertexFormat;
  29513. /**
  29514. * When <code>true</code>, flat shading is used in the fragment shader,
  29515. * which means lighting is not taking into account.
  29516. */
  29517. readonly flat: boolean;
  29518. /**
  29519. * When <code>true</code>, the fragment shader flips the surface normal
  29520. * as needed to ensure that the normal faces the viewer to avoid
  29521. * dark spots. This is useful when both sides of a geometry should be
  29522. * shaded like {@link WallGeometry}.
  29523. */
  29524. readonly faceForward: boolean;
  29525. /**
  29526. * When <code>true</code>, the geometry is expected to be on the ellipsoid's
  29527. * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState}
  29528. * has backface culling enabled.
  29529. */
  29530. readonly aboveGround: boolean;
  29531. /**
  29532. * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances
  29533. * are compatible with, which requires only <code>position</code> and <code>st</code>
  29534. * attributes. Other attributes are procedurally computed in the fragment shader.
  29535. */
  29536. static readonly VERTEX_FORMAT: VertexFormat;
  29537. /**
  29538. * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance},
  29539. * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat},
  29540. * and {@link EllipsoidSurfaceAppearance#faceForward}.
  29541. * @returns The full GLSL fragment shader source.
  29542. */
  29543. getFragmentShaderSource(): string;
  29544. /**
  29545. * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}.
  29546. * @returns <code>true</code> if the appearance is translucent.
  29547. */
  29548. isTranslucent(): boolean;
  29549. /**
  29550. * Creates a render state. This is not the final render state instance; instead,
  29551. * it can contain a subset of render state properties identical to the render state
  29552. * created in the context.
  29553. * @returns The render state.
  29554. */
  29555. getRenderState(): any;
  29556. }
  29557. /**
  29558. * An expression for a style applied to a {@link Cesium3DTileset}.
  29559. * <p>
  29560. * Evaluates an expression defined using the
  29561. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  29562. * </p>
  29563. * <p>
  29564. * Implements the {@link StyleExpression} interface.
  29565. * </p>
  29566. * @example
  29567. * var expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)');
  29568. * expression.evaluate(feature); // returns true or false depending on the feature's properties
  29569. * @example
  29570. * var expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")');
  29571. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  29572. * @param [expression] - The expression defined using the 3D Tiles Styling language.
  29573. * @param [defines] - Defines in the style.
  29574. */
  29575. export class Expression {
  29576. constructor(expression?: string, defines?: any);
  29577. /**
  29578. * Gets the expression defined in the 3D Tiles Styling language.
  29579. */
  29580. readonly expression: string;
  29581. /**
  29582. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  29583. * the expression in the
  29584. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  29585. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  29586. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  29587. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  29588. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  29589. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  29590. * @param feature - The feature whose properties may be used as variables in the expression.
  29591. * @param [result] - The object onto which to store the result.
  29592. * @returns The result of evaluating the expression.
  29593. */
  29594. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  29595. /**
  29596. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  29597. * <p>
  29598. * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.
  29599. * </p>
  29600. * @param feature - The feature whose properties may be used as variables in the expression.
  29601. * @param [result] - The object in which to store the result
  29602. * @returns The modified result parameter or a new Color instance if one was not provided.
  29603. */
  29604. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  29605. }
  29606. /**
  29607. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  29608. * performance improvements by rendering less geometry and dispatching less terrain requests.
  29609. */
  29610. export class Fog {
  29611. constructor();
  29612. /**
  29613. * <code>true</code> if fog is enabled, <code>false</code> otherwise.
  29614. */
  29615. enabled: boolean;
  29616. /**
  29617. * A scalar that determines the density of the fog. Terrain that is in full fog are culled.
  29618. * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.
  29619. * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of
  29620. * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.
  29621. * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.
  29622. */
  29623. density: number;
  29624. /**
  29625. * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce
  29626. * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased
  29627. * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably
  29628. * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.
  29629. */
  29630. screenSpaceErrorFactor: number;
  29631. /**
  29632. * The minimum brightness of the fog color from lighting. A value of 0.0 can cause the fog to be completely black. A value of 1.0 will not affect
  29633. * the brightness at all.
  29634. */
  29635. minimumBrightness: number;
  29636. }
  29637. /**
  29638. * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is
  29639. * lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised.
  29640. * To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene}
  29641. * instead of constructing an instance explicitly.
  29642. * @param [options] - Object with the following properties:
  29643. * @param options.scene - The Scene instance for which to monitor performance.
  29644. * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds.
  29645. * @param [options.quietPeriod = 2.0] - The length of time to wait at startup and each time the page becomes visible (i.e. when the user
  29646. * switches back to the tab) before starting to measure performance, in seconds.
  29647. * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate
  29648. * (usually lower) frame rate is required.
  29649. * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during
  29650. * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the
  29651. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  29652. * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after
  29653. * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the
  29654. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  29655. */
  29656. export class FrameRateMonitor {
  29657. constructor(options?: {
  29658. scene: Scene;
  29659. samplingWindow?: number;
  29660. quietPeriod?: number;
  29661. warmupPeriod?: number;
  29662. minimumFrameRateDuringWarmup?: number;
  29663. minimumFrameRateAfterWarmup?: number;
  29664. });
  29665. /**
  29666. * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds.
  29667. */
  29668. samplingWindow: number;
  29669. /**
  29670. * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user
  29671. * switches back to the tab) before starting to measure performance, in seconds.
  29672. */
  29673. quietPeriod: number;
  29674. /**
  29675. * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate
  29676. * (usually lower) frame rate is required.
  29677. */
  29678. warmupPeriod: number;
  29679. /**
  29680. * Gets or sets the minimum frames-per-second that are required for acceptable performance during
  29681. * the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the
  29682. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  29683. */
  29684. minimumFrameRateDuringWarmup: number;
  29685. /**
  29686. * Gets or sets the minimum frames-per-second that are required for acceptable performance after
  29687. * the end of the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> after the <code>warmupPeriod</code>, the
  29688. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  29689. */
  29690. minimumFrameRateAfterWarmup: number;
  29691. /**
  29692. * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene}
  29693. * needs to create a new frame rate monitor, and for any settings that are not passed to the
  29694. * {@link FrameRateMonitor} constructor.
  29695. */
  29696. static defaultSettings: any;
  29697. /**
  29698. * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have
  29699. * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}.
  29700. * @param scene - The scene for which to get the {@link FrameRateMonitor}.
  29701. * @returns The scene's {@link FrameRateMonitor}.
  29702. */
  29703. static fromScene(scene: Scene): FrameRateMonitor;
  29704. /**
  29705. * Gets the {@link Scene} instance for which to monitor performance.
  29706. */
  29707. scene: Scene;
  29708. /**
  29709. * Gets the event that is raised when a low frame rate is detected. The function will be passed
  29710. * the {@link Scene} instance as its first parameter and the average number of frames per second
  29711. * over the sampling window as its second parameter.
  29712. */
  29713. lowFrameRate: Event;
  29714. /**
  29715. * Gets the event that is raised when the frame rate returns to a normal level after having been low.
  29716. * The function will be passed the {@link Scene} instance as its first parameter and the average
  29717. * number of frames per second over the sampling window as its second parameter.
  29718. */
  29719. nominalFrameRate: Event;
  29720. /**
  29721. * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>.
  29722. * This property may be undefined if the frame rate has not been computed.
  29723. */
  29724. lastFramesPerSecond: number;
  29725. /**
  29726. * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause}
  29727. * must be called once for each time this function is called.
  29728. */
  29729. pause(): void;
  29730. /**
  29731. * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called
  29732. * multiple times, this function must be called the same number of times in order to
  29733. * actually resume monitoring.
  29734. */
  29735. unpause(): void;
  29736. /**
  29737. * Returns true if this object was destroyed; otherwise, false.
  29738. * <br /><br />
  29739. * If this object was destroyed, it should not be used; calling any function other than
  29740. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29741. * @returns True if this object was destroyed; otherwise, false.
  29742. */
  29743. isDestroyed(): boolean;
  29744. /**
  29745. * Unsubscribes this instance from all events it is listening to.
  29746. * Once an object is destroyed, it should not be used; calling any function other than
  29747. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29748. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29749. */
  29750. destroy(): void;
  29751. }
  29752. /**
  29753. * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.
  29754. * @param type - The type of response to expect from a GetFeatureInfo request. Valid
  29755. * values are 'json', 'xml', 'html', or 'text'.
  29756. * @param [format] - The info format to request from the WMS server. This is usually a
  29757. * MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json'
  29758. * using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'.
  29759. * @param [callback] - A function to invoke with the GetFeatureInfo response from the WMS server
  29760. * in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified,
  29761. * a default function for the type of response is used.
  29762. */
  29763. export class GetFeatureInfoFormat {
  29764. constructor(type: string, format?: string, callback?: (...params: any[]) => any);
  29765. }
  29766. /**
  29767. * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
  29768. * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}.
  29769. * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the
  29770. * globe.
  29771. */
  29772. export class Globe {
  29773. constructor(ellipsoid?: Ellipsoid);
  29774. /**
  29775. * Determines if the globe will be shown.
  29776. */
  29777. show: boolean;
  29778. /**
  29779. * The maximum screen-space error used to drive level-of-detail refinement. Higher
  29780. * values will provide better performance but lower visual quality.
  29781. */
  29782. maximumScreenSpaceError: number;
  29783. /**
  29784. * The size of the terrain tile cache, expressed as a number of tiles. Any additional
  29785. * tiles beyond this number will be freed, as long as they aren't needed for rendering
  29786. * this frame. A larger number will consume more memory but will show detail faster
  29787. * when, for example, zooming out and then back in.
  29788. */
  29789. tileCacheSize: number;
  29790. /**
  29791. * Gets or sets the number of loading descendant tiles that is considered "too many".
  29792. * If a tile has too many loading descendants, that tile will be loaded and rendered before any of
  29793. * its descendants are loaded and rendered. This means more feedback for the user that something
  29794. * is happening at the cost of a longer overall load time. Setting this to 0 will cause each
  29795. * tile level to be loaded successively, significantly increasing load time. Setting it to a large
  29796. * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make
  29797. * detail appear all at once after a long wait.
  29798. */
  29799. loadingDescendantLimit: number;
  29800. /**
  29801. * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.
  29802. * Setting this to true optimizes the zoom-out experience and provides more detail in
  29803. * newly-exposed areas when panning. The down side is that it requires loading more tiles.
  29804. */
  29805. preloadAncestors: boolean;
  29806. /**
  29807. * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.
  29808. * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even
  29809. * if they are culled. Setting this to true may provide a better panning experience at the
  29810. * cost of loading more tiles.
  29811. */
  29812. preloadSiblings: boolean;
  29813. /**
  29814. * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not
  29815. * highlighted at all. The alpha value is used to alpha blend with the tile's
  29816. * actual color. Because terrain fill tiles do not represent the actual terrain surface,
  29817. * it may be useful in some applications to indicate visually that they are not to be trusted.
  29818. */
  29819. fillHighlightColor: Color;
  29820. /**
  29821. * Enable lighting the globe with the scene's light source.
  29822. */
  29823. enableLighting: boolean;
  29824. /**
  29825. * Enable dynamic lighting effects on atmosphere and fog. This only takes effect
  29826. * when <code>enableLighting</code> is <code>true</code>.
  29827. */
  29828. dynamicAtmosphereLighting: boolean;
  29829. /**
  29830. * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's
  29831. * light direction. This only takes effect when <code>enableLighting</code> and
  29832. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29833. */
  29834. dynamicAtmosphereLightingFromSun: boolean;
  29835. /**
  29836. * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
  29837. */
  29838. showGroundAtmosphere: boolean;
  29839. /**
  29840. * The distance where everything becomes lit. This only takes effect
  29841. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  29842. */
  29843. lightingFadeOutDistance: number;
  29844. /**
  29845. * The distance where lighting resumes. This only takes effect
  29846. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  29847. */
  29848. lightingFadeInDistance: number;
  29849. /**
  29850. * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.
  29851. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  29852. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29853. */
  29854. nightFadeOutDistance: number;
  29855. /**
  29856. * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.
  29857. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  29858. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  29859. */
  29860. nightFadeInDistance: number;
  29861. /**
  29862. * True if an animated wave effect should be shown in areas of the globe
  29863. * covered by water; otherwise, false. This property is ignored if the
  29864. * <code>terrainProvider</code> does not provide a water mask.
  29865. */
  29866. showWaterEffect: boolean;
  29867. /**
  29868. * True if primitives such as billboards, polylines, labels, etc. should be depth-tested
  29869. * against the terrain surface, or false if such primitives should always be drawn on top
  29870. * of terrain unless they're on the opposite side of the globe. The disadvantage of depth
  29871. * testing primitives against terrain is that slight numerical noise or terrain level-of-detail
  29872. * switched can sometimes make a primitive that should be on the surface disappear underneath it.
  29873. */
  29874. depthTestAgainstTerrain: boolean;
  29875. /**
  29876. * Determines whether the globe casts or receives shadows from light sources. Setting the globe
  29877. * to cast shadows may impact performance since the terrain is rendered again from the light's perspective.
  29878. * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
  29879. */
  29880. shadows: ShadowMode;
  29881. /**
  29882. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29883. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  29884. */
  29885. atmosphereHueShift: number;
  29886. /**
  29887. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29888. * A saturation shift of -1.0 is monochrome.
  29889. */
  29890. atmosphereSaturationShift: number;
  29891. /**
  29892. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  29893. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  29894. */
  29895. atmosphereBrightnessShift: number;
  29896. /**
  29897. * A scalar used to exaggerate the terrain. Defaults to <code>1.0</code> (no exaggeration).
  29898. * A value of <code>2.0</code> scales the terrain by 2x.
  29899. * A value of <code>0.0</code> makes the terrain completely flat.
  29900. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  29901. */
  29902. terrainExaggeration: number;
  29903. /**
  29904. * The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).
  29905. * Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.
  29906. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  29907. * If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.
  29908. */
  29909. terrainExaggerationRelativeHeight: number;
  29910. /**
  29911. * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.
  29912. * Skirts are always hidden when the camera is underground or translucency is enabled.
  29913. */
  29914. showSkirts: boolean;
  29915. /**
  29916. * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
  29917. */
  29918. backFaceCulling: boolean;
  29919. /**
  29920. * Gets an ellipsoid describing the shape of this globe.
  29921. */
  29922. ellipsoid: Ellipsoid;
  29923. /**
  29924. * Gets the collection of image layers that will be rendered on this globe.
  29925. */
  29926. imageryLayers: ImageryLayerCollection;
  29927. /**
  29928. * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.
  29929. */
  29930. readonly imageryLayersUpdatedEvent: Event;
  29931. /**
  29932. * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty,
  29933. * all terrain and imagery for the current view have been loaded.
  29934. */
  29935. readonly tilesLoaded: boolean;
  29936. /**
  29937. * Gets or sets the color of the globe when no imagery is available.
  29938. */
  29939. baseColor: Color;
  29940. /**
  29941. * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
  29942. */
  29943. clippingPlanes: ClippingPlaneCollection;
  29944. /**
  29945. * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
  29946. * Defaults to the maximum extent of cartographic coordinates.
  29947. */
  29948. cartographicLimitRectangle: Rectangle;
  29949. /**
  29950. * The normal map to use for rendering waves in the ocean. Setting this property will
  29951. * only have an effect if the configured terrain provider includes a water mask.
  29952. */
  29953. oceanNormalMapUrl: string;
  29954. /**
  29955. * The terrain provider providing surface geometry for this globe.
  29956. */
  29957. terrainProvider: TerrainProvider;
  29958. /**
  29959. * Gets an event that's raised when the terrain provider is changed
  29960. */
  29961. readonly terrainProviderChanged: Event;
  29962. /**
  29963. * Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty,
  29964. * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
  29965. */
  29966. tileLoadProgressEvent: Event;
  29967. /**
  29968. * Gets or sets the material appearance of the Globe. This can be one of several built-in {@link Material} objects or a custom material, scripted with
  29969. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  29970. */
  29971. material: Material;
  29972. /**
  29973. * The color to render the back side of the globe when the camera is underground or the globe is translucent,
  29974. * blended with the globe color based on the camera's distance.
  29975. * <br /><br />
  29976. * To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.
  29977. */
  29978. undergroundColor: Color;
  29979. /**
  29980. * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.
  29981. * The alpha will interpolate between the {@link NearFarScalar#nearValue} and
  29982. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  29983. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  29984. * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,
  29985. * the underground color will not be blended with the globe color.
  29986. * <br /> <br />
  29987. * When the camera is above the ellipsoid the distance is computed from the nearest
  29988. * point on the ellipsoid instead of the camera's position.
  29989. */
  29990. undergroundColorAlphaByDistance: NearFarScalar;
  29991. /**
  29992. * Properties for controlling globe translucency.
  29993. */
  29994. translucency: GlobeTranslucency;
  29995. /**
  29996. * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
  29997. * @example
  29998. * // find intersection of ray through a pixel and the globe
  29999. * var ray = viewer.camera.getPickRay(windowCoordinates);
  30000. * var intersection = globe.pick(ray, scene);
  30001. * @param ray - The ray to test for intersection.
  30002. * @param scene - The scene.
  30003. * @param [result] - The object onto which to store the result.
  30004. * @returns The intersection or <code>undefined</code> if none was found.
  30005. */
  30006. pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined;
  30007. /**
  30008. * Get the height of the surface at a given cartographic.
  30009. * @param cartographic - The cartographic for which to find the height.
  30010. * @returns The height of the cartographic or undefined if it could not be found.
  30011. */
  30012. getHeight(cartographic: Cartographic): number | undefined;
  30013. /**
  30014. * Returns true if this object was destroyed; otherwise, false.
  30015. * <br /><br />
  30016. * If this object was destroyed, it should not be used; calling any function other than
  30017. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30018. * @returns True if this object was destroyed; otherwise, false.
  30019. */
  30020. isDestroyed(): boolean;
  30021. /**
  30022. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30023. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30024. * <br /><br />
  30025. * Once an object is destroyed, it should not be used; calling any function other than
  30026. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30027. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30028. * @example
  30029. * globe = globe && globe.destroy();
  30030. */
  30031. destroy(): void;
  30032. }
  30033. /**
  30034. * Properties for controlling globe translucency.
  30035. */
  30036. export class GlobeTranslucency {
  30037. constructor();
  30038. /**
  30039. * When true, the globe is rendered as a translucent surface.
  30040. * <br /><br />
  30041. * The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers},
  30042. * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by
  30043. * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and
  30044. * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces.
  30045. * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry
  30046. * is considered front facing.
  30047. * <br /><br />
  30048. * Translucency is disabled by default.
  30049. */
  30050. enabled: boolean;
  30051. /**
  30052. * A constant translucency to apply to front faces of the globe.
  30053. * <br /><br />
  30054. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30055. * @example
  30056. * // Set front face translucency to 0.5.
  30057. * globe.translucency.frontFaceAlpha = 0.5;
  30058. * globe.translucency.enabled = true;
  30059. */
  30060. frontFaceAlpha: number;
  30061. /**
  30062. * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera.
  30063. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  30064. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30065. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30066. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  30067. * frontFaceAlphaByDistance will be disabled.
  30068. * <br /><br />
  30069. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30070. * @example
  30071. * // Example 1.
  30072. * // Set front face translucency to 0.5 when the
  30073. * // camera is 1500 meters from the surface and 1.0
  30074. * // as the camera distance approaches 8.0e6 meters.
  30075. * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  30076. * globe.translucency.enabled = true;
  30077. * @example
  30078. * // Example 2.
  30079. * // Disable front face translucency by distance
  30080. * globe.translucency.frontFaceAlphaByDistance = undefined;
  30081. */
  30082. frontFaceAlphaByDistance: NearFarScalar;
  30083. /**
  30084. * A constant translucency to apply to back faces of the globe.
  30085. * <br /><br />
  30086. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30087. * @example
  30088. * // Set back face translucency to 0.5.
  30089. * globe.translucency.backFaceAlpha = 0.5;
  30090. * globe.translucency.enabled = true;
  30091. */
  30092. backFaceAlpha: number;
  30093. /**
  30094. * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera.
  30095. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  30096. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30097. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30098. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  30099. * backFaceAlphaByDistance will be disabled.
  30100. * <br /><br />
  30101. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30102. * @example
  30103. * // Example 1.
  30104. * // Set back face translucency to 0.5 when the
  30105. * // camera is 1500 meters from the surface and 1.0
  30106. * // as the camera distance approaches 8.0e6 meters.
  30107. * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  30108. * globe.translucency.enabled = true;
  30109. * @example
  30110. * // Example 2.
  30111. * // Disable back face translucency by distance
  30112. * globe.translucency.backFaceAlphaByDistance = undefined;
  30113. */
  30114. backFaceAlphaByDistance: NearFarScalar;
  30115. /**
  30116. * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area.
  30117. * Defaults to the maximum extent of cartographic coordinates.
  30118. */
  30119. rectangle: Rectangle;
  30120. }
  30121. export namespace GoogleEarthEnterpriseImageryProvider {
  30122. /**
  30123. * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor
  30124. * @property url - The url of the Google Earth Enterprise server hosting the imagery.
  30125. * @property metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.
  30126. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  30127. * @property [tileDiscardPolicy] - The policy that determines if a tile
  30128. * is invalid and should be discarded. If this value is not specified, a default
  30129. * is to discard tiles that fail to download.
  30130. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  30131. */
  30132. type ConstructorOptions = {
  30133. url: Resource | string;
  30134. metadata: GoogleEarthEnterpriseMetadata;
  30135. ellipsoid?: Ellipsoid;
  30136. tileDiscardPolicy?: TileDiscardPolicy;
  30137. credit?: Credit | string;
  30138. };
  30139. }
  30140. /**
  30141. * Provides tiled imagery using the Google Earth Enterprise REST API.
  30142. *
  30143. * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise,
  30144. * {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API.
  30145. * @example
  30146. * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  30147. * var gee = new Cesium.GoogleEarthEnterpriseImageryProvider({
  30148. * metadata : geeMetadata
  30149. * });
  30150. * @param options - Object describing initialization options
  30151. */
  30152. export class GoogleEarthEnterpriseImageryProvider {
  30153. constructor(options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions);
  30154. /**
  30155. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  30156. * 1.0 representing fully opaque.
  30157. */
  30158. defaultAlpha: number | undefined;
  30159. /**
  30160. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  30161. * 1.0 representing fully opaque.
  30162. */
  30163. defaultNightAlpha: number | undefined;
  30164. /**
  30165. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  30166. * 1.0 representing fully opaque.
  30167. */
  30168. defaultDayAlpha: number | undefined;
  30169. /**
  30170. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  30171. * makes the imagery darker while greater than 1.0 makes it brighter.
  30172. */
  30173. defaultBrightness: number | undefined;
  30174. /**
  30175. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30176. * the contrast while greater than 1.0 increases it.
  30177. */
  30178. defaultContrast: number | undefined;
  30179. /**
  30180. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  30181. */
  30182. defaultHue: number | undefined;
  30183. /**
  30184. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30185. * saturation while greater than 1.0 increases it.
  30186. */
  30187. defaultSaturation: number | undefined;
  30188. /**
  30189. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  30190. */
  30191. defaultGamma: number | undefined;
  30192. /**
  30193. * The default texture minification filter to apply to this provider.
  30194. */
  30195. defaultMinificationFilter: TextureMinificationFilter;
  30196. /**
  30197. * The default texture magnification filter to apply to this provider.
  30198. */
  30199. defaultMagnificationFilter: TextureMagnificationFilter;
  30200. /**
  30201. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  30202. */
  30203. readonly url: string;
  30204. /**
  30205. * Gets the proxy used by this provider.
  30206. */
  30207. readonly proxy: Proxy;
  30208. /**
  30209. * Gets the width of each tile, in pixels. This function should
  30210. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30211. */
  30212. readonly tileWidth: number;
  30213. /**
  30214. * Gets the height of each tile, in pixels. This function should
  30215. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30216. */
  30217. readonly tileHeight: number;
  30218. /**
  30219. * Gets the maximum level-of-detail that can be requested. This function should
  30220. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30221. */
  30222. readonly maximumLevel: number | undefined;
  30223. /**
  30224. * Gets the minimum level-of-detail that can be requested. This function should
  30225. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30226. */
  30227. readonly minimumLevel: number;
  30228. /**
  30229. * Gets the tiling scheme used by this provider. This function should
  30230. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30231. */
  30232. readonly tilingScheme: TilingScheme;
  30233. /**
  30234. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  30235. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30236. */
  30237. readonly rectangle: Rectangle;
  30238. /**
  30239. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  30240. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  30241. * returns undefined, no tiles are filtered. This function should
  30242. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30243. */
  30244. readonly tileDiscardPolicy: TileDiscardPolicy;
  30245. /**
  30246. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  30247. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  30248. * are passed an instance of {@link TileProviderError}.
  30249. */
  30250. readonly errorEvent: Event;
  30251. /**
  30252. * Gets a value indicating whether or not the provider is ready for use.
  30253. */
  30254. readonly ready: boolean;
  30255. /**
  30256. * Gets a promise that resolves to true when the provider is ready for use.
  30257. */
  30258. readonly readyPromise: Promise<boolean>;
  30259. /**
  30260. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  30261. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30262. */
  30263. readonly credit: Credit;
  30264. /**
  30265. * Gets a value indicating whether or not the images provided by this imagery provider
  30266. * include an alpha channel. If this property is false, an alpha channel, if present, will
  30267. * be ignored. If this property is true, any images without an alpha channel will be treated
  30268. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  30269. * and texture upload time.
  30270. */
  30271. readonly hasAlphaChannel: boolean;
  30272. /**
  30273. * Gets the credits to be displayed when a given tile is displayed.
  30274. * @param x - The tile X coordinate.
  30275. * @param y - The tile Y coordinate.
  30276. * @param level - The tile level;
  30277. * @returns The credits to be displayed when the tile is displayed.
  30278. */
  30279. getTileCredits(x: number, y: number, level: number): Credit[];
  30280. /**
  30281. * Requests the image for a given tile. This function should
  30282. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30283. * @param x - The tile X coordinate.
  30284. * @param y - The tile Y coordinate.
  30285. * @param level - The tile level.
  30286. * @param [request] - The request object. Intended for internal use only.
  30287. * @returns A promise for the image that will resolve when the image is available, or
  30288. * undefined if there are too many active requests to the server, and the request
  30289. * should be retried later. The resolved image may be either an
  30290. * Image or a Canvas DOM object.
  30291. */
  30292. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  30293. /**
  30294. * Picking features is not currently supported by this imagery provider, so this function simply returns
  30295. * undefined.
  30296. * @param x - The tile X coordinate.
  30297. * @param y - The tile Y coordinate.
  30298. * @param level - The tile level.
  30299. * @param longitude - The longitude at which to pick features.
  30300. * @param latitude - The latitude at which to pick features.
  30301. * @returns A promise for the picked features that will resolve when the asynchronous
  30302. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  30303. * instances. The array may be empty if no features are found at the given location.
  30304. * It may also be undefined if picking is not supported.
  30305. */
  30306. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  30307. }
  30308. export namespace GoogleEarthEnterpriseMapsProvider {
  30309. /**
  30310. * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor
  30311. * @property url - The url of the Google Earth server hosting the imagery.
  30312. * @property channel - The channel (id) to be used when requesting data from the server.
  30313. * The channel number can be found by looking at the json file located at:
  30314. * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may
  30315. * differ depending on your Google Earth Enterprise server configuration. Look for the "id" that
  30316. * is associated with a "ImageryMaps" requestType. There may be more than one id available.
  30317. * Example:
  30318. * {
  30319. * layers: [
  30320. * {
  30321. * id: 1002,
  30322. * requestType: "ImageryMaps"
  30323. * },
  30324. * {
  30325. * id: 1007,
  30326. * requestType: "VectorMapsRaster"
  30327. * }
  30328. * ]
  30329. * }
  30330. * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery.
  30331. * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth
  30332. * Enterprise server, or undefined if there is no limit.
  30333. * @property [tileDiscardPolicy] - The policy that determines if a tile
  30334. * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
  30335. * a {@link NeverTileDiscardPolicy} for this parameter.
  30336. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  30337. */
  30338. type ConstructorOptions = {
  30339. url: Resource | string;
  30340. channel: number;
  30341. path?: string;
  30342. maximumLevel?: number;
  30343. tileDiscardPolicy?: TileDiscardPolicy;
  30344. ellipsoid?: Ellipsoid;
  30345. };
  30346. }
  30347. /**
  30348. * Provides tiled imagery using the Google Earth Imagery API.
  30349. *
  30350. * Notes: This imagery provider does not work with the public Google Earth servers. It works with the
  30351. * Google Earth Enterprise Server.
  30352. *
  30353. * By default the Google Earth Enterprise server does not set the
  30354. * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either
  30355. * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf
  30356. * and add the 'Header set Access-Control-Allow-Origin "*"' option to the '&lt;Directory /&gt;' and
  30357. * '&lt;Directory "/opt/google/gehttpd/htdocs"&gt;' directives.
  30358. *
  30359. * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it
  30360. * is necessary to use {@link GoogleEarthEnterpriseImageryProvider}
  30361. * @example
  30362. * var google = new Cesium.GoogleEarthEnterpriseMapsProvider({
  30363. * url : 'https://earth.localdomain',
  30364. * channel : 1008
  30365. * });
  30366. * @param options - Object describing initialization options
  30367. */
  30368. export class GoogleEarthEnterpriseMapsProvider {
  30369. constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions);
  30370. /**
  30371. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  30372. * 1.0 representing fully opaque.
  30373. */
  30374. defaultAlpha: number | undefined;
  30375. /**
  30376. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  30377. * 1.0 representing fully opaque.
  30378. */
  30379. defaultNightAlpha: number | undefined;
  30380. /**
  30381. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  30382. * 1.0 representing fully opaque.
  30383. */
  30384. defaultDayAlpha: number | undefined;
  30385. /**
  30386. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  30387. * makes the imagery darker while greater than 1.0 makes it brighter.
  30388. */
  30389. defaultBrightness: number | undefined;
  30390. /**
  30391. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30392. * the contrast while greater than 1.0 increases it.
  30393. */
  30394. defaultContrast: number | undefined;
  30395. /**
  30396. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  30397. */
  30398. defaultHue: number | undefined;
  30399. /**
  30400. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30401. * saturation while greater than 1.0 increases it.
  30402. */
  30403. defaultSaturation: number | undefined;
  30404. /**
  30405. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  30406. */
  30407. defaultGamma: number | undefined;
  30408. /**
  30409. * The default texture minification filter to apply to this provider.
  30410. */
  30411. defaultMinificationFilter: TextureMinificationFilter;
  30412. /**
  30413. * The default texture magnification filter to apply to this provider.
  30414. */
  30415. defaultMagnificationFilter: TextureMagnificationFilter;
  30416. /**
  30417. * Gets the URL of the Google Earth MapServer.
  30418. */
  30419. readonly url: string;
  30420. /**
  30421. * Gets the url path of the data on the Google Earth server.
  30422. */
  30423. readonly path: string;
  30424. /**
  30425. * Gets the proxy used by this provider.
  30426. */
  30427. readonly proxy: Proxy;
  30428. /**
  30429. * Gets the imagery channel (id) currently being used.
  30430. */
  30431. readonly channel: number;
  30432. /**
  30433. * Gets the width of each tile, in pixels. This function should
  30434. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30435. */
  30436. readonly tileWidth: number;
  30437. /**
  30438. * Gets the height of each tile, in pixels. This function should
  30439. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30440. */
  30441. readonly tileHeight: number;
  30442. /**
  30443. * Gets the maximum level-of-detail that can be requested. This function should
  30444. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30445. */
  30446. readonly maximumLevel: number | undefined;
  30447. /**
  30448. * Gets the minimum level-of-detail that can be requested. This function should
  30449. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30450. */
  30451. readonly minimumLevel: number;
  30452. /**
  30453. * Gets the tiling scheme used by this provider. This function should
  30454. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30455. */
  30456. readonly tilingScheme: TilingScheme;
  30457. /**
  30458. * Gets the version of the data used by this provider. This function should
  30459. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30460. */
  30461. readonly version: number;
  30462. /**
  30463. * Gets the type of data that is being requested from the provider. This function should
  30464. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30465. */
  30466. readonly requestType: string;
  30467. /**
  30468. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  30469. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30470. */
  30471. readonly rectangle: Rectangle;
  30472. /**
  30473. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  30474. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  30475. * returns undefined, no tiles are filtered. This function should
  30476. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30477. */
  30478. readonly tileDiscardPolicy: TileDiscardPolicy;
  30479. /**
  30480. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  30481. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  30482. * are passed an instance of {@link TileProviderError}.
  30483. */
  30484. readonly errorEvent: Event;
  30485. /**
  30486. * Gets a value indicating whether or not the provider is ready for use.
  30487. */
  30488. readonly ready: boolean;
  30489. /**
  30490. * Gets a promise that resolves to true when the provider is ready for use.
  30491. */
  30492. readonly readyPromise: Promise<boolean>;
  30493. /**
  30494. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  30495. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30496. */
  30497. readonly credit: Credit;
  30498. /**
  30499. * Gets a value indicating whether or not the images provided by this imagery provider
  30500. * include an alpha channel. If this property is false, an alpha channel, if present, will
  30501. * be ignored. If this property is true, any images without an alpha channel will be treated
  30502. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  30503. * and texture upload time are reduced.
  30504. */
  30505. readonly hasAlphaChannel: boolean;
  30506. /**
  30507. * Gets the credits to be displayed when a given tile is displayed.
  30508. * @param x - The tile X coordinate.
  30509. * @param y - The tile Y coordinate.
  30510. * @param level - The tile level;
  30511. * @returns The credits to be displayed when the tile is displayed.
  30512. */
  30513. getTileCredits(x: number, y: number, level: number): Credit[];
  30514. /**
  30515. * Requests the image for a given tile. This function should
  30516. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  30517. * @param x - The tile X coordinate.
  30518. * @param y - The tile Y coordinate.
  30519. * @param level - The tile level.
  30520. * @param [request] - The request object. Intended for internal use only.
  30521. * @returns A promise for the image that will resolve when the image is available, or
  30522. * undefined if there are too many active requests to the server, and the request
  30523. * should be retried later. The resolved image may be either an
  30524. * Image or a Canvas DOM object.
  30525. */
  30526. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  30527. /**
  30528. * Picking features is not currently supported by this imagery provider, so this function simply returns
  30529. * undefined.
  30530. * @param x - The tile X coordinate.
  30531. * @param y - The tile Y coordinate.
  30532. * @param level - The tile level.
  30533. * @param longitude - The longitude at which to pick features.
  30534. * @param latitude - The latitude at which to pick features.
  30535. * @returns A promise for the picked features that will resolve when the asynchronous
  30536. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  30537. * instances. The array may be empty if no features are found at the given location.
  30538. * It may also be undefined if picking is not supported.
  30539. */
  30540. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  30541. /**
  30542. * Gets or sets the URL to the Google Earth logo for display in the credit.
  30543. */
  30544. static logoUrl: string;
  30545. }
  30546. export namespace GridImageryProvider {
  30547. /**
  30548. * Initialization options for the GridImageryProvider constructor
  30549. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  30550. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  30551. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  30552. * parameter is specified, the WGS84 ellipsoid is used.
  30553. * @property [cells = 8] - The number of grids cells.
  30554. * @property [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines.
  30555. * @property [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines.
  30556. * @property [glowWidth = 6] - The width of lines used for rendering the line glow effect.
  30557. * @property [backgroundColor = Color(0.0, 0.5, 0.0, 0.2)] - Background fill color.
  30558. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  30559. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  30560. * @property [canvasSize = 256] - The size of the canvas used for rendering.
  30561. */
  30562. type ConstructorOptions = {
  30563. tilingScheme?: TilingScheme;
  30564. ellipsoid?: Ellipsoid;
  30565. cells?: number;
  30566. color?: Color;
  30567. glowColor?: Color;
  30568. glowWidth?: number;
  30569. backgroundColor?: Color;
  30570. tileWidth?: number;
  30571. tileHeight?: number;
  30572. canvasSize?: number;
  30573. };
  30574. }
  30575. /**
  30576. * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.
  30577. * May be useful for custom rendering effects or debugging terrain.
  30578. * @param options - Object describing initialization options
  30579. */
  30580. export class GridImageryProvider {
  30581. constructor(options: GridImageryProvider.ConstructorOptions);
  30582. /**
  30583. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  30584. * 1.0 representing fully opaque.
  30585. */
  30586. defaultAlpha: number | undefined;
  30587. /**
  30588. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  30589. * 1.0 representing fully opaque.
  30590. */
  30591. defaultNightAlpha: number | undefined;
  30592. /**
  30593. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  30594. * 1.0 representing fully opaque.
  30595. */
  30596. defaultDayAlpha: number | undefined;
  30597. /**
  30598. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  30599. * makes the imagery darker while greater than 1.0 makes it brighter.
  30600. */
  30601. defaultBrightness: number | undefined;
  30602. /**
  30603. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30604. * the contrast while greater than 1.0 increases it.
  30605. */
  30606. defaultContrast: number | undefined;
  30607. /**
  30608. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  30609. */
  30610. defaultHue: number | undefined;
  30611. /**
  30612. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30613. * saturation while greater than 1.0 increases it.
  30614. */
  30615. defaultSaturation: number | undefined;
  30616. /**
  30617. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  30618. */
  30619. defaultGamma: number | undefined;
  30620. /**
  30621. * The default texture minification filter to apply to this provider.
  30622. */
  30623. defaultMinificationFilter: TextureMinificationFilter;
  30624. /**
  30625. * The default texture magnification filter to apply to this provider.
  30626. */
  30627. defaultMagnificationFilter: TextureMagnificationFilter;
  30628. /**
  30629. * Gets the proxy used by this provider.
  30630. */
  30631. readonly proxy: Proxy;
  30632. /**
  30633. * Gets the width of each tile, in pixels. This function should
  30634. * not be called before {@link GridImageryProvider#ready} returns true.
  30635. */
  30636. readonly tileWidth: number;
  30637. /**
  30638. * Gets the height of each tile, in pixels. This function should
  30639. * not be called before {@link GridImageryProvider#ready} returns true.
  30640. */
  30641. readonly tileHeight: number;
  30642. /**
  30643. * Gets the maximum level-of-detail that can be requested. This function should
  30644. * not be called before {@link GridImageryProvider#ready} returns true.
  30645. */
  30646. readonly maximumLevel: number | undefined;
  30647. /**
  30648. * Gets the minimum level-of-detail that can be requested. This function should
  30649. * not be called before {@link GridImageryProvider#ready} returns true.
  30650. */
  30651. readonly minimumLevel: number;
  30652. /**
  30653. * Gets the tiling scheme used by this provider. This function should
  30654. * not be called before {@link GridImageryProvider#ready} returns true.
  30655. */
  30656. readonly tilingScheme: TilingScheme;
  30657. /**
  30658. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  30659. * not be called before {@link GridImageryProvider#ready} returns true.
  30660. */
  30661. readonly rectangle: Rectangle;
  30662. /**
  30663. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  30664. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  30665. * returns undefined, no tiles are filtered. This function should
  30666. * not be called before {@link GridImageryProvider#ready} returns true.
  30667. */
  30668. readonly tileDiscardPolicy: TileDiscardPolicy;
  30669. /**
  30670. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  30671. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  30672. * are passed an instance of {@link TileProviderError}.
  30673. */
  30674. readonly errorEvent: Event;
  30675. /**
  30676. * Gets a value indicating whether or not the provider is ready for use.
  30677. */
  30678. readonly ready: boolean;
  30679. /**
  30680. * Gets a promise that resolves to true when the provider is ready for use.
  30681. */
  30682. readonly readyPromise: Promise<boolean>;
  30683. /**
  30684. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  30685. * the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true.
  30686. */
  30687. readonly credit: Credit;
  30688. /**
  30689. * Gets a value indicating whether or not the images provided by this imagery provider
  30690. * include an alpha channel. If this property is false, an alpha channel, if present, will
  30691. * be ignored. If this property is true, any images without an alpha channel will be treated
  30692. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  30693. * and texture upload time are reduced.
  30694. */
  30695. readonly hasAlphaChannel: boolean;
  30696. /**
  30697. * Draws a grid of lines into a canvas.
  30698. */
  30699. _drawGrid(): void;
  30700. /**
  30701. * Render a grid into a canvas with background and glow
  30702. */
  30703. _createGridCanvas(): void;
  30704. /**
  30705. * Gets the credits to be displayed when a given tile is displayed.
  30706. * @param x - The tile X coordinate.
  30707. * @param y - The tile Y coordinate.
  30708. * @param level - The tile level;
  30709. * @returns The credits to be displayed when the tile is displayed.
  30710. */
  30711. getTileCredits(x: number, y: number, level: number): Credit[];
  30712. /**
  30713. * Requests the image for a given tile. This function should
  30714. * not be called before {@link GridImageryProvider#ready} returns true.
  30715. * @param x - The tile X coordinate.
  30716. * @param y - The tile Y coordinate.
  30717. * @param level - The tile level.
  30718. * @param [request] - The request object. Intended for internal use only.
  30719. * @returns A promise for the image that will resolve when the image is available, or
  30720. * undefined if there are too many active requests to the server, and the request
  30721. * should be retried later. The resolved image may be either an
  30722. * Image or a Canvas DOM object.
  30723. */
  30724. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  30725. /**
  30726. * Picking features is not currently supported by this imagery provider, so this function simply returns
  30727. * undefined.
  30728. * @param x - The tile X coordinate.
  30729. * @param y - The tile Y coordinate.
  30730. * @param level - The tile level.
  30731. * @param longitude - The longitude at which to pick features.
  30732. * @param latitude - The latitude at which to pick features.
  30733. * @returns A promise for the picked features that will resolve when the asynchronous
  30734. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  30735. * instances. The array may be empty if no features are found at the given location.
  30736. * It may also be undefined if picking is not supported.
  30737. */
  30738. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  30739. }
  30740. /**
  30741. * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.
  30742. * <p>
  30743. * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.
  30744. * </p>
  30745. * @example
  30746. * // 1. Draw a polyline on terrain with a basic color material
  30747. *
  30748. * var instance = new Cesium.GeometryInstance({
  30749. * geometry : new Cesium.GroundPolylineGeometry({
  30750. * positions : Cesium.Cartesian3.fromDegreesArray([
  30751. * -112.1340164450331, 36.05494287836128,
  30752. * -112.08821010582645, 36.097804071380715
  30753. * ]),
  30754. * width : 4.0
  30755. * }),
  30756. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  30757. * });
  30758. *
  30759. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  30760. * geometryInstances : instance,
  30761. * appearance : new Cesium.PolylineMaterialAppearance()
  30762. * }));
  30763. *
  30764. * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.
  30765. * // Distance display conditions for polylines on terrain are based on an approximate terrain height
  30766. * // instead of true terrain height.
  30767. *
  30768. * var instance = new Cesium.GeometryInstance({
  30769. * geometry : new Cesium.GroundPolylineGeometry({
  30770. * positions : Cesium.Cartesian3.fromDegreesArray([
  30771. * -112.1340164450331, 36.05494287836128,
  30772. * -112.08821010582645, 36.097804071380715,
  30773. * -112.13296079730024, 36.168769146801104
  30774. * ]),
  30775. * loop : true,
  30776. * width : 4.0
  30777. * }),
  30778. * attributes : {
  30779. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),
  30780. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)
  30781. * },
  30782. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  30783. * });
  30784. *
  30785. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  30786. * geometryInstances : instance,
  30787. * appearance : new Cesium.PolylineColorAppearance()
  30788. * }));
  30789. * @param [options] - Object with the following properties:
  30790. * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry
  30791. * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.
  30792. * @param [options.show = true] - Determines if this primitive will be shown.
  30793. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  30794. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30795. * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  30796. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  30797. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  30798. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  30799. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on creation to have effect.
  30800. */
  30801. export class GroundPolylinePrimitive {
  30802. constructor(options?: {
  30803. geometryInstances?: any[] | GeometryInstance;
  30804. appearance?: Appearance;
  30805. show?: boolean;
  30806. interleave?: boolean;
  30807. releaseGeometryInstances?: boolean;
  30808. allowPicking?: boolean;
  30809. asynchronous?: boolean;
  30810. classificationType?: ClassificationType;
  30811. debugShowBoundingVolume?: boolean;
  30812. debugShowShadowVolume?: boolean;
  30813. });
  30814. /**
  30815. * The geometry instances rendered with this primitive. This may
  30816. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  30817. * is <code>true</code> when the primitive is constructed.
  30818. * <p>
  30819. * Changing this property after the primitive is rendered has no effect.
  30820. * </p>
  30821. */
  30822. readonly geometryInstances: any[] | GeometryInstance;
  30823. /**
  30824. * The {@link Appearance} used to shade this primitive. Each geometry
  30825. * instance is shaded with the same appearance. Some appearances, like
  30826. * {@link PolylineColorAppearance} allow giving each instance unique
  30827. * properties.
  30828. */
  30829. appearance: Appearance;
  30830. /**
  30831. * Determines if the primitive will be shown. This affects all geometry
  30832. * instances in the primitive.
  30833. */
  30834. show: boolean;
  30835. /**
  30836. * Determines whether terrain, 3D Tiles or both will be classified.
  30837. */
  30838. classificationType: ClassificationType;
  30839. /**
  30840. * This property is for debugging only; it is not for production use nor is it optimized.
  30841. * <p>
  30842. * Draws the bounding sphere for each draw command in the primitive.
  30843. * </p>
  30844. */
  30845. debugShowBoundingVolume: boolean;
  30846. /**
  30847. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  30848. */
  30849. readonly interleave: boolean;
  30850. /**
  30851. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  30852. */
  30853. readonly releaseGeometryInstances: boolean;
  30854. /**
  30855. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  30856. */
  30857. readonly allowPicking: boolean;
  30858. /**
  30859. * Determines if the geometry instances will be created and batched on a web worker.
  30860. */
  30861. readonly asynchronous: boolean;
  30862. /**
  30863. * Determines if the primitive is complete and ready to render. If this property is
  30864. * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}
  30865. * is called.
  30866. */
  30867. readonly ready: boolean;
  30868. /**
  30869. * Gets a promise that resolves when the primitive is ready to render.
  30870. */
  30871. readonly readyPromise: Promise<GroundPolylinePrimitive>;
  30872. /**
  30873. * This property is for debugging only; it is not for production use nor is it optimized.
  30874. * <p>
  30875. * If true, draws the shadow volume for each geometry in the primitive.
  30876. * </p>
  30877. */
  30878. readonly debugShowShadowVolume: boolean;
  30879. /**
  30880. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  30881. * GroundPolylinePrimitive synchronously.
  30882. * @returns A promise that will resolve once the terrain heights have been loaded.
  30883. */
  30884. static initializeTerrainHeights(): Promise<void>;
  30885. /**
  30886. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  30887. * get the draw commands needed to render this primitive.
  30888. * <p>
  30889. * Do not call this function directly. This is documented just to
  30890. * list the exceptions that may be propagated when the scene is rendered:
  30891. * </p>
  30892. */
  30893. update(): void;
  30894. /**
  30895. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  30896. * @example
  30897. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  30898. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  30899. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  30900. * @param id - The id of the {@link GeometryInstance}.
  30901. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  30902. */
  30903. getGeometryInstanceAttributes(id: any): any;
  30904. /**
  30905. * Checks if the given Scene supports GroundPolylinePrimitives.
  30906. * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.
  30907. * @param scene - The current scene.
  30908. * @returns Whether or not the current scene supports GroundPolylinePrimitives.
  30909. */
  30910. static isSupported(scene: Scene): boolean;
  30911. /**
  30912. * Returns true if this object was destroyed; otherwise, false.
  30913. * <p>
  30914. * If this object was destroyed, it should not be used; calling any function other than
  30915. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30916. * </p>
  30917. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  30918. */
  30919. isDestroyed(): boolean;
  30920. /**
  30921. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30922. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30923. * <p>
  30924. * Once an object is destroyed, it should not be used; calling any function other than
  30925. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30926. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30927. * </p>
  30928. * @example
  30929. * e = e && e.destroy();
  30930. */
  30931. destroy(): void;
  30932. }
  30933. /**
  30934. * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.
  30935. * <p>
  30936. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  30937. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  30938. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  30939. * and match most of them and add a new geometry or appearance independently of each other.
  30940. * </p>
  30941. * <p>
  30942. * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors
  30943. * or materials besides PerInstanceColorAppearance.
  30944. * </p>
  30945. * <p>
  30946. * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping
  30947. * textures to terrain - for that use case, use {@link SingleTileImageryProvider}.
  30948. * </p>
  30949. * <p>
  30950. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  30951. * will be rendering artifacts for some viewing angles.
  30952. * </p>
  30953. * <p>
  30954. * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.
  30955. * </p>
  30956. * @example
  30957. * // Example 1: Create primitive with a single instance
  30958. * var rectangleInstance = new Cesium.GeometryInstance({
  30959. * geometry : new Cesium.RectangleGeometry({
  30960. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  30961. * }),
  30962. * id : 'rectangle',
  30963. * attributes : {
  30964. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  30965. * }
  30966. * });
  30967. * scene.primitives.add(new Cesium.GroundPrimitive({
  30968. * geometryInstances : rectangleInstance
  30969. * }));
  30970. *
  30971. * // Example 2: Batch instances
  30972. * var color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.
  30973. * var rectangleInstance = new Cesium.GeometryInstance({
  30974. * geometry : new Cesium.RectangleGeometry({
  30975. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  30976. * }),
  30977. * id : 'rectangle',
  30978. * attributes : {
  30979. * color : color
  30980. * }
  30981. * });
  30982. * var ellipseInstance = new Cesium.GeometryInstance({
  30983. * geometry : new Cesium.EllipseGeometry({
  30984. * center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),
  30985. * semiMinorAxis : 300000.0,
  30986. * semiMajorAxis : 400000.0
  30987. * }),
  30988. * id : 'ellipse',
  30989. * attributes : {
  30990. * color : color
  30991. * }
  30992. * });
  30993. * scene.primitives.add(new Cesium.GroundPrimitive({
  30994. * geometryInstances : [rectangleInstance, ellipseInstance]
  30995. * }));
  30996. * @param [options] - Object with the following properties:
  30997. * @param [options.geometryInstances] - The geometry instances to render.
  30998. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.
  30999. * @param [options.show = true] - Determines if this primitive will be shown.
  31000. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  31001. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  31002. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  31003. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31004. * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  31005. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  31006. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  31007. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  31008. * @param [options.debugShowShadowVolume = false] - For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on
  31009. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  31010. */
  31011. export class GroundPrimitive {
  31012. constructor(options?: {
  31013. geometryInstances?: any[] | GeometryInstance;
  31014. appearance?: Appearance;
  31015. show?: boolean;
  31016. vertexCacheOptimize?: boolean;
  31017. interleave?: boolean;
  31018. compressVertices?: boolean;
  31019. releaseGeometryInstances?: boolean;
  31020. allowPicking?: boolean;
  31021. asynchronous?: boolean;
  31022. classificationType?: ClassificationType;
  31023. debugShowBoundingVolume?: boolean;
  31024. debugShowShadowVolume?: boolean;
  31025. });
  31026. /**
  31027. * The {@link Appearance} used to shade this primitive. Each geometry
  31028. * instance is shaded with the same appearance. Some appearances, like
  31029. * {@link PerInstanceColorAppearance} allow giving each instance unique
  31030. * properties.
  31031. */
  31032. appearance: Appearance;
  31033. /**
  31034. * The geometry instances rendered with this primitive. This may
  31035. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  31036. * is <code>true</code> when the primitive is constructed.
  31037. * <p>
  31038. * Changing this property after the primitive is rendered has no effect.
  31039. * </p>
  31040. */
  31041. readonly geometryInstances: any[] | GeometryInstance;
  31042. /**
  31043. * Determines if the primitive will be shown. This affects all geometry
  31044. * instances in the primitive.
  31045. */
  31046. show: boolean;
  31047. /**
  31048. * Determines whether terrain, 3D Tiles or both will be classified.
  31049. */
  31050. classificationType: ClassificationType;
  31051. /**
  31052. * This property is for debugging only; it is not for production use nor is it optimized.
  31053. * <p>
  31054. * Draws the bounding sphere for each draw command in the primitive.
  31055. * </p>
  31056. */
  31057. debugShowBoundingVolume: boolean;
  31058. /**
  31059. * This property is for debugging only; it is not for production use nor is it optimized.
  31060. * <p>
  31061. * Draws the shadow volume for each geometry in the primitive.
  31062. * </p>
  31063. */
  31064. debugShowShadowVolume: boolean;
  31065. /**
  31066. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  31067. */
  31068. readonly vertexCacheOptimize: boolean;
  31069. /**
  31070. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  31071. */
  31072. readonly interleave: boolean;
  31073. /**
  31074. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31075. */
  31076. readonly releaseGeometryInstances: boolean;
  31077. /**
  31078. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  31079. */
  31080. readonly allowPicking: boolean;
  31081. /**
  31082. * Determines if the geometry instances will be created and batched on a web worker.
  31083. */
  31084. readonly asynchronous: boolean;
  31085. /**
  31086. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  31087. */
  31088. readonly compressVertices: boolean;
  31089. /**
  31090. * Determines if the primitive is complete and ready to render. If this property is
  31091. * true, the primitive will be rendered the next time that {@link GroundPrimitive#update}
  31092. * is called.
  31093. */
  31094. readonly ready: boolean;
  31095. /**
  31096. * Gets a promise that resolves when the primitive is ready to render.
  31097. */
  31098. readonly readyPromise: Promise<GroundPrimitive>;
  31099. /**
  31100. * Determines if GroundPrimitive rendering is supported.
  31101. * @param scene - The scene.
  31102. * @returns <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>
  31103. */
  31104. static isSupported(scene: Scene): boolean;
  31105. /**
  31106. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  31107. * GroundPrimitive synchronously.
  31108. * @returns A promise that will resolve once the terrain heights have been loaded.
  31109. */
  31110. static initializeTerrainHeights(): Promise<void>;
  31111. /**
  31112. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  31113. * get the draw commands needed to render this primitive.
  31114. * <p>
  31115. * Do not call this function directly. This is documented just to
  31116. * list the exceptions that may be propagated when the scene is rendered:
  31117. * </p>
  31118. */
  31119. update(): void;
  31120. /**
  31121. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  31122. * @example
  31123. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  31124. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  31125. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  31126. * @param id - The id of the {@link GeometryInstance}.
  31127. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  31128. */
  31129. getGeometryInstanceAttributes(id: any): any;
  31130. /**
  31131. * Returns true if this object was destroyed; otherwise, false.
  31132. * <p>
  31133. * If this object was destroyed, it should not be used; calling any function other than
  31134. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31135. * </p>
  31136. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  31137. */
  31138. isDestroyed(): boolean;
  31139. /**
  31140. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31141. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31142. * <p>
  31143. * Once an object is destroyed, it should not be used; calling any function other than
  31144. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31145. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31146. * </p>
  31147. * @example
  31148. * e = e && e.destroy();
  31149. */
  31150. destroy(): void;
  31151. /**
  31152. * Checks if the given Scene supports materials on GroundPrimitives.
  31153. * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.
  31154. * @param scene - The current scene.
  31155. * @returns Whether or not the current scene supports materials on GroundPrimitives.
  31156. */
  31157. static supportsMaterials(scene: Scene): boolean;
  31158. }
  31159. /**
  31160. * Represents the position relative to the terrain.
  31161. */
  31162. export enum HeightReference {
  31163. /**
  31164. * The position is absolute.
  31165. */
  31166. NONE = 0,
  31167. /**
  31168. * The position is clamped to the terrain.
  31169. */
  31170. CLAMP_TO_GROUND = 1,
  31171. /**
  31172. * The position height is the height above the terrain.
  31173. */
  31174. RELATIVE_TO_GROUND = 2
  31175. }
  31176. /**
  31177. * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}
  31178. * or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code>
  31179. * or <code>RIGHT</code> will display a billboard to the left or right (in screen space)
  31180. * of the anchor position.
  31181. * <br /><br />
  31182. * <div align='center'>
  31183. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  31184. * </div>
  31185. */
  31186. export enum HorizontalOrigin {
  31187. /**
  31188. * The origin is at the horizontal center of the object.
  31189. */
  31190. CENTER = 0,
  31191. /**
  31192. * The origin is on the left side of the object.
  31193. */
  31194. LEFT = 1,
  31195. /**
  31196. * The origin is on the right side of the object.
  31197. */
  31198. RIGHT = -1
  31199. }
  31200. /**
  31201. * An imagery layer that displays tiled image data from a single imagery provider
  31202. * on a {@link Globe}.
  31203. * @param imageryProvider - The imagery provider to use.
  31204. * @param [options] - Object with the following properties:
  31205. * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle
  31206. * can limit the visible portion of the imagery provider.
  31207. * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0.
  31208. * This can either be a simple number or a function with the signature
  31209. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31210. * current frame state, this layer, and the x, y, and level coordinates of the
  31211. * imagery tile for which the alpha is required, and it is expected to return
  31212. * the alpha value to use for the tile.
  31213. * @param [options.nightAlpha = 1.0] - The alpha blending value of this layer on the night side of the globe, from 0.0 to 1.0.
  31214. * This can either be a simple number or a function with the signature
  31215. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31216. * current frame state, this layer, and the x, y, and level coordinates of the
  31217. * imagery tile for which the alpha is required, and it is expected to return
  31218. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  31219. * @param [options.dayAlpha = 1.0] - The alpha blending value of this layer on the day side of the globe, from 0.0 to 1.0.
  31220. * This can either be a simple number or a function with the signature
  31221. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31222. * current frame state, this layer, and the x, y, and level coordinates of the
  31223. * imagery tile for which the alpha is required, and it is expected to return
  31224. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  31225. * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery
  31226. * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.
  31227. * This can either be a simple number or a function with the signature
  31228. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31229. * current frame state, this layer, and the x, y, and level coordinates of the
  31230. * imagery tile for which the brightness is required, and it is expected to return
  31231. * the brightness value to use for the tile. The function is executed for every
  31232. * frame and for every tile, so it must be fast.
  31233. * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color.
  31234. * Less than 1.0 reduces the contrast while greater than 1.0 increases it.
  31235. * This can either be a simple number or a function with the signature
  31236. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31237. * current frame state, this layer, and the x, y, and level coordinates of the
  31238. * imagery tile for which the contrast is required, and it is expected to return
  31239. * the contrast value to use for the tile. The function is executed for every
  31240. * frame and for every tile, so it must be fast.
  31241. * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color.
  31242. * This can either be a simple number or a function with the signature
  31243. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31244. * current frame state, this layer, and the x, y, and level coordinates
  31245. * of the imagery tile for which the hue is required, and it is expected to return
  31246. * the contrast value to use for the tile. The function is executed for every
  31247. * frame and for every tile, so it must be fast.
  31248. * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color.
  31249. * Less than 1.0 reduces the saturation while greater than 1.0 increases it.
  31250. * This can either be a simple number or a function with the signature
  31251. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31252. * current frame state, this layer, and the x, y, and level coordinates
  31253. * of the imagery tile for which the saturation is required, and it is expected to return
  31254. * the contrast value to use for the tile. The function is executed for every
  31255. * frame and for every tile, so it must be fast.
  31256. * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  31257. * This can either be a simple number or a function with the signature
  31258. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31259. * current frame state, this layer, and the x, y, and level coordinates of the
  31260. * imagery tile for which the gamma is required, and it is expected to return
  31261. * the gamma value to use for the tile. The function is executed for every
  31262. * frame and for every tile, so it must be fast.
  31263. * @param [options.splitDirection = ImagerySplitDirection.NONE] - The {@link ImagerySplitDirection} split to apply to this layer.
  31264. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The
  31265. * texture minification filter to apply to this layer. Possible values
  31266. * are <code>TextureMinificationFilter.LINEAR</code> and
  31267. * <code>TextureMinificationFilter.NEAREST</code>.
  31268. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The
  31269. * texture minification filter to apply to this layer. Possible values
  31270. * are <code>TextureMagnificationFilter.LINEAR</code> and
  31271. * <code>TextureMagnificationFilter.NEAREST</code>.
  31272. * @param [options.show = true] - True if the layer is shown; otherwise, false.
  31273. * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use
  31274. * for texture filtering. If this parameter is not specified, the maximum anisotropy supported
  31275. * by the WebGL stack will be used. Larger values make the imagery look better in horizon
  31276. * views.
  31277. * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer,
  31278. * or undefined to show it at all levels. Level zero is the least-detailed level.
  31279. * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer,
  31280. * or undefined to show it at all levels. Level zero is the least-detailed level.
  31281. * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer.
  31282. * @param [options.colorToAlpha] - Color to be used as alpha.
  31283. * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha.
  31284. */
  31285. export class ImageryLayer {
  31286. constructor(imageryProvider: ImageryProvider, options?: {
  31287. rectangle?: Rectangle;
  31288. alpha?: number | ((...params: any[]) => any);
  31289. nightAlpha?: number | ((...params: any[]) => any);
  31290. dayAlpha?: number | ((...params: any[]) => any);
  31291. brightness?: number | ((...params: any[]) => any);
  31292. contrast?: number | ((...params: any[]) => any);
  31293. hue?: number | ((...params: any[]) => any);
  31294. saturation?: number | ((...params: any[]) => any);
  31295. gamma?: number | ((...params: any[]) => any);
  31296. splitDirection?: ImagerySplitDirection | ((...params: any[]) => any);
  31297. minificationFilter?: TextureMinificationFilter;
  31298. magnificationFilter?: TextureMagnificationFilter;
  31299. show?: boolean;
  31300. maximumAnisotropy?: number;
  31301. minimumTerrainLevel?: number;
  31302. maximumTerrainLevel?: number;
  31303. cutoutRectangle?: Rectangle;
  31304. colorToAlpha?: Color;
  31305. colorToAlphaThreshold?: number;
  31306. });
  31307. /**
  31308. * The alpha blending value of this layer, with 0.0 representing fully transparent and
  31309. * 1.0 representing fully opaque.
  31310. */
  31311. alpha: number;
  31312. /**
  31313. * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and
  31314. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  31315. */
  31316. nightAlpha: number;
  31317. /**
  31318. * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and
  31319. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  31320. */
  31321. dayAlpha: number;
  31322. /**
  31323. * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0
  31324. * makes the imagery darker while greater than 1.0 makes it brighter.
  31325. */
  31326. brightness: number;
  31327. /**
  31328. * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31329. * the contrast while greater than 1.0 increases it.
  31330. */
  31331. contrast: number;
  31332. /**
  31333. * The hue of this layer in radians. 0.0 uses the unmodified imagery color.
  31334. */
  31335. hue: number;
  31336. /**
  31337. * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31338. * saturation while greater than 1.0 increases it.
  31339. */
  31340. saturation: number;
  31341. /**
  31342. * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  31343. */
  31344. gamma: number;
  31345. /**
  31346. * The {@link ImagerySplitDirection} to apply to this layer.
  31347. */
  31348. splitDirection: ImagerySplitDirection;
  31349. /**
  31350. * The {@link TextureMinificationFilter} to apply to this layer.
  31351. * Possible values are {@link TextureMinificationFilter.LINEAR} (the default)
  31352. * and {@link TextureMinificationFilter.NEAREST}.
  31353. *
  31354. * To take effect, this property must be set immediately after adding the imagery layer.
  31355. * Once a texture is loaded it won't be possible to change the texture filter used.
  31356. */
  31357. minificationFilter: TextureMinificationFilter;
  31358. /**
  31359. * The {@link TextureMagnificationFilter} to apply to this layer.
  31360. * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)
  31361. * and {@link TextureMagnificationFilter.NEAREST}.
  31362. *
  31363. * To take effect, this property must be set immediately after adding the imagery layer.
  31364. * Once a texture is loaded it won't be possible to change the texture filter used.
  31365. */
  31366. magnificationFilter: TextureMagnificationFilter;
  31367. /**
  31368. * Determines if this layer is shown.
  31369. */
  31370. show: boolean;
  31371. /**
  31372. * Rectangle cutout in this layer of imagery.
  31373. */
  31374. cutoutRectangle: Rectangle;
  31375. /**
  31376. * Color value that should be set to transparent.
  31377. */
  31378. colorToAlpha: Color;
  31379. /**
  31380. * Normalized (0-1) threshold for color-to-alpha.
  31381. */
  31382. colorToAlphaThreshold: number;
  31383. /**
  31384. * Gets the imagery provider for this layer.
  31385. */
  31386. readonly imageryProvider: ImageryProvider;
  31387. /**
  31388. * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the
  31389. * {@link ImageryProvider}, only a portion of the imagery provider is shown.
  31390. */
  31391. readonly rectangle: Rectangle;
  31392. /**
  31393. * This value is used as the default brightness for the imagery layer if one is not provided during construction
  31394. * or by the imagery provider. This value does not modify the brightness of the imagery.
  31395. */
  31396. static DEFAULT_BRIGHTNESS: number;
  31397. /**
  31398. * This value is used as the default contrast for the imagery layer if one is not provided during construction
  31399. * or by the imagery provider. This value does not modify the contrast of the imagery.
  31400. */
  31401. static DEFAULT_CONTRAST: number;
  31402. /**
  31403. * This value is used as the default hue for the imagery layer if one is not provided during construction
  31404. * or by the imagery provider. This value does not modify the hue of the imagery.
  31405. */
  31406. static DEFAULT_HUE: number;
  31407. /**
  31408. * This value is used as the default saturation for the imagery layer if one is not provided during construction
  31409. * or by the imagery provider. This value does not modify the saturation of the imagery.
  31410. */
  31411. static DEFAULT_SATURATION: number;
  31412. /**
  31413. * This value is used as the default gamma for the imagery layer if one is not provided during construction
  31414. * or by the imagery provider. This value does not modify the gamma of the imagery.
  31415. */
  31416. static DEFAULT_GAMMA: number;
  31417. /**
  31418. * This value is used as the default split for the imagery layer if one is not provided during construction
  31419. * or by the imagery provider.
  31420. */
  31421. static DEFAULT_SPLIT: ImagerySplitDirection;
  31422. /**
  31423. * This value is used as the default texture minification filter for the imagery layer if one is not provided
  31424. * during construction or by the imagery provider.
  31425. */
  31426. static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter;
  31427. /**
  31428. * This value is used as the default texture magnification filter for the imagery layer if one is not provided
  31429. * during construction or by the imagery provider.
  31430. */
  31431. static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter;
  31432. /**
  31433. * This value is used as the default threshold for color-to-alpha if one is not provided
  31434. * during construction or by the imagery provider.
  31435. */
  31436. static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number;
  31437. /**
  31438. * Gets a value indicating whether this layer is the base layer in the
  31439. * {@link ImageryLayerCollection}. The base layer is the one that underlies all
  31440. * others. It is special in that it is treated as if it has global rectangle, even if
  31441. * it actually does not, by stretching the texels at the edges over the entire
  31442. * globe.
  31443. * @returns true if this is the base layer; otherwise, false.
  31444. */
  31445. isBaseLayer(): boolean;
  31446. /**
  31447. * Returns true if this object was destroyed; otherwise, false.
  31448. * <br /><br />
  31449. * If this object was destroyed, it should not be used; calling any function other than
  31450. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31451. * @returns True if this object was destroyed; otherwise, false.
  31452. */
  31453. isDestroyed(): boolean;
  31454. /**
  31455. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31456. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31457. * <br /><br />
  31458. * Once an object is destroyed, it should not be used; calling any function other than
  31459. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31460. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31461. * @example
  31462. * imageryLayer = imageryLayer && imageryLayer.destroy();
  31463. */
  31464. destroy(): void;
  31465. /**
  31466. * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
  31467. * producing the overall bounds of imagery that can be produced by this layer.
  31468. * @example
  31469. * // Zoom to an imagery layer.
  31470. * imageryLayer.getViewableRectangle().then(function (rectangle) {
  31471. * return camera.flyTo({
  31472. * destination: rectangle
  31473. * });
  31474. * });
  31475. * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.
  31476. */
  31477. getViewableRectangle(): Promise<Rectangle>;
  31478. }
  31479. /**
  31480. * An ordered collection of imagery layers.
  31481. */
  31482. export class ImageryLayerCollection {
  31483. constructor();
  31484. /**
  31485. * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that
  31486. * was added and the index at which it was added.
  31487. */
  31488. layerAdded: Event;
  31489. /**
  31490. * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that
  31491. * was removed and the index from which it was removed.
  31492. */
  31493. layerRemoved: Event;
  31494. /**
  31495. * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that
  31496. * was moved, its new index after the move, and its old index prior to the move.
  31497. */
  31498. layerMoved: Event;
  31499. /**
  31500. * An event that is raised when a layer is shown or hidden by setting the
  31501. * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer,
  31502. * the index of the layer in the collection, and a flag that is true if the layer is now
  31503. * shown or false if it is now hidden.
  31504. */
  31505. layerShownOrHidden: Event;
  31506. /**
  31507. * Gets the number of layers in this collection.
  31508. */
  31509. length: number;
  31510. /**
  31511. * Adds a layer to the collection.
  31512. * @param layer - the layer to add.
  31513. * @param [index] - the index to add the layer at. If omitted, the layer will
  31514. * be added on top of all existing layers.
  31515. */
  31516. add(layer: ImageryLayer, index?: number): void;
  31517. /**
  31518. * Creates a new layer using the given ImageryProvider and adds it to the collection.
  31519. * @param imageryProvider - the imagery provider to create a new layer for.
  31520. * @param [index] - the index to add the layer at. If omitted, the layer will
  31521. * added on top of all existing layers.
  31522. * @returns The newly created layer.
  31523. */
  31524. addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer;
  31525. /**
  31526. * Removes a layer from this collection, if present.
  31527. * @param layer - The layer to remove.
  31528. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  31529. * @returns true if the layer was in the collection and was removed,
  31530. * false if the layer was not in the collection.
  31531. */
  31532. remove(layer: ImageryLayer, destroy?: boolean): boolean;
  31533. /**
  31534. * Removes all layers from this collection.
  31535. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  31536. */
  31537. removeAll(destroy?: boolean): void;
  31538. /**
  31539. * Checks to see if the collection contains a given layer.
  31540. * @param layer - the layer to check for.
  31541. * @returns true if the collection contains the layer, false otherwise.
  31542. */
  31543. contains(layer: ImageryLayer): boolean;
  31544. /**
  31545. * Determines the index of a given layer in the collection.
  31546. * @param layer - The layer to find the index of.
  31547. * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection.
  31548. */
  31549. indexOf(layer: ImageryLayer): number;
  31550. /**
  31551. * Gets a layer by index from the collection.
  31552. * @param index - the index to retrieve.
  31553. * @returns The imagery layer at the given index.
  31554. */
  31555. get(index: number): ImageryLayer;
  31556. /**
  31557. * Raises a layer up one position in the collection.
  31558. * @param layer - the layer to move.
  31559. */
  31560. raise(layer: ImageryLayer): void;
  31561. /**
  31562. * Lowers a layer down one position in the collection.
  31563. * @param layer - the layer to move.
  31564. */
  31565. lower(layer: ImageryLayer): void;
  31566. /**
  31567. * Raises a layer to the top of the collection.
  31568. * @param layer - the layer to move.
  31569. */
  31570. raiseToTop(layer: ImageryLayer): void;
  31571. /**
  31572. * Lowers a layer to the bottom of the collection.
  31573. * @param layer - the layer to move.
  31574. */
  31575. lowerToBottom(layer: ImageryLayer): void;
  31576. /**
  31577. * Determines the imagery layers that are intersected by a pick ray. To compute a pick ray from a
  31578. * location on the screen, use {@link Camera.getPickRay}.
  31579. * @param ray - The ray to test for intersection.
  31580. * @param scene - The scene.
  31581. * @returns An array that includes all of
  31582. * the layers that are intersected by a given pick ray. Undefined if
  31583. * no layers are selected.
  31584. */
  31585. pickImageryLayers(ray: Ray, scene: Scene): ImageryLayer[] | undefined;
  31586. /**
  31587. * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery
  31588. * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected
  31589. * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.
  31590. * @example
  31591. * var pickRay = viewer.camera.getPickRay(windowPosition);
  31592. * var featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);
  31593. * if (!Cesium.defined(featuresPromise)) {
  31594. * console.log('No features picked.');
  31595. * } else {
  31596. * Cesium.when(featuresPromise, function(features) {
  31597. * // This function is called asynchronously when the list if picked features is available.
  31598. * console.log('Number of features: ' + features.length);
  31599. * if (features.length > 0) {
  31600. * console.log('First feature name: ' + features[0].name);
  31601. * }
  31602. * });
  31603. * }
  31604. * @param ray - The ray to test for intersection.
  31605. * @param scene - The scene.
  31606. * @returns A promise that resolves to an array of features intersected by the pick ray.
  31607. * If it can be quickly determined that no features are intersected (for example,
  31608. * because no active imagery providers support {@link ImageryProvider#pickFeatures}
  31609. * or because the pick ray does not intersect the surface), this function will
  31610. * return undefined.
  31611. */
  31612. pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise<ImageryLayerFeatureInfo[]> | undefined;
  31613. /**
  31614. * Returns true if this object was destroyed; otherwise, false.
  31615. * <br /><br />
  31616. * If this object was destroyed, it should not be used; calling any function other than
  31617. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31618. * @returns true if this object was destroyed; otherwise, false.
  31619. */
  31620. isDestroyed(): boolean;
  31621. /**
  31622. * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this
  31623. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  31624. * collector.
  31625. * <br /><br />
  31626. * Once this object is destroyed, it should not be used; calling any function other than
  31627. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31628. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31629. * @example
  31630. * layerCollection = layerCollection && layerCollection.destroy();
  31631. */
  31632. destroy(): void;
  31633. }
  31634. /**
  31635. * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.
  31636. */
  31637. export class ImageryLayerFeatureInfo {
  31638. constructor();
  31639. /**
  31640. * Gets or sets the name of the feature.
  31641. */
  31642. name: string | undefined;
  31643. /**
  31644. * Gets or sets an HTML description of the feature. The HTML is not trusted and should
  31645. * be sanitized before display to the user.
  31646. */
  31647. description: string | undefined;
  31648. /**
  31649. * Gets or sets the position of the feature, or undefined if the position is not known.
  31650. */
  31651. position: Cartographic | undefined;
  31652. /**
  31653. * Gets or sets the raw data describing the feature. The raw data may be in any
  31654. * number of formats, such as GeoJSON, KML, etc.
  31655. */
  31656. data: any | undefined;
  31657. /**
  31658. * Gets or sets the image layer of the feature.
  31659. */
  31660. imageryLayer: any | undefined;
  31661. /**
  31662. * Configures the name of this feature by selecting an appropriate property. The name will be obtained from
  31663. * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title',
  31664. * 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If
  31665. * the name cannot be obtained from any of these sources, the existing name will be left unchanged.
  31666. * @param properties - An object literal containing the properties of the feature.
  31667. */
  31668. configureNameFromProperties(properties: any): void;
  31669. /**
  31670. * Configures the description of this feature by creating an HTML table of properties and their values.
  31671. * @param properties - An object literal containing the properties of the feature.
  31672. */
  31673. configureDescriptionFromProperties(properties: any): void;
  31674. }
  31675. /**
  31676. * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an
  31677. * interface and is not intended to be instantiated directly.
  31678. */
  31679. export class ImageryProvider {
  31680. constructor();
  31681. /**
  31682. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31683. * 1.0 representing fully opaque.
  31684. */
  31685. defaultAlpha: number | undefined;
  31686. /**
  31687. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31688. * 1.0 representing fully opaque.
  31689. */
  31690. defaultNightAlpha: number | undefined;
  31691. /**
  31692. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31693. * 1.0 representing fully opaque.
  31694. */
  31695. defaultDayAlpha: number | undefined;
  31696. /**
  31697. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31698. * makes the imagery darker while greater than 1.0 makes it brighter.
  31699. */
  31700. defaultBrightness: number | undefined;
  31701. /**
  31702. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31703. * the contrast while greater than 1.0 increases it.
  31704. */
  31705. defaultContrast: number | undefined;
  31706. /**
  31707. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31708. */
  31709. defaultHue: number | undefined;
  31710. /**
  31711. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31712. * saturation while greater than 1.0 increases it.
  31713. */
  31714. defaultSaturation: number | undefined;
  31715. /**
  31716. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31717. */
  31718. defaultGamma: number | undefined;
  31719. /**
  31720. * The default texture minification filter to apply to this provider.
  31721. */
  31722. defaultMinificationFilter: TextureMinificationFilter;
  31723. /**
  31724. * The default texture magnification filter to apply to this provider.
  31725. */
  31726. defaultMagnificationFilter: TextureMagnificationFilter;
  31727. /**
  31728. * Gets a value indicating whether or not the provider is ready for use.
  31729. */
  31730. readonly ready: boolean;
  31731. /**
  31732. * Gets a promise that resolves to true when the provider is ready for use.
  31733. */
  31734. readonly readyPromise: Promise<boolean>;
  31735. /**
  31736. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  31737. * not be called before {@link ImageryProvider#ready} returns true.
  31738. */
  31739. readonly rectangle: Rectangle;
  31740. /**
  31741. * Gets the width of each tile, in pixels. This function should
  31742. * not be called before {@link ImageryProvider#ready} returns true.
  31743. */
  31744. readonly tileWidth: number;
  31745. /**
  31746. * Gets the height of each tile, in pixels. This function should
  31747. * not be called before {@link ImageryProvider#ready} returns true.
  31748. */
  31749. readonly tileHeight: number;
  31750. /**
  31751. * Gets the maximum level-of-detail that can be requested. This function should
  31752. * not be called before {@link ImageryProvider#ready} returns true.
  31753. */
  31754. readonly maximumLevel: number | undefined;
  31755. /**
  31756. * Gets the minimum level-of-detail that can be requested. This function should
  31757. * not be called before {@link ImageryProvider#ready} returns true. Generally,
  31758. * a minimum level should only be used when the rectangle of the imagery is small
  31759. * enough that the number of tiles at the minimum level is small. An imagery
  31760. * provider with more than a few tiles at the minimum level will lead to
  31761. * rendering problems.
  31762. */
  31763. readonly minimumLevel: number;
  31764. /**
  31765. * Gets the tiling scheme used by the provider. This function should
  31766. * not be called before {@link ImageryProvider#ready} returns true.
  31767. */
  31768. readonly tilingScheme: TilingScheme;
  31769. /**
  31770. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31771. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31772. * returns undefined, no tiles are filtered. This function should
  31773. * not be called before {@link ImageryProvider#ready} returns true.
  31774. */
  31775. readonly tileDiscardPolicy: TileDiscardPolicy;
  31776. /**
  31777. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  31778. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31779. * are passed an instance of {@link TileProviderError}.
  31780. */
  31781. readonly errorEvent: Event;
  31782. /**
  31783. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31784. * the source of the imagery. This function should
  31785. * not be called before {@link ImageryProvider#ready} returns true.
  31786. */
  31787. readonly credit: Credit;
  31788. /**
  31789. * Gets the proxy used by this provider.
  31790. */
  31791. readonly proxy: Proxy;
  31792. /**
  31793. * Gets a value indicating whether or not the images provided by this imagery provider
  31794. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31795. * be ignored. If this property is true, any images without an alpha channel will be treated
  31796. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31797. * and texture upload time are reduced.
  31798. */
  31799. readonly hasAlphaChannel: boolean;
  31800. /**
  31801. * Gets the credits to be displayed when a given tile is displayed.
  31802. * @param x - The tile X coordinate.
  31803. * @param y - The tile Y coordinate.
  31804. * @param level - The tile level;
  31805. * @returns The credits to be displayed when the tile is displayed.
  31806. */
  31807. getTileCredits(x: number, y: number, level: number): Credit[];
  31808. /**
  31809. * Requests the image for a given tile. This function should
  31810. * not be called before {@link ImageryProvider#ready} returns true.
  31811. * @param x - The tile X coordinate.
  31812. * @param y - The tile Y coordinate.
  31813. * @param level - The tile level.
  31814. * @param [request] - The request object. Intended for internal use only.
  31815. * @returns A promise for the image that will resolve when the image is available, or
  31816. * undefined if there are too many active requests to the server, and the request
  31817. * should be retried later. The resolved image may be either an
  31818. * Image or a Canvas DOM object.
  31819. */
  31820. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31821. /**
  31822. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  31823. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  31824. * This function is optional, so it may not exist on all ImageryProviders.
  31825. * @param x - The tile X coordinate.
  31826. * @param y - The tile Y coordinate.
  31827. * @param level - The tile level.
  31828. * @param longitude - The longitude at which to pick features.
  31829. * @param latitude - The latitude at which to pick features.
  31830. * @returns A promise for the picked features that will resolve when the asynchronous
  31831. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  31832. * instances. The array may be empty if no features are found at the given location.
  31833. * It may also be undefined if picking is not supported.
  31834. */
  31835. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  31836. /**
  31837. * Loads an image from a given URL. If the server referenced by the URL already has
  31838. * too many requests pending, this function will instead return undefined, indicating
  31839. * that the request should be retried later.
  31840. * @param imageryProvider - The imagery provider for the URL.
  31841. * @param url - The URL of the image.
  31842. * @returns A promise for the image that will resolve when the image is available, or
  31843. * undefined if there are too many active requests to the server, and the request
  31844. * should be retried later. The resolved image may be either an
  31845. * Image or a Canvas DOM object.
  31846. */
  31847. static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  31848. }
  31849. /**
  31850. * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}.
  31851. */
  31852. export enum ImagerySplitDirection {
  31853. /**
  31854. * Display the ImageryLayer to the left of the {@link Scene#imagerySplitPosition}.
  31855. */
  31856. LEFT = -1,
  31857. /**
  31858. * Always display the ImageryLayer.
  31859. */
  31860. NONE = 0,
  31861. /**
  31862. * Display the ImageryLayer to the right of the {@link Scene#imagerySplitPosition}.
  31863. */
  31864. RIGHT = 1
  31865. }
  31866. export namespace IonImageryProvider {
  31867. /**
  31868. * Initialization options for the TileMapServiceImageryProvider constructor
  31869. * @property assetId - An ion imagery asset ID
  31870. * @property [accessToken = Ion.defaultAccessToken] - The access token to use.
  31871. * @property [server = Ion.defaultServer] - The resource to the Cesium ion API server.
  31872. */
  31873. type ConstructorOptions = {
  31874. assetId: number;
  31875. accessToken?: string;
  31876. server?: string | Resource;
  31877. };
  31878. }
  31879. /**
  31880. * Provides tiled imagery using the Cesium ion REST API.
  31881. * @example
  31882. * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 }));
  31883. * @param options - Object describing initialization options
  31884. */
  31885. export class IonImageryProvider {
  31886. constructor(options: IonImageryProvider.ConstructorOptions);
  31887. /**
  31888. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31889. * 1.0 representing fully opaque.
  31890. */
  31891. defaultAlpha: number | undefined;
  31892. /**
  31893. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31894. * 1.0 representing fully opaque.
  31895. */
  31896. defaultNightAlpha: number | undefined;
  31897. /**
  31898. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31899. * 1.0 representing fully opaque.
  31900. */
  31901. defaultDayAlpha: number | undefined;
  31902. /**
  31903. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31904. * makes the imagery darker while greater than 1.0 makes it brighter.
  31905. */
  31906. defaultBrightness: number | undefined;
  31907. /**
  31908. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31909. * the contrast while greater than 1.0 increases it.
  31910. */
  31911. defaultContrast: number | undefined;
  31912. /**
  31913. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31914. */
  31915. defaultHue: number | undefined;
  31916. /**
  31917. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31918. * saturation while greater than 1.0 increases it.
  31919. */
  31920. defaultSaturation: number | undefined;
  31921. /**
  31922. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31923. */
  31924. defaultGamma: number | undefined;
  31925. /**
  31926. * The default texture minification filter to apply to this provider.
  31927. */
  31928. defaultMinificationFilter: TextureMinificationFilter;
  31929. /**
  31930. * The default texture magnification filter to apply to this provider.
  31931. */
  31932. defaultMagnificationFilter: TextureMagnificationFilter;
  31933. /**
  31934. * Gets a value indicating whether or not the provider is ready for use.
  31935. */
  31936. readonly ready: boolean;
  31937. /**
  31938. * Gets a promise that resolves to true when the provider is ready for use.
  31939. */
  31940. readonly readyPromise: Promise<boolean>;
  31941. /**
  31942. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  31943. * not be called before {@link IonImageryProvider#ready} returns true.
  31944. */
  31945. readonly rectangle: Rectangle;
  31946. /**
  31947. * Gets the width of each tile, in pixels. This function should
  31948. * not be called before {@link IonImageryProvider#ready} returns true.
  31949. */
  31950. readonly tileWidth: number;
  31951. /**
  31952. * Gets the height of each tile, in pixels. This function should
  31953. * not be called before {@link IonImageryProvider#ready} returns true.
  31954. */
  31955. readonly tileHeight: number;
  31956. /**
  31957. * Gets the maximum level-of-detail that can be requested. This function should
  31958. * not be called before {@link IonImageryProvider#ready} returns true.
  31959. */
  31960. readonly maximumLevel: number | undefined;
  31961. /**
  31962. * Gets the minimum level-of-detail that can be requested. This function should
  31963. * not be called before {@link IonImageryProvider#ready} returns true. Generally,
  31964. * a minimum level should only be used when the rectangle of the imagery is small
  31965. * enough that the number of tiles at the minimum level is small. An imagery
  31966. * provider with more than a few tiles at the minimum level will lead to
  31967. * rendering problems.
  31968. */
  31969. readonly minimumLevel: number;
  31970. /**
  31971. * Gets the tiling scheme used by the provider. This function should
  31972. * not be called before {@link IonImageryProvider#ready} returns true.
  31973. */
  31974. readonly tilingScheme: TilingScheme;
  31975. /**
  31976. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31977. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31978. * returns undefined, no tiles are filtered. This function should
  31979. * not be called before {@link IonImageryProvider#ready} returns true.
  31980. */
  31981. readonly tileDiscardPolicy: TileDiscardPolicy;
  31982. /**
  31983. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  31984. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31985. * are passed an instance of {@link TileProviderError}.
  31986. */
  31987. readonly errorEvent: Event;
  31988. /**
  31989. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31990. * the source of the imagery. This function should
  31991. * not be called before {@link IonImageryProvider#ready} returns true.
  31992. */
  31993. readonly credit: Credit;
  31994. /**
  31995. * Gets a value indicating whether or not the images provided by this imagery provider
  31996. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31997. * be ignored. If this property is true, any images without an alpha channel will be treated
  31998. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31999. * and texture upload time are reduced.
  32000. */
  32001. readonly hasAlphaChannel: boolean;
  32002. /**
  32003. * Gets the proxy used by this provider.
  32004. */
  32005. readonly proxy: Proxy;
  32006. /**
  32007. * Gets the credits to be displayed when a given tile is displayed.
  32008. * @param x - The tile X coordinate.
  32009. * @param y - The tile Y coordinate.
  32010. * @param level - The tile level;
  32011. * @returns The credits to be displayed when the tile is displayed.
  32012. */
  32013. getTileCredits(x: number, y: number, level: number): Credit[];
  32014. /**
  32015. * Requests the image for a given tile. This function should
  32016. * not be called before {@link IonImageryProvider#ready} returns true.
  32017. * @param x - The tile X coordinate.
  32018. * @param y - The tile Y coordinate.
  32019. * @param level - The tile level.
  32020. * @param [request] - The request object. Intended for internal use only.
  32021. * @returns A promise for the image that will resolve when the image is available, or
  32022. * undefined if there are too many active requests to the server, and the request
  32023. * should be retried later. The resolved image may be either an
  32024. * Image or a Canvas DOM object.
  32025. */
  32026. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  32027. /**
  32028. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32029. * a tile. This function should not be called before {@link IonImageryProvider#ready} returns true.
  32030. * This function is optional, so it may not exist on all ImageryProviders.
  32031. * @param x - The tile X coordinate.
  32032. * @param y - The tile Y coordinate.
  32033. * @param level - The tile level.
  32034. * @param longitude - The longitude at which to pick features.
  32035. * @param latitude - The latitude at which to pick features.
  32036. * @returns A promise for the picked features that will resolve when the asynchronous
  32037. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32038. * instances. The array may be empty if no features are found at the given location.
  32039. * It may also be undefined if picking is not supported.
  32040. */
  32041. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32042. }
  32043. /**
  32044. * The types of imagery provided by {@link createWorldImagery}.
  32045. */
  32046. export enum IonWorldImageryStyle {
  32047. /**
  32048. * Aerial imagery.
  32049. */
  32050. AERIAL = 2,
  32051. /**
  32052. * Aerial imagery with a road overlay.
  32053. */
  32054. AERIAL_WITH_LABELS = 3,
  32055. /**
  32056. * Roads without additional imagery.
  32057. */
  32058. ROAD = 4
  32059. }
  32060. /**
  32061. * A Label draws viewport-aligned text positioned in the 3D scene. This constructor
  32062. * should not be used directly, instead create labels by calling {@link LabelCollection#add}.
  32063. */
  32064. export class Label {
  32065. constructor();
  32066. /**
  32067. * Determines if this label will be shown. Use this to hide or show a label, instead
  32068. * of removing it and re-adding it to the collection.
  32069. */
  32070. show: boolean;
  32071. /**
  32072. * Gets or sets the Cartesian position of this label.
  32073. */
  32074. position: Cartesian3;
  32075. /**
  32076. * Gets or sets the height reference of this billboard.
  32077. */
  32078. heightReference: HeightReference;
  32079. /**
  32080. * Gets or sets the text of this label.
  32081. */
  32082. text: string;
  32083. /**
  32084. * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
  32085. */
  32086. font: string;
  32087. /**
  32088. * Gets or sets the fill color of this label.
  32089. */
  32090. fillColor: Color;
  32091. /**
  32092. * Gets or sets the outline color of this label.
  32093. */
  32094. outlineColor: Color;
  32095. /**
  32096. * Gets or sets the outline width of this label.
  32097. */
  32098. outlineWidth: number;
  32099. /**
  32100. * Determines if a background behind this label will be shown.
  32101. */
  32102. showBackground: boolean;
  32103. /**
  32104. * Gets or sets the background color of this label.
  32105. */
  32106. backgroundColor: Color;
  32107. /**
  32108. * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value
  32109. * controls horizontal padding, and the <code>y</code> value controls vertical padding.
  32110. */
  32111. backgroundPadding: Cartesian2;
  32112. /**
  32113. * Gets or sets the style of this label.
  32114. */
  32115. style: LabelStyle;
  32116. /**
  32117. * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used
  32118. * to align multiple labels and billboards at the same position, e.g., an image and text. The
  32119. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  32120. * left to right, and <code>y</code> increases from top to bottom.
  32121. * <br /><br />
  32122. * <div align='center'>
  32123. * <table border='0' cellpadding='5'><tr>
  32124. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  32125. * <td align='center'><code>l.pixeloffset = new Cartesian2(25, 75);</code><br/><img src='Images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td>
  32126. * </tr></table>
  32127. * The label's origin is indicated by the yellow point.
  32128. * </div>
  32129. */
  32130. pixelOffset: Cartesian2;
  32131. /**
  32132. * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.
  32133. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  32134. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32135. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32136. * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined,
  32137. * translucencyByDistance will be disabled.
  32138. * @example
  32139. * // Example 1.
  32140. * // Set a label's translucencyByDistance to 1.0 when the
  32141. * // camera is 1500 meters from the label and disappear as
  32142. * // the camera distance approaches 8.0e6 meters.
  32143. * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  32144. * @example
  32145. * // Example 2.
  32146. * // disable translucency by distance
  32147. * text.translucencyByDistance = undefined;
  32148. */
  32149. translucencyByDistance: NearFarScalar;
  32150. /**
  32151. * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.
  32152. * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  32153. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32154. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32155. * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined,
  32156. * pixelOffsetScaleByDistance will be disabled.
  32157. * @example
  32158. * // Example 1.
  32159. * // Set a label's pixel offset scale to 0.0 when the
  32160. * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels
  32161. * // in the y direction the camera distance approaches 8.0e6 meters.
  32162. * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  32163. * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  32164. * @example
  32165. * // Example 2.
  32166. * // disable pixel offset by distance
  32167. * text.pixelOffsetScaleByDistance = undefined;
  32168. */
  32169. pixelOffsetScaleByDistance: NearFarScalar;
  32170. /**
  32171. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  32172. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  32173. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32174. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32175. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  32176. * scaleByDistance will be disabled.
  32177. * @example
  32178. * // Example 1.
  32179. * // Set a label's scaleByDistance to scale by 1.5 when the
  32180. * // camera is 1500 meters from the label and disappear as
  32181. * // the camera distance approaches 8.0e6 meters.
  32182. * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  32183. * @example
  32184. * // Example 2.
  32185. * // disable scaling by distance
  32186. * label.scaleByDistance = undefined;
  32187. */
  32188. scaleByDistance: NearFarScalar;
  32189. /**
  32190. * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed
  32191. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  32192. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  32193. * which is typically meters.
  32194. * <br /><br />
  32195. * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to
  32196. * arrange a label above its corresponding 3D model.
  32197. * <br /><br />
  32198. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  32199. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  32200. * <br /><br />
  32201. * <div align='center'>
  32202. * <table border='0' cellpadding='5'><tr>
  32203. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  32204. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  32205. * </tr></table>
  32206. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  32207. * </div>
  32208. */
  32209. eyeOffset: Cartesian3;
  32210. /**
  32211. * Gets or sets the horizontal origin of this label, which determines if the label is drawn
  32212. * to the left, center, or right of its anchor position.
  32213. * <br /><br />
  32214. * <div align='center'>
  32215. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  32216. * </div>
  32217. * @example
  32218. * // Use a top, right origin
  32219. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  32220. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  32221. */
  32222. horizontalOrigin: HorizontalOrigin;
  32223. /**
  32224. * Gets or sets the vertical origin of this label, which determines if the label is
  32225. * to the above, below, or at the center of its anchor position.
  32226. * <br /><br />
  32227. * <div align='center'>
  32228. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  32229. * </div>
  32230. * @example
  32231. * // Use a top, right origin
  32232. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  32233. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  32234. */
  32235. verticalOrigin: VerticalOrigin;
  32236. /**
  32237. * Gets or sets the uniform scale that is multiplied with the label's size in pixels.
  32238. * A scale of <code>1.0</code> does not change the size of the label; a scale greater than
  32239. * <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks
  32240. * the label.
  32241. * <br /><br />
  32242. * Applying a large scale value may pixelate the label. To make text larger without pixelation,
  32243. * use a larger font size when calling {@link Label#font} instead.
  32244. * <br /><br />
  32245. * <div align='center'>
  32246. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  32247. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  32248. * and <code>2.0</code>.
  32249. * </div>
  32250. */
  32251. scale: number;
  32252. /**
  32253. * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size
  32254. * of the desired font compared to the generated glyph size.
  32255. */
  32256. totalScale: number;
  32257. /**
  32258. * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.
  32259. */
  32260. distanceDisplayCondition: DistanceDisplayCondition;
  32261. /**
  32262. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  32263. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  32264. */
  32265. disableDepthTestDistance: number;
  32266. /**
  32267. * Gets or sets the user-defined value returned when the label is picked.
  32268. */
  32269. id: any;
  32270. /**
  32271. * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
  32272. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  32273. * left to right, and <code>y</code> increases from top to bottom.
  32274. * @example
  32275. * console.log(l.computeScreenSpacePosition(scene).toString());
  32276. * @param scene - The scene the label is in.
  32277. * @param [result] - The object onto which to store the result.
  32278. * @returns The screen-space position of the label.
  32279. */
  32280. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  32281. /**
  32282. * Determines if this label equals another label. Labels are equal if all their properties
  32283. * are equal. Labels in different collections can be equal.
  32284. * @param other - The label to compare for equality.
  32285. * @returns <code>true</code> if the labels are equal; otherwise, <code>false</code>.
  32286. */
  32287. equals(other: Label): boolean;
  32288. /**
  32289. * Returns true if this object was destroyed; otherwise, false.
  32290. * <br /><br />
  32291. * If this object was destroyed, it should not be used; calling any function other than
  32292. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32293. * @returns True if this object was destroyed; otherwise, false.
  32294. */
  32295. isDestroyed(): boolean;
  32296. /**
  32297. * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages
  32298. * @example
  32299. * // Example 1.
  32300. * // Set a label's rightToLeft before init
  32301. * Cesium.Label.enableRightToLeftDetection = true;
  32302. * var myLabelEntity = viewer.entities.add({
  32303. * label: {
  32304. * id: 'my label',
  32305. * text: 'זה טקסט בעברית \n ועכשיו יורדים שורה',
  32306. * }
  32307. * });
  32308. * @example
  32309. * // Example 2.
  32310. * var myLabelEntity = viewer.entities.add({
  32311. * label: {
  32312. * id: 'my label',
  32313. * text: 'English text'
  32314. * }
  32315. * });
  32316. * // Set a label's rightToLeft after init
  32317. * Cesium.Label.enableRightToLeftDetection = true;
  32318. * myLabelEntity.text = 'טקסט חדש';
  32319. */
  32320. static enableRightToLeftDetection: boolean;
  32321. }
  32322. /**
  32323. * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene.
  32324. * Each label can have a different font, color, scale, etc.
  32325. * <br /><br />
  32326. * <div align='center'>
  32327. * <img src='Images/Label.png' width='400' height='300' /><br />
  32328. * Example labels
  32329. * </div>
  32330. * <br /><br />
  32331. * Labels are added and removed from the collection using {@link LabelCollection#add}
  32332. * and {@link LabelCollection#remove}.
  32333. * @example
  32334. * // Create a label collection with two labels
  32335. * var labels = scene.primitives.add(new Cesium.LabelCollection());
  32336. * labels.add({
  32337. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  32338. * text : 'A label'
  32339. * });
  32340. * labels.add({
  32341. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  32342. * text : 'Another label'
  32343. * });
  32344. * @param [options] - Object with the following properties:
  32345. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates.
  32346. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  32347. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe.
  32348. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default
  32349. * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,
  32350. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  32351. * @param [options.show = true] - Determines if the labels in the collection will be shown.
  32352. */
  32353. export class LabelCollection {
  32354. constructor(options?: {
  32355. modelMatrix?: Matrix4;
  32356. debugShowBoundingVolume?: boolean;
  32357. scene?: Scene;
  32358. blendOption?: BlendOption;
  32359. show?: boolean;
  32360. });
  32361. /**
  32362. * Determines if labels in this collection will be shown.
  32363. */
  32364. show: boolean;
  32365. /**
  32366. * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.
  32367. * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  32368. * Local reference frames can be used by providing a different transformation matrix, like that returned
  32369. * by {@link Transforms.eastNorthUpToFixedFrame}.
  32370. * @example
  32371. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  32372. * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  32373. * labels.add({
  32374. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0),
  32375. * text : 'Center'
  32376. * });
  32377. * labels.add({
  32378. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),
  32379. * text : 'East'
  32380. * });
  32381. * labels.add({
  32382. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),
  32383. * text : 'North'
  32384. * });
  32385. * labels.add({
  32386. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),
  32387. * text : 'Up'
  32388. * });
  32389. */
  32390. modelMatrix: Matrix4;
  32391. /**
  32392. * This property is for debugging only; it is not for production use nor is it optimized.
  32393. * <p>
  32394. * Draws the bounding sphere for each draw command in the primitive.
  32395. * </p>
  32396. */
  32397. debugShowBoundingVolume: boolean;
  32398. /**
  32399. * The label blending option. The default is used for rendering both opaque and translucent labels.
  32400. * However, if either all of the labels are completely opaque or all are completely translucent,
  32401. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  32402. * performance by up to 2x.
  32403. */
  32404. blendOption: BlendOption;
  32405. /**
  32406. * Returns the number of labels in this collection. This is commonly used with
  32407. * {@link LabelCollection#get} to iterate over all the labels
  32408. * in the collection.
  32409. */
  32410. length: number;
  32411. /**
  32412. * Creates and adds a label with the specified initial properties to the collection.
  32413. * The added label is returned so it can be modified or removed from the collection later.
  32414. * @example
  32415. * // Example 1: Add a label, specifying all the default values.
  32416. * var l = labels.add({
  32417. * show : true,
  32418. * position : Cesium.Cartesian3.ZERO,
  32419. * text : '',
  32420. * font : '30px sans-serif',
  32421. * fillColor : Cesium.Color.WHITE,
  32422. * outlineColor : Cesium.Color.BLACK,
  32423. * outlineWidth : 1.0,
  32424. * showBackground : false,
  32425. * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),
  32426. * backgroundPadding : new Cesium.Cartesian2(7, 5),
  32427. * style : Cesium.LabelStyle.FILL,
  32428. * pixelOffset : Cesium.Cartesian2.ZERO,
  32429. * eyeOffset : Cesium.Cartesian3.ZERO,
  32430. * horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
  32431. * verticalOrigin : Cesium.VerticalOrigin.BASELINE,
  32432. * scale : 1.0,
  32433. * translucencyByDistance : undefined,
  32434. * pixelOffsetScaleByDistance : undefined,
  32435. * heightReference : HeightReference.NONE,
  32436. * distanceDisplayCondition : undefined
  32437. * });
  32438. * @example
  32439. * // Example 2: Specify only the label's cartographic position,
  32440. * // text, and font.
  32441. * var l = labels.add({
  32442. * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),
  32443. * text : 'Hello World',
  32444. * font : '24px Helvetica',
  32445. * });
  32446. * @param [options] - A template describing the label's properties as shown in Example 1.
  32447. * @returns The label that was added to the collection.
  32448. */
  32449. add(options?: any): Label;
  32450. /**
  32451. * Removes a label from the collection. Once removed, a label is no longer usable.
  32452. * @example
  32453. * var l = labels.add(...);
  32454. * labels.remove(l); // Returns true
  32455. * @param label - The label to remove.
  32456. * @returns <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.
  32457. */
  32458. remove(label: Label): boolean;
  32459. /**
  32460. * Removes all labels from the collection.
  32461. * @example
  32462. * labels.add(...);
  32463. * labels.add(...);
  32464. * labels.removeAll();
  32465. */
  32466. removeAll(): void;
  32467. /**
  32468. * Check whether this collection contains a given label.
  32469. * @param label - The label to check for.
  32470. * @returns true if this collection contains the label, false otherwise.
  32471. */
  32472. contains(label: Label): boolean;
  32473. /**
  32474. * Returns the label in the collection at the specified index. Indices are zero-based
  32475. * and increase as labels are added. Removing a label shifts all labels after
  32476. * it to the left, changing their indices. This function is commonly used with
  32477. * {@link LabelCollection#length} to iterate over all the labels
  32478. * in the collection.
  32479. * @example
  32480. * // Toggle the show property of every label in the collection
  32481. * var len = labels.length;
  32482. * for (var i = 0; i < len; ++i) {
  32483. * var l = billboards.get(i);
  32484. * l.show = !l.show;
  32485. * }
  32486. * @param index - The zero-based index of the billboard.
  32487. * @returns The label at the specified index.
  32488. */
  32489. get(index: number): Label;
  32490. /**
  32491. * Returns true if this object was destroyed; otherwise, false.
  32492. * <br /><br />
  32493. * If this object was destroyed, it should not be used; calling any function other than
  32494. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32495. * @returns True if this object was destroyed; otherwise, false.
  32496. */
  32497. isDestroyed(): boolean;
  32498. /**
  32499. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  32500. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  32501. * <br /><br />
  32502. * Once an object is destroyed, it should not be used; calling any function other than
  32503. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  32504. * assign the return value (<code>undefined</code>) to the object as done in the example.
  32505. * @example
  32506. * labels = labels && labels.destroy();
  32507. */
  32508. destroy(): void;
  32509. }
  32510. /**
  32511. * Describes how to draw a label.
  32512. */
  32513. export enum LabelStyle {
  32514. /**
  32515. * Fill the text of the label, but do not outline.
  32516. */
  32517. FILL = 0,
  32518. /**
  32519. * Outline the text of the label, but do not fill.
  32520. */
  32521. OUTLINE = 1,
  32522. /**
  32523. * Fill and outline the text of the label.
  32524. */
  32525. FILL_AND_OUTLINE = 2
  32526. }
  32527. /**
  32528. * A light source. This type describes an interface and is not intended to be instantiated directly. Together, <code>color</code> and <code>intensity</code> produce a high-dynamic-range light color. <code>intensity</code> can also be used individually to dim or brighten the light without changing the hue.
  32529. */
  32530. export class Light {
  32531. constructor();
  32532. /**
  32533. * The color of the light.
  32534. */
  32535. color: Color;
  32536. /**
  32537. * The intensity controls the strength of the light. <code>intensity</code> has a minimum value of 0.0 and no maximum value.
  32538. */
  32539. intensity: number;
  32540. }
  32541. /**
  32542. * Describes how the map will operate in 2D.
  32543. */
  32544. export enum MapMode2D {
  32545. /**
  32546. * The 2D map can be rotated about the z axis.
  32547. */
  32548. ROTATE = 0,
  32549. /**
  32550. * The 2D map can be scrolled infinitely in the horizontal direction.
  32551. */
  32552. INFINITE_SCROLL = 1
  32553. }
  32554. export namespace MapboxImageryProvider {
  32555. /**
  32556. * Initialization options for the MapboxImageryProvider constructor
  32557. * @property [url = 'https://api.mapbox.com/v4/'] - The Mapbox server url.
  32558. * @property mapId - The Mapbox Map ID.
  32559. * @property accessToken - The public access token for the imagery.
  32560. * @property [format = 'png'] - The format of the image request.
  32561. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  32562. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  32563. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  32564. * to result in rendering problems.
  32565. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  32566. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  32567. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  32568. */
  32569. type ConstructorOptions = {
  32570. url?: string;
  32571. mapId: string;
  32572. accessToken: string;
  32573. format?: string;
  32574. ellipsoid?: Ellipsoid;
  32575. minimumLevel?: number;
  32576. maximumLevel?: number;
  32577. rectangle?: Rectangle;
  32578. credit?: Credit | string;
  32579. };
  32580. }
  32581. /**
  32582. * Provides tiled imagery hosted by Mapbox.
  32583. * @example
  32584. * // Mapbox tile provider
  32585. * var mapbox = new Cesium.MapboxImageryProvider({
  32586. * mapId: 'mapbox.streets',
  32587. * accessToken: 'thisIsMyAccessToken'
  32588. * });
  32589. * @param options - Object describing initialization options
  32590. */
  32591. export class MapboxImageryProvider {
  32592. constructor(options: MapboxImageryProvider.ConstructorOptions);
  32593. /**
  32594. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32595. * 1.0 representing fully opaque.
  32596. */
  32597. defaultAlpha: number | undefined;
  32598. /**
  32599. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32600. * 1.0 representing fully opaque.
  32601. */
  32602. defaultNightAlpha: number | undefined;
  32603. /**
  32604. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32605. * 1.0 representing fully opaque.
  32606. */
  32607. defaultDayAlpha: number | undefined;
  32608. /**
  32609. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32610. * makes the imagery darker while greater than 1.0 makes it brighter.
  32611. */
  32612. defaultBrightness: number | undefined;
  32613. /**
  32614. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32615. * the contrast while greater than 1.0 increases it.
  32616. */
  32617. defaultContrast: number | undefined;
  32618. /**
  32619. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32620. */
  32621. defaultHue: number | undefined;
  32622. /**
  32623. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32624. * saturation while greater than 1.0 increases it.
  32625. */
  32626. defaultSaturation: number | undefined;
  32627. /**
  32628. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32629. */
  32630. defaultGamma: number | undefined;
  32631. /**
  32632. * The default texture minification filter to apply to this provider.
  32633. */
  32634. defaultMinificationFilter: TextureMinificationFilter;
  32635. /**
  32636. * The default texture magnification filter to apply to this provider.
  32637. */
  32638. defaultMagnificationFilter: TextureMagnificationFilter;
  32639. /**
  32640. * Gets the URL of the Mapbox server.
  32641. */
  32642. readonly url: string;
  32643. /**
  32644. * Gets a value indicating whether or not the provider is ready for use.
  32645. */
  32646. readonly ready: boolean;
  32647. /**
  32648. * Gets a promise that resolves to true when the provider is ready for use.
  32649. */
  32650. readonly readyPromise: Promise<boolean>;
  32651. /**
  32652. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32653. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32654. */
  32655. readonly rectangle: Rectangle;
  32656. /**
  32657. * Gets the width of each tile, in pixels. This function should
  32658. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32659. */
  32660. readonly tileWidth: number;
  32661. /**
  32662. * Gets the height of each tile, in pixels. This function should
  32663. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32664. */
  32665. readonly tileHeight: number;
  32666. /**
  32667. * Gets the maximum level-of-detail that can be requested. This function should
  32668. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32669. */
  32670. readonly maximumLevel: number | undefined;
  32671. /**
  32672. * Gets the minimum level-of-detail that can be requested. This function should
  32673. * not be called before {@link MapboxImageryProvider#ready} returns true. Generally,
  32674. * a minimum level should only be used when the rectangle of the imagery is small
  32675. * enough that the number of tiles at the minimum level is small. An imagery
  32676. * provider with more than a few tiles at the minimum level will lead to
  32677. * rendering problems.
  32678. */
  32679. readonly minimumLevel: number;
  32680. /**
  32681. * Gets the tiling scheme used by the provider. This function should
  32682. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32683. */
  32684. readonly tilingScheme: TilingScheme;
  32685. /**
  32686. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32687. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32688. * returns undefined, no tiles are filtered. This function should
  32689. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32690. */
  32691. readonly tileDiscardPolicy: TileDiscardPolicy;
  32692. /**
  32693. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32694. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32695. * are passed an instance of {@link TileProviderError}.
  32696. */
  32697. readonly errorEvent: Event;
  32698. /**
  32699. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32700. * the source of the imagery. This function should
  32701. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32702. */
  32703. readonly credit: Credit;
  32704. /**
  32705. * Gets the proxy used by this provider.
  32706. */
  32707. readonly proxy: Proxy;
  32708. /**
  32709. * Gets a value indicating whether or not the images provided by this imagery provider
  32710. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32711. * be ignored. If this property is true, any images without an alpha channel will be treated
  32712. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32713. * and texture upload time are reduced.
  32714. */
  32715. readonly hasAlphaChannel: boolean;
  32716. /**
  32717. * Gets the credits to be displayed when a given tile is displayed.
  32718. * @param x - The tile X coordinate.
  32719. * @param y - The tile Y coordinate.
  32720. * @param level - The tile level;
  32721. * @returns The credits to be displayed when the tile is displayed.
  32722. */
  32723. getTileCredits(x: number, y: number, level: number): Credit[];
  32724. /**
  32725. * Requests the image for a given tile. This function should
  32726. * not be called before {@link MapboxImageryProvider#ready} returns true.
  32727. * @param x - The tile X coordinate.
  32728. * @param y - The tile Y coordinate.
  32729. * @param level - The tile level.
  32730. * @param [request] - The request object. Intended for internal use only.
  32731. * @returns A promise for the image that will resolve when the image is available, or
  32732. * undefined if there are too many active requests to the server, and the request
  32733. * should be retried later. The resolved image may be either an
  32734. * Image or a Canvas DOM object.
  32735. */
  32736. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  32737. /**
  32738. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32739. * a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true.
  32740. * This function is optional, so it may not exist on all ImageryProviders.
  32741. * @param x - The tile X coordinate.
  32742. * @param y - The tile Y coordinate.
  32743. * @param level - The tile level.
  32744. * @param longitude - The longitude at which to pick features.
  32745. * @param latitude - The latitude at which to pick features.
  32746. * @returns A promise for the picked features that will resolve when the asynchronous
  32747. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32748. * instances. The array may be empty if no features are found at the given location.
  32749. * It may also be undefined if picking is not supported.
  32750. */
  32751. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32752. }
  32753. export namespace MapboxStyleImageryProvider {
  32754. /**
  32755. * Initialization options for the MapboxStyleImageryProvider constructor
  32756. * @property [url = 'https://api.mapbox.com/styles/v1/'] - The Mapbox server url.
  32757. * @property [username = 'mapbox'] - The username of the map account.
  32758. * @property styleId - The Mapbox Style ID.
  32759. * @property accessToken - The public access token for the imagery.
  32760. * @property [tilesize = 512] - The size of the image tiles.
  32761. * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor.
  32762. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  32763. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  32764. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  32765. * to result in rendering problems.
  32766. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  32767. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  32768. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  32769. */
  32770. type ConstructorOptions = {
  32771. url?: Resource | string;
  32772. username?: string;
  32773. styleId: string;
  32774. accessToken: string;
  32775. tilesize?: number;
  32776. scaleFactor?: boolean;
  32777. ellipsoid?: Ellipsoid;
  32778. minimumLevel?: number;
  32779. maximumLevel?: number;
  32780. rectangle?: Rectangle;
  32781. credit?: Credit | string;
  32782. };
  32783. }
  32784. /**
  32785. * Provides tiled imagery hosted by Mapbox.
  32786. * @example
  32787. * // Mapbox style provider
  32788. * var mapbox = new Cesium.MapboxStyleImageryProvider({
  32789. * styleId: 'streets-v11',
  32790. * accessToken: 'thisIsMyAccessToken'
  32791. * });
  32792. * @param options - Object describing initialization options
  32793. */
  32794. export class MapboxStyleImageryProvider {
  32795. constructor(options: MapboxStyleImageryProvider.ConstructorOptions);
  32796. /**
  32797. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32798. * 1.0 representing fully opaque.
  32799. */
  32800. defaultAlpha: number | undefined;
  32801. /**
  32802. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32803. * 1.0 representing fully opaque.
  32804. */
  32805. defaultNightAlpha: number | undefined;
  32806. /**
  32807. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32808. * 1.0 representing fully opaque.
  32809. */
  32810. defaultDayAlpha: number | undefined;
  32811. /**
  32812. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32813. * makes the imagery darker while greater than 1.0 makes it brighter.
  32814. */
  32815. defaultBrightness: number | undefined;
  32816. /**
  32817. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32818. * the contrast while greater than 1.0 increases it.
  32819. */
  32820. defaultContrast: number | undefined;
  32821. /**
  32822. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32823. */
  32824. defaultHue: number | undefined;
  32825. /**
  32826. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32827. * saturation while greater than 1.0 increases it.
  32828. */
  32829. defaultSaturation: number | undefined;
  32830. /**
  32831. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32832. */
  32833. defaultGamma: number | undefined;
  32834. /**
  32835. * The default texture minification filter to apply to this provider.
  32836. */
  32837. defaultMinificationFilter: TextureMinificationFilter;
  32838. /**
  32839. * The default texture magnification filter to apply to this provider.
  32840. */
  32841. defaultMagnificationFilter: TextureMagnificationFilter;
  32842. /**
  32843. * Gets the URL of the Mapbox server.
  32844. */
  32845. readonly url: string;
  32846. /**
  32847. * Gets a value indicating whether or not the provider is ready for use.
  32848. */
  32849. readonly ready: boolean;
  32850. /**
  32851. * Gets a promise that resolves to true when the provider is ready for use.
  32852. */
  32853. readonly readyPromise: Promise<boolean>;
  32854. /**
  32855. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32856. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32857. */
  32858. readonly rectangle: Rectangle;
  32859. /**
  32860. * Gets the width of each tile, in pixels. This function should
  32861. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32862. */
  32863. readonly tileWidth: number;
  32864. /**
  32865. * Gets the height of each tile, in pixels. This function should
  32866. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32867. */
  32868. readonly tileHeight: number;
  32869. /**
  32870. * Gets the maximum level-of-detail that can be requested. This function should
  32871. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32872. */
  32873. readonly maximumLevel: number | undefined;
  32874. /**
  32875. * Gets the minimum level-of-detail that can be requested. This function should
  32876. * not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally,
  32877. * a minimum level should only be used when the rectangle of the imagery is small
  32878. * enough that the number of tiles at the minimum level is small. An imagery
  32879. * provider with more than a few tiles at the minimum level will lead to
  32880. * rendering problems.
  32881. */
  32882. readonly minimumLevel: number;
  32883. /**
  32884. * Gets the tiling scheme used by the provider. This function should
  32885. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32886. */
  32887. readonly tilingScheme: TilingScheme;
  32888. /**
  32889. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32890. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32891. * returns undefined, no tiles are filtered. This function should
  32892. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32893. */
  32894. readonly tileDiscardPolicy: TileDiscardPolicy;
  32895. /**
  32896. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32897. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32898. * are passed an instance of {@link TileProviderError}.
  32899. */
  32900. readonly errorEvent: Event;
  32901. /**
  32902. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32903. * the source of the imagery. This function should
  32904. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32905. */
  32906. readonly credit: Credit;
  32907. /**
  32908. * Gets the proxy used by this provider.
  32909. */
  32910. readonly proxy: Proxy;
  32911. /**
  32912. * Gets a value indicating whether or not the images provided by this imagery provider
  32913. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32914. * be ignored. If this property is true, any images without an alpha channel will be treated
  32915. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32916. * and texture upload time are reduced.
  32917. */
  32918. readonly hasAlphaChannel: boolean;
  32919. /**
  32920. * Gets the credits to be displayed when a given tile is displayed.
  32921. * @param x - The tile X coordinate.
  32922. * @param y - The tile Y coordinate.
  32923. * @param level - The tile level;
  32924. * @returns The credits to be displayed when the tile is displayed.
  32925. */
  32926. getTileCredits(x: number, y: number, level: number): Credit[];
  32927. /**
  32928. * Requests the image for a given tile. This function should
  32929. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32930. * @param x - The tile X coordinate.
  32931. * @param y - The tile Y coordinate.
  32932. * @param level - The tile level.
  32933. * @param [request] - The request object. Intended for internal use only.
  32934. * @returns A promise for the image that will resolve when the image is available, or
  32935. * undefined if there are too many active requests to the server, and the request
  32936. * should be retried later. The resolved image may be either an
  32937. * Image or a Canvas DOM object.
  32938. */
  32939. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  32940. /**
  32941. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32942. * a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  32943. * This function is optional, so it may not exist on all ImageryProviders.
  32944. * @param x - The tile X coordinate.
  32945. * @param y - The tile Y coordinate.
  32946. * @param level - The tile level.
  32947. * @param longitude - The longitude at which to pick features.
  32948. * @param latitude - The latitude at which to pick features.
  32949. * @returns A promise for the picked features that will resolve when the asynchronous
  32950. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32951. * instances. The array may be empty if no features are found at the given location.
  32952. * It may also be undefined if picking is not supported.
  32953. */
  32954. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32955. }
  32956. /**
  32957. * A Material defines surface appearance through a combination of diffuse, specular,
  32958. * normal, emission, and alpha components. These values are specified using a
  32959. * JSON schema called Fabric which gets parsed and assembled into glsl shader code
  32960. * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page}
  32961. * for more details on Fabric.
  32962. * <br /><br />
  32963. * <style type="text/css">
  32964. * #materialDescriptions code {
  32965. * font-weight: normal;
  32966. * font-family: Consolas, 'Lucida Console', Monaco, monospace;
  32967. * color: #A35A00;
  32968. * }
  32969. * #materialDescriptions ul, #materialDescriptions ul ul {
  32970. * list-style-type: none;
  32971. * }
  32972. * #materialDescriptions ul ul {
  32973. * margin-bottom: 10px;
  32974. * }
  32975. * #materialDescriptions ul ul li {
  32976. * font-weight: normal;
  32977. * color: #000000;
  32978. * text-indent: -2em;
  32979. * margin-left: 2em;
  32980. * }
  32981. * #materialDescriptions ul li {
  32982. * font-weight: bold;
  32983. * color: #0053CF;
  32984. * }
  32985. * </style>
  32986. *
  32987. * Base material types and their uniforms:
  32988. * <div id='materialDescriptions'>
  32989. * <ul>
  32990. * <li>Color</li>
  32991. * <ul>
  32992. * <li><code>color</code>: rgba color object.</li>
  32993. * </ul>
  32994. * <li>Image</li>
  32995. * <ul>
  32996. * <li><code>image</code>: path to image.</li>
  32997. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  32998. * </ul>
  32999. * <li>DiffuseMap</li>
  33000. * <ul>
  33001. * <li><code>image</code>: path to image.</li>
  33002. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>
  33003. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33004. * </ul>
  33005. * <li>AlphaMap</li>
  33006. * <ul>
  33007. * <li><code>image</code>: path to image.</li>
  33008. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33009. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33010. * </ul>
  33011. * <li>SpecularMap</li>
  33012. * <ul>
  33013. * <li><code>image</code>: path to image.</li>
  33014. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33015. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33016. * </ul>
  33017. * <li>EmissionMap</li>
  33018. * <ul>
  33019. * <li><code>image</code>: path to image.</li>
  33020. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  33021. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33022. * </ul>
  33023. * <li>BumpMap</li>
  33024. * <ul>
  33025. * <li><code>image</code>: path to image.</li>
  33026. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33027. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33028. * <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li>
  33029. * </ul>
  33030. * <li>NormalMap</li>
  33031. * <ul>
  33032. * <li><code>image</code>: path to image.</li>
  33033. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  33034. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33035. * <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li>
  33036. * </ul>
  33037. * <li>Grid</li>
  33038. * <ul>
  33039. * <li><code>color</code>: rgba color object for the whole material.</li>
  33040. * <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li>
  33041. * <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  33042. * <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>
  33043. * <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>
  33044. * </ul>
  33045. * <li>Stripe</li>
  33046. * <ul>
  33047. * <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li>
  33048. * <li><code>evenColor</code>: rgba color object for the stripe's first color.</li>
  33049. * <li><code>oddColor</code>: rgba color object for the stripe's second color.</li>
  33050. * <li><code>offset</code>: Number that controls at which point into the pattern to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning of the odd color, 2.0 being the even color again, and any multiple or fractional values being in between.</li>
  33051. * <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li>
  33052. * </ul>
  33053. * <li>Checkerboard</li>
  33054. * <ul>
  33055. * <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li>
  33056. * <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>
  33057. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  33058. * </ul>
  33059. * <li>Dot</li>
  33060. * <ul>
  33061. * <li><code>lightColor</code>: rgba color object for the dot color.</li>
  33062. * <li><code>darkColor</code>: rgba color object for the background color.</li>
  33063. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li>
  33064. * </ul>
  33065. * <li>Water</li>
  33066. * <ul>
  33067. * <li><code>baseWaterColor</code>: rgba color object base color of the water.</li>
  33068. * <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li>
  33069. * <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li>
  33070. * <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  33071. * <li><code>frequency</code>: Number that controls the number of waves.</li>
  33072. * <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li>
  33073. * <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li>
  33074. * <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li>
  33075. * </ul>
  33076. * <li>RimLighting</li>
  33077. * <ul>
  33078. * <li><code>color</code>: diffuse color and alpha.</li>
  33079. * <li><code>rimColor</code>: diffuse color and alpha of the rim.</li>
  33080. * <li><code>width</code>: Number that determines the rim's width.</li>
  33081. * </ul>
  33082. * <li>Fade</li>
  33083. * <ul>
  33084. * <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>
  33085. * <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>
  33086. * <li><code>maximumDistance</code>: Number between 0.0 and 1.0 where the <code>fadeInColor</code> becomes the <code>fadeOutColor</code>. A value of 0.0 gives the entire material a color of <code>fadeOutColor</code> and a value of 1.0 gives the the entire material a color of <code>fadeInColor</code></li>
  33087. * <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>
  33088. * <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>
  33089. * <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>
  33090. * </ul>
  33091. * <li>PolylineArrow</li>
  33092. * <ul>
  33093. * <li><code>color</code>: diffuse color and alpha.</li>
  33094. * </ul>
  33095. * <li>PolylineDash</li>
  33096. * <ul>
  33097. * <li><code>color</code>: color for the line.</li>
  33098. * <li><code>gapColor</code>: color for the gaps in the line.</li>
  33099. * <li><code>dashLength</code>: Dash length in pixels.</li>
  33100. * <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>
  33101. * </ul>
  33102. * <li>PolylineGlow</li>
  33103. * <ul>
  33104. * <li><code>color</code>: color and maximum alpha for the glow on the line.</li>
  33105. * <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>
  33106. * <li><code>taperPower</code>: strength of the tapering effect, as a percentage of the total line length. If 1.0 or higher, no taper effect is used.</li>
  33107. * </ul>
  33108. * <li>PolylineOutline</li>
  33109. * <ul>
  33110. * <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>
  33111. * <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>
  33112. * <li><code>outlineWidth</code>: width of the outline in pixels.</li>
  33113. * </ul>
  33114. * <li>ElevationContour</li>
  33115. * <ul>
  33116. * <li><code>color</code>: color and alpha for the contour line.</li>
  33117. * <li><code>spacing</code>: spacing for contour lines in meters.</li>
  33118. * <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>
  33119. * </ul>
  33120. * <li>ElevationRamp</li>
  33121. * <ul>
  33122. * <li><code>image</code>: color ramp image to use for coloring the terrain.</li>
  33123. * <li><code>minimumHeight</code>: minimum height for the ramp.</li>
  33124. * <li><code>maximumHeight</code>: maximum height for the ramp.</li>
  33125. * </ul>
  33126. * <li>SlopeRamp</li>
  33127. * <ul>
  33128. * <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>
  33129. * </ul>
  33130. * <li>AspectRamp</li>
  33131. * <ul>
  33132. * <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>
  33133. * </ul>
  33134. * <li>ElevationBand</li>
  33135. * <ul>
  33136. * <li><code>heights</code>: image of heights sorted from lowest to highest.</li>
  33137. * <li><code>colors</code>: image of colors at the corresponding heights.</li>
  33138. * </ul>
  33139. * </ul>
  33140. * </ul>
  33141. * </div>
  33142. * @example
  33143. * // Create a color material with fromType:
  33144. * polygon.material = Cesium.Material.fromType('Color');
  33145. * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  33146. *
  33147. * // Create the default material:
  33148. * polygon.material = new Cesium.Material();
  33149. *
  33150. * // Create a color material with full Fabric notation:
  33151. * polygon.material = new Cesium.Material({
  33152. * fabric : {
  33153. * type : 'Color',
  33154. * uniforms : {
  33155. * color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
  33156. * }
  33157. * }
  33158. * });
  33159. * @param [options] - Object with the following properties:
  33160. * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials.
  33161. * @param [options.translucent = true] - When <code>true</code> or a function that returns <code>true</code>, the geometry
  33162. * with this material is expected to appear translucent.
  33163. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures.
  33164. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures.
  33165. * @param options.fabric - The fabric JSON used to generate the material.
  33166. */
  33167. export class Material {
  33168. constructor(options?: {
  33169. strict?: boolean;
  33170. translucent?: boolean | ((...params: any[]) => any);
  33171. minificationFilter?: TextureMinificationFilter;
  33172. magnificationFilter?: TextureMagnificationFilter;
  33173. fabric: any;
  33174. });
  33175. /**
  33176. * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
  33177. */
  33178. type: string;
  33179. /**
  33180. * The glsl shader source for this material.
  33181. */
  33182. shaderSource: string;
  33183. /**
  33184. * Maps sub-material names to Material objects.
  33185. */
  33186. materials: any;
  33187. /**
  33188. * Maps uniform names to their values.
  33189. */
  33190. uniforms: any;
  33191. /**
  33192. * When <code>true</code> or a function that returns <code>true</code>,
  33193. * the geometry is expected to appear translucent.
  33194. */
  33195. translucent: boolean | ((...params: any[]) => any);
  33196. /**
  33197. * Creates a new material using an existing material type.
  33198. * <br /><br />
  33199. * Shorthand for: new Material({fabric : {type : type}});
  33200. * @example
  33201. * var material = Cesium.Material.fromType('Color', {
  33202. * color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)
  33203. * });
  33204. * @param type - The base material type.
  33205. * @param [uniforms] - Overrides for the default uniforms.
  33206. * @returns New material object.
  33207. */
  33208. static fromType(type: string, uniforms?: any): Material;
  33209. /**
  33210. * Gets whether or not this material is translucent.
  33211. * @returns <code>true</code> if this material is translucent, <code>false</code> otherwise.
  33212. */
  33213. isTranslucent(): boolean;
  33214. /**
  33215. * Returns true if this object was destroyed; otherwise, false.
  33216. * <br /><br />
  33217. * If this object was destroyed, it should not be used; calling any function other than
  33218. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33219. * @returns True if this object was destroyed; otherwise, false.
  33220. */
  33221. isDestroyed(): boolean;
  33222. /**
  33223. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33224. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33225. * <br /><br />
  33226. * Once an object is destroyed, it should not be used; calling any function other than
  33227. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33228. * assign the return value (<code>undefined</code>) to the object as done in the example.
  33229. * @example
  33230. * material = material && material.destroy();
  33231. */
  33232. destroy(): void;
  33233. /**
  33234. * Gets or sets the default texture uniform value.
  33235. */
  33236. static DefaultImageId: string;
  33237. /**
  33238. * Gets or sets the default cube map texture uniform value.
  33239. */
  33240. static DefaultCubeMapId: string;
  33241. /**
  33242. * Gets the name of the color material.
  33243. */
  33244. static readonly ColorType: string;
  33245. /**
  33246. * Gets the name of the image material.
  33247. */
  33248. static readonly ImageType: string;
  33249. /**
  33250. * Gets the name of the diffuce map material.
  33251. */
  33252. static readonly DiffuseMapType: string;
  33253. /**
  33254. * Gets the name of the alpha map material.
  33255. */
  33256. static readonly AlphaMapType: string;
  33257. /**
  33258. * Gets the name of the specular map material.
  33259. */
  33260. static readonly SpecularMapType: string;
  33261. /**
  33262. * Gets the name of the emmision map material.
  33263. */
  33264. static readonly EmissionMapType: string;
  33265. /**
  33266. * Gets the name of the bump map material.
  33267. */
  33268. static readonly BumpMapType: string;
  33269. /**
  33270. * Gets the name of the normal map material.
  33271. */
  33272. static readonly NormalMapType: string;
  33273. /**
  33274. * Gets the name of the grid material.
  33275. */
  33276. static readonly GridType: string;
  33277. /**
  33278. * Gets the name of the stripe material.
  33279. */
  33280. static readonly StripeType: string;
  33281. /**
  33282. * Gets the name of the checkerboard material.
  33283. */
  33284. static readonly CheckerboardType: string;
  33285. /**
  33286. * Gets the name of the dot material.
  33287. */
  33288. static readonly DotType: string;
  33289. /**
  33290. * Gets the name of the water material.
  33291. */
  33292. static readonly WaterType: string;
  33293. /**
  33294. * Gets the name of the rim lighting material.
  33295. */
  33296. static readonly RimLightingType: string;
  33297. /**
  33298. * Gets the name of the fade material.
  33299. */
  33300. static readonly FadeType: string;
  33301. /**
  33302. * Gets the name of the polyline arrow material.
  33303. */
  33304. static readonly PolylineArrowType: string;
  33305. /**
  33306. * Gets the name of the polyline glow material.
  33307. */
  33308. static readonly PolylineDashType: string;
  33309. /**
  33310. * Gets the name of the polyline glow material.
  33311. */
  33312. static readonly PolylineGlowType: string;
  33313. /**
  33314. * Gets the name of the polyline outline material.
  33315. */
  33316. static readonly PolylineOutlineType: string;
  33317. /**
  33318. * Gets the name of the elevation contour material.
  33319. */
  33320. static readonly ElevationContourType: string;
  33321. /**
  33322. * Gets the name of the elevation contour material.
  33323. */
  33324. static readonly ElevationRampType: string;
  33325. /**
  33326. * Gets the name of the slope ramp material.
  33327. */
  33328. static readonly SlopeRampMaterialType: string;
  33329. /**
  33330. * Gets the name of the aspect ramp material.
  33331. */
  33332. static readonly AspectRampMaterialType: string;
  33333. /**
  33334. * Gets the name of the elevation band material.
  33335. */
  33336. static readonly ElevationBandType: string;
  33337. }
  33338. /**
  33339. * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)
  33340. * that supports shading with materials.
  33341. * @example
  33342. * var primitive = new Cesium.Primitive({
  33343. * geometryInstances : new Cesium.GeometryInstance({
  33344. * geometry : new Cesium.WallGeometry({
  33345. * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,
  33346. * // ...
  33347. * })
  33348. * }),
  33349. * appearance : new Cesium.MaterialAppearance({
  33350. * material : Cesium.Material.fromType('Color'),
  33351. * faceForward : true
  33352. * })
  33353. *
  33354. * });
  33355. * @param [options] - Object with the following properties:
  33356. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  33357. * @param [options.faceForward = !options.closed] - When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.
  33358. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.
  33359. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.
  33360. * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported.
  33361. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  33362. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  33363. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  33364. * @param [options.renderState] - Optional render state to override the default render state.
  33365. */
  33366. export class MaterialAppearance {
  33367. constructor(options?: {
  33368. flat?: boolean;
  33369. faceForward?: boolean;
  33370. translucent?: boolean;
  33371. closed?: boolean;
  33372. materialSupport?: MaterialAppearance.MaterialSupportType;
  33373. material?: Material;
  33374. vertexShaderSource?: string;
  33375. fragmentShaderSource?: string;
  33376. renderState?: any;
  33377. });
  33378. /**
  33379. * The material used to determine the fragment color. Unlike other {@link MaterialAppearance}
  33380. * properties, this is not read-only, so an appearance's material can change on the fly.
  33381. */
  33382. material: Material;
  33383. /**
  33384. * When <code>true</code>, the geometry is expected to appear translucent.
  33385. */
  33386. translucent: boolean;
  33387. /**
  33388. * The GLSL source code for the vertex shader.
  33389. */
  33390. readonly vertexShaderSource: string;
  33391. /**
  33392. * The GLSL source code for the fragment shader. The full fragment shader
  33393. * source is built procedurally taking into account {@link MaterialAppearance#material},
  33394. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  33395. * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.
  33396. */
  33397. readonly fragmentShaderSource: string;
  33398. /**
  33399. * The WebGL fixed-function state to use when rendering the geometry.
  33400. * <p>
  33401. * The render state can be explicitly defined when constructing a {@link MaterialAppearance}
  33402. * instance, or it is set implicitly via {@link MaterialAppearance#translucent}
  33403. * and {@link MaterialAppearance#closed}.
  33404. * </p>
  33405. */
  33406. readonly renderState: any;
  33407. /**
  33408. * When <code>true</code>, the geometry is expected to be closed so
  33409. * {@link MaterialAppearance#renderState} has backface culling enabled.
  33410. * If the viewer enters the geometry, it will not be visible.
  33411. */
  33412. readonly closed: boolean;
  33413. /**
  33414. * The type of materials supported by this instance. This impacts the required
  33415. * {@link VertexFormat} and the complexity of the vertex and fragment shaders.
  33416. */
  33417. readonly materialSupport: MaterialAppearance.MaterialSupportType;
  33418. /**
  33419. * The {@link VertexFormat} that this appearance instance is compatible with.
  33420. * A geometry can have more vertex attributes and still be compatible - at a
  33421. * potential performance cost - but it can't have less.
  33422. */
  33423. readonly vertexFormat: VertexFormat;
  33424. /**
  33425. * When <code>true</code>, flat shading is used in the fragment shader,
  33426. * which means lighting is not taking into account.
  33427. */
  33428. readonly flat: boolean;
  33429. /**
  33430. * When <code>true</code>, the fragment shader flips the surface normal
  33431. * as needed to ensure that the normal faces the viewer to avoid
  33432. * dark spots. This is useful when both sides of a geometry should be
  33433. * shaded like {@link WallGeometry}.
  33434. */
  33435. readonly faceForward: boolean;
  33436. /**
  33437. * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance},
  33438. * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},
  33439. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  33440. * @returns The full GLSL fragment shader source.
  33441. */
  33442. getFragmentShaderSource(): string;
  33443. /**
  33444. * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.
  33445. * @returns <code>true</code> if the appearance is translucent.
  33446. */
  33447. isTranslucent(): boolean;
  33448. /**
  33449. * Creates a render state. This is not the final render state instance; instead,
  33450. * it can contain a subset of render state properties identical to the render state
  33451. * created in the context.
  33452. * @returns The render state.
  33453. */
  33454. getRenderState(): any;
  33455. }
  33456. export namespace MaterialAppearance {
  33457. type MaterialSupportType = {
  33458. vertexFormat: VertexFormat;
  33459. vertexShaderSource: string;
  33460. fragmentShaderSource: string;
  33461. };
  33462. /**
  33463. * Determines the type of {@link Material} that is supported by a
  33464. * {@link MaterialAppearance} instance. This is a trade-off between
  33465. * flexibility (a wide array of materials) and memory/performance
  33466. * (required vertex format and GLSL shader complexity.
  33467. */
  33468. namespace MaterialSupport {
  33469. /**
  33470. * Only basic materials, which require just <code>position</code> and
  33471. * <code>normal</code> vertex attributes, are supported.
  33472. */
  33473. const BASIC: MaterialAppearance.MaterialSupportType;
  33474. /**
  33475. * Materials with textures, which require <code>position</code>,
  33476. * <code>normal</code>, and <code>st</code> vertex attributes,
  33477. * are supported. The vast majority of materials fall into this category.
  33478. */
  33479. const TEXTURED: MaterialAppearance.MaterialSupportType;
  33480. /**
  33481. * All materials, including those that work in tangent space, are supported.
  33482. * This requires <code>position</code>, <code>normal</code>, <code>st</code>,
  33483. * <code>tangent</code>, and <code>bitangent</code> vertex attributes.
  33484. */
  33485. const ALL: MaterialAppearance.MaterialSupportType;
  33486. }
  33487. }
  33488. /**
  33489. * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  33490. * <p>
  33491. * Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
  33492. * In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable
  33493. * with {@link Model#getNode}. glTF cameras and lights are not currently supported.
  33494. * </p>
  33495. * <p>
  33496. * An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be
  33497. * created at runtime and passed to this constructor function. In either case, the
  33498. * {@link Model#readyPromise} is resolved when the model is ready to render, i.e.,
  33499. * when the external binary, image, and shader files are downloaded and the WebGL
  33500. * resources are created.
  33501. * </p>
  33502. * <p>
  33503. * Cesium supports glTF assets with the following extensions:
  33504. * <ul>
  33505. * <li>
  33506. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  33507. * </li><li>
  33508. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  33509. * </li><li>
  33510. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  33511. * </li><li>
  33512. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  33513. * </li><li>
  33514. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  33515. * </li><li>
  33516. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  33517. * </li><li>
  33518. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  33519. * </li><li>
  33520. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  33521. * </li><li>
  33522. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  33523. * </li><li>
  33524. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  33525. * </li><li>
  33526. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu|KHR_texture_basisu}
  33527. * </li>
  33528. * </ul>
  33529. * </p>
  33530. * <p>
  33531. * Note: for models with compressed textures using the KHR_texture_basisu extension, we recommend power of 2 textures in both dimensions
  33532. * for maximum compatibility. This is because some samplers require power of 2 textures ({@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL|Using textures in WebGL})
  33533. * and KHR_texture_basisu requires multiple of 4 dimensions ({@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu/README.md#additional-requirements|KHR_texture_basisu additional requirements}).
  33534. * </p>
  33535. * <p>
  33536. * For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the
  33537. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  33538. * relative to a local origin.
  33539. * </p>
  33540. * @param [options] - Object with the following properties:
  33541. * @param [options.gltf] - A glTF JSON object, or a binary glTF buffer.
  33542. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
  33543. * @param [options.show = true] - Determines if the model primitive will be shown.
  33544. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  33545. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  33546. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  33547. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  33548. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  33549. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  33550. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  33551. * @param [options.asynchronous = true] - Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
  33552. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  33553. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  33554. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  33555. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  33556. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  33557. * @param [options.scene] - Must be passed in for models that use the height reference property.
  33558. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  33559. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  33560. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  33561. * @param [options.colorBlendAmount = 0.5] - Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
  33562. * @param [options.silhouetteColor = Color.RED] - The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.
  33563. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  33564. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  33565. * @param [options.dequantizeInShader = true] - Determines if a {@link https://github.com/google/draco|Draco} encoded model is dequantized on the GPU. This decreases total memory usage for encoded models.
  33566. * @param [options.imageBasedLightingFactor = Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.
  33567. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  33568. * @param [options.luminanceAtZenith = 0.2] - The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  33569. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  33570. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  33571. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  33572. * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if {@link Model#color} is translucent or {@link Model#silhouetteSize} is greater than 0.0.
  33573. * @param [options.showOutline = true] - Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
  33574. */
  33575. export class Model {
  33576. constructor(options?: {
  33577. gltf?: any | ArrayBuffer | Uint8Array;
  33578. basePath?: Resource | string;
  33579. show?: boolean;
  33580. modelMatrix?: Matrix4;
  33581. scale?: number;
  33582. minimumPixelSize?: number;
  33583. maximumScale?: number;
  33584. id?: any;
  33585. allowPicking?: boolean;
  33586. incrementallyLoadTextures?: boolean;
  33587. asynchronous?: boolean;
  33588. clampAnimations?: boolean;
  33589. shadows?: ShadowMode;
  33590. debugShowBoundingVolume?: boolean;
  33591. debugWireframe?: boolean;
  33592. heightReference?: HeightReference;
  33593. scene?: Scene;
  33594. distanceDisplayCondition?: DistanceDisplayCondition;
  33595. color?: Color;
  33596. colorBlendMode?: ColorBlendMode;
  33597. colorBlendAmount?: number;
  33598. silhouetteColor?: Color;
  33599. silhouetteSize?: number;
  33600. clippingPlanes?: ClippingPlaneCollection;
  33601. dequantizeInShader?: boolean;
  33602. imageBasedLightingFactor?: Cartesian2;
  33603. lightColor?: Cartesian3;
  33604. luminanceAtZenith?: number;
  33605. sphericalHarmonicCoefficients?: Cartesian3[];
  33606. specularEnvironmentMaps?: string;
  33607. credit?: Credit | string;
  33608. backFaceCulling?: boolean;
  33609. showOutline?: boolean;
  33610. });
  33611. /**
  33612. * Determines if the model primitive will be shown.
  33613. */
  33614. show: boolean;
  33615. /**
  33616. * The silhouette color.
  33617. */
  33618. silhouetteColor: Color;
  33619. /**
  33620. * The size of the silhouette in pixels.
  33621. */
  33622. silhouetteSize: number;
  33623. /**
  33624. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  33625. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  33626. * Local reference frames can be used by providing a different transformation matrix, like that returned
  33627. * by {@link Transforms.eastNorthUpToFixedFrame}.
  33628. * @example
  33629. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  33630. * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  33631. */
  33632. modelMatrix: Matrix4;
  33633. /**
  33634. * A uniform scale applied to this model before the {@link Model#modelMatrix}.
  33635. * Values greater than <code>1.0</code> increase the size of the model; values
  33636. * less than <code>1.0</code> decrease.
  33637. */
  33638. scale: number;
  33639. /**
  33640. * The approximate minimum pixel size of the model regardless of zoom.
  33641. * This can be used to ensure that a model is visible even when the viewer
  33642. * zooms out. When <code>0.0</code>, no minimum size is enforced.
  33643. */
  33644. minimumPixelSize: number;
  33645. /**
  33646. * The maximum scale size for a model. This can be used to give
  33647. * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
  33648. * is never an unreasonable scale.
  33649. */
  33650. maximumScale: number;
  33651. /**
  33652. * User-defined object returned when the model is picked.
  33653. */
  33654. id: any;
  33655. /**
  33656. * Returns the height reference of the model
  33657. */
  33658. heightReference: HeightReference;
  33659. /**
  33660. * The currently playing glTF animations.
  33661. */
  33662. activeAnimations: ModelAnimationCollection;
  33663. /**
  33664. * Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  33665. */
  33666. clampAnimations: boolean;
  33667. /**
  33668. * Determines whether the model casts or receives shadows from light sources.
  33669. */
  33670. shadows: ShadowMode;
  33671. /**
  33672. * A color that blends with the model's rendered color.
  33673. */
  33674. color: Color;
  33675. /**
  33676. * Defines how the color blends with the model.
  33677. */
  33678. colorBlendMode: ColorBlendMode;
  33679. /**
  33680. * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>.
  33681. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  33682. * any value in-between resulting in a mix of the two.
  33683. */
  33684. colorBlendAmount: number;
  33685. /**
  33686. * Whether to cull back-facing geometry. When true, back face culling is
  33687. * determined by the material's doubleSided property; when false, back face
  33688. * culling is disabled. Back faces are not culled if {@link Model#color} is
  33689. * translucent or {@link Model#silhouetteSize} is greater than 0.0.
  33690. */
  33691. backFaceCulling: boolean;
  33692. /**
  33693. * Whether to display the outline for models using the
  33694. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.
  33695. * When true, outlines are displayed. When false, outlines are not displayed.
  33696. */
  33697. readonly showOutline: boolean;
  33698. /**
  33699. * This property is for debugging only; it is not for production use nor is it optimized.
  33700. * <p>
  33701. * Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds
  33702. * to one draw command. A glTF mesh has an array of primitives, often of length one.
  33703. * </p>
  33704. */
  33705. debugShowBoundingVolume: boolean;
  33706. /**
  33707. * This property is for debugging only; it is not for production use nor is it optimized.
  33708. * <p>
  33709. * Draws the model in wireframe.
  33710. * </p>
  33711. */
  33712. debugWireframe: boolean;
  33713. /**
  33714. * The object for the glTF JSON, including properties with default values omitted
  33715. * from the JSON provided to this model.
  33716. */
  33717. readonly gltf: any;
  33718. /**
  33719. * The base path that paths in the glTF JSON are relative to. The base
  33720. * path is the same path as the path containing the .gltf file
  33721. * minus the .gltf file, when binary, image, and shader files are
  33722. * in the same directory as the .gltf. When this is <code>''</code>,
  33723. * the app's base path is used.
  33724. */
  33725. readonly basePath: string;
  33726. /**
  33727. * The model's bounding sphere in its local coordinate system. This does not take into
  33728. * account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}.
  33729. * @example
  33730. * // Center in WGS84 coordinates
  33731. * var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
  33732. */
  33733. readonly boundingSphere: BoundingSphere;
  33734. /**
  33735. * When <code>true</code>, this model is ready to render, i.e., the external binary, image,
  33736. * and shader files were downloaded and the WebGL resources were created. This is set to
  33737. * <code>true</code> right before {@link Model#readyPromise} is resolved.
  33738. */
  33739. readonly ready: boolean;
  33740. /**
  33741. * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image,
  33742. * and shader files were downloaded and the WebGL resources were created.
  33743. * <p>
  33744. * This promise is resolved at the end of the frame before the first frame the model is rendered in.
  33745. * </p>
  33746. * @example
  33747. * // Play all animations at half-speed when the model is ready to render
  33748. * Cesium.when(model.readyPromise).then(function(model) {
  33749. * model.activeAnimations.addAll({
  33750. * multiplier : 0.5
  33751. * });
  33752. * }).otherwise(function(error){
  33753. * window.alert(error);
  33754. * });
  33755. */
  33756. readonly readyPromise: Promise<Model>;
  33757. /**
  33758. * Determines if model WebGL resource creation will be spread out over several frames or
  33759. * block until completion once all glTF files are loaded.
  33760. */
  33761. readonly asynchronous: boolean;
  33762. /**
  33763. * When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  33764. */
  33765. readonly allowPicking: boolean;
  33766. /**
  33767. * Determine if textures may continue to stream in after the model is loaded.
  33768. */
  33769. readonly incrementallyLoadTextures: boolean;
  33770. /**
  33771. * Return the number of pending texture loads.
  33772. */
  33773. readonly pendingTextureLoads: number;
  33774. /**
  33775. * Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
  33776. */
  33777. distanceDisplayCondition: DistanceDisplayCondition;
  33778. /**
  33779. * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  33780. */
  33781. clippingPlanes: ClippingPlaneCollection;
  33782. /**
  33783. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox. This cartesian is used to scale the final
  33784. * diffuse and specular lighting contribution from those sources to the final color. A value of 0.0 will disable those light sources.
  33785. */
  33786. imageBasedLightingFactor: Cartesian2;
  33787. /**
  33788. * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  33789. * <p>
  33790. * For example, disabling additional light sources by setting <code>model.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0)</code> will make the
  33791. * model much darker. Here, increasing the intensity of the light source will make the model brighter.
  33792. * </p>
  33793. */
  33794. lightColor: Cartesian3;
  33795. /**
  33796. * The sun's luminance at the zenith in kilo candela per meter squared to use for this model's procedural environment map.
  33797. * This is used when {@link Model#specularEnvironmentMaps} and {@link Model#sphericalHarmonicCoefficients} are not defined.
  33798. */
  33799. luminanceAtZenith: number;
  33800. /**
  33801. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  33802. * computed from the atmosphere color is used.
  33803. * <p>
  33804. * There are nine <code>Cartesian3</code> coefficients.
  33805. * The order of the coefficients is: L<sub>00</sub>, L<sub>1-1</sub>, L<sub>10</sub>, L<sub>11</sub>, L<sub>2-2</sub>, L<sub>2-1</sub>, L<sub>20</sub>, L<sub>21</sub>, L<sub>22</sub>
  33806. * </p>
  33807. *
  33808. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  33809. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  33810. * supplied to {@link Model#specularEnvironmentMaps}.
  33811. */
  33812. sphericalHarmonicCoefficients: Cartesian3[];
  33813. /**
  33814. * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  33815. */
  33816. specularEnvironmentMaps: string;
  33817. /**
  33818. * Gets the credit that will be displayed for the model
  33819. */
  33820. credit: Credit;
  33821. /**
  33822. * Determines if silhouettes are supported.
  33823. * @param scene - The scene.
  33824. * @returns <code>true</code> if silhouettes are supported; otherwise, returns <code>false</code>
  33825. */
  33826. static silhouetteSupported(scene: Scene): boolean;
  33827. /**
  33828. * <p>
  33829. * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
  33830. * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
  33831. * </p>
  33832. * <p>
  33833. * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
  33834. * </p>
  33835. * <p>
  33836. * Cesium supports glTF assets with the following extensions:
  33837. * <ul>
  33838. * <li>
  33839. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  33840. * </li><li>
  33841. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  33842. * </li><li>
  33843. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  33844. * </li><li>
  33845. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  33846. * </li><li>
  33847. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  33848. * </li><li>
  33849. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  33850. * </li><li>
  33851. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  33852. * </li><li>
  33853. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  33854. * </li><li>
  33855. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  33856. * </li><li>
  33857. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  33858. * </li><li>
  33859. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu/README.md|KHR_texture_basisu}
  33860. * </li>
  33861. * </ul>
  33862. * </p>
  33863. * <p>
  33864. * For high-precision rendering, Cesium supports the {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/CESIUM_RTC/README.md|CESIUM_RTC} extension, which introduces the
  33865. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  33866. * relative to a local origin.
  33867. * </p>
  33868. * @example
  33869. * // Example 1. Create a model from a glTF asset
  33870. * var model = scene.primitives.add(Cesium.Model.fromGltf({
  33871. * url : './duck/duck.gltf'
  33872. * }));
  33873. * @example
  33874. * // Example 2. Create model and provide all properties and events
  33875. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  33876. * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  33877. *
  33878. * var model = scene.primitives.add(Cesium.Model.fromGltf({
  33879. * url : './duck/duck.gltf',
  33880. * show : true, // default
  33881. * modelMatrix : modelMatrix,
  33882. * scale : 2.0, // double size
  33883. * minimumPixelSize : 128, // never smaller than 128 pixels
  33884. * maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
  33885. * allowPicking : false, // not pickable
  33886. * debugShowBoundingVolume : false, // default
  33887. * debugWireframe : false
  33888. * }));
  33889. *
  33890. * model.readyPromise.then(function(model) {
  33891. * // Play all animations when the model is ready to render
  33892. * model.activeAnimations.addAll();
  33893. * });
  33894. * @param options - Object with the following properties:
  33895. * @param options.url - The url to the .gltf file.
  33896. * @param [options.basePath] - The base path that paths in the glTF JSON are relative to.
  33897. * @param [options.show = true] - Determines if the model primitive will be shown.
  33898. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  33899. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  33900. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  33901. * @param [options.maximumScale] - The maximum scale for the model.
  33902. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  33903. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  33904. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  33905. * @param [options.asynchronous = true] - Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
  33906. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  33907. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  33908. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  33909. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  33910. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  33911. * @param [options.scene] - Must be passed in for models that use the height reference property.
  33912. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  33913. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  33914. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  33915. * @param [options.colorBlendAmount = 0.5] - Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
  33916. * @param [options.silhouetteColor = Color.RED] - The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.
  33917. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  33918. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  33919. * @param [options.dequantizeInShader = true] - Determines if a {@link https://github.com/google/draco|Draco} encoded model is dequantized on the GPU. This decreases total memory usage for encoded models.
  33920. * @param [options.credit] - A credit for the model, which is displayed on the canvas.
  33921. * @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if {@link Model#color} is translucent or {@link Model#silhouetteSize} is greater than 0.0.
  33922. * @param [options.showOutline = true] - Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
  33923. * @returns The newly created model.
  33924. */
  33925. static fromGltf(options: {
  33926. url: Resource | string;
  33927. basePath?: Resource | string;
  33928. show?: boolean;
  33929. modelMatrix?: Matrix4;
  33930. scale?: number;
  33931. minimumPixelSize?: number;
  33932. maximumScale?: number;
  33933. id?: any;
  33934. allowPicking?: boolean;
  33935. incrementallyLoadTextures?: boolean;
  33936. asynchronous?: boolean;
  33937. clampAnimations?: boolean;
  33938. shadows?: ShadowMode;
  33939. debugShowBoundingVolume?: boolean;
  33940. debugWireframe?: boolean;
  33941. heightReference?: HeightReference;
  33942. scene?: Scene;
  33943. distanceDisplayCondition?: DistanceDisplayCondition;
  33944. color?: Color;
  33945. colorBlendMode?: ColorBlendMode;
  33946. colorBlendAmount?: number;
  33947. silhouetteColor?: Color;
  33948. silhouetteSize?: number;
  33949. clippingPlanes?: ClippingPlaneCollection;
  33950. dequantizeInShader?: boolean;
  33951. credit?: Credit | string;
  33952. backFaceCulling?: boolean;
  33953. showOutline?: boolean;
  33954. }): Model;
  33955. /**
  33956. * Returns the glTF node with the given <code>name</code> property. This is used to
  33957. * modify a node's transform for animation outside of glTF animations.
  33958. * @example
  33959. * // Apply non-uniform scale to node LOD3sp
  33960. * var node = model.getNode('LOD3sp');
  33961. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  33962. * @param name - The glTF name of the node.
  33963. * @returns The node or <code>undefined</code> if no node with <code>name</code> exists.
  33964. */
  33965. getNode(name: string): ModelNode;
  33966. /**
  33967. * Returns the glTF mesh with the given <code>name</code> property.
  33968. * @param name - The glTF name of the mesh.
  33969. * @returns The mesh or <code>undefined</code> if no mesh with <code>name</code> exists.
  33970. */
  33971. getMesh(name: string): ModelMesh;
  33972. /**
  33973. * Returns the glTF material with the given <code>name</code> property.
  33974. * @param name - The glTF name of the material.
  33975. * @returns The material or <code>undefined</code> if no material with <code>name</code> exists.
  33976. */
  33977. getMaterial(name: string): ModelMaterial;
  33978. /**
  33979. * Sets the current value of an articulation stage. After setting one or multiple stage values, call
  33980. * Model.applyArticulations() to cause the node matrices to be recalculated.
  33981. * @param articulationStageKey - The name of the articulation, a space, and the name of the stage.
  33982. * @param value - The numeric value of this stage of the articulation.
  33983. */
  33984. setArticulationStage(articulationStageKey: string, value: number): void;
  33985. /**
  33986. * Applies any modified articulation stages to the matrix of each node that participates
  33987. * in any articulation. Note that this will overwrite any nodeTransformations on participating nodes.
  33988. */
  33989. applyArticulations(): void;
  33990. /**
  33991. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  33992. * get the draw commands needed to render this primitive.
  33993. * <p>
  33994. * Do not call this function directly. This is documented just to
  33995. * list the exceptions that may be propagated when the scene is rendered:
  33996. * </p>
  33997. */
  33998. update(): void;
  33999. /**
  34000. * Returns true if this object was destroyed; otherwise, false.
  34001. * <br /><br />
  34002. * If this object was destroyed, it should not be used; calling any function other than
  34003. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34004. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34005. */
  34006. isDestroyed(): boolean;
  34007. /**
  34008. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34009. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34010. * <br /><br />
  34011. * Once an object is destroyed, it should not be used; calling any function other than
  34012. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34013. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34014. * @example
  34015. * model = model && model.destroy();
  34016. */
  34017. destroy(): void;
  34018. }
  34019. /**
  34020. * An active glTF animation. A glTF asset can contain animations. An active animation
  34021. * is an animation that is currently playing or scheduled to be played because it was
  34022. * added to a model's {@link ModelAnimationCollection}. An active animation is an
  34023. * instance of an animation; for example, there can be multiple active animations
  34024. * for the same glTF animation, each with a different start time.
  34025. * <p>
  34026. * Create this by calling {@link ModelAnimationCollection#add}.
  34027. * </p>
  34028. */
  34029. export class ModelAnimation {
  34030. constructor();
  34031. /**
  34032. * When <code>true</code>, the animation is removed after it stops playing.
  34033. * This is slightly more efficient that not removing it, but if, for example,
  34034. * time is reversed, the animation is not played again.
  34035. */
  34036. removeOnStop: boolean;
  34037. /**
  34038. * The event fired when this animation is started. This can be used, for
  34039. * example, to play a sound or start a particle system, when the animation starts.
  34040. * <p>
  34041. * This event is fired at the end of the frame after the scene is rendered.
  34042. * </p>
  34043. * @example
  34044. * animation.start.addEventListener(function(model, animation) {
  34045. * console.log('Animation started: ' + animation.name);
  34046. * });
  34047. */
  34048. start: Event;
  34049. /**
  34050. * The event fired when on each frame when this animation is updated. The
  34051. * current time of the animation, relative to the glTF animation time span, is
  34052. * passed to the event, which allows, for example, starting new animations at a
  34053. * specific time relative to a playing animation.
  34054. * <p>
  34055. * This event is fired at the end of the frame after the scene is rendered.
  34056. * </p>
  34057. * @example
  34058. * animation.update.addEventListener(function(model, animation, time) {
  34059. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  34060. * });
  34061. */
  34062. update: Event;
  34063. /**
  34064. * The event fired when this animation is stopped. This can be used, for
  34065. * example, to play a sound or start a particle system, when the animation stops.
  34066. * <p>
  34067. * This event is fired at the end of the frame after the scene is rendered.
  34068. * </p>
  34069. * @example
  34070. * animation.stop.addEventListener(function(model, animation) {
  34071. * console.log('Animation stopped: ' + animation.name);
  34072. * });
  34073. */
  34074. stop: Event;
  34075. /**
  34076. * The glTF animation name that identifies this animation.
  34077. */
  34078. readonly name: string;
  34079. /**
  34080. * The scene time to start playing this animation. When this is <code>undefined</code>,
  34081. * the animation starts at the next frame.
  34082. */
  34083. readonly startTime: JulianDate;
  34084. /**
  34085. * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing.
  34086. */
  34087. readonly delay: number;
  34088. /**
  34089. * The scene time to stop playing this animation. When this is <code>undefined</code>,
  34090. * the animation is played for its full duration and perhaps repeated depending on
  34091. * {@link ModelAnimation#loop}.
  34092. */
  34093. readonly stopTime: JulianDate;
  34094. /**
  34095. * Values greater than <code>1.0</code> increase the speed that the animation is played relative
  34096. * to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of
  34097. * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene
  34098. * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation
  34099. * will play in one second even if <code>multiplier</code> is <code>1.0</code>.
  34100. */
  34101. readonly multiplier: number;
  34102. /**
  34103. * When <code>true</code>, the animation is played in reverse.
  34104. */
  34105. readonly reverse: boolean;
  34106. /**
  34107. * Determines if and how the animation is looped.
  34108. */
  34109. readonly loop: ModelAnimationLoop;
  34110. }
  34111. /**
  34112. * A collection of active model animations. Access this using {@link Model#activeAnimations}.
  34113. */
  34114. export class ModelAnimationCollection {
  34115. constructor();
  34116. /**
  34117. * The event fired when an animation is added to the collection. This can be used, for
  34118. * example, to keep a UI in sync.
  34119. * @example
  34120. * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  34121. * console.log('Animation added: ' + animation.name);
  34122. * });
  34123. */
  34124. animationAdded: Event;
  34125. /**
  34126. * The event fired when an animation is removed from the collection. This can be used, for
  34127. * example, to keep a UI in sync.
  34128. * @example
  34129. * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  34130. * console.log('Animation removed: ' + animation.name);
  34131. * });
  34132. */
  34133. animationRemoved: Event;
  34134. /**
  34135. * The number of animations in the collection.
  34136. */
  34137. readonly length: number;
  34138. /**
  34139. * Creates and adds an animation with the specified initial properties to the collection.
  34140. * <p>
  34141. * This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.
  34142. * </p>
  34143. * @example
  34144. * // Example 1. Add an animation by name
  34145. * model.activeAnimations.add({
  34146. * name : 'animation name'
  34147. * });
  34148. *
  34149. * // Example 2. Add an animation by index
  34150. * model.activeAnimations.add({
  34151. * index : 0
  34152. * });
  34153. * @example
  34154. * // Example 3. Add an animation and provide all properties and events
  34155. * var startTime = Cesium.JulianDate.now();
  34156. *
  34157. * var animation = model.activeAnimations.add({
  34158. * name : 'another animation name',
  34159. * startTime : startTime,
  34160. * delay : 0.0, // Play at startTime (default)
  34161. * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),
  34162. * removeOnStop : false, // Do not remove when animation stops (default)
  34163. * multiplier : 2.0, // Play at double speed
  34164. * reverse : true, // Play in reverse
  34165. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation
  34166. * });
  34167. *
  34168. * animation.start.addEventListener(function(model, animation) {
  34169. * console.log('Animation started: ' + animation.name);
  34170. * });
  34171. * animation.update.addEventListener(function(model, animation, time) {
  34172. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  34173. * });
  34174. * animation.stop.addEventListener(function(model, animation) {
  34175. * console.log('Animation stopped: ' + animation.name);
  34176. * });
  34177. * @param options - Object with the following properties:
  34178. * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.
  34179. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.
  34180. * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.
  34181. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  34182. * @param [options.stopTime] - The scene time to stop playing the animation. When this is <code>undefined</code>, the animation is played for its full duration.
  34183. * @param [options.removeOnStop = false] - When <code>true</code>, the animation is removed after it stops playing.
  34184. * @param [options.multiplier = 1.0] - Values greater than <code>1.0</code> increase the speed that the animation is played relative to the scene clock speed; values less than <code>1.0</code> decrease the speed.
  34185. * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse.
  34186. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped.
  34187. * @returns The animation that was added to the collection.
  34188. */
  34189. add(options: {
  34190. name?: string;
  34191. index?: number;
  34192. startTime?: JulianDate;
  34193. delay?: number;
  34194. stopTime?: JulianDate;
  34195. removeOnStop?: boolean;
  34196. multiplier?: number;
  34197. reverse?: boolean;
  34198. loop?: ModelAnimationLoop;
  34199. }): ModelAnimation;
  34200. /**
  34201. * Creates and adds an animation with the specified initial properties to the collection
  34202. * for each animation in the model.
  34203. * <p>
  34204. * This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.
  34205. * </p>
  34206. * @example
  34207. * model.activeAnimations.addAll({
  34208. * multiplier : 0.5, // Play at half-speed
  34209. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations
  34210. * });
  34211. * @param [options] - Object with the following properties:
  34212. * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.
  34213. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  34214. * @param [options.stopTime] - The scene time to stop playing the animations. When this is <code>undefined</code>, the animations are played for its full duration.
  34215. * @param [options.removeOnStop = false] - When <code>true</code>, the animations are removed after they stop playing.
  34216. * @param [options.multiplier = 1.0] - Values greater than <code>1.0</code> increase the speed that the animations play relative to the scene clock speed; values less than <code>1.0</code> decrease the speed.
  34217. * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse.
  34218. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped.
  34219. * @returns An array of {@link ModelAnimation} objects, one for each animation added to the collection. If there are no glTF animations, the array is empty.
  34220. */
  34221. addAll(options?: {
  34222. startTime?: JulianDate;
  34223. delay?: number;
  34224. stopTime?: JulianDate;
  34225. removeOnStop?: boolean;
  34226. multiplier?: number;
  34227. reverse?: boolean;
  34228. loop?: ModelAnimationLoop;
  34229. }): ModelAnimation[];
  34230. /**
  34231. * Removes an animation from the collection.
  34232. * <p>
  34233. * This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.
  34234. * </p>
  34235. * <p>
  34236. * An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to
  34237. * <code>true</code>. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed.
  34238. * </p>
  34239. * @example
  34240. * var a = model.activeAnimations.add({
  34241. * name : 'animation name'
  34242. * });
  34243. * model.activeAnimations.remove(a); // Returns true
  34244. * @param animation - The animation to remove.
  34245. * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.
  34246. */
  34247. remove(animation: ModelAnimation): boolean;
  34248. /**
  34249. * Removes all animations from the collection.
  34250. * <p>
  34251. * This raises the {@link ModelAnimationCollection#animationRemoved} event for each
  34252. * animation so, for example, a UI can stay in sync.
  34253. * </p>
  34254. */
  34255. removeAll(): void;
  34256. /**
  34257. * Determines whether this collection contains a given animation.
  34258. * @param animation - The animation to check for.
  34259. * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise.
  34260. */
  34261. contains(animation: ModelAnimation): boolean;
  34262. /**
  34263. * Returns the animation in the collection at the specified index. Indices are zero-based
  34264. * and increase as animations are added. Removing an animation shifts all animations after
  34265. * it to the left, changing their indices. This function is commonly used to iterate over
  34266. * all the animations in the collection.
  34267. * @example
  34268. * // Output the names of all the animations in the collection.
  34269. * var animations = model.activeAnimations;
  34270. * var length = animations.length;
  34271. * for (var i = 0; i < length; ++i) {
  34272. * console.log(animations.get(i).name);
  34273. * }
  34274. * @param index - The zero-based index of the animation.
  34275. * @returns The animation at the specified index.
  34276. */
  34277. get(index: number): ModelAnimation;
  34278. }
  34279. /**
  34280. * Determines if and how a glTF animation is looped.
  34281. */
  34282. export enum ModelAnimationLoop {
  34283. /**
  34284. * Play the animation once; do not loop it.
  34285. */
  34286. NONE = 0,
  34287. /**
  34288. * Loop the animation playing it from the start immediately after it stops.
  34289. */
  34290. REPEAT = 1,
  34291. /**
  34292. * Loop the animation. First, playing it forward, then in reverse, then forward, and so on.
  34293. */
  34294. MIRRORED_REPEAT = 2
  34295. }
  34296. /**
  34297. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  34298. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's Cartesian WGS84 coordinates.
  34299. * Local reference frames can be used by providing a different transformation matrix, like that returned
  34300. * by {@link Transforms.eastNorthUpToFixedFrame}.
  34301. * @example
  34302. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  34303. * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  34304. */
  34305. export var modelMatrix: Matrix4;
  34306. /**
  34307. * The bounding sphere that contains all the vertices in this primitive.
  34308. */
  34309. export var boundingSphere: BoundingSphere;
  34310. /**
  34311. * A model's material with modifiable parameters. A glTF material
  34312. * contains parameters defined by the material's technique with values
  34313. * defined by the technique and potentially overridden by the material.
  34314. * This class allows changing these values at runtime.
  34315. * <p>
  34316. * Use {@link Model#getMaterial} to create an instance.
  34317. * </p>
  34318. */
  34319. export class ModelMaterial {
  34320. constructor();
  34321. /**
  34322. * The value of the <code>name</code> property of this material.
  34323. */
  34324. readonly name: string;
  34325. /**
  34326. * The index of the material.
  34327. */
  34328. readonly id: string;
  34329. /**
  34330. * Assigns a value to a material parameter. The type for <code>value</code>
  34331. * depends on the glTF type of the parameter. It will be a floating-point
  34332. * number, Cartesian, or matrix.
  34333. * @example
  34334. * material.setValue('diffuse', new Cesium.Cartesian4(1.0, 0.0, 0.0, 1.0)); // vec4
  34335. * material.setValue('shininess', 256.0); // scalar
  34336. * @param name - The name of the parameter.
  34337. * @param [value] - The value to assign to the parameter.
  34338. */
  34339. setValue(name: string, value?: any): void;
  34340. /**
  34341. * Returns the value of the parameter with the given <code>name</code>. The type of the
  34342. * returned object depends on the glTF type of the parameter. It will be a floating-point
  34343. * number, Cartesian, or matrix.
  34344. * @param name - The name of the parameter.
  34345. * @returns The value of the parameter or <code>undefined</code> if the parameter does not exist.
  34346. */
  34347. getValue(name: string): any;
  34348. }
  34349. /**
  34350. * A model's mesh and its materials.
  34351. * <p>
  34352. * Use {@link Model#getMesh} to create an instance.
  34353. * </p>
  34354. */
  34355. export class ModelMesh {
  34356. constructor();
  34357. /**
  34358. * The value of the <code>name</code> property of this mesh.
  34359. */
  34360. readonly name: string;
  34361. /**
  34362. * The index of the mesh.
  34363. */
  34364. readonly id: string;
  34365. /**
  34366. * An array of {@link ModelMaterial} instances indexed by the mesh's
  34367. * primitive indices.
  34368. */
  34369. readonly materials: ModelMaterial[];
  34370. }
  34371. /**
  34372. * A model node with a transform for user-defined animations. A glTF asset can
  34373. * contain animations that target a node's transform. This class allows
  34374. * changing a node's transform externally so animation can be driven by another
  34375. * source, not just an animation in the glTF asset.
  34376. * <p>
  34377. * Use {@link Model#getNode} to create an instance.
  34378. * </p>
  34379. * @example
  34380. * var node = model.getNode('LOD3sp');
  34381. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  34382. */
  34383. export class ModelNode {
  34384. constructor();
  34385. /**
  34386. * The value of the <code>name</code> property of this node.
  34387. */
  34388. readonly name: string;
  34389. /**
  34390. * The index of the node.
  34391. */
  34392. readonly id: string;
  34393. /**
  34394. * Determines if this node and its children will be shown.
  34395. */
  34396. show: boolean;
  34397. /**
  34398. * The node's 4x4 matrix transform from its local coordinates to
  34399. * its parent's.
  34400. * <p>
  34401. * For changes to take effect, this property must be assigned to;
  34402. * setting individual elements of the matrix will not work.
  34403. * </p>
  34404. */
  34405. matrix: Matrix4;
  34406. /**
  34407. * Gets the node's original 4x4 matrix transform from its local coordinates to
  34408. * its parent's, without any node transformations or articulations applied.
  34409. */
  34410. originalMatrix: Matrix4;
  34411. }
  34412. /**
  34413. * Draws the Moon in 3D.
  34414. * @example
  34415. * scene.moon = new Cesium.Moon();
  34416. * @param [options] - Object with the following properties:
  34417. * @param [options.show = true] - Determines whether the moon will be rendered.
  34418. * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture.
  34419. * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid.
  34420. * @param [options.onlySunLighting = true] - Use the sun as the only light source.
  34421. */
  34422. export class Moon {
  34423. constructor(options?: {
  34424. show?: boolean;
  34425. textureUrl?: string;
  34426. ellipsoid?: Ellipsoid;
  34427. onlySunLighting?: boolean;
  34428. });
  34429. /**
  34430. * Determines if the moon will be shown.
  34431. */
  34432. show: boolean;
  34433. /**
  34434. * The moon texture.
  34435. */
  34436. textureUrl: string;
  34437. /**
  34438. * Use the sun as the only light source.
  34439. */
  34440. onlySunLighting: boolean;
  34441. /**
  34442. * Get the ellipsoid that defines the shape of the moon.
  34443. */
  34444. readonly ellipsoid: Ellipsoid;
  34445. /**
  34446. * Returns true if this object was destroyed; otherwise, false.
  34447. * <br /><br />
  34448. * If this object was destroyed, it should not be used; calling any function other than
  34449. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34450. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34451. */
  34452. isDestroyed(): boolean;
  34453. /**
  34454. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34455. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34456. * <br /><br />
  34457. * Once an object is destroyed, it should not be used; calling any function other than
  34458. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34459. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34460. * @example
  34461. * moon = moon && moon.destroy();
  34462. */
  34463. destroy(): void;
  34464. }
  34465. /**
  34466. * A {@link TileDiscardPolicy} specifying that tile images should never be discard.
  34467. */
  34468. export class NeverTileDiscardPolicy {
  34469. constructor();
  34470. /**
  34471. * Determines if the discard policy is ready to process images.
  34472. * @returns True if the discard policy is ready to process images; otherwise, false.
  34473. */
  34474. isReady(): boolean;
  34475. /**
  34476. * Given a tile image, decide whether to discard that image.
  34477. * @param image - An image to test.
  34478. * @returns True if the image should be discarded; otherwise, false.
  34479. */
  34480. shouldDiscardImage(image: HTMLImageElement): boolean;
  34481. }
  34482. export namespace OpenStreetMapImageryProvider {
  34483. /**
  34484. * Initialization options for the OpenStreetMapImageryProvider constructor
  34485. * @property [url = 'https://a.tile.openstreetmap.org'] - The OpenStreetMap server url.
  34486. * @property [fileExtension = 'png'] - The file extension for images on the server.
  34487. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  34488. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  34489. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  34490. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  34491. * @property [credit = 'MapQuest, Open Street Map and contributors, CC-BY-SA'] - A credit for the data source, which is displayed on the canvas.
  34492. */
  34493. type ConstructorOptions = {
  34494. url?: string;
  34495. fileExtension?: string;
  34496. rectangle?: Rectangle;
  34497. minimumLevel?: number;
  34498. maximumLevel?: number;
  34499. ellipsoid?: Ellipsoid;
  34500. credit?: Credit | string;
  34501. };
  34502. }
  34503. /**
  34504. * An imagery provider that provides tiled imagery hosted by OpenStreetMap
  34505. * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run
  34506. * servers, so you must conform to their
  34507. * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}.
  34508. * @example
  34509. * var osm = new Cesium.OpenStreetMapImageryProvider({
  34510. * url : 'https://a.tile.openstreetmap.org/'
  34511. * });
  34512. * @param options - Object describing initialization options
  34513. */
  34514. export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider {
  34515. constructor(options: OpenStreetMapImageryProvider.ConstructorOptions);
  34516. }
  34517. /**
  34518. * A particle emitted by a {@link ParticleSystem}.
  34519. * @param options - An object with the following properties:
  34520. * @param [options.mass = 1.0] - The mass of the particle in kilograms.
  34521. * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates.
  34522. * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates.
  34523. * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds.
  34524. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  34525. * @param [options.startColor = Color.WHITE] - The color of a particle when it is born.
  34526. * @param [options.endColor = Color.WHITE] - The color of a particle when it dies.
  34527. * @param [options.startScale = 1.0] - The scale of the particle when it is born.
  34528. * @param [options.endScale = 1.0] - The scale of the particle when it dies.
  34529. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels.
  34530. */
  34531. export class Particle {
  34532. constructor(options: {
  34533. mass?: number;
  34534. position?: Cartesian3;
  34535. velocity?: Cartesian3;
  34536. life?: number;
  34537. image?: any;
  34538. startColor?: Color;
  34539. endColor?: Color;
  34540. startScale?: number;
  34541. endScale?: number;
  34542. imageSize?: Cartesian2;
  34543. });
  34544. /**
  34545. * The mass of the particle in kilograms.
  34546. */
  34547. mass: number;
  34548. /**
  34549. * The positon of the particle in world coordinates.
  34550. */
  34551. position: Cartesian3;
  34552. /**
  34553. * The velocity of the particle in world coordinates.
  34554. */
  34555. velocity: Cartesian3;
  34556. /**
  34557. * The life of the particle in seconds.
  34558. */
  34559. life: number;
  34560. /**
  34561. * The image to use for the particle.
  34562. */
  34563. image: any;
  34564. /**
  34565. * The color of the particle when it is born.
  34566. */
  34567. startColor: Color;
  34568. /**
  34569. * The color of the particle when it dies.
  34570. */
  34571. endColor: Color;
  34572. /**
  34573. * the scale of the particle when it is born.
  34574. */
  34575. startScale: number;
  34576. /**
  34577. * The scale of the particle when it dies.
  34578. */
  34579. endScale: number;
  34580. /**
  34581. * The dimensions, width by height, to scale the particle image in pixels.
  34582. */
  34583. imageSize: Cartesian2;
  34584. /**
  34585. * Gets the age of the particle in seconds.
  34586. */
  34587. age: number;
  34588. /**
  34589. * Gets the age normalized to a value in the range [0.0, 1.0].
  34590. */
  34591. normalizedAge: number;
  34592. }
  34593. /**
  34594. * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime.
  34595. * @param [options] - An object with the following properties:
  34596. * @param [options.time = 0.0] - The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  34597. * @param [options.minimum = 0.0] - The minimum number of particles emmitted in the burst.
  34598. * @param [options.maximum = 50.0] - The maximum number of particles emitted in the burst.
  34599. */
  34600. export class ParticleBurst {
  34601. constructor(options?: {
  34602. time?: number;
  34603. minimum?: number;
  34604. maximum?: number;
  34605. });
  34606. /**
  34607. * The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  34608. */
  34609. time: number;
  34610. /**
  34611. * The minimum number of particles emitted.
  34612. */
  34613. minimum: number;
  34614. /**
  34615. * The maximum number of particles emitted.
  34616. */
  34617. maximum: number;
  34618. /**
  34619. * <code>true</code> if the burst has been completed; <code>false</code> otherwise.
  34620. */
  34621. complete: boolean;
  34622. }
  34623. /**
  34624. * <p>
  34625. * An object that initializes a {@link Particle} from a {@link ParticleSystem}.
  34626. * </p>
  34627. * <p>
  34628. * This type describes an interface and is not intended to be instantiated directly.
  34629. * </p>
  34630. */
  34631. export class ParticleEmitter {
  34632. constructor();
  34633. }
  34634. /**
  34635. * A ParticleSystem manages the updating and display of a collection of particles.
  34636. * @param [options] - Object with the following properties:
  34637. * @param [options.show = true] - Whether to display the particle system.
  34638. * @param [options.updateCallback] - The callback function to be called each frame to update a particle.
  34639. * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system.
  34640. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  34641. * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  34642. * @param [options.emissionRate = 5] - The number of particles to emit per second.
  34643. * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  34644. * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete.
  34645. * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife.
  34646. * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life.
  34647. * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life.
  34648. * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife.
  34649. * @param [options.startColor] - The color of the particle at the beginning of its life.
  34650. * @param [options.endColor] - The color of the particle at the end of its life.
  34651. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  34652. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - If set, overrides the minimumImageSize and maximumImageSize inputs that scale the particle image's dimensions in pixels.
  34653. * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  34654. * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  34655. * @param [options.sizeInMeters] - Sets if the size of particles is in meters or pixels. <code>true</code> to size the particles in meters; otherwise, the size is in pixels.
  34656. * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value.
  34657. * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  34658. * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  34659. * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds.
  34660. * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.
  34661. * @param [options.minimumParticleLife] - Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.
  34662. * @param [options.maximumParticleLife] - Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.
  34663. * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms.
  34664. * @param [options.minimumMass] - Sets the minimum bound for the mass of a particle in kilograms. A particle's actual mass will be chosen as a random amount above this value.
  34665. * @param [options.maximumMass] - Sets the maximum mass of particles in kilograms. A particle's actual mass will be chosen as a random amount below this value.
  34666. */
  34667. export class ParticleSystem {
  34668. constructor(options?: {
  34669. show?: boolean;
  34670. updateCallback?: ParticleSystem.updateCallback;
  34671. emitter?: ParticleEmitter;
  34672. modelMatrix?: Matrix4;
  34673. emitterModelMatrix?: Matrix4;
  34674. emissionRate?: number;
  34675. bursts?: ParticleBurst[];
  34676. loop?: boolean;
  34677. scale?: number;
  34678. startScale?: number;
  34679. endScale?: number;
  34680. color?: Color;
  34681. startColor?: Color;
  34682. endColor?: Color;
  34683. image?: any;
  34684. imageSize?: Cartesian2;
  34685. minimumImageSize?: Cartesian2;
  34686. maximumImageSize?: Cartesian2;
  34687. sizeInMeters?: boolean;
  34688. speed?: number;
  34689. minimumSpeed?: number;
  34690. maximumSpeed?: number;
  34691. lifetime?: number;
  34692. particleLife?: number;
  34693. minimumParticleLife?: number;
  34694. maximumParticleLife?: number;
  34695. mass?: number;
  34696. minimumMass?: number;
  34697. maximumMass?: number;
  34698. });
  34699. /**
  34700. * Whether to display the particle system.
  34701. */
  34702. show: boolean;
  34703. /**
  34704. * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time
  34705. */
  34706. updateCallback: ParticleSystem.updateCallback;
  34707. /**
  34708. * Whether the particle system should loop it's bursts when it is complete.
  34709. */
  34710. loop: boolean;
  34711. /**
  34712. * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  34713. */
  34714. image: any;
  34715. /**
  34716. * The particle emitter for this
  34717. */
  34718. emitter: ParticleEmitter;
  34719. /**
  34720. * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  34721. */
  34722. bursts: ParticleBurst[];
  34723. /**
  34724. * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  34725. */
  34726. modelMatrix: Matrix4;
  34727. /**
  34728. * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  34729. */
  34730. emitterModelMatrix: Matrix4;
  34731. /**
  34732. * The color of the particle at the beginning of its life.
  34733. */
  34734. startColor: Color;
  34735. /**
  34736. * The color of the particle at the end of its life.
  34737. */
  34738. endColor: Color;
  34739. /**
  34740. * The initial scale to apply to the image of the particle at the beginning of its life.
  34741. */
  34742. startScale: number;
  34743. /**
  34744. * The final scale to apply to the image of the particle at the end of its life.
  34745. */
  34746. endScale: number;
  34747. /**
  34748. * The number of particles to emit per second.
  34749. */
  34750. emissionRate: number;
  34751. /**
  34752. * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  34753. */
  34754. minimumSpeed: number;
  34755. /**
  34756. * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  34757. */
  34758. maximumSpeed: number;
  34759. /**
  34760. * Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.
  34761. */
  34762. minimumParticleLife: number;
  34763. /**
  34764. * Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.
  34765. */
  34766. maximumParticleLife: number;
  34767. /**
  34768. * Sets the minimum mass of particles in kilograms.
  34769. */
  34770. minimumMass: number;
  34771. /**
  34772. * Sets the maximum mass of particles in kilograms.
  34773. */
  34774. maximumMass: number;
  34775. /**
  34776. * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  34777. */
  34778. minimumImageSize: Cartesian2;
  34779. /**
  34780. * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  34781. */
  34782. maximumImageSize: Cartesian2;
  34783. /**
  34784. * Gets or sets if the particle size is in meters or pixels. <code>true</code> to size particles in meters; otherwise, the size is in pixels.
  34785. */
  34786. sizeInMeters: boolean;
  34787. /**
  34788. * How long the particle system will emit particles, in seconds.
  34789. */
  34790. lifetime: number;
  34791. /**
  34792. * Fires an event when the particle system has reached the end of its lifetime.
  34793. */
  34794. complete: Event;
  34795. /**
  34796. * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.
  34797. */
  34798. isComplete: boolean;
  34799. /**
  34800. * Returns true if this object was destroyed; otherwise, false.
  34801. * <br /><br />
  34802. * If this object was destroyed, it should not be used; calling any function other than
  34803. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34804. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34805. */
  34806. isDestroyed(): boolean;
  34807. /**
  34808. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34809. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34810. * <br /><br />
  34811. * Once an object is destroyed, it should not be used; calling any function other than
  34812. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34813. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34814. */
  34815. destroy(): void;
  34816. }
  34817. export namespace ParticleSystem {
  34818. /**
  34819. * A function used to modify attributes of the particle at each time step. This can include force modifications,
  34820. * color, sizing, etc.
  34821. * @example
  34822. * function applyGravity(particle, dt) {
  34823. * var position = particle.position;
  34824. * var gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());
  34825. * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);
  34826. * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);
  34827. * }
  34828. * @param particle - The particle being updated.
  34829. * @param dt - The time in seconds since the last update.
  34830. */
  34831. type updateCallback = (particle: Particle, dt: number) => void;
  34832. }
  34833. /**
  34834. * An appearance for {@link GeometryInstance} instances with color attributes.
  34835. * This allows several geometry instances, each with a different color, to
  34836. * be drawn with the same {@link Primitive} as shown in the second example below.
  34837. * @example
  34838. * // A solid white line segment
  34839. * var primitive = new Cesium.Primitive({
  34840. * geometryInstances : new Cesium.GeometryInstance({
  34841. * geometry : new Cesium.SimplePolylineGeometry({
  34842. * positions : Cesium.Cartesian3.fromDegreesArray([
  34843. * 0.0, 0.0,
  34844. * 5.0, 0.0
  34845. * ])
  34846. * }),
  34847. * attributes : {
  34848. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  34849. * }
  34850. * }),
  34851. * appearance : new Cesium.PerInstanceColorAppearance({
  34852. * flat : true,
  34853. * translucent : false
  34854. * })
  34855. * });
  34856. *
  34857. * // Two rectangles in a primitive, each with a different color
  34858. * var instance = new Cesium.GeometryInstance({
  34859. * geometry : new Cesium.RectangleGeometry({
  34860. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)
  34861. * }),
  34862. * attributes : {
  34863. * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)
  34864. * }
  34865. * });
  34866. *
  34867. * var anotherInstance = new Cesium.GeometryInstance({
  34868. * geometry : new Cesium.RectangleGeometry({
  34869. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)
  34870. * }),
  34871. * attributes : {
  34872. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)
  34873. * }
  34874. * });
  34875. *
  34876. * var rectanglePrimitive = new Cesium.Primitive({
  34877. * geometryInstances : [instance, anotherInstance],
  34878. * appearance : new Cesium.PerInstanceColorAppearance()
  34879. * });
  34880. * @param [options] - Object with the following properties:
  34881. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  34882. * @param [options.faceForward = !options.closed] - When <code>true</code>, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like {@link WallGeometry}.
  34883. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  34884. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  34885. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34886. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34887. * @param [options.renderState] - Optional render state to override the default render state.
  34888. */
  34889. export class PerInstanceColorAppearance {
  34890. constructor(options?: {
  34891. flat?: boolean;
  34892. faceForward?: boolean;
  34893. translucent?: boolean;
  34894. closed?: boolean;
  34895. vertexShaderSource?: string;
  34896. fragmentShaderSource?: string;
  34897. renderState?: any;
  34898. });
  34899. /**
  34900. * This property is part of the {@link Appearance} interface, but is not
  34901. * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.
  34902. */
  34903. material: Material;
  34904. /**
  34905. * When <code>true</code>, the geometry is expected to appear translucent so
  34906. * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  34907. */
  34908. translucent: boolean;
  34909. /**
  34910. * The GLSL source code for the vertex shader.
  34911. */
  34912. readonly vertexShaderSource: string;
  34913. /**
  34914. * The GLSL source code for the fragment shader.
  34915. */
  34916. readonly fragmentShaderSource: string;
  34917. /**
  34918. * The WebGL fixed-function state to use when rendering the geometry.
  34919. * <p>
  34920. * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}
  34921. * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}
  34922. * and {@link PerInstanceColorAppearance#closed}.
  34923. * </p>
  34924. */
  34925. readonly renderState: any;
  34926. /**
  34927. * When <code>true</code>, the geometry is expected to be closed so
  34928. * {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  34929. * If the viewer enters the geometry, it will not be visible.
  34930. */
  34931. readonly closed: boolean;
  34932. /**
  34933. * The {@link VertexFormat} that this appearance instance is compatible with.
  34934. * A geometry can have more vertex attributes and still be compatible - at a
  34935. * potential performance cost - but it can't have less.
  34936. */
  34937. readonly vertexFormat: VertexFormat;
  34938. /**
  34939. * When <code>true</code>, flat shading is used in the fragment shader,
  34940. * which means lighting is not taking into account.
  34941. */
  34942. readonly flat: boolean;
  34943. /**
  34944. * When <code>true</code>, the fragment shader flips the surface normal
  34945. * as needed to ensure that the normal faces the viewer to avoid
  34946. * dark spots. This is useful when both sides of a geometry should be
  34947. * shaded like {@link WallGeometry}.
  34948. */
  34949. readonly faceForward: boolean;
  34950. /**
  34951. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  34952. * are compatible with. This requires only <code>position</code> and <code>normal</code>
  34953. * attributes.
  34954. */
  34955. static readonly VERTEX_FORMAT: VertexFormat;
  34956. /**
  34957. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  34958. * are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.
  34959. * This requires only a <code>position</code> attribute.
  34960. */
  34961. static readonly FLAT_VERTEX_FORMAT: VertexFormat;
  34962. /**
  34963. * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance},
  34964. * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},
  34965. * and {@link PerInstanceColorAppearance#faceForward}.
  34966. * @returns The full GLSL fragment shader source.
  34967. */
  34968. getFragmentShaderSource(): string;
  34969. /**
  34970. * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.
  34971. * @returns <code>true</code> if the appearance is translucent.
  34972. */
  34973. isTranslucent(): boolean;
  34974. /**
  34975. * Creates a render state. This is not the final render state instance; instead,
  34976. * it can contain a subset of render state properties identical to the render state
  34977. * created in the context.
  34978. * @returns The render state.
  34979. */
  34980. getRenderState(): any;
  34981. }
  34982. /**
  34983. * Options for performing point attenuation based on geometric error when rendering
  34984. * point clouds using 3D Tiles.
  34985. * @param [options] - Object with the following properties:
  34986. * @param [options.attenuation = false] - Perform point attenuation based on geometric error.
  34987. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error.
  34988. * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.
  34989. * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.
  34990. * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation.
  34991. * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges.
  34992. * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting.
  34993. * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included.
  34994. * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source.
  34995. */
  34996. export class PointCloudShading {
  34997. constructor(options?: {
  34998. attenuation?: boolean;
  34999. geometricErrorScale?: number;
  35000. maximumAttenuation?: number;
  35001. baseResolution?: number;
  35002. eyeDomeLighting?: boolean;
  35003. eyeDomeLightingStrength?: number;
  35004. eyeDomeLightingRadius?: number;
  35005. backFaceCulling?: boolean;
  35006. normalShading?: boolean;
  35007. });
  35008. /**
  35009. * Perform point attenuation based on geometric error.
  35010. */
  35011. attenuation: boolean;
  35012. /**
  35013. * Scale to be applied to the geometric error before computing attenuation.
  35014. */
  35015. geometricErrorScale: number;
  35016. /**
  35017. * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.
  35018. */
  35019. maximumAttenuation: number;
  35020. /**
  35021. * Average base resolution for the dataset in meters.
  35022. * Used in place of geometric error when geometric error is 0.
  35023. * If undefined, an approximation will be computed for each tile that has geometric error of 0.
  35024. */
  35025. baseResolution: number;
  35026. /**
  35027. * Use eye dome lighting when drawing with point attenuation
  35028. * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,
  35029. * otherwise eye dome lighting is ignored.
  35030. */
  35031. eyeDomeLighting: boolean;
  35032. /**
  35033. * Eye dome lighting strength (apparent contrast)
  35034. */
  35035. eyeDomeLightingStrength: number;
  35036. /**
  35037. * Thickness of contours from eye dome lighting
  35038. */
  35039. eyeDomeLightingRadius: number;
  35040. /**
  35041. * Determines whether back-facing points are hidden.
  35042. * This option works only if data has normals included.
  35043. */
  35044. backFaceCulling: boolean;
  35045. /**
  35046. * Determines whether a point cloud that contains normals is shaded by the scene's light source.
  35047. */
  35048. normalShading: boolean;
  35049. /**
  35050. * Determines if point cloud shading is supported.
  35051. * @param scene - The scene.
  35052. * @returns <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>
  35053. */
  35054. static isSupported(scene: Scene): boolean;
  35055. }
  35056. /**
  35057. * A graphical point positioned in the 3D scene, that is created
  35058. * and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial
  35059. * properties are set by calling {@link PointPrimitiveCollection#add}.
  35060. */
  35061. export class PointPrimitive {
  35062. constructor();
  35063. /**
  35064. * Determines if this point will be shown. Use this to hide or show a point, instead
  35065. * of removing it and re-adding it to the collection.
  35066. */
  35067. show: boolean;
  35068. /**
  35069. * Gets or sets the Cartesian position of this point.
  35070. */
  35071. position: Cartesian3;
  35072. /**
  35073. * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.
  35074. * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and
  35075. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  35076. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  35077. * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale
  35078. * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,
  35079. * scaleByDistance will be disabled.
  35080. * @example
  35081. * // Example 1.
  35082. * // Set a pointPrimitive's scaleByDistance to scale to 15 when the
  35083. * // camera is 1500 meters from the pointPrimitive and disappear as
  35084. * // the camera distance approaches 8.0e6 meters.
  35085. * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
  35086. * @example
  35087. * // Example 2.
  35088. * // disable scaling by distance
  35089. * p.scaleByDistance = undefined;
  35090. */
  35091. scaleByDistance: NearFarScalar;
  35092. /**
  35093. * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.
  35094. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  35095. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  35096. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  35097. * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,
  35098. * translucencyByDistance will be disabled.
  35099. * @example
  35100. * // Example 1.
  35101. * // Set a point's translucency to 1.0 when the
  35102. * // camera is 1500 meters from the point and disappear as
  35103. * // the camera distance approaches 8.0e6 meters.
  35104. * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  35105. * @example
  35106. * // Example 2.
  35107. * // disable translucency by distance
  35108. * p.translucencyByDistance = undefined;
  35109. */
  35110. translucencyByDistance: NearFarScalar;
  35111. /**
  35112. * Gets or sets the inner size of the point in pixels.
  35113. */
  35114. pixelSize: number;
  35115. /**
  35116. * Gets or sets the inner color of the point.
  35117. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  35118. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  35119. * (no intensity) to <code>1.0</code> (full intensity).
  35120. * @example
  35121. * // Example 1. Assign yellow.
  35122. * p.color = Cesium.Color.YELLOW;
  35123. * @example
  35124. * // Example 2. Make a pointPrimitive 50% translucent.
  35125. * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  35126. */
  35127. color: Color;
  35128. /**
  35129. * Gets or sets the outline color of the point.
  35130. */
  35131. outlineColor: Color;
  35132. /**
  35133. * Gets or sets the outline width in pixels. This width adds to pixelSize,
  35134. * increasing the total size of the point.
  35135. */
  35136. outlineWidth: number;
  35137. /**
  35138. * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.
  35139. */
  35140. distanceDisplayCondition: DistanceDisplayCondition;
  35141. /**
  35142. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  35143. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  35144. */
  35145. disableDepthTestDistance: number;
  35146. /**
  35147. * Gets or sets the user-defined value returned when the point is picked.
  35148. */
  35149. id: any;
  35150. /**
  35151. * Computes the screen-space position of the point's origin.
  35152. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  35153. * left to right, and <code>y</code> increases from top to bottom.
  35154. * @example
  35155. * console.log(p.computeScreenSpacePosition(scene).toString());
  35156. * @param scene - The scene.
  35157. * @param [result] - The object onto which to store the result.
  35158. * @returns The screen-space position of the point.
  35159. */
  35160. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  35161. /**
  35162. * Determines if this point equals another point. Points are equal if all their properties
  35163. * are equal. Points in different collections can be equal.
  35164. * @param other - The point to compare for equality.
  35165. * @returns <code>true</code> if the points are equal; otherwise, <code>false</code>.
  35166. */
  35167. equals(other: PointPrimitive): boolean;
  35168. }
  35169. /**
  35170. * A renderable collection of points.
  35171. * <br /><br />
  35172. * Points are added and removed from the collection using {@link PointPrimitiveCollection#add}
  35173. * and {@link PointPrimitiveCollection#remove}.
  35174. * @example
  35175. * // Create a pointPrimitive collection with two points
  35176. * var points = scene.primitives.add(new Cesium.PointPrimitiveCollection());
  35177. * points.add({
  35178. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  35179. * color : Cesium.Color.YELLOW
  35180. * });
  35181. * points.add({
  35182. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  35183. * color : Cesium.Color.CYAN
  35184. * });
  35185. * @param [options] - Object with the following properties:
  35186. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates.
  35187. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  35188. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default
  35189. * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,
  35190. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  35191. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  35192. */
  35193. export class PointPrimitiveCollection {
  35194. constructor(options?: {
  35195. modelMatrix?: Matrix4;
  35196. debugShowBoundingVolume?: boolean;
  35197. blendOption?: BlendOption;
  35198. show?: boolean;
  35199. });
  35200. /**
  35201. * Determines if primitives in this collection will be shown.
  35202. */
  35203. show: boolean;
  35204. /**
  35205. * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.
  35206. * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  35207. * Local reference frames can be used by providing a different transformation matrix, like that returned
  35208. * by {@link Transforms.eastNorthUpToFixedFrame}.
  35209. * @example
  35210. * var center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  35211. * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  35212. * pointPrimitives.add({
  35213. * color : Cesium.Color.ORANGE,
  35214. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  35215. * });
  35216. * pointPrimitives.add({
  35217. * color : Cesium.Color.YELLOW,
  35218. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  35219. * });
  35220. * pointPrimitives.add({
  35221. * color : Cesium.Color.GREEN,
  35222. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  35223. * });
  35224. * pointPrimitives.add({
  35225. * color : Cesium.Color.CYAN,
  35226. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  35227. * });
  35228. */
  35229. modelMatrix: Matrix4;
  35230. /**
  35231. * This property is for debugging only; it is not for production use nor is it optimized.
  35232. * <p>
  35233. * Draws the bounding sphere for each draw command in the primitive.
  35234. * </p>
  35235. */
  35236. debugShowBoundingVolume: boolean;
  35237. /**
  35238. * The point blending option. The default is used for rendering both opaque and translucent points.
  35239. * However, if either all of the points are completely opaque or all are completely translucent,
  35240. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  35241. * performance by up to 2x.
  35242. */
  35243. blendOption: BlendOption;
  35244. /**
  35245. * Returns the number of points in this collection. This is commonly used with
  35246. * {@link PointPrimitiveCollection#get} to iterate over all the points
  35247. * in the collection.
  35248. */
  35249. length: number;
  35250. /**
  35251. * Creates and adds a point with the specified initial properties to the collection.
  35252. * The added point is returned so it can be modified or removed from the collection later.
  35253. * @example
  35254. * // Example 1: Add a point, specifying all the default values.
  35255. * var p = pointPrimitives.add({
  35256. * show : true,
  35257. * position : Cesium.Cartesian3.ZERO,
  35258. * pixelSize : 10.0,
  35259. * color : Cesium.Color.WHITE,
  35260. * outlineColor : Cesium.Color.TRANSPARENT,
  35261. * outlineWidth : 0.0,
  35262. * id : undefined
  35263. * });
  35264. * @example
  35265. * // Example 2: Specify only the point's cartographic position.
  35266. * var p = pointPrimitives.add({
  35267. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  35268. * });
  35269. * @param [options] - A template describing the point's properties as shown in Example 1.
  35270. * @returns The point that was added to the collection.
  35271. */
  35272. add(options?: any): PointPrimitive;
  35273. /**
  35274. * Removes a point from the collection.
  35275. * @example
  35276. * var p = pointPrimitives.add(...);
  35277. * pointPrimitives.remove(p); // Returns true
  35278. * @param pointPrimitive - The point to remove.
  35279. * @returns <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.
  35280. */
  35281. remove(pointPrimitive: PointPrimitive): boolean;
  35282. /**
  35283. * Removes all points from the collection.
  35284. * @example
  35285. * pointPrimitives.add(...);
  35286. * pointPrimitives.add(...);
  35287. * pointPrimitives.removeAll();
  35288. */
  35289. removeAll(): void;
  35290. /**
  35291. * Check whether this collection contains a given point.
  35292. * @param [pointPrimitive] - The point to check for.
  35293. * @returns true if this collection contains the point, false otherwise.
  35294. */
  35295. contains(pointPrimitive?: PointPrimitive): boolean;
  35296. /**
  35297. * Returns the point in the collection at the specified index. Indices are zero-based
  35298. * and increase as points are added. Removing a point shifts all points after
  35299. * it to the left, changing their indices. This function is commonly used with
  35300. * {@link PointPrimitiveCollection#length} to iterate over all the points
  35301. * in the collection.
  35302. * @example
  35303. * // Toggle the show property of every point in the collection
  35304. * var len = pointPrimitives.length;
  35305. * for (var i = 0; i < len; ++i) {
  35306. * var p = pointPrimitives.get(i);
  35307. * p.show = !p.show;
  35308. * }
  35309. * @param index - The zero-based index of the point.
  35310. * @returns The point at the specified index.
  35311. */
  35312. get(index: number): PointPrimitive;
  35313. /**
  35314. * Returns true if this object was destroyed; otherwise, false.
  35315. * <br /><br />
  35316. * If this object was destroyed, it should not be used; calling any function other than
  35317. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35318. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35319. */
  35320. isDestroyed(): boolean;
  35321. /**
  35322. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35323. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35324. * <br /><br />
  35325. * Once an object is destroyed, it should not be used; calling any function other than
  35326. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35327. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35328. * @example
  35329. * pointPrimitives = pointPrimitives && pointPrimitives.destroy();
  35330. */
  35331. destroy(): void;
  35332. }
  35333. /**
  35334. * A renderable polyline. Create this by calling {@link PolylineCollection#add}
  35335. * @param options - Object with the following properties:
  35336. * @param [options.show = true] - <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.
  35337. * @param [options.width = 1.0] - The width of the polyline in pixels.
  35338. * @param [options.loop = false] - Whether a line segment will be added between the last and first line positions to make this line a loop.
  35339. * @param [options.material = Material.ColorType] - The material.
  35340. * @param [options.positions] - The positions.
  35341. * @param [options.id] - The user-defined object to be returned when this polyline is picked.
  35342. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this polyline will be displayed.
  35343. * @param polylineCollection - The renderable polyline collection.
  35344. */
  35345. export class Polyline {
  35346. constructor(options: {
  35347. show?: boolean;
  35348. width?: number;
  35349. loop?: boolean;
  35350. material?: Material;
  35351. positions?: Cartesian3[];
  35352. id?: any;
  35353. distanceDisplayCondition?: DistanceDisplayCondition;
  35354. }, polylineCollection: PolylineCollection);
  35355. /**
  35356. * Determines if this polyline will be shown. Use this to hide or show a polyline, instead
  35357. * of removing it and re-adding it to the collection.
  35358. */
  35359. show: boolean;
  35360. /**
  35361. * Gets or sets the positions of the polyline.
  35362. * @example
  35363. * polyline.positions = Cesium.Cartesian3.fromDegreesArray([
  35364. * 0.0, 0.0,
  35365. * 10.0, 0.0,
  35366. * 0.0, 20.0
  35367. * ]);
  35368. */
  35369. positions: Cartesian3[];
  35370. /**
  35371. * Gets or sets the surface appearance of the polyline. This can be one of several built-in {@link Material} objects or a custom material, scripted with
  35372. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  35373. */
  35374. material: Material;
  35375. /**
  35376. * Gets or sets the width of the polyline.
  35377. */
  35378. width: number;
  35379. /**
  35380. * Gets or sets whether a line segment will be added between the first and last polyline positions.
  35381. */
  35382. loop: boolean;
  35383. /**
  35384. * Gets or sets the user-defined value returned when the polyline is picked.
  35385. */
  35386. id: any;
  35387. /**
  35388. * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.
  35389. */
  35390. distanceDisplayCondition: DistanceDisplayCondition;
  35391. }
  35392. /**
  35393. * A renderable collection of polylines.
  35394. * <br /><br />
  35395. * <div align="center">
  35396. * <img src="Images/Polyline.png" width="400" height="300" /><br />
  35397. * Example polylines
  35398. * </div>
  35399. * <br /><br />
  35400. * Polylines are added and removed from the collection using {@link PolylineCollection#add}
  35401. * and {@link PolylineCollection#remove}.
  35402. * @example
  35403. * // Create a polyline collection with two polylines
  35404. * var polylines = new Cesium.PolylineCollection();
  35405. * polylines.add({
  35406. * positions : Cesium.Cartesian3.fromDegreesArray([
  35407. * -75.10, 39.57,
  35408. * -77.02, 38.53,
  35409. * -80.50, 35.14,
  35410. * -80.12, 25.46]),
  35411. * width : 2
  35412. * });
  35413. *
  35414. * polylines.add({
  35415. * positions : Cesium.Cartesian3.fromDegreesArray([
  35416. * -73.10, 37.57,
  35417. * -75.02, 36.53,
  35418. * -78.50, 33.14,
  35419. * -78.12, 23.46]),
  35420. * width : 4
  35421. * });
  35422. * @param [options] - Object with the following properties:
  35423. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates.
  35424. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  35425. * @param [options.show = true] - Determines if the polylines in the collection will be shown.
  35426. */
  35427. export class PolylineCollection {
  35428. constructor(options?: {
  35429. modelMatrix?: Matrix4;
  35430. debugShowBoundingVolume?: boolean;
  35431. show?: boolean;
  35432. });
  35433. /**
  35434. * Determines if polylines in this collection will be shown.
  35435. */
  35436. show: boolean;
  35437. /**
  35438. * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.
  35439. * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  35440. * Local reference frames can be used by providing a different transformation matrix, like that returned
  35441. * by {@link Transforms.eastNorthUpToFixedFrame}.
  35442. */
  35443. modelMatrix: Matrix4;
  35444. /**
  35445. * This property is for debugging only; it is not for production use nor is it optimized.
  35446. * <p>
  35447. * Draws the bounding sphere for each draw command in the primitive.
  35448. * </p>
  35449. */
  35450. debugShowBoundingVolume: boolean;
  35451. /**
  35452. * Returns the number of polylines in this collection. This is commonly used with
  35453. * {@link PolylineCollection#get} to iterate over all the polylines
  35454. * in the collection.
  35455. */
  35456. length: number;
  35457. /**
  35458. * Creates and adds a polyline with the specified initial properties to the collection.
  35459. * The added polyline is returned so it can be modified or removed from the collection later.
  35460. * @example
  35461. * // Example 1: Add a polyline, specifying all the default values.
  35462. * var p = polylines.add({
  35463. * show : true,
  35464. * positions : ellipsoid.cartographicArrayToCartesianArray([
  35465. * Cesium.Cartographic.fromDegrees(-75.10, 39.57),
  35466. * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),
  35467. * width : 1
  35468. * });
  35469. * @param [options] - A template describing the polyline's properties as shown in Example 1.
  35470. * @returns The polyline that was added to the collection.
  35471. */
  35472. add(options?: any): Polyline;
  35473. /**
  35474. * Removes a polyline from the collection.
  35475. * @example
  35476. * var p = polylines.add(...);
  35477. * polylines.remove(p); // Returns true
  35478. * @param polyline - The polyline to remove.
  35479. * @returns <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.
  35480. */
  35481. remove(polyline: Polyline): boolean;
  35482. /**
  35483. * Removes all polylines from the collection.
  35484. * @example
  35485. * polylines.add(...);
  35486. * polylines.add(...);
  35487. * polylines.removeAll();
  35488. */
  35489. removeAll(): void;
  35490. /**
  35491. * Determines if this collection contains the specified polyline.
  35492. * @param polyline - The polyline to check for.
  35493. * @returns true if this collection contains the polyline, false otherwise.
  35494. */
  35495. contains(polyline: Polyline): boolean;
  35496. /**
  35497. * Returns the polyline in the collection at the specified index. Indices are zero-based
  35498. * and increase as polylines are added. Removing a polyline shifts all polylines after
  35499. * it to the left, changing their indices. This function is commonly used with
  35500. * {@link PolylineCollection#length} to iterate over all the polylines
  35501. * in the collection.
  35502. * @example
  35503. * // Toggle the show property of every polyline in the collection
  35504. * var len = polylines.length;
  35505. * for (var i = 0; i < len; ++i) {
  35506. * var p = polylines.get(i);
  35507. * p.show = !p.show;
  35508. * }
  35509. * @param index - The zero-based index of the polyline.
  35510. * @returns The polyline at the specified index.
  35511. */
  35512. get(index: number): Polyline;
  35513. /**
  35514. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  35515. * get the draw commands needed to render this primitive.
  35516. * <p>
  35517. * Do not call this function directly. This is documented just to
  35518. * list the exceptions that may be propagated when the scene is rendered:
  35519. * </p>
  35520. */
  35521. update(): void;
  35522. /**
  35523. * Returns true if this object was destroyed; otherwise, false.
  35524. * <br /><br />
  35525. * If this object was destroyed, it should not be used; calling any function other than
  35526. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35527. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35528. */
  35529. isDestroyed(): boolean;
  35530. /**
  35531. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35532. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35533. * <br /><br />
  35534. * Once an object is destroyed, it should not be used; calling any function other than
  35535. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35536. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35537. * @example
  35538. * polylines = polylines && polylines.destroy();
  35539. */
  35540. destroy(): void;
  35541. }
  35542. /**
  35543. * An appearance for {@link GeometryInstance} instances with color attributes and
  35544. * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.
  35545. * This allows several geometry instances, each with a different color, to
  35546. * be drawn with the same {@link Primitive}.
  35547. * @example
  35548. * // A solid white line segment
  35549. * var primitive = new Cesium.Primitive({
  35550. * geometryInstances : new Cesium.GeometryInstance({
  35551. * geometry : new Cesium.PolylineGeometry({
  35552. * positions : Cesium.Cartesian3.fromDegreesArray([
  35553. * 0.0, 0.0,
  35554. * 5.0, 0.0
  35555. * ]),
  35556. * width : 10.0,
  35557. * vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT
  35558. * }),
  35559. * attributes : {
  35560. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  35561. * }
  35562. * }),
  35563. * appearance : new Cesium.PolylineColorAppearance({
  35564. * translucent : false
  35565. * })
  35566. * });
  35567. * @param [options] - Object with the following properties:
  35568. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  35569. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  35570. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  35571. * @param [options.renderState] - Optional render state to override the default render state.
  35572. */
  35573. export class PolylineColorAppearance {
  35574. constructor(options?: {
  35575. translucent?: boolean;
  35576. vertexShaderSource?: string;
  35577. fragmentShaderSource?: string;
  35578. renderState?: any;
  35579. });
  35580. /**
  35581. * This property is part of the {@link Appearance} interface, but is not
  35582. * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.
  35583. */
  35584. material: Material;
  35585. /**
  35586. * When <code>true</code>, the geometry is expected to appear translucent so
  35587. * {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  35588. */
  35589. translucent: boolean;
  35590. /**
  35591. * The GLSL source code for the vertex shader.
  35592. */
  35593. readonly vertexShaderSource: string;
  35594. /**
  35595. * The GLSL source code for the fragment shader.
  35596. */
  35597. readonly fragmentShaderSource: string;
  35598. /**
  35599. * The WebGL fixed-function state to use when rendering the geometry.
  35600. * <p>
  35601. * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}
  35602. * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.
  35603. * </p>
  35604. */
  35605. readonly renderState: any;
  35606. /**
  35607. * When <code>true</code>, the geometry is expected to be closed so
  35608. * {@link PolylineColorAppearance#renderState} has backface culling enabled.
  35609. * This is always <code>false</code> for <code>PolylineColorAppearance</code>.
  35610. */
  35611. readonly closed: boolean;
  35612. /**
  35613. * The {@link VertexFormat} that this appearance instance is compatible with.
  35614. * A geometry can have more vertex attributes and still be compatible - at a
  35615. * potential performance cost - but it can't have less.
  35616. */
  35617. readonly vertexFormat: VertexFormat;
  35618. /**
  35619. * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances
  35620. * are compatible with. This requires only a <code>position</code> attribute.
  35621. */
  35622. static readonly VERTEX_FORMAT: VertexFormat;
  35623. /**
  35624. * Procedurally creates the full GLSL fragment shader source.
  35625. * @returns The full GLSL fragment shader source.
  35626. */
  35627. getFragmentShaderSource(): string;
  35628. /**
  35629. * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.
  35630. * @returns <code>true</code> if the appearance is translucent.
  35631. */
  35632. isTranslucent(): boolean;
  35633. /**
  35634. * Creates a render state. This is not the final render state instance; instead,
  35635. * it can contain a subset of render state properties identical to the render state
  35636. * created in the context.
  35637. * @returns The render state.
  35638. */
  35639. getRenderState(): any;
  35640. }
  35641. /**
  35642. * An appearance for {@link PolylineGeometry} that supports shading with materials.
  35643. * @example
  35644. * var primitive = new Cesium.Primitive({
  35645. * geometryInstances : new Cesium.GeometryInstance({
  35646. * geometry : new Cesium.PolylineGeometry({
  35647. * positions : Cesium.Cartesian3.fromDegreesArray([
  35648. * 0.0, 0.0,
  35649. * 5.0, 0.0
  35650. * ]),
  35651. * width : 10.0,
  35652. * vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
  35653. * })
  35654. * }),
  35655. * appearance : new Cesium.PolylineMaterialAppearance({
  35656. * material : Cesium.Material.fromType('Color')
  35657. * })
  35658. * });
  35659. * @param [options] - Object with the following properties:
  35660. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  35661. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  35662. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  35663. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  35664. * @param [options.renderState] - Optional render state to override the default render state.
  35665. */
  35666. export class PolylineMaterialAppearance {
  35667. constructor(options?: {
  35668. translucent?: boolean;
  35669. material?: Material;
  35670. vertexShaderSource?: string;
  35671. fragmentShaderSource?: string;
  35672. renderState?: any;
  35673. });
  35674. /**
  35675. * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance}
  35676. * properties, this is not read-only, so an appearance's material can change on the fly.
  35677. */
  35678. material: Material;
  35679. /**
  35680. * When <code>true</code>, the geometry is expected to appear translucent so
  35681. * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  35682. */
  35683. translucent: boolean;
  35684. /**
  35685. * The GLSL source code for the vertex shader.
  35686. */
  35687. readonly vertexShaderSource: string;
  35688. /**
  35689. * The GLSL source code for the fragment shader.
  35690. */
  35691. readonly fragmentShaderSource: string;
  35692. /**
  35693. * The WebGL fixed-function state to use when rendering the geometry.
  35694. * <p>
  35695. * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}
  35696. * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}
  35697. * and {@link PolylineMaterialAppearance#closed}.
  35698. * </p>
  35699. */
  35700. readonly renderState: any;
  35701. /**
  35702. * When <code>true</code>, the geometry is expected to be closed so
  35703. * {@link PolylineMaterialAppearance#renderState} has backface culling enabled.
  35704. * This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.
  35705. */
  35706. readonly closed: boolean;
  35707. /**
  35708. * The {@link VertexFormat} that this appearance instance is compatible with.
  35709. * A geometry can have more vertex attributes and still be compatible - at a
  35710. * potential performance cost - but it can't have less.
  35711. */
  35712. readonly vertexFormat: VertexFormat;
  35713. /**
  35714. * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances
  35715. * are compatible with. This requires <code>position</code> and <code>st</code> attributes.
  35716. */
  35717. static readonly VERTEX_FORMAT: VertexFormat;
  35718. /**
  35719. * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance},
  35720. * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.
  35721. * @returns The full GLSL fragment shader source.
  35722. */
  35723. getFragmentShaderSource(): string;
  35724. /**
  35725. * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.
  35726. * @returns <code>true</code> if the appearance is translucent.
  35727. */
  35728. isTranslucent(): boolean;
  35729. /**
  35730. * Creates a render state. This is not the final render state instance; instead,
  35731. * it can contain a subset of render state properties identical to the render state
  35732. * created in the context.
  35733. * @returns The render state.
  35734. */
  35735. getRenderState(): any;
  35736. }
  35737. /**
  35738. * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.
  35739. * @example
  35740. * // Simple stage to change the color
  35741. * var fs =
  35742. * 'uniform sampler2D colorTexture;\n' +
  35743. * 'varying vec2 v_textureCoordinates;\n' +
  35744. * 'uniform float scale;\n' +
  35745. * 'uniform vec3 offset;\n' +
  35746. * 'void main() {\n' +
  35747. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  35748. * ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' +
  35749. * '}\n';
  35750. * scene.postProcessStages.add(new Cesium.PostProcessStage({
  35751. * fragmentShader : fs,
  35752. * uniforms : {
  35753. * scale : 1.1,
  35754. * offset : function() {
  35755. * return new Cesium.Cartesian3(0.1, 0.2, 0.3);
  35756. * }
  35757. * }
  35758. * }));
  35759. * @example
  35760. * // Simple stage to change the color of what is selected.
  35761. * // If czm_selected returns true, the current fragment belongs to geometry in the selected array.
  35762. * var fs =
  35763. * 'uniform sampler2D colorTexture;\n' +
  35764. * 'varying vec2 v_textureCoordinates;\n' +
  35765. * 'uniform vec4 highlight;\n' +
  35766. * 'void main() {\n' +
  35767. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  35768. * ' if (czm_selected()) {\n' +
  35769. * ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' +
  35770. * ' gl_FragColor = vec4(highlighted, 1.0);\n' +
  35771. * ' } else { \n' +
  35772. * ' gl_FragColor = color;\n' +
  35773. * ' }\n' +
  35774. * '}\n';
  35775. * var stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
  35776. * fragmentShader : fs,
  35777. * uniforms : {
  35778. * highlight : function() {
  35779. * return new Cesium.Color(1.0, 0.0, 0.0, 0.5);
  35780. * }
  35781. * }
  35782. * }));
  35783. * stage.selected = [cesium3DTileFeature];
  35784. * @param options - An object with the following properties:
  35785. * @param options.fragmentShader - The fragment shader to use. The default <code>sampler2D</code> uniforms are <code>colorTexture</code> and <code>depthTexture</code>. The color texture is the output of rendering the scene or the previous stage. The depth texture is the output from rendering the scene. The shader should contain one or both uniforms. There is also a <code>vec2</code> varying named <code>v_textureCoordinates</code> that can be used to sample the textures.
  35786. * @param [options.uniforms] - An object whose properties will be used to set the shaders uniforms. The properties can be constant values or a function. A constant value can also be a URI, data URI, or HTML element to use as a texture.
  35787. * @param [options.textureScale = 1.0] - A number in the range (0.0, 1.0] used to scale the texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport.
  35788. * @param [options.forcePowerOfTwo = false] - Whether or not to force the texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions.
  35789. * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture.
  35790. * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture.
  35791. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture.
  35792. * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to.
  35793. * @param [options.scissorRectangle] - The rectangle to use for the scissor test.
  35794. * @param [options.name = createGuid()] - The unique name of this post-process stage for reference by other stages in a composite. If a name is not supplied, a GUID will be generated.
  35795. */
  35796. export class PostProcessStage {
  35797. constructor(options: {
  35798. fragmentShader: string;
  35799. uniforms?: any;
  35800. textureScale?: number;
  35801. forcePowerOfTwo?: boolean;
  35802. sampleMode?: PostProcessStageSampleMode;
  35803. pixelFormat?: PixelFormat;
  35804. pixelDatatype?: PixelDatatype;
  35805. clearColor?: Color;
  35806. scissorRectangle?: BoundingRectangle;
  35807. name?: string;
  35808. });
  35809. /**
  35810. * Whether or not to execute this post-process stage when ready.
  35811. */
  35812. enabled: boolean;
  35813. /**
  35814. * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>
  35815. * and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures
  35816. * to load.
  35817. */
  35818. readonly ready: boolean;
  35819. /**
  35820. * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.
  35821. */
  35822. readonly name: string;
  35823. /**
  35824. * The fragment shader to use when execute this post-process stage.
  35825. * <p>
  35826. * The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,
  35827. * or both.
  35828. * </p>
  35829. * <p>
  35830. * The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling
  35831. * the texture uniforms.
  35832. * </p>
  35833. */
  35834. readonly fragmentShader: string;
  35835. /**
  35836. * An object whose properties are used to set the uniforms of the fragment shader.
  35837. * <p>
  35838. * The object property values can be either a constant or a function. The function will be called
  35839. * each frame before the post-process stage is executed.
  35840. * </p>
  35841. * <p>
  35842. * A constant value can also be a URI to an image, a data URI, or an HTML element that can be used as a texture, such as HTMLImageElement or HTMLCanvasElement.
  35843. * </p>
  35844. * <p>
  35845. * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be
  35846. * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.
  35847. * </p>
  35848. */
  35849. readonly uniforms: any;
  35850. /**
  35851. * A number in the range (0.0, 1.0] used to scale the output texture dimensions. A scale of 1.0 will render this post-process stage to a texture the size of the viewport.
  35852. */
  35853. readonly textureScale: number;
  35854. /**
  35855. * Whether or not to force the output texture dimensions to be both equal powers of two. The power of two will be the next power of two of the minimum of the dimensions.
  35856. */
  35857. readonly forcePowerOfTwo: number;
  35858. /**
  35859. * How to sample the input color texture.
  35860. */
  35861. readonly sampleMode: PostProcessStageSampleMode;
  35862. /**
  35863. * The color pixel format of the output texture.
  35864. */
  35865. readonly pixelFormat: PixelFormat;
  35866. /**
  35867. * The pixel data type of the output texture.
  35868. */
  35869. readonly pixelDatatype: PixelDatatype;
  35870. /**
  35871. * The color to clear the output texture to.
  35872. */
  35873. readonly clearColor: Color;
  35874. /**
  35875. * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.
  35876. */
  35877. readonly scissorRectangle: BoundingRectangle;
  35878. /**
  35879. * The features selected for applying the post-process.
  35880. * <p>
  35881. * In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process
  35882. * stage to that fragment. For example:
  35883. * <code>
  35884. * if (czm_selected(v_textureCoordinates)) {
  35885. * // apply post-process stage
  35886. * } else {
  35887. * gl_FragColor = texture2D(colorTexture, v_textureCordinates);
  35888. * }
  35889. * </code>
  35890. * </p>
  35891. */
  35892. selected: any[];
  35893. /**
  35894. * Returns true if this object was destroyed; otherwise, false.
  35895. * <p>
  35896. * If this object was destroyed, it should not be used; calling any function other than
  35897. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35898. * </p>
  35899. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35900. */
  35901. isDestroyed(): boolean;
  35902. /**
  35903. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35904. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35905. * <p>
  35906. * Once an object is destroyed, it should not be used; calling any function other than
  35907. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35908. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35909. * </p>
  35910. */
  35911. destroy(): void;
  35912. }
  35913. /**
  35914. * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.
  35915. * <p>
  35916. * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered
  35917. * to by the previous stage in the collection.
  35918. * </p>
  35919. * <p>
  35920. * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.
  35921. * </p>
  35922. * <p>
  35923. * If the FXAA stage is enabled, it will execute after all other stages.
  35924. * </p>
  35925. */
  35926. export class PostProcessStageCollection {
  35927. constructor();
  35928. /**
  35929. * Determines if all of the post-process stages in the collection are ready to be executed.
  35930. */
  35931. readonly ready: boolean;
  35932. /**
  35933. * A post-process stage for Fast Approximate Anti-aliasing.
  35934. * <p>
  35935. * When enabled, this stage will execute after all others.
  35936. * </p>
  35937. */
  35938. readonly fxaa: PostProcessStage;
  35939. /**
  35940. * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.
  35941. * <p>
  35942. * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the
  35943. * surface receives light and regardless of the light's position.
  35944. * </p>
  35945. * <p>
  35946. * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,
  35947. * <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,
  35948. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
  35949. * </p>
  35950. * <ul>
  35951. * <li><code>intensity</code> is a scalar value used to lighten or darken the shadows exponentially. Higher values make the shadows darker. The default value is <code>3.0</code>.</li>
  35952. *
  35953. * <li><code>bias</code> is a scalar value representing an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value,
  35954. * sampling stops in the current direction. This is used to remove shadows from near planar edges. The default value is <code>0.1</code>.</li>
  35955. *
  35956. * <li><code>lengthCap</code> is a scalar value representing a length in meters. If the distance from the current sample to first sample is greater than this value,
  35957. * sampling stops in the current direction. The default value is <code>0.26</code>.</li>
  35958. *
  35959. * <li><code>stepSize</code> is a scalar value indicating the distance to the next texel sample in the current direction. The default value is <code>1.95</code>.</li>
  35960. *
  35961. * <li><code>frustumLength</code> is a scalar value in meters. If the current fragment has a distance from the camera greater than this value, ambient occlusion is not computed for the fragment.
  35962. * The default value is <code>1000.0</code>.</li>
  35963. *
  35964. * <li><code>ambientOcclusionOnly</code> is a boolean value. When <code>true</code>, only the shadows generated are written to the output. When <code>false</code>, the input texture is modulated
  35965. * with the ambient occlusion. This is a useful debug option for seeing the effects of changing the uniform values. The default value is <code>false</code>.</li>
  35966. * </ul>
  35967. * <p>
  35968. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35969. * The blur is applied to the shadows generated from the image to make them smoother.
  35970. * </p>
  35971. * <p>
  35972. * When enabled, this stage will execute before all others.
  35973. * </p>
  35974. */
  35975. readonly ambientOcclusion: PostProcessStageComposite;
  35976. /**
  35977. * A post-process stage for a bloom effect.
  35978. * <p>
  35979. * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.
  35980. * </p>
  35981. * <p>
  35982. * This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,
  35983. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  35984. * </p>
  35985. * <ul>
  35986. * <li><code>contrast</code> is a scalar value in the range [-255.0, 255.0] and affects the contract of the effect. The default value is <code>128.0</code>.</li>
  35987. *
  35988. * <li><code>brightness</code> is a scalar value. The input texture RGB value is converted to hue, saturation, and brightness (HSB) then this value is
  35989. * added to the brightness. The default value is <code>-0.3</code>.</li>
  35990. *
  35991. * <li><code>glowOnly</code> is a boolean value. When <code>true</code>, only the glow effect will be shown. When <code>false</code>, the glow will be added to the input texture.
  35992. * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>
  35993. * </ul>
  35994. * <p>
  35995. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  35996. * The blur is applied to the shadows generated from the image to make them smoother.
  35997. * </p>
  35998. * <p>
  35999. * When enabled, this stage will execute before all others.
  36000. * </p>
  36001. */
  36002. readonly bloom: PostProcessStageComposite;
  36003. /**
  36004. * The number of post-process stages in this collection.
  36005. */
  36006. readonly length: number;
  36007. /**
  36008. * Adds the post-process stage to the collection.
  36009. * @param stage - The post-process stage to add to the collection.
  36010. * @returns The post-process stage that was added to the collection.
  36011. */
  36012. add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite;
  36013. /**
  36014. * Removes a post-process stage from the collection and destroys it.
  36015. * @param stage - The post-process stage to remove from the collection.
  36016. * @returns Whether the post-process stage was removed.
  36017. */
  36018. remove(stage: PostProcessStage | PostProcessStageComposite): boolean;
  36019. /**
  36020. * Returns whether the collection contains a post-process stage.
  36021. * @param stage - The post-process stage.
  36022. * @returns Whether the collection contains the post-process stage.
  36023. */
  36024. contains(stage: PostProcessStage | PostProcessStageComposite): boolean;
  36025. /**
  36026. * Gets the post-process stage at <code>index</code>.
  36027. * @param index - The index of the post-process stage.
  36028. * @returns The post-process stage at index.
  36029. */
  36030. get(index: number): PostProcessStage | PostProcessStageComposite;
  36031. /**
  36032. * Removes all post-process stages from the collection and destroys them.
  36033. */
  36034. removeAll(): void;
  36035. /**
  36036. * Returns true if this object was destroyed; otherwise, false.
  36037. * <p>
  36038. * If this object was destroyed, it should not be used; calling any function other than
  36039. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36040. * </p>
  36041. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36042. */
  36043. isDestroyed(): boolean;
  36044. /**
  36045. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36046. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36047. * <p>
  36048. * Once an object is destroyed, it should not be used; calling any function other than
  36049. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36050. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36051. * </p>
  36052. */
  36053. destroy(): void;
  36054. }
  36055. /**
  36056. * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.
  36057. * <p>
  36058. * All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  36059. * If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it.
  36060. * If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene
  36061. * or the output texture of the previous stage.
  36062. * </p>
  36063. * @example
  36064. * // Example 1: separable blur filter
  36065. * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.
  36066. * // The input to blurYDirection is the texture rendered to by blurXDirection.
  36067. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  36068. * stages : [blurXDirection, blurYDirection]
  36069. * }));
  36070. * @example
  36071. * // Example 2: referencing the output of another post-process stage
  36072. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  36073. * inputPreviousStageTexture : false,
  36074. * stages : [
  36075. * // The same as Example 1.
  36076. * new Cesium.PostProcessStageComposite({
  36077. * inputPreviousStageTexture : true
  36078. * stages : [blurXDirection, blurYDirection],
  36079. * name : 'blur'
  36080. * }),
  36081. * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false
  36082. * new Cesium.PostProcessStage({
  36083. * fragmentShader : compositeShader,
  36084. * uniforms : {
  36085. * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).
  36086. * }
  36087. * })
  36088. * ]
  36089. * });
  36090. * @example
  36091. * // Example 3: create a uniform alias
  36092. * var uniforms = {};
  36093. * Cesium.defineProperties(uniforms, {
  36094. * filterSize : {
  36095. * get : function() {
  36096. * return blurXDirection.uniforms.filterSize;
  36097. * },
  36098. * set : function(value) {
  36099. * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;
  36100. * }
  36101. * }
  36102. * });
  36103. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  36104. * stages : [blurXDirection, blurYDirection],
  36105. * uniforms : uniforms
  36106. * }));
  36107. * @param options - An object with the following properties:
  36108. * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order.
  36109. * @param [options.inputPreviousStageTexture = true] - Whether to execute each post-process stage where the input to one stage is the output of the previous. Otherwise, the input to each contained stage is the output of the stage that executed before the composite.
  36110. * @param [options.name = createGuid()] - The unique name of this post-process stage for reference by other composites. If a name is not supplied, a GUID will be generated.
  36111. * @param [options.uniforms] - An alias to the uniforms of post-process stages.
  36112. */
  36113. export class PostProcessStageComposite {
  36114. constructor(options: {
  36115. stages: any[];
  36116. inputPreviousStageTexture?: boolean;
  36117. name?: string;
  36118. uniforms?: any;
  36119. });
  36120. /**
  36121. * Determines if this post-process stage is ready to be executed.
  36122. */
  36123. readonly ready: boolean;
  36124. /**
  36125. * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.
  36126. */
  36127. readonly name: string;
  36128. /**
  36129. * Whether or not to execute this post-process stage when ready.
  36130. */
  36131. enabled: boolean;
  36132. /**
  36133. * An alias to the uniform values of the post-process stages. May be <code>undefined</code>; in which case, get each stage to set uniform values.
  36134. */
  36135. uniforms: any;
  36136. /**
  36137. * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  36138. * If <code>inputPreviousStageTexture</code> is <code>true</code>, the input to each stage is the output texture rendered to by the scene or of the stage that executed before it.
  36139. * If <code>inputPreviousStageTexture</code> is <code>false</code>, the input texture is the same for each stage in the composite. The input texture is the texture rendered to by the scene
  36140. * or the output texture of the previous stage.
  36141. */
  36142. readonly inputPreviousStageTexture: boolean;
  36143. /**
  36144. * The number of post-process stages in this composite.
  36145. */
  36146. readonly length: number;
  36147. /**
  36148. * The features selected for applying the post-process.
  36149. */
  36150. selected: any[];
  36151. /**
  36152. * Gets the post-process stage at <code>index</code>
  36153. * @param index - The index of the post-process stage or composite.
  36154. * @returns The post-process stage or composite at index.
  36155. */
  36156. get(index: number): PostProcessStage | PostProcessStageComposite;
  36157. /**
  36158. * Returns true if this object was destroyed; otherwise, false.
  36159. * <p>
  36160. * If this object was destroyed, it should not be used; calling any function other than
  36161. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36162. * </p>
  36163. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36164. */
  36165. isDestroyed(): boolean;
  36166. /**
  36167. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36168. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36169. * <p>
  36170. * Once an object is destroyed, it should not be used; calling any function other than
  36171. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36172. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36173. * </p>
  36174. */
  36175. destroy(): void;
  36176. }
  36177. /**
  36178. * Contains functions for creating common post-process stages.
  36179. */
  36180. export namespace PostProcessStageLibrary {
  36181. /**
  36182. * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.
  36183. * <p>
  36184. * This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  36185. * </p>
  36186. * <p>
  36187. * <code>delta</code> and <code>sigma</code> are used to compute the weights of a Gaussian filter. The equation is <code>exp((-0.5 * delta * delta) / (sigma * sigma))</code>.
  36188. * The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.
  36189. * <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.
  36190. * </p>
  36191. * @returns A post-process stage that applies a Gaussian blur to the input texture.
  36192. */
  36193. function createBlurStage(): PostProcessStageComposite;
  36194. /**
  36195. * Creates a post-process stage that applies a depth of field effect.
  36196. * <p>
  36197. * Depth of field simulates camera focus. Objects in the scene that are in focus
  36198. * will be clear whereas objects not in focus will be blurred.
  36199. * </p>
  36200. * <p>
  36201. * This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  36202. * </p>
  36203. * <p>
  36204. * <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.
  36205. * </p>
  36206. * <p>
  36207. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  36208. * The blur is applied to the areas out of focus.
  36209. * </p>
  36210. * @returns A post-process stage that applies a depth of field effect.
  36211. */
  36212. function createDepthOfFieldStage(): PostProcessStageComposite;
  36213. /**
  36214. * Whether or not a depth of field stage is supported.
  36215. * <p>
  36216. * This stage requires the WEBGL_depth_texture extension.
  36217. * </p>
  36218. * @param scene - The scene.
  36219. * @returns Whether this post process stage is supported.
  36220. */
  36221. function isDepthOfFieldSupported(scene: Scene): boolean;
  36222. /**
  36223. * Creates a post-process stage that detects edges.
  36224. * <p>
  36225. * Writes the color to the output texture with alpha set to 1.0 when it is on an edge.
  36226. * </p>
  36227. * <p>
  36228. * This stage has the following uniforms: <code>color</code> and <code>length</code>
  36229. * </p>
  36230. * <ul>
  36231. * <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>
  36232. * <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>
  36233. * </ul>
  36234. * <p>
  36235. * This stage is not supported in 2D.
  36236. * </p>
  36237. * @example
  36238. * // multiple silhouette effects
  36239. * var yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  36240. * yellowEdge.uniforms.color = Cesium.Color.YELLOW;
  36241. * yellowEdge.selected = [feature0];
  36242. *
  36243. * var greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  36244. * greenEdge.uniforms.color = Cesium.Color.LIME;
  36245. * greenEdge.selected = [feature1];
  36246. *
  36247. * // draw edges around feature0 and feature1
  36248. * postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
  36249. * @returns A post-process stage that applies an edge detection effect.
  36250. */
  36251. function createEdgeDetectionStage(): PostProcessStage;
  36252. /**
  36253. * Whether or not an edge detection stage is supported.
  36254. * <p>
  36255. * This stage requires the WEBGL_depth_texture extension.
  36256. * </p>
  36257. * @param scene - The scene.
  36258. * @returns Whether this post process stage is supported.
  36259. */
  36260. function isEdgeDetectionSupported(scene: Scene): boolean;
  36261. /**
  36262. * Creates a post-process stage that applies a silhouette effect.
  36263. * <p>
  36264. * A silhouette effect composites the color from the edge detection pass with input color texture.
  36265. * </p>
  36266. * <p>
  36267. * This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>
  36268. * </p>
  36269. * <p>
  36270. * <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.
  36271. * <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.
  36272. * </p>
  36273. * @param [edgeDetectionStages] - An array of edge detection post process stages.
  36274. * @returns A post-process stage that applies a silhouette effect.
  36275. */
  36276. function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite;
  36277. /**
  36278. * Whether or not a silhouette stage is supported.
  36279. * <p>
  36280. * This stage requires the WEBGL_depth_texture extension.
  36281. * </p>
  36282. * @param scene - The scene.
  36283. * @returns Whether this post process stage is supported.
  36284. */
  36285. function isSilhouetteSupported(scene: Scene): boolean;
  36286. /**
  36287. * Whether or not an ambient occlusion stage is supported.
  36288. * <p>
  36289. * This stage requires the WEBGL_depth_texture extension.
  36290. * </p>
  36291. * @param scene - The scene.
  36292. * @returns Whether this post process stage is supported.
  36293. */
  36294. function isAmbientOcclusionSupported(scene: Scene): boolean;
  36295. /**
  36296. * Creates a post-process stage that renders the input texture with black and white gradations.
  36297. * <p>
  36298. * This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.
  36299. * </p>
  36300. * @returns A post-process stage that renders the input texture with black and white gradations.
  36301. */
  36302. function createBlackAndWhiteStage(): PostProcessStage;
  36303. /**
  36304. * Creates a post-process stage that saturates the input texture.
  36305. * <p>
  36306. * This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.
  36307. * </p>
  36308. * @returns A post-process stage that saturates the input texture.
  36309. */
  36310. function createBrightnessStage(): PostProcessStage;
  36311. /**
  36312. * Creates a post-process stage that adds a night vision effect to the input texture.
  36313. * @returns A post-process stage that adds a night vision effect to the input texture.
  36314. */
  36315. function createNightVisionStage(): PostProcessStage;
  36316. /**
  36317. * Creates a post-process stage that applies an effect simulating light flaring a camera lens.
  36318. * <p>
  36319. * This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,
  36320. * <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.
  36321. * <ul>
  36322. * <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>
  36323. * <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>
  36324. * <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>
  36325. * <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>
  36326. * <li><code>ghostDispersal</code> is a scalar indicating how far the halo effect is from the center of the texture. The default value is <code>0.4</code>.</li>
  36327. * <li><code>haloWidth</code> is a scalar representing the width of the halo from the ghost dispersal. The default value is <code>0.4</code>.</li>
  36328. * <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>
  36329. * <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>
  36330. * </ul>
  36331. * </p>
  36332. * @returns A post-process stage for applying a lens flare effect.
  36333. */
  36334. function createLensFlareStage(): PostProcessStage;
  36335. }
  36336. /**
  36337. * Determines how input texture to a {@link PostProcessStage} is sampled.
  36338. */
  36339. export enum PostProcessStageSampleMode {
  36340. /**
  36341. * Samples the texture by returning the closest texel.
  36342. */
  36343. NEAREST = 0,
  36344. /**
  36345. * Samples the texture through bi-linear interpolation of the four nearest texels.
  36346. */
  36347. LINEAR = 1
  36348. }
  36349. /**
  36350. * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance}
  36351. * as shown in example 1 below, or from an array of instances, even if the geometry is from different
  36352. * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.
  36353. * <p>
  36354. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  36355. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  36356. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  36357. * and match most of them and add a new geometry or appearance independently of each other.
  36358. * </p>
  36359. * <p>
  36360. * Combining multiple instances into one primitive is called batching, and significantly improves performance for static data.
  36361. * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using
  36362. * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.
  36363. * </p>
  36364. * <p>
  36365. * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples
  36366. * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example
  36367. * shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.
  36368. * </p>
  36369. * @example
  36370. * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern
  36371. * var instance = new Cesium.GeometryInstance({
  36372. * geometry : new Cesium.EllipseGeometry({
  36373. * center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),
  36374. * semiMinorAxis : 500000.0,
  36375. * semiMajorAxis : 1000000.0,
  36376. * rotation : Cesium.Math.PI_OVER_FOUR,
  36377. * vertexFormat : Cesium.VertexFormat.POSITION_AND_ST
  36378. * }),
  36379. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  36380. * });
  36381. * scene.primitives.add(new Cesium.Primitive({
  36382. * geometryInstances : instance,
  36383. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  36384. * material : Cesium.Material.fromType('Checkerboard')
  36385. * })
  36386. * }));
  36387. * @example
  36388. * // 2. Draw different instances each with a unique color
  36389. * var rectangleInstance = new Cesium.GeometryInstance({
  36390. * geometry : new Cesium.RectangleGeometry({
  36391. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),
  36392. * vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
  36393. * }),
  36394. * id : 'rectangle',
  36395. * attributes : {
  36396. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  36397. * }
  36398. * });
  36399. * var ellipsoidInstance = new Cesium.GeometryInstance({
  36400. * geometry : new Cesium.EllipsoidGeometry({
  36401. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  36402. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  36403. * }),
  36404. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  36405. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  36406. * id : 'ellipsoid',
  36407. * attributes : {
  36408. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  36409. * }
  36410. * });
  36411. * scene.primitives.add(new Cesium.Primitive({
  36412. * geometryInstances : [rectangleInstance, ellipsoidInstance],
  36413. * appearance : new Cesium.PerInstanceColorAppearance()
  36414. * }));
  36415. * @example
  36416. * // 3. Create the geometry on the main thread.
  36417. * scene.primitives.add(new Cesium.Primitive({
  36418. * geometryInstances : new Cesium.GeometryInstance({
  36419. * geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({
  36420. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  36421. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  36422. * })),
  36423. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  36424. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  36425. * id : 'ellipsoid',
  36426. * attributes : {
  36427. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  36428. * }
  36429. * }),
  36430. * appearance : new Cesium.PerInstanceColorAppearance(),
  36431. * asynchronous : false
  36432. * }));
  36433. * @param [options] - Object with the following properties:
  36434. * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render.
  36435. * @param [options.appearance] - The appearance used to render the primitive.
  36436. * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test.
  36437. * @param [options.show = true] - Determines if this primitive will be shown.
  36438. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  36439. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  36440. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  36441. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  36442. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  36443. * @param [options.allowPicking = true] - When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  36444. * @param [options.cull = true] - When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands based on their bounding volume. Set this to <code>false</code> for a small performance gain if you are manually culling the primitive.
  36445. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready.
  36446. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  36447. * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources.
  36448. */
  36449. export class Primitive {
  36450. constructor(options?: {
  36451. geometryInstances?: GeometryInstance[] | GeometryInstance;
  36452. appearance?: Appearance;
  36453. depthFailAppearance?: Appearance;
  36454. show?: boolean;
  36455. modelMatrix?: Matrix4;
  36456. vertexCacheOptimize?: boolean;
  36457. interleave?: boolean;
  36458. compressVertices?: boolean;
  36459. releaseGeometryInstances?: boolean;
  36460. allowPicking?: boolean;
  36461. cull?: boolean;
  36462. asynchronous?: boolean;
  36463. debugShowBoundingVolume?: boolean;
  36464. shadows?: ShadowMode;
  36465. });
  36466. /**
  36467. * The geometry instances rendered with this primitive. This may
  36468. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  36469. * is <code>true</code> when the primitive is constructed.
  36470. * <p>
  36471. * Changing this property after the primitive is rendered has no effect.
  36472. * </p>
  36473. */
  36474. readonly geometryInstances: GeometryInstance[] | GeometryInstance;
  36475. /**
  36476. * The {@link Appearance} used to shade this primitive. Each geometry
  36477. * instance is shaded with the same appearance. Some appearances, like
  36478. * {@link PerInstanceColorAppearance} allow giving each instance unique
  36479. * properties.
  36480. */
  36481. appearance: Appearance;
  36482. /**
  36483. * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry
  36484. * instance is shaded with the same appearance. Some appearances, like
  36485. * {@link PerInstanceColorAppearance} allow giving each instance unique
  36486. * properties.
  36487. *
  36488. * <p>
  36489. * When using an appearance that requires a color attribute, like PerInstanceColorAppearance,
  36490. * add a depthFailColor per-instance attribute instead.
  36491. * </p>
  36492. *
  36493. * <p>
  36494. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  36495. * there may be artifacts.
  36496. * </p>
  36497. */
  36498. depthFailAppearance: Appearance;
  36499. /**
  36500. * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  36501. * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  36502. * Local reference frames can be used by providing a different transformation matrix, like that returned
  36503. * by {@link Transforms.eastNorthUpToFixedFrame}.
  36504. *
  36505. * <p>
  36506. * This property is only supported in 3D mode.
  36507. * </p>
  36508. * @example
  36509. * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  36510. * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  36511. */
  36512. modelMatrix: Matrix4;
  36513. /**
  36514. * Determines if the primitive will be shown. This affects all geometry
  36515. * instances in the primitive.
  36516. */
  36517. show: boolean;
  36518. /**
  36519. * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands
  36520. * based on their bounding volume. Set this to <code>false</code> for a small performance gain
  36521. * if you are manually culling the primitive.
  36522. */
  36523. cull: boolean;
  36524. /**
  36525. * This property is for debugging only; it is not for production use nor is it optimized.
  36526. * <p>
  36527. * Draws the bounding sphere for each draw command in the primitive.
  36528. * </p>
  36529. */
  36530. debugShowBoundingVolume: boolean;
  36531. /**
  36532. * Determines whether this primitive casts or receives shadows from light sources.
  36533. */
  36534. shadows: ShadowMode;
  36535. /**
  36536. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  36537. */
  36538. readonly vertexCacheOptimize: boolean;
  36539. /**
  36540. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  36541. */
  36542. readonly interleave: boolean;
  36543. /**
  36544. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  36545. */
  36546. readonly releaseGeometryInstances: boolean;
  36547. /**
  36548. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. *
  36549. */
  36550. readonly allowPicking: boolean;
  36551. /**
  36552. * Determines if the geometry instances will be created and batched on a web worker.
  36553. */
  36554. readonly asynchronous: boolean;
  36555. /**
  36556. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  36557. */
  36558. readonly compressVertices: boolean;
  36559. /**
  36560. * Determines if the primitive is complete and ready to render. If this property is
  36561. * true, the primitive will be rendered the next time that {@link Primitive#update}
  36562. * is called.
  36563. */
  36564. readonly ready: boolean;
  36565. /**
  36566. * Gets a promise that resolves when the primitive is ready to render.
  36567. */
  36568. readonly readyPromise: Promise<Primitive>;
  36569. /**
  36570. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  36571. * get the draw commands needed to render this primitive.
  36572. * <p>
  36573. * Do not call this function directly. This is documented just to
  36574. * list the exceptions that may be propagated when the scene is rendered:
  36575. * </p>
  36576. */
  36577. update(): void;
  36578. /**
  36579. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  36580. * @example
  36581. * var attributes = primitive.getGeometryInstanceAttributes('an id');
  36582. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  36583. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  36584. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);
  36585. * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);
  36586. * @param id - The id of the {@link GeometryInstance}.
  36587. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  36588. */
  36589. getGeometryInstanceAttributes(id: any): any;
  36590. /**
  36591. * Returns true if this object was destroyed; otherwise, false.
  36592. * <p>
  36593. * If this object was destroyed, it should not be used; calling any function other than
  36594. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36595. * </p>
  36596. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36597. */
  36598. isDestroyed(): boolean;
  36599. /**
  36600. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36601. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36602. * <p>
  36603. * Once an object is destroyed, it should not be used; calling any function other than
  36604. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36605. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36606. * </p>
  36607. * @example
  36608. * e = e && e.destroy();
  36609. */
  36610. destroy(): void;
  36611. }
  36612. /**
  36613. * A collection of primitives. This is most often used with {@link Scene#primitives},
  36614. * but <code>PrimitiveCollection</code> is also a primitive itself so collections can
  36615. * be added to collections forming a hierarchy.
  36616. * @example
  36617. * var billboards = new Cesium.BillboardCollection();
  36618. * var labels = new Cesium.LabelCollection();
  36619. *
  36620. * var collection = new Cesium.PrimitiveCollection();
  36621. * collection.add(billboards);
  36622. *
  36623. * scene.primitives.add(collection); // Add collection
  36624. * scene.primitives.add(labels); // Add regular primitive
  36625. * @param [options] - Object with the following properties:
  36626. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  36627. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed.
  36628. */
  36629. export class PrimitiveCollection {
  36630. constructor(options?: {
  36631. show?: boolean;
  36632. destroyPrimitives?: boolean;
  36633. });
  36634. /**
  36635. * Determines if primitives in this collection will be shown.
  36636. */
  36637. show: boolean;
  36638. /**
  36639. * Determines if primitives in the collection are destroyed when they are removed by
  36640. * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly
  36641. * by {@link PrimitiveCollection#removeAll}.
  36642. * @example
  36643. * // Example 1. Primitives are destroyed by default.
  36644. * var primitives = new Cesium.PrimitiveCollection();
  36645. * var labels = primitives.add(new Cesium.LabelCollection());
  36646. * primitives = primitives.destroy();
  36647. * var b = labels.isDestroyed(); // true
  36648. * @example
  36649. * // Example 2. Do not destroy primitives in a collection.
  36650. * var primitives = new Cesium.PrimitiveCollection();
  36651. * primitives.destroyPrimitives = false;
  36652. * var labels = primitives.add(new Cesium.LabelCollection());
  36653. * primitives = primitives.destroy();
  36654. * var b = labels.isDestroyed(); // false
  36655. * labels = labels.destroy(); // explicitly destroy
  36656. */
  36657. destroyPrimitives: boolean;
  36658. /**
  36659. * Gets the number of primitives in the collection.
  36660. */
  36661. readonly length: number;
  36662. /**
  36663. * Adds a primitive to the collection.
  36664. * @example
  36665. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  36666. * @param primitive - The primitive to add.
  36667. * @param [index] - The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives.
  36668. * @returns The primitive added to the collection.
  36669. */
  36670. add(primitive: any, index?: number): any;
  36671. /**
  36672. * Removes a primitive from the collection.
  36673. * @example
  36674. * var billboards = scene.primitives.add(new Cesium.BillboardCollection());
  36675. * scene.primitives.remove(billboards); // Returns true
  36676. * @param [primitive] - The primitive to remove.
  36677. * @returns <code>true</code> if the primitive was removed; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.
  36678. */
  36679. remove(primitive?: any): boolean;
  36680. /**
  36681. * Removes all primitives in the collection.
  36682. */
  36683. removeAll(): void;
  36684. /**
  36685. * Determines if this collection contains a primitive.
  36686. * @param [primitive] - The primitive to check for.
  36687. * @returns <code>true</code> if the primitive is in the collection; <code>false</code> if the primitive is <code>undefined</code> or was not found in the collection.
  36688. */
  36689. contains(primitive?: any): boolean;
  36690. /**
  36691. * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn
  36692. * on the globe surface, this visually moves the primitive up one.
  36693. * @param [primitive] - The primitive to raise.
  36694. */
  36695. raise(primitive?: any): void;
  36696. /**
  36697. * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn
  36698. * on the globe surface, this visually moves the primitive to the top.
  36699. * @param [primitive] - The primitive to raise the top.
  36700. */
  36701. raiseToTop(primitive?: any): void;
  36702. /**
  36703. * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn
  36704. * on the globe surface, this visually moves the primitive down one.
  36705. * @param [primitive] - The primitive to lower.
  36706. */
  36707. lower(primitive?: any): void;
  36708. /**
  36709. * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn
  36710. * on the globe surface, this visually moves the primitive to the bottom.
  36711. * @param [primitive] - The primitive to lower to the bottom.
  36712. */
  36713. lowerToBottom(primitive?: any): void;
  36714. /**
  36715. * Returns the primitive in the collection at the specified index.
  36716. * @example
  36717. * // Toggle the show property of every primitive in the collection.
  36718. * var primitives = scene.primitives;
  36719. * var length = primitives.length;
  36720. * for (var i = 0; i < length; ++i) {
  36721. * var p = primitives.get(i);
  36722. * p.show = !p.show;
  36723. * }
  36724. * @param index - The zero-based index of the primitive to return.
  36725. * @returns The primitive at the <code>index</code>.
  36726. */
  36727. get(index: number): any;
  36728. /**
  36729. * Returns true if this object was destroyed; otherwise, false.
  36730. * <br /><br />
  36731. * If this object was destroyed, it should not be used; calling any function other than
  36732. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36733. * @returns True if this object was destroyed; otherwise, false.
  36734. */
  36735. isDestroyed(): boolean;
  36736. /**
  36737. * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this
  36738. * collection allows for deterministic release of WebGL resources, instead of relying on the garbage
  36739. * collector to destroy this collection.
  36740. * <br /><br />
  36741. * Since destroying a collection destroys all the contained primitives, only destroy a collection
  36742. * when you are sure no other code is still using any of the contained primitives.
  36743. * <br /><br />
  36744. * Once this collection is destroyed, it should not be used; calling any function other than
  36745. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36746. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36747. * @example
  36748. * primitives = primitives && primitives.destroy();
  36749. */
  36750. destroy(): void;
  36751. }
  36752. /**
  36753. * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
  36754. * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
  36755. * <p>
  36756. * <em><code>contextOptions</code> parameter details:</em>
  36757. * </p>
  36758. * <p>
  36759. * The default values are:
  36760. * <code>
  36761. * {
  36762. * webgl : {
  36763. * alpha : false,
  36764. * depth : true,
  36765. * stencil : false,
  36766. * antialias : true,
  36767. * powerPreference: 'high-performance',
  36768. * premultipliedAlpha : true,
  36769. * preserveDrawingBuffer : false,
  36770. * failIfMajorPerformanceCaveat : false
  36771. * },
  36772. * allowTextureFilterAnisotropic : true
  36773. * }
  36774. * </code>
  36775. * </p>
  36776. * <p>
  36777. * The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
  36778. * object used to create the WebGL context.
  36779. * </p>
  36780. * <p>
  36781. * <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
  36782. * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
  36783. * <code>webgl.alpha</code> to true.
  36784. * </p>
  36785. * <p>
  36786. * The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
  36787. * </p>
  36788. * <p>
  36789. * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
  36790. * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
  36791. * </p>
  36792. * @example
  36793. * // Create scene without anisotropic texture filtering
  36794. * var scene = new Cesium.Scene({
  36795. * canvas : canvas,
  36796. * contextOptions : {
  36797. * allowTextureFilterAnisotropic : false
  36798. * }
  36799. * });
  36800. * @param options - Object with the following properties:
  36801. * @param options.canvas - The HTML canvas element to create the scene for.
  36802. * @param [options.contextOptions] - Context and WebGL creation properties. See details above.
  36803. * @param [options.creditContainer] - The HTML element in which the credits will be displayed.
  36804. * @param [options.creditViewport] - The HTML element in which to display the credit popup. If not specified, the viewport will be a added as a sibling of the canvas.
  36805. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  36806. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  36807. * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
  36808. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  36809. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  36810. * @param [options.requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
  36811. * @param [options.maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
  36812. */
  36813. export class Scene {
  36814. constructor(options: {
  36815. canvas: HTMLCanvasElement;
  36816. contextOptions?: any;
  36817. creditContainer?: Element;
  36818. creditViewport?: Element;
  36819. mapProjection?: MapProjection;
  36820. orderIndependentTranslucency?: boolean;
  36821. scene3DOnly?: boolean;
  36822. shadows?: boolean;
  36823. mapMode2D?: MapMode2D;
  36824. requestRenderMode?: boolean;
  36825. maximumRenderTimeChange?: number;
  36826. });
  36827. /**
  36828. * Exceptions occurring in <code>render</code> are always caught in order to raise the
  36829. * <code>renderError</code> event. If this property is true, the error is rethrown
  36830. * after the event is raised. If this property is false, the <code>render</code> function
  36831. * returns normally after raising the event.
  36832. */
  36833. rethrowRenderErrors: boolean;
  36834. /**
  36835. * Determines whether or not to instantly complete the
  36836. * scene transition animation on user input.
  36837. */
  36838. completeMorphOnUserInput: boolean;
  36839. /**
  36840. * The event fired at the beginning of a scene transition.
  36841. */
  36842. morphStart: Event;
  36843. /**
  36844. * The event fired at the completion of a scene transition.
  36845. */
  36846. morphComplete: Event;
  36847. /**
  36848. * The {@link SkyBox} used to draw the stars.
  36849. */
  36850. skyBox: SkyBox;
  36851. /**
  36852. * The sky atmosphere drawn around the globe.
  36853. */
  36854. skyAtmosphere: SkyAtmosphere;
  36855. /**
  36856. * The {@link Sun}.
  36857. */
  36858. sun: Sun;
  36859. /**
  36860. * Uses a bloom filter on the sun when enabled.
  36861. */
  36862. sunBloom: boolean;
  36863. /**
  36864. * The {@link Moon}
  36865. */
  36866. moon: Moon;
  36867. /**
  36868. * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.
  36869. */
  36870. backgroundColor: Color;
  36871. /**
  36872. * The current morph transition time between 2D/Columbus View and 3D,
  36873. * with 0.0 being 2D or Columbus View and 1.0 being 3D.
  36874. */
  36875. morphTime: number;
  36876. /**
  36877. * The far-to-near ratio of the multi-frustum when using a normal depth buffer.
  36878. * <p>
  36879. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  36880. * when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is
  36881. * <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.
  36882. * </p>
  36883. */
  36884. farToNearRatio: number;
  36885. /**
  36886. * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.
  36887. * <p>
  36888. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  36889. * when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is
  36890. * <code>false</code>, use {@link Scene#farToNearRatio}.
  36891. * </p>
  36892. */
  36893. logarithmicDepthFarToNearRatio: number;
  36894. /**
  36895. * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close
  36896. * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the
  36897. * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.
  36898. */
  36899. nearToFarDistance2D: number;
  36900. /**
  36901. * This property is for debugging only; it is not for production use.
  36902. * <p>
  36903. * A function that determines what commands are executed. As shown in the examples below,
  36904. * the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the
  36905. * command should be executed.
  36906. * </p>
  36907. * <p>
  36908. * The default is <code>undefined</code>, indicating that all commands are executed.
  36909. * </p>
  36910. * @example
  36911. * // Do not execute any commands.
  36912. * scene.debugCommandFilter = function(command) {
  36913. * return false;
  36914. * };
  36915. *
  36916. * // Execute only the billboard's commands. That is, only draw the billboard.
  36917. * var billboards = new Cesium.BillboardCollection();
  36918. * scene.debugCommandFilter = function(command) {
  36919. * return command.owner === billboards;
  36920. * };
  36921. */
  36922. debugCommandFilter: (...params: any[]) => any;
  36923. /**
  36924. * This property is for debugging only; it is not for production use.
  36925. * <p>
  36926. * When <code>true</code>, commands are randomly shaded. This is useful
  36927. * for performance analysis to see what parts of a scene or model are
  36928. * command-dense and could benefit from batching.
  36929. * </p>
  36930. */
  36931. debugShowCommands: boolean;
  36932. /**
  36933. * This property is for debugging only; it is not for production use.
  36934. * <p>
  36935. * When <code>true</code>, commands are shaded based on the frustums they
  36936. * overlap. Commands in the closest frustum are tinted red, commands in
  36937. * the next closest are green, and commands in the farthest frustum are
  36938. * blue. If a command overlaps more than one frustum, the color components
  36939. * are combined, e.g., a command overlapping the first two frustums is tinted
  36940. * yellow.
  36941. * </p>
  36942. */
  36943. debugShowFrustums: boolean;
  36944. /**
  36945. * This property is for debugging only; it is not for production use.
  36946. * <p>
  36947. * Displays frames per second and time between frames.
  36948. * </p>
  36949. */
  36950. debugShowFramesPerSecond: boolean;
  36951. /**
  36952. * This property is for debugging only; it is not for production use.
  36953. * <p>
  36954. * Displays depth information for the indicated frustum.
  36955. * </p>
  36956. */
  36957. debugShowGlobeDepth: boolean;
  36958. /**
  36959. * This property is for debugging only; it is not for production use.
  36960. * <p>
  36961. * Indicates which frustum will have depth information displayed.
  36962. * </p>
  36963. */
  36964. debugShowDepthFrustum: number;
  36965. /**
  36966. * This property is for debugging only; it is not for production use.
  36967. * <p>
  36968. * When <code>true</code>, draws outlines to show the boundaries of the camera frustums
  36969. * </p>
  36970. */
  36971. debugShowFrustumPlanes: boolean;
  36972. /**
  36973. * When <code>true</code>, enables picking using the depth buffer.
  36974. */
  36975. useDepthPicking: boolean;
  36976. /**
  36977. * When <code>true</code>, enables picking translucent geometry using the depth buffer. Note that {@link Scene#useDepthPicking} must also be true for enabling this to work.
  36978. *
  36979. * <p>
  36980. * Render must be called between picks.
  36981. * <br>There is a decrease in performance when enabled. There are extra draw calls to write depth for
  36982. * translucent geometry.
  36983. * </p>
  36984. * @example
  36985. * // picking the position of a translucent primitive
  36986. * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
  36987. * var pickedFeature = viewer.scene.pick(movement.position);
  36988. * if (!Cesium.defined(pickedFeature)) {
  36989. * // nothing picked
  36990. * return;
  36991. * }
  36992. * viewer.scene.render();
  36993. * var worldPosition = viewer.scene.pickPosition(movement.position);
  36994. * }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  36995. */
  36996. pickTranslucentDepth: boolean;
  36997. /**
  36998. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  36999. * performance improvements by rendering less geometry and dispatching less terrain requests.
  37000. */
  37001. fog: Fog;
  37002. /**
  37003. * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.
  37004. */
  37005. shadowMap: ShadowMap;
  37006. /**
  37007. * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and
  37008. * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.
  37009. */
  37010. invertClassification: boolean;
  37011. /**
  37012. * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.
  37013. * <p>When the color's alpha is less than 1.0, the unclassified portions of the 3D Tiles will not blend correctly with the classified positions of the 3D Tiles.</p>
  37014. * <p>Also, when the color's alpha is less than 1.0, the WEBGL_depth_texture and EXT_frag_depth WebGL extensions must be supported.</p>
  37015. */
  37016. invertClassificationColor: Color;
  37017. /**
  37018. * The focal length for use when with cardboard or WebVR.
  37019. */
  37020. focalLength: number;
  37021. /**
  37022. * The eye separation distance in meters for use with cardboard or WebVR.
  37023. */
  37024. eyeSeparation: number;
  37025. /**
  37026. * Post processing effects applied to the final render.
  37027. */
  37028. postProcessStages: PostProcessStageCollection;
  37029. /**
  37030. * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.
  37031. * Enabling improves performance of the application, but requires using {@link Scene#requestRender}
  37032. * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes
  37033. * to the scene in other parts of the API.
  37034. */
  37035. requestRenderMode: boolean;
  37036. /**
  37037. * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in
  37038. * simulation time allowed before a render is requested. Lower values increase the number of frames rendered
  37039. * and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to
  37040. * the simulation time will never request a render.
  37041. * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,
  37042. * and animations.
  37043. */
  37044. maximumRenderTimeChange: number;
  37045. /**
  37046. * The spherical harmonic coefficients for image-based lighting of PBR models.
  37047. */
  37048. sphericalHarmonicCoefficients: Cartesian3[];
  37049. /**
  37050. * The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.
  37051. */
  37052. specularEnvironmentMaps: string;
  37053. /**
  37054. * The light source for shading. Defaults to a directional light from the Sun.
  37055. */
  37056. light: Light;
  37057. /**
  37058. * Gets the canvas element to which this scene is bound.
  37059. */
  37060. readonly canvas: HTMLCanvasElement;
  37061. /**
  37062. * The drawingBufferHeight of the underlying GL context.
  37063. */
  37064. readonly drawingBufferHeight: number;
  37065. /**
  37066. * The drawingBufferHeight of the underlying GL context.
  37067. */
  37068. readonly drawingBufferWidth: number;
  37069. /**
  37070. * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
  37071. */
  37072. readonly maximumAliasedLineWidth: number;
  37073. /**
  37074. * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.
  37075. */
  37076. readonly maximumCubeMapSize: number;
  37077. /**
  37078. * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.
  37079. */
  37080. readonly pickPositionSupported: boolean;
  37081. /**
  37082. * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.
  37083. */
  37084. readonly sampleHeightSupported: boolean;
  37085. /**
  37086. * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.
  37087. */
  37088. readonly clampToHeightSupported: boolean;
  37089. /**
  37090. * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.
  37091. */
  37092. readonly invertClassificationSupported: boolean;
  37093. /**
  37094. * Returns <code>true</code> if specular environment maps are supported.
  37095. */
  37096. readonly specularEnvironmentMapsSupported: boolean;
  37097. /**
  37098. * Gets or sets the depth-test ellipsoid.
  37099. */
  37100. globe: Globe;
  37101. /**
  37102. * Gets the collection of primitives.
  37103. */
  37104. readonly primitives: PrimitiveCollection;
  37105. /**
  37106. * Gets the collection of ground primitives.
  37107. */
  37108. readonly groundPrimitives: PrimitiveCollection;
  37109. /**
  37110. * Gets or sets the camera.
  37111. */
  37112. readonly camera: Camera;
  37113. /**
  37114. * Gets the controller for camera input handling.
  37115. */
  37116. readonly screenSpaceCameraController: ScreenSpaceCameraController;
  37117. /**
  37118. * Get the map projection to use in 2D and Columbus View modes.
  37119. */
  37120. readonly mapProjection: MapProjection;
  37121. /**
  37122. * Gets the collection of image layers that will be rendered on the globe.
  37123. */
  37124. readonly imageryLayers: ImageryLayerCollection;
  37125. /**
  37126. * The terrain provider providing surface geometry for the globe.
  37127. */
  37128. terrainProvider: TerrainProvider;
  37129. /**
  37130. * Gets an event that's raised when the terrain provider is changed
  37131. */
  37132. readonly terrainProviderChanged: Event;
  37133. /**
  37134. * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
  37135. * receive the Scene instance as the first parameter and the current time as the second parameter.
  37136. */
  37137. readonly preUpdate: Event;
  37138. /**
  37139. * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.
  37140. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  37141. * parameter.
  37142. */
  37143. readonly postUpdate: Event;
  37144. /**
  37145. * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.
  37146. * The Scene instance and the thrown error are the only two parameters passed to the event handler.
  37147. * By default, errors are not rethrown after this event is raised, but that can be changed by setting
  37148. * the <code>rethrowRenderErrors</code> property.
  37149. */
  37150. readonly renderError: Event;
  37151. /**
  37152. * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.
  37153. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  37154. * parameter.
  37155. */
  37156. readonly preRender: Event;
  37157. /**
  37158. * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event
  37159. * receive the Scene instance as the first parameter and the current time as the second parameter.
  37160. */
  37161. readonly postRender: Event;
  37162. /**
  37163. * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been
  37164. * rendered.
  37165. */
  37166. readonly lastRenderTime: JulianDate;
  37167. /**
  37168. * This property is for debugging only; it is not for production use.
  37169. * <p>
  37170. * When {@link Scene.debugShowFrustums} is <code>true</code>, this contains
  37171. * properties with statistics about the number of command execute per frustum.
  37172. * <code>totalCommands</code> is the total number of commands executed, ignoring
  37173. * overlap. <code>commandsInFrustums</code> is an array with the number of times
  37174. * commands are executed redundantly, e.g., how many commands overlap two or
  37175. * three frustums.
  37176. * </p>
  37177. */
  37178. readonly debugFrustumStatistics: any;
  37179. /**
  37180. * Gets whether or not the scene is optimized for 3D only viewing.
  37181. */
  37182. readonly scene3DOnly: boolean;
  37183. /**
  37184. * Gets whether or not the scene has order independent translucency enabled.
  37185. * Note that this only reflects the original construction option, and there are
  37186. * other factors that could prevent OIT from functioning on a given system configuration.
  37187. */
  37188. readonly orderIndependentTranslucency: boolean;
  37189. /**
  37190. * Gets the unique identifier for this scene.
  37191. */
  37192. readonly id: string;
  37193. /**
  37194. * Gets or sets the current mode of the scene.
  37195. */
  37196. mode: SceneMode;
  37197. /**
  37198. * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.
  37199. * Used for cardboard and WebVR.
  37200. */
  37201. useWebVR: boolean;
  37202. /**
  37203. * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  37204. */
  37205. readonly mapMode2D: MapMode2D;
  37206. /**
  37207. * Gets or sets the position of the Imagery splitter within the viewport. Valid values are between 0.0 and 1.0.
  37208. */
  37209. imagerySplitPosition: number;
  37210. /**
  37211. * The distance from the camera at which to disable the depth test of billboards, labels and points
  37212. * to, for example, prevent clipping against terrain. When set to zero, the depth test should always
  37213. * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance
  37214. * property of a billboard, label or point will override this value.
  37215. */
  37216. minimumDisableDepthTestDistance: number;
  37217. /**
  37218. * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,
  37219. * increasing performance. This property relies on fragmentDepth being supported.
  37220. */
  37221. logarithmicDepthBuffer: boolean;
  37222. /**
  37223. * The value used for gamma correction. This is only used when rendering with high dynamic range.
  37224. */
  37225. gamma: number;
  37226. /**
  37227. * Whether or not to use high dynamic range rendering.
  37228. */
  37229. highDynamicRange: boolean;
  37230. /**
  37231. * Whether or not high dynamic range rendering is supported.
  37232. */
  37233. readonly highDynamicRangeSupported: boolean;
  37234. /**
  37235. * Whether or not the camera is underneath the globe.
  37236. */
  37237. readonly cameraUnderground: boolean;
  37238. /**
  37239. * Determines if a compressed texture format is supported.
  37240. * @param format - The texture format. May be the name of the format or the WebGL extension name, e.g. s3tc or WEBGL_compressed_texture_s3tc.
  37241. * @returns Whether or not the format is supported.
  37242. */
  37243. getCompressedTextureFormatSupported(format: string): boolean;
  37244. /**
  37245. * Update and render the scene. It is usually not necessary to call this function
  37246. * directly because {@link CesiumWidget} or {@link Viewer} do it automatically.
  37247. * @param [time] - The simulation time at which to render.
  37248. */
  37249. render(time?: JulianDate): void;
  37250. /**
  37251. * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.
  37252. * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.
  37253. */
  37254. requestRender(): void;
  37255. /**
  37256. * Returns an object with a `primitive` property that contains the first (top) primitive in the scene
  37257. * at a particular window coordinate or undefined if nothing is at the location. Other properties may
  37258. * potentially be set depending on the type of primitive and may be used to further identify the picked object.
  37259. * <p>
  37260. * When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
  37261. * </p>
  37262. * @example
  37263. * // On mouse over, color the feature yellow.
  37264. * handler.setInputAction(function(movement) {
  37265. * var feature = scene.pick(movement.endPosition);
  37266. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  37267. * feature.color = Cesium.Color.YELLOW;
  37268. * }
  37269. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37270. * @param windowPosition - Window coordinates to perform picking on.
  37271. * @param [width = 3] - Width of the pick rectangle.
  37272. * @param [height = 3] - Height of the pick rectangle.
  37273. * @returns Object containing the picked primitive.
  37274. */
  37275. pick(windowPosition: Cartesian2, width?: number, height?: number): any;
  37276. /**
  37277. * Returns the cartesian position reconstructed from the depth buffer and window position.
  37278. * <p>
  37279. * The position reconstructed from the depth buffer in 2D may be slightly different from those
  37280. * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution
  37281. * of depth values of perspective and orthographic projection.
  37282. * </p>
  37283. * <p>
  37284. * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
  37285. * translucent primitives; otherwise, this essentially picks through translucent primitives.
  37286. * </p>
  37287. * @param windowPosition - Window coordinates to perform picking on.
  37288. * @param [result] - The object on which to restore the result.
  37289. * @returns The cartesian position.
  37290. */
  37291. pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3;
  37292. /**
  37293. * Returns a list of objects, each containing a `primitive` property, for all primitives at
  37294. * a particular window coordinate position. Other properties may also be set depending on the
  37295. * type of primitive and may be used to further identify the picked object. The primitives in
  37296. * the list are ordered by their visual order in the scene (front to back).
  37297. * @example
  37298. * var pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
  37299. * @param windowPosition - Window coordinates to perform picking on.
  37300. * @param [limit] - If supplied, stop drilling after collecting this many picks.
  37301. * @param [width = 3] - Width of the pick rectangle.
  37302. * @param [height = 3] - Height of the pick rectangle.
  37303. * @returns Array of objects, each containing 1 picked primitives.
  37304. */
  37305. drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[];
  37306. /**
  37307. * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
  37308. * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to
  37309. * the globe, 3D Tiles, or primitives in the scene.
  37310. * <p>
  37311. * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height
  37312. * from all other primitives regardless of their visibility.
  37313. * </p>
  37314. * @example
  37315. * var position = new Cesium.Cartographic(-1.31968, 0.698874);
  37316. * var height = viewer.scene.sampleHeight(position);
  37317. * console.log(height);
  37318. * @param position - The cartographic position to sample height from.
  37319. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  37320. * @param [width = 0.1] - Width of the intersection volume in meters.
  37321. * @returns The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
  37322. */
  37323. sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number;
  37324. /**
  37325. * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the
  37326. * clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp
  37327. * objects to the globe, 3D Tiles, or primitives in the scene.
  37328. * <p>
  37329. * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to
  37330. * all other primitives regardless of their visibility.
  37331. * </p>
  37332. * @example
  37333. * // Clamp an entity to the underlying scene geometry
  37334. * var position = entity.position.getValue(Cesium.JulianDate.now());
  37335. * entity.position = viewer.scene.clampToHeight(position);
  37336. * @param cartesian - The cartesian position.
  37337. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  37338. * @param [width = 0.1] - Width of the intersection volume in meters.
  37339. * @param [result] - An optional object to return the clamped position.
  37340. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. This may be <code>undefined</code> if there was no scene geometry to clamp to.
  37341. */
  37342. clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3;
  37343. /**
  37344. * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions
  37345. * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.
  37346. * Returns a promise that is resolved when the query completes. Each point height is modified in place.
  37347. * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,
  37348. * the height is set to undefined.
  37349. * @example
  37350. * var positions = [
  37351. * new Cesium.Cartographic(-1.31968, 0.69887),
  37352. * new Cesium.Cartographic(-1.10489, 0.83923)
  37353. * ];
  37354. * var promise = viewer.scene.sampleHeightMostDetailed(positions);
  37355. * promise.then(function(updatedPosition) {
  37356. * // positions[0].height and positions[1].height have been updated.
  37357. * // updatedPositions is just a reference to positions.
  37358. * }
  37359. * @param positions - The cartographic positions to update with sampled heights.
  37360. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  37361. * @param [width = 0.1] - Width of the intersection volume in meters.
  37362. * @returns A promise that resolves to the provided list of positions when the query has completed.
  37363. */
  37364. sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<Cartographic[]>;
  37365. /**
  37366. * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions
  37367. * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when
  37368. * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry
  37369. * can be sampled at that location, or another error occurs, the element in the array is set to undefined.
  37370. * @example
  37371. * var cartesians = [
  37372. * entities[0].position.getValue(Cesium.JulianDate.now()),
  37373. * entities[1].position.getValue(Cesium.JulianDate.now())
  37374. * ];
  37375. * var promise = viewer.scene.clampToHeightMostDetailed(cartesians);
  37376. * promise.then(function(updatedCartesians) {
  37377. * entities[0].position = updatedCartesians[0];
  37378. * entities[1].position = updatedCartesians[1];
  37379. * }
  37380. * @param cartesians - The cartesian positions to update with clamped positions.
  37381. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  37382. * @param [width = 0.1] - Width of the intersection volume in meters.
  37383. * @returns A promise that resolves to the provided list of positions when the query has completed.
  37384. */
  37385. clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<Cartesian3[]>;
  37386. /**
  37387. * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an
  37388. * HTML element at the same screen position as an object in the scene.
  37389. * @example
  37390. * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
  37391. * var scene = widget.scene;
  37392. * var ellipsoid = scene.globe.ellipsoid;
  37393. * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  37394. * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  37395. * handler.setInputAction(function(movement) {
  37396. * console.log(scene.cartesianToCanvasCoordinates(position));
  37397. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37398. * @param position - The position in cartesian coordinates.
  37399. * @param [result] - An optional object to return the input position transformed to canvas coordinates.
  37400. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid.
  37401. */
  37402. cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2;
  37403. /**
  37404. * Instantly completes an active transition.
  37405. */
  37406. completeMorph(): void;
  37407. /**
  37408. * Asynchronously transitions the scene to 2D.
  37409. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  37410. */
  37411. morphTo2D(duration?: number): void;
  37412. /**
  37413. * Asynchronously transitions the scene to Columbus View.
  37414. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  37415. */
  37416. morphToColumbusView(duration?: number): void;
  37417. /**
  37418. * Asynchronously transitions the scene to 3D.
  37419. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  37420. */
  37421. morphTo3D(duration?: number): void;
  37422. /**
  37423. * Returns true if this object was destroyed; otherwise, false.
  37424. * <br /><br />
  37425. * If this object was destroyed, it should not be used; calling any function other than
  37426. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37427. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37428. */
  37429. isDestroyed(): boolean;
  37430. /**
  37431. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37432. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37433. * <br /><br />
  37434. * Once an object is destroyed, it should not be used; calling any function other than
  37435. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37436. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37437. * @example
  37438. * scene = scene && scene.destroy();
  37439. */
  37440. destroy(): void;
  37441. }
  37442. /**
  37443. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  37444. */
  37445. export enum SceneMode {
  37446. /**
  37447. * Morphing between mode, e.g., 3D to 2D.
  37448. */
  37449. MORPHING = 0,
  37450. /**
  37451. * Columbus View mode. A 2.5D perspective view where the map is laid out
  37452. * flat and objects with non-zero height are drawn above it.
  37453. */
  37454. COLUMBUS_VIEW = 1,
  37455. /**
  37456. * 2D mode. The map is viewed top-down with an orthographic projection.
  37457. */
  37458. SCENE2D = 2,
  37459. /**
  37460. * 3D mode. A traditional 3D perspective view of the globe.
  37461. */
  37462. SCENE3D = 3
  37463. }
  37464. /**
  37465. * Functions that do scene-dependent transforms between rendering-related coordinate systems.
  37466. */
  37467. export namespace SceneTransforms {
  37468. /**
  37469. * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an
  37470. * HTML element at the same screen position as an object in the scene.
  37471. * @example
  37472. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  37473. * var scene = widget.scene;
  37474. * var ellipsoid = scene.globe.ellipsoid;
  37475. * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  37476. * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  37477. * handler.setInputAction(function(movement) {
  37478. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  37479. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37480. * @param scene - The scene.
  37481. * @param position - The position in WGS84 (world) coordinates.
  37482. * @param [result] - An optional object to return the input position transformed to window coordinates.
  37483. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid.
  37484. */
  37485. function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  37486. /**
  37487. * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different
  37488. * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.
  37489. * @example
  37490. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  37491. * var scene = widget.scene;
  37492. * var ellipsoid = scene.globe.ellipsoid;
  37493. * var position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  37494. * var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  37495. * handler.setInputAction(function(movement) {
  37496. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  37497. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37498. * @param scene - The scene.
  37499. * @param position - The position in WGS84 (world) coordinates.
  37500. * @param [result] - An optional object to return the input position transformed to window coordinates.
  37501. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. This may be <code>undefined</code> if the input position is near the center of the ellipsoid.
  37502. */
  37503. function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  37504. }
  37505. /**
  37506. * Modifies the camera position and orientation based on mouse input to a canvas.
  37507. * @param scene - The scene.
  37508. */
  37509. export class ScreenSpaceCameraController {
  37510. constructor(scene: Scene);
  37511. /**
  37512. * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,
  37513. * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.
  37514. *
  37515. * NOTE: This setting is for temporary use cases, such as camera flights and
  37516. * drag-selection of regions (see Picking demo). It is typically set to false at the
  37517. * start of such events, and set true on completion. To keep inputs disabled
  37518. * past the end of camera flights, you must use the other booleans (enableTranslate,
  37519. * enableZoom, enableRotate, enableTilt, and enableLook).
  37520. */
  37521. enableInputs: boolean;
  37522. /**
  37523. * If true, allows the user to pan around the map. If false, the camera stays locked at the current position.
  37524. * This flag only applies in 2D and Columbus view modes.
  37525. */
  37526. enableTranslate: boolean;
  37527. /**
  37528. * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.
  37529. */
  37530. enableZoom: boolean;
  37531. /**
  37532. * If true, allows the user to rotate the world which translates the user's position.
  37533. * This flag only applies in 2D and 3D.
  37534. */
  37535. enableRotate: boolean;
  37536. /**
  37537. * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.
  37538. * This flag only applies in 3D and Columbus view.
  37539. */
  37540. enableTilt: boolean;
  37541. /**
  37542. * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating
  37543. * or rotating. This flag only applies in 3D and Columbus view modes.
  37544. */
  37545. enableLook: boolean;
  37546. /**
  37547. * A parameter in the range <code>[0, 1)</code> used to determine how long
  37548. * the camera will continue to spin because of inertia.
  37549. * With value of zero, the camera will have no inertia.
  37550. */
  37551. inertiaSpin: number;
  37552. /**
  37553. * A parameter in the range <code>[0, 1)</code> used to determine how long
  37554. * the camera will continue to translate because of inertia.
  37555. * With value of zero, the camera will have no inertia.
  37556. */
  37557. inertiaTranslate: number;
  37558. /**
  37559. * A parameter in the range <code>[0, 1)</code> used to determine how long
  37560. * the camera will continue to zoom because of inertia.
  37561. * With value of zero, the camera will have no inertia.
  37562. */
  37563. inertiaZoom: number;
  37564. /**
  37565. * A parameter in the range <code>[0, 1)</code> used to limit the range
  37566. * of various user inputs to a percentage of the window width/height per animation frame.
  37567. * This helps keep the camera under control in low-frame-rate situations.
  37568. */
  37569. maximumMovementRatio: number;
  37570. /**
  37571. * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.
  37572. */
  37573. bounceAnimationTime: number;
  37574. /**
  37575. * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.
  37576. */
  37577. minimumZoomDistance: number;
  37578. /**
  37579. * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.
  37580. */
  37581. maximumZoomDistance: number;
  37582. /**
  37583. * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.
  37584. * <p>
  37585. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  37586. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  37587. * or an array of any of the preceding.
  37588. * </p>
  37589. */
  37590. translateEventTypes: CameraEventType | any[] | undefined;
  37591. /**
  37592. * The input that allows the user to zoom in/out.
  37593. * <p>
  37594. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  37595. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  37596. * or an array of any of the preceding.
  37597. * </p>
  37598. */
  37599. zoomEventTypes: CameraEventType | any[] | undefined;
  37600. /**
  37601. * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.
  37602. * <p>
  37603. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  37604. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  37605. * or an array of any of the preceding.
  37606. * </p>
  37607. */
  37608. rotateEventTypes: CameraEventType | any[] | undefined;
  37609. /**
  37610. * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.
  37611. * <p>
  37612. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  37613. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  37614. * or an array of any of the preceding.
  37615. * </p>
  37616. */
  37617. tiltEventTypes: CameraEventType | any[] | undefined;
  37618. /**
  37619. * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.
  37620. * <p>
  37621. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  37622. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  37623. * or an array of any of the preceding.
  37624. * </p>
  37625. */
  37626. lookEventTypes: CameraEventType | any[] | undefined;
  37627. /**
  37628. * The minimum height the camera must be before picking the terrain instead of the ellipsoid.
  37629. */
  37630. minimumPickingTerrainHeight: number;
  37631. /**
  37632. * The minimum height the camera must be before testing for collision with terrain.
  37633. */
  37634. minimumCollisionTerrainHeight: number;
  37635. /**
  37636. * The minimum height the camera must be before switching from rotating a track ball to
  37637. * free look when clicks originate on the sky or in space.
  37638. */
  37639. minimumTrackBallHeight: number;
  37640. /**
  37641. * Enables or disables camera collision detection with terrain.
  37642. */
  37643. enableCollisionDetection: boolean;
  37644. /**
  37645. * Returns true if this object was destroyed; otherwise, false.
  37646. * <br /><br />
  37647. * If this object was destroyed, it should not be used; calling any function other than
  37648. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37649. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37650. */
  37651. isDestroyed(): boolean;
  37652. /**
  37653. * Removes mouse listeners held by this object.
  37654. * <br /><br />
  37655. * Once an object is destroyed, it should not be used; calling any function other than
  37656. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37657. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37658. * @example
  37659. * controller = controller && controller.destroy();
  37660. */
  37661. destroy(): void;
  37662. }
  37663. /**
  37664. * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.
  37665. *
  37666. * <p>
  37667. * The normalOffset bias pushes the shadows forward slightly, and may be disabled
  37668. * for applications that require ultra precise shadows.
  37669. * </p>
  37670. * @param options - An object containing the following properties:
  37671. * @param options.lightCamera - A camera representing the light source.
  37672. * @param [options.enabled = true] - Whether the shadow map is enabled.
  37673. * @param [options.isPointLight = false] - Whether the light source is a point light. Point light shadows do not use cascades.
  37674. * @param [options.pointLightRadius = 100.0] - Radius of the point light.
  37675. * @param [options.cascadesEnabled = true] - Use multiple shadow maps to cover different partitions of the view frustum.
  37676. * @param [options.numberOfCascades = 4] - The number of cascades to use for the shadow map. Supported values are one and four.
  37677. * @param [options.maximumDistance = 5000.0] - The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.
  37678. * @param [options.size = 2048] - The width and height, in pixels, of each shadow map.
  37679. * @param [options.softShadows = false] - Whether percentage-closer-filtering is enabled for producing softer shadows.
  37680. * @param [options.darkness = 0.3] - The shadow darkness.
  37681. * @param [options.normalOffset = true] - Whether a normal bias is applied to shadows.
  37682. * @param [options.fadingEnabled = true] - Whether shadows start to fade out once the light gets closer to the horizon.
  37683. */
  37684. export class ShadowMap {
  37685. constructor(options: {
  37686. lightCamera: Camera;
  37687. enabled?: boolean;
  37688. isPointLight?: boolean;
  37689. pointLightRadius?: boolean;
  37690. cascadesEnabled?: boolean;
  37691. numberOfCascades?: number;
  37692. maximumDistance?: number;
  37693. size?: number;
  37694. softShadows?: boolean;
  37695. darkness?: number;
  37696. normalOffset?: boolean;
  37697. fadingEnabled?: boolean;
  37698. });
  37699. /**
  37700. * Determines the darkness of the shadows.
  37701. */
  37702. darkness: number;
  37703. /**
  37704. * Determines whether shadows start to fade out once the light gets closer to the horizon.
  37705. */
  37706. fadingEnabled: boolean;
  37707. /**
  37708. * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.
  37709. */
  37710. maximumDistance: number;
  37711. /**
  37712. * Determines if the shadow map will be shown.
  37713. */
  37714. enabled: boolean;
  37715. /**
  37716. * Determines if a normal bias will be applied to shadows.
  37717. */
  37718. normalOffset: boolean;
  37719. /**
  37720. * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.
  37721. */
  37722. softShadows: boolean;
  37723. /**
  37724. * The width and height, in pixels, of each shadow map.
  37725. */
  37726. size: number;
  37727. }
  37728. /**
  37729. * Specifies whether the object casts or receives shadows from light sources when
  37730. * shadows are enabled.
  37731. */
  37732. export enum ShadowMode {
  37733. /**
  37734. * The object does not cast or receive shadows.
  37735. */
  37736. DISABLED = 0,
  37737. /**
  37738. * The object casts and receives shadows.
  37739. */
  37740. ENABLED = 1,
  37741. /**
  37742. * The object casts shadows only.
  37743. */
  37744. CAST_ONLY = 2,
  37745. /**
  37746. * The object receives shadows only.
  37747. */
  37748. RECEIVE_ONLY = 3
  37749. }
  37750. export namespace SingleTileImageryProvider {
  37751. /**
  37752. * Initialization options for the SingleTileImageryProvider constructor
  37753. * @property url - The url for the tile.
  37754. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  37755. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  37756. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  37757. */
  37758. type ConstructorOptions = {
  37759. url: Resource | string;
  37760. rectangle?: Rectangle;
  37761. credit?: Credit | string;
  37762. ellipsoid?: Ellipsoid;
  37763. };
  37764. }
  37765. /**
  37766. * Provides a single, top-level imagery tile. The single image is assumed to use a
  37767. * {@link GeographicTilingScheme}.
  37768. * @param options - Object describing initialization options
  37769. */
  37770. export class SingleTileImageryProvider {
  37771. constructor(options: SingleTileImageryProvider.ConstructorOptions);
  37772. /**
  37773. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  37774. * 1.0 representing fully opaque.
  37775. */
  37776. defaultAlpha: number | undefined;
  37777. /**
  37778. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  37779. * 1.0 representing fully opaque.
  37780. */
  37781. defaultNightAlpha: number | undefined;
  37782. /**
  37783. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  37784. * 1.0 representing fully opaque.
  37785. */
  37786. defaultDayAlpha: number | undefined;
  37787. /**
  37788. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  37789. * makes the imagery darker while greater than 1.0 makes it brighter.
  37790. */
  37791. defaultBrightness: number | undefined;
  37792. /**
  37793. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  37794. * the contrast while greater than 1.0 increases it.
  37795. */
  37796. defaultContrast: number | undefined;
  37797. /**
  37798. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  37799. */
  37800. defaultHue: number | undefined;
  37801. /**
  37802. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  37803. * saturation while greater than 1.0 increases it.
  37804. */
  37805. defaultSaturation: number | undefined;
  37806. /**
  37807. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  37808. */
  37809. defaultGamma: number | undefined;
  37810. /**
  37811. * The default texture minification filter to apply to this provider.
  37812. */
  37813. defaultMinificationFilter: TextureMinificationFilter;
  37814. /**
  37815. * The default texture magnification filter to apply to this provider.
  37816. */
  37817. defaultMagnificationFilter: TextureMagnificationFilter;
  37818. /**
  37819. * Gets the URL of the single, top-level imagery tile.
  37820. */
  37821. readonly url: string;
  37822. /**
  37823. * Gets the proxy used by this provider.
  37824. */
  37825. readonly proxy: Proxy;
  37826. /**
  37827. * Gets the width of each tile, in pixels. This function should
  37828. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37829. */
  37830. readonly tileWidth: number;
  37831. /**
  37832. * Gets the height of each tile, in pixels. This function should
  37833. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37834. */
  37835. readonly tileHeight: number;
  37836. /**
  37837. * Gets the maximum level-of-detail that can be requested. This function should
  37838. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37839. */
  37840. readonly maximumLevel: number | undefined;
  37841. /**
  37842. * Gets the minimum level-of-detail that can be requested. This function should
  37843. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37844. */
  37845. readonly minimumLevel: number;
  37846. /**
  37847. * Gets the tiling scheme used by this provider. This function should
  37848. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37849. */
  37850. readonly tilingScheme: TilingScheme;
  37851. /**
  37852. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  37853. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37854. */
  37855. readonly rectangle: Rectangle;
  37856. /**
  37857. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  37858. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  37859. * returns undefined, no tiles are filtered. This function should
  37860. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37861. */
  37862. readonly tileDiscardPolicy: TileDiscardPolicy;
  37863. /**
  37864. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  37865. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  37866. * are passed an instance of {@link TileProviderError}.
  37867. */
  37868. readonly errorEvent: Event;
  37869. /**
  37870. * Gets a value indicating whether or not the provider is ready for use.
  37871. */
  37872. readonly ready: boolean;
  37873. /**
  37874. * Gets a promise that resolves to true when the provider is ready for use.
  37875. */
  37876. readonly readyPromise: Promise<boolean>;
  37877. /**
  37878. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  37879. * the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true.
  37880. */
  37881. readonly credit: Credit;
  37882. /**
  37883. * Gets a value indicating whether or not the images provided by this imagery provider
  37884. * include an alpha channel. If this property is false, an alpha channel, if present, will
  37885. * be ignored. If this property is true, any images without an alpha channel will be treated
  37886. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  37887. * and texture upload time are reduced.
  37888. */
  37889. readonly hasAlphaChannel: boolean;
  37890. /**
  37891. * Gets the credits to be displayed when a given tile is displayed.
  37892. * @param x - The tile X coordinate.
  37893. * @param y - The tile Y coordinate.
  37894. * @param level - The tile level;
  37895. * @returns The credits to be displayed when the tile is displayed.
  37896. */
  37897. getTileCredits(x: number, y: number, level: number): Credit[];
  37898. /**
  37899. * Requests the image for a given tile. This function should
  37900. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  37901. * @param x - The tile X coordinate.
  37902. * @param y - The tile Y coordinate.
  37903. * @param level - The tile level.
  37904. * @param [request] - The request object. Intended for internal use only.
  37905. * @returns A promise for the image that will resolve when the image is available, or
  37906. * undefined if there are too many active requests to the server, and the request
  37907. * should be retried later. The resolved image may be either an
  37908. * Image or a Canvas DOM object.
  37909. */
  37910. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  37911. /**
  37912. * Picking features is not currently supported by this imagery provider, so this function simply returns
  37913. * undefined.
  37914. * @param x - The tile X coordinate.
  37915. * @param y - The tile Y coordinate.
  37916. * @param level - The tile level.
  37917. * @param longitude - The longitude at which to pick features.
  37918. * @param latitude - The latitude at which to pick features.
  37919. * @returns A promise for the picked features that will resolve when the asynchronous
  37920. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  37921. * instances. The array may be empty if no features are found at the given location.
  37922. * It may also be undefined if picking is not supported.
  37923. */
  37924. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  37925. }
  37926. /**
  37927. * An atmosphere drawn around the limb of the provided ellipsoid. Based on
  37928. * {@link https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter16.html|Accurate Atmospheric Scattering}
  37929. * in GPU Gems 2.
  37930. * <p>
  37931. * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.
  37932. * </p>
  37933. * @example
  37934. * scene.skyAtmosphere = new Cesium.SkyAtmosphere();
  37935. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around.
  37936. */
  37937. export class SkyAtmosphere {
  37938. constructor(ellipsoid?: Ellipsoid);
  37939. /**
  37940. * Determines if the atmosphere is shown.
  37941. */
  37942. show: boolean;
  37943. /**
  37944. * Compute atmosphere per-fragment instead of per-vertex.
  37945. * This produces better looking atmosphere with a slight performance penalty.
  37946. */
  37947. perFragmentAtmosphere: boolean;
  37948. /**
  37949. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37950. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  37951. */
  37952. hueShift: number;
  37953. /**
  37954. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37955. * A saturation shift of -1.0 is monochrome.
  37956. */
  37957. saturationShift: number;
  37958. /**
  37959. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  37960. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  37961. */
  37962. brightnessShift: number;
  37963. /**
  37964. * Gets the ellipsoid the atmosphere is drawn around.
  37965. */
  37966. readonly ellipsoid: Ellipsoid;
  37967. /**
  37968. * Returns true if this object was destroyed; otherwise, false.
  37969. * <br /><br />
  37970. * If this object was destroyed, it should not be used; calling any function other than
  37971. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37972. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37973. */
  37974. isDestroyed(): boolean;
  37975. /**
  37976. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37977. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37978. * <br /><br />
  37979. * Once an object is destroyed, it should not be used; calling any function other than
  37980. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37981. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37982. * @example
  37983. * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();
  37984. */
  37985. destroy(): void;
  37986. }
  37987. /**
  37988. * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.
  37989. * <p>
  37990. * This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of
  37991. * the sky box must not exceed {@link Scene#maximumCubeMapSize}.
  37992. * </p>
  37993. * @example
  37994. * scene.skyBox = new Cesium.SkyBox({
  37995. * sources : {
  37996. * positiveX : 'skybox_px.png',
  37997. * negativeX : 'skybox_nx.png',
  37998. * positiveY : 'skybox_py.png',
  37999. * negativeY : 'skybox_ny.png',
  38000. * positiveZ : 'skybox_pz.png',
  38001. * negativeZ : 'skybox_nz.png'
  38002. * }
  38003. * });
  38004. * @param options - Object with the following properties:
  38005. * @param [options.sources] - The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.
  38006. * @param [options.show = true] - Determines if this primitive will be shown.
  38007. */
  38008. export class SkyBox {
  38009. constructor(options: {
  38010. sources?: any;
  38011. show?: boolean;
  38012. });
  38013. /**
  38014. * The sources used to create the cube map faces: an object
  38015. * with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,
  38016. * <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.
  38017. * These can be either URLs or <code>Image</code> objects.
  38018. */
  38019. sources: any;
  38020. /**
  38021. * Determines if the sky box will be shown.
  38022. */
  38023. show: boolean;
  38024. /**
  38025. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  38026. * get the draw commands needed to render this primitive.
  38027. * <p>
  38028. * Do not call this function directly. This is documented just to
  38029. * list the exceptions that may be propagated when the scene is rendered:
  38030. * </p>
  38031. */
  38032. update(): void;
  38033. /**
  38034. * Returns true if this object was destroyed; otherwise, false.
  38035. * <br /><br />
  38036. * If this object was destroyed, it should not be used; calling any function other than
  38037. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38038. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  38039. */
  38040. isDestroyed(): boolean;
  38041. /**
  38042. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38043. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38044. * <br /><br />
  38045. * Once an object is destroyed, it should not be used; calling any function other than
  38046. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38047. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38048. * @example
  38049. * skyBox = skyBox && skyBox.destroy();
  38050. */
  38051. destroy(): void;
  38052. }
  38053. /**
  38054. * A ParticleEmitter that emits particles within a sphere.
  38055. * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere.
  38056. * @param [radius = 1.0] - The radius of the sphere in meters.
  38057. */
  38058. export class SphereEmitter {
  38059. constructor(radius?: number);
  38060. /**
  38061. * The radius of the sphere in meters.
  38062. */
  38063. radius: number;
  38064. }
  38065. /**
  38066. * Determines the function used to compare stencil values for the stencil test.
  38067. */
  38068. export enum StencilFunction {
  38069. /**
  38070. * The stencil test never passes.
  38071. */
  38072. NEVER = WebGLConstants.NEVER,
  38073. /**
  38074. * The stencil test passes when the masked reference value is less than the masked stencil value.
  38075. */
  38076. LESS = WebGLConstants.LESS,
  38077. /**
  38078. * The stencil test passes when the masked reference value is equal to the masked stencil value.
  38079. */
  38080. EQUAL = WebGLConstants.EQUAL,
  38081. /**
  38082. * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.
  38083. */
  38084. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  38085. /**
  38086. * The stencil test passes when the masked reference value is greater than the masked stencil value.
  38087. */
  38088. GREATER = WebGLConstants.GREATER,
  38089. /**
  38090. * The stencil test passes when the masked reference value is not equal to the masked stencil value.
  38091. */
  38092. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  38093. /**
  38094. * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.
  38095. */
  38096. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  38097. /**
  38098. * The stencil test always passes.
  38099. */
  38100. ALWAYS = WebGLConstants.ALWAYS
  38101. }
  38102. /**
  38103. * Determines the action taken based on the result of the stencil test.
  38104. */
  38105. export enum StencilOperation {
  38106. /**
  38107. * Sets the stencil buffer value to zero.
  38108. */
  38109. ZERO = WebGLConstants.ZERO,
  38110. /**
  38111. * Does not change the stencil buffer.
  38112. */
  38113. KEEP = WebGLConstants.KEEP,
  38114. /**
  38115. * Replaces the stencil buffer value with the reference value.
  38116. */
  38117. REPLACE = WebGLConstants.REPLACE,
  38118. /**
  38119. * Increments the stencil buffer value, clamping to unsigned byte.
  38120. */
  38121. INCREMENT = WebGLConstants.INCR,
  38122. /**
  38123. * Decrements the stencil buffer value, clamping to zero.
  38124. */
  38125. DECREMENT = WebGLConstants.DECR,
  38126. /**
  38127. * Bitwise inverts the existing stencil buffer value.
  38128. */
  38129. INVERT = WebGLConstants.INVERT,
  38130. /**
  38131. * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  38132. */
  38133. INCREMENT_WRAP = WebGLConstants.INCR_WRAP,
  38134. /**
  38135. * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  38136. */
  38137. DECREMENT_WRAP = WebGLConstants.DECR_WRAP
  38138. }
  38139. /**
  38140. * An expression for a style applied to a {@link Cesium3DTileset}.
  38141. * <p>
  38142. * Derived classes of this interface evaluate expressions in the
  38143. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  38144. * </p>
  38145. * <p>
  38146. * This type describes an interface and is not intended to be instantiated directly.
  38147. * </p>
  38148. */
  38149. export class StyleExpression {
  38150. constructor();
  38151. /**
  38152. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  38153. * the expression in the
  38154. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  38155. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  38156. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  38157. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  38158. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  38159. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  38160. * @param feature - The feature whose properties may be used as variables in the expression.
  38161. * @param [result] - The object onto which to store the result.
  38162. * @returns The result of evaluating the expression.
  38163. */
  38164. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  38165. /**
  38166. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  38167. * <p>
  38168. * This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object.
  38169. * </p>
  38170. * @param feature - The feature whose properties may be used as variables in the expression.
  38171. * @param [result] - The object in which to store the result.
  38172. * @returns The modified result parameter or a new Color instance if one was not provided.
  38173. */
  38174. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  38175. }
  38176. /**
  38177. * Draws a sun billboard.
  38178. * <p>This is only supported in 3D and Columbus view.</p>
  38179. * @example
  38180. * scene.sun = new Cesium.Sun();
  38181. */
  38182. export class Sun {
  38183. constructor();
  38184. /**
  38185. * Determines if the sun will be shown.
  38186. */
  38187. show: boolean;
  38188. /**
  38189. * Gets or sets a number that controls how "bright" the Sun's lens flare appears
  38190. * to be. Zero shows just the Sun's disc without any flare.
  38191. * Use larger values for a more pronounced flare around the Sun.
  38192. */
  38193. glowFactor: number;
  38194. /**
  38195. * Returns true if this object was destroyed; otherwise, false.
  38196. * <br /><br />
  38197. * If this object was destroyed, it should not be used; calling any function other than
  38198. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38199. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  38200. */
  38201. isDestroyed(): boolean;
  38202. /**
  38203. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38204. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38205. * <br /><br />
  38206. * Once an object is destroyed, it should not be used; calling any function other than
  38207. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38208. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38209. * @example
  38210. * sun = sun && sun.destroy();
  38211. *
  38212. *
  38213. */
  38214. destroy(): void;
  38215. }
  38216. /**
  38217. * A directional light source that originates from the Sun.
  38218. * @param [options] - Object with the following properties:
  38219. * @param [options.color = Color.WHITE] - The light's color.
  38220. * @param [options.intensity = 2.0] - The light's intensity.
  38221. */
  38222. export class SunLight {
  38223. constructor(options?: {
  38224. color?: Color;
  38225. intensity?: number;
  38226. });
  38227. /**
  38228. * The color of the light.
  38229. */
  38230. color: Color;
  38231. /**
  38232. * The intensity of the light.
  38233. */
  38234. intensity: number;
  38235. }
  38236. export namespace TileCoordinatesImageryProvider {
  38237. /**
  38238. * Initialization options for the TileCoordinatesImageryProvider constructor
  38239. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  38240. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  38241. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  38242. * parameter is specified, the WGS84 ellipsoid is used.
  38243. * @property [color = Color.YELLOW] - The color to draw the tile box and label.
  38244. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  38245. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  38246. */
  38247. type ConstructorOptions = {
  38248. tilingScheme?: TilingScheme;
  38249. ellipsoid?: Ellipsoid;
  38250. color?: Color;
  38251. tileWidth?: number;
  38252. tileHeight?: number;
  38253. };
  38254. }
  38255. /**
  38256. * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws
  38257. * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for
  38258. * debugging terrain and imagery rendering problems.
  38259. * @param [options] - Object describing initialization options
  38260. */
  38261. export class TileCoordinatesImageryProvider {
  38262. constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions);
  38263. /**
  38264. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38265. * 1.0 representing fully opaque.
  38266. */
  38267. defaultAlpha: number | undefined;
  38268. /**
  38269. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38270. * 1.0 representing fully opaque.
  38271. */
  38272. defaultNightAlpha: number | undefined;
  38273. /**
  38274. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38275. * 1.0 representing fully opaque.
  38276. */
  38277. defaultDayAlpha: number | undefined;
  38278. /**
  38279. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38280. * makes the imagery darker while greater than 1.0 makes it brighter.
  38281. */
  38282. defaultBrightness: number | undefined;
  38283. /**
  38284. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38285. * the contrast while greater than 1.0 increases it.
  38286. */
  38287. defaultContrast: number | undefined;
  38288. /**
  38289. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38290. */
  38291. defaultHue: number | undefined;
  38292. /**
  38293. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38294. * saturation while greater than 1.0 increases it.
  38295. */
  38296. defaultSaturation: number | undefined;
  38297. /**
  38298. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38299. */
  38300. defaultGamma: number | undefined;
  38301. /**
  38302. * The default texture minification filter to apply to this provider.
  38303. */
  38304. defaultMinificationFilter: TextureMinificationFilter;
  38305. /**
  38306. * The default texture magnification filter to apply to this provider.
  38307. */
  38308. defaultMagnificationFilter: TextureMagnificationFilter;
  38309. /**
  38310. * Gets the proxy used by this provider.
  38311. */
  38312. readonly proxy: Proxy;
  38313. /**
  38314. * Gets the width of each tile, in pixels. This function should
  38315. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38316. */
  38317. readonly tileWidth: number;
  38318. /**
  38319. * Gets the height of each tile, in pixels. This function should
  38320. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38321. */
  38322. readonly tileHeight: number;
  38323. /**
  38324. * Gets the maximum level-of-detail that can be requested. This function should
  38325. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38326. */
  38327. readonly maximumLevel: number | undefined;
  38328. /**
  38329. * Gets the minimum level-of-detail that can be requested. This function should
  38330. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38331. */
  38332. readonly minimumLevel: number;
  38333. /**
  38334. * Gets the tiling scheme used by this provider. This function should
  38335. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38336. */
  38337. readonly tilingScheme: TilingScheme;
  38338. /**
  38339. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38340. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38341. */
  38342. readonly rectangle: Rectangle;
  38343. /**
  38344. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38345. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38346. * returns undefined, no tiles are filtered. This function should
  38347. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38348. */
  38349. readonly tileDiscardPolicy: TileDiscardPolicy;
  38350. /**
  38351. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38352. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38353. * are passed an instance of {@link TileProviderError}.
  38354. */
  38355. readonly errorEvent: Event;
  38356. /**
  38357. * Gets a value indicating whether or not the provider is ready for use.
  38358. */
  38359. readonly ready: boolean;
  38360. /**
  38361. * Gets a promise that resolves to true when the provider is ready for use.
  38362. */
  38363. readonly readyPromise: Promise<boolean>;
  38364. /**
  38365. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38366. * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38367. */
  38368. readonly credit: Credit;
  38369. /**
  38370. * Gets a value indicating whether or not the images provided by this imagery provider
  38371. * include an alpha channel. If this property is false, an alpha channel, if present, will
  38372. * be ignored. If this property is true, any images without an alpha channel will be treated
  38373. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  38374. * and texture upload time.
  38375. */
  38376. readonly hasAlphaChannel: boolean;
  38377. /**
  38378. * Gets the credits to be displayed when a given tile is displayed.
  38379. * @param x - The tile X coordinate.
  38380. * @param y - The tile Y coordinate.
  38381. * @param level - The tile level;
  38382. * @returns The credits to be displayed when the tile is displayed.
  38383. */
  38384. getTileCredits(x: number, y: number, level: number): Credit[];
  38385. /**
  38386. * Requests the image for a given tile. This function should
  38387. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  38388. * @param x - The tile X coordinate.
  38389. * @param y - The tile Y coordinate.
  38390. * @param level - The tile level.
  38391. * @param [request] - The request object. Intended for internal use only.
  38392. * @returns A promise for the image that will resolve when the image is available, or
  38393. * undefined if there are too many active requests to the server, and the request
  38394. * should be retried later. The resolved image may be either an
  38395. * Image or a Canvas DOM object.
  38396. */
  38397. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  38398. /**
  38399. * Picking features is not currently supported by this imagery provider, so this function simply returns
  38400. * undefined.
  38401. * @param x - The tile X coordinate.
  38402. * @param y - The tile Y coordinate.
  38403. * @param level - The tile level.
  38404. * @param longitude - The longitude at which to pick features.
  38405. * @param latitude - The latitude at which to pick features.
  38406. * @returns A promise for the picked features that will resolve when the asynchronous
  38407. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  38408. * instances. The array may be empty if no features are found at the given location.
  38409. * It may also be undefined if picking is not supported.
  38410. */
  38411. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  38412. }
  38413. /**
  38414. * A policy for discarding tile images according to some criteria. This type describes an
  38415. * interface and is not intended to be instantiated directly.
  38416. */
  38417. export class TileDiscardPolicy {
  38418. constructor();
  38419. /**
  38420. * Determines if the discard policy is ready to process images.
  38421. * @returns True if the discard policy is ready to process images; otherwise, false.
  38422. */
  38423. isReady(): boolean;
  38424. /**
  38425. * Given a tile image, decide whether to discard that image.
  38426. * @param image - An image to test.
  38427. * @returns True if the image should be discarded; otherwise, false.
  38428. */
  38429. shouldDiscardImage(image: HTMLImageElement): boolean;
  38430. }
  38431. export namespace TileMapServiceImageryProvider {
  38432. /**
  38433. * Initialization options for the TileMapServiceImageryProvider constructor
  38434. * @property [url = '.'] - Path to image tiles on server.
  38435. * @property [fileExtension = 'png'] - The file extension for images on the server.
  38436. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  38437. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  38438. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  38439. * to result in rendering problems.
  38440. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  38441. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  38442. * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal
  38443. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  38444. * is used.
  38445. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  38446. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  38447. * parameter is specified, the WGS84 ellipsoid is used.
  38448. * @property [tileWidth = 256] - Pixel width of image tiles.
  38449. * @property [tileHeight = 256] - Pixel height of image tiles.
  38450. * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml.
  38451. * Specifying this option will do the same, allowing for loading of these incorrect tilesets.
  38452. */
  38453. type ConstructorOptions = {
  38454. url?: Resource | string | Promise<Resource> | Promise<string>;
  38455. fileExtension?: string;
  38456. credit?: Credit | string;
  38457. minimumLevel?: number;
  38458. maximumLevel?: number;
  38459. rectangle?: Rectangle;
  38460. tilingScheme?: TilingScheme;
  38461. ellipsoid?: Ellipsoid;
  38462. tileWidth?: number;
  38463. tileHeight?: number;
  38464. flipXY?: boolean;
  38465. };
  38466. }
  38467. /**
  38468. * An imagery provider that provides tiled imagery as generated by
  38469. * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc.
  38470. * @example
  38471. * var tms = new Cesium.TileMapServiceImageryProvider({
  38472. * url : '../images/cesium_maptiler/Cesium_Logo_Color',
  38473. * fileExtension: 'png',
  38474. * maximumLevel: 4,
  38475. * rectangle: new Cesium.Rectangle(
  38476. * Cesium.Math.toRadians(-120.0),
  38477. * Cesium.Math.toRadians(20.0),
  38478. * Cesium.Math.toRadians(-60.0),
  38479. * Cesium.Math.toRadians(40.0))
  38480. * });
  38481. * @param options - Object describing initialization options
  38482. */
  38483. export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider {
  38484. constructor(options: TileMapServiceImageryProvider.ConstructorOptions);
  38485. }
  38486. /**
  38487. * Provides functionality for ImageryProviders that have time dynamic imagery
  38488. * @param options - Object with the following properties:
  38489. * @param options.clock - A Clock instance that is used when determining the value for the time dimension. Required when <code>options.times</code> is specified.
  38490. * @param options.times - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  38491. * @param options.requestImageFunction - A function that will request imagery tiles.
  38492. * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded.
  38493. */
  38494. export class TimeDynamicImagery {
  38495. constructor(options: {
  38496. clock: Clock;
  38497. times: TimeIntervalCollection;
  38498. requestImageFunction: (...params: any[]) => any;
  38499. reloadFunction: (...params: any[]) => any;
  38500. });
  38501. /**
  38502. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  38503. */
  38504. clock: Clock;
  38505. /**
  38506. * Gets or sets a time interval collection.
  38507. */
  38508. times: TimeIntervalCollection;
  38509. /**
  38510. * Gets the current interval.
  38511. */
  38512. currentInterval: TimeInterval;
  38513. /**
  38514. * Gets the tile from the cache if its available.
  38515. * @param x - The tile X coordinate.
  38516. * @param y - The tile Y coordinate.
  38517. * @param level - The tile level.
  38518. * @param [request] - The request object. Intended for internal use only.
  38519. * @returns A promise for the image that will resolve when the image is available, or
  38520. * undefined if the tile is not in the cache.
  38521. */
  38522. getFromCache(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement> | undefined;
  38523. /**
  38524. * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will
  38525. * just add the tile to a list to preload when we approach the next interval.
  38526. * @param x - The tile X coordinate.
  38527. * @param y - The tile Y coordinate.
  38528. * @param level - The tile level.
  38529. * @param [request] - The request object. Intended for internal use only.
  38530. */
  38531. checkApproachingInterval(x: number, y: number, level: number, request?: Request): void;
  38532. }
  38533. /**
  38534. * Provides playback of time-dynamic point cloud data.
  38535. * <p>
  38536. * Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed.
  38537. * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently
  38538. * small or the clock is sufficiently slow then no frames will be skipped.
  38539. * </p>
  38540. * @param options - Object with the following properties:
  38541. * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension.
  38542. * @param options.intervals - A {@link TimeIntervalCollection} with its data property being an object containing a <code>uri</code> to a 3D Tiles Point Cloud tile and an optional <code>transform</code>.
  38543. * @param [options.show = true] - Determines if the point cloud will be shown.
  38544. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the point cloud.
  38545. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the point cloud casts or receives shadows from light sources.
  38546. * @param [options.maximumMemoryUsage = 256] - The maximum amount of memory in MB that can be used by the point cloud.
  38547. * @param [options.shading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting.
  38548. * @param [options.style] - The style, defined using the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}, applied to each point in the point cloud.
  38549. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  38550. */
  38551. export class TimeDynamicPointCloud {
  38552. constructor(options: {
  38553. clock: Clock;
  38554. intervals: TimeIntervalCollection;
  38555. show?: boolean;
  38556. modelMatrix?: Matrix4;
  38557. shadows?: ShadowMode;
  38558. maximumMemoryUsage?: number;
  38559. shading?: any;
  38560. style?: Cesium3DTileStyle;
  38561. clippingPlanes?: ClippingPlaneCollection;
  38562. });
  38563. /**
  38564. * Determines if the point cloud will be shown.
  38565. */
  38566. show: boolean;
  38567. /**
  38568. * A 4x4 transformation matrix that transforms the point cloud.
  38569. */
  38570. modelMatrix: Matrix4;
  38571. /**
  38572. * Determines whether the point cloud casts or receives shadows from light sources.
  38573. * <p>
  38574. * Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view.
  38575. * </p>
  38576. * <p>
  38577. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  38578. * </p>
  38579. */
  38580. shadows: ShadowMode;
  38581. /**
  38582. * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.
  38583. * <p>
  38584. * Frames that are not being loaded or rendered are unloaded to enforce this.
  38585. * </p>
  38586. * <p>
  38587. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  38588. * </p>
  38589. */
  38590. maximumMemoryUsage: number;
  38591. /**
  38592. * Options for controlling point size based on geometric error and eye dome lighting.
  38593. */
  38594. shading: PointCloudShading;
  38595. /**
  38596. * The style, defined using the
  38597. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},
  38598. * applied to each point in the point cloud.
  38599. * <p>
  38600. * Assign <code>undefined</code> to remove the style, which will restore the visual
  38601. * appearance of the point cloud to its default when no style was applied.
  38602. * </p>
  38603. * @example
  38604. * pointCloud.style = new Cesium.Cesium3DTileStyle({
  38605. * color : {
  38606. * conditions : [
  38607. * ['${Classification} === 0', 'color("purple", 0.5)'],
  38608. * ['${Classification} === 1', 'color("red")'],
  38609. * ['true', '${COLOR}']
  38610. * ]
  38611. * },
  38612. * show : '${Classification} !== 2'
  38613. * });
  38614. */
  38615. style: Cesium3DTileStyle;
  38616. /**
  38617. * The event fired to indicate that a frame failed to load. A frame may fail to load if the
  38618. * request for its uri fails or processing fails due to invalid content.
  38619. * <p>
  38620. * If there are no event listeners, error messages will be logged to the console.
  38621. * </p>
  38622. * <p>
  38623. * The error object passed to the listener contains two properties:
  38624. * <ul>
  38625. * <li><code>uri</code>: the uri of the failed frame.</li>
  38626. * <li><code>message</code>: the error message.</li>
  38627. * </ul>
  38628. * @example
  38629. * pointCloud.frameFailed.addEventListener(function(error) {
  38630. * console.log('An error occurred loading frame: ' + error.uri);
  38631. * console.log('Error: ' + error.message);
  38632. * });
  38633. */
  38634. frameFailed: Event;
  38635. /**
  38636. * The event fired to indicate that a new frame was rendered.
  38637. * <p>
  38638. * The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener.
  38639. * </p>
  38640. * @example
  38641. * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {
  38642. * viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);
  38643. * });
  38644. */
  38645. frameChanged: Event;
  38646. /**
  38647. * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  38648. */
  38649. clippingPlanes: ClippingPlaneCollection;
  38650. /**
  38651. * The total amount of GPU memory in bytes used by the point cloud.
  38652. */
  38653. readonly totalMemoryUsageInBytes: number;
  38654. /**
  38655. * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered.
  38656. */
  38657. readonly boundingSphere: BoundingSphere;
  38658. /**
  38659. * Gets the promise that will be resolved when the point cloud renders a frame for the first time.
  38660. */
  38661. readonly readyPromise: Promise<TimeDynamicPointCloud>;
  38662. /**
  38663. * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all
  38664. * points to re-evaluate the style in the next frame.
  38665. */
  38666. makeStyleDirty(): void;
  38667. /**
  38668. * Returns true if this object was destroyed; otherwise, false.
  38669. * <br /><br />
  38670. * If this object was destroyed, it should not be used; calling any function other than
  38671. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38672. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  38673. */
  38674. isDestroyed(): boolean;
  38675. /**
  38676. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38677. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38678. * <br /><br />
  38679. * Once an object is destroyed, it should not be used; calling any function other than
  38680. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38681. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38682. * @example
  38683. * pointCloud = pointCloud && pointCloud.destroy();
  38684. */
  38685. destroy(): void;
  38686. }
  38687. export namespace UrlTemplateImageryProvider {
  38688. /**
  38689. * Initialization options for the UrlTemplateImageryProvider constructor
  38690. * @property [options] - Object with the following properties:
  38691. * @property url - The URL template to use to request tiles. It has the following keywords:
  38692. * <ul>
  38693. * <li><code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  38694. * <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  38695. * <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  38696. * <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  38697. * <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  38698. * <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  38699. * <li><code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.</li>
  38700. * <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  38701. * <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  38702. * <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  38703. * <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  38704. * <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  38705. * <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  38706. * <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  38707. * <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  38708. * <li><code>{width}</code>: The width of each tile in pixels.</li>
  38709. * <li><code>{height}</code>: The height of each tile in pixels.</li>
  38710. * </ul>
  38711. * @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified,
  38712. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no
  38713. * features picked. The URL template supports all of the keywords supported by the <code>url</code>
  38714. * parameter, plus the following:
  38715. * <ul>
  38716. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  38717. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  38718. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  38719. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  38720. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  38721. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  38722. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38723. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38724. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  38725. * </ul>
  38726. * @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where
  38727. * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  38728. * urlSchemeZeroPadding : { '{x}' : '0000'}
  38729. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  38730. * It the passed object has the following keywords:
  38731. * <ul>
  38732. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  38733. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  38734. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  38735. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  38736. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  38737. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  38738. * </ul>
  38739. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  38740. * If this parameter is a single string, each character in the string is a subdomain. If it is
  38741. * an array, each element in the array is a subdomain.
  38742. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  38743. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  38744. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  38745. * to result in rendering problems.
  38746. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  38747. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  38748. * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal
  38749. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  38750. * is used.
  38751. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  38752. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  38753. * parameter is specified, the WGS84 ellipsoid is used.
  38754. * @property [tileWidth = 256] - Pixel width of image tiles.
  38755. * @property [tileHeight = 256] - Pixel height of image tiles.
  38756. * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider
  38757. * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if
  38758. * present, will be ignored. If this property is true, any images without an alpha channel will
  38759. * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage
  38760. * and texture upload time are potentially reduced.
  38761. * @property [getFeatureInfoFormats] - The formats in which to get feature information at a
  38762. * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this
  38763. * parameter is not specified, feature picking is disabled.
  38764. * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  38765. * request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  38766. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38767. * features) without communicating with the server. Set this property to false if you know your data
  38768. * source does not support picking features or if you don't want this provider's features to be pickable. Note
  38769. * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}
  38770. * property.
  38771. * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.
  38772. */
  38773. type ConstructorOptions = {
  38774. options?: Promise<object> | any;
  38775. url: Resource | string;
  38776. pickFeaturesUrl?: Resource | string;
  38777. urlSchemeZeroPadding?: any;
  38778. subdomains?: string | string[];
  38779. credit?: Credit | string;
  38780. minimumLevel?: number;
  38781. maximumLevel?: number;
  38782. rectangle?: Rectangle;
  38783. tilingScheme?: TilingScheme;
  38784. ellipsoid?: Ellipsoid;
  38785. tileWidth?: number;
  38786. tileHeight?: number;
  38787. hasAlphaChannel?: boolean;
  38788. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  38789. enablePickFeatures?: boolean;
  38790. customTags?: any;
  38791. };
  38792. }
  38793. /**
  38794. * Provides imagery by requesting tiles using a specified URL template.
  38795. * @example
  38796. * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project
  38797. * var tms = new Cesium.UrlTemplateImageryProvider({
  38798. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',
  38799. * credit : '© Analytical Graphics, Inc.',
  38800. * tilingScheme : new Cesium.GeographicTilingScheme(),
  38801. * maximumLevel : 5
  38802. * });
  38803. * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.
  38804. * var positron = new Cesium.UrlTemplateImageryProvider({
  38805. * url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
  38806. * credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
  38807. * });
  38808. * // Access a Web Map Service (WMS) server.
  38809. * var wms = new Cesium.UrlTemplateImageryProvider({
  38810. * url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' +
  38811. * 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
  38812. * 'styles=&service=WMS&version=1.1.1&request=GetMap&' +
  38813. * 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' +
  38814. * 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +
  38815. * 'width=256&height=256',
  38816. * rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013)
  38817. * });
  38818. * // Using custom tags in your template url.
  38819. * var custom = new Cesium.UrlTemplateImageryProvider({
  38820. * url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',
  38821. * customTags : {
  38822. * Time: function(imageryProvider, x, y, level) {
  38823. * return '20171231'
  38824. * }
  38825. * }
  38826. * });
  38827. * @param options - Object describing initialization options
  38828. */
  38829. export class UrlTemplateImageryProvider {
  38830. constructor(options: UrlTemplateImageryProvider.ConstructorOptions);
  38831. /**
  38832. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  38833. * 1.0 representing fully opaque.
  38834. */
  38835. defaultAlpha: number | undefined;
  38836. /**
  38837. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  38838. * 1.0 representing fully opaque.
  38839. */
  38840. defaultNightAlpha: number | undefined;
  38841. /**
  38842. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  38843. * 1.0 representing fully opaque.
  38844. */
  38845. defaultDayAlpha: number | undefined;
  38846. /**
  38847. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  38848. * makes the imagery darker while greater than 1.0 makes it brighter.
  38849. */
  38850. defaultBrightness: number | undefined;
  38851. /**
  38852. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  38853. * the contrast while greater than 1.0 increases it.
  38854. */
  38855. defaultContrast: number | undefined;
  38856. /**
  38857. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  38858. */
  38859. defaultHue: number | undefined;
  38860. /**
  38861. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  38862. * saturation while greater than 1.0 increases it.
  38863. */
  38864. defaultSaturation: number | undefined;
  38865. /**
  38866. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  38867. */
  38868. defaultGamma: number | undefined;
  38869. /**
  38870. * The default texture minification filter to apply to this provider.
  38871. */
  38872. defaultMinificationFilter: TextureMinificationFilter;
  38873. /**
  38874. * The default texture magnification filter to apply to this provider.
  38875. */
  38876. defaultMagnificationFilter: TextureMagnificationFilter;
  38877. /**
  38878. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  38879. * request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  38880. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  38881. * features) without communicating with the server. Set this property to false if you know your data
  38882. * source does not support picking features or if you don't want this provider's features to be pickable.
  38883. */
  38884. enablePickFeatures: boolean;
  38885. /**
  38886. * Gets the URL template to use to request tiles. It has the following keywords:
  38887. * <ul>
  38888. * <li> <code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  38889. * <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  38890. * <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  38891. * <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  38892. * <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  38893. * <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  38894. * <li> <code>{reverseZ}</code>: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.</li>
  38895. * <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  38896. * <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  38897. * <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  38898. * <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  38899. * <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  38900. * <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  38901. * <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  38902. * <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  38903. * <li> <code>{width}</code>: The width of each tile in pixels.</li>
  38904. * <li> <code>{height}</code>: The height of each tile in pixels.</li>
  38905. * </ul>
  38906. */
  38907. readonly url: string;
  38908. /**
  38909. * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on
  38910. * the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  38911. * urlSchemeZeroPadding : { '{x}' : '0000'}
  38912. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  38913. * It has the following keywords:
  38914. * <ul>
  38915. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  38916. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  38917. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  38918. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  38919. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  38920. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  38921. * </ul>
  38922. */
  38923. readonly urlSchemeZeroPadding: any;
  38924. /**
  38925. * Gets the URL template to use to use to pick features. If this property is not specified,
  38926. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no
  38927. * features picked. The URL template supports all of the keywords supported by the
  38928. * {@link UrlTemplateImageryProvider#url} property, plus the following:
  38929. * <ul>
  38930. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  38931. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  38932. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  38933. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  38934. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  38935. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  38936. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38937. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  38938. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  38939. * </ul>
  38940. */
  38941. readonly pickFeaturesUrl: string;
  38942. /**
  38943. * Gets the proxy used by this provider.
  38944. */
  38945. readonly proxy: Proxy;
  38946. /**
  38947. * Gets the width of each tile, in pixels. This function should
  38948. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38949. */
  38950. readonly tileWidth: number;
  38951. /**
  38952. * Gets the height of each tile, in pixels. This function should
  38953. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38954. */
  38955. readonly tileHeight: number;
  38956. /**
  38957. * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit.
  38958. * This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38959. */
  38960. readonly maximumLevel: number | undefined;
  38961. /**
  38962. * Gets the minimum level-of-detail that can be requested. This function should
  38963. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38964. */
  38965. readonly minimumLevel: number;
  38966. /**
  38967. * Gets the tiling scheme used by this provider. This function should
  38968. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38969. */
  38970. readonly tilingScheme: TilingScheme;
  38971. /**
  38972. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  38973. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38974. */
  38975. readonly rectangle: Rectangle;
  38976. /**
  38977. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  38978. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  38979. * returns undefined, no tiles are filtered. This function should
  38980. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  38981. */
  38982. readonly tileDiscardPolicy: TileDiscardPolicy;
  38983. /**
  38984. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  38985. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  38986. * are passed an instance of {@link TileProviderError}.
  38987. */
  38988. readonly errorEvent: Event;
  38989. /**
  38990. * Gets a value indicating whether or not the provider is ready for use.
  38991. */
  38992. readonly ready: boolean;
  38993. /**
  38994. * Gets a promise that resolves to true when the provider is ready for use.
  38995. */
  38996. readonly readyPromise: Promise<boolean>;
  38997. /**
  38998. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  38999. * the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  39000. */
  39001. readonly credit: Credit;
  39002. /**
  39003. * Gets a value indicating whether or not the images provided by this imagery provider
  39004. * include an alpha channel. If this property is false, an alpha channel, if present, will
  39005. * be ignored. If this property is true, any images without an alpha channel will be treated
  39006. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  39007. * and texture upload time are reduced. This function should
  39008. * not be called before {@link ImageryProvider#ready} returns true.
  39009. */
  39010. readonly hasAlphaChannel: boolean;
  39011. /**
  39012. * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not
  39013. * recommended because existing tiles provided by the imagery provider will not be updated.
  39014. * @param options - Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor.
  39015. */
  39016. reinitialize(options: Promise<object> | any): void;
  39017. /**
  39018. * Gets the credits to be displayed when a given tile is displayed.
  39019. * @param x - The tile X coordinate.
  39020. * @param y - The tile Y coordinate.
  39021. * @param level - The tile level;
  39022. * @returns The credits to be displayed when the tile is displayed.
  39023. */
  39024. getTileCredits(x: number, y: number, level: number): Credit[];
  39025. /**
  39026. * Requests the image for a given tile. This function should
  39027. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  39028. * @param x - The tile X coordinate.
  39029. * @param y - The tile Y coordinate.
  39030. * @param level - The tile level.
  39031. * @param [request] - The request object. Intended for internal use only.
  39032. * @returns A promise for the image that will resolve when the image is available, or
  39033. * undefined if there are too many active requests to the server, and the request
  39034. * should be retried later. The resolved image may be either an
  39035. * Image or a Canvas DOM object.
  39036. */
  39037. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  39038. /**
  39039. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  39040. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  39041. * @param x - The tile X coordinate.
  39042. * @param y - The tile Y coordinate.
  39043. * @param level - The tile level.
  39044. * @param longitude - The longitude at which to pick features.
  39045. * @param latitude - The latitude at which to pick features.
  39046. * @returns A promise for the picked features that will resolve when the asynchronous
  39047. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  39048. * instances. The array may be empty if no features are found at the given location.
  39049. * It may also be undefined if picking is not supported.
  39050. */
  39051. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  39052. }
  39053. /**
  39054. * The vertical location of an origin relative to an object, e.g., a {@link Billboard}
  39055. * or {@link Label}. For example, setting the vertical origin to <code>TOP</code>
  39056. * or <code>BOTTOM</code> will display a billboard above or below (in screen space)
  39057. * the anchor position.
  39058. * <br /><br />
  39059. * <div align='center'>
  39060. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  39061. * </div>
  39062. */
  39063. export enum VerticalOrigin {
  39064. /**
  39065. * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.
  39066. */
  39067. CENTER = 0,
  39068. /**
  39069. * The origin is at the bottom of the object.
  39070. */
  39071. BOTTOM = 1,
  39072. /**
  39073. * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.
  39074. */
  39075. BASELINE = 2,
  39076. /**
  39077. * The origin is at the top of the object.
  39078. */
  39079. TOP = -1
  39080. }
  39081. /**
  39082. * A viewport aligned quad.
  39083. * @example
  39084. * var viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));
  39085. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
  39086. * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport.
  39087. * @param [material] - The {@link Material} defining the surface appearance of the viewport quad.
  39088. */
  39089. export class ViewportQuad {
  39090. constructor(rectangle?: BoundingRectangle, material?: Material);
  39091. /**
  39092. * Determines if the viewport quad primitive will be shown.
  39093. */
  39094. show: boolean;
  39095. /**
  39096. * The BoundingRectangle defining the quad's position within the viewport.
  39097. * @example
  39098. * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);
  39099. */
  39100. rectangle: BoundingRectangle;
  39101. /**
  39102. * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with
  39103. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  39104. * <p>
  39105. * The default material is <code>Material.ColorType</code>.
  39106. * </p>
  39107. * @example
  39108. * // 1. Change the color of the default material to yellow
  39109. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  39110. *
  39111. * // 2. Change material to horizontal stripes
  39112. * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);
  39113. */
  39114. material: Material;
  39115. /**
  39116. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  39117. * get the draw commands needed to render this primitive.
  39118. * <p>
  39119. * Do not call this function directly. This is documented just to
  39120. * list the exceptions that may be propagated when the scene is rendered:
  39121. * </p>
  39122. */
  39123. update(): void;
  39124. /**
  39125. * Returns true if this object was destroyed; otherwise, false.
  39126. * <br /><br />
  39127. * If this object was destroyed, it should not be used; calling any function other than
  39128. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39129. * @returns True if this object was destroyed; otherwise, false.
  39130. */
  39131. isDestroyed(): boolean;
  39132. /**
  39133. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39134. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39135. * <br /><br />
  39136. * Once an object is destroyed, it should not be used; calling any function other than
  39137. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39138. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39139. * @example
  39140. * quad = quad && quad.destroy();
  39141. */
  39142. destroy(): void;
  39143. }
  39144. export namespace WebMapServiceImageryProvider {
  39145. /**
  39146. * Initialization options for the WebMapServiceImageryProvider constructor
  39147. * @property url - The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}.
  39148. * @property layers - The layers to include, separated by commas.
  39149. * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL.
  39150. * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
  39151. * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke
  39152. * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false,
  39153. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  39154. * without communicating with the server. Set this property to false if you know your WMS server does not support
  39155. * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically
  39156. * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.
  39157. * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats
  39158. * in which to try WMS GetFeatureInfo requests.
  39159. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  39160. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  39161. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  39162. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  39163. * parameter is specified, the WGS84 ellipsoid is used.
  39164. * @property [tileWidth = 256] - The width of each tile in pixels.
  39165. * @property [tileHeight = 256] - The height of each tile in pixels.
  39166. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when
  39167. * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is
  39168. * likely to result in rendering problems.
  39169. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  39170. * If not specified, there is no limit.
  39171. * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0.
  39172. * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1
  39173. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  39174. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  39175. * If this parameter is a single string, each character in the string is a subdomain. If it is
  39176. * an array, each element in the array is a subdomain.
  39177. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  39178. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values.
  39179. */
  39180. type ConstructorOptions = {
  39181. url: Resource | string;
  39182. layers: string;
  39183. parameters?: any;
  39184. getFeatureInfoParameters?: any;
  39185. enablePickFeatures?: boolean;
  39186. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  39187. rectangle?: Rectangle;
  39188. tilingScheme?: TilingScheme;
  39189. ellipsoid?: Ellipsoid;
  39190. tileWidth?: number;
  39191. tileHeight?: number;
  39192. minimumLevel?: number;
  39193. maximumLevel?: number;
  39194. crs?: string;
  39195. srs?: string;
  39196. credit?: Credit | string;
  39197. subdomains?: string | string[];
  39198. clock?: Clock;
  39199. times?: TimeIntervalCollection;
  39200. };
  39201. }
  39202. /**
  39203. * Provides tiled imagery hosted by a Web Map Service (WMS) server.
  39204. * @example
  39205. * var provider = new Cesium.WebMapServiceImageryProvider({
  39206. * url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',
  39207. * layers : '0',
  39208. * proxy: new Cesium.DefaultProxy('/proxy/')
  39209. * });
  39210. *
  39211. * viewer.imageryLayers.addImageryProvider(provider);
  39212. * @param options - Object describing initialization options
  39213. */
  39214. export class WebMapServiceImageryProvider {
  39215. constructor(options: WebMapServiceImageryProvider.ConstructorOptions);
  39216. /**
  39217. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  39218. * 1.0 representing fully opaque.
  39219. */
  39220. defaultAlpha: number | undefined;
  39221. /**
  39222. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  39223. * 1.0 representing fully opaque.
  39224. */
  39225. defaultNightAlpha: number | undefined;
  39226. /**
  39227. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  39228. * 1.0 representing fully opaque.
  39229. */
  39230. defaultDayAlpha: number | undefined;
  39231. /**
  39232. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  39233. * makes the imagery darker while greater than 1.0 makes it brighter.
  39234. */
  39235. defaultBrightness: number | undefined;
  39236. /**
  39237. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  39238. * the contrast while greater than 1.0 increases it.
  39239. */
  39240. defaultContrast: number | undefined;
  39241. /**
  39242. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  39243. */
  39244. defaultHue: number | undefined;
  39245. /**
  39246. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  39247. * saturation while greater than 1.0 increases it.
  39248. */
  39249. defaultSaturation: number | undefined;
  39250. /**
  39251. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  39252. */
  39253. defaultGamma: number | undefined;
  39254. /**
  39255. * The default texture minification filter to apply to this provider.
  39256. */
  39257. defaultMinificationFilter: TextureMinificationFilter;
  39258. /**
  39259. * The default texture magnification filter to apply to this provider.
  39260. */
  39261. defaultMagnificationFilter: TextureMagnificationFilter;
  39262. /**
  39263. * Gets the URL of the WMS server.
  39264. */
  39265. readonly url: string;
  39266. /**
  39267. * Gets the proxy used by this provider.
  39268. */
  39269. readonly proxy: Proxy;
  39270. /**
  39271. * Gets the names of the WMS layers, separated by commas.
  39272. */
  39273. readonly layers: string;
  39274. /**
  39275. * Gets the width of each tile, in pixels. This function should
  39276. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39277. */
  39278. readonly tileWidth: number;
  39279. /**
  39280. * Gets the height of each tile, in pixels. This function should
  39281. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39282. */
  39283. readonly tileHeight: number;
  39284. /**
  39285. * Gets the maximum level-of-detail that can be requested. This function should
  39286. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39287. */
  39288. readonly maximumLevel: number | undefined;
  39289. /**
  39290. * Gets the minimum level-of-detail that can be requested. This function should
  39291. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39292. */
  39293. readonly minimumLevel: number;
  39294. /**
  39295. * Gets the tiling scheme used by this provider. This function should
  39296. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39297. */
  39298. readonly tilingScheme: TilingScheme;
  39299. /**
  39300. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  39301. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39302. */
  39303. readonly rectangle: Rectangle;
  39304. /**
  39305. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  39306. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  39307. * returns undefined, no tiles are filtered. This function should
  39308. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39309. */
  39310. readonly tileDiscardPolicy: TileDiscardPolicy;
  39311. /**
  39312. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  39313. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  39314. * are passed an instance of {@link TileProviderError}.
  39315. */
  39316. readonly errorEvent: Event;
  39317. /**
  39318. * Gets a value indicating whether or not the provider is ready for use.
  39319. */
  39320. readonly ready: boolean;
  39321. /**
  39322. * Gets a promise that resolves to true when the provider is ready for use.
  39323. */
  39324. readonly readyPromise: Promise<boolean>;
  39325. /**
  39326. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  39327. * the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39328. */
  39329. readonly credit: Credit;
  39330. /**
  39331. * Gets a value indicating whether or not the images provided by this imagery provider
  39332. * include an alpha channel. If this property is false, an alpha channel, if present, will
  39333. * be ignored. If this property is true, any images without an alpha channel will be treated
  39334. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  39335. * and texture upload time are reduced.
  39336. */
  39337. readonly hasAlphaChannel: boolean;
  39338. /**
  39339. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will
  39340. * invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response. If false,
  39341. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  39342. * features) without communicating with the server. Set this property to false if you know your data
  39343. * source does not support picking features or if you don't want this provider's features to be pickable.
  39344. */
  39345. enablePickFeatures: boolean;
  39346. /**
  39347. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  39348. */
  39349. clock: Clock;
  39350. /**
  39351. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  39352. * TimeInterval is an object containing the keys and values of the properties that are used during
  39353. * tile requests.
  39354. */
  39355. times: TimeIntervalCollection;
  39356. /**
  39357. * Gets the credits to be displayed when a given tile is displayed.
  39358. * @param x - The tile X coordinate.
  39359. * @param y - The tile Y coordinate.
  39360. * @param level - The tile level;
  39361. * @returns The credits to be displayed when the tile is displayed.
  39362. */
  39363. getTileCredits(x: number, y: number, level: number): Credit[];
  39364. /**
  39365. * Requests the image for a given tile. This function should
  39366. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  39367. * @param x - The tile X coordinate.
  39368. * @param y - The tile Y coordinate.
  39369. * @param level - The tile level.
  39370. * @param [request] - The request object. Intended for internal use only.
  39371. * @returns A promise for the image that will resolve when the image is available, or
  39372. * undefined if there are too many active requests to the server, and the request
  39373. * should be retried later. The resolved image may be either an
  39374. * Image or a Canvas DOM object.
  39375. */
  39376. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  39377. /**
  39378. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  39379. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  39380. * @param x - The tile X coordinate.
  39381. * @param y - The tile Y coordinate.
  39382. * @param level - The tile level.
  39383. * @param longitude - The longitude at which to pick features.
  39384. * @param latitude - The latitude at which to pick features.
  39385. * @returns A promise for the picked features that will resolve when the asynchronous
  39386. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  39387. * instances. The array may be empty if no features are found at the given location.
  39388. */
  39389. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  39390. /**
  39391. * The default parameters to include in the WMS URL to obtain images. The values are as follows:
  39392. * service=WMS
  39393. * version=1.1.1
  39394. * request=GetMap
  39395. * styles=
  39396. * format=image/jpeg
  39397. */
  39398. static readonly DefaultParameters: any;
  39399. /**
  39400. * The default parameters to include in the WMS URL to get feature information. The values are as follows:
  39401. * service=WMS
  39402. * version=1.1.1
  39403. * request=GetFeatureInfo
  39404. */
  39405. static readonly GetFeatureInfoDefaultParameters: any;
  39406. }
  39407. export namespace WebMapTileServiceImageryProvider {
  39408. /**
  39409. * Initialization options for the WebMapTileServiceImageryProvider constructor
  39410. * @property url - The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: &#123;style&#125;, &#123;TileMatrixSet&#125;, &#123;TileMatrix&#125;, &#123;TileRow&#125;, &#123;TileCol&#125;. The first two are optional if actual values are hardcoded or not required by the server. The &#123;s&#125; keyword may be used to specify subdomains.
  39411. * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server.
  39412. * @property layer - The layer name for WMTS requests.
  39413. * @property style - The style name for WMTS requests.
  39414. * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests.
  39415. * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.
  39416. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  39417. * @property [times] - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  39418. * @property [dimensions] - A object containing static dimensions and their values.
  39419. * @property [tileWidth = 256] - The tile width in pixels.
  39420. * @property [tileHeight = 256] - The tile height in pixels.
  39421. * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
  39422. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer.
  39423. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  39424. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  39425. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  39426. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  39427. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  39428. * If this parameter is a single string, each character in the string is a subdomain. If it is
  39429. * an array, each element in the array is a subdomain.
  39430. */
  39431. type ConstructorOptions = {
  39432. url: Resource | string;
  39433. format?: string;
  39434. layer: string;
  39435. style: string;
  39436. tileMatrixSetID: string;
  39437. tileMatrixLabels?: any[];
  39438. clock?: Clock;
  39439. times?: TimeIntervalCollection;
  39440. dimensions?: any;
  39441. tileWidth?: number;
  39442. tileHeight?: number;
  39443. tilingScheme?: TilingScheme;
  39444. rectangle?: Rectangle;
  39445. minimumLevel?: number;
  39446. maximumLevel?: number;
  39447. ellipsoid?: Ellipsoid;
  39448. credit?: Credit | string;
  39449. subdomains?: string | string[];
  39450. };
  39451. }
  39452. /**
  39453. * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.
  39454. * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.
  39455. * @example
  39456. * // Example 1. USGS shaded relief tiles (KVP)
  39457. * var shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
  39458. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
  39459. * layer : 'USGSShadedReliefOnly',
  39460. * style : 'default',
  39461. * format : 'image/jpeg',
  39462. * tileMatrixSetID : 'default028mm',
  39463. * // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
  39464. * maximumLevel: 19,
  39465. * credit : new Cesium.Credit('U. S. Geological Survey')
  39466. * });
  39467. * viewer.imageryLayers.addImageryProvider(shadedRelief1);
  39468. * @example
  39469. * // Example 2. USGS shaded relief tiles (RESTful)
  39470. * var shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
  39471. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
  39472. * layer : 'USGSShadedReliefOnly',
  39473. * style : 'default',
  39474. * format : 'image/jpeg',
  39475. * tileMatrixSetID : 'default028mm',
  39476. * maximumLevel: 19,
  39477. * credit : new Cesium.Credit('U. S. Geological Survey')
  39478. * });
  39479. * viewer.imageryLayers.addImageryProvider(shadedRelief2);
  39480. * @example
  39481. * // Example 3. NASA time dynamic weather data (RESTful)
  39482. * var times = Cesium.TimeIntervalCollection.fromIso8601({
  39483. * iso8601: '2015-07-30/2017-06-16/P1D',
  39484. * dataCallback: function dataCallback(interval, index) {
  39485. * return {
  39486. * Time: Cesium.JulianDate.toIso8601(interval.start)
  39487. * };
  39488. * }
  39489. * });
  39490. * var weather = new Cesium.WebMapTileServiceImageryProvider({
  39491. * url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
  39492. * layer : 'AMSR2_Snow_Water_Equivalent',
  39493. * style : 'default',
  39494. * tileMatrixSetID : '2km',
  39495. * maximumLevel : 5,
  39496. * format : 'image/png',
  39497. * clock: clock,
  39498. * times: times,
  39499. * credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
  39500. * });
  39501. * viewer.imageryLayers.addImageryProvider(weather);
  39502. * @param options - Object describing initialization options
  39503. */
  39504. export class WebMapTileServiceImageryProvider {
  39505. constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions);
  39506. /**
  39507. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  39508. * 1.0 representing fully opaque.
  39509. */
  39510. defaultAlpha: number | undefined;
  39511. /**
  39512. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  39513. * 1.0 representing fully opaque.
  39514. */
  39515. defaultNightAlpha: number | undefined;
  39516. /**
  39517. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  39518. * 1.0 representing fully opaque.
  39519. */
  39520. defaultDayAlpha: number | undefined;
  39521. /**
  39522. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  39523. * makes the imagery darker while greater than 1.0 makes it brighter.
  39524. */
  39525. defaultBrightness: number | undefined;
  39526. /**
  39527. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  39528. * the contrast while greater than 1.0 increases it.
  39529. */
  39530. defaultContrast: number | undefined;
  39531. /**
  39532. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  39533. */
  39534. defaultHue: number | undefined;
  39535. /**
  39536. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  39537. * saturation while greater than 1.0 increases it.
  39538. */
  39539. defaultSaturation: number | undefined;
  39540. /**
  39541. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  39542. */
  39543. defaultGamma: number | undefined;
  39544. /**
  39545. * The default texture minification filter to apply to this provider.
  39546. */
  39547. defaultMinificationFilter: TextureMinificationFilter;
  39548. /**
  39549. * The default texture magnification filter to apply to this provider.
  39550. */
  39551. defaultMagnificationFilter: TextureMagnificationFilter;
  39552. /**
  39553. * Gets the URL of the service hosting the imagery.
  39554. */
  39555. readonly url: string;
  39556. /**
  39557. * Gets the proxy used by this provider.
  39558. */
  39559. readonly proxy: Proxy;
  39560. /**
  39561. * Gets the width of each tile, in pixels. This function should
  39562. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39563. */
  39564. readonly tileWidth: number;
  39565. /**
  39566. * Gets the height of each tile, in pixels. This function should
  39567. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39568. */
  39569. readonly tileHeight: number;
  39570. /**
  39571. * Gets the maximum level-of-detail that can be requested. This function should
  39572. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39573. */
  39574. readonly maximumLevel: number | undefined;
  39575. /**
  39576. * Gets the minimum level-of-detail that can be requested. This function should
  39577. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39578. */
  39579. readonly minimumLevel: number;
  39580. /**
  39581. * Gets the tiling scheme used by this provider. This function should
  39582. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39583. */
  39584. readonly tilingScheme: TilingScheme;
  39585. /**
  39586. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  39587. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39588. */
  39589. readonly rectangle: Rectangle;
  39590. /**
  39591. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  39592. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  39593. * returns undefined, no tiles are filtered. This function should
  39594. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39595. */
  39596. readonly tileDiscardPolicy: TileDiscardPolicy;
  39597. /**
  39598. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  39599. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  39600. * are passed an instance of {@link TileProviderError}.
  39601. */
  39602. readonly errorEvent: Event;
  39603. /**
  39604. * Gets the mime type of images returned by this imagery provider.
  39605. */
  39606. readonly format: string;
  39607. /**
  39608. * Gets a value indicating whether or not the provider is ready for use.
  39609. */
  39610. readonly ready: boolean;
  39611. /**
  39612. * Gets a promise that resolves to true when the provider is ready for use.
  39613. */
  39614. readonly readyPromise: Promise<boolean>;
  39615. /**
  39616. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  39617. * the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39618. */
  39619. readonly credit: Credit;
  39620. /**
  39621. * Gets a value indicating whether or not the images provided by this imagery provider
  39622. * include an alpha channel. If this property is false, an alpha channel, if present, will
  39623. * be ignored. If this property is true, any images without an alpha channel will be treated
  39624. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  39625. * and texture upload time are reduced.
  39626. */
  39627. readonly hasAlphaChannel: boolean;
  39628. /**
  39629. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  39630. */
  39631. clock: Clock;
  39632. /**
  39633. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  39634. * TimeInterval is an object containing the keys and values of the properties that are used during
  39635. * tile requests.
  39636. */
  39637. times: TimeIntervalCollection;
  39638. /**
  39639. * Gets or sets an object that contains static dimensions and their values.
  39640. */
  39641. dimensions: any;
  39642. /**
  39643. * Gets the credits to be displayed when a given tile is displayed.
  39644. * @param x - The tile X coordinate.
  39645. * @param y - The tile Y coordinate.
  39646. * @param level - The tile level;
  39647. * @returns The credits to be displayed when the tile is displayed.
  39648. */
  39649. getTileCredits(x: number, y: number, level: number): Credit[];
  39650. /**
  39651. * Requests the image for a given tile. This function should
  39652. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  39653. * @param x - The tile X coordinate.
  39654. * @param y - The tile Y coordinate.
  39655. * @param level - The tile level.
  39656. * @param [request] - The request object. Intended for internal use only.
  39657. * @returns A promise for the image that will resolve when the image is available, or
  39658. * undefined if there are too many active requests to the server, and the request
  39659. * should be retried later. The resolved image may be either an
  39660. * Image or a Canvas DOM object.
  39661. */
  39662. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement | HTMLCanvasElement> | undefined;
  39663. /**
  39664. * Picking features is not currently supported by this imagery provider, so this function simply returns
  39665. * undefined.
  39666. * @param x - The tile X coordinate.
  39667. * @param y - The tile Y coordinate.
  39668. * @param level - The tile level.
  39669. * @param longitude - The longitude at which to pick features.
  39670. * @param latitude - The latitude at which to pick features.
  39671. * @returns A promise for the picked features that will resolve when the asynchronous
  39672. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  39673. * instances. The array may be empty if no features are found at the given location.
  39674. * It may also be undefined if picking is not supported.
  39675. */
  39676. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  39677. }
  39678. /**
  39679. * @property height - The height.
  39680. * @property color - The color at this height.
  39681. */
  39682. export type createElevationBandMaterialEntry = {
  39683. height: number;
  39684. color: Color;
  39685. };
  39686. /**
  39687. * @property entries - A list of elevation entries. They will automatically be sorted from lowest to highest. If there is only one entry and <code>extendsDownards</code> and <code>extendUpwards</code> are both <code>false</code>, they will both be set to <code>true</code>.
  39688. * @property [extendDownwards = false] - If <code>true</code>, the band's minimum elevation color will extend infinitely downwards.
  39689. * @property [extendUpwards = false] - If <code>true</code>, the band's maximum elevation color will extend infinitely upwards.
  39690. */
  39691. export type createElevationBandMaterialBand = {
  39692. entries: createElevationBandMaterialEntry[];
  39693. extendDownwards?: boolean;
  39694. extendUpwards?: boolean;
  39695. };
  39696. /**
  39697. * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights.
  39698. *
  39699. * The shader does a binary search over all the heights to find out which colors are above and below a given height, and
  39700. * interpolates between them for the final color. This material supports hundreds of entries relatively cheaply.
  39701. * @example
  39702. * scene.globe.material = Cesium.createElevationBandMaterial({
  39703. * scene : scene,
  39704. * layers : [{
  39705. * entries : [{
  39706. * height : 4200.0,
  39707. * color : new Cesium.Color(0.0, 0.0, 0.0, 1.0)
  39708. * }, {
  39709. * height : 8848.0,
  39710. * color : new Cesium.Color(1.0, 1.0, 1.0, 1.0)
  39711. * }],
  39712. * extendDownwards : true,
  39713. * extendUpwards : true,
  39714. * }, {
  39715. * entries : [{
  39716. * height : 7000.0,
  39717. * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
  39718. * }, {
  39719. * height : 7100.0,
  39720. * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
  39721. * }]
  39722. * }]
  39723. * });
  39724. * @param options - Object with the following properties:
  39725. * @param options.scene - The scene where the visualization is taking place.
  39726. * @param options.layers - A list of bands ordered from lowest to highest precedence.
  39727. * @returns A new {@link Material} instance.
  39728. */
  39729. export function createElevationBandMaterial(options: {
  39730. scene: Scene;
  39731. layers: createElevationBandMaterialBand[];
  39732. }): Material;
  39733. /**
  39734. * Creates a {@link Cesium3DTileset} instance for the
  39735. * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}
  39736. * tileset.
  39737. * @example
  39738. * // Create Cesium OSM Buildings with default styling
  39739. * var viewer = new Cesium.Viewer('cesiumContainer');
  39740. * viewer.scene.primitives.add(Cesium.createOsmBuildings());
  39741. * @example
  39742. * // Create Cesium OSM Buildings with a custom style highlighting
  39743. * // schools and hospitals.
  39744. * viewer.scene.primitives.add(Cesium.createOsmBuildings({
  39745. * style: new Cesium.Cesium3DTileStyle({
  39746. * color: {
  39747. * conditions: [
  39748. * ["${feature['building']} === 'hospital'", "color('#0000FF')"],
  39749. * ["${feature['building']} === 'school'", "color('#00FF00')"],
  39750. * [true, "color('#ffffff')"]
  39751. * ]
  39752. * }
  39753. * })
  39754. * }));
  39755. * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor
  39756. * may be specified here. In addition to those, the following properties are supported:
  39757. * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings
  39758. * that do not have a color. This parameter is ignored if <code>options.style</code> is specified.
  39759. * @param [options.style] - The style to use with the tileset. If not
  39760. * specified, a default style is used which gives each building or building part a
  39761. * color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred,
  39762. * <code>options.defaultColor</code> is used.
  39763. * @param [options.showOutline = true] - Whether to show outlines around buildings. When true,
  39764. * outlines are displayed. When false, outlines are not displayed.
  39765. */
  39766. export function createOsmBuildings(options?: {
  39767. defaultColor?: Color;
  39768. style?: Cesium3DTileStyle;
  39769. showOutline?: boolean;
  39770. }): Cesium3DTileset;
  39771. /**
  39772. * Creates a {@link Primitive} to visualize well-known vector vertex attributes:
  39773. * <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal
  39774. * is red; tangent is green; and bitangent is blue. If an attribute is not
  39775. * present, it is not drawn.
  39776. * @example
  39777. * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({
  39778. * geometry : instance.geometry,
  39779. * length : 100000.0,
  39780. * modelMatrix : instance.modelMatrix
  39781. * }));
  39782. * @param options - Object with the following properties:
  39783. * @param options.geometry - The <code>Geometry</code> instance with the attribute.
  39784. * @param [options.length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
  39785. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  39786. * @returns A new <code>Primitive</code> instance with geometry for the vectors.
  39787. */
  39788. export function createTangentSpaceDebugPrimitive(options: {
  39789. geometry: Geometry;
  39790. length?: number;
  39791. modelMatrix?: Matrix4;
  39792. }): Primitive;
  39793. /**
  39794. * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.
  39795. * @example
  39796. * // Create Cesium World Terrain with default settings
  39797. * var viewer = new Cesium.Viewer('cesiumContainer', {
  39798. * imageryProvider : Cesium.createWorldImagery();
  39799. * });
  39800. * @example
  39801. * // Create Cesium World Terrain with water and normals.
  39802. * var viewer = new Cesium.Viewer('cesiumContainer', {
  39803. * imageryProvider : Cesium.createWorldImagery({
  39804. * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
  39805. * })
  39806. * });
  39807. * @param [options] - Object with the following properties:
  39808. * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.
  39809. */
  39810. export function createWorldImagery(options?: {
  39811. style?: IonWorldImageryStyle;
  39812. }): IonImageryProvider;
  39813. /**
  39814. * <span style="display: block; text-align: center;">
  39815. * <img src="Images/AnimationWidget.png" width="211" height="142" alt="" />
  39816. * <br />Animation widget
  39817. * </span>
  39818. * <br /><br />
  39819. * The Animation widget provides buttons for play, pause, and reverse, along with the
  39820. * current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
  39821. * <br /><br />
  39822. * The "shuttle ring" concept is borrowed from video editing, where typically a
  39823. * "jog wheel" can be rotated to move past individual animation frames very slowly, and
  39824. * a surrounding shuttle ring can be twisted to control direction and speed of fast playback.
  39825. * Cesium typically treats time as continuous (not broken into pre-defined animation frames),
  39826. * so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and
  39827. * very slow playback. Click and drag the shuttle ring pointer itself (shown above in green),
  39828. * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
  39829. * <br /><br />
  39830. * The Animation widget also provides a "realtime" button (in the upper-left) that keeps
  39831. * animation time in sync with the end user's system clock, typically displaying
  39832. * "today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or
  39833. * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.
  39834. * @example
  39835. * // In HTML head, include a link to Animation.css stylesheet,
  39836. * // and in the body, include: <div id="animationContainer"></div>
  39837. *
  39838. * var clock = new Cesium.Clock();
  39839. * var clockViewModel = new Cesium.ClockViewModel(clock);
  39840. * var viewModel = new Cesium.AnimationViewModel(clockViewModel);
  39841. * var widget = new Cesium.Animation('animationContainer', viewModel);
  39842. *
  39843. * function tick() {
  39844. * clock.tick();
  39845. * Cesium.requestAnimationFrame(tick);
  39846. * }
  39847. * Cesium.requestAnimationFrame(tick);
  39848. * @param container - The DOM element or ID that will contain the widget.
  39849. * @param viewModel - The view model used by this widget.
  39850. */
  39851. export class Animation {
  39852. constructor(container: Element | string, viewModel: AnimationViewModel);
  39853. /**
  39854. * Gets the parent container.
  39855. */
  39856. readonly container: Element;
  39857. /**
  39858. * Gets the view model.
  39859. */
  39860. readonly viewModel: AnimationViewModel;
  39861. /**
  39862. * @returns true if the object has been destroyed, false otherwise.
  39863. */
  39864. isDestroyed(): boolean;
  39865. /**
  39866. * Destroys the animation widget. Should be called if permanently
  39867. * removing the widget from layout.
  39868. */
  39869. destroy(): void;
  39870. /**
  39871. * Resizes the widget to match the container size.
  39872. * This function should be called whenever the container size is changed.
  39873. */
  39874. resize(): void;
  39875. /**
  39876. * Updates the widget to reflect any modified CSS rules for theming.
  39877. * @example
  39878. * //Switch to the cesium-lighter theme.
  39879. * document.body.className = 'cesium-lighter';
  39880. * animation.applyThemeChanges();
  39881. */
  39882. applyThemeChanges(): void;
  39883. }
  39884. /**
  39885. * The view model for the {@link Animation} widget.
  39886. * @param clockViewModel - The ClockViewModel instance to use.
  39887. */
  39888. export class AnimationViewModel {
  39889. constructor(clockViewModel: ClockViewModel);
  39890. /**
  39891. * Gets or sets whether the shuttle ring is currently being dragged. This property is observable.
  39892. */
  39893. shuttleRingDragging: boolean;
  39894. /**
  39895. * Gets or sets whether dragging the shuttle ring should cause the multiplier
  39896. * to snap to the defined tick values rather than interpolating between them.
  39897. * This property is observable.
  39898. */
  39899. snapToTicks: boolean;
  39900. /**
  39901. * Gets the string representation of the current time. This property is observable.
  39902. */
  39903. timeLabel: string;
  39904. /**
  39905. * Gets the string representation of the current date. This property is observable.
  39906. */
  39907. dateLabel: string;
  39908. /**
  39909. * Gets the string representation of the current multiplier. This property is observable.
  39910. */
  39911. multiplierLabel: string;
  39912. /**
  39913. * Gets or sets the current shuttle ring angle. This property is observable.
  39914. */
  39915. shuttleRingAngle: number;
  39916. /**
  39917. * Gets or sets the default date formatter used by new instances.
  39918. */
  39919. static defaultDateFormatter: AnimationViewModel.DateFormatter;
  39920. /**
  39921. * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.
  39922. */
  39923. static defaultTicks: number[];
  39924. /**
  39925. * Gets or sets the default time formatter used by new instances.
  39926. */
  39927. static defaultTimeFormatter: AnimationViewModel.TimeFormatter;
  39928. /**
  39929. * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.
  39930. * @returns The array of known clock multipliers associated with the shuttle ring.
  39931. */
  39932. getShuttleRingTicks(): number[];
  39933. /**
  39934. * Sets the array of positive known clock multipliers to associate with the shuttle ring.
  39935. * These values will have negative equivalents created for them and sets both the minimum
  39936. * and maximum range of values for the shuttle ring as well as the values that are snapped
  39937. * to when a single click is made. The values need not be in order, as they will be sorted
  39938. * automatically, and duplicate values will be removed.
  39939. * @param positiveTicks - The list of known positive clock multipliers to associate with the shuttle ring.
  39940. */
  39941. setShuttleRingTicks(positiveTicks: number[]): void;
  39942. /**
  39943. * Gets a command that decreases the speed of animation.
  39944. */
  39945. slower: Command;
  39946. /**
  39947. * Gets a command that increases the speed of animation.
  39948. */
  39949. faster: Command;
  39950. /**
  39951. * Gets the clock view model.
  39952. */
  39953. clockViewModel: ClockViewModel;
  39954. /**
  39955. * Gets the pause toggle button view model.
  39956. */
  39957. pauseViewModel: ToggleButtonViewModel;
  39958. /**
  39959. * Gets the reverse toggle button view model.
  39960. */
  39961. playReverseViewModel: ToggleButtonViewModel;
  39962. /**
  39963. * Gets the play toggle button view model.
  39964. */
  39965. playForwardViewModel: ToggleButtonViewModel;
  39966. /**
  39967. * Gets the realtime toggle button view model.
  39968. */
  39969. playRealtimeViewModel: ToggleButtonViewModel;
  39970. /**
  39971. * Gets or sets the function which formats a date for display.
  39972. */
  39973. dateFormatter: AnimationViewModel.DateFormatter;
  39974. /**
  39975. * Gets or sets the function which formats a time for display.
  39976. */
  39977. timeFormatter: AnimationViewModel.TimeFormatter;
  39978. }
  39979. export namespace AnimationViewModel {
  39980. /**
  39981. * A function that formats a date for display.
  39982. * @param date - The date to be formatted
  39983. * @param viewModel - The AnimationViewModel instance requesting formatting.
  39984. */
  39985. type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  39986. /**
  39987. * A function that formats a time for display.
  39988. * @param date - The date to be formatted
  39989. * @param viewModel - The AnimationViewModel instance requesting formatting.
  39990. */
  39991. type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  39992. }
  39993. /**
  39994. * <span style="display: block; text-align: center;">
  39995. * <img src="Images/BaseLayerPicker.png" width="264" height="287" alt="" />
  39996. * <br />BaseLayerPicker with its drop-panel open.
  39997. * </span>
  39998. * <br /><br />
  39999. * The BaseLayerPicker is a single button widget that displays a panel of available imagery and
  40000. * terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted
  40001. * as the base layer of the imagery collection; removing the existing base. When terrain is selected,
  40002. * it replaces the current terrain provider. Each item in the available providers list contains a name,
  40003. * a representative icon, and a tooltip to display more information when hovered. The list is initially
  40004. * empty, and must be configured before use, as illustrated in the below example.
  40005. * @example
  40006. * // In HTML head, include a link to the BaseLayerPicker.css stylesheet,
  40007. * // and in the body, include: <div id="baseLayerPickerContainer"
  40008. * // style="position:absolute;top:24px;right:24px;width:38px;height:38px;"></div>
  40009. *
  40010. * //Create the list of available providers we would like the user to select from.
  40011. * //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image.
  40012. * var imageryViewModels = [];
  40013. * imageryViewModels.push(new Cesium.ProviderViewModel({
  40014. * name : 'Open\u00adStreet\u00adMap',
  40015. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),
  40016. * tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \
  40017. * map of the world.\nhttp://www.openstreetmap.org',
  40018. * creationFunction : function() {
  40019. * return new Cesium.OpenStreetMapImageryProvider({
  40020. * url : 'https://a.tile.openstreetmap.org/'
  40021. * });
  40022. * }
  40023. * }));
  40024. *
  40025. * imageryViewModels.push(new Cesium.ProviderViewModel({
  40026. * name : 'Earth at Night',
  40027. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'),
  40028. * tooltip : 'The lights of cities and villages trace the outlines of civilization \
  40029. * in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.',
  40030. * creationFunction : function() {
  40031. * return new Cesium.IonImageryProvider({ assetId: 3812 });
  40032. * }
  40033. * }));
  40034. *
  40035. * imageryViewModels.push(new Cesium.ProviderViewModel({
  40036. * name : 'Natural Earth\u00a0II',
  40037. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),
  40038. * tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/',
  40039. * creationFunction : function() {
  40040. * return new Cesium.TileMapServiceImageryProvider({
  40041. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
  40042. * });
  40043. * }
  40044. * }));
  40045. *
  40046. * //Create a CesiumWidget without imagery, if you haven't already done so.
  40047. * var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false });
  40048. *
  40049. * //Finally, create the baseLayerPicker widget using our view models.
  40050. * var layers = cesiumWidget.imageryLayers;
  40051. * var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {
  40052. * globe : cesiumWidget.scene.globe,
  40053. * imageryProviderViewModels : imageryViewModels
  40054. * });
  40055. * @param container - The parent HTML container node or ID for this widget.
  40056. * @param options - Object with the following properties:
  40057. * @param options.globe - The Globe to use.
  40058. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  40059. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  40060. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  40061. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  40062. */
  40063. export class BaseLayerPicker {
  40064. constructor(container: Element | string, options: {
  40065. globe: Globe;
  40066. imageryProviderViewModels?: ProviderViewModel[];
  40067. selectedImageryProviderViewModel?: ProviderViewModel;
  40068. terrainProviderViewModels?: ProviderViewModel[];
  40069. selectedTerrainProviderViewModel?: ProviderViewModel;
  40070. });
  40071. /**
  40072. * Gets the parent container.
  40073. */
  40074. container: Element;
  40075. /**
  40076. * Gets the view model.
  40077. */
  40078. viewModel: BaseLayerPickerViewModel;
  40079. /**
  40080. * @returns true if the object has been destroyed, false otherwise.
  40081. */
  40082. isDestroyed(): boolean;
  40083. /**
  40084. * Destroys the widget. Should be called if permanently
  40085. * removing the widget from layout.
  40086. */
  40087. destroy(): void;
  40088. }
  40089. /**
  40090. * The view model for {@link BaseLayerPicker}.
  40091. * @param options - Object with the following properties:
  40092. * @param options.globe - The Globe to use.
  40093. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  40094. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  40095. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  40096. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  40097. */
  40098. export class BaseLayerPickerViewModel {
  40099. constructor(options: {
  40100. globe: Globe;
  40101. imageryProviderViewModels?: ProviderViewModel[];
  40102. selectedImageryProviderViewModel?: ProviderViewModel;
  40103. terrainProviderViewModels?: ProviderViewModel[];
  40104. selectedTerrainProviderViewModel?: ProviderViewModel;
  40105. });
  40106. /**
  40107. * Gets or sets an array of ProviderViewModel instances available for imagery selection.
  40108. * This property is observable.
  40109. */
  40110. imageryProviderViewModels: ProviderViewModel[];
  40111. /**
  40112. * Gets or sets an array of ProviderViewModel instances available for terrain selection.
  40113. * This property is observable.
  40114. */
  40115. terrainProviderViewModels: ProviderViewModel[];
  40116. /**
  40117. * Gets or sets whether the imagery selection drop-down is currently visible.
  40118. */
  40119. dropDownVisible: boolean;
  40120. /**
  40121. * Gets the button tooltip. This property is observable.
  40122. */
  40123. buttonTooltip: string;
  40124. /**
  40125. * Gets the button background image. This property is observable.
  40126. */
  40127. buttonImageUrl: string;
  40128. /**
  40129. * Gets or sets the currently selected imagery. This property is observable.
  40130. */
  40131. selectedImagery: ProviderViewModel;
  40132. /**
  40133. * Gets or sets the currently selected terrain. This property is observable.
  40134. */
  40135. selectedTerrain: ProviderViewModel;
  40136. /**
  40137. * Gets the command to toggle the visibility of the drop down.
  40138. */
  40139. toggleDropDown: Command;
  40140. /**
  40141. * Gets the globe.
  40142. */
  40143. globe: Globe;
  40144. }
  40145. /**
  40146. * A view model that represents each item in the {@link BaseLayerPicker}.
  40147. * @param options - The object containing all parameters.
  40148. * @param options.name - The name of the layer.
  40149. * @param options.tooltip - The tooltip to show when the item is moused over.
  40150. * @param options.iconUrl - An icon representing the layer.
  40151. * @param [options.category] - A category for the layer.
  40152. * @param options.creationFunction - A function or Command
  40153. * that creates one or more providers which will be added to the globe when this item is selected.
  40154. */
  40155. export class ProviderViewModel {
  40156. constructor(options: {
  40157. name: string;
  40158. tooltip: string;
  40159. iconUrl: string;
  40160. category?: string;
  40161. creationFunction: ProviderViewModel.CreationFunction | Command;
  40162. });
  40163. /**
  40164. * Gets the display name. This property is observable.
  40165. */
  40166. name: string;
  40167. /**
  40168. * Gets the tooltip. This property is observable.
  40169. */
  40170. tooltip: string;
  40171. /**
  40172. * Gets the icon. This property is observable.
  40173. */
  40174. iconUrl: string;
  40175. /**
  40176. * Gets the Command that creates one or more providers which will be added to
  40177. * the globe when this item is selected.
  40178. */
  40179. readonly creationCommand: Command;
  40180. /**
  40181. * Gets the category
  40182. */
  40183. readonly category: string;
  40184. }
  40185. export namespace ProviderViewModel {
  40186. /**
  40187. * A function which creates one or more providers.
  40188. */
  40189. type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[];
  40190. }
  40191. /**
  40192. * Inspector widget to aid in debugging 3D Tiles
  40193. * @param container - The DOM element or ID that will contain the widget.
  40194. * @param scene - the Scene instance to use.
  40195. */
  40196. export class Cesium3DTilesInspector {
  40197. constructor(container: Element | string, scene: Scene);
  40198. /**
  40199. * Gets the parent container.
  40200. */
  40201. container: Element;
  40202. /**
  40203. * Gets the view model.
  40204. */
  40205. viewModel: Cesium3DTilesInspectorViewModel;
  40206. /**
  40207. * @returns true if the object has been destroyed, false otherwise.
  40208. */
  40209. isDestroyed(): boolean;
  40210. /**
  40211. * Destroys the widget. Should be called if permanently
  40212. * removing the widget from layout.
  40213. */
  40214. destroy(): void;
  40215. }
  40216. /**
  40217. * The view model for {@link Cesium3DTilesInspector}.
  40218. * @param scene - The scene instance to use.
  40219. * @param performanceContainer - The container for the performance display
  40220. */
  40221. export class Cesium3DTilesInspectorViewModel {
  40222. constructor(scene: Scene, performanceContainer: HTMLElement);
  40223. /**
  40224. * Gets or sets the flag to enable performance display. This property is observable.
  40225. */
  40226. performance: boolean;
  40227. /**
  40228. * Gets or sets the flag to show statistics. This property is observable.
  40229. */
  40230. showStatistics: boolean;
  40231. /**
  40232. * Gets or sets the flag to show pick statistics. This property is observable.
  40233. */
  40234. showPickStatistics: boolean;
  40235. /**
  40236. * Gets or sets the flag to show the inspector. This property is observable.
  40237. */
  40238. inspectorVisible: boolean;
  40239. /**
  40240. * Gets or sets the flag to show the tileset section. This property is observable.
  40241. */
  40242. tilesetVisible: boolean;
  40243. /**
  40244. * Gets or sets the flag to show the display section. This property is observable.
  40245. */
  40246. displayVisible: boolean;
  40247. /**
  40248. * Gets or sets the flag to show the update section. This property is observable.
  40249. */
  40250. updateVisible: boolean;
  40251. /**
  40252. * Gets or sets the flag to show the logging section. This property is observable.
  40253. */
  40254. loggingVisible: boolean;
  40255. /**
  40256. * Gets or sets the flag to show the style section. This property is observable.
  40257. */
  40258. styleVisible: boolean;
  40259. /**
  40260. * Gets or sets the flag to show the tile info section. This property is observable.
  40261. */
  40262. tileDebugLabelsVisible: boolean;
  40263. /**
  40264. * Gets or sets the flag to show the optimization info section. This property is observable.
  40265. */
  40266. optimizationVisible: boolean;
  40267. /**
  40268. * Gets or sets the JSON for the tileset style. This property is observable.
  40269. */
  40270. styleString: string;
  40271. /**
  40272. * Gets the names of the properties in the tileset. This property is observable.
  40273. */
  40274. readonly properties: string[];
  40275. /**
  40276. * Gets or sets the flag to enable dynamic screen space error. This property is observable.
  40277. */
  40278. dynamicScreenSpaceError: boolean;
  40279. /**
  40280. * Gets or sets the color blend mode. This property is observable.
  40281. */
  40282. colorBlendMode: Cesium3DTileColorBlendMode;
  40283. /**
  40284. * Gets or sets the flag to enable picking. This property is observable.
  40285. */
  40286. picking: boolean;
  40287. /**
  40288. * Gets or sets the flag to colorize tiles. This property is observable.
  40289. */
  40290. colorize: boolean;
  40291. /**
  40292. * Gets or sets the flag to draw with wireframe. This property is observable.
  40293. */
  40294. wireframe: boolean;
  40295. /**
  40296. * Gets or sets the flag to show bounding volumes. This property is observable.
  40297. */
  40298. showBoundingVolumes: boolean;
  40299. /**
  40300. * Gets or sets the flag to show content volumes. This property is observable.
  40301. */
  40302. showContentBoundingVolumes: boolean;
  40303. /**
  40304. * Gets or sets the flag to show request volumes. This property is observable.
  40305. */
  40306. showRequestVolumes: boolean;
  40307. /**
  40308. * Gets or sets the flag to suspend updates. This property is observable.
  40309. */
  40310. freezeFrame: boolean;
  40311. /**
  40312. * Gets or sets the flag to show debug labels only for the currently picked tile. This property is observable.
  40313. */
  40314. showOnlyPickedTileDebugLabel: boolean;
  40315. /**
  40316. * Gets or sets the flag to show tile geometric error. This property is observable.
  40317. */
  40318. showGeometricError: boolean;
  40319. /**
  40320. * Displays the number of commands, points, triangles and features used per tile. This property is observable.
  40321. */
  40322. showRenderingStatistics: boolean;
  40323. /**
  40324. * Displays the memory used per tile. This property is observable.
  40325. */
  40326. showMemoryUsage: boolean;
  40327. /**
  40328. * Gets or sets the flag to show the tile url. This property is observable.
  40329. */
  40330. showUrl: boolean;
  40331. /**
  40332. * Gets or sets the maximum screen space error. This property is observable.
  40333. */
  40334. maximumScreenSpaceError: number;
  40335. /**
  40336. * Gets or sets the dynamic screen space error density. This property is observable.
  40337. */
  40338. dynamicScreenSpaceErrorDensity: number;
  40339. /**
  40340. * Gets or sets the dynamic screen space error density slider value.
  40341. * This allows the slider to be exponential because values tend to be closer to 0 than 1.
  40342. * This property is observable.
  40343. */
  40344. dynamicScreenSpaceErrorDensitySliderValue: number;
  40345. /**
  40346. * Gets or sets the dynamic screen space error factor. This property is observable.
  40347. */
  40348. dynamicScreenSpaceErrorFactor: number;
  40349. /**
  40350. * Gets or sets the flag to enable point cloud shading. This property is observable.
  40351. */
  40352. pointCloudShading: boolean;
  40353. /**
  40354. * Gets or sets the geometric error scale. This property is observable.
  40355. */
  40356. geometricErrorScale: number;
  40357. /**
  40358. * Gets or sets the maximum attenuation. This property is observable.
  40359. */
  40360. maximumAttenuation: number;
  40361. /**
  40362. * Gets or sets the base resolution. This property is observable.
  40363. */
  40364. baseResolution: number;
  40365. /**
  40366. * Gets or sets the flag to enable eye dome lighting. This property is observable.
  40367. */
  40368. eyeDomeLighting: boolean;
  40369. /**
  40370. * Gets or sets the eye dome lighting strength. This property is observable.
  40371. */
  40372. eyeDomeLightingStrength: number;
  40373. /**
  40374. * Gets or sets the eye dome lighting radius. This property is observable.
  40375. */
  40376. eyeDomeLightingRadius: number;
  40377. /**
  40378. * Gets or sets the pick state
  40379. */
  40380. pickActive: boolean;
  40381. /**
  40382. * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal.
  40383. * This property is observable.
  40384. */
  40385. skipLevelOfDetail: boolean;
  40386. /**
  40387. * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable.
  40388. */
  40389. skipScreenSpaceErrorFactor: number;
  40390. /**
  40391. * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable.
  40392. */
  40393. baseScreenSpaceError: number;
  40394. /**
  40395. * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable.
  40396. */
  40397. skipLevels: number;
  40398. /**
  40399. * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded.
  40400. * This property is observable.
  40401. */
  40402. immediatelyLoadDesiredLevelOfDetail: boolean;
  40403. /**
  40404. * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal.
  40405. * This property is observable
  40406. */
  40407. loadSiblings: boolean;
  40408. /**
  40409. * Gets the scene
  40410. */
  40411. readonly scene: Scene;
  40412. /**
  40413. * Gets the performance container
  40414. */
  40415. readonly performanceContainer: HTMLElement;
  40416. /**
  40417. * Gets the statistics text. This property is observable.
  40418. */
  40419. readonly statisticsText: string;
  40420. /**
  40421. * Gets the pick statistics text. This property is observable.
  40422. */
  40423. readonly pickStatisticsText: string;
  40424. /**
  40425. * Gets the available blend modes
  40426. */
  40427. readonly colorBlendModes: object[];
  40428. /**
  40429. * Gets the editor error message
  40430. */
  40431. readonly editorError: string;
  40432. /**
  40433. * Gets or sets the tileset of the view model.
  40434. */
  40435. tileset: Cesium3DTileset;
  40436. /**
  40437. * Gets the current feature of the view model.
  40438. */
  40439. feature: Cesium3DTileFeature;
  40440. /**
  40441. * Gets the current tile of the view model
  40442. */
  40443. tile: Cesium3DTile;
  40444. /**
  40445. * Toggles the pick tileset mode
  40446. */
  40447. togglePickTileset(): void;
  40448. /**
  40449. * Toggles the inspector visibility
  40450. */
  40451. toggleInspector(): void;
  40452. /**
  40453. * Toggles the visibility of the tileset section
  40454. */
  40455. toggleTileset(): void;
  40456. /**
  40457. * Toggles the visibility of the display section
  40458. */
  40459. toggleDisplay(): void;
  40460. /**
  40461. * Toggles the visibility of the update section
  40462. */
  40463. toggleUpdate(): void;
  40464. /**
  40465. * Toggles the visibility of the logging section
  40466. */
  40467. toggleLogging(): void;
  40468. /**
  40469. * Toggles the visibility of the style section
  40470. */
  40471. toggleStyle(): void;
  40472. /**
  40473. * Toggles the visibility of the tile Debug Info section
  40474. */
  40475. toggleTileDebugLabels(): void;
  40476. /**
  40477. * Toggles the visibility of the optimization section
  40478. */
  40479. toggleOptimization(): void;
  40480. /**
  40481. * Trims tile cache
  40482. */
  40483. trimTilesCache(): void;
  40484. /**
  40485. * Compiles the style in the style editor.
  40486. */
  40487. compileStyle(): void;
  40488. /**
  40489. * Handles key press events on the style editor.
  40490. */
  40491. styleEditorKeyPress(): void;
  40492. /**
  40493. * @returns true if the object has been destroyed, false otherwise.
  40494. */
  40495. isDestroyed(): boolean;
  40496. /**
  40497. * Destroys the widget. Should be called if permanently
  40498. * removing the widget from layout.
  40499. */
  40500. destroy(): void;
  40501. /**
  40502. * Generates an HTML string of the statistics
  40503. * @param tileset - The tileset
  40504. * @param isPick - Whether this is getting the statistics for the pick pass
  40505. * @returns The formatted statistics
  40506. */
  40507. static getStatistics(tileset: Cesium3DTileset, isPick: boolean): string;
  40508. }
  40509. /**
  40510. * Inspector widget to aid in debugging
  40511. * @param container - The DOM element or ID that will contain the widget.
  40512. * @param scene - The Scene instance to use.
  40513. */
  40514. export class CesiumInspector {
  40515. constructor(container: Element | string, scene: Scene);
  40516. /**
  40517. * Gets the parent container.
  40518. */
  40519. container: Element;
  40520. /**
  40521. * Gets the view model.
  40522. */
  40523. viewModel: CesiumInspectorViewModel;
  40524. /**
  40525. * @returns true if the object has been destroyed, false otherwise.
  40526. */
  40527. isDestroyed(): boolean;
  40528. /**
  40529. * Destroys the widget. Should be called if permanently
  40530. * removing the widget from layout.
  40531. */
  40532. destroy(): void;
  40533. }
  40534. /**
  40535. * The view model for {@link CesiumInspector}.
  40536. * @param scene - The scene instance to use.
  40537. * @param performanceContainer - The instance to use for performance container.
  40538. */
  40539. export class CesiumInspectorViewModel {
  40540. constructor(scene: Scene, performanceContainer: Element);
  40541. /**
  40542. * Gets or sets the show frustums state. This property is observable.
  40543. */
  40544. frustums: boolean;
  40545. /**
  40546. * Gets or sets the show frustum planes state. This property is observable.
  40547. */
  40548. frustumPlanes: boolean;
  40549. /**
  40550. * Gets or sets the show performance display state. This property is observable.
  40551. */
  40552. performance: boolean;
  40553. /**
  40554. * Gets or sets the shader cache text. This property is observable.
  40555. */
  40556. shaderCacheText: string;
  40557. /**
  40558. * Gets or sets the show primitive bounding sphere state. This property is observable.
  40559. */
  40560. primitiveBoundingSphere: boolean;
  40561. /**
  40562. * Gets or sets the show primitive reference frame state. This property is observable.
  40563. */
  40564. primitiveReferenceFrame: boolean;
  40565. /**
  40566. * Gets or sets the filter primitive state. This property is observable.
  40567. */
  40568. filterPrimitive: boolean;
  40569. /**
  40570. * Gets or sets the show tile bounding sphere state. This property is observable.
  40571. */
  40572. tileBoundingSphere: boolean;
  40573. /**
  40574. * Gets or sets the filter tile state. This property is observable.
  40575. */
  40576. filterTile: boolean;
  40577. /**
  40578. * Gets or sets the show wireframe state. This property is observable.
  40579. */
  40580. wireframe: boolean;
  40581. /**
  40582. * Gets or sets the show globe depth state. This property is observable.
  40583. */
  40584. globeDepth: boolean;
  40585. /**
  40586. * Gets or sets the show pick depth state. This property is observable.
  40587. */
  40588. pickDepth: boolean;
  40589. /**
  40590. * Gets or sets the index of the depth frustum to display. This property is observable.
  40591. */
  40592. depthFrustum: number;
  40593. /**
  40594. * Gets or sets the suspend updates state. This property is observable.
  40595. */
  40596. suspendUpdates: boolean;
  40597. /**
  40598. * Gets or sets the show tile coordinates state. This property is observable.
  40599. */
  40600. tileCoordinates: boolean;
  40601. /**
  40602. * Gets or sets the frustum statistic text. This property is observable.
  40603. */
  40604. frustumStatisticText: string;
  40605. /**
  40606. * Gets or sets the selected tile information text. This property is observable.
  40607. */
  40608. tileText: string;
  40609. /**
  40610. * Gets if a primitive has been selected. This property is observable.
  40611. */
  40612. hasPickedPrimitive: boolean;
  40613. /**
  40614. * Gets if a tile has been selected. This property is observable
  40615. */
  40616. hasPickedTile: boolean;
  40617. /**
  40618. * Gets if the picking primitive command is active. This property is observable.
  40619. */
  40620. pickPrimitiveActive: boolean;
  40621. /**
  40622. * Gets if the picking tile command is active. This property is observable.
  40623. */
  40624. pickTileActive: boolean;
  40625. /**
  40626. * Gets or sets if the cesium inspector drop down is visible. This property is observable.
  40627. */
  40628. dropDownVisible: boolean;
  40629. /**
  40630. * Gets or sets if the general section is visible. This property is observable.
  40631. */
  40632. generalVisible: boolean;
  40633. /**
  40634. * Gets or sets if the primitive section is visible. This property is observable.
  40635. */
  40636. primitivesVisible: boolean;
  40637. /**
  40638. * Gets or sets if the terrain section is visible. This property is observable.
  40639. */
  40640. terrainVisible: boolean;
  40641. /**
  40642. * Gets or sets the index of the depth frustum text. This property is observable.
  40643. */
  40644. depthFrustumText: string;
  40645. /**
  40646. * Gets the scene to control.
  40647. */
  40648. scene: Scene;
  40649. /**
  40650. * Gets the container of the PerformanceDisplay
  40651. */
  40652. performanceContainer: Element;
  40653. /**
  40654. * Gets the command to toggle the visibility of the drop down.
  40655. */
  40656. toggleDropDown: Command;
  40657. /**
  40658. * Gets the command to toggle the visibility of a BoundingSphere for a primitive
  40659. */
  40660. showPrimitiveBoundingSphere: Command;
  40661. /**
  40662. * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive
  40663. */
  40664. showPrimitiveReferenceFrame: Command;
  40665. /**
  40666. * Gets the command to toggle a filter that renders only a selected primitive
  40667. */
  40668. doFilterPrimitive: Command;
  40669. /**
  40670. * Gets the command to increment the depth frustum index to be shown
  40671. */
  40672. incrementDepthFrustum: Command;
  40673. /**
  40674. * Gets the command to decrement the depth frustum index to be shown
  40675. */
  40676. decrementDepthFrustum: Command;
  40677. /**
  40678. * Gets the command to toggle the visibility of tile coordinates
  40679. */
  40680. showTileCoordinates: Command;
  40681. /**
  40682. * Gets the command to toggle the visibility of a BoundingSphere for a selected tile
  40683. */
  40684. showTileBoundingSphere: Command;
  40685. /**
  40686. * Gets the command to toggle a filter that renders only a selected tile
  40687. */
  40688. doFilterTile: Command;
  40689. /**
  40690. * Gets the command to expand and collapse the general section
  40691. */
  40692. toggleGeneral: Command;
  40693. /**
  40694. * Gets the command to expand and collapse the primitives section
  40695. */
  40696. togglePrimitives: Command;
  40697. /**
  40698. * Gets the command to expand and collapse the terrain section
  40699. */
  40700. toggleTerrain: Command;
  40701. /**
  40702. * Gets the command to pick a primitive
  40703. */
  40704. pickPrimitive: Command;
  40705. /**
  40706. * Gets the command to pick a tile
  40707. */
  40708. pickTile: Command;
  40709. /**
  40710. * Gets the command to pick a tile
  40711. */
  40712. selectParent: Command;
  40713. /**
  40714. * Gets the command to pick a tile
  40715. */
  40716. selectNW: Command;
  40717. /**
  40718. * Gets the command to pick a tile
  40719. */
  40720. selectNE: Command;
  40721. /**
  40722. * Gets the command to pick a tile
  40723. */
  40724. selectSW: Command;
  40725. /**
  40726. * Gets the command to pick a tile
  40727. */
  40728. selectSE: Command;
  40729. /**
  40730. * Gets or sets the current selected primitive
  40731. */
  40732. primitive: Command;
  40733. /**
  40734. * Gets or sets the current selected tile
  40735. */
  40736. tile: Command;
  40737. /**
  40738. * @returns true if the object has been destroyed, false otherwise.
  40739. */
  40740. isDestroyed(): boolean;
  40741. /**
  40742. * Destroys the widget. Should be called if permanently
  40743. * removing the widget from layout.
  40744. */
  40745. destroy(): void;
  40746. }
  40747. /**
  40748. * A widget containing a Cesium scene.
  40749. * @example
  40750. * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,
  40751. * // and in the body, include: <div id="cesiumContainer"></div>
  40752. *
  40753. * //Widget with no terrain and default Bing Maps imagery provider.
  40754. * var widget = new Cesium.CesiumWidget('cesiumContainer');
  40755. *
  40756. * //Widget with ion imagery and Cesium World Terrain.
  40757. * var widget = new Cesium.CesiumWidget('cesiumContainer', {
  40758. * imageryProvider : Cesium.createWorldImagery(),
  40759. * terrainProvider : Cesium.createWorldTerrain(),
  40760. * skyBox : new Cesium.SkyBox({
  40761. * sources : {
  40762. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  40763. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  40764. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  40765. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  40766. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  40767. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  40768. * }
  40769. * }),
  40770. * // Show Columbus View map with Web Mercator projection
  40771. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  40772. * mapProjection : new Cesium.WebMercatorProjection()
  40773. * });
  40774. * @param container - The DOM element or ID that will contain the widget.
  40775. * @param [options] - Object with the following properties:
  40776. * @param [options.clock = new Clock()] - The clock to use to control current time.
  40777. * @param [options.imageryProvider = createWorldImagery()] - The imagery provider to serve as the base layer. If set to <code>false</code>, no imagery provider will be added.
  40778. * @param [options.terrainProvider = new EllipsoidTerrainProvider] - The terrain provider.
  40779. * @param [options.skyBox] - The skybox used to render the stars. When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added.
  40780. * @param [options.skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  40781. * @param [options.sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  40782. * @param [options.scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  40783. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  40784. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  40785. * @param [options.globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
  40786. * @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  40787. * @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  40788. * @param [options.targetFrameRate] - The target frame rate when using the default render loop.
  40789. * @param [options.showRenderLoopErrors = true] - If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.
  40790. * @param [options.contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  40791. * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added
  40792. * to the bottom of the widget itself.
  40793. * @param [options.creditViewport] - The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself.
  40794. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  40795. * @param [options.terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  40796. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  40797. * @param [options.requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling improves performance of the application, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
  40798. * @param [options.maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
  40799. */
  40800. export class CesiumWidget {
  40801. constructor(container: Element | string, options?: {
  40802. clock?: Clock;
  40803. imageryProvider?: ImageryProvider | false;
  40804. terrainProvider?: TerrainProvider;
  40805. skyBox?: SkyBox | false;
  40806. skyAtmosphere?: SkyAtmosphere | false;
  40807. sceneMode?: SceneMode;
  40808. scene3DOnly?: boolean;
  40809. orderIndependentTranslucency?: boolean;
  40810. mapProjection?: MapProjection;
  40811. globe?: Globe | false;
  40812. useDefaultRenderLoop?: boolean;
  40813. useBrowserRecommendedResolution?: boolean;
  40814. targetFrameRate?: number;
  40815. showRenderLoopErrors?: boolean;
  40816. contextOptions?: any;
  40817. creditContainer?: Element | string;
  40818. creditViewport?: Element | string;
  40819. shadows?: boolean;
  40820. terrainShadows?: ShadowMode;
  40821. mapMode2D?: MapMode2D;
  40822. requestRenderMode?: boolean;
  40823. maximumRenderTimeChange?: number;
  40824. });
  40825. /**
  40826. * Gets the parent container.
  40827. */
  40828. readonly container: Element;
  40829. /**
  40830. * Gets the canvas.
  40831. */
  40832. readonly canvas: HTMLCanvasElement;
  40833. /**
  40834. * Gets the credit container.
  40835. */
  40836. readonly creditContainer: Element;
  40837. /**
  40838. * Gets the credit viewport
  40839. */
  40840. readonly creditViewport: Element;
  40841. /**
  40842. * Gets the scene.
  40843. */
  40844. readonly scene: Scene;
  40845. /**
  40846. * Gets the collection of image layers that will be rendered on the globe.
  40847. */
  40848. readonly imageryLayers: ImageryLayerCollection;
  40849. /**
  40850. * The terrain provider providing surface geometry for the globe.
  40851. */
  40852. terrainProvider: TerrainProvider;
  40853. /**
  40854. * Gets the camera.
  40855. */
  40856. readonly camera: Camera;
  40857. /**
  40858. * Gets the clock.
  40859. */
  40860. readonly clock: Clock;
  40861. /**
  40862. * Gets the screen space event handler.
  40863. */
  40864. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  40865. /**
  40866. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  40867. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  40868. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  40869. * than the underlying requestAnimationFrame implementation will have no effect.
  40870. */
  40871. targetFrameRate: number;
  40872. /**
  40873. * Gets or sets whether or not this widget should control the render loop.
  40874. * If set to true the widget will use {@link requestAnimationFrame} to
  40875. * perform rendering and resizing of the widget, as well as drive the
  40876. * simulation clock. If set to false, you must manually call the
  40877. * <code>resize</code>, <code>render</code> methods as part of a custom
  40878. * render loop. If an error occurs during rendering, {@link Scene}'s
  40879. * <code>renderError</code> event will be raised and this property
  40880. * will be set to false. It must be set back to true to continue rendering
  40881. * after the error.
  40882. */
  40883. useDefaultRenderLoop: boolean;
  40884. /**
  40885. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  40886. * performance on less powerful devices while values greater than 1.0 will render at a higher
  40887. * resolution and then scale down, resulting in improved visual fidelity.
  40888. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  40889. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  40890. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  40891. */
  40892. resolutionScale: number;
  40893. /**
  40894. * Boolean flag indicating if the browser's recommended resolution is used.
  40895. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  40896. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  40897. * performance on less powerful devices that have high pixel density. When false, rendering
  40898. * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether
  40899. * this flag is true or false.
  40900. */
  40901. useBrowserRecommendedResolution: boolean;
  40902. /**
  40903. * Show an error panel to the user containing a title and a longer error message,
  40904. * which can be dismissed using an OK button. This panel is displayed automatically
  40905. * when a render loop error occurs, if showRenderLoopErrors was not false when the
  40906. * widget was constructed.
  40907. * @param title - The title to be displayed on the error panel. This string is interpreted as text.
  40908. * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML.
  40909. * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text.
  40910. */
  40911. showErrorPanel(title: string, message?: string, error?: string): void;
  40912. /**
  40913. * @returns true if the object has been destroyed, false otherwise.
  40914. */
  40915. isDestroyed(): boolean;
  40916. /**
  40917. * Destroys the widget. Should be called if permanently
  40918. * removing the widget from layout.
  40919. */
  40920. destroy(): void;
  40921. /**
  40922. * Updates the canvas size, camera aspect ratio, and viewport size.
  40923. * This function is called automatically as needed unless
  40924. * <code>useDefaultRenderLoop</code> is set to false.
  40925. */
  40926. resize(): void;
  40927. /**
  40928. * Renders the scene. This function is called automatically
  40929. * unless <code>useDefaultRenderLoop</code> is set to false;
  40930. */
  40931. render(): void;
  40932. }
  40933. /**
  40934. * A view model which exposes a {@link Clock} for user interfaces.
  40935. * @param [clock] - The clock object wrapped by this view model, if undefined a new instance will be created.
  40936. */
  40937. export class ClockViewModel {
  40938. constructor(clock?: Clock);
  40939. /**
  40940. * Gets the current system time.
  40941. * This property is observable.
  40942. */
  40943. systemTime: JulianDate;
  40944. /**
  40945. * Gets or sets the start time of the clock.
  40946. * See {@link Clock#startTime}.
  40947. * This property is observable.
  40948. */
  40949. startTime: JulianDate;
  40950. /**
  40951. * Gets or sets the stop time of the clock.
  40952. * See {@link Clock#stopTime}.
  40953. * This property is observable.
  40954. */
  40955. stopTime: JulianDate;
  40956. /**
  40957. * Gets or sets the current time.
  40958. * See {@link Clock#currentTime}.
  40959. * This property is observable.
  40960. */
  40961. currentTime: JulianDate;
  40962. /**
  40963. * Gets or sets the clock multiplier.
  40964. * See {@link Clock#multiplier}.
  40965. * This property is observable.
  40966. */
  40967. multiplier: number;
  40968. /**
  40969. * Gets or sets the clock step setting.
  40970. * See {@link Clock#clockStep}.
  40971. * This property is observable.
  40972. */
  40973. clockStep: ClockStep;
  40974. /**
  40975. * Gets or sets the clock range setting.
  40976. * See {@link Clock#clockRange}.
  40977. * This property is observable.
  40978. */
  40979. clockRange: ClockRange;
  40980. /**
  40981. * Gets or sets whether the clock can animate.
  40982. * See {@link Clock#canAnimate}.
  40983. * This property is observable.
  40984. */
  40985. canAnimate: boolean;
  40986. /**
  40987. * Gets or sets whether the clock should animate.
  40988. * See {@link Clock#shouldAnimate}.
  40989. * This property is observable.
  40990. */
  40991. shouldAnimate: boolean;
  40992. /**
  40993. * Gets the underlying Clock.
  40994. */
  40995. clock: Clock;
  40996. /**
  40997. * Updates the view model with the contents of the underlying clock.
  40998. * Can be called to force an update of the viewModel if the underlying
  40999. * clock has changed and <code>Clock.tick</code> has not yet been called.
  41000. */
  41001. synchronize(): void;
  41002. /**
  41003. * @returns true if the object has been destroyed, false otherwise.
  41004. */
  41005. isDestroyed(): boolean;
  41006. /**
  41007. * Destroys the view model. Should be called to
  41008. * properly clean up the view model when it is no longer needed.
  41009. */
  41010. destroy(): void;
  41011. }
  41012. /**
  41013. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  41014. * whether the command can be executed. When executed, a Command function will check the
  41015. * value of <code>canExecute</code> and throw if false.
  41016. *
  41017. * This type describes an interface and is not intended to be instantiated directly.
  41018. * See {@link createCommand} to create a command from a function.
  41019. */
  41020. export class Command {
  41021. constructor();
  41022. /**
  41023. * Gets whether this command can currently be executed. This property is observable.
  41024. */
  41025. canExecute: boolean;
  41026. /**
  41027. * Gets an event which is raised before the command executes, the event
  41028. * is raised with an object containing two properties: a <code>cancel</code> property,
  41029. * which if set to false by the listener will prevent the command from being executed, and
  41030. * an <code>args</code> property, which is the array of arguments being passed to the command.
  41031. */
  41032. beforeExecute: Event;
  41033. /**
  41034. * Gets an event which is raised after the command executes, the event
  41035. * is raised with the return value of the command as its only parameter.
  41036. */
  41037. afterExecute: Event;
  41038. }
  41039. /**
  41040. * A single button widget for toggling fullscreen mode.
  41041. * @param container - The DOM element or ID that will contain the widget.
  41042. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  41043. */
  41044. export class FullscreenButton {
  41045. constructor(container: Element | string, fullscreenElement?: Element | string);
  41046. /**
  41047. * Gets the parent container.
  41048. */
  41049. container: Element;
  41050. /**
  41051. * Gets the view model.
  41052. */
  41053. viewModel: FullscreenButtonViewModel;
  41054. /**
  41055. * @returns true if the object has been destroyed, false otherwise.
  41056. */
  41057. isDestroyed(): boolean;
  41058. /**
  41059. * Destroys the widget. Should be called if permanently
  41060. * removing the widget from layout.
  41061. */
  41062. destroy(): void;
  41063. }
  41064. /**
  41065. * The view model for {@link FullscreenButton}.
  41066. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  41067. * @param [container] - The DOM element or ID that will contain the widget.
  41068. */
  41069. export class FullscreenButtonViewModel {
  41070. constructor(fullscreenElement?: Element | string, container?: Element | string);
  41071. /**
  41072. * Gets whether or not fullscreen mode is active. This property is observable.
  41073. */
  41074. isFullscreen: boolean;
  41075. /**
  41076. * Gets or sets whether or not fullscreen functionality should be enabled. This property is observable.
  41077. */
  41078. isFullscreenEnabled: boolean;
  41079. /**
  41080. * Gets the tooltip. This property is observable.
  41081. */
  41082. tooltip: string;
  41083. /**
  41084. * Gets or sets the HTML element to place into fullscreen mode when the
  41085. * corresponding button is pressed.
  41086. */
  41087. fullscreenElement: Element;
  41088. /**
  41089. * Gets the Command to toggle fullscreen mode.
  41090. */
  41091. command: Command;
  41092. /**
  41093. * @returns true if the object has been destroyed, false otherwise.
  41094. */
  41095. isDestroyed(): boolean;
  41096. /**
  41097. * Destroys the view model. Should be called to
  41098. * properly clean up the view model when it is no longer needed.
  41099. */
  41100. destroy(): void;
  41101. }
  41102. /**
  41103. * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is
  41104. * performed using {@link https://cesium.com/cesium-ion/|Cesium ion}.
  41105. * @param options - Object with the following properties:
  41106. * @param options.container - The DOM element or ID that will contain the widget.
  41107. * @param options.scene - The Scene instance to use.
  41108. * @param [options.geocoderServices] - The geocoder services to be used
  41109. * @param [options.autoComplete = true] - True if the geocoder should query as the user types to autocomplete
  41110. * @param [options.flightDuration = 1.5] - The duration of the camera flight to an entered location, in seconds.
  41111. * @param [options.destinationFound = GeocoderViewModel.flyToDestination] - A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination.
  41112. */
  41113. export class Geocoder {
  41114. constructor(options: {
  41115. container: Element | string;
  41116. scene: Scene;
  41117. geocoderServices?: GeocoderService[];
  41118. autoComplete?: boolean;
  41119. flightDuration?: number;
  41120. destinationFound?: Geocoder.DestinationFoundFunction;
  41121. });
  41122. /**
  41123. * Gets the parent container.
  41124. */
  41125. container: Element;
  41126. /**
  41127. * Gets the parent container.
  41128. */
  41129. searchSuggestionsContainer: Element;
  41130. /**
  41131. * Gets the view model.
  41132. */
  41133. viewModel: GeocoderViewModel;
  41134. /**
  41135. * @returns true if the object has been destroyed, false otherwise.
  41136. */
  41137. isDestroyed(): boolean;
  41138. /**
  41139. * Destroys the widget. Should be called if permanently
  41140. * removing the widget from layout.
  41141. */
  41142. destroy(): void;
  41143. }
  41144. export namespace Geocoder {
  41145. /**
  41146. * A function that handles the result of a successful geocode.
  41147. * @param viewModel - The view model.
  41148. * @param destination - The destination result of the geocode.
  41149. */
  41150. type DestinationFoundFunction = (viewModel: GeocoderViewModel, destination: Cartesian3 | Rectangle) => void;
  41151. }
  41152. /**
  41153. * The view model for the {@link Geocoder} widget.
  41154. * @param options - Object with the following properties:
  41155. * @param options.scene - The Scene instance to use.
  41156. * @param [options.geocoderServices] - Geocoder services to use for geocoding queries.
  41157. * If more than one are supplied, suggestions will be gathered for the geocoders that support it,
  41158. * and if no suggestion is selected the result from the first geocoder service wil be used.
  41159. * @param [options.flightDuration] - The duration of the camera flight to an entered location, in seconds.
  41160. * @param [options.destinationFound = GeocoderViewModel.flyToDestination] - A callback function that is called after a successful geocode. If not supplied, the default behavior is to fly the camera to the result destination.
  41161. */
  41162. export class GeocoderViewModel {
  41163. constructor(options: {
  41164. scene: Scene;
  41165. geocoderServices?: GeocoderService[];
  41166. flightDuration?: number;
  41167. destinationFound?: Geocoder.DestinationFoundFunction;
  41168. });
  41169. /**
  41170. * Gets or sets a value indicating if this instance should always show its text input field.
  41171. */
  41172. keepExpanded: boolean;
  41173. /**
  41174. * True if the geocoder should query as the user types to autocomplete
  41175. */
  41176. autoComplete: boolean;
  41177. /**
  41178. * Gets and sets the command called when a geocode destination is found
  41179. */
  41180. destinationFound: Geocoder.DestinationFoundFunction;
  41181. /**
  41182. * Gets a value indicating whether a search is currently in progress. This property is observable.
  41183. */
  41184. isSearchInProgress: boolean;
  41185. /**
  41186. * Gets or sets the text to search for. The text can be an address, or longitude, latitude,
  41187. * and optional height, where longitude and latitude are in degrees and height is in meters.
  41188. */
  41189. searchText: string;
  41190. /**
  41191. * Gets or sets the the duration of the camera flight in seconds.
  41192. * A value of zero causes the camera to instantly switch to the geocoding location.
  41193. * The duration will be computed based on the distance when undefined.
  41194. */
  41195. flightDuration: number | undefined;
  41196. /**
  41197. * Gets the event triggered on flight completion.
  41198. */
  41199. complete: Event;
  41200. /**
  41201. * Gets the scene to control.
  41202. */
  41203. scene: Scene;
  41204. /**
  41205. * Gets the Command that is executed when the button is clicked.
  41206. */
  41207. search: Command;
  41208. /**
  41209. * Gets the currently selected geocoder search suggestion
  41210. */
  41211. selectedSuggestion: any;
  41212. /**
  41213. * Gets the list of geocoder search suggestions
  41214. */
  41215. suggestions: object[];
  41216. /**
  41217. * Destroys the widget. Should be called if permanently
  41218. * removing the widget from layout.
  41219. */
  41220. destroy(): void;
  41221. /**
  41222. * A function to fly to the destination found by a successful geocode.
  41223. */
  41224. static flyToDestination: Geocoder.DestinationFoundFunction;
  41225. }
  41226. /**
  41227. * A single button widget for returning to the default camera view of the current scene.
  41228. * @param container - The DOM element or ID that will contain the widget.
  41229. * @param scene - The Scene instance to use.
  41230. * @param [duration] - The time, in seconds, it takes to complete the camera flight home.
  41231. */
  41232. export class HomeButton {
  41233. constructor(container: Element | string, scene: Scene, duration?: number);
  41234. /**
  41235. * Gets the parent container.
  41236. */
  41237. container: Element;
  41238. /**
  41239. * Gets the view model.
  41240. */
  41241. viewModel: HomeButtonViewModel;
  41242. /**
  41243. * @returns true if the object has been destroyed, false otherwise.
  41244. */
  41245. isDestroyed(): boolean;
  41246. /**
  41247. * Destroys the widget. Should be called if permanently
  41248. * removing the widget from layout.
  41249. */
  41250. destroy(): void;
  41251. }
  41252. /**
  41253. * The view model for {@link HomeButton}.
  41254. * @param scene - The scene instance to use.
  41255. * @param [duration] - The duration of the camera flight in seconds.
  41256. */
  41257. export class HomeButtonViewModel {
  41258. constructor(scene: Scene, duration?: number);
  41259. /**
  41260. * Gets or sets the tooltip. This property is observable.
  41261. */
  41262. tooltip: string;
  41263. /**
  41264. * Gets the scene to control.
  41265. */
  41266. scene: Scene;
  41267. /**
  41268. * Gets the Command that is executed when the button is clicked.
  41269. */
  41270. command: Command;
  41271. /**
  41272. * Gets or sets the the duration of the camera flight in seconds.
  41273. * A value of zero causes the camera to instantly switch to home view.
  41274. * The duration will be computed based on the distance when undefined.
  41275. */
  41276. duration: number | undefined;
  41277. }
  41278. /**
  41279. * A widget for displaying information or a description.
  41280. * @param container - The DOM element or ID that will contain the widget.
  41281. */
  41282. export class InfoBox {
  41283. constructor(container: Element | string);
  41284. /**
  41285. * Gets the parent container.
  41286. */
  41287. container: Element;
  41288. /**
  41289. * Gets the view model.
  41290. */
  41291. viewModel: InfoBoxViewModel;
  41292. /**
  41293. * Gets the iframe used to display the description.
  41294. */
  41295. frame: HTMLIFrameElement;
  41296. /**
  41297. * @returns true if the object has been destroyed, false otherwise.
  41298. */
  41299. isDestroyed(): boolean;
  41300. /**
  41301. * Destroys the widget. Should be called if permanently
  41302. * removing the widget from layout.
  41303. */
  41304. destroy(): void;
  41305. }
  41306. /**
  41307. * The view model for {@link InfoBox}.
  41308. */
  41309. export class InfoBoxViewModel {
  41310. constructor();
  41311. /**
  41312. * Gets or sets the maximum height of the info box in pixels. This property is observable.
  41313. */
  41314. maxHeight: number;
  41315. /**
  41316. * Gets or sets whether the camera tracking icon is enabled.
  41317. */
  41318. enableCamera: boolean;
  41319. /**
  41320. * Gets or sets the status of current camera tracking of the selected object.
  41321. */
  41322. isCameraTracking: boolean;
  41323. /**
  41324. * Gets or sets the visibility of the info box.
  41325. */
  41326. showInfo: boolean;
  41327. /**
  41328. * Gets or sets the title text in the info box.
  41329. */
  41330. titleText: string;
  41331. /**
  41332. * Gets or sets the description HTML for the info box.
  41333. */
  41334. description: string;
  41335. /**
  41336. * Gets the SVG path of the camera icon, which can change to be "crossed out" or not.
  41337. */
  41338. cameraIconPath: string;
  41339. /**
  41340. * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form.
  41341. * @param offset - The offset in pixels.
  41342. */
  41343. maxHeightOffset(offset: number): string;
  41344. /**
  41345. * Gets an {@link Event} that is fired when the user clicks the camera icon.
  41346. */
  41347. cameraClicked: Event;
  41348. /**
  41349. * Gets an {@link Event} that is fired when the user closes the info box.
  41350. */
  41351. closeClicked: Event;
  41352. }
  41353. /**
  41354. * <p>The NavigationHelpButton is a single button widget for displaying instructions for
  41355. * navigating the globe with the mouse.</p><p style="clear: both;"></p><br/>
  41356. * @example
  41357. * // In HTML head, include a link to the NavigationHelpButton.css stylesheet,
  41358. * // and in the body, include: <div id="navigationHelpButtonContainer"></div>
  41359. *
  41360. * var navigationHelpButton = new Cesium.NavigationHelpButton({
  41361. * container : 'navigationHelpButtonContainer'
  41362. * });
  41363. * @param options - Object with the following properties:
  41364. * @param options.container - The DOM element or ID that will contain the widget.
  41365. * @param [options.instructionsInitiallyVisible = false] - True if the navigation instructions should initially be visible; otherwise, false.
  41366. */
  41367. export class NavigationHelpButton {
  41368. constructor(options: {
  41369. container: Element | string;
  41370. instructionsInitiallyVisible?: boolean;
  41371. });
  41372. /**
  41373. * Gets the parent container.
  41374. */
  41375. container: Element;
  41376. /**
  41377. * Gets the view model.
  41378. */
  41379. viewModel: NavigationHelpButtonViewModel;
  41380. /**
  41381. * @returns true if the object has been destroyed, false otherwise.
  41382. */
  41383. isDestroyed(): boolean;
  41384. /**
  41385. * Destroys the widget. Should be called if permanently
  41386. * removing the widget from layout.
  41387. */
  41388. destroy(): void;
  41389. }
  41390. /**
  41391. * The view model for {@link NavigationHelpButton}.
  41392. */
  41393. export class NavigationHelpButtonViewModel {
  41394. constructor();
  41395. /**
  41396. * Gets or sets whether the instructions are currently shown. This property is observable.
  41397. */
  41398. showInstructions: boolean;
  41399. /**
  41400. * Gets or sets the tooltip. This property is observable.
  41401. */
  41402. tooltip: string;
  41403. /**
  41404. * Gets the Command that is executed when the button is clicked.
  41405. */
  41406. command: Command;
  41407. /**
  41408. * Gets the Command that is executed when the mouse instructions should be shown.
  41409. */
  41410. showClick: Command;
  41411. /**
  41412. * Gets the Command that is executed when the touch instructions should be shown.
  41413. */
  41414. showTouch: Command;
  41415. }
  41416. /**
  41417. * Monitors performance of the application and displays a message if poor performance is detected.
  41418. * @param [options] - Object with the following properties:
  41419. * @param options.container - The DOM element or ID that will contain the widget.
  41420. * @param options.scene - The {@link Scene} for which to monitor performance.
  41421. * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The
  41422. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  41423. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  41424. */
  41425. export class PerformanceWatchdog {
  41426. constructor(options?: {
  41427. container: Element | string;
  41428. scene: Scene;
  41429. lowFrameRateMessage?: string;
  41430. });
  41431. /**
  41432. * Gets the parent container.
  41433. */
  41434. container: Element;
  41435. /**
  41436. * Gets the view model.
  41437. */
  41438. viewModel: PerformanceWatchdogViewModel;
  41439. /**
  41440. * @returns true if the object has been destroyed, false otherwise.
  41441. */
  41442. isDestroyed(): boolean;
  41443. /**
  41444. * Destroys the widget. Should be called if permanently
  41445. * removing the widget from layout.
  41446. */
  41447. destroy(): void;
  41448. }
  41449. /**
  41450. * The view model for {@link PerformanceWatchdog}.
  41451. * @param [options] - Object with the following properties:
  41452. * @param options.scene - The Scene instance for which to monitor performance.
  41453. * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The
  41454. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  41455. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  41456. */
  41457. export class PerformanceWatchdogViewModel {
  41458. constructor(options?: {
  41459. scene: Scene;
  41460. lowFrameRateMessage?: string;
  41461. });
  41462. /**
  41463. * Gets or sets the message to display when a low frame rate is detected. This string will be interpreted as HTML.
  41464. */
  41465. lowFrameRateMessage: string;
  41466. /**
  41467. * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has
  41468. * been dismissed, the message will not be redisplayed, no matter the frame rate.
  41469. */
  41470. lowFrameRateMessageDismissed: boolean;
  41471. /**
  41472. * Gets or sets a value indicating whether the low frame rate message is currently being displayed.
  41473. */
  41474. showingLowFrameRateMessage: boolean;
  41475. /**
  41476. * Gets the {@link Scene} instance for which to monitor performance.
  41477. */
  41478. scene: Scene;
  41479. /**
  41480. * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message
  41481. * will not be redisplayed.
  41482. */
  41483. dismissMessage: Command;
  41484. }
  41485. /**
  41486. * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections.
  41487. * @example
  41488. * // In HTML head, include a link to the ProjectionPicker.css stylesheet,
  41489. * // and in the body, include: <div id="projectionPickerContainer"></div>
  41490. * // Note: This code assumes you already have a Scene instance.
  41491. *
  41492. * var projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene);
  41493. * @param container - The DOM element or ID that will contain the widget.
  41494. * @param scene - The Scene instance to use.
  41495. */
  41496. export class ProjectionPicker {
  41497. constructor(container: Element | string, scene: Scene);
  41498. /**
  41499. * Gets the parent container.
  41500. */
  41501. container: Element;
  41502. /**
  41503. * Gets the view model.
  41504. */
  41505. viewModel: ProjectionPickerViewModel;
  41506. /**
  41507. * @returns true if the object has been destroyed, false otherwise.
  41508. */
  41509. isDestroyed(): boolean;
  41510. /**
  41511. * Destroys the widget. Should be called if permanently
  41512. * removing the widget from layout.
  41513. */
  41514. destroy(): void;
  41515. }
  41516. /**
  41517. * The view model for {@link ProjectionPicker}.
  41518. * @param scene - The Scene to switch projections.
  41519. */
  41520. export class ProjectionPickerViewModel {
  41521. constructor(scene: Scene);
  41522. /**
  41523. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  41524. */
  41525. dropDownVisible: boolean;
  41526. /**
  41527. * Gets or sets the perspective projection tooltip. This property is observable.
  41528. */
  41529. tooltipPerspective: string;
  41530. /**
  41531. * Gets or sets the orthographic projection tooltip. This property is observable.
  41532. */
  41533. tooltipOrthographic: string;
  41534. /**
  41535. * Gets the currently active tooltip. This property is observable.
  41536. */
  41537. selectedTooltip: string;
  41538. /**
  41539. * Gets or sets the current SceneMode. This property is observable.
  41540. */
  41541. sceneMode: SceneMode;
  41542. /**
  41543. * Gets the scene
  41544. */
  41545. scene: Scene;
  41546. /**
  41547. * Gets the command to toggle the drop down box.
  41548. */
  41549. toggleDropDown: Command;
  41550. /**
  41551. * Gets the command to switch to a perspective projection.
  41552. */
  41553. switchToPerspective: Command;
  41554. /**
  41555. * Gets the command to switch to orthographic projection.
  41556. */
  41557. switchToOrthographic: Command;
  41558. /**
  41559. * Gets whether the scene is currently using an orthographic projection.
  41560. */
  41561. isOrthographicProjection: Command;
  41562. /**
  41563. * @returns true if the object has been destroyed, false otherwise.
  41564. */
  41565. isDestroyed(): boolean;
  41566. /**
  41567. * Destroys the view model.
  41568. */
  41569. destroy(): void;
  41570. }
  41571. /**
  41572. * <img src="Images/sceneModePicker.png" style="float: left; margin-right: 10px;" width="44" height="116" />
  41573. * <p>The SceneModePicker is a single button widget for switching between scene modes;
  41574. * shown to the left in its expanded state. Programatic switching of scene modes will
  41575. * be automatically reflected in the widget as long as the specified Scene
  41576. * is used to perform the change.</p><p style="clear: both;"></p><br/>
  41577. * @example
  41578. * // In HTML head, include a link to the SceneModePicker.css stylesheet,
  41579. * // and in the body, include: <div id="sceneModePickerContainer"></div>
  41580. * // Note: This code assumes you already have a Scene instance.
  41581. *
  41582. * var sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);
  41583. * @param container - The DOM element or ID that will contain the widget.
  41584. * @param scene - The Scene instance to use.
  41585. * @param [duration = 2.0] - The time, in seconds, it takes for the scene to transition.
  41586. */
  41587. export class SceneModePicker {
  41588. constructor(container: Element | string, scene: Scene, duration?: number);
  41589. /**
  41590. * Gets the parent container.
  41591. */
  41592. container: Element;
  41593. /**
  41594. * Gets the view model.
  41595. */
  41596. viewModel: SceneModePickerViewModel;
  41597. /**
  41598. * @returns true if the object has been destroyed, false otherwise.
  41599. */
  41600. isDestroyed(): boolean;
  41601. /**
  41602. * Destroys the widget. Should be called if permanently
  41603. * removing the widget from layout.
  41604. */
  41605. destroy(): void;
  41606. }
  41607. /**
  41608. * The view model for {@link SceneModePicker}.
  41609. * @param scene - The Scene to morph
  41610. * @param [duration = 2.0] - The duration of scene morph animations, in seconds
  41611. */
  41612. export class SceneModePickerViewModel {
  41613. constructor(scene: Scene, duration?: number);
  41614. /**
  41615. * Gets or sets the current SceneMode. This property is observable.
  41616. */
  41617. sceneMode: SceneMode;
  41618. /**
  41619. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  41620. */
  41621. dropDownVisible: boolean;
  41622. /**
  41623. * Gets or sets the 2D tooltip. This property is observable.
  41624. */
  41625. tooltip2D: string;
  41626. /**
  41627. * Gets or sets the 3D tooltip. This property is observable.
  41628. */
  41629. tooltip3D: string;
  41630. /**
  41631. * Gets or sets the Columbus View tooltip. This property is observable.
  41632. */
  41633. tooltipColumbusView: string;
  41634. /**
  41635. * Gets the currently active tooltip. This property is observable.
  41636. */
  41637. selectedTooltip: string;
  41638. /**
  41639. * Gets the scene
  41640. */
  41641. scene: Scene;
  41642. /**
  41643. * Gets or sets the the duration of scene mode transition animations in seconds.
  41644. * A value of zero causes the scene to instantly change modes.
  41645. */
  41646. duration: number;
  41647. /**
  41648. * Gets the command to toggle the drop down box.
  41649. */
  41650. toggleDropDown: Command;
  41651. /**
  41652. * Gets the command to morph to 2D.
  41653. */
  41654. morphTo2D: Command;
  41655. /**
  41656. * Gets the command to morph to 3D.
  41657. */
  41658. morphTo3D: Command;
  41659. /**
  41660. * Gets the command to morph to Columbus View.
  41661. */
  41662. morphToColumbusView: Command;
  41663. /**
  41664. * @returns true if the object has been destroyed, false otherwise.
  41665. */
  41666. isDestroyed(): boolean;
  41667. /**
  41668. * Destroys the view model.
  41669. */
  41670. destroy(): void;
  41671. }
  41672. /**
  41673. * A widget for displaying an indicator on a selected object.
  41674. * @param container - The DOM element or ID that will contain the widget.
  41675. * @param scene - The Scene instance to use.
  41676. */
  41677. export class SelectionIndicator {
  41678. constructor(container: Element | string, scene: Scene);
  41679. /**
  41680. * Gets the parent container.
  41681. */
  41682. container: Element;
  41683. /**
  41684. * Gets the view model.
  41685. */
  41686. viewModel: SelectionIndicatorViewModel;
  41687. /**
  41688. * @returns true if the object has been destroyed, false otherwise.
  41689. */
  41690. isDestroyed(): boolean;
  41691. /**
  41692. * Destroys the widget. Should be called if permanently
  41693. * removing the widget from layout.
  41694. */
  41695. destroy(): void;
  41696. }
  41697. /**
  41698. * The view model for {@link SelectionIndicator}.
  41699. * @param scene - The scene instance to use for screen-space coordinate conversion.
  41700. * @param selectionIndicatorElement - The element containing all elements that make up the selection indicator.
  41701. * @param container - The DOM element that contains the widget.
  41702. */
  41703. export class SelectionIndicatorViewModel {
  41704. constructor(scene: Scene, selectionIndicatorElement: Element, container: Element);
  41705. /**
  41706. * Gets or sets the world position of the object for which to display the selection indicator.
  41707. */
  41708. position: Cartesian3;
  41709. /**
  41710. * Gets or sets the visibility of the selection indicator.
  41711. */
  41712. showSelection: boolean;
  41713. /**
  41714. * Gets the visibility of the position indicator. This can be false even if an
  41715. * object is selected, when the selected object has no position.
  41716. */
  41717. isVisible: boolean;
  41718. /**
  41719. * Gets or sets the function for converting the world position of the object to the screen space position.
  41720. * @example
  41721. * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
  41722. * return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
  41723. * };
  41724. */
  41725. computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition;
  41726. /**
  41727. * Updates the view of the selection indicator to match the position and content properties of the view model.
  41728. * This function should be called as part of the render loop.
  41729. */
  41730. update(): void;
  41731. /**
  41732. * Animate the indicator to draw attention to the selection.
  41733. */
  41734. animateAppear(): void;
  41735. /**
  41736. * Animate the indicator to release the selection.
  41737. */
  41738. animateDepart(): void;
  41739. /**
  41740. * Gets the HTML element containing the selection indicator.
  41741. */
  41742. container: Element;
  41743. /**
  41744. * Gets the HTML element that holds the selection indicator.
  41745. */
  41746. selectionIndicatorElement: Element;
  41747. /**
  41748. * Gets the scene being used.
  41749. */
  41750. scene: Scene;
  41751. }
  41752. export namespace SelectionIndicatorViewModel {
  41753. /**
  41754. * A function that converts the world position of an object to a screen space position.
  41755. * @param position - The position in WGS84 (world) coordinates.
  41756. * @param result - An object to return the input position transformed to window coordinates.
  41757. */
  41758. type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2;
  41759. }
  41760. /**
  41761. * A Knockout binding handler that creates a DOM element for a single SVG path.
  41762. * This binding handler will be registered as cesiumSvgPath.
  41763. *
  41764. * <p>
  41765. * The parameter to this binding is an object with the following properties:
  41766. * </p>
  41767. *
  41768. * <ul>
  41769. * <li>path: The SVG path as a string.</li>
  41770. * <li>width: The width of the SVG path with no transformations applied.</li>
  41771. * <li>height: The height of the SVG path with no transformations applied.</li>
  41772. * <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li>
  41773. * </ul>
  41774. * @example
  41775. * // Create an SVG as a child of a div
  41776. * <div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>
  41777. *
  41778. * // parameters can be observable from the view model
  41779. * <div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>
  41780. *
  41781. * // or the whole object can be observable from the view model
  41782. * <div data-bind="cesiumSvgPath: svgPathOptions"></div>
  41783. */
  41784. export namespace SvgPathBindingHandler {
  41785. function register(): void;
  41786. }
  41787. /**
  41788. * The Timeline is a widget for displaying and controlling the current scene time.
  41789. * @param container - The parent HTML container node for this widget.
  41790. * @param clock - The clock to use.
  41791. */
  41792. export class Timeline {
  41793. constructor(container: Element, clock: Clock);
  41794. /**
  41795. * Gets the parent container.
  41796. */
  41797. container: Element;
  41798. /**
  41799. * @returns true if the object has been destroyed, false otherwise.
  41800. */
  41801. isDestroyed(): boolean;
  41802. /**
  41803. * Destroys the widget. Should be called if permanently
  41804. * removing the widget from layout.
  41805. */
  41806. destroy(): void;
  41807. /**
  41808. * Sets the view to the provided times.
  41809. * @param startTime - The start time.
  41810. * @param stopTime - The stop time.
  41811. */
  41812. zoomTo(startTime: JulianDate, stopTime: JulianDate): void;
  41813. /**
  41814. * Resizes the widget to match the container size.
  41815. */
  41816. resize(): void;
  41817. }
  41818. /**
  41819. * A view model which exposes the properties of a toggle button.
  41820. * @param command - The command which will be executed when the button is toggled.
  41821. * @param [options] - Object with the following properties:
  41822. * @param [options.toggled = false] - A boolean indicating whether the button should be initially toggled.
  41823. * @param [options.tooltip = ''] - A string containing the button's tooltip.
  41824. */
  41825. export class ToggleButtonViewModel {
  41826. constructor(command: Command, options?: {
  41827. toggled?: boolean;
  41828. tooltip?: string;
  41829. });
  41830. /**
  41831. * Gets or sets whether the button is currently toggled. This property is observable.
  41832. */
  41833. toggled: boolean;
  41834. /**
  41835. * Gets or sets the button's tooltip. This property is observable.
  41836. */
  41837. tooltip: string;
  41838. /**
  41839. * Gets the command which will be executed when the button is toggled.
  41840. */
  41841. command: Command;
  41842. }
  41843. /**
  41844. * A single button widget for toggling vr mode.
  41845. * @param container - The DOM element or ID that will contain the widget.
  41846. * @param scene - The scene.
  41847. * @param [vrElement = document.body] - The element or id to be placed into vr mode.
  41848. */
  41849. export class VRButton {
  41850. constructor(container: Element | string, scene: Scene, vrElement?: Element | string);
  41851. /**
  41852. * Gets the parent container.
  41853. */
  41854. container: Element;
  41855. /**
  41856. * Gets the view model.
  41857. */
  41858. viewModel: VRButtonViewModel;
  41859. /**
  41860. * @returns true if the object has been destroyed, false otherwise.
  41861. */
  41862. isDestroyed(): boolean;
  41863. /**
  41864. * Destroys the widget. Should be called if permanently
  41865. * removing the widget from layout.
  41866. */
  41867. destroy(): void;
  41868. }
  41869. /**
  41870. * The view model for {@link VRButton}.
  41871. * @param scene - The scene.
  41872. * @param [vrElement = document.body] - The element or id to be placed into VR mode.
  41873. */
  41874. export class VRButtonViewModel {
  41875. constructor(scene: Scene, vrElement?: Element | string);
  41876. /**
  41877. * Gets whether or not VR mode is active.
  41878. */
  41879. isVRMode: boolean;
  41880. /**
  41881. * Gets or sets whether or not VR functionality should be enabled.
  41882. */
  41883. isVREnabled: boolean;
  41884. /**
  41885. * Gets the tooltip. This property is observable.
  41886. */
  41887. tooltip: string;
  41888. /**
  41889. * Gets or sets the HTML element to place into VR mode when the
  41890. * corresponding button is pressed.
  41891. */
  41892. vrElement: Element;
  41893. /**
  41894. * Gets the Command to toggle VR mode.
  41895. */
  41896. command: Command;
  41897. /**
  41898. * @returns true if the object has been destroyed, false otherwise.
  41899. */
  41900. isDestroyed(): boolean;
  41901. /**
  41902. * Destroys the view model. Should be called to
  41903. * properly clean up the view model when it is no longer needed.
  41904. */
  41905. destroy(): void;
  41906. }
  41907. export namespace Viewer {
  41908. /**
  41909. * Initialization options for the Viewer constructor
  41910. * @property [animation = true] - If set to false, the Animation widget will not be created.
  41911. * @property [baseLayerPicker = true] - If set to false, the BaseLayerPicker widget will not be created.
  41912. * @property [fullscreenButton = true] - If set to false, the FullscreenButton widget will not be created.
  41913. * @property [vrButton = false] - If set to true, the VRButton widget will be created.
  41914. * @property [geocoder = true] - If set to false, the Geocoder widget will not be created.
  41915. * @property [homeButton = true] - If set to false, the HomeButton widget will not be created.
  41916. * @property [infoBox = true] - If set to false, the InfoBox widget will not be created.
  41917. * @property [sceneModePicker = true] - If set to false, the SceneModePicker widget will not be created.
  41918. * @property [selectionIndicator = true] - If set to false, the SelectionIndicator widget will not be created.
  41919. * @property [timeline = true] - If set to false, the Timeline widget will not be created.
  41920. * @property [navigationHelpButton = true] - If set to false, the navigation help button will not be created.
  41921. * @property [navigationInstructionsInitiallyVisible = true] - True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button.
  41922. * @property [scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  41923. * @property [shouldAnimate = false] - <code>true</code> if the clock should attempt to advance simulation time by default, <code>false</code> otherwise. This option takes precedence over setting {@link Viewer#clockViewModel}.
  41924. * @property [clockViewModel = new ClockViewModel(clock)] - The clock view model to use to control current time.
  41925. * @property [selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true.
  41926. * @property [imageryProviderViewModels = createDefaultImageryProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  41927. * @property [selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available base layer is used. This value is only valid if `baseLayerPicker` is set to true.
  41928. * @property [terrainProviderViewModels = createDefaultTerrainProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  41929. * @property [imageryProvider = createWorldImagery()] - The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.
  41930. * @property [terrainProvider = new EllipsoidTerrainProvider()] - The terrain provider to use
  41931. * @property [skyBox] - The skybox used to render the stars. When <code>undefined</code>, the default stars are used. If set to <code>false</code>, no skyBox, Sun, or Moon will be added.
  41932. * @property [skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  41933. * @property [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode when the full screen button is pressed.
  41934. * @property [useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  41935. * @property [targetFrameRate] - The target frame rate when using the default render loop.
  41936. * @property [showRenderLoopErrors = true] - If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.
  41937. * @property [useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  41938. * @property [automaticallyTrackDataSourceClocks = true] - If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently.
  41939. * @property [contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  41940. * @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  41941. * @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  41942. * @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
  41943. * @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  41944. * @property [creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself.
  41945. * @property [creditViewport] - The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself.
  41946. * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided,
  41947. * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.
  41948. * @property [shadows = false] - Determines if shadows are cast by light sources.
  41949. * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  41950. * @property [mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  41951. * @property [projectionPicker = false] - If set to true, the ProjectionPicker widget will be created.
  41952. * @property [requestRenderMode = false] - If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using {@link Scene#requestRender} to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
  41953. * @property [maximumRenderTimeChange = 0.0] - If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See {@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|Improving Performance with Explicit Rendering}.
  41954. */
  41955. type ConstructorOptions = {
  41956. animation?: boolean;
  41957. baseLayerPicker?: boolean;
  41958. fullscreenButton?: boolean;
  41959. vrButton?: boolean;
  41960. geocoder?: boolean | GeocoderService[];
  41961. homeButton?: boolean;
  41962. infoBox?: boolean;
  41963. sceneModePicker?: boolean;
  41964. selectionIndicator?: boolean;
  41965. timeline?: boolean;
  41966. navigationHelpButton?: boolean;
  41967. navigationInstructionsInitiallyVisible?: boolean;
  41968. scene3DOnly?: boolean;
  41969. shouldAnimate?: boolean;
  41970. clockViewModel?: ClockViewModel;
  41971. selectedImageryProviderViewModel?: ProviderViewModel;
  41972. imageryProviderViewModels?: ProviderViewModel[];
  41973. selectedTerrainProviderViewModel?: ProviderViewModel;
  41974. terrainProviderViewModels?: ProviderViewModel[];
  41975. imageryProvider?: ImageryProvider;
  41976. terrainProvider?: TerrainProvider;
  41977. skyBox?: SkyBox | false;
  41978. skyAtmosphere?: SkyAtmosphere | false;
  41979. fullscreenElement?: Element | string;
  41980. useDefaultRenderLoop?: boolean;
  41981. targetFrameRate?: number;
  41982. showRenderLoopErrors?: boolean;
  41983. useBrowserRecommendedResolution?: boolean;
  41984. automaticallyTrackDataSourceClocks?: boolean;
  41985. contextOptions?: any;
  41986. sceneMode?: SceneMode;
  41987. mapProjection?: MapProjection;
  41988. globe?: Globe | false;
  41989. orderIndependentTranslucency?: boolean;
  41990. creditContainer?: Element | string;
  41991. creditViewport?: Element | string;
  41992. dataSources?: DataSourceCollection;
  41993. shadows?: boolean;
  41994. terrainShadows?: ShadowMode;
  41995. mapMode2D?: MapMode2D;
  41996. projectionPicker?: boolean;
  41997. requestRenderMode?: boolean;
  41998. maximumRenderTimeChange?: number;
  41999. };
  42000. /**
  42001. * A function that augments a Viewer instance with additional functionality.
  42002. * @param viewer - The viewer instance.
  42003. * @param options - Options object to be passed to the mixin function.
  42004. */
  42005. type ViewerMixin = (viewer: Viewer, options: any) => void;
  42006. }
  42007. /**
  42008. * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package.
  42009. * The widget can always be extended by using mixins, which add functionality useful for a variety of applications.
  42010. * @example
  42011. * //Initialize the viewer widget with several custom options and mixins.
  42012. * var viewer = new Cesium.Viewer('cesiumContainer', {
  42013. * //Start in Columbus Viewer
  42014. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  42015. * //Use Cesium World Terrain
  42016. * terrainProvider : Cesium.createWorldTerrain(),
  42017. * //Hide the base layer picker
  42018. * baseLayerPicker : false,
  42019. * //Use OpenStreetMaps
  42020. * imageryProvider : new Cesium.OpenStreetMapImageryProvider({
  42021. * url : 'https://a.tile.openstreetmap.org/'
  42022. * }),
  42023. * skyBox : new Cesium.SkyBox({
  42024. * sources : {
  42025. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  42026. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  42027. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  42028. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  42029. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  42030. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  42031. * }
  42032. * }),
  42033. * // Show Columbus View map with Web Mercator projection
  42034. * mapProjection : new Cesium.WebMercatorProjection()
  42035. * });
  42036. *
  42037. * //Add basic drag and drop functionality
  42038. * viewer.extend(Cesium.viewerDragDropMixin);
  42039. *
  42040. * //Show a pop-up alert if we encounter an error when processing a dropped file
  42041. * viewer.dropError.addEventListener(function(dropHandler, name, error) {
  42042. * console.log(error);
  42043. * window.alert(error);
  42044. * });
  42045. * @param container - The DOM element or ID that will contain the widget.
  42046. * @param [options] - Object describing initialization options
  42047. */
  42048. export class Viewer {
  42049. constructor(container: Element | string, options?: Viewer.ConstructorOptions);
  42050. /**
  42051. * Gets the parent container.
  42052. */
  42053. readonly container: Element;
  42054. /**
  42055. * Gets the DOM element for the area at the bottom of the window containing the
  42056. * {@link CreditDisplay} and potentially other things.
  42057. */
  42058. readonly bottomContainer: Element;
  42059. /**
  42060. * Gets the CesiumWidget.
  42061. */
  42062. readonly cesiumWidget: CesiumWidget;
  42063. /**
  42064. * Gets the selection indicator.
  42065. */
  42066. readonly selectionIndicator: SelectionIndicator;
  42067. /**
  42068. * Gets the info box.
  42069. */
  42070. readonly infoBox: InfoBox;
  42071. /**
  42072. * Gets the Geocoder.
  42073. */
  42074. readonly geocoder: Geocoder;
  42075. /**
  42076. * Gets the HomeButton.
  42077. */
  42078. readonly homeButton: HomeButton;
  42079. /**
  42080. * Gets the SceneModePicker.
  42081. */
  42082. readonly sceneModePicker: SceneModePicker;
  42083. /**
  42084. * Gets the ProjectionPicker.
  42085. */
  42086. readonly projectionPicker: ProjectionPicker;
  42087. /**
  42088. * Gets the BaseLayerPicker.
  42089. */
  42090. readonly baseLayerPicker: BaseLayerPicker;
  42091. /**
  42092. * Gets the NavigationHelpButton.
  42093. */
  42094. readonly navigationHelpButton: NavigationHelpButton;
  42095. /**
  42096. * Gets the Animation widget.
  42097. */
  42098. readonly animation: Animation;
  42099. /**
  42100. * Gets the Timeline widget.
  42101. */
  42102. readonly timeline: Timeline;
  42103. /**
  42104. * Gets the FullscreenButton.
  42105. */
  42106. readonly fullscreenButton: FullscreenButton;
  42107. /**
  42108. * Gets the VRButton.
  42109. */
  42110. readonly vrButton: VRButton;
  42111. /**
  42112. * Gets the display used for {@link DataSource} visualization.
  42113. */
  42114. readonly dataSourceDisplay: DataSourceDisplay;
  42115. /**
  42116. * Gets the collection of entities not tied to a particular data source.
  42117. * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.
  42118. */
  42119. readonly entities: EntityCollection;
  42120. /**
  42121. * Gets the set of {@link DataSource} instances to be visualized.
  42122. */
  42123. readonly dataSources: DataSourceCollection;
  42124. /**
  42125. * Gets the canvas.
  42126. */
  42127. readonly canvas: HTMLCanvasElement;
  42128. /**
  42129. * Gets the scene.
  42130. */
  42131. readonly scene: Scene;
  42132. /**
  42133. * Determines if shadows are cast by light sources.
  42134. */
  42135. shadows: boolean;
  42136. /**
  42137. * Determines if the terrain casts or shadows from light sources.
  42138. */
  42139. terrainShadows: ShadowMode;
  42140. /**
  42141. * Get the scene's shadow map
  42142. */
  42143. readonly shadowMap: ShadowMap;
  42144. /**
  42145. * Gets the collection of image layers that will be rendered on the globe.
  42146. */
  42147. readonly imageryLayers: ImageryLayerCollection;
  42148. /**
  42149. * The terrain provider providing surface geometry for the globe.
  42150. */
  42151. terrainProvider: TerrainProvider;
  42152. /**
  42153. * Gets the camera.
  42154. */
  42155. readonly camera: Camera;
  42156. /**
  42157. * Gets the post-process stages.
  42158. */
  42159. readonly postProcessStages: PostProcessStageCollection;
  42160. /**
  42161. * Gets the clock.
  42162. */
  42163. readonly clock: Clock;
  42164. /**
  42165. * Gets the clock view model.
  42166. */
  42167. readonly clockViewModel: ClockViewModel;
  42168. /**
  42169. * Gets the screen space event handler.
  42170. */
  42171. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  42172. /**
  42173. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  42174. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  42175. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  42176. * than the underlying requestAnimationFrame implementation will have no effect.
  42177. */
  42178. targetFrameRate: number;
  42179. /**
  42180. * Gets or sets whether or not this widget should control the render loop.
  42181. * If set to true the widget will use {@link requestAnimationFrame} to
  42182. * perform rendering and resizing of the widget, as well as drive the
  42183. * simulation clock. If set to false, you must manually call the
  42184. * <code>resize</code>, <code>render</code> methods
  42185. * as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s
  42186. * <code>renderError</code> event will be raised and this property
  42187. * will be set to false. It must be set back to true to continue rendering
  42188. * after the error.
  42189. */
  42190. useDefaultRenderLoop: boolean;
  42191. /**
  42192. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  42193. * performance on less powerful devices while values greater than 1.0 will render at a higher
  42194. * resolution and then scale down, resulting in improved visual fidelity.
  42195. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  42196. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  42197. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  42198. */
  42199. resolutionScale: number;
  42200. /**
  42201. * Boolean flag indicating if the browser's recommended resolution is used.
  42202. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  42203. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  42204. * performance on less powerful devices that have high pixel density. When false, rendering
  42205. * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether
  42206. * this flag is true or false.
  42207. */
  42208. useBrowserRecommendedResolution: boolean;
  42209. /**
  42210. * Gets or sets whether or not data sources can temporarily pause
  42211. * animation in order to avoid showing an incomplete picture to the user.
  42212. * For example, if asynchronous primitives are being processed in the
  42213. * background, the clock will not advance until the geometry is ready.
  42214. */
  42215. allowDataSourcesToSuspendAnimation: boolean;
  42216. /**
  42217. * Gets or sets the Entity instance currently being tracked by the camera.
  42218. */
  42219. trackedEntity: Entity | undefined;
  42220. /**
  42221. * Gets or sets the object instance for which to display a selection indicator.
  42222. *
  42223. * If a user interactively picks a Cesium3DTilesFeature instance, then this property
  42224. * will contain a transient Entity instance with a property named "feature" that is
  42225. * the instance that was picked.
  42226. */
  42227. selectedEntity: Entity | undefined;
  42228. /**
  42229. * Gets the event that is raised when the selected entity changes.
  42230. */
  42231. readonly selectedEntityChanged: Event;
  42232. /**
  42233. * Gets the event that is raised when the tracked entity changes.
  42234. */
  42235. readonly trackedEntityChanged: Event;
  42236. /**
  42237. * Gets or sets the data source to track with the viewer's clock.
  42238. */
  42239. clockTrackedDataSource: DataSource;
  42240. /**
  42241. * Extends the base viewer functionality with the provided mixin.
  42242. * A mixin may add additional properties, functions, or other behavior
  42243. * to the provided viewer instance.
  42244. * @param mixin - The Viewer mixin to add to this instance.
  42245. * @param [options] - The options object to be passed to the mixin function.
  42246. */
  42247. extend(mixin: Viewer.ViewerMixin, options?: any): void;
  42248. /**
  42249. * Resizes the widget to match the container size.
  42250. * This function is called automatically as needed unless
  42251. * <code>useDefaultRenderLoop</code> is set to false.
  42252. */
  42253. resize(): void;
  42254. /**
  42255. * This forces the widget to re-think its layout, including
  42256. * widget sizes and credit placement.
  42257. */
  42258. forceResize(): void;
  42259. /**
  42260. * Renders the scene. This function is called automatically
  42261. * unless <code>useDefaultRenderLoop</code> is set to false;
  42262. */
  42263. render(): void;
  42264. /**
  42265. * @returns true if the object has been destroyed, false otherwise.
  42266. */
  42267. isDestroyed(): boolean;
  42268. /**
  42269. * Destroys the widget. Should be called if permanently
  42270. * removing the widget from layout.
  42271. */
  42272. destroy(): void;
  42273. /**
  42274. * Asynchronously sets the camera to view the provided entity, entities, or data source.
  42275. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  42276. * this method waits for the data to be ready before performing the zoom.
  42277. *
  42278. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  42279. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  42280. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  42281. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  42282. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  42283. *
  42284. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  42285. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  42286. * determined from the offset, the heading will be north.</p>
  42287. * @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.
  42288. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame.
  42289. * @returns A Promise that resolves to true if the zoom was successful or false if the target is not currently visualized in the scene or the zoom was cancelled.
  42290. */
  42291. zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>;
  42292. /**
  42293. * Flies the camera to the provided entity, entities, or data source.
  42294. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  42295. * this method waits for the data to be ready before performing the flight.
  42296. *
  42297. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  42298. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  42299. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  42300. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  42301. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  42302. *
  42303. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  42304. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  42305. * determined from the offset, the heading will be north.</p>
  42306. * @param target - The entity, array of entities, entity collection, data source, Cesium3DTileset, point cloud, or imagery layer to view. You can also pass a promise that resolves to one of the previously mentioned types.
  42307. * @param [options] - Object with the following properties:
  42308. * @param [options.duration = 3.0] - The duration of the flight in seconds.
  42309. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  42310. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  42311. * @returns A Promise that resolves to true if the flight was successful or false if the target is not currently visualized in the scene or the flight was cancelled. //TODO: Cleanup entity mentions
  42312. */
  42313. flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: {
  42314. duration?: number;
  42315. maximumHeight?: number;
  42316. offset?: HeadingPitchRange;
  42317. }): Promise<boolean>;
  42318. }
  42319. /**
  42320. * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget.
  42321. * Rather than being called directly, this function is normally passed as
  42322. * a parameter to {@link Viewer#extend}, as shown in the example below.
  42323. * @example
  42324. * var viewer = new Cesium.Viewer('cesiumContainer');
  42325. * viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
  42326. * @param viewer - The viewer instance.
  42327. */
  42328. export function viewerCesium3DTilesInspectorMixin(viewer: Viewer): void;
  42329. /**
  42330. * A mixin which adds the CesiumInspector widget to the Viewer widget.
  42331. * Rather than being called directly, this function is normally passed as
  42332. * a parameter to {@link Viewer#extend}, as shown in the example below.
  42333. * @example
  42334. * var viewer = new Cesium.Viewer('cesiumContainer');
  42335. * viewer.extend(Cesium.viewerCesiumInspectorMixin);
  42336. * @param viewer - The viewer instance.
  42337. */
  42338. export function viewerCesiumInspectorMixin(viewer: Viewer): void;
  42339. /**
  42340. * A mixin which adds default drag and drop support for CZML files to the Viewer widget.
  42341. * Rather than being called directly, this function is normally passed as
  42342. * a parameter to {@link Viewer#extend}, as shown in the example below.
  42343. * @example
  42344. * // Add basic drag and drop support and pop up an alert window on error.
  42345. * var viewer = new Cesium.Viewer('cesiumContainer');
  42346. * viewer.extend(Cesium.viewerDragDropMixin);
  42347. * viewer.dropError.addEventListener(function(viewerArg, source, error) {
  42348. * window.alert('Error processing ' + source + ':' + error);
  42349. * });
  42350. * @param viewer - The viewer instance.
  42351. * @param [options] - Object with the following properties:
  42352. * @param [options.dropTarget = viewer.container] - The DOM element which will serve as the drop target.
  42353. * @param [options.clearOnDrop = true] - When true, dropping files will clear all existing data sources first, when false, new data sources will be loaded after the existing ones.
  42354. * @param [options.flyToOnDrop = true] - When true, dropping files will fly to the data source once it is loaded.
  42355. * @param [options.clampToGround = true] - When true, datasources are clamped to the ground.
  42356. * @param [options.proxy] - The proxy to be used for KML network links.
  42357. */
  42358. export function viewerDragDropMixin(viewer: Viewer, options?: {
  42359. dropTarget?: Element | string;
  42360. clearOnDrop?: boolean;
  42361. flyToOnDrop?: boolean;
  42362. clampToGround?: boolean;
  42363. proxy?: Proxy;
  42364. }): void;
  42365. /**
  42366. * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget.
  42367. * Rather than being called directly, this function is normally passed as
  42368. * a parameter to {@link Viewer#extend}, as shown in the example below.
  42369. * @example
  42370. * var viewer = new Cesium.Viewer('cesiumContainer');
  42371. * viewer.extend(Cesium.viewerPerformanceWatchdogMixin, {
  42372. * lowFrameRateMessage : 'Why is this going so <em>slowly</em>?'
  42373. * });
  42374. * @param viewer - The viewer instance.
  42375. * @param [options] - An object with properties.
  42376. * @param [options.lowFrameRateMessage = 'This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] - The
  42377. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  42378. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  42379. */
  42380. export function viewerPerformanceWatchdogMixin(viewer: Viewer, options?: {
  42381. lowFrameRateMessage?: string;
  42382. }): void;
  42383. /**
  42384. * Create a Command from a given function, for use with ViewModels.
  42385. *
  42386. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  42387. * whether the command can be executed. When executed, a Command function will check the
  42388. * value of <code>canExecute</code> and throw if false. It also provides events for when
  42389. * a command has been or is about to be executed.
  42390. * @param func - The function to execute.
  42391. * @param [canExecute = true] - A boolean indicating whether the function can currently be executed.
  42392. */
  42393. export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void;
  42394. }
  42395. declare module "cesium/Source/Core/ArcGISTiledElevationTerrainProvider" { import { ArcGISTiledElevationTerrainProvider } from 'cesium'; export default ArcGISTiledElevationTerrainProvider; }
  42396. declare module "cesium/Source/Core/ArcType" { import { ArcType } from 'cesium'; export default ArcType; }
  42397. declare module "cesium/Source/Core/AssociativeArray" { import { AssociativeArray } from 'cesium'; export default AssociativeArray; }
  42398. declare module "cesium/Source/Core/AxisAlignedBoundingBox" { import { AxisAlignedBoundingBox } from 'cesium'; export default AxisAlignedBoundingBox; }
  42399. declare module "cesium/Source/Core/BingMapsGeocoderService" { import { BingMapsGeocoderService } from 'cesium'; export default BingMapsGeocoderService; }
  42400. declare module "cesium/Source/Core/BoundingRectangle" { import { BoundingRectangle } from 'cesium'; export default BoundingRectangle; }
  42401. declare module "cesium/Source/Core/BoundingSphere" { import { BoundingSphere } from 'cesium'; export default BoundingSphere; }
  42402. declare module "cesium/Source/Core/BoxGeometry" { import { BoxGeometry } from 'cesium'; export default BoxGeometry; }
  42403. declare module "cesium/Source/Core/BoxOutlineGeometry" { import { BoxOutlineGeometry } from 'cesium'; export default BoxOutlineGeometry; }
  42404. declare module "cesium/Source/Core/Cartesian2" { import { Cartesian2 } from 'cesium'; export default Cartesian2; }
  42405. declare module "cesium/Source/Core/Cartesian3" { import { Cartesian3 } from 'cesium'; export default Cartesian3; }
  42406. declare module "cesium/Source/Core/Cartesian4" { import { Cartesian4 } from 'cesium'; export default Cartesian4; }
  42407. declare module "cesium/Source/Core/Cartographic" { import { Cartographic } from 'cesium'; export default Cartographic; }
  42408. declare module "cesium/Source/Core/CartographicGeocoderService" { import { CartographicGeocoderService } from 'cesium'; export default CartographicGeocoderService; }
  42409. declare module "cesium/Source/Core/CatmullRomSpline" { import { CatmullRomSpline } from 'cesium'; export default CatmullRomSpline; }
  42410. declare module "cesium/Source/Core/CesiumTerrainProvider" { import { CesiumTerrainProvider } from 'cesium'; export default CesiumTerrainProvider; }
  42411. declare module "cesium/Source/Core/CircleGeometry" { import { CircleGeometry } from 'cesium'; export default CircleGeometry; }
  42412. declare module "cesium/Source/Core/CircleOutlineGeometry" { import { CircleOutlineGeometry } from 'cesium'; export default CircleOutlineGeometry; }
  42413. declare module "cesium/Source/Core/Clock" { import { Clock } from 'cesium'; export default Clock; }
  42414. declare module "cesium/Source/Core/ClockRange" { import { ClockRange } from 'cesium'; export default ClockRange; }
  42415. declare module "cesium/Source/Core/ClockStep" { import { ClockStep } from 'cesium'; export default ClockStep; }
  42416. declare module "cesium/Source/Core/Color" { import { Color } from 'cesium'; export default Color; }
  42417. declare module "cesium/Source/Core/ColorGeometryInstanceAttribute" { import { ColorGeometryInstanceAttribute } from 'cesium'; export default ColorGeometryInstanceAttribute; }
  42418. declare module "cesium/Source/Core/ComponentDatatype" { import { ComponentDatatype } from 'cesium'; export default ComponentDatatype; }
  42419. declare module "cesium/Source/Core/CompressedTextureBuffer" { import { CompressedTextureBuffer } from 'cesium'; export default CompressedTextureBuffer; }
  42420. declare module "cesium/Source/Core/CoplanarPolygonGeometry" { import { CoplanarPolygonGeometry } from 'cesium'; export default CoplanarPolygonGeometry; }
  42421. declare module "cesium/Source/Core/CoplanarPolygonOutlineGeometry" { import { CoplanarPolygonOutlineGeometry } from 'cesium'; export default CoplanarPolygonOutlineGeometry; }
  42422. declare module "cesium/Source/Core/CornerType" { import { CornerType } from 'cesium'; export default CornerType; }
  42423. declare module "cesium/Source/Core/CorridorGeometry" { import { CorridorGeometry } from 'cesium'; export default CorridorGeometry; }
  42424. declare module "cesium/Source/Core/CorridorOutlineGeometry" { import { CorridorOutlineGeometry } from 'cesium'; export default CorridorOutlineGeometry; }
  42425. declare module "cesium/Source/Core/Credit" { import { Credit } from 'cesium'; export default Credit; }
  42426. declare module "cesium/Source/Core/CubicRealPolynomial" { import { CubicRealPolynomial } from 'cesium'; export default CubicRealPolynomial; }
  42427. declare module "cesium/Source/Core/CullingVolume" { import { CullingVolume } from 'cesium'; export default CullingVolume; }
  42428. declare module "cesium/Source/Core/CustomHeightmapTerrainProvider" { import { CustomHeightmapTerrainProvider } from 'cesium'; export default CustomHeightmapTerrainProvider; }
  42429. declare module "cesium/Source/Core/CylinderGeometry" { import { CylinderGeometry } from 'cesium'; export default CylinderGeometry; }
  42430. declare module "cesium/Source/Core/CylinderOutlineGeometry" { import { CylinderOutlineGeometry } from 'cesium'; export default CylinderOutlineGeometry; }
  42431. declare module "cesium/Source/Core/DefaultProxy" { import { DefaultProxy } from 'cesium'; export default DefaultProxy; }
  42432. declare module "cesium/Source/Core/DeveloperError" { import { DeveloperError } from 'cesium'; export default DeveloperError; }
  42433. declare module "cesium/Source/Core/DistanceDisplayCondition" { import { DistanceDisplayCondition } from 'cesium'; export default DistanceDisplayCondition; }
  42434. declare module "cesium/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute" { import { DistanceDisplayConditionGeometryInstanceAttribute } from 'cesium'; export default DistanceDisplayConditionGeometryInstanceAttribute; }
  42435. declare module "cesium/Source/Core/EasingFunction" { import { EasingFunction } from 'cesium'; export default EasingFunction; }
  42436. declare module "cesium/Source/Core/EllipseGeometry" { import { EllipseGeometry } from 'cesium'; export default EllipseGeometry; }
  42437. declare module "cesium/Source/Core/EllipseOutlineGeometry" { import { EllipseOutlineGeometry } from 'cesium'; export default EllipseOutlineGeometry; }
  42438. declare module "cesium/Source/Core/Ellipsoid" { import { Ellipsoid } from 'cesium'; export default Ellipsoid; }
  42439. declare module "cesium/Source/Core/EllipsoidGeodesic" { import { EllipsoidGeodesic } from 'cesium'; export default EllipsoidGeodesic; }
  42440. declare module "cesium/Source/Core/EllipsoidGeometry" { import { EllipsoidGeometry } from 'cesium'; export default EllipsoidGeometry; }
  42441. declare module "cesium/Source/Core/EllipsoidOutlineGeometry" { import { EllipsoidOutlineGeometry } from 'cesium'; export default EllipsoidOutlineGeometry; }
  42442. declare module "cesium/Source/Core/EllipsoidRhumbLine" { import { EllipsoidRhumbLine } from 'cesium'; export default EllipsoidRhumbLine; }
  42443. declare module "cesium/Source/Core/EllipsoidTangentPlane" { import { EllipsoidTangentPlane } from 'cesium'; export default EllipsoidTangentPlane; }
  42444. declare module "cesium/Source/Core/EllipsoidTerrainProvider" { import { EllipsoidTerrainProvider } from 'cesium'; export default EllipsoidTerrainProvider; }
  42445. declare module "cesium/Source/Core/Event" { import { Event } from 'cesium'; export default Event; }
  42446. declare module "cesium/Source/Core/EventHelper" { import { EventHelper } from 'cesium'; export default EventHelper; }
  42447. declare module "cesium/Source/Core/ExtrapolationType" { import { ExtrapolationType } from 'cesium'; export default ExtrapolationType; }
  42448. declare module "cesium/Source/Core/FeatureDetection" { import { FeatureDetection } from 'cesium'; export default FeatureDetection; }
  42449. declare module "cesium/Source/Core/FrustumGeometry" { import { FrustumGeometry } from 'cesium'; export default FrustumGeometry; }
  42450. declare module "cesium/Source/Core/FrustumOutlineGeometry" { import { FrustumOutlineGeometry } from 'cesium'; export default FrustumOutlineGeometry; }
  42451. declare module "cesium/Source/Core/Fullscreen" { import { Fullscreen } from 'cesium'; export default Fullscreen; }
  42452. declare module "cesium/Source/Core/GeocodeType" { import { GeocodeType } from 'cesium'; export default GeocodeType; }
  42453. declare module "cesium/Source/Core/GeocoderService" { import { GeocoderService } from 'cesium'; export default GeocoderService; }
  42454. declare module "cesium/Source/Core/GeographicProjection" { import { GeographicProjection } from 'cesium'; export default GeographicProjection; }
  42455. declare module "cesium/Source/Core/GeographicTilingScheme" { import { GeographicTilingScheme } from 'cesium'; export default GeographicTilingScheme; }
  42456. declare module "cesium/Source/Core/Geometry" { import { Geometry } from 'cesium'; export default Geometry; }
  42457. declare module "cesium/Source/Core/GeometryAttribute" { import { GeometryAttribute } from 'cesium'; export default GeometryAttribute; }
  42458. declare module "cesium/Source/Core/GeometryAttributes" { import { GeometryAttributes } from 'cesium'; export default GeometryAttributes; }
  42459. declare module "cesium/Source/Core/GeometryFactory" { import { GeometryFactory } from 'cesium'; export default GeometryFactory; }
  42460. declare module "cesium/Source/Core/GeometryInstance" { import { GeometryInstance } from 'cesium'; export default GeometryInstance; }
  42461. declare module "cesium/Source/Core/GeometryInstanceAttribute" { import { GeometryInstanceAttribute } from 'cesium'; export default GeometryInstanceAttribute; }
  42462. declare module "cesium/Source/Core/GeometryPipeline" { import { GeometryPipeline } from 'cesium'; export default GeometryPipeline; }
  42463. declare module "cesium/Source/Core/GoogleEarthEnterpriseMetadata" { import { GoogleEarthEnterpriseMetadata } from 'cesium'; export default GoogleEarthEnterpriseMetadata; }
  42464. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainData" { import { GoogleEarthEnterpriseTerrainData } from 'cesium'; export default GoogleEarthEnterpriseTerrainData; }
  42465. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainProvider" { import { GoogleEarthEnterpriseTerrainProvider } from 'cesium'; export default GoogleEarthEnterpriseTerrainProvider; }
  42466. declare module "cesium/Source/Core/GregorianDate" { import { GregorianDate } from 'cesium'; export default GregorianDate; }
  42467. declare module "cesium/Source/Core/GroundPolylineGeometry" { import { GroundPolylineGeometry } from 'cesium'; export default GroundPolylineGeometry; }
  42468. declare module "cesium/Source/Core/HeadingPitchRange" { import { HeadingPitchRange } from 'cesium'; export default HeadingPitchRange; }
  42469. declare module "cesium/Source/Core/HeadingPitchRoll" { import { HeadingPitchRoll } from 'cesium'; export default HeadingPitchRoll; }
  42470. declare module "cesium/Source/Core/HeightmapEncoding" { import { HeightmapEncoding } from 'cesium'; export default HeightmapEncoding; }
  42471. declare module "cesium/Source/Core/HeightmapTerrainData" { import { HeightmapTerrainData } from 'cesium'; export default HeightmapTerrainData; }
  42472. declare module "cesium/Source/Core/HermitePolynomialApproximation" { import { HermitePolynomialApproximation } from 'cesium'; export default HermitePolynomialApproximation; }
  42473. declare module "cesium/Source/Core/HermiteSpline" { import { HermiteSpline } from 'cesium'; export default HermiteSpline; }
  42474. declare module "cesium/Source/Core/HilbertOrder" { import { HilbertOrder } from 'cesium'; export default HilbertOrder; }
  42475. declare module "cesium/Source/Core/IndexDatatype" { import { IndexDatatype } from 'cesium'; export default IndexDatatype; }
  42476. declare module "cesium/Source/Core/InterpolationAlgorithm" { import { InterpolationAlgorithm } from 'cesium'; export default InterpolationAlgorithm; }
  42477. declare module "cesium/Source/Core/Intersect" { import { Intersect } from 'cesium'; export default Intersect; }
  42478. declare module "cesium/Source/Core/IntersectionTests" { import { IntersectionTests } from 'cesium'; export default IntersectionTests; }
  42479. declare module "cesium/Source/Core/Intersections2D" { import { Intersections2D } from 'cesium'; export default Intersections2D; }
  42480. declare module "cesium/Source/Core/Interval" { import { Interval } from 'cesium'; export default Interval; }
  42481. declare module "cesium/Source/Core/Ion" { import { Ion } from 'cesium'; export default Ion; }
  42482. declare module "cesium/Source/Core/IonGeocoderService" { import { IonGeocoderService } from 'cesium'; export default IonGeocoderService; }
  42483. declare module "cesium/Source/Core/IonResource" { import { IonResource } from 'cesium'; export default IonResource; }
  42484. declare module "cesium/Source/Core/Iso8601" { import { Iso8601 } from 'cesium'; export default Iso8601; }
  42485. declare module "cesium/Source/Core/JulianDate" { import { JulianDate } from 'cesium'; export default JulianDate; }
  42486. declare module "cesium/Source/Core/KeyboardEventModifier" { import { KeyboardEventModifier } from 'cesium'; export default KeyboardEventModifier; }
  42487. declare module "cesium/Source/Core/LagrangePolynomialApproximation" { import { LagrangePolynomialApproximation } from 'cesium'; export default LagrangePolynomialApproximation; }
  42488. declare module "cesium/Source/Core/LeapSecond" { import { LeapSecond } from 'cesium'; export default LeapSecond; }
  42489. declare module "cesium/Source/Core/LinearApproximation" { import { LinearApproximation } from 'cesium'; export default LinearApproximation; }
  42490. declare module "cesium/Source/Core/LinearSpline" { import { LinearSpline } from 'cesium'; export default LinearSpline; }
  42491. declare module "cesium/Source/Core/MapProjection" { import { MapProjection } from 'cesium'; export default MapProjection; }
  42492. declare module "cesium/Source/Core/Math" { import { Math } from 'cesium'; export default Math; }
  42493. declare module "cesium/Source/Core/Matrix2" { import { Matrix2 } from 'cesium'; export default Matrix2; }
  42494. declare module "cesium/Source/Core/Matrix3" { import { Matrix3 } from 'cesium'; export default Matrix3; }
  42495. declare module "cesium/Source/Core/Matrix4" { import { Matrix4 } from 'cesium'; export default Matrix4; }
  42496. declare module "cesium/Source/Core/NearFarScalar" { import { NearFarScalar } from 'cesium'; export default NearFarScalar; }
  42497. declare module "cesium/Source/Core/Occluder" { import { Occluder } from 'cesium'; export default Occluder; }
  42498. declare module "cesium/Source/Core/OpenCageGeocoderService" { import { OpenCageGeocoderService } from 'cesium'; export default OpenCageGeocoderService; }
  42499. declare module "cesium/Source/Core/OrientedBoundingBox" { import { OrientedBoundingBox } from 'cesium'; export default OrientedBoundingBox; }
  42500. declare module "cesium/Source/Core/OrthographicFrustum" { import { OrthographicFrustum } from 'cesium'; export default OrthographicFrustum; }
  42501. declare module "cesium/Source/Core/OrthographicOffCenterFrustum" { import { OrthographicOffCenterFrustum } from 'cesium'; export default OrthographicOffCenterFrustum; }
  42502. declare module "cesium/Source/Core/Packable" { import { Packable } from 'cesium'; export default Packable; }
  42503. declare module "cesium/Source/Core/PackableForInterpolation" { import { PackableForInterpolation } from 'cesium'; export default PackableForInterpolation; }
  42504. declare module "cesium/Source/Core/PeliasGeocoderService" { import { PeliasGeocoderService } from 'cesium'; export default PeliasGeocoderService; }
  42505. declare module "cesium/Source/Core/PerspectiveFrustum" { import { PerspectiveFrustum } from 'cesium'; export default PerspectiveFrustum; }
  42506. declare module "cesium/Source/Core/PerspectiveOffCenterFrustum" { import { PerspectiveOffCenterFrustum } from 'cesium'; export default PerspectiveOffCenterFrustum; }
  42507. declare module "cesium/Source/Core/PinBuilder" { import { PinBuilder } from 'cesium'; export default PinBuilder; }
  42508. declare module "cesium/Source/Core/PixelFormat" { import { PixelFormat } from 'cesium'; export default PixelFormat; }
  42509. declare module "cesium/Source/Core/Plane" { import { Plane } from 'cesium'; export default Plane; }
  42510. declare module "cesium/Source/Core/PlaneGeometry" { import { PlaneGeometry } from 'cesium'; export default PlaneGeometry; }
  42511. declare module "cesium/Source/Core/PlaneOutlineGeometry" { import { PlaneOutlineGeometry } from 'cesium'; export default PlaneOutlineGeometry; }
  42512. declare module "cesium/Source/Core/PolygonGeometry" { import { PolygonGeometry } from 'cesium'; export default PolygonGeometry; }
  42513. declare module "cesium/Source/Core/PolygonHierarchy" { import { PolygonHierarchy } from 'cesium'; export default PolygonHierarchy; }
  42514. declare module "cesium/Source/Core/PolygonOutlineGeometry" { import { PolygonOutlineGeometry } from 'cesium'; export default PolygonOutlineGeometry; }
  42515. declare module "cesium/Source/Core/PolylineGeometry" { import { PolylineGeometry } from 'cesium'; export default PolylineGeometry; }
  42516. declare module "cesium/Source/Core/PolylineVolumeGeometry" { import { PolylineVolumeGeometry } from 'cesium'; export default PolylineVolumeGeometry; }
  42517. declare module "cesium/Source/Core/PolylineVolumeOutlineGeometry" { import { PolylineVolumeOutlineGeometry } from 'cesium'; export default PolylineVolumeOutlineGeometry; }
  42518. declare module "cesium/Source/Core/PrimitiveType" { import { PrimitiveType } from 'cesium'; export default PrimitiveType; }
  42519. declare module "cesium/Source/Core/Proxy" { import { Proxy } from 'cesium'; export default Proxy; }
  42520. declare module "cesium/Source/Core/QuadraticRealPolynomial" { import { QuadraticRealPolynomial } from 'cesium'; export default QuadraticRealPolynomial; }
  42521. declare module "cesium/Source/Core/QuantizedMeshTerrainData" { import { QuantizedMeshTerrainData } from 'cesium'; export default QuantizedMeshTerrainData; }
  42522. declare module "cesium/Source/Core/QuarticRealPolynomial" { import { QuarticRealPolynomial } from 'cesium'; export default QuarticRealPolynomial; }
  42523. declare module "cesium/Source/Core/Quaternion" { import { Quaternion } from 'cesium'; export default Quaternion; }
  42524. declare module "cesium/Source/Core/QuaternionSpline" { import { QuaternionSpline } from 'cesium'; export default QuaternionSpline; }
  42525. declare module "cesium/Source/Core/Queue" { import { Queue } from 'cesium'; export default Queue; }
  42526. declare module "cesium/Source/Core/Ray" { import { Ray } from 'cesium'; export default Ray; }
  42527. declare module "cesium/Source/Core/Rectangle" { import { Rectangle } from 'cesium'; export default Rectangle; }
  42528. declare module "cesium/Source/Core/RectangleGeometry" { import { RectangleGeometry } from 'cesium'; export default RectangleGeometry; }
  42529. declare module "cesium/Source/Core/RectangleOutlineGeometry" { import { RectangleOutlineGeometry } from 'cesium'; export default RectangleOutlineGeometry; }
  42530. declare module "cesium/Source/Core/ReferenceFrame" { import { ReferenceFrame } from 'cesium'; export default ReferenceFrame; }
  42531. declare module "cesium/Source/Core/Request" { import { Request } from 'cesium'; export default Request; }
  42532. declare module "cesium/Source/Core/RequestErrorEvent" { import { RequestErrorEvent } from 'cesium'; export default RequestErrorEvent; }
  42533. declare module "cesium/Source/Core/RequestScheduler" { import { RequestScheduler } from 'cesium'; export default RequestScheduler; }
  42534. declare module "cesium/Source/Core/RequestState" { import { RequestState } from 'cesium'; export default RequestState; }
  42535. declare module "cesium/Source/Core/RequestType" { import { RequestType } from 'cesium'; export default RequestType; }
  42536. declare module "cesium/Source/Core/Resource" { import { Resource } from 'cesium'; export default Resource; }
  42537. declare module "cesium/Source/Core/RuntimeError" { import { RuntimeError } from 'cesium'; export default RuntimeError; }
  42538. declare module "cesium/Source/Core/ScreenSpaceEventHandler" { import { ScreenSpaceEventHandler } from 'cesium'; export default ScreenSpaceEventHandler; }
  42539. declare module "cesium/Source/Core/ScreenSpaceEventType" { import { ScreenSpaceEventType } from 'cesium'; export default ScreenSpaceEventType; }
  42540. declare module "cesium/Source/Core/ShowGeometryInstanceAttribute" { import { ShowGeometryInstanceAttribute } from 'cesium'; export default ShowGeometryInstanceAttribute; }
  42541. declare module "cesium/Source/Core/Simon1994PlanetaryPositions" { import { Simon1994PlanetaryPositions } from 'cesium'; export default Simon1994PlanetaryPositions; }
  42542. declare module "cesium/Source/Core/SimplePolylineGeometry" { import { SimplePolylineGeometry } from 'cesium'; export default SimplePolylineGeometry; }
  42543. declare module "cesium/Source/Core/SphereGeometry" { import { SphereGeometry } from 'cesium'; export default SphereGeometry; }
  42544. declare module "cesium/Source/Core/SphereOutlineGeometry" { import { SphereOutlineGeometry } from 'cesium'; export default SphereOutlineGeometry; }
  42545. declare module "cesium/Source/Core/Spherical" { import { Spherical } from 'cesium'; export default Spherical; }
  42546. declare module "cesium/Source/Core/Spline" { import { Spline } from 'cesium'; export default Spline; }
  42547. declare module "cesium/Source/Core/TaskProcessor" { import { TaskProcessor } from 'cesium'; export default TaskProcessor; }
  42548. declare module "cesium/Source/Core/TerrainData" { import { TerrainData } from 'cesium'; export default TerrainData; }
  42549. declare module "cesium/Source/Core/TerrainProvider" { import { TerrainProvider } from 'cesium'; export default TerrainProvider; }
  42550. declare module "cesium/Source/Core/TileAvailability" { import { TileAvailability } from 'cesium'; export default TileAvailability; }
  42551. declare module "cesium/Source/Core/TileProviderError" { import { TileProviderError } from 'cesium'; export default TileProviderError; }
  42552. declare module "cesium/Source/Core/TilingScheme" { import { TilingScheme } from 'cesium'; export default TilingScheme; }
  42553. declare module "cesium/Source/Core/TimeInterval" { import { TimeInterval } from 'cesium'; export default TimeInterval; }
  42554. declare module "cesium/Source/Core/TimeIntervalCollection" { import { TimeIntervalCollection } from 'cesium'; export default TimeIntervalCollection; }
  42555. declare module "cesium/Source/Core/TimeStandard" { import { TimeStandard } from 'cesium'; export default TimeStandard; }
  42556. declare module "cesium/Source/Core/Transforms" { import { Transforms } from 'cesium'; export default Transforms; }
  42557. declare module "cesium/Source/Core/TranslationRotationScale" { import { TranslationRotationScale } from 'cesium'; export default TranslationRotationScale; }
  42558. declare module "cesium/Source/Core/TridiagonalSystemSolver" { import { TridiagonalSystemSolver } from 'cesium'; export default TridiagonalSystemSolver; }
  42559. declare module "cesium/Source/Core/TrustedServers" { import { TrustedServers } from 'cesium'; export default TrustedServers; }
  42560. declare module "cesium/Source/Core/VRTheWorldTerrainProvider" { import { VRTheWorldTerrainProvider } from 'cesium'; export default VRTheWorldTerrainProvider; }
  42561. declare module "cesium/Source/Core/VertexFormat" { import { VertexFormat } from 'cesium'; export default VertexFormat; }
  42562. declare module "cesium/Source/Core/VideoSynchronizer" { import { VideoSynchronizer } from 'cesium'; export default VideoSynchronizer; }
  42563. declare module "cesium/Source/Core/Visibility" { import { Visibility } from 'cesium'; export default Visibility; }
  42564. declare module "cesium/Source/Core/WallGeometry" { import { WallGeometry } from 'cesium'; export default WallGeometry; }
  42565. declare module "cesium/Source/Core/WallOutlineGeometry" { import { WallOutlineGeometry } from 'cesium'; export default WallOutlineGeometry; }
  42566. declare module "cesium/Source/Core/WebGLConstants" { import { WebGLConstants } from 'cesium'; export default WebGLConstants; }
  42567. declare module "cesium/Source/Core/WebMercatorProjection" { import { WebMercatorProjection } from 'cesium'; export default WebMercatorProjection; }
  42568. declare module "cesium/Source/Core/WebMercatorTilingScheme" { import { WebMercatorTilingScheme } from 'cesium'; export default WebMercatorTilingScheme; }
  42569. declare module "cesium/Source/Core/WeightSpline" { import { WeightSpline } from 'cesium'; export default WeightSpline; }
  42570. declare module "cesium/Source/Core/WindingOrder" { import { WindingOrder } from 'cesium'; export default WindingOrder; }
  42571. declare module "cesium/Source/Core/barycentricCoordinates" { import { barycentricCoordinates } from 'cesium'; export default barycentricCoordinates; }
  42572. declare module "cesium/Source/Core/binarySearch" { import { binarySearch } from 'cesium'; export default binarySearch; }
  42573. declare module "cesium/Source/Core/buildModuleUrl" { import { buildModuleUrl } from 'cesium'; export default buildModuleUrl; }
  42574. declare module "cesium/Source/Core/cancelAnimationFrame" { import { cancelAnimationFrame } from 'cesium'; export default cancelAnimationFrame; }
  42575. declare module "cesium/Source/Core/clone" { import { clone } from 'cesium'; export default clone; }
  42576. declare module "cesium/Source/Core/combine" { import { combine } from 'cesium'; export default combine; }
  42577. declare module "cesium/Source/Core/createGuid" { import { createGuid } from 'cesium'; export default createGuid; }
  42578. declare module "cesium/Source/Core/createWorldTerrain" { import { createWorldTerrain } from 'cesium'; export default createWorldTerrain; }
  42579. declare module "cesium/Source/Core/defaultValue" { import { defaultValue } from 'cesium'; export default defaultValue; }
  42580. declare module "cesium/Source/Core/defined" { import { defined } from 'cesium'; export default defined; }
  42581. declare module "cesium/Source/Core/destroyObject" { import { destroyObject } from 'cesium'; export default destroyObject; }
  42582. declare module "cesium/Source/Core/formatError" { import { formatError } from 'cesium'; export default formatError; }
  42583. declare module "cesium/Source/Core/getAbsoluteUri" { import { getAbsoluteUri } from 'cesium'; export default getAbsoluteUri; }
  42584. declare module "cesium/Source/Core/getBaseUri" { import { getBaseUri } from 'cesium'; export default getBaseUri; }
  42585. declare module "cesium/Source/Core/getExtensionFromUri" { import { getExtensionFromUri } from 'cesium'; export default getExtensionFromUri; }
  42586. declare module "cesium/Source/Core/getFilenameFromUri" { import { getFilenameFromUri } from 'cesium'; export default getFilenameFromUri; }
  42587. declare module "cesium/Source/Core/getImagePixels" { import { getImagePixels } from 'cesium'; export default getImagePixels; }
  42588. declare module "cesium/Source/Core/getTimestamp" { import { getTimestamp } from 'cesium'; export default getTimestamp; }
  42589. declare module "cesium/Source/Core/isLeapYear" { import { isLeapYear } from 'cesium'; export default isLeapYear; }
  42590. declare module "cesium/Source/Core/mergeSort" { import { mergeSort } from 'cesium'; export default mergeSort; }
  42591. declare module "cesium/Source/Core/objectToQuery" { import { objectToQuery } from 'cesium'; export default objectToQuery; }
  42592. declare module "cesium/Source/Core/pointInsideTriangle" { import { pointInsideTriangle } from 'cesium'; export default pointInsideTriangle; }
  42593. declare module "cesium/Source/Core/queryToObject" { import { queryToObject } from 'cesium'; export default queryToObject; }
  42594. declare module "cesium/Source/Core/requestAnimationFrame" { import { requestAnimationFrame } from 'cesium'; export default requestAnimationFrame; }
  42595. declare module "cesium/Source/Core/sampleTerrain" { import { sampleTerrain } from 'cesium'; export default sampleTerrain; }
  42596. declare module "cesium/Source/Core/sampleTerrainMostDetailed" { import { sampleTerrainMostDetailed } from 'cesium'; export default sampleTerrainMostDetailed; }
  42597. declare module "cesium/Source/Core/subdivideArray" { import { subdivideArray } from 'cesium'; export default subdivideArray; }
  42598. declare module "cesium/Source/Core/writeTextToCanvas" { import { writeTextToCanvas } from 'cesium'; export default writeTextToCanvas; }
  42599. declare module "cesium/Source/DataSources/BillboardGraphics" { import { BillboardGraphics } from 'cesium'; export default BillboardGraphics; }
  42600. declare module "cesium/Source/DataSources/BillboardVisualizer" { import { BillboardVisualizer } from 'cesium'; export default BillboardVisualizer; }
  42601. declare module "cesium/Source/DataSources/BoxGeometryUpdater" { import { BoxGeometryUpdater } from 'cesium'; export default BoxGeometryUpdater; }
  42602. declare module "cesium/Source/DataSources/BoxGraphics" { import { BoxGraphics } from 'cesium'; export default BoxGraphics; }
  42603. declare module "cesium/Source/DataSources/CallbackProperty" { import { CallbackProperty } from 'cesium'; export default CallbackProperty; }
  42604. declare module "cesium/Source/DataSources/Cesium3DTilesetGraphics" { import { Cesium3DTilesetGraphics } from 'cesium'; export default Cesium3DTilesetGraphics; }
  42605. declare module "cesium/Source/DataSources/Cesium3DTilesetVisualizer" { import { Cesium3DTilesetVisualizer } from 'cesium'; export default Cesium3DTilesetVisualizer; }
  42606. declare module "cesium/Source/DataSources/CheckerboardMaterialProperty" { import { CheckerboardMaterialProperty } from 'cesium'; export default CheckerboardMaterialProperty; }
  42607. declare module "cesium/Source/DataSources/ColorMaterialProperty" { import { ColorMaterialProperty } from 'cesium'; export default ColorMaterialProperty; }
  42608. declare module "cesium/Source/DataSources/CompositeEntityCollection" { import { CompositeEntityCollection } from 'cesium'; export default CompositeEntityCollection; }
  42609. declare module "cesium/Source/DataSources/CompositeMaterialProperty" { import { CompositeMaterialProperty } from 'cesium'; export default CompositeMaterialProperty; }
  42610. declare module "cesium/Source/DataSources/CompositePositionProperty" { import { CompositePositionProperty } from 'cesium'; export default CompositePositionProperty; }
  42611. declare module "cesium/Source/DataSources/CompositeProperty" { import { CompositeProperty } from 'cesium'; export default CompositeProperty; }
  42612. declare module "cesium/Source/DataSources/ConstantPositionProperty" { import { ConstantPositionProperty } from 'cesium'; export default ConstantPositionProperty; }
  42613. declare module "cesium/Source/DataSources/ConstantProperty" { import { ConstantProperty } from 'cesium'; export default ConstantProperty; }
  42614. declare module "cesium/Source/DataSources/CorridorGeometryUpdater" { import { CorridorGeometryUpdater } from 'cesium'; export default CorridorGeometryUpdater; }
  42615. declare module "cesium/Source/DataSources/CorridorGraphics" { import { CorridorGraphics } from 'cesium'; export default CorridorGraphics; }
  42616. declare module "cesium/Source/DataSources/CustomDataSource" { import { CustomDataSource } from 'cesium'; export default CustomDataSource; }
  42617. declare module "cesium/Source/DataSources/CylinderGeometryUpdater" { import { CylinderGeometryUpdater } from 'cesium'; export default CylinderGeometryUpdater; }
  42618. declare module "cesium/Source/DataSources/CylinderGraphics" { import { CylinderGraphics } from 'cesium'; export default CylinderGraphics; }
  42619. declare module "cesium/Source/DataSources/CzmlDataSource" { import { CzmlDataSource } from 'cesium'; export default CzmlDataSource; }
  42620. declare module "cesium/Source/DataSources/DataSource" { import { DataSource } from 'cesium'; export default DataSource; }
  42621. declare module "cesium/Source/DataSources/DataSourceClock" { import { DataSourceClock } from 'cesium'; export default DataSourceClock; }
  42622. declare module "cesium/Source/DataSources/DataSourceCollection" { import { DataSourceCollection } from 'cesium'; export default DataSourceCollection; }
  42623. declare module "cesium/Source/DataSources/DataSourceDisplay" { import { DataSourceDisplay } from 'cesium'; export default DataSourceDisplay; }
  42624. declare module "cesium/Source/DataSources/EllipseGeometryUpdater" { import { EllipseGeometryUpdater } from 'cesium'; export default EllipseGeometryUpdater; }
  42625. declare module "cesium/Source/DataSources/EllipseGraphics" { import { EllipseGraphics } from 'cesium'; export default EllipseGraphics; }
  42626. declare module "cesium/Source/DataSources/EllipsoidGeometryUpdater" { import { EllipsoidGeometryUpdater } from 'cesium'; export default EllipsoidGeometryUpdater; }
  42627. declare module "cesium/Source/DataSources/EllipsoidGraphics" { import { EllipsoidGraphics } from 'cesium'; export default EllipsoidGraphics; }
  42628. declare module "cesium/Source/DataSources/Entity" { import { Entity } from 'cesium'; export default Entity; }
  42629. declare module "cesium/Source/DataSources/EntityCluster" { import { EntityCluster } from 'cesium'; export default EntityCluster; }
  42630. declare module "cesium/Source/DataSources/EntityCollection" { import { EntityCollection } from 'cesium'; export default EntityCollection; }
  42631. declare module "cesium/Source/DataSources/EntityView" { import { EntityView } from 'cesium'; export default EntityView; }
  42632. declare module "cesium/Source/DataSources/GeoJsonDataSource" { import { GeoJsonDataSource } from 'cesium'; export default GeoJsonDataSource; }
  42633. declare module "cesium/Source/DataSources/GeometryUpdater" { import { GeometryUpdater } from 'cesium'; export default GeometryUpdater; }
  42634. declare module "cesium/Source/DataSources/GeometryVisualizer" { import { GeometryVisualizer } from 'cesium'; export default GeometryVisualizer; }
  42635. declare module "cesium/Source/DataSources/GridMaterialProperty" { import { GridMaterialProperty } from 'cesium'; export default GridMaterialProperty; }
  42636. declare module "cesium/Source/DataSources/GroundGeometryUpdater" { import { GroundGeometryUpdater } from 'cesium'; export default GroundGeometryUpdater; }
  42637. declare module "cesium/Source/DataSources/ImageMaterialProperty" { import { ImageMaterialProperty } from 'cesium'; export default ImageMaterialProperty; }
  42638. declare module "cesium/Source/DataSources/KmlCamera" { import { KmlCamera } from 'cesium'; export default KmlCamera; }
  42639. declare module "cesium/Source/DataSources/KmlDataSource" { import { KmlDataSource } from 'cesium'; export default KmlDataSource; }
  42640. declare module "cesium/Source/DataSources/KmlLookAt" { import { KmlLookAt } from 'cesium'; export default KmlLookAt; }
  42641. declare module "cesium/Source/DataSources/KmlTour" { import { KmlTour } from 'cesium'; export default KmlTour; }
  42642. declare module "cesium/Source/DataSources/KmlTourFlyTo" { import { KmlTourFlyTo } from 'cesium'; export default KmlTourFlyTo; }
  42643. declare module "cesium/Source/DataSources/KmlTourWait" { import { KmlTourWait } from 'cesium'; export default KmlTourWait; }
  42644. declare module "cesium/Source/DataSources/LabelGraphics" { import { LabelGraphics } from 'cesium'; export default LabelGraphics; }
  42645. declare module "cesium/Source/DataSources/LabelVisualizer" { import { LabelVisualizer } from 'cesium'; export default LabelVisualizer; }
  42646. declare module "cesium/Source/DataSources/MaterialProperty" { import { MaterialProperty } from 'cesium'; export default MaterialProperty; }
  42647. declare module "cesium/Source/DataSources/ModelGraphics" { import { ModelGraphics } from 'cesium'; export default ModelGraphics; }
  42648. declare module "cesium/Source/DataSources/ModelVisualizer" { import { ModelVisualizer } from 'cesium'; export default ModelVisualizer; }
  42649. declare module "cesium/Source/DataSources/NodeTransformationProperty" { import { NodeTransformationProperty } from 'cesium'; export default NodeTransformationProperty; }
  42650. declare module "cesium/Source/DataSources/PathGraphics" { import { PathGraphics } from 'cesium'; export default PathGraphics; }
  42651. declare module "cesium/Source/DataSources/PathVisualizer" { import { PathVisualizer } from 'cesium'; export default PathVisualizer; }
  42652. declare module "cesium/Source/DataSources/PlaneGeometryUpdater" { import { PlaneGeometryUpdater } from 'cesium'; export default PlaneGeometryUpdater; }
  42653. declare module "cesium/Source/DataSources/PlaneGraphics" { import { PlaneGraphics } from 'cesium'; export default PlaneGraphics; }
  42654. declare module "cesium/Source/DataSources/PointGraphics" { import { PointGraphics } from 'cesium'; export default PointGraphics; }
  42655. declare module "cesium/Source/DataSources/PointVisualizer" { import { PointVisualizer } from 'cesium'; export default PointVisualizer; }
  42656. declare module "cesium/Source/DataSources/PolygonGeometryUpdater" { import { PolygonGeometryUpdater } from 'cesium'; export default PolygonGeometryUpdater; }
  42657. declare module "cesium/Source/DataSources/PolygonGraphics" { import { PolygonGraphics } from 'cesium'; export default PolygonGraphics; }
  42658. declare module "cesium/Source/DataSources/PolylineArrowMaterialProperty" { import { PolylineArrowMaterialProperty } from 'cesium'; export default PolylineArrowMaterialProperty; }
  42659. declare module "cesium/Source/DataSources/PolylineDashMaterialProperty" { import { PolylineDashMaterialProperty } from 'cesium'; export default PolylineDashMaterialProperty; }
  42660. declare module "cesium/Source/DataSources/PolylineGeometryUpdater" { import { PolylineGeometryUpdater } from 'cesium'; export default PolylineGeometryUpdater; }
  42661. declare module "cesium/Source/DataSources/PolylineGlowMaterialProperty" { import { PolylineGlowMaterialProperty } from 'cesium'; export default PolylineGlowMaterialProperty; }
  42662. declare module "cesium/Source/DataSources/PolylineGraphics" { import { PolylineGraphics } from 'cesium'; export default PolylineGraphics; }
  42663. declare module "cesium/Source/DataSources/PolylineOutlineMaterialProperty" { import { PolylineOutlineMaterialProperty } from 'cesium'; export default PolylineOutlineMaterialProperty; }
  42664. declare module "cesium/Source/DataSources/PolylineVisualizer" { import { PolylineVisualizer } from 'cesium'; export default PolylineVisualizer; }
  42665. declare module "cesium/Source/DataSources/PolylineVolumeGeometryUpdater" { import { PolylineVolumeGeometryUpdater } from 'cesium'; export default PolylineVolumeGeometryUpdater; }
  42666. declare module "cesium/Source/DataSources/PolylineVolumeGraphics" { import { PolylineVolumeGraphics } from 'cesium'; export default PolylineVolumeGraphics; }
  42667. declare module "cesium/Source/DataSources/PositionProperty" { import { PositionProperty } from 'cesium'; export default PositionProperty; }
  42668. declare module "cesium/Source/DataSources/PositionPropertyArray" { import { PositionPropertyArray } from 'cesium'; export default PositionPropertyArray; }
  42669. declare module "cesium/Source/DataSources/Property" { import { Property } from 'cesium'; export default Property; }
  42670. declare module "cesium/Source/DataSources/PropertyArray" { import { PropertyArray } from 'cesium'; export default PropertyArray; }
  42671. declare module "cesium/Source/DataSources/PropertyBag" { import { PropertyBag } from 'cesium'; export default PropertyBag; }
  42672. declare module "cesium/Source/DataSources/RectangleGeometryUpdater" { import { RectangleGeometryUpdater } from 'cesium'; export default RectangleGeometryUpdater; }
  42673. declare module "cesium/Source/DataSources/RectangleGraphics" { import { RectangleGraphics } from 'cesium'; export default RectangleGraphics; }
  42674. declare module "cesium/Source/DataSources/ReferenceProperty" { import { ReferenceProperty } from 'cesium'; export default ReferenceProperty; }
  42675. declare module "cesium/Source/DataSources/Rotation" { import { Rotation } from 'cesium'; export default Rotation; }
  42676. declare module "cesium/Source/DataSources/SampledPositionProperty" { import { SampledPositionProperty } from 'cesium'; export default SampledPositionProperty; }
  42677. declare module "cesium/Source/DataSources/SampledProperty" { import { SampledProperty } from 'cesium'; export default SampledProperty; }
  42678. declare module "cesium/Source/DataSources/StripeMaterialProperty" { import { StripeMaterialProperty } from 'cesium'; export default StripeMaterialProperty; }
  42679. declare module "cesium/Source/DataSources/StripeOrientation" { import { StripeOrientation } from 'cesium'; export default StripeOrientation; }
  42680. declare module "cesium/Source/DataSources/TimeIntervalCollectionPositionProperty" { import { TimeIntervalCollectionPositionProperty } from 'cesium'; export default TimeIntervalCollectionPositionProperty; }
  42681. declare module "cesium/Source/DataSources/TimeIntervalCollectionProperty" { import { TimeIntervalCollectionProperty } from 'cesium'; export default TimeIntervalCollectionProperty; }
  42682. declare module "cesium/Source/DataSources/VelocityOrientationProperty" { import { VelocityOrientationProperty } from 'cesium'; export default VelocityOrientationProperty; }
  42683. declare module "cesium/Source/DataSources/VelocityVectorProperty" { import { VelocityVectorProperty } from 'cesium'; export default VelocityVectorProperty; }
  42684. declare module "cesium/Source/DataSources/Visualizer" { import { Visualizer } from 'cesium'; export default Visualizer; }
  42685. declare module "cesium/Source/DataSources/WallGeometryUpdater" { import { WallGeometryUpdater } from 'cesium'; export default WallGeometryUpdater; }
  42686. declare module "cesium/Source/DataSources/WallGraphics" { import { WallGraphics } from 'cesium'; export default WallGraphics; }
  42687. declare module "cesium/Source/DataSources/exportKml" { import { exportKml } from 'cesium'; export default exportKml; }
  42688. declare module "cesium/Source/Renderer/PixelDatatype" { import { PixelDatatype } from 'cesium'; export default PixelDatatype; }
  42689. declare module "cesium/Source/Renderer/TextureMagnificationFilter" { import { TextureMagnificationFilter } from 'cesium'; export default TextureMagnificationFilter; }
  42690. declare module "cesium/Source/Renderer/TextureMinificationFilter" { import { TextureMinificationFilter } from 'cesium'; export default TextureMinificationFilter; }
  42691. declare module "cesium/Source/Scene/Appearance" { import { Appearance } from 'cesium'; export default Appearance; }
  42692. declare module "cesium/Source/Scene/ArcGisMapServerImageryProvider" { import { ArcGisMapServerImageryProvider } from 'cesium'; export default ArcGisMapServerImageryProvider; }
  42693. declare module "cesium/Source/Scene/Axis" { import { Axis } from 'cesium'; export default Axis; }
  42694. declare module "cesium/Source/Scene/Billboard" { import { Billboard } from 'cesium'; export default Billboard; }
  42695. declare module "cesium/Source/Scene/BillboardCollection" { import { BillboardCollection } from 'cesium'; export default BillboardCollection; }
  42696. declare module "cesium/Source/Scene/BingMapsImageryProvider" { import { BingMapsImageryProvider } from 'cesium'; export default BingMapsImageryProvider; }
  42697. declare module "cesium/Source/Scene/BingMapsStyle" { import { BingMapsStyle } from 'cesium'; export default BingMapsStyle; }
  42698. declare module "cesium/Source/Scene/BlendEquation" { import { BlendEquation } from 'cesium'; export default BlendEquation; }
  42699. declare module "cesium/Source/Scene/BlendFunction" { import { BlendFunction } from 'cesium'; export default BlendFunction; }
  42700. declare module "cesium/Source/Scene/BlendOption" { import { BlendOption } from 'cesium'; export default BlendOption; }
  42701. declare module "cesium/Source/Scene/BlendingState" { import { BlendingState } from 'cesium'; export default BlendingState; }
  42702. declare module "cesium/Source/Scene/BoxEmitter" { import { BoxEmitter } from 'cesium'; export default BoxEmitter; }
  42703. declare module "cesium/Source/Scene/Camera" { import { Camera } from 'cesium'; export default Camera; }
  42704. declare module "cesium/Source/Scene/CameraEventAggregator" { import { CameraEventAggregator } from 'cesium'; export default CameraEventAggregator; }
  42705. declare module "cesium/Source/Scene/CameraEventType" { import { CameraEventType } from 'cesium'; export default CameraEventType; }
  42706. declare module "cesium/Source/Scene/Cesium3DTile" { import { Cesium3DTile } from 'cesium'; export default Cesium3DTile; }
  42707. declare module "cesium/Source/Scene/Cesium3DTileColorBlendMode" { import { Cesium3DTileColorBlendMode } from 'cesium'; export default Cesium3DTileColorBlendMode; }
  42708. declare module "cesium/Source/Scene/Cesium3DTileContent" { import { Cesium3DTileContent } from 'cesium'; export default Cesium3DTileContent; }
  42709. declare module "cesium/Source/Scene/Cesium3DTileFeature" { import { Cesium3DTileFeature } from 'cesium'; export default Cesium3DTileFeature; }
  42710. declare module "cesium/Source/Scene/Cesium3DTilePointFeature" { import { Cesium3DTilePointFeature } from 'cesium'; export default Cesium3DTilePointFeature; }
  42711. declare module "cesium/Source/Scene/Cesium3DTileStyle" { import { Cesium3DTileStyle } from 'cesium'; export default Cesium3DTileStyle; }
  42712. declare module "cesium/Source/Scene/Cesium3DTileset" { import { Cesium3DTileset } from 'cesium'; export default Cesium3DTileset; }
  42713. declare module "cesium/Source/Scene/CircleEmitter" { import { CircleEmitter } from 'cesium'; export default CircleEmitter; }
  42714. declare module "cesium/Source/Scene/ClassificationPrimitive" { import { ClassificationPrimitive } from 'cesium'; export default ClassificationPrimitive; }
  42715. declare module "cesium/Source/Scene/ClassificationType" { import { ClassificationType } from 'cesium'; export default ClassificationType; }
  42716. declare module "cesium/Source/Scene/ClippingPlane" { import { ClippingPlane } from 'cesium'; export default ClippingPlane; }
  42717. declare module "cesium/Source/Scene/ClippingPlaneCollection" { import { ClippingPlaneCollection } from 'cesium'; export default ClippingPlaneCollection; }
  42718. declare module "cesium/Source/Scene/CloudCollection" { import { CloudCollection } from 'cesium'; export default CloudCollection; }
  42719. declare module "cesium/Source/Scene/CloudType" { import { CloudType } from 'cesium'; export default CloudType; }
  42720. declare module "cesium/Source/Scene/ColorBlendMode" { import { ColorBlendMode } from 'cesium'; export default ColorBlendMode; }
  42721. declare module "cesium/Source/Scene/ConditionsExpression" { import { ConditionsExpression } from 'cesium'; export default ConditionsExpression; }
  42722. declare module "cesium/Source/Scene/ConeEmitter" { import { ConeEmitter } from 'cesium'; export default ConeEmitter; }
  42723. declare module "cesium/Source/Scene/CreditDisplay" { import { CreditDisplay } from 'cesium'; export default CreditDisplay; }
  42724. declare module "cesium/Source/Scene/CullFace" { import { CullFace } from 'cesium'; export default CullFace; }
  42725. declare module "cesium/Source/Scene/CumulusCloud" { import { CumulusCloud } from 'cesium'; export default CumulusCloud; }
  42726. declare module "cesium/Source/Scene/DebugAppearance" { import { DebugAppearance } from 'cesium'; export default DebugAppearance; }
  42727. declare module "cesium/Source/Scene/DebugCameraPrimitive" { import { DebugCameraPrimitive } from 'cesium'; export default DebugCameraPrimitive; }
  42728. declare module "cesium/Source/Scene/DebugModelMatrixPrimitive" { import { DebugModelMatrixPrimitive } from 'cesium'; export default DebugModelMatrixPrimitive; }
  42729. declare module "cesium/Source/Scene/DepthFunction" { import { DepthFunction } from 'cesium'; export default DepthFunction; }
  42730. declare module "cesium/Source/Scene/DirectionalLight" { import { DirectionalLight } from 'cesium'; export default DirectionalLight; }
  42731. declare module "cesium/Source/Scene/DiscardEmptyTileImagePolicy" { import { DiscardEmptyTileImagePolicy } from 'cesium'; export default DiscardEmptyTileImagePolicy; }
  42732. declare module "cesium/Source/Scene/DiscardMissingTileImagePolicy" { import { DiscardMissingTileImagePolicy } from 'cesium'; export default DiscardMissingTileImagePolicy; }
  42733. declare module "cesium/Source/Scene/EllipsoidSurfaceAppearance" { import { EllipsoidSurfaceAppearance } from 'cesium'; export default EllipsoidSurfaceAppearance; }
  42734. declare module "cesium/Source/Scene/Expression" { import { Expression } from 'cesium'; export default Expression; }
  42735. declare module "cesium/Source/Scene/Fog" { import { Fog } from 'cesium'; export default Fog; }
  42736. declare module "cesium/Source/Scene/FrameRateMonitor" { import { FrameRateMonitor } from 'cesium'; export default FrameRateMonitor; }
  42737. declare module "cesium/Source/Scene/GetFeatureInfoFormat" { import { GetFeatureInfoFormat } from 'cesium'; export default GetFeatureInfoFormat; }
  42738. declare module "cesium/Source/Scene/Globe" { import { Globe } from 'cesium'; export default Globe; }
  42739. declare module "cesium/Source/Scene/GlobeTranslucency" { import { GlobeTranslucency } from 'cesium'; export default GlobeTranslucency; }
  42740. declare module "cesium/Source/Scene/GoogleEarthEnterpriseImageryProvider" { import { GoogleEarthEnterpriseImageryProvider } from 'cesium'; export default GoogleEarthEnterpriseImageryProvider; }
  42741. declare module "cesium/Source/Scene/GoogleEarthEnterpriseMapsProvider" { import { GoogleEarthEnterpriseMapsProvider } from 'cesium'; export default GoogleEarthEnterpriseMapsProvider; }
  42742. declare module "cesium/Source/Scene/GridImageryProvider" { import { GridImageryProvider } from 'cesium'; export default GridImageryProvider; }
  42743. declare module "cesium/Source/Scene/GroundPolylinePrimitive" { import { GroundPolylinePrimitive } from 'cesium'; export default GroundPolylinePrimitive; }
  42744. declare module "cesium/Source/Scene/GroundPrimitive" { import { GroundPrimitive } from 'cesium'; export default GroundPrimitive; }
  42745. declare module "cesium/Source/Scene/HeightReference" { import { HeightReference } from 'cesium'; export default HeightReference; }
  42746. declare module "cesium/Source/Scene/HorizontalOrigin" { import { HorizontalOrigin } from 'cesium'; export default HorizontalOrigin; }
  42747. declare module "cesium/Source/Scene/ImageryLayer" { import { ImageryLayer } from 'cesium'; export default ImageryLayer; }
  42748. declare module "cesium/Source/Scene/ImageryLayerCollection" { import { ImageryLayerCollection } from 'cesium'; export default ImageryLayerCollection; }
  42749. declare module "cesium/Source/Scene/ImageryLayerFeatureInfo" { import { ImageryLayerFeatureInfo } from 'cesium'; export default ImageryLayerFeatureInfo; }
  42750. declare module "cesium/Source/Scene/ImageryProvider" { import { ImageryProvider } from 'cesium'; export default ImageryProvider; }
  42751. declare module "cesium/Source/Scene/ImagerySplitDirection" { import { ImagerySplitDirection } from 'cesium'; export default ImagerySplitDirection; }
  42752. declare module "cesium/Source/Scene/IonImageryProvider" { import { IonImageryProvider } from 'cesium'; export default IonImageryProvider; }
  42753. declare module "cesium/Source/Scene/IonWorldImageryStyle" { import { IonWorldImageryStyle } from 'cesium'; export default IonWorldImageryStyle; }
  42754. declare module "cesium/Source/Scene/Label" { import { Label } from 'cesium'; export default Label; }
  42755. declare module "cesium/Source/Scene/LabelCollection" { import { LabelCollection } from 'cesium'; export default LabelCollection; }
  42756. declare module "cesium/Source/Scene/LabelStyle" { import { LabelStyle } from 'cesium'; export default LabelStyle; }
  42757. declare module "cesium/Source/Scene/Light" { import { Light } from 'cesium'; export default Light; }
  42758. declare module "cesium/Source/Scene/MapMode2D" { import { MapMode2D } from 'cesium'; export default MapMode2D; }
  42759. declare module "cesium/Source/Scene/MapboxImageryProvider" { import { MapboxImageryProvider } from 'cesium'; export default MapboxImageryProvider; }
  42760. declare module "cesium/Source/Scene/MapboxStyleImageryProvider" { import { MapboxStyleImageryProvider } from 'cesium'; export default MapboxStyleImageryProvider; }
  42761. declare module "cesium/Source/Scene/Material" { import { Material } from 'cesium'; export default Material; }
  42762. declare module "cesium/Source/Scene/MaterialAppearance" { import { MaterialAppearance } from 'cesium'; export default MaterialAppearance; }
  42763. declare module "cesium/Source/Scene/Model" { import { Model } from 'cesium'; export default Model; }
  42764. declare module "cesium/Source/Scene/ModelAnimation" { import { ModelAnimation } from 'cesium'; export default ModelAnimation; }
  42765. declare module "cesium/Source/Scene/ModelAnimationCollection" { import { ModelAnimationCollection } from 'cesium'; export default ModelAnimationCollection; }
  42766. declare module "cesium/Source/Scene/ModelAnimationLoop" { import { ModelAnimationLoop } from 'cesium'; export default ModelAnimationLoop; }
  42767. declare module "cesium/Source/Scene/ModelMaterial" { import { ModelMaterial } from 'cesium'; export default ModelMaterial; }
  42768. declare module "cesium/Source/Scene/ModelMesh" { import { ModelMesh } from 'cesium'; export default ModelMesh; }
  42769. declare module "cesium/Source/Scene/ModelNode" { import { ModelNode } from 'cesium'; export default ModelNode; }
  42770. declare module "cesium/Source/Scene/Moon" { import { Moon } from 'cesium'; export default Moon; }
  42771. declare module "cesium/Source/Scene/NeverTileDiscardPolicy" { import { NeverTileDiscardPolicy } from 'cesium'; export default NeverTileDiscardPolicy; }
  42772. declare module "cesium/Source/Scene/OpenStreetMapImageryProvider" { import { OpenStreetMapImageryProvider } from 'cesium'; export default OpenStreetMapImageryProvider; }
  42773. declare module "cesium/Source/Scene/Particle" { import { Particle } from 'cesium'; export default Particle; }
  42774. declare module "cesium/Source/Scene/ParticleBurst" { import { ParticleBurst } from 'cesium'; export default ParticleBurst; }
  42775. declare module "cesium/Source/Scene/ParticleEmitter" { import { ParticleEmitter } from 'cesium'; export default ParticleEmitter; }
  42776. declare module "cesium/Source/Scene/ParticleSystem" { import { ParticleSystem } from 'cesium'; export default ParticleSystem; }
  42777. declare module "cesium/Source/Scene/PerInstanceColorAppearance" { import { PerInstanceColorAppearance } from 'cesium'; export default PerInstanceColorAppearance; }
  42778. declare module "cesium/Source/Scene/PointCloudShading" { import { PointCloudShading } from 'cesium'; export default PointCloudShading; }
  42779. declare module "cesium/Source/Scene/PointPrimitive" { import { PointPrimitive } from 'cesium'; export default PointPrimitive; }
  42780. declare module "cesium/Source/Scene/PointPrimitiveCollection" { import { PointPrimitiveCollection } from 'cesium'; export default PointPrimitiveCollection; }
  42781. declare module "cesium/Source/Scene/Polyline" { import { Polyline } from 'cesium'; export default Polyline; }
  42782. declare module "cesium/Source/Scene/PolylineCollection" { import { PolylineCollection } from 'cesium'; export default PolylineCollection; }
  42783. declare module "cesium/Source/Scene/PolylineColorAppearance" { import { PolylineColorAppearance } from 'cesium'; export default PolylineColorAppearance; }
  42784. declare module "cesium/Source/Scene/PolylineMaterialAppearance" { import { PolylineMaterialAppearance } from 'cesium'; export default PolylineMaterialAppearance; }
  42785. declare module "cesium/Source/Scene/PostProcessStage" { import { PostProcessStage } from 'cesium'; export default PostProcessStage; }
  42786. declare module "cesium/Source/Scene/PostProcessStageCollection" { import { PostProcessStageCollection } from 'cesium'; export default PostProcessStageCollection; }
  42787. declare module "cesium/Source/Scene/PostProcessStageComposite" { import { PostProcessStageComposite } from 'cesium'; export default PostProcessStageComposite; }
  42788. declare module "cesium/Source/Scene/PostProcessStageLibrary" { import { PostProcessStageLibrary } from 'cesium'; export default PostProcessStageLibrary; }
  42789. declare module "cesium/Source/Scene/PostProcessStageSampleMode" { import { PostProcessStageSampleMode } from 'cesium'; export default PostProcessStageSampleMode; }
  42790. declare module "cesium/Source/Scene/Primitive" { import { Primitive } from 'cesium'; export default Primitive; }
  42791. declare module "cesium/Source/Scene/PrimitiveCollection" { import { PrimitiveCollection } from 'cesium'; export default PrimitiveCollection; }
  42792. declare module "cesium/Source/Scene/Scene" { import { Scene } from 'cesium'; export default Scene; }
  42793. declare module "cesium/Source/Scene/SceneMode" { import { SceneMode } from 'cesium'; export default SceneMode; }
  42794. declare module "cesium/Source/Scene/SceneTransforms" { import { SceneTransforms } from 'cesium'; export default SceneTransforms; }
  42795. declare module "cesium/Source/Scene/ScreenSpaceCameraController" { import { ScreenSpaceCameraController } from 'cesium'; export default ScreenSpaceCameraController; }
  42796. declare module "cesium/Source/Scene/ShadowMap" { import { ShadowMap } from 'cesium'; export default ShadowMap; }
  42797. declare module "cesium/Source/Scene/ShadowMode" { import { ShadowMode } from 'cesium'; export default ShadowMode; }
  42798. declare module "cesium/Source/Scene/SingleTileImageryProvider" { import { SingleTileImageryProvider } from 'cesium'; export default SingleTileImageryProvider; }
  42799. declare module "cesium/Source/Scene/SkyAtmosphere" { import { SkyAtmosphere } from 'cesium'; export default SkyAtmosphere; }
  42800. declare module "cesium/Source/Scene/SkyBox" { import { SkyBox } from 'cesium'; export default SkyBox; }
  42801. declare module "cesium/Source/Scene/SphereEmitter" { import { SphereEmitter } from 'cesium'; export default SphereEmitter; }
  42802. declare module "cesium/Source/Scene/StencilFunction" { import { StencilFunction } from 'cesium'; export default StencilFunction; }
  42803. declare module "cesium/Source/Scene/StencilOperation" { import { StencilOperation } from 'cesium'; export default StencilOperation; }
  42804. declare module "cesium/Source/Scene/StyleExpression" { import { StyleExpression } from 'cesium'; export default StyleExpression; }
  42805. declare module "cesium/Source/Scene/Sun" { import { Sun } from 'cesium'; export default Sun; }
  42806. declare module "cesium/Source/Scene/SunLight" { import { SunLight } from 'cesium'; export default SunLight; }
  42807. declare module "cesium/Source/Scene/TileCoordinatesImageryProvider" { import { TileCoordinatesImageryProvider } from 'cesium'; export default TileCoordinatesImageryProvider; }
  42808. declare module "cesium/Source/Scene/TileDiscardPolicy" { import { TileDiscardPolicy } from 'cesium'; export default TileDiscardPolicy; }
  42809. declare module "cesium/Source/Scene/TileMapServiceImageryProvider" { import { TileMapServiceImageryProvider } from 'cesium'; export default TileMapServiceImageryProvider; }
  42810. declare module "cesium/Source/Scene/TimeDynamicImagery" { import { TimeDynamicImagery } from 'cesium'; export default TimeDynamicImagery; }
  42811. declare module "cesium/Source/Scene/TimeDynamicPointCloud" { import { TimeDynamicPointCloud } from 'cesium'; export default TimeDynamicPointCloud; }
  42812. declare module "cesium/Source/Scene/UrlTemplateImageryProvider" { import { UrlTemplateImageryProvider } from 'cesium'; export default UrlTemplateImageryProvider; }
  42813. declare module "cesium/Source/Scene/VerticalOrigin" { import { VerticalOrigin } from 'cesium'; export default VerticalOrigin; }
  42814. declare module "cesium/Source/Scene/ViewportQuad" { import { ViewportQuad } from 'cesium'; export default ViewportQuad; }
  42815. declare module "cesium/Source/Scene/WebMapServiceImageryProvider" { import { WebMapServiceImageryProvider } from 'cesium'; export default WebMapServiceImageryProvider; }
  42816. declare module "cesium/Source/Scene/WebMapTileServiceImageryProvider" { import { WebMapTileServiceImageryProvider } from 'cesium'; export default WebMapTileServiceImageryProvider; }
  42817. declare module "cesium/Source/Scene/createElevationBandMaterial" { import { createElevationBandMaterial } from 'cesium'; export default createElevationBandMaterial; }
  42818. declare module "cesium/Source/Scene/createOsmBuildings" { import { createOsmBuildings } from 'cesium'; export default createOsmBuildings; }
  42819. declare module "cesium/Source/Scene/createTangentSpaceDebugPrimitive" { import { createTangentSpaceDebugPrimitive } from 'cesium'; export default createTangentSpaceDebugPrimitive; }
  42820. declare module "cesium/Source/Scene/createWorldImagery" { import { createWorldImagery } from 'cesium'; export default createWorldImagery; }
  42821. declare module "cesium/Source/Widgets/ClockViewModel" { import { ClockViewModel } from 'cesium'; export default ClockViewModel; }
  42822. declare module "cesium/Source/Widgets/Command" { import { Command } from 'cesium'; export default Command; }
  42823. declare module "cesium/Source/Widgets/SvgPathBindingHandler" { import { SvgPathBindingHandler } from 'cesium'; export default SvgPathBindingHandler; }
  42824. declare module "cesium/Source/Widgets/ToggleButtonViewModel" { import { ToggleButtonViewModel } from 'cesium'; export default ToggleButtonViewModel; }
  42825. declare module "cesium/Source/Widgets/createCommand" { import { createCommand } from 'cesium'; export default createCommand; }
  42826. declare module "cesium/Source/Widgets/Animation/Animation" { import { Animation } from 'cesium'; export default Animation; }
  42827. declare module "cesium/Source/Widgets/Animation/AnimationViewModel" { import { AnimationViewModel } from 'cesium'; export default AnimationViewModel; }
  42828. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPicker" { import { BaseLayerPicker } from 'cesium'; export default BaseLayerPicker; }
  42829. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel" { import { BaseLayerPickerViewModel } from 'cesium'; export default BaseLayerPickerViewModel; }
  42830. declare module "cesium/Source/Widgets/BaseLayerPicker/ProviderViewModel" { import { ProviderViewModel } from 'cesium'; export default ProviderViewModel; }
  42831. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector" { import { Cesium3DTilesInspector } from 'cesium'; export default Cesium3DTilesInspector; }
  42832. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel" { import { Cesium3DTilesInspectorViewModel } from 'cesium'; export default Cesium3DTilesInspectorViewModel; }
  42833. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspector" { import { CesiumInspector } from 'cesium'; export default CesiumInspector; }
  42834. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspectorViewModel" { import { CesiumInspectorViewModel } from 'cesium'; export default CesiumInspectorViewModel; }
  42835. declare module "cesium/Source/Widgets/CesiumWidget/CesiumWidget" { import { CesiumWidget } from 'cesium'; export default CesiumWidget; }
  42836. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButton" { import { FullscreenButton } from 'cesium'; export default FullscreenButton; }
  42837. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButtonViewModel" { import { FullscreenButtonViewModel } from 'cesium'; export default FullscreenButtonViewModel; }
  42838. declare module "cesium/Source/Widgets/Geocoder/Geocoder" { import { Geocoder } from 'cesium'; export default Geocoder; }
  42839. declare module "cesium/Source/Widgets/Geocoder/GeocoderViewModel" { import { GeocoderViewModel } from 'cesium'; export default GeocoderViewModel; }
  42840. declare module "cesium/Source/Widgets/HomeButton/HomeButton" { import { HomeButton } from 'cesium'; export default HomeButton; }
  42841. declare module "cesium/Source/Widgets/HomeButton/HomeButtonViewModel" { import { HomeButtonViewModel } from 'cesium'; export default HomeButtonViewModel; }
  42842. declare module "cesium/Source/Widgets/InfoBox/InfoBox" { import { InfoBox } from 'cesium'; export default InfoBox; }
  42843. declare module "cesium/Source/Widgets/InfoBox/InfoBoxViewModel" { import { InfoBoxViewModel } from 'cesium'; export default InfoBoxViewModel; }
  42844. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButton" { import { NavigationHelpButton } from 'cesium'; export default NavigationHelpButton; }
  42845. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButtonViewModel" { import { NavigationHelpButtonViewModel } from 'cesium'; export default NavigationHelpButtonViewModel; }
  42846. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdog" { import { PerformanceWatchdog } from 'cesium'; export default PerformanceWatchdog; }
  42847. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel" { import { PerformanceWatchdogViewModel } from 'cesium'; export default PerformanceWatchdogViewModel; }
  42848. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPicker" { import { ProjectionPicker } from 'cesium'; export default ProjectionPicker; }
  42849. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPickerViewModel" { import { ProjectionPickerViewModel } from 'cesium'; export default ProjectionPickerViewModel; }
  42850. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePicker" { import { SceneModePicker } from 'cesium'; export default SceneModePicker; }
  42851. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePickerViewModel" { import { SceneModePickerViewModel } from 'cesium'; export default SceneModePickerViewModel; }
  42852. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicator" { import { SelectionIndicator } from 'cesium'; export default SelectionIndicator; }
  42853. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel" { import { SelectionIndicatorViewModel } from 'cesium'; export default SelectionIndicatorViewModel; }
  42854. declare module "cesium/Source/Widgets/Timeline/Timeline" { import { Timeline } from 'cesium'; export default Timeline; }
  42855. declare module "cesium/Source/Widgets/VRButton/VRButton" { import { VRButton } from 'cesium'; export default VRButton; }
  42856. declare module "cesium/Source/Widgets/VRButton/VRButtonViewModel" { import { VRButtonViewModel } from 'cesium'; export default VRButtonViewModel; }
  42857. declare module "cesium/Source/Widgets/Viewer/Viewer" { import { Viewer } from 'cesium'; export default Viewer; }
  42858. declare module "cesium/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin" { import { viewerCesium3DTilesInspectorMixin } from 'cesium'; export default viewerCesium3DTilesInspectorMixin; }
  42859. declare module "cesium/Source/Widgets/Viewer/viewerCesiumInspectorMixin" { import { viewerCesiumInspectorMixin } from 'cesium'; export default viewerCesiumInspectorMixin; }
  42860. declare module "cesium/Source/Widgets/Viewer/viewerDragDropMixin" { import { viewerDragDropMixin } from 'cesium'; export default viewerDragDropMixin; }
  42861. declare module "cesium/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin" { import { viewerPerformanceWatchdogMixin } from 'cesium'; export default viewerPerformanceWatchdogMixin; }