Cesium.d.ts 2.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169
  1. declare module "cesium" {
  2. /**
  3. * Enum containing WebGL Constant values by name.
  4. * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context
  5. * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).
  6. *
  7. * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}
  8. * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}
  9. * specifications.
  10. */
  11. export enum WebGLConstants {
  12. DEPTH_BUFFER_BIT = 256,
  13. STENCIL_BUFFER_BIT = 1024,
  14. COLOR_BUFFER_BIT = 16384,
  15. POINTS = 0,
  16. LINES = 1,
  17. LINE_LOOP = 2,
  18. LINE_STRIP = 3,
  19. TRIANGLES = 4,
  20. TRIANGLE_STRIP = 5,
  21. TRIANGLE_FAN = 6,
  22. ZERO = 0,
  23. ONE = 1,
  24. SRC_COLOR = 768,
  25. ONE_MINUS_SRC_COLOR = 769,
  26. SRC_ALPHA = 770,
  27. ONE_MINUS_SRC_ALPHA = 771,
  28. DST_ALPHA = 772,
  29. ONE_MINUS_DST_ALPHA = 773,
  30. DST_COLOR = 774,
  31. ONE_MINUS_DST_COLOR = 775,
  32. SRC_ALPHA_SATURATE = 776,
  33. FUNC_ADD = 32774,
  34. BLEND_EQUATION = 32777,
  35. BLEND_EQUATION_RGB = 32777,
  36. BLEND_EQUATION_ALPHA = 34877,
  37. FUNC_SUBTRACT = 32778,
  38. FUNC_REVERSE_SUBTRACT = 32779,
  39. BLEND_DST_RGB = 32968,
  40. BLEND_SRC_RGB = 32969,
  41. BLEND_DST_ALPHA = 32970,
  42. BLEND_SRC_ALPHA = 32971,
  43. CONSTANT_COLOR = 32769,
  44. ONE_MINUS_CONSTANT_COLOR = 32770,
  45. CONSTANT_ALPHA = 32771,
  46. ONE_MINUS_CONSTANT_ALPHA = 32772,
  47. BLEND_COLOR = 32773,
  48. ARRAY_BUFFER = 34962,
  49. ELEMENT_ARRAY_BUFFER = 34963,
  50. ARRAY_BUFFER_BINDING = 34964,
  51. ELEMENT_ARRAY_BUFFER_BINDING = 34965,
  52. STREAM_DRAW = 35040,
  53. STATIC_DRAW = 35044,
  54. DYNAMIC_DRAW = 35048,
  55. BUFFER_SIZE = 34660,
  56. BUFFER_USAGE = 34661,
  57. CURRENT_VERTEX_ATTRIB = 34342,
  58. FRONT = 1028,
  59. BACK = 1029,
  60. FRONT_AND_BACK = 1032,
  61. CULL_FACE = 2884,
  62. BLEND = 3042,
  63. DITHER = 3024,
  64. STENCIL_TEST = 2960,
  65. DEPTH_TEST = 2929,
  66. SCISSOR_TEST = 3089,
  67. POLYGON_OFFSET_FILL = 32823,
  68. SAMPLE_ALPHA_TO_COVERAGE = 32926,
  69. SAMPLE_COVERAGE = 32928,
  70. NO_ERROR = 0,
  71. INVALID_ENUM = 1280,
  72. INVALID_VALUE = 1281,
  73. INVALID_OPERATION = 1282,
  74. OUT_OF_MEMORY = 1285,
  75. CW = 2304,
  76. CCW = 2305,
  77. LINE_WIDTH = 2849,
  78. ALIASED_POINT_SIZE_RANGE = 33901,
  79. ALIASED_LINE_WIDTH_RANGE = 33902,
  80. CULL_FACE_MODE = 2885,
  81. FRONT_FACE = 2886,
  82. DEPTH_RANGE = 2928,
  83. DEPTH_WRITEMASK = 2930,
  84. DEPTH_CLEAR_VALUE = 2931,
  85. DEPTH_FUNC = 2932,
  86. STENCIL_CLEAR_VALUE = 2961,
  87. STENCIL_FUNC = 2962,
  88. STENCIL_FAIL = 2964,
  89. STENCIL_PASS_DEPTH_FAIL = 2965,
  90. STENCIL_PASS_DEPTH_PASS = 2966,
  91. STENCIL_REF = 2967,
  92. STENCIL_VALUE_MASK = 2963,
  93. STENCIL_WRITEMASK = 2968,
  94. STENCIL_BACK_FUNC = 34816,
  95. STENCIL_BACK_FAIL = 34817,
  96. STENCIL_BACK_PASS_DEPTH_FAIL = 34818,
  97. STENCIL_BACK_PASS_DEPTH_PASS = 34819,
  98. STENCIL_BACK_REF = 36003,
  99. STENCIL_BACK_VALUE_MASK = 36004,
  100. STENCIL_BACK_WRITEMASK = 36005,
  101. VIEWPORT = 2978,
  102. SCISSOR_BOX = 3088,
  103. COLOR_CLEAR_VALUE = 3106,
  104. COLOR_WRITEMASK = 3107,
  105. UNPACK_ALIGNMENT = 3317,
  106. PACK_ALIGNMENT = 3333,
  107. MAX_TEXTURE_SIZE = 3379,
  108. MAX_VIEWPORT_DIMS = 3386,
  109. SUBPIXEL_BITS = 3408,
  110. RED_BITS = 3410,
  111. GREEN_BITS = 3411,
  112. BLUE_BITS = 3412,
  113. ALPHA_BITS = 3413,
  114. DEPTH_BITS = 3414,
  115. STENCIL_BITS = 3415,
  116. POLYGON_OFFSET_UNITS = 10752,
  117. POLYGON_OFFSET_FACTOR = 32824,
  118. TEXTURE_BINDING_2D = 32873,
  119. SAMPLE_BUFFERS = 32936,
  120. SAMPLES = 32937,
  121. SAMPLE_COVERAGE_VALUE = 32938,
  122. SAMPLE_COVERAGE_INVERT = 32939,
  123. COMPRESSED_TEXTURE_FORMATS = 34467,
  124. DONT_CARE = 4352,
  125. FASTEST = 4353,
  126. NICEST = 4354,
  127. GENERATE_MIPMAP_HINT = 33170,
  128. BYTE = 5120,
  129. UNSIGNED_BYTE = 5121,
  130. SHORT = 5122,
  131. UNSIGNED_SHORT = 5123,
  132. INT = 5124,
  133. UNSIGNED_INT = 5125,
  134. FLOAT = 5126,
  135. DEPTH_COMPONENT = 6402,
  136. ALPHA = 6406,
  137. RGB = 6407,
  138. RGBA = 6408,
  139. LUMINANCE = 6409,
  140. LUMINANCE_ALPHA = 6410,
  141. UNSIGNED_SHORT_4_4_4_4 = 32819,
  142. UNSIGNED_SHORT_5_5_5_1 = 32820,
  143. UNSIGNED_SHORT_5_6_5 = 33635,
  144. FRAGMENT_SHADER = 35632,
  145. VERTEX_SHADER = 35633,
  146. MAX_VERTEX_ATTRIBS = 34921,
  147. MAX_VERTEX_UNIFORM_VECTORS = 36347,
  148. MAX_VARYING_VECTORS = 36348,
  149. MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661,
  150. MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660,
  151. MAX_TEXTURE_IMAGE_UNITS = 34930,
  152. MAX_FRAGMENT_UNIFORM_VECTORS = 36349,
  153. SHADER_TYPE = 35663,
  154. DELETE_STATUS = 35712,
  155. LINK_STATUS = 35714,
  156. VALIDATE_STATUS = 35715,
  157. ATTACHED_SHADERS = 35717,
  158. ACTIVE_UNIFORMS = 35718,
  159. ACTIVE_ATTRIBUTES = 35721,
  160. SHADING_LANGUAGE_VERSION = 35724,
  161. CURRENT_PROGRAM = 35725,
  162. NEVER = 512,
  163. LESS = 513,
  164. EQUAL = 514,
  165. LEQUAL = 515,
  166. GREATER = 516,
  167. NOTEQUAL = 517,
  168. GEQUAL = 518,
  169. ALWAYS = 519,
  170. KEEP = 7680,
  171. REPLACE = 7681,
  172. INCR = 7682,
  173. DECR = 7683,
  174. INVERT = 5386,
  175. INCR_WRAP = 34055,
  176. DECR_WRAP = 34056,
  177. VENDOR = 7936,
  178. RENDERER = 7937,
  179. VERSION = 7938,
  180. NEAREST = 9728,
  181. LINEAR = 9729,
  182. NEAREST_MIPMAP_NEAREST = 9984,
  183. LINEAR_MIPMAP_NEAREST = 9985,
  184. NEAREST_MIPMAP_LINEAR = 9986,
  185. LINEAR_MIPMAP_LINEAR = 9987,
  186. TEXTURE_MAG_FILTER = 10240,
  187. TEXTURE_MIN_FILTER = 10241,
  188. TEXTURE_WRAP_S = 10242,
  189. TEXTURE_WRAP_T = 10243,
  190. TEXTURE_2D = 3553,
  191. TEXTURE = 5890,
  192. TEXTURE_CUBE_MAP = 34067,
  193. TEXTURE_BINDING_CUBE_MAP = 34068,
  194. TEXTURE_CUBE_MAP_POSITIVE_X = 34069,
  195. TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,
  196. TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,
  197. TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,
  198. TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,
  199. TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074,
  200. MAX_CUBE_MAP_TEXTURE_SIZE = 34076,
  201. TEXTURE0 = 33984,
  202. TEXTURE1 = 33985,
  203. TEXTURE2 = 33986,
  204. TEXTURE3 = 33987,
  205. TEXTURE4 = 33988,
  206. TEXTURE5 = 33989,
  207. TEXTURE6 = 33990,
  208. TEXTURE7 = 33991,
  209. TEXTURE8 = 33992,
  210. TEXTURE9 = 33993,
  211. TEXTURE10 = 33994,
  212. TEXTURE11 = 33995,
  213. TEXTURE12 = 33996,
  214. TEXTURE13 = 33997,
  215. TEXTURE14 = 33998,
  216. TEXTURE15 = 33999,
  217. TEXTURE16 = 34000,
  218. TEXTURE17 = 34001,
  219. TEXTURE18 = 34002,
  220. TEXTURE19 = 34003,
  221. TEXTURE20 = 34004,
  222. TEXTURE21 = 34005,
  223. TEXTURE22 = 34006,
  224. TEXTURE23 = 34007,
  225. TEXTURE24 = 34008,
  226. TEXTURE25 = 34009,
  227. TEXTURE26 = 34010,
  228. TEXTURE27 = 34011,
  229. TEXTURE28 = 34012,
  230. TEXTURE29 = 34013,
  231. TEXTURE30 = 34014,
  232. TEXTURE31 = 34015,
  233. ACTIVE_TEXTURE = 34016,
  234. REPEAT = 10497,
  235. CLAMP_TO_EDGE = 33071,
  236. MIRRORED_REPEAT = 33648,
  237. FLOAT_VEC2 = 35664,
  238. FLOAT_VEC3 = 35665,
  239. FLOAT_VEC4 = 35666,
  240. INT_VEC2 = 35667,
  241. INT_VEC3 = 35668,
  242. INT_VEC4 = 35669,
  243. BOOL = 35670,
  244. BOOL_VEC2 = 35671,
  245. BOOL_VEC3 = 35672,
  246. BOOL_VEC4 = 35673,
  247. FLOAT_MAT2 = 35674,
  248. FLOAT_MAT3 = 35675,
  249. FLOAT_MAT4 = 35676,
  250. SAMPLER_2D = 35678,
  251. SAMPLER_CUBE = 35680,
  252. VERTEX_ATTRIB_ARRAY_ENABLED = 34338,
  253. VERTEX_ATTRIB_ARRAY_SIZE = 34339,
  254. VERTEX_ATTRIB_ARRAY_STRIDE = 34340,
  255. VERTEX_ATTRIB_ARRAY_TYPE = 34341,
  256. VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922,
  257. VERTEX_ATTRIB_ARRAY_POINTER = 34373,
  258. VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975,
  259. IMPLEMENTATION_COLOR_READ_TYPE = 35738,
  260. IMPLEMENTATION_COLOR_READ_FORMAT = 35739,
  261. COMPILE_STATUS = 35713,
  262. LOW_FLOAT = 36336,
  263. MEDIUM_FLOAT = 36337,
  264. HIGH_FLOAT = 36338,
  265. LOW_INT = 36339,
  266. MEDIUM_INT = 36340,
  267. HIGH_INT = 36341,
  268. FRAMEBUFFER = 36160,
  269. RENDERBUFFER = 36161,
  270. RGBA4 = 32854,
  271. RGB5_A1 = 32855,
  272. RGB565 = 36194,
  273. DEPTH_COMPONENT16 = 33189,
  274. STENCIL_INDEX = 6401,
  275. STENCIL_INDEX8 = 36168,
  276. DEPTH_STENCIL = 34041,
  277. RENDERBUFFER_WIDTH = 36162,
  278. RENDERBUFFER_HEIGHT = 36163,
  279. RENDERBUFFER_INTERNAL_FORMAT = 36164,
  280. RENDERBUFFER_RED_SIZE = 36176,
  281. RENDERBUFFER_GREEN_SIZE = 36177,
  282. RENDERBUFFER_BLUE_SIZE = 36178,
  283. RENDERBUFFER_ALPHA_SIZE = 36179,
  284. RENDERBUFFER_DEPTH_SIZE = 36180,
  285. RENDERBUFFER_STENCIL_SIZE = 36181,
  286. FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048,
  287. FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049,
  288. FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050,
  289. FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051,
  290. COLOR_ATTACHMENT0 = 36064,
  291. DEPTH_ATTACHMENT = 36096,
  292. STENCIL_ATTACHMENT = 36128,
  293. DEPTH_STENCIL_ATTACHMENT = 33306,
  294. NONE = 0,
  295. FRAMEBUFFER_COMPLETE = 36053,
  296. FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054,
  297. FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055,
  298. FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057,
  299. FRAMEBUFFER_UNSUPPORTED = 36061,
  300. FRAMEBUFFER_BINDING = 36006,
  301. RENDERBUFFER_BINDING = 36007,
  302. MAX_RENDERBUFFER_SIZE = 34024,
  303. INVALID_FRAMEBUFFER_OPERATION = 1286,
  304. UNPACK_FLIP_Y_WEBGL = 37440,
  305. UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441,
  306. CONTEXT_LOST_WEBGL = 37442,
  307. UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443,
  308. BROWSER_DEFAULT_WEBGL = 37444,
  309. COMPRESSED_RGB_S3TC_DXT1_EXT = 33776,
  310. COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777,
  311. COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778,
  312. COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779,
  313. COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840,
  314. COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841,
  315. COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842,
  316. COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843,
  317. COMPRESSED_RGBA_ASTC_4x4_WEBGL = 37808,
  318. COMPRESSED_RGB_ETC1_WEBGL = 36196,
  319. COMPRESSED_RGBA_BPTC_UNORM = 36492,
  320. HALF_FLOAT_OES = 36193,
  321. DOUBLE = 5130,
  322. READ_BUFFER = 3074,
  323. UNPACK_ROW_LENGTH = 3314,
  324. UNPACK_SKIP_ROWS = 3315,
  325. UNPACK_SKIP_PIXELS = 3316,
  326. PACK_ROW_LENGTH = 3330,
  327. PACK_SKIP_ROWS = 3331,
  328. PACK_SKIP_PIXELS = 3332,
  329. COLOR = 6144,
  330. DEPTH = 6145,
  331. STENCIL = 6146,
  332. RED = 6403,
  333. RGB8 = 32849,
  334. RGBA8 = 32856,
  335. RGB10_A2 = 32857,
  336. TEXTURE_BINDING_3D = 32874,
  337. UNPACK_SKIP_IMAGES = 32877,
  338. UNPACK_IMAGE_HEIGHT = 32878,
  339. TEXTURE_3D = 32879,
  340. TEXTURE_WRAP_R = 32882,
  341. MAX_3D_TEXTURE_SIZE = 32883,
  342. UNSIGNED_INT_2_10_10_10_REV = 33640,
  343. MAX_ELEMENTS_VERTICES = 33000,
  344. MAX_ELEMENTS_INDICES = 33001,
  345. TEXTURE_MIN_LOD = 33082,
  346. TEXTURE_MAX_LOD = 33083,
  347. TEXTURE_BASE_LEVEL = 33084,
  348. TEXTURE_MAX_LEVEL = 33085,
  349. MIN = 32775,
  350. MAX = 32776,
  351. DEPTH_COMPONENT24 = 33190,
  352. MAX_TEXTURE_LOD_BIAS = 34045,
  353. TEXTURE_COMPARE_MODE = 34892,
  354. TEXTURE_COMPARE_FUNC = 34893,
  355. CURRENT_QUERY = 34917,
  356. QUERY_RESULT = 34918,
  357. QUERY_RESULT_AVAILABLE = 34919,
  358. STREAM_READ = 35041,
  359. STREAM_COPY = 35042,
  360. STATIC_READ = 35045,
  361. STATIC_COPY = 35046,
  362. DYNAMIC_READ = 35049,
  363. DYNAMIC_COPY = 35050,
  364. MAX_DRAW_BUFFERS = 34852,
  365. DRAW_BUFFER0 = 34853,
  366. DRAW_BUFFER1 = 34854,
  367. DRAW_BUFFER2 = 34855,
  368. DRAW_BUFFER3 = 34856,
  369. DRAW_BUFFER4 = 34857,
  370. DRAW_BUFFER5 = 34858,
  371. DRAW_BUFFER6 = 34859,
  372. DRAW_BUFFER7 = 34860,
  373. DRAW_BUFFER8 = 34861,
  374. DRAW_BUFFER9 = 34862,
  375. DRAW_BUFFER10 = 34863,
  376. DRAW_BUFFER11 = 34864,
  377. DRAW_BUFFER12 = 34865,
  378. DRAW_BUFFER13 = 34866,
  379. DRAW_BUFFER14 = 34867,
  380. DRAW_BUFFER15 = 34868,
  381. MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657,
  382. MAX_VERTEX_UNIFORM_COMPONENTS = 35658,
  383. SAMPLER_3D = 35679,
  384. SAMPLER_2D_SHADOW = 35682,
  385. FRAGMENT_SHADER_DERIVATIVE_HINT = 35723,
  386. PIXEL_PACK_BUFFER = 35051,
  387. PIXEL_UNPACK_BUFFER = 35052,
  388. PIXEL_PACK_BUFFER_BINDING = 35053,
  389. PIXEL_UNPACK_BUFFER_BINDING = 35055,
  390. FLOAT_MAT2x3 = 35685,
  391. FLOAT_MAT2x4 = 35686,
  392. FLOAT_MAT3x2 = 35687,
  393. FLOAT_MAT3x4 = 35688,
  394. FLOAT_MAT4x2 = 35689,
  395. FLOAT_MAT4x3 = 35690,
  396. SRGB = 35904,
  397. SRGB8 = 35905,
  398. SRGB8_ALPHA8 = 35907,
  399. COMPARE_REF_TO_TEXTURE = 34894,
  400. RGBA32F = 34836,
  401. RGB32F = 34837,
  402. RGBA16F = 34842,
  403. RGB16F = 34843,
  404. VERTEX_ATTRIB_ARRAY_INTEGER = 35069,
  405. MAX_ARRAY_TEXTURE_LAYERS = 35071,
  406. MIN_PROGRAM_TEXEL_OFFSET = 35076,
  407. MAX_PROGRAM_TEXEL_OFFSET = 35077,
  408. MAX_VARYING_COMPONENTS = 35659,
  409. TEXTURE_2D_ARRAY = 35866,
  410. TEXTURE_BINDING_2D_ARRAY = 35869,
  411. R11F_G11F_B10F = 35898,
  412. UNSIGNED_INT_10F_11F_11F_REV = 35899,
  413. RGB9_E5 = 35901,
  414. UNSIGNED_INT_5_9_9_9_REV = 35902,
  415. TRANSFORM_FEEDBACK_BUFFER_MODE = 35967,
  416. MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968,
  417. TRANSFORM_FEEDBACK_VARYINGS = 35971,
  418. TRANSFORM_FEEDBACK_BUFFER_START = 35972,
  419. TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973,
  420. TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976,
  421. RASTERIZER_DISCARD = 35977,
  422. MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978,
  423. MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979,
  424. INTERLEAVED_ATTRIBS = 35980,
  425. SEPARATE_ATTRIBS = 35981,
  426. TRANSFORM_FEEDBACK_BUFFER = 35982,
  427. TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983,
  428. RGBA32UI = 36208,
  429. RGB32UI = 36209,
  430. RGBA16UI = 36214,
  431. RGB16UI = 36215,
  432. RGBA8UI = 36220,
  433. RGB8UI = 36221,
  434. RGBA32I = 36226,
  435. RGB32I = 36227,
  436. RGBA16I = 36232,
  437. RGB16I = 36233,
  438. RGBA8I = 36238,
  439. RGB8I = 36239,
  440. RED_INTEGER = 36244,
  441. RGB_INTEGER = 36248,
  442. RGBA_INTEGER = 36249,
  443. SAMPLER_2D_ARRAY = 36289,
  444. SAMPLER_2D_ARRAY_SHADOW = 36292,
  445. SAMPLER_CUBE_SHADOW = 36293,
  446. UNSIGNED_INT_VEC2 = 36294,
  447. UNSIGNED_INT_VEC3 = 36295,
  448. UNSIGNED_INT_VEC4 = 36296,
  449. INT_SAMPLER_2D = 36298,
  450. INT_SAMPLER_3D = 36299,
  451. INT_SAMPLER_CUBE = 36300,
  452. INT_SAMPLER_2D_ARRAY = 36303,
  453. UNSIGNED_INT_SAMPLER_2D = 36306,
  454. UNSIGNED_INT_SAMPLER_3D = 36307,
  455. UNSIGNED_INT_SAMPLER_CUBE = 36308,
  456. UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311,
  457. DEPTH_COMPONENT32F = 36012,
  458. DEPTH32F_STENCIL8 = 36013,
  459. FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,
  460. FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296,
  461. FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297,
  462. FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298,
  463. FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299,
  464. FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300,
  465. FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301,
  466. FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302,
  467. FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303,
  468. FRAMEBUFFER_DEFAULT = 33304,
  469. UNSIGNED_INT_24_8 = 34042,
  470. DEPTH24_STENCIL8 = 35056,
  471. UNSIGNED_NORMALIZED = 35863,
  472. DRAW_FRAMEBUFFER_BINDING = 36006,
  473. READ_FRAMEBUFFER = 36008,
  474. DRAW_FRAMEBUFFER = 36009,
  475. READ_FRAMEBUFFER_BINDING = 36010,
  476. RENDERBUFFER_SAMPLES = 36011,
  477. FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052,
  478. MAX_COLOR_ATTACHMENTS = 36063,
  479. COLOR_ATTACHMENT1 = 36065,
  480. COLOR_ATTACHMENT2 = 36066,
  481. COLOR_ATTACHMENT3 = 36067,
  482. COLOR_ATTACHMENT4 = 36068,
  483. COLOR_ATTACHMENT5 = 36069,
  484. COLOR_ATTACHMENT6 = 36070,
  485. COLOR_ATTACHMENT7 = 36071,
  486. COLOR_ATTACHMENT8 = 36072,
  487. COLOR_ATTACHMENT9 = 36073,
  488. COLOR_ATTACHMENT10 = 36074,
  489. COLOR_ATTACHMENT11 = 36075,
  490. COLOR_ATTACHMENT12 = 36076,
  491. COLOR_ATTACHMENT13 = 36077,
  492. COLOR_ATTACHMENT14 = 36078,
  493. COLOR_ATTACHMENT15 = 36079,
  494. FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182,
  495. MAX_SAMPLES = 36183,
  496. HALF_FLOAT = 5131,
  497. RG = 33319,
  498. RG_INTEGER = 33320,
  499. R8 = 33321,
  500. RG8 = 33323,
  501. R16F = 33325,
  502. R32F = 33326,
  503. RG16F = 33327,
  504. RG32F = 33328,
  505. R8I = 33329,
  506. R8UI = 33330,
  507. R16I = 33331,
  508. R16UI = 33332,
  509. R32I = 33333,
  510. R32UI = 33334,
  511. RG8I = 33335,
  512. RG8UI = 33336,
  513. RG16I = 33337,
  514. RG16UI = 33338,
  515. RG32I = 33339,
  516. RG32UI = 33340,
  517. VERTEX_ARRAY_BINDING = 34229,
  518. R8_SNORM = 36756,
  519. RG8_SNORM = 36757,
  520. RGB8_SNORM = 36758,
  521. RGBA8_SNORM = 36759,
  522. SIGNED_NORMALIZED = 36764,
  523. COPY_READ_BUFFER = 36662,
  524. COPY_WRITE_BUFFER = 36663,
  525. COPY_READ_BUFFER_BINDING = 36662,
  526. COPY_WRITE_BUFFER_BINDING = 36663,
  527. UNIFORM_BUFFER = 35345,
  528. UNIFORM_BUFFER_BINDING = 35368,
  529. UNIFORM_BUFFER_START = 35369,
  530. UNIFORM_BUFFER_SIZE = 35370,
  531. MAX_VERTEX_UNIFORM_BLOCKS = 35371,
  532. MAX_FRAGMENT_UNIFORM_BLOCKS = 35373,
  533. MAX_COMBINED_UNIFORM_BLOCKS = 35374,
  534. MAX_UNIFORM_BUFFER_BINDINGS = 35375,
  535. MAX_UNIFORM_BLOCK_SIZE = 35376,
  536. MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377,
  537. MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379,
  538. UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380,
  539. ACTIVE_UNIFORM_BLOCKS = 35382,
  540. UNIFORM_TYPE = 35383,
  541. UNIFORM_SIZE = 35384,
  542. UNIFORM_BLOCK_INDEX = 35386,
  543. UNIFORM_OFFSET = 35387,
  544. UNIFORM_ARRAY_STRIDE = 35388,
  545. UNIFORM_MATRIX_STRIDE = 35389,
  546. UNIFORM_IS_ROW_MAJOR = 35390,
  547. UNIFORM_BLOCK_BINDING = 35391,
  548. UNIFORM_BLOCK_DATA_SIZE = 35392,
  549. UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394,
  550. UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395,
  551. UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396,
  552. UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398,
  553. INVALID_INDEX = 4294967295,
  554. MAX_VERTEX_OUTPUT_COMPONENTS = 37154,
  555. MAX_FRAGMENT_INPUT_COMPONENTS = 37157,
  556. MAX_SERVER_WAIT_TIMEOUT = 37137,
  557. OBJECT_TYPE = 37138,
  558. SYNC_CONDITION = 37139,
  559. SYNC_STATUS = 37140,
  560. SYNC_FLAGS = 37141,
  561. SYNC_FENCE = 37142,
  562. SYNC_GPU_COMMANDS_COMPLETE = 37143,
  563. UNSIGNALED = 37144,
  564. SIGNALED = 37145,
  565. ALREADY_SIGNALED = 37146,
  566. TIMEOUT_EXPIRED = 37147,
  567. CONDITION_SATISFIED = 37148,
  568. WAIT_FAILED = 37149,
  569. SYNC_FLUSH_COMMANDS_BIT = 1,
  570. VERTEX_ATTRIB_ARRAY_DIVISOR = 35070,
  571. ANY_SAMPLES_PASSED = 35887,
  572. ANY_SAMPLES_PASSED_CONSERVATIVE = 36202,
  573. SAMPLER_BINDING = 35097,
  574. RGB10_A2UI = 36975,
  575. INT_2_10_10_10_REV = 36255,
  576. TRANSFORM_FEEDBACK = 36386,
  577. TRANSFORM_FEEDBACK_PAUSED = 36387,
  578. TRANSFORM_FEEDBACK_ACTIVE = 36388,
  579. TRANSFORM_FEEDBACK_BINDING = 36389,
  580. COMPRESSED_R11_EAC = 37488,
  581. COMPRESSED_SIGNED_R11_EAC = 37489,
  582. COMPRESSED_RG11_EAC = 37490,
  583. COMPRESSED_SIGNED_RG11_EAC = 37491,
  584. COMPRESSED_RGB8_ETC2 = 37492,
  585. COMPRESSED_SRGB8_ETC2 = 37493,
  586. COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494,
  587. COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495,
  588. COMPRESSED_RGBA8_ETC2_EAC = 37496,
  589. COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497,
  590. TEXTURE_IMMUTABLE_FORMAT = 37167,
  591. MAX_ELEMENT_INDEX = 36203,
  592. TEXTURE_IMMUTABLE_LEVELS = 33503,
  593. MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047
  594. }
  595. /**
  596. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  597. * retrieved from Elevation Tiles of an an ArcGIS ImageService.
  598. * @example
  599. * const terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
  600. * url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
  601. * token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..'
  602. * });
  603. * viewer.terrainProvider = terrainProvider;
  604. *
  605. *
  606. * @param options - Object with the following properties:
  607. * @param options.url - The URL of the ArcGIS ImageServer service.
  608. * @param [options.token] - The authorization token to use to connect to the service.
  609. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  610. * this parameter is ignored and the tiling scheme's ellipsoid is used instead.
  611. * If neither parameter is specified, the WGS84 ellipsoid is used.
  612. */
  613. export class ArcGISTiledElevationTerrainProvider {
  614. constructor(options: {
  615. url: Resource | string | Promise<Resource> | Promise<string>;
  616. token?: string;
  617. ellipsoid?: Ellipsoid;
  618. });
  619. /**
  620. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  621. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  622. * are passed an instance of {@link TileProviderError}.
  623. */
  624. readonly errorEvent: Event;
  625. /**
  626. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  627. * the source of the terrain. This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  628. */
  629. readonly credit: Credit;
  630. /**
  631. * Gets the tiling scheme used by this provider. This function should
  632. * not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  633. */
  634. readonly tilingScheme: GeographicTilingScheme;
  635. /**
  636. * Gets a value indicating whether or not the provider is ready for use.
  637. */
  638. readonly ready: boolean;
  639. /**
  640. * Gets a promise that resolves to true when the provider is ready for use.
  641. */
  642. readonly readyPromise: Promise<boolean>;
  643. /**
  644. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  645. * indicates which areas of the globe are water rather than land, so they can be rendered
  646. * as a reflective surface with animated waves. This function should not be
  647. * called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  648. */
  649. readonly hasWaterMask: boolean;
  650. /**
  651. * Gets a value indicating whether or not the requested tiles include vertex normals.
  652. * This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
  653. */
  654. readonly hasVertexNormals: boolean;
  655. /**
  656. * Gets an object that can be used to determine availability of terrain from this provider, such as
  657. * at points and in rectangles. This function should not be called before
  658. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  659. * information is not available.
  660. */
  661. readonly availability: TileAvailability;
  662. /**
  663. * Requests the geometry for a given tile. This function should not be called before
  664. * {@link ArcGISTiledElevationTerrainProvider#ready} returns true. The result includes terrain
  665. * data and indicates that all child tiles are available.
  666. * @param x - The X coordinate of the tile for which to request geometry.
  667. * @param y - The Y coordinate of the tile for which to request geometry.
  668. * @param level - The level of the tile for which to request geometry.
  669. * @param [request] - The request object. Intended for internal use only.
  670. * @returns A promise for the requested geometry. If this method
  671. * returns undefined instead of a promise, it is an indication that too many requests are already
  672. * pending and the request will be retried later.
  673. */
  674. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  675. /**
  676. * Gets the maximum geometric error allowed in a tile at a given level.
  677. * @param level - The tile level for which to get the maximum geometric error.
  678. * @returns The maximum geometric error.
  679. */
  680. getLevelMaximumGeometricError(level: number): number;
  681. /**
  682. * Determines whether data for a tile is available to be loaded.
  683. * @param x - The X coordinate of the tile for which to request geometry.
  684. * @param y - The Y coordinate of the tile for which to request geometry.
  685. * @param level - The level of the tile for which to request geometry.
  686. * @returns Undefined if not supported, otherwise true or false.
  687. */
  688. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  689. /**
  690. * Makes sure we load availability data for a tile
  691. * @param x - The X coordinate of the tile for which to request geometry.
  692. * @param y - The Y coordinate of the tile for which to request geometry.
  693. * @param level - The level of the tile for which to request geometry.
  694. * @returns This provider does not support loading availability.
  695. */
  696. loadTileDataAvailability(x: number, y: number, level: number): undefined;
  697. }
  698. /**
  699. * ArcType defines the path that should be taken connecting vertices.
  700. */
  701. export enum ArcType {
  702. /**
  703. * Straight line that does not conform to the surface of the ellipsoid.
  704. */
  705. NONE = 0,
  706. /**
  707. * Follow geodesic path.
  708. */
  709. GEODESIC = 1,
  710. /**
  711. * Follow rhumb or loxodrome path.
  712. */
  713. RHUMB = 2
  714. }
  715. /**
  716. * A collection of key-value pairs that is stored as a hash for easy
  717. * lookup but also provides an array for fast iteration.
  718. */
  719. export class AssociativeArray {
  720. constructor();
  721. /**
  722. * Gets the number of items in the collection.
  723. */
  724. length: number;
  725. /**
  726. * Gets an unordered array of all values in the collection.
  727. * This is a live array that will automatically reflect the values in the collection,
  728. * it should not be modified directly.
  729. */
  730. values: any[];
  731. /**
  732. * Determines if the provided key is in the array.
  733. * @param key - The key to check.
  734. * @returns <code>true</code> if the key is in the array, <code>false</code> otherwise.
  735. */
  736. contains(key: string | number): boolean;
  737. /**
  738. * Associates the provided key with the provided value. If the key already
  739. * exists, it is overwritten with the new value.
  740. * @param key - A unique identifier.
  741. * @param value - The value to associate with the provided key.
  742. */
  743. set(key: string | number, value: any): void;
  744. /**
  745. * Retrieves the value associated with the provided key.
  746. * @param key - The key whose value is to be retrieved.
  747. * @returns The associated value, or undefined if the key does not exist in the collection.
  748. */
  749. get(key: string | number): any;
  750. /**
  751. * Removes a key-value pair from the collection.
  752. * @param key - The key to be removed.
  753. * @returns True if it was removed, false if the key was not in the collection.
  754. */
  755. remove(key: string | number): boolean;
  756. /**
  757. * Clears the collection.
  758. */
  759. removeAll(): void;
  760. }
  761. /**
  762. * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
  763. * @param [minimum = Cartesian3.ZERO] - The minimum point along the x, y, and z axes.
  764. * @param [maximum = Cartesian3.ZERO] - The maximum point along the x, y, and z axes.
  765. * @param [center] - The center of the box; automatically computed if not supplied.
  766. */
  767. export class AxisAlignedBoundingBox {
  768. constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3);
  769. /**
  770. * The minimum point defining the bounding box.
  771. */
  772. minimum: Cartesian3;
  773. /**
  774. * The maximum point defining the bounding box.
  775. */
  776. maximum: Cartesian3;
  777. /**
  778. * The center point of the bounding box.
  779. */
  780. center: Cartesian3;
  781. /**
  782. * Creates an instance of an AxisAlignedBoundingBox from its corners.
  783. * @example
  784. * // Compute an axis aligned bounding box from the two corners.
  785. * const box = Cesium.AxisAlignedBoundingBox.fromCorners(new Cesium.Cartesian3(-1, -1, -1), new Cesium.Cartesian3(1, 1, 1));
  786. * @param minimum - The minimum point along the x, y, and z axes.
  787. * @param maximum - The maximum point along the x, y, and z axes.
  788. * @param [result] - The object onto which to store the result.
  789. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  790. */
  791. static fromCorners(minimum: Cartesian3, maximum: Cartesian3, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  792. /**
  793. * Computes an instance of an AxisAlignedBoundingBox. The box is determined by
  794. * finding the points spaced the farthest apart on the x, y, and z axes.
  795. * @example
  796. * // Compute an axis aligned bounding box enclosing two points.
  797. * const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  798. * @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.
  799. * @param [result] - The object onto which to store the result.
  800. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  801. */
  802. static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  803. /**
  804. * Duplicates a AxisAlignedBoundingBox instance.
  805. * @param box - The bounding box to duplicate.
  806. * @param [result] - The object onto which to store the result.
  807. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  808. */
  809. static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  810. /**
  811. * Compares the provided AxisAlignedBoundingBox componentwise and returns
  812. * <code>true</code> if they are equal, <code>false</code> otherwise.
  813. * @param [left] - The first AxisAlignedBoundingBox.
  814. * @param [right] - The second AxisAlignedBoundingBox.
  815. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  816. */
  817. static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean;
  818. /**
  819. * Determines which side of a plane a box is located.
  820. * @param box - The bounding box to test.
  821. * @param plane - The plane to test against.
  822. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  823. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  824. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  825. * intersects the plane.
  826. */
  827. static intersectPlane(box: AxisAlignedBoundingBox, plane: Plane): Intersect;
  828. /**
  829. * Duplicates this AxisAlignedBoundingBox instance.
  830. * @param [result] - The object onto which to store the result.
  831. * @returns The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
  832. */
  833. clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox;
  834. /**
  835. * Determines which side of a plane this box is located.
  836. * @param plane - The plane to test against.
  837. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  838. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  839. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  840. * intersects the plane.
  841. */
  842. intersectPlane(plane: Plane): Intersect;
  843. /**
  844. * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
  845. * <code>true</code> if they are equal, <code>false</code> otherwise.
  846. * @param [right] - The right hand side AxisAlignedBoundingBox.
  847. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  848. */
  849. equals(right?: AxisAlignedBoundingBox): boolean;
  850. }
  851. /**
  852. * Provides geocoding through Bing Maps.
  853. * @param options - Object with the following properties:
  854. * @param options.key - A key to use with the Bing Maps geocoding service
  855. * @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.
  856. */
  857. export class BingMapsGeocoderService {
  858. constructor(options: {
  859. key: string;
  860. culture?: string;
  861. });
  862. /**
  863. * The URL endpoint for the Bing geocoder service
  864. */
  865. readonly url: string;
  866. /**
  867. * The key for the Bing geocoder service
  868. */
  869. readonly key: string;
  870. /**
  871. * @param query - The query to be sent to the geocoder service
  872. */
  873. geocode(query: string): Promise<GeocoderService.Result[]>;
  874. }
  875. /**
  876. * A bounding rectangle given by a corner, width and height.
  877. * @param [x = 0.0] - The x coordinate of the rectangle.
  878. * @param [y = 0.0] - The y coordinate of the rectangle.
  879. * @param [width = 0.0] - The width of the rectangle.
  880. * @param [height = 0.0] - The height of the rectangle.
  881. */
  882. export class BoundingRectangle {
  883. constructor(x?: number, y?: number, width?: number, height?: number);
  884. /**
  885. * The x coordinate of the rectangle.
  886. */
  887. x: number;
  888. /**
  889. * The y coordinate of the rectangle.
  890. */
  891. y: number;
  892. /**
  893. * The width of the rectangle.
  894. */
  895. width: number;
  896. /**
  897. * The height of the rectangle.
  898. */
  899. height: number;
  900. /**
  901. * The number of elements used to pack the object into an array.
  902. */
  903. static packedLength: number;
  904. /**
  905. * Stores the provided instance into the provided array.
  906. * @param value - The value to pack.
  907. * @param array - The array to pack into.
  908. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  909. * @returns The array that was packed into
  910. */
  911. static pack(value: BoundingRectangle, array: number[], startingIndex?: number): number[];
  912. /**
  913. * Retrieves an instance from a packed array.
  914. * @param array - The packed array.
  915. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  916. * @param [result] - The object into which to store the result.
  917. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  918. */
  919. static unpack(array: number[], startingIndex?: number, result?: BoundingRectangle): BoundingRectangle;
  920. /**
  921. * Computes a bounding rectangle enclosing the list of 2D points.
  922. * The rectangle is oriented with the corner at the bottom left.
  923. * @param positions - List of points that the bounding rectangle will enclose. Each point must have <code>x</code> and <code>y</code> properties.
  924. * @param [result] - The object onto which to store the result.
  925. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  926. */
  927. static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle;
  928. /**
  929. * Computes a bounding rectangle from a rectangle.
  930. * @param rectangle - The valid rectangle used to create a bounding rectangle.
  931. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  932. * @param [result] - The object onto which to store the result.
  933. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  934. */
  935. static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle;
  936. /**
  937. * Duplicates a BoundingRectangle instance.
  938. * @param rectangle - The bounding rectangle to duplicate.
  939. * @param [result] - The object onto which to store the result.
  940. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
  941. */
  942. static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  943. /**
  944. * Computes a bounding rectangle that is the union of the left and right bounding rectangles.
  945. * @param left - A rectangle to enclose in bounding rectangle.
  946. * @param right - A rectangle to enclose in a bounding rectangle.
  947. * @param [result] - The object onto which to store the result.
  948. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  949. */
  950. static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle;
  951. /**
  952. * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
  953. * @param rectangle - A rectangle to expand.
  954. * @param point - A point to enclose in a bounding rectangle.
  955. * @param [result] - The object onto which to store the result.
  956. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  957. */
  958. static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle;
  959. /**
  960. * Determines if two rectangles intersect.
  961. * @param left - A rectangle to check for intersection.
  962. * @param right - The other rectangle to check for intersection.
  963. * @returns <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  964. */
  965. static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect;
  966. /**
  967. * Compares the provided BoundingRectangles componentwise and returns
  968. * <code>true</code> if they are equal, <code>false</code> otherwise.
  969. * @param [left] - The first BoundingRectangle.
  970. * @param [right] - The second BoundingRectangle.
  971. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  972. */
  973. static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean;
  974. /**
  975. * Duplicates this BoundingRectangle instance.
  976. * @param [result] - The object onto which to store the result.
  977. * @returns The modified result parameter or a new BoundingRectangle instance if one was not provided.
  978. */
  979. clone(result?: BoundingRectangle): BoundingRectangle;
  980. /**
  981. * Determines if this rectangle intersects with another.
  982. * @param right - A rectangle to check for intersection.
  983. * @returns <code>Intersect.INTERSECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
  984. */
  985. intersect(right: BoundingRectangle): Intersect;
  986. /**
  987. * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
  988. * <code>true</code> if they are equal, <code>false</code> otherwise.
  989. * @param [right] - The right hand side BoundingRectangle.
  990. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  991. */
  992. equals(right?: BoundingRectangle): boolean;
  993. }
  994. /**
  995. * A bounding sphere with a center and a radius.
  996. * @param [center = Cartesian3.ZERO] - The center of the bounding sphere.
  997. * @param [radius = 0.0] - The radius of the bounding sphere.
  998. */
  999. export class BoundingSphere {
  1000. constructor(center?: Cartesian3, radius?: number);
  1001. /**
  1002. * The center point of the sphere.
  1003. */
  1004. center: Cartesian3;
  1005. /**
  1006. * The radius of the sphere.
  1007. */
  1008. radius: number;
  1009. /**
  1010. * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.
  1011. * The bounding sphere is computed by running two algorithms, a naive algorithm and
  1012. * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.
  1013. * @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.
  1014. * @param [result] - The object onto which to store the result.
  1015. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1016. */
  1017. static fromPoints(positions?: Cartesian3[], result?: BoundingSphere): BoundingSphere;
  1018. /**
  1019. * Computes a bounding sphere from a rectangle projected in 2D.
  1020. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1021. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  1022. * @param [result] - The object onto which to store the result.
  1023. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1024. */
  1025. static fromRectangle2D(rectangle?: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere;
  1026. /**
  1027. * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the
  1028. * object's minimum and maximum heights over the rectangle.
  1029. * @param [rectangle] - The rectangle around which to create a bounding sphere.
  1030. * @param [projection = GeographicProjection] - The projection used to project the rectangle into 2D.
  1031. * @param [minimumHeight = 0.0] - The minimum height over the rectangle.
  1032. * @param [maximumHeight = 0.0] - The maximum height over the rectangle.
  1033. * @param [result] - The object onto which to store the result.
  1034. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1035. */
  1036. static fromRectangleWithHeights2D(rectangle?: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere;
  1037. /**
  1038. * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points
  1039. * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
  1040. * @param [rectangle] - The valid rectangle used to create a bounding sphere.
  1041. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  1042. * @param [surfaceHeight = 0.0] - The height above the surface of the ellipsoid.
  1043. * @param [result] - The object onto which to store the result.
  1044. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1045. */
  1046. static fromRectangle3D(rectangle?: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere;
  1047. /**
  1048. * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
  1049. * stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two
  1050. * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1051. * ensure a tight fit.
  1052. * @example
  1053. * // Compute the bounding sphere from 3 positions, each specified relative to a center.
  1054. * // In addition to the X, Y, and Z coordinates, the points array contains two additional
  1055. * // elements per point which are ignored for the purpose of computing the bounding sphere.
  1056. * const center = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  1057. * const points = [1.0, 2.0, 3.0, 0.1, 0.2,
  1058. * 4.0, 5.0, 6.0, 0.1, 0.2,
  1059. * 7.0, 8.0, 9.0, 0.1, 0.2];
  1060. * const sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);
  1061. * @param [positions] - An array of points that the bounding sphere will enclose. Each point
  1062. * is formed from three elements in the array in the order X, Y, Z.
  1063. * @param [center = Cartesian3.ZERO] - The position to which the positions are relative, which need not be the
  1064. * origin of the coordinate system. This is useful when the positions are to be used for
  1065. * relative-to-center (RTC) rendering.
  1066. * @param [stride = 3] - The number of array elements per vertex. It must be at least 3, but it may
  1067. * be higher. Regardless of the value of this parameter, the X coordinate of the first position
  1068. * is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index
  1069. * 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If
  1070. * the stride is 5, however, two array elements are skipped and the next position begins at array
  1071. * index 5.
  1072. * @param [result] - The object onto which to store the result.
  1073. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1074. */
  1075. static fromVertices(positions?: number[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere;
  1076. /**
  1077. * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are
  1078. * stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two
  1079. * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
  1080. * ensure a tight fit.
  1081. * @param [positionsHigh] - An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1082. * is formed from three elements in the array in the order X, Y, Z.
  1083. * @param [positionsLow] - An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point
  1084. * is formed from three elements in the array in the order X, Y, Z.
  1085. * @param [result] - The object onto which to store the result.
  1086. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1087. */
  1088. static fromEncodedCartesianVertices(positionsHigh?: number[], positionsLow?: number[], result?: BoundingSphere): BoundingSphere;
  1089. /**
  1090. * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
  1091. * tightly and fully encompasses the box.
  1092. * @example
  1093. * // Create a bounding sphere around the unit cube
  1094. * const sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));
  1095. * @param [corner] - The minimum height over the rectangle.
  1096. * @param [oppositeCorner] - The maximum height over the rectangle.
  1097. * @param [result] - The object onto which to store the result.
  1098. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1099. */
  1100. static fromCornerPoints(corner?: Cartesian3, oppositeCorner?: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1101. /**
  1102. * Creates a bounding sphere encompassing an ellipsoid.
  1103. * @example
  1104. * const boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
  1105. * @param ellipsoid - The ellipsoid around which to create a bounding sphere.
  1106. * @param [result] - The object onto which to store the result.
  1107. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1108. */
  1109. static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere;
  1110. /**
  1111. * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.
  1112. * @param [boundingSpheres] - The array of bounding spheres.
  1113. * @param [result] - The object onto which to store the result.
  1114. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1115. */
  1116. static fromBoundingSpheres(boundingSpheres?: BoundingSphere[], result?: BoundingSphere): BoundingSphere;
  1117. /**
  1118. * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.
  1119. * @param orientedBoundingBox - The oriented bounding box.
  1120. * @param [result] - The object onto which to store the result.
  1121. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1122. */
  1123. static fromOrientedBoundingBox(orientedBoundingBox: OrientedBoundingBox, result?: BoundingSphere): BoundingSphere;
  1124. /**
  1125. * Computes a tight-fitting bounding sphere enclosing the provided affine transformation.
  1126. * @param transformation - The affine transformation.
  1127. * @param [result] - The object onto which to store the result.
  1128. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1129. */
  1130. static fromTransformation(transformation: Matrix4, result?: BoundingSphere): BoundingSphere;
  1131. /**
  1132. * Duplicates a BoundingSphere instance.
  1133. * @param sphere - The bounding sphere to duplicate.
  1134. * @param [result] - The object onto which to store the result.
  1135. * @returns The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)
  1136. */
  1137. static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1138. /**
  1139. * The number of elements used to pack the object into an array.
  1140. */
  1141. static packedLength: number;
  1142. /**
  1143. * Stores the provided instance into the provided array.
  1144. * @param value - The value to pack.
  1145. * @param array - The array to pack into.
  1146. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1147. * @returns The array that was packed into
  1148. */
  1149. static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[];
  1150. /**
  1151. * Retrieves an instance from a packed array.
  1152. * @param array - The packed array.
  1153. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1154. * @param [result] - The object into which to store the result.
  1155. * @returns The modified result parameter or a new BoundingSphere instance if one was not provided.
  1156. */
  1157. static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere;
  1158. /**
  1159. * Computes a bounding sphere that contains both the left and right bounding spheres.
  1160. * @param left - A sphere to enclose in a bounding sphere.
  1161. * @param right - A sphere to enclose in a bounding sphere.
  1162. * @param [result] - The object onto which to store the result.
  1163. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1164. */
  1165. static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere;
  1166. /**
  1167. * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.
  1168. * @param sphere - A sphere to expand.
  1169. * @param point - A point to enclose in a bounding sphere.
  1170. * @param [result] - The object onto which to store the result.
  1171. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1172. */
  1173. static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere;
  1174. /**
  1175. * Determines which side of a plane a sphere is located.
  1176. * @param sphere - The bounding sphere to test.
  1177. * @param plane - The plane to test against.
  1178. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1179. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1180. * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1181. * intersects the plane.
  1182. */
  1183. static intersectPlane(sphere: BoundingSphere, plane: Plane): Intersect;
  1184. /**
  1185. * Applies a 4x4 affine transformation matrix to a bounding sphere.
  1186. * @param sphere - The bounding sphere to apply the transformation to.
  1187. * @param transform - The transformation matrix to apply to the bounding sphere.
  1188. * @param [result] - The object onto which to store the result.
  1189. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1190. */
  1191. static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1192. /**
  1193. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1194. * @example
  1195. * // Sort bounding spheres from back to front
  1196. * spheres.sort(function(a, b) {
  1197. * return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);
  1198. * });
  1199. * @param sphere - The sphere.
  1200. * @param cartesian - The point
  1201. * @returns The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.
  1202. */
  1203. static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number;
  1204. /**
  1205. * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale
  1206. * The transformation matrix is not verified to have a uniform scale of 1.
  1207. * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.
  1208. * @example
  1209. * const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);
  1210. * const boundingSphere = new Cesium.BoundingSphere();
  1211. * const newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);
  1212. * @param sphere - The bounding sphere to apply the transformation to.
  1213. * @param transform - The transformation matrix to apply to the bounding sphere.
  1214. * @param [result] - The object onto which to store the result.
  1215. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1216. */
  1217. static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere;
  1218. /**
  1219. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1220. * plus/minus the radius of the bounding sphere.
  1221. * <br>
  1222. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1223. * closest and farthest planes from position that intersect the bounding sphere.
  1224. * @param sphere - The bounding sphere to calculate the distance to.
  1225. * @param position - The position to calculate the distance from.
  1226. * @param direction - The direction from position.
  1227. * @param [result] - A Interval to store the nearest and farthest distances.
  1228. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1229. */
  1230. static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1231. /**
  1232. * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.
  1233. * @param sphere - The bounding sphere to transform to 2D.
  1234. * @param [projection = GeographicProjection] - The projection to 2D.
  1235. * @param [result] - The object onto which to store the result.
  1236. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1237. */
  1238. static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere;
  1239. /**
  1240. * Determines whether or not a sphere is hidden from view by the occluder.
  1241. * @param sphere - The bounding sphere surrounding the occludee object.
  1242. * @param occluder - The occluder.
  1243. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1244. */
  1245. static isOccluded(sphere: BoundingSphere, occluder: Occluder): boolean;
  1246. /**
  1247. * Compares the provided BoundingSphere componentwise and returns
  1248. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1249. * @param [left] - The first BoundingSphere.
  1250. * @param [right] - The second BoundingSphere.
  1251. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1252. */
  1253. static equals(left?: BoundingSphere, right?: BoundingSphere): boolean;
  1254. /**
  1255. * Determines which side of a plane the sphere is located.
  1256. * @param plane - The plane to test against.
  1257. * @returns {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
  1258. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
  1259. * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
  1260. * intersects the plane.
  1261. */
  1262. intersectPlane(plane: Plane): Intersect;
  1263. /**
  1264. * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
  1265. * @example
  1266. * // Sort bounding spheres from back to front
  1267. * spheres.sort(function(a, b) {
  1268. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  1269. * });
  1270. * @param cartesian - The point
  1271. * @returns The estimated distance squared from the bounding sphere to the point.
  1272. */
  1273. distanceSquaredTo(cartesian: Cartesian3): number;
  1274. /**
  1275. * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
  1276. * plus/minus the radius of the bounding sphere.
  1277. * <br>
  1278. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  1279. * closest and farthest planes from position that intersect the bounding sphere.
  1280. * @param position - The position to calculate the distance from.
  1281. * @param direction - The direction from position.
  1282. * @param [result] - A Interval to store the nearest and farthest distances.
  1283. * @returns The nearest and farthest distances on the bounding sphere from position in direction.
  1284. */
  1285. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  1286. /**
  1287. * Determines whether or not a sphere is hidden from view by the occluder.
  1288. * @param occluder - The occluder.
  1289. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  1290. */
  1291. isOccluded(occluder: Occluder): boolean;
  1292. /**
  1293. * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns
  1294. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1295. * @param [right] - The right hand side BoundingSphere.
  1296. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1297. */
  1298. equals(right?: BoundingSphere): boolean;
  1299. /**
  1300. * Duplicates this BoundingSphere instance.
  1301. * @param [result] - The object onto which to store the result.
  1302. * @returns The modified result parameter or a new BoundingSphere instance if none was provided.
  1303. */
  1304. clone(result?: BoundingSphere): BoundingSphere;
  1305. /**
  1306. * Computes the radius of the BoundingSphere.
  1307. * @returns The radius of the BoundingSphere.
  1308. */
  1309. volume(): number;
  1310. }
  1311. /**
  1312. * Describes a cube centered at the origin.
  1313. * @example
  1314. * const box = new Cesium.BoxGeometry({
  1315. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1316. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1317. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1318. * });
  1319. * const geometry = Cesium.BoxGeometry.createGeometry(box);
  1320. * @param options - Object with the following properties:
  1321. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1322. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1323. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1324. */
  1325. export class BoxGeometry {
  1326. constructor(options: {
  1327. minimum: Cartesian3;
  1328. maximum: Cartesian3;
  1329. vertexFormat?: VertexFormat;
  1330. });
  1331. /**
  1332. * Creates a cube centered at the origin given its dimensions.
  1333. * @example
  1334. * const box = Cesium.BoxGeometry.fromDimensions({
  1335. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  1336. * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1337. * });
  1338. * const geometry = Cesium.BoxGeometry.createGeometry(box);
  1339. * @param options - Object with the following properties:
  1340. * @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.
  1341. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  1342. */
  1343. static fromDimensions(options: {
  1344. dimensions: Cartesian3;
  1345. vertexFormat?: VertexFormat;
  1346. }): BoxGeometry;
  1347. /**
  1348. * Creates a cube from the dimensions of an AxisAlignedBoundingBox.
  1349. * @example
  1350. * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1351. * -72.0, 40.0,
  1352. * -70.0, 35.0,
  1353. * -75.0, 30.0,
  1354. * -70.0, 30.0,
  1355. * -68.0, 40.0
  1356. * ]));
  1357. * const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
  1358. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1359. */
  1360. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxGeometry;
  1361. /**
  1362. * The number of elements used to pack the object into an array.
  1363. */
  1364. static packedLength: number;
  1365. /**
  1366. * Stores the provided instance into the provided array.
  1367. * @param value - The value to pack.
  1368. * @param array - The array to pack into.
  1369. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1370. * @returns The array that was packed into
  1371. */
  1372. static pack(value: BoxGeometry, array: number[], startingIndex?: number): number[];
  1373. /**
  1374. * Retrieves an instance from a packed array.
  1375. * @param array - The packed array.
  1376. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1377. * @param [result] - The object into which to store the result.
  1378. * @returns The modified result parameter or a new BoxGeometry instance if one was not provided.
  1379. */
  1380. static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry;
  1381. /**
  1382. * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
  1383. * @param boxGeometry - A description of the box.
  1384. * @returns The computed vertices and indices.
  1385. */
  1386. static createGeometry(boxGeometry: BoxGeometry): Geometry | undefined;
  1387. }
  1388. /**
  1389. * A description of the outline of a cube centered at the origin.
  1390. * @example
  1391. * const box = new Cesium.BoxOutlineGeometry({
  1392. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
  1393. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
  1394. * });
  1395. * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1396. * @param options - Object with the following properties:
  1397. * @param options.minimum - The minimum x, y, and z coordinates of the box.
  1398. * @param options.maximum - The maximum x, y, and z coordinates of the box.
  1399. */
  1400. export class BoxOutlineGeometry {
  1401. constructor(options: {
  1402. minimum: Cartesian3;
  1403. maximum: Cartesian3;
  1404. });
  1405. /**
  1406. * Creates an outline of a cube centered at the origin given its dimensions.
  1407. * @example
  1408. * const box = Cesium.BoxOutlineGeometry.fromDimensions({
  1409. * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
  1410. * });
  1411. * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
  1412. * @param options - Object with the following properties:
  1413. * @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.
  1414. */
  1415. static fromDimensions(options: {
  1416. dimensions: Cartesian3;
  1417. }): BoxOutlineGeometry;
  1418. /**
  1419. * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.
  1420. * @example
  1421. * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
  1422. * -72.0, 40.0,
  1423. * -70.0, 35.0,
  1424. * -75.0, 30.0,
  1425. * -70.0, 30.0,
  1426. * -68.0, 40.0
  1427. * ]));
  1428. * const box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);
  1429. *
  1430. *
  1431. * @param boundingBox - A description of the AxisAlignedBoundingBox.
  1432. */
  1433. static fromAxisAlignedBoundingBox(boundingBox: AxisAlignedBoundingBox): BoxOutlineGeometry;
  1434. /**
  1435. * The number of elements used to pack the object into an array.
  1436. */
  1437. static packedLength: number;
  1438. /**
  1439. * Stores the provided instance into the provided array.
  1440. * @param value - The value to pack.
  1441. * @param array - The array to pack into.
  1442. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1443. * @returns The array that was packed into
  1444. */
  1445. static pack(value: BoxOutlineGeometry, array: number[], startingIndex?: number): number[];
  1446. /**
  1447. * Retrieves an instance from a packed array.
  1448. * @param array - The packed array.
  1449. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1450. * @param [result] - The object into which to store the result.
  1451. * @returns The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.
  1452. */
  1453. static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry;
  1454. /**
  1455. * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.
  1456. * @param boxGeometry - A description of the box outline.
  1457. * @returns The computed vertices and indices.
  1458. */
  1459. static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry | undefined;
  1460. }
  1461. /**
  1462. * A 2D Cartesian point.
  1463. * @param [x = 0.0] - The X component.
  1464. * @param [y = 0.0] - The Y component.
  1465. */
  1466. export class Cartesian2 {
  1467. constructor(x?: number, y?: number);
  1468. /**
  1469. * The X component.
  1470. */
  1471. x: number;
  1472. /**
  1473. * The Y component.
  1474. */
  1475. y: number;
  1476. /**
  1477. * Creates a Cartesian2 instance from x and y coordinates.
  1478. * @param x - The x coordinate.
  1479. * @param y - The y coordinate.
  1480. * @param [result] - The object onto which to store the result.
  1481. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1482. */
  1483. static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2;
  1484. /**
  1485. * Duplicates a Cartesian2 instance.
  1486. * @param cartesian - The Cartesian to duplicate.
  1487. * @param [result] - The object onto which to store the result.
  1488. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1489. */
  1490. static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2;
  1491. /**
  1492. * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
  1493. * x and y properties of the Cartesian3 and drops z.
  1494. * @param cartesian - The Cartesian3 instance to create a Cartesian2 instance from.
  1495. * @param [result] - The object onto which to store the result.
  1496. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1497. */
  1498. static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  1499. /**
  1500. * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
  1501. * x and y properties of the Cartesian4 and drops z and w.
  1502. * @param cartesian - The Cartesian4 instance to create a Cartesian2 instance from.
  1503. * @param [result] - The object onto which to store the result.
  1504. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1505. */
  1506. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2;
  1507. /**
  1508. * The number of elements used to pack the object into an array.
  1509. */
  1510. static packedLength: number;
  1511. /**
  1512. * Stores the provided instance into the provided array.
  1513. * @param value - The value to pack.
  1514. * @param array - The array to pack into.
  1515. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1516. * @returns The array that was packed into
  1517. */
  1518. static pack(value: Cartesian2, array: number[], startingIndex?: number): number[];
  1519. /**
  1520. * Retrieves an instance from a packed array.
  1521. * @param array - The packed array.
  1522. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1523. * @param [result] - The object into which to store the result.
  1524. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1525. */
  1526. static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1527. /**
  1528. * Flattens an array of Cartesian2s into an array of components.
  1529. * @param array - The array of cartesians to pack.
  1530. * @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.
  1531. * @returns The packed array.
  1532. */
  1533. static packArray(array: Cartesian2[], result?: number[]): number[];
  1534. /**
  1535. * Unpacks an array of cartesian components into an array of Cartesian2s.
  1536. * @param array - The array of components to unpack.
  1537. * @param [result] - The array onto which to store the result.
  1538. * @returns The unpacked array.
  1539. */
  1540. static unpackArray(array: number[], result?: Cartesian2[]): Cartesian2[];
  1541. /**
  1542. * Creates a Cartesian2 from two consecutive elements in an array.
  1543. * @example
  1544. * // Create a Cartesian2 with (1.0, 2.0)
  1545. * const v = [1.0, 2.0];
  1546. * const p = Cesium.Cartesian2.fromArray(v);
  1547. *
  1548. * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
  1549. * const v2 = [0.0, 0.0, 1.0, 2.0];
  1550. * const p2 = Cesium.Cartesian2.fromArray(v2, 2);
  1551. * @param array - The array whose two consecutive elements correspond to the x and y components, respectively.
  1552. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1553. * @param [result] - The object onto which to store the result.
  1554. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1555. */
  1556. static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2;
  1557. /**
  1558. * Computes the value of the maximum component for the supplied Cartesian.
  1559. * @param cartesian - The cartesian to use.
  1560. * @returns The value of the maximum component.
  1561. */
  1562. static maximumComponent(cartesian: Cartesian2): number;
  1563. /**
  1564. * Computes the value of the minimum component for the supplied Cartesian.
  1565. * @param cartesian - The cartesian to use.
  1566. * @returns The value of the minimum component.
  1567. */
  1568. static minimumComponent(cartesian: Cartesian2): number;
  1569. /**
  1570. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1571. * @param first - A cartesian to compare.
  1572. * @param second - A cartesian to compare.
  1573. * @param result - The object into which to store the result.
  1574. * @returns A cartesian with the minimum components.
  1575. */
  1576. static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1577. /**
  1578. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1579. * @param first - A cartesian to compare.
  1580. * @param second - A cartesian to compare.
  1581. * @param result - The object into which to store the result.
  1582. * @returns A cartesian with the maximum components.
  1583. */
  1584. static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2;
  1585. /**
  1586. * Constrain a value to lie between two values.
  1587. * @param value - The value to clamp.
  1588. * @param min - The minimum bound.
  1589. * @param max - The maximum bound.
  1590. * @param result - The object into which to store the result.
  1591. * @returns The clamped value such that min <= result <= max.
  1592. */
  1593. static clamp(value: Cartesian2, min: Cartesian2, max: Cartesian2, result: Cartesian2): Cartesian2;
  1594. /**
  1595. * Computes the provided Cartesian's squared magnitude.
  1596. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1597. * @returns The squared magnitude.
  1598. */
  1599. static magnitudeSquared(cartesian: Cartesian2): number;
  1600. /**
  1601. * Computes the Cartesian's magnitude (length).
  1602. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1603. * @returns The magnitude.
  1604. */
  1605. static magnitude(cartesian: Cartesian2): number;
  1606. /**
  1607. * Computes the distance between two points.
  1608. * @example
  1609. * // Returns 1.0
  1610. * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
  1611. * @param left - The first point to compute the distance from.
  1612. * @param right - The second point to compute the distance to.
  1613. * @returns The distance between two points.
  1614. */
  1615. static distance(left: Cartesian2, right: Cartesian2): number;
  1616. /**
  1617. * Computes the squared distance between two points. Comparing squared distances
  1618. * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
  1619. * @example
  1620. * // Returns 4.0, not 2.0
  1621. * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
  1622. * @param left - The first point to compute the distance from.
  1623. * @param right - The second point to compute the distance to.
  1624. * @returns The distance between two points.
  1625. */
  1626. static distanceSquared(left: Cartesian2, right: Cartesian2): number;
  1627. /**
  1628. * Computes the normalized form of the supplied Cartesian.
  1629. * @param cartesian - The Cartesian to be normalized.
  1630. * @param result - The object onto which to store the result.
  1631. * @returns The modified result parameter.
  1632. */
  1633. static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1634. /**
  1635. * Computes the dot (scalar) product of two Cartesians.
  1636. * @param left - The first Cartesian.
  1637. * @param right - The second Cartesian.
  1638. * @returns The dot product.
  1639. */
  1640. static dot(left: Cartesian2, right: Cartesian2): number;
  1641. /**
  1642. * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0
  1643. * @param left - The first Cartesian.
  1644. * @param right - The second Cartesian.
  1645. * @returns The cross product.
  1646. */
  1647. static cross(left: Cartesian2, right: Cartesian2): number;
  1648. /**
  1649. * Computes the componentwise product of two Cartesians.
  1650. * @param left - The first Cartesian.
  1651. * @param right - The second Cartesian.
  1652. * @param result - The object onto which to store the result.
  1653. * @returns The modified result parameter.
  1654. */
  1655. static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1656. /**
  1657. * Computes the componentwise quotient of two Cartesians.
  1658. * @param left - The first Cartesian.
  1659. * @param right - The second Cartesian.
  1660. * @param result - The object onto which to store the result.
  1661. * @returns The modified result parameter.
  1662. */
  1663. static divideComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1664. /**
  1665. * Computes the componentwise sum of two Cartesians.
  1666. * @param left - The first Cartesian.
  1667. * @param right - The second Cartesian.
  1668. * @param result - The object onto which to store the result.
  1669. * @returns The modified result parameter.
  1670. */
  1671. static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1672. /**
  1673. * Computes the componentwise difference of two Cartesians.
  1674. * @param left - The first Cartesian.
  1675. * @param right - The second Cartesian.
  1676. * @param result - The object onto which to store the result.
  1677. * @returns The modified result parameter.
  1678. */
  1679. static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2;
  1680. /**
  1681. * Multiplies the provided Cartesian componentwise by the provided scalar.
  1682. * @param cartesian - The Cartesian to be scaled.
  1683. * @param scalar - The scalar to multiply with.
  1684. * @param result - The object onto which to store the result.
  1685. * @returns The modified result parameter.
  1686. */
  1687. static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1688. /**
  1689. * Divides the provided Cartesian componentwise by the provided scalar.
  1690. * @param cartesian - The Cartesian to be divided.
  1691. * @param scalar - The scalar to divide by.
  1692. * @param result - The object onto which to store the result.
  1693. * @returns The modified result parameter.
  1694. */
  1695. static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2;
  1696. /**
  1697. * Negates the provided Cartesian.
  1698. * @param cartesian - The Cartesian to be negated.
  1699. * @param result - The object onto which to store the result.
  1700. * @returns The modified result parameter.
  1701. */
  1702. static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1703. /**
  1704. * Computes the absolute value of the provided Cartesian.
  1705. * @param cartesian - The Cartesian whose absolute value is to be computed.
  1706. * @param result - The object onto which to store the result.
  1707. * @returns The modified result parameter.
  1708. */
  1709. static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1710. /**
  1711. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  1712. * @param start - The value corresponding to t at 0.0.
  1713. * @param end - The value corresponding to t at 1.0.
  1714. * @param t - The point along t at which to interpolate.
  1715. * @param result - The object onto which to store the result.
  1716. * @returns The modified result parameter.
  1717. */
  1718. static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2;
  1719. /**
  1720. * Returns the angle, in radians, between the provided Cartesians.
  1721. * @param left - The first Cartesian.
  1722. * @param right - The second Cartesian.
  1723. * @returns The angle between the Cartesians.
  1724. */
  1725. static angleBetween(left: Cartesian2, right: Cartesian2): number;
  1726. /**
  1727. * Returns the axis that is most orthogonal to the provided Cartesian.
  1728. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  1729. * @param result - The object onto which to store the result.
  1730. * @returns The most orthogonal axis.
  1731. */
  1732. static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  1733. /**
  1734. * Compares the provided Cartesians componentwise and returns
  1735. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1736. * @param [left] - The first Cartesian.
  1737. * @param [right] - The second Cartesian.
  1738. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  1739. */
  1740. static equals(left?: Cartesian2, right?: Cartesian2): boolean;
  1741. /**
  1742. * Compares the provided Cartesians componentwise and returns
  1743. * <code>true</code> if they pass an absolute or relative tolerance test,
  1744. * <code>false</code> otherwise.
  1745. * @param [left] - The first Cartesian.
  1746. * @param [right] - The second Cartesian.
  1747. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1748. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1749. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  1750. */
  1751. static equalsEpsilon(left?: Cartesian2, right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1752. /**
  1753. * An immutable Cartesian2 instance initialized to (0.0, 0.0).
  1754. */
  1755. static readonly ZERO: Cartesian2;
  1756. /**
  1757. * An immutable Cartesian2 instance initialized to (1.0, 1.0).
  1758. */
  1759. static readonly ONE: Cartesian2;
  1760. /**
  1761. * An immutable Cartesian2 instance initialized to (1.0, 0.0).
  1762. */
  1763. static readonly UNIT_X: Cartesian2;
  1764. /**
  1765. * An immutable Cartesian2 instance initialized to (0.0, 1.0).
  1766. */
  1767. static readonly UNIT_Y: Cartesian2;
  1768. /**
  1769. * Duplicates this Cartesian2 instance.
  1770. * @param [result] - The object onto which to store the result.
  1771. * @returns The modified result parameter or a new Cartesian2 instance if one was not provided.
  1772. */
  1773. clone(result?: Cartesian2): Cartesian2;
  1774. /**
  1775. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1776. * <code>true</code> if they are equal, <code>false</code> otherwise.
  1777. * @param [right] - The right hand side Cartesian.
  1778. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  1779. */
  1780. equals(right?: Cartesian2): boolean;
  1781. /**
  1782. * Compares this Cartesian against the provided Cartesian componentwise and returns
  1783. * <code>true</code> if they pass an absolute or relative tolerance test,
  1784. * <code>false</code> otherwise.
  1785. * @param [right] - The right hand side Cartesian.
  1786. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  1787. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  1788. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  1789. */
  1790. equalsEpsilon(right?: Cartesian2, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  1791. /**
  1792. * Creates a string representing this Cartesian in the format '(x, y)'.
  1793. * @returns A string representing the provided Cartesian in the format '(x, y)'.
  1794. */
  1795. toString(): string;
  1796. }
  1797. /**
  1798. * A 3D Cartesian point.
  1799. * @param [x = 0.0] - The X component.
  1800. * @param [y = 0.0] - The Y component.
  1801. * @param [z = 0.0] - The Z component.
  1802. */
  1803. export class Cartesian3 {
  1804. constructor(x?: number, y?: number, z?: number);
  1805. /**
  1806. * The X component.
  1807. */
  1808. x: number;
  1809. /**
  1810. * The Y component.
  1811. */
  1812. y: number;
  1813. /**
  1814. * The Z component.
  1815. */
  1816. z: number;
  1817. /**
  1818. * Converts the provided Spherical into Cartesian3 coordinates.
  1819. * @param spherical - The Spherical to be converted to Cartesian3.
  1820. * @param [result] - The object onto which to store the result.
  1821. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1822. */
  1823. static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3;
  1824. /**
  1825. * Creates a Cartesian3 instance from x, y and z coordinates.
  1826. * @param x - The x coordinate.
  1827. * @param y - The y coordinate.
  1828. * @param z - The z coordinate.
  1829. * @param [result] - The object onto which to store the result.
  1830. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1831. */
  1832. static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3;
  1833. /**
  1834. * Duplicates a Cartesian3 instance.
  1835. * @param cartesian - The Cartesian to duplicate.
  1836. * @param [result] - The object onto which to store the result.
  1837. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)
  1838. */
  1839. static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  1840. /**
  1841. * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the
  1842. * x, y, and z properties of the Cartesian4 and drops w.
  1843. * @param cartesian - The Cartesian4 instance to create a Cartesian3 instance from.
  1844. * @param [result] - The object onto which to store the result.
  1845. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1846. */
  1847. static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3;
  1848. /**
  1849. * The number of elements used to pack the object into an array.
  1850. */
  1851. static packedLength: number;
  1852. /**
  1853. * Stores the provided instance into the provided array.
  1854. * @param value - The value to pack.
  1855. * @param array - The array to pack into.
  1856. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  1857. * @returns The array that was packed into
  1858. */
  1859. static pack(value: Cartesian3, array: number[], startingIndex?: number): number[];
  1860. /**
  1861. * Retrieves an instance from a packed array.
  1862. * @param array - The packed array.
  1863. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  1864. * @param [result] - The object into which to store the result.
  1865. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1866. */
  1867. static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1868. /**
  1869. * Flattens an array of Cartesian3s into an array of components.
  1870. * @param array - The array of cartesians to pack.
  1871. * @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.
  1872. * @returns The packed array.
  1873. */
  1874. static packArray(array: Cartesian3[], result?: number[]): number[];
  1875. /**
  1876. * Unpacks an array of cartesian components into an array of Cartesian3s.
  1877. * @param array - The array of components to unpack.
  1878. * @param [result] - The array onto which to store the result.
  1879. * @returns The unpacked array.
  1880. */
  1881. static unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[];
  1882. /**
  1883. * Creates a Cartesian3 from three consecutive elements in an array.
  1884. * @example
  1885. * // Create a Cartesian3 with (1.0, 2.0, 3.0)
  1886. * const v = [1.0, 2.0, 3.0];
  1887. * const p = Cesium.Cartesian3.fromArray(v);
  1888. *
  1889. * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array
  1890. * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0];
  1891. * const p2 = Cesium.Cartesian3.fromArray(v2, 2);
  1892. * @param array - The array whose three consecutive elements correspond to the x, y, and z components, respectively.
  1893. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  1894. * @param [result] - The object onto which to store the result.
  1895. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  1896. */
  1897. static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3;
  1898. /**
  1899. * Computes the value of the maximum component for the supplied Cartesian.
  1900. * @param cartesian - The cartesian to use.
  1901. * @returns The value of the maximum component.
  1902. */
  1903. static maximumComponent(cartesian: Cartesian3): number;
  1904. /**
  1905. * Computes the value of the minimum component for the supplied Cartesian.
  1906. * @param cartesian - The cartesian to use.
  1907. * @returns The value of the minimum component.
  1908. */
  1909. static minimumComponent(cartesian: Cartesian3): number;
  1910. /**
  1911. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  1912. * @param first - A cartesian to compare.
  1913. * @param second - A cartesian to compare.
  1914. * @param result - The object into which to store the result.
  1915. * @returns A cartesian with the minimum components.
  1916. */
  1917. static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1918. /**
  1919. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  1920. * @param first - A cartesian to compare.
  1921. * @param second - A cartesian to compare.
  1922. * @param result - The object into which to store the result.
  1923. * @returns A cartesian with the maximum components.
  1924. */
  1925. static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3;
  1926. /**
  1927. * Constrain a value to lie between two values.
  1928. * @param cartesian - The value to clamp.
  1929. * @param min - The minimum bound.
  1930. * @param max - The maximum bound.
  1931. * @param result - The object into which to store the result.
  1932. * @returns The clamped value such that min <= value <= max.
  1933. */
  1934. static clamp(cartesian: Cartesian3, min: Cartesian3, max: Cartesian3, result: Cartesian3): Cartesian3;
  1935. /**
  1936. * Computes the provided Cartesian's squared magnitude.
  1937. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  1938. * @returns The squared magnitude.
  1939. */
  1940. static magnitudeSquared(cartesian: Cartesian3): number;
  1941. /**
  1942. * Computes the Cartesian's magnitude (length).
  1943. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  1944. * @returns The magnitude.
  1945. */
  1946. static magnitude(cartesian: Cartesian3): number;
  1947. /**
  1948. * Computes the distance between two points.
  1949. * @example
  1950. * // Returns 1.0
  1951. * const d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
  1952. * @param left - The first point to compute the distance from.
  1953. * @param right - The second point to compute the distance to.
  1954. * @returns The distance between two points.
  1955. */
  1956. static distance(left: Cartesian3, right: Cartesian3): number;
  1957. /**
  1958. * Computes the squared distance between two points. Comparing squared distances
  1959. * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.
  1960. * @example
  1961. * // Returns 4.0, not 2.0
  1962. * const d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));
  1963. * @param left - The first point to compute the distance from.
  1964. * @param right - The second point to compute the distance to.
  1965. * @returns The distance between two points.
  1966. */
  1967. static distanceSquared(left: Cartesian3, right: Cartesian3): number;
  1968. /**
  1969. * Computes the normalized form of the supplied Cartesian.
  1970. * @param cartesian - The Cartesian to be normalized.
  1971. * @param result - The object onto which to store the result.
  1972. * @returns The modified result parameter.
  1973. */
  1974. static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  1975. /**
  1976. * Computes the dot (scalar) product of two Cartesians.
  1977. * @param left - The first Cartesian.
  1978. * @param right - The second Cartesian.
  1979. * @returns The dot product.
  1980. */
  1981. static dot(left: Cartesian3, right: Cartesian3): number;
  1982. /**
  1983. * Computes the componentwise product of two Cartesians.
  1984. * @param left - The first Cartesian.
  1985. * @param right - The second Cartesian.
  1986. * @param result - The object onto which to store the result.
  1987. * @returns The modified result parameter.
  1988. */
  1989. static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1990. /**
  1991. * Computes the componentwise quotient of two Cartesians.
  1992. * @param left - The first Cartesian.
  1993. * @param right - The second Cartesian.
  1994. * @param result - The object onto which to store the result.
  1995. * @returns The modified result parameter.
  1996. */
  1997. static divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  1998. /**
  1999. * Computes the componentwise sum of two Cartesians.
  2000. * @param left - The first Cartesian.
  2001. * @param right - The second Cartesian.
  2002. * @param result - The object onto which to store the result.
  2003. * @returns The modified result parameter.
  2004. */
  2005. static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2006. /**
  2007. * Computes the componentwise difference of two Cartesians.
  2008. * @param left - The first Cartesian.
  2009. * @param right - The second Cartesian.
  2010. * @param result - The object onto which to store the result.
  2011. * @returns The modified result parameter.
  2012. */
  2013. static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2014. /**
  2015. * Multiplies the provided Cartesian componentwise by the provided scalar.
  2016. * @param cartesian - The Cartesian to be scaled.
  2017. * @param scalar - The scalar to multiply with.
  2018. * @param result - The object onto which to store the result.
  2019. * @returns The modified result parameter.
  2020. */
  2021. static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  2022. /**
  2023. * Divides the provided Cartesian componentwise by the provided scalar.
  2024. * @param cartesian - The Cartesian to be divided.
  2025. * @param scalar - The scalar to divide by.
  2026. * @param result - The object onto which to store the result.
  2027. * @returns The modified result parameter.
  2028. */
  2029. static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3;
  2030. /**
  2031. * Negates the provided Cartesian.
  2032. * @param cartesian - The Cartesian to be negated.
  2033. * @param result - The object onto which to store the result.
  2034. * @returns The modified result parameter.
  2035. */
  2036. static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2037. /**
  2038. * Computes the absolute value of the provided Cartesian.
  2039. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2040. * @param result - The object onto which to store the result.
  2041. * @returns The modified result parameter.
  2042. */
  2043. static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2044. /**
  2045. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2046. * @param start - The value corresponding to t at 0.0.
  2047. * @param end - The value corresponding to t at 1.0.
  2048. * @param t - The point along t at which to interpolate.
  2049. * @param result - The object onto which to store the result.
  2050. * @returns The modified result parameter.
  2051. */
  2052. static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3;
  2053. /**
  2054. * Returns the angle, in radians, between the provided Cartesians.
  2055. * @param left - The first Cartesian.
  2056. * @param right - The second Cartesian.
  2057. * @returns The angle between the Cartesians.
  2058. */
  2059. static angleBetween(left: Cartesian3, right: Cartesian3): number;
  2060. /**
  2061. * Returns the axis that is most orthogonal to the provided Cartesian.
  2062. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2063. * @param result - The object onto which to store the result.
  2064. * @returns The most orthogonal axis.
  2065. */
  2066. static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  2067. /**
  2068. * Projects vector a onto vector b
  2069. * @param a - The vector that needs projecting
  2070. * @param b - The vector to project onto
  2071. * @param result - The result cartesian
  2072. * @returns The modified result parameter
  2073. */
  2074. static projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3;
  2075. /**
  2076. * Compares the provided Cartesians componentwise and returns
  2077. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2078. * @param [left] - The first Cartesian.
  2079. * @param [right] - The second Cartesian.
  2080. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2081. */
  2082. static equals(left?: Cartesian3, right?: Cartesian3): boolean;
  2083. /**
  2084. * Compares the provided Cartesians componentwise and returns
  2085. * <code>true</code> if they pass an absolute or relative tolerance test,
  2086. * <code>false</code> otherwise.
  2087. * @param [left] - The first Cartesian.
  2088. * @param [right] - The second Cartesian.
  2089. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2090. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2091. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2092. */
  2093. static equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2094. /**
  2095. * Computes the cross (outer) product of two Cartesians.
  2096. * @param left - The first Cartesian.
  2097. * @param right - The second Cartesian.
  2098. * @param result - The object onto which to store the result.
  2099. * @returns The cross product.
  2100. */
  2101. static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2102. /**
  2103. * Computes the midpoint between the right and left Cartesian.
  2104. * @param left - The first Cartesian.
  2105. * @param right - The second Cartesian.
  2106. * @param result - The object onto which to store the result.
  2107. * @returns The midpoint.
  2108. */
  2109. static midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3;
  2110. /**
  2111. * Returns a Cartesian3 position from longitude and latitude values given in degrees.
  2112. * @example
  2113. * const position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
  2114. * @param longitude - The longitude, in degrees
  2115. * @param latitude - The latitude, in degrees
  2116. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2117. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2118. * @param [result] - The object onto which to store the result.
  2119. * @returns The position
  2120. */
  2121. static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2122. /**
  2123. * Returns a Cartesian3 position from longitude and latitude values given in radians.
  2124. * @example
  2125. * const position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
  2126. * @param longitude - The longitude, in radians
  2127. * @param latitude - The latitude, in radians
  2128. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2129. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2130. * @param [result] - The object onto which to store the result.
  2131. * @returns The position
  2132. */
  2133. static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2134. /**
  2135. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
  2136. * @example
  2137. * const positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
  2138. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2139. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2140. * @param [result] - An array of Cartesian3 objects to store the result.
  2141. * @returns The array of positions.
  2142. */
  2143. static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2144. /**
  2145. * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
  2146. * @example
  2147. * const positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
  2148. * @param coordinates - A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
  2149. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the coordinates lie.
  2150. * @param [result] - An array of Cartesian3 objects to store the result.
  2151. * @returns The array of positions.
  2152. */
  2153. static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2154. /**
  2155. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
  2156. * @example
  2157. * const positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
  2158. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2159. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2160. * @param [result] - An array of Cartesian3 objects to store the result.
  2161. * @returns The array of positions.
  2162. */
  2163. static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2164. /**
  2165. * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
  2166. * @example
  2167. * const positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
  2168. * @param coordinates - A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
  2169. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2170. * @param [result] - An array of Cartesian3 objects to store the result.
  2171. * @returns The array of positions.
  2172. */
  2173. static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[];
  2174. /**
  2175. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
  2176. */
  2177. static readonly ZERO: Cartesian3;
  2178. /**
  2179. * An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).
  2180. */
  2181. static readonly ONE: Cartesian3;
  2182. /**
  2183. * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
  2184. */
  2185. static readonly UNIT_X: Cartesian3;
  2186. /**
  2187. * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
  2188. */
  2189. static readonly UNIT_Y: Cartesian3;
  2190. /**
  2191. * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
  2192. */
  2193. static readonly UNIT_Z: Cartesian3;
  2194. /**
  2195. * Duplicates this Cartesian3 instance.
  2196. * @param [result] - The object onto which to store the result.
  2197. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  2198. */
  2199. clone(result?: Cartesian3): Cartesian3;
  2200. /**
  2201. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2202. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2203. * @param [right] - The right hand side Cartesian.
  2204. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2205. */
  2206. equals(right?: Cartesian3): boolean;
  2207. /**
  2208. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2209. * <code>true</code> if they pass an absolute or relative tolerance test,
  2210. * <code>false</code> otherwise.
  2211. * @param [right] - The right hand side Cartesian.
  2212. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2213. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2214. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2215. */
  2216. equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2217. /**
  2218. * Creates a string representing this Cartesian in the format '(x, y, z)'.
  2219. * @returns A string representing this Cartesian in the format '(x, y, z)'.
  2220. */
  2221. toString(): string;
  2222. }
  2223. /**
  2224. * A 4D Cartesian point.
  2225. * @param [x = 0.0] - The X component.
  2226. * @param [y = 0.0] - The Y component.
  2227. * @param [z = 0.0] - The Z component.
  2228. * @param [w = 0.0] - The W component.
  2229. */
  2230. export class Cartesian4 {
  2231. constructor(x?: number, y?: number, z?: number, w?: number);
  2232. /**
  2233. * The X component.
  2234. */
  2235. x: number;
  2236. /**
  2237. * The Y component.
  2238. */
  2239. y: number;
  2240. /**
  2241. * The Z component.
  2242. */
  2243. z: number;
  2244. /**
  2245. * The W component.
  2246. */
  2247. w: number;
  2248. /**
  2249. * Creates a Cartesian4 instance from x, y, z and w coordinates.
  2250. * @param x - The x coordinate.
  2251. * @param y - The y coordinate.
  2252. * @param z - The z coordinate.
  2253. * @param w - The w coordinate.
  2254. * @param [result] - The object onto which to store the result.
  2255. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2256. */
  2257. static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4;
  2258. /**
  2259. * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,
  2260. * and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.
  2261. * @param color - The source color.
  2262. * @param [result] - The object onto which to store the result.
  2263. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2264. */
  2265. static fromColor(color: Color, result?: Cartesian4): Cartesian4;
  2266. /**
  2267. * Duplicates a Cartesian4 instance.
  2268. * @param cartesian - The Cartesian to duplicate.
  2269. * @param [result] - The object onto which to store the result.
  2270. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
  2271. */
  2272. static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  2273. /**
  2274. * The number of elements used to pack the object into an array.
  2275. */
  2276. static packedLength: number;
  2277. /**
  2278. * Stores the provided instance into the provided array.
  2279. * @param value - The value to pack.
  2280. * @param array - The array to pack into.
  2281. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2282. * @returns The array that was packed into
  2283. */
  2284. static pack(value: Cartesian4, array: number[], startingIndex?: number): number[];
  2285. /**
  2286. * Retrieves an instance from a packed array.
  2287. * @param array - The packed array.
  2288. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2289. * @param [result] - The object into which to store the result.
  2290. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2291. */
  2292. static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2293. /**
  2294. * Flattens an array of Cartesian4s into an array of components.
  2295. * @param array - The array of cartesians to pack.
  2296. * @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.
  2297. * @returns The packed array.
  2298. */
  2299. static packArray(array: Cartesian4[], result?: number[]): number[];
  2300. /**
  2301. * Unpacks an array of cartesian components into an array of Cartesian4s.
  2302. * @param array - The array of components to unpack.
  2303. * @param [result] - The array onto which to store the result.
  2304. * @returns The unpacked array.
  2305. */
  2306. static unpackArray(array: number[], result?: Cartesian4[]): Cartesian4[];
  2307. /**
  2308. * Creates a Cartesian4 from four consecutive elements in an array.
  2309. * @example
  2310. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
  2311. * const v = [1.0, 2.0, 3.0, 4.0];
  2312. * const p = Cesium.Cartesian4.fromArray(v);
  2313. *
  2314. * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
  2315. * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
  2316. * const p2 = Cesium.Cartesian4.fromArray(v2, 2);
  2317. * @param array - The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
  2318. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to the x component.
  2319. * @param [result] - The object onto which to store the result.
  2320. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2321. */
  2322. static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4;
  2323. /**
  2324. * Computes the value of the maximum component for the supplied Cartesian.
  2325. * @param cartesian - The cartesian to use.
  2326. * @returns The value of the maximum component.
  2327. */
  2328. static maximumComponent(cartesian: Cartesian4): number;
  2329. /**
  2330. * Computes the value of the minimum component for the supplied Cartesian.
  2331. * @param cartesian - The cartesian to use.
  2332. * @returns The value of the minimum component.
  2333. */
  2334. static minimumComponent(cartesian: Cartesian4): number;
  2335. /**
  2336. * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
  2337. * @param first - A cartesian to compare.
  2338. * @param second - A cartesian to compare.
  2339. * @param result - The object into which to store the result.
  2340. * @returns A cartesian with the minimum components.
  2341. */
  2342. static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2343. /**
  2344. * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
  2345. * @param first - A cartesian to compare.
  2346. * @param second - A cartesian to compare.
  2347. * @param result - The object into which to store the result.
  2348. * @returns A cartesian with the maximum components.
  2349. */
  2350. static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4;
  2351. /**
  2352. * Constrain a value to lie between two values.
  2353. * @param value - The value to clamp.
  2354. * @param min - The minimum bound.
  2355. * @param max - The maximum bound.
  2356. * @param result - The object into which to store the result.
  2357. * @returns The clamped value such that min <= result <= max.
  2358. */
  2359. static clamp(value: Cartesian4, min: Cartesian4, max: Cartesian4, result: Cartesian4): Cartesian4;
  2360. /**
  2361. * Computes the provided Cartesian's squared magnitude.
  2362. * @param cartesian - The Cartesian instance whose squared magnitude is to be computed.
  2363. * @returns The squared magnitude.
  2364. */
  2365. static magnitudeSquared(cartesian: Cartesian4): number;
  2366. /**
  2367. * Computes the Cartesian's magnitude (length).
  2368. * @param cartesian - The Cartesian instance whose magnitude is to be computed.
  2369. * @returns The magnitude.
  2370. */
  2371. static magnitude(cartesian: Cartesian4): number;
  2372. /**
  2373. * Computes the 4-space distance between two points.
  2374. * @example
  2375. * // Returns 1.0
  2376. * const d = Cesium.Cartesian4.distance(
  2377. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2378. * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
  2379. * @param left - The first point to compute the distance from.
  2380. * @param right - The second point to compute the distance to.
  2381. * @returns The distance between two points.
  2382. */
  2383. static distance(left: Cartesian4, right: Cartesian4): number;
  2384. /**
  2385. * Computes the squared distance between two points. Comparing squared distances
  2386. * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
  2387. * @example
  2388. * // Returns 4.0, not 2.0
  2389. * const d = Cesium.Cartesian4.distance(
  2390. * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
  2391. * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
  2392. * @param left - The first point to compute the distance from.
  2393. * @param right - The second point to compute the distance to.
  2394. * @returns The distance between two points.
  2395. */
  2396. static distanceSquared(left: Cartesian4, right: Cartesian4): number;
  2397. /**
  2398. * Computes the normalized form of the supplied Cartesian.
  2399. * @param cartesian - The Cartesian to be normalized.
  2400. * @param result - The object onto which to store the result.
  2401. * @returns The modified result parameter.
  2402. */
  2403. static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2404. /**
  2405. * Computes the dot (scalar) product of two Cartesians.
  2406. * @param left - The first Cartesian.
  2407. * @param right - The second Cartesian.
  2408. * @returns The dot product.
  2409. */
  2410. static dot(left: Cartesian4, right: Cartesian4): number;
  2411. /**
  2412. * Computes the componentwise product of two Cartesians.
  2413. * @param left - The first Cartesian.
  2414. * @param right - The second Cartesian.
  2415. * @param result - The object onto which to store the result.
  2416. * @returns The modified result parameter.
  2417. */
  2418. static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2419. /**
  2420. * Computes the componentwise quotient of two Cartesians.
  2421. * @param left - The first Cartesian.
  2422. * @param right - The second Cartesian.
  2423. * @param result - The object onto which to store the result.
  2424. * @returns The modified result parameter.
  2425. */
  2426. static divideComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2427. /**
  2428. * Computes the componentwise sum of two Cartesians.
  2429. * @param left - The first Cartesian.
  2430. * @param right - The second Cartesian.
  2431. * @param result - The object onto which to store the result.
  2432. * @returns The modified result parameter.
  2433. */
  2434. static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2435. /**
  2436. * Computes the componentwise difference of two Cartesians.
  2437. * @param left - The first Cartesian.
  2438. * @param right - The second Cartesian.
  2439. * @param result - The object onto which to store the result.
  2440. * @returns The modified result parameter.
  2441. */
  2442. static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4;
  2443. /**
  2444. * Multiplies the provided Cartesian componentwise by the provided scalar.
  2445. * @param cartesian - The Cartesian to be scaled.
  2446. * @param scalar - The scalar to multiply with.
  2447. * @param result - The object onto which to store the result.
  2448. * @returns The modified result parameter.
  2449. */
  2450. static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2451. /**
  2452. * Divides the provided Cartesian componentwise by the provided scalar.
  2453. * @param cartesian - The Cartesian to be divided.
  2454. * @param scalar - The scalar to divide by.
  2455. * @param result - The object onto which to store the result.
  2456. * @returns The modified result parameter.
  2457. */
  2458. static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4;
  2459. /**
  2460. * Negates the provided Cartesian.
  2461. * @param cartesian - The Cartesian to be negated.
  2462. * @param result - The object onto which to store the result.
  2463. * @returns The modified result parameter.
  2464. */
  2465. static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2466. /**
  2467. * Computes the absolute value of the provided Cartesian.
  2468. * @param cartesian - The Cartesian whose absolute value is to be computed.
  2469. * @param result - The object onto which to store the result.
  2470. * @returns The modified result parameter.
  2471. */
  2472. static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2473. /**
  2474. * Computes the linear interpolation or extrapolation at t using the provided cartesians.
  2475. * @param start - The value corresponding to t at 0.0.
  2476. * @param end - The value corresponding to t at 1.0.
  2477. * @param t - The point along t at which to interpolate.
  2478. * @param result - The object onto which to store the result.
  2479. * @returns The modified result parameter.
  2480. */
  2481. static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4;
  2482. /**
  2483. * Returns the axis that is most orthogonal to the provided Cartesian.
  2484. * @param cartesian - The Cartesian on which to find the most orthogonal axis.
  2485. * @param result - The object onto which to store the result.
  2486. * @returns The most orthogonal axis.
  2487. */
  2488. static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  2489. /**
  2490. * Compares the provided Cartesians componentwise and returns
  2491. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2492. * @param [left] - The first Cartesian.
  2493. * @param [right] - The second Cartesian.
  2494. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2495. */
  2496. static equals(left?: Cartesian4, right?: Cartesian4): boolean;
  2497. /**
  2498. * Compares the provided Cartesians componentwise and returns
  2499. * <code>true</code> if they pass an absolute or relative tolerance test,
  2500. * <code>false</code> otherwise.
  2501. * @param [left] - The first Cartesian.
  2502. * @param [right] - The second Cartesian.
  2503. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2504. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2505. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2506. */
  2507. static equalsEpsilon(left?: Cartesian4, right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2508. /**
  2509. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
  2510. */
  2511. static readonly ZERO: Cartesian4;
  2512. /**
  2513. * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).
  2514. */
  2515. static readonly ONE: Cartesian4;
  2516. /**
  2517. * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
  2518. */
  2519. static readonly UNIT_X: Cartesian4;
  2520. /**
  2521. * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
  2522. */
  2523. static readonly UNIT_Y: Cartesian4;
  2524. /**
  2525. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
  2526. */
  2527. static readonly UNIT_Z: Cartesian4;
  2528. /**
  2529. * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
  2530. */
  2531. static readonly UNIT_W: Cartesian4;
  2532. /**
  2533. * Duplicates this Cartesian4 instance.
  2534. * @param [result] - The object onto which to store the result.
  2535. * @returns The modified result parameter or a new Cartesian4 instance if one was not provided.
  2536. */
  2537. clone(result?: Cartesian4): Cartesian4;
  2538. /**
  2539. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2540. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2541. * @param [right] - The right hand side Cartesian.
  2542. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  2543. */
  2544. equals(right?: Cartesian4): boolean;
  2545. /**
  2546. * Compares this Cartesian against the provided Cartesian componentwise and returns
  2547. * <code>true</code> if they pass an absolute or relative tolerance test,
  2548. * <code>false</code> otherwise.
  2549. * @param [right] - The right hand side Cartesian.
  2550. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  2551. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  2552. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  2553. */
  2554. equalsEpsilon(right?: Cartesian4, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  2555. /**
  2556. * Creates a string representing this Cartesian in the format '(x, y, z, w)'.
  2557. * @returns A string representing the provided Cartesian in the format '(x, y, z, w)'.
  2558. */
  2559. toString(): string;
  2560. /**
  2561. * Packs an arbitrary floating point value to 4 values representable using uint8.
  2562. * @param value - A floating point number.
  2563. * @param [result] - The Cartesian4 that will contain the packed float.
  2564. * @returns A Cartesian4 representing the float packed to values in x, y, z, and w.
  2565. */
  2566. static packFloat(value: number, result?: Cartesian4): Cartesian4;
  2567. }
  2568. /**
  2569. * A position defined by longitude, latitude, and height.
  2570. * @param [longitude = 0.0] - The longitude, in radians.
  2571. * @param [latitude = 0.0] - The latitude, in radians.
  2572. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2573. */
  2574. export class Cartographic {
  2575. constructor(longitude?: number, latitude?: number, height?: number);
  2576. /**
  2577. * The longitude, in radians.
  2578. */
  2579. longitude: number;
  2580. /**
  2581. * The latitude, in radians.
  2582. */
  2583. latitude: number;
  2584. /**
  2585. * The height, in meters, above the ellipsoid.
  2586. */
  2587. height: number;
  2588. /**
  2589. * Creates a new Cartographic instance from longitude and latitude
  2590. * specified in radians.
  2591. * @param longitude - The longitude, in radians.
  2592. * @param latitude - The latitude, in radians.
  2593. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2594. * @param [result] - The object onto which to store the result.
  2595. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2596. */
  2597. static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2598. /**
  2599. * Creates a new Cartographic instance from longitude and latitude
  2600. * specified in degrees. The values in the resulting object will
  2601. * be in radians.
  2602. * @param longitude - The longitude, in degrees.
  2603. * @param latitude - The latitude, in degrees.
  2604. * @param [height = 0.0] - The height, in meters, above the ellipsoid.
  2605. * @param [result] - The object onto which to store the result.
  2606. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2607. */
  2608. static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic;
  2609. /**
  2610. * Creates a new Cartographic instance from a Cartesian position. The values in the
  2611. * resulting object will be in radians.
  2612. * @param cartesian - The Cartesian position to convert to cartographic representation.
  2613. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2614. * @param [result] - The object onto which to store the result.
  2615. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  2616. */
  2617. static fromCartesian(cartesian: Cartesian3, ellipsoid?: Ellipsoid, result?: Cartographic): Cartographic;
  2618. /**
  2619. * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
  2620. * object should be in radians.
  2621. * @param cartographic - Input to be converted into a Cartesian3 output.
  2622. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the position lies.
  2623. * @param [result] - The object onto which to store the result.
  2624. * @returns The position
  2625. */
  2626. static toCartesian(cartographic: Cartographic, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3;
  2627. /**
  2628. * Duplicates a Cartographic instance.
  2629. * @param cartographic - The cartographic to duplicate.
  2630. * @param [result] - The object onto which to store the result.
  2631. * @returns The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
  2632. */
  2633. static clone(cartographic: Cartographic, result?: Cartographic): Cartographic;
  2634. /**
  2635. * Compares the provided cartographics componentwise and returns
  2636. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2637. * @param [left] - The first cartographic.
  2638. * @param [right] - The second cartographic.
  2639. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2640. */
  2641. static equals(left?: Cartographic, right?: Cartographic): boolean;
  2642. /**
  2643. * Compares the provided cartographics componentwise and returns
  2644. * <code>true</code> if they are within the provided epsilon,
  2645. * <code>false</code> otherwise.
  2646. * @param [left] - The first cartographic.
  2647. * @param [right] - The second cartographic.
  2648. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2649. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2650. */
  2651. static equalsEpsilon(left?: Cartographic, right?: Cartographic, epsilon?: number): boolean;
  2652. /**
  2653. * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
  2654. */
  2655. static readonly ZERO: Cartographic;
  2656. /**
  2657. * Duplicates this instance.
  2658. * @param [result] - The object onto which to store the result.
  2659. * @returns The modified result parameter or a new Cartographic instance if one was not provided.
  2660. */
  2661. clone(result?: Cartographic): Cartographic;
  2662. /**
  2663. * Compares the provided against this cartographic componentwise and returns
  2664. * <code>true</code> if they are equal, <code>false</code> otherwise.
  2665. * @param [right] - The second cartographic.
  2666. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  2667. */
  2668. equals(right?: Cartographic): boolean;
  2669. /**
  2670. * Compares the provided against this cartographic componentwise and returns
  2671. * <code>true</code> if they are within the provided epsilon,
  2672. * <code>false</code> otherwise.
  2673. * @param [right] - The second cartographic.
  2674. * @param [epsilon = 0] - The epsilon to use for equality testing.
  2675. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  2676. */
  2677. equalsEpsilon(right?: Cartographic, epsilon?: number): boolean;
  2678. /**
  2679. * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
  2680. * @returns A string representing the provided cartographic in the format '(longitude, latitude, height)'.
  2681. */
  2682. toString(): string;
  2683. }
  2684. /**
  2685. * Geocodes queries containing longitude and latitude coordinates and an optional height.
  2686. * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.
  2687. */
  2688. export class CartographicGeocoderService {
  2689. constructor();
  2690. /**
  2691. * @param query - The query to be sent to the geocoder service
  2692. */
  2693. geocode(query: string): Promise<GeocoderService.Result[]>;
  2694. }
  2695. /**
  2696. * A Catmull-Rom spline is a cubic spline where the tangent at control points,
  2697. * except the first and last, are computed using the previous and next control points.
  2698. * Catmull-Rom splines are in the class C<sup>1</sup>.
  2699. * @example
  2700. * // spline above the earth from Philadelphia to Los Angeles
  2701. * const spline = new Cesium.CatmullRomSpline({
  2702. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  2703. * points : [
  2704. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  2705. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  2706. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  2707. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  2708. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  2709. * ]
  2710. * });
  2711. *
  2712. * const p0 = spline.evaluate(times[i]); // equal to positions[i]
  2713. * const p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
  2714. * @param options - Object with the following properties:
  2715. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  2716. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  2717. * @param options.points - The array of {@link Cartesian3} control points.
  2718. * @param [options.firstTangent] - The tangent of the curve at the first control point.
  2719. * If the tangent is not given, it will be estimated.
  2720. * @param [options.lastTangent] - The tangent of the curve at the last control point.
  2721. * If the tangent is not given, it will be estimated.
  2722. */
  2723. export class CatmullRomSpline {
  2724. constructor(options: {
  2725. times: number[];
  2726. points: Cartesian3[];
  2727. firstTangent?: Cartesian3;
  2728. lastTangent?: Cartesian3;
  2729. });
  2730. /**
  2731. * An array of times for the control points.
  2732. */
  2733. readonly times: number[];
  2734. /**
  2735. * An array of {@link Cartesian3} control points.
  2736. */
  2737. readonly points: Cartesian3[];
  2738. /**
  2739. * The tangent at the first control point.
  2740. */
  2741. readonly firstTangent: Cartesian3;
  2742. /**
  2743. * The tangent at the last control point.
  2744. */
  2745. readonly lastTangent: Cartesian3;
  2746. /**
  2747. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  2748. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  2749. * @param time - The time.
  2750. * @returns The index for the element at the start of the interval.
  2751. */
  2752. findTimeInterval(time: number): number;
  2753. /**
  2754. * Wraps the given time to the period covered by the spline.
  2755. * @param time - The time.
  2756. * @returns The time, wrapped around to the updated animation.
  2757. */
  2758. wrapTime(time: number): number;
  2759. /**
  2760. * Clamps the given time to the period covered by the spline.
  2761. * @param time - The time.
  2762. * @returns The time, clamped to the animation period.
  2763. */
  2764. clampTime(time: number): number;
  2765. /**
  2766. * Evaluates the curve at a given time.
  2767. * @param time - The time at which to evaluate the curve.
  2768. * @param [result] - The object onto which to store the result.
  2769. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  2770. */
  2771. evaluate(time: number, result?: Cartesian3): Cartesian3;
  2772. }
  2773. /**
  2774. * A {@link TerrainProvider} that accesses terrain data in a Cesium terrain format.
  2775. * @example
  2776. * // Create Arctic DEM terrain with normals.
  2777. * const viewer = new Cesium.Viewer('cesiumContainer', {
  2778. * terrainProvider : new Cesium.CesiumTerrainProvider({
  2779. * url : Cesium.IonResource.fromAssetId(3956),
  2780. * requestVertexNormals : true
  2781. * })
  2782. * });
  2783. * @param options - Object with the following properties:
  2784. * @param options.url - The URL of the Cesium terrain server.
  2785. * @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.
  2786. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server, if available.
  2787. * @param [options.requestMetadata = true] - Flag that indicates if the client should request per tile metadata from the server, if available.
  2788. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  2789. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  2790. */
  2791. export class CesiumTerrainProvider {
  2792. constructor(options: {
  2793. url: Resource | string | Promise<Resource> | Promise<string>;
  2794. requestVertexNormals?: boolean;
  2795. requestWaterMask?: boolean;
  2796. requestMetadata?: boolean;
  2797. ellipsoid?: Ellipsoid;
  2798. credit?: Credit | string;
  2799. });
  2800. /**
  2801. * Requests the geometry for a given tile. This function should not be called before
  2802. * {@link CesiumTerrainProvider#ready} returns true. The result must include terrain data and
  2803. * may optionally include a water mask and an indication of which child tiles are available.
  2804. * @param x - The X coordinate of the tile for which to request geometry.
  2805. * @param y - The Y coordinate of the tile for which to request geometry.
  2806. * @param level - The level of the tile for which to request geometry.
  2807. * @param [request] - The request object. Intended for internal use only.
  2808. * @returns A promise for the requested geometry. If this method
  2809. * returns undefined instead of a promise, it is an indication that too many requests are already
  2810. * pending and the request will be retried later.
  2811. */
  2812. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  2813. /**
  2814. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  2815. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  2816. * are passed an instance of {@link TileProviderError}.
  2817. */
  2818. readonly errorEvent: Event;
  2819. /**
  2820. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  2821. * the source of the terrain. This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2822. */
  2823. readonly credit: Credit;
  2824. /**
  2825. * Gets the tiling scheme used by this provider. This function should
  2826. * not be called before {@link CesiumTerrainProvider#ready} returns true.
  2827. */
  2828. readonly tilingScheme: GeographicTilingScheme;
  2829. /**
  2830. * Gets a value indicating whether or not the provider is ready for use.
  2831. */
  2832. readonly ready: boolean;
  2833. /**
  2834. * Gets a promise that resolves to true when the provider is ready for use.
  2835. */
  2836. readonly readyPromise: Promise<boolean>;
  2837. /**
  2838. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  2839. * indicates which areas of the globe are water rather than land, so they can be rendered
  2840. * as a reflective surface with animated waves. This function should not be
  2841. * called before {@link CesiumTerrainProvider#ready} returns true.
  2842. */
  2843. readonly hasWaterMask: boolean;
  2844. /**
  2845. * Gets a value indicating whether or not the requested tiles include vertex normals.
  2846. * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2847. */
  2848. readonly hasVertexNormals: boolean;
  2849. /**
  2850. * Gets a value indicating whether or not the requested tiles include metadata.
  2851. * This function should not be called before {@link CesiumTerrainProvider#ready} returns true.
  2852. */
  2853. readonly hasMetadata: boolean;
  2854. /**
  2855. * Boolean flag that indicates if the client should request vertex normals from the server.
  2856. * Vertex normals data is appended to the standard tile mesh data only if the client requests the vertex normals and
  2857. * if the server provides vertex normals.
  2858. */
  2859. readonly requestVertexNormals: boolean;
  2860. /**
  2861. * Boolean flag that indicates if the client should request a watermask from the server.
  2862. * Watermask data is appended to the standard tile mesh data only if the client requests the watermask and
  2863. * if the server provides a watermask.
  2864. */
  2865. readonly requestWaterMask: boolean;
  2866. /**
  2867. * Boolean flag that indicates if the client should request metadata from the server.
  2868. * Metadata is appended to the standard tile mesh data only if the client requests the metadata and
  2869. * if the server provides a metadata.
  2870. */
  2871. readonly requestMetadata: boolean;
  2872. /**
  2873. * Gets an object that can be used to determine availability of terrain from this provider, such as
  2874. * at points and in rectangles. This function should not be called before
  2875. * {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability
  2876. * information is not available. Note that this reflects tiles that are known to be available currently.
  2877. * Additional tiles may be discovered to be available in the future, e.g. if availability information
  2878. * exists deeper in the tree rather than it all being discoverable at the root. However, a tile that
  2879. * is available now will not become unavailable in the future.
  2880. */
  2881. readonly availability: TileAvailability;
  2882. /**
  2883. * Gets the maximum geometric error allowed in a tile at a given level.
  2884. * @param level - The tile level for which to get the maximum geometric error.
  2885. * @returns The maximum geometric error.
  2886. */
  2887. getLevelMaximumGeometricError(level: number): number;
  2888. /**
  2889. * Determines whether data for a tile is available to be loaded.
  2890. * @param x - The X coordinate of the tile for which to request geometry.
  2891. * @param y - The Y coordinate of the tile for which to request geometry.
  2892. * @param level - The level of the tile for which to request geometry.
  2893. * @returns Undefined if not supported or availability is unknown, otherwise true or false.
  2894. */
  2895. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  2896. /**
  2897. * Makes sure we load availability data for a tile
  2898. * @param x - The X coordinate of the tile for which to request geometry.
  2899. * @param y - The Y coordinate of the tile for which to request geometry.
  2900. * @param level - The level of the tile for which to request geometry.
  2901. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  2902. */
  2903. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  2904. }
  2905. /**
  2906. * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  2907. * @example
  2908. * // Create a circle.
  2909. * const circle = new Cesium.CircleGeometry({
  2910. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2911. * radius : 100000.0
  2912. * });
  2913. * const geometry = Cesium.CircleGeometry.createGeometry(circle);
  2914. * @param options - Object with the following properties:
  2915. * @param options.center - The circle's center point in the fixed frame.
  2916. * @param options.radius - The radius in meters.
  2917. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2918. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2919. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2920. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  2921. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2922. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  2923. */
  2924. export class CircleGeometry {
  2925. constructor(options: {
  2926. center: Cartesian3;
  2927. radius: number;
  2928. ellipsoid?: Ellipsoid;
  2929. height?: number;
  2930. granularity?: number;
  2931. vertexFormat?: VertexFormat;
  2932. extrudedHeight?: number;
  2933. stRotation?: number;
  2934. });
  2935. /**
  2936. * The number of elements used to pack the object into an array.
  2937. */
  2938. static packedLength: number;
  2939. /**
  2940. * Stores the provided instance into the provided array.
  2941. * @param value - The value to pack.
  2942. * @param array - The array to pack into.
  2943. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2944. * @returns The array that was packed into
  2945. */
  2946. static pack(value: CircleGeometry, array: number[], startingIndex?: number): number[];
  2947. /**
  2948. * Retrieves an instance from a packed array.
  2949. * @param array - The packed array.
  2950. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  2951. * @param [result] - The object into which to store the result.
  2952. * @returns The modified result parameter or a new CircleGeometry instance if one was not provided.
  2953. */
  2954. static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): CircleGeometry;
  2955. /**
  2956. * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  2957. * @param circleGeometry - A description of the circle.
  2958. * @returns The computed vertices and indices.
  2959. */
  2960. static createGeometry(circleGeometry: CircleGeometry): Geometry | undefined;
  2961. }
  2962. /**
  2963. * A description of the outline of a circle on the ellipsoid.
  2964. * @example
  2965. * // Create a circle.
  2966. * const circle = new Cesium.CircleOutlineGeometry({
  2967. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  2968. * radius : 100000.0
  2969. * });
  2970. * const geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
  2971. * @param options - Object with the following properties:
  2972. * @param options.center - The circle's center point in the fixed frame.
  2973. * @param options.radius - The radius in meters.
  2974. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the circle will be on.
  2975. * @param [options.height = 0.0] - The distance in meters between the circle and the ellipsoid surface.
  2976. * @param [options.granularity = 0.02] - The angular distance between points on the circle in radians.
  2977. * @param [options.extrudedHeight = 0.0] - The distance in meters between the circle's extruded face and the ellipsoid surface.
  2978. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom of an extruded circle.
  2979. */
  2980. export class CircleOutlineGeometry {
  2981. constructor(options: {
  2982. center: Cartesian3;
  2983. radius: number;
  2984. ellipsoid?: Ellipsoid;
  2985. height?: number;
  2986. granularity?: number;
  2987. extrudedHeight?: number;
  2988. numberOfVerticalLines?: number;
  2989. });
  2990. /**
  2991. * The number of elements used to pack the object into an array.
  2992. */
  2993. static packedLength: number;
  2994. /**
  2995. * Stores the provided instance into the provided array.
  2996. * @param value - The value to pack.
  2997. * @param array - The array to pack into.
  2998. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  2999. * @returns The array that was packed into
  3000. */
  3001. static pack(value: CircleOutlineGeometry, array: number[], startingIndex?: number): number[];
  3002. /**
  3003. * Retrieves an instance from a packed array.
  3004. * @param array - The packed array.
  3005. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  3006. * @param [result] - The object into which to store the result.
  3007. * @returns The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
  3008. */
  3009. static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): CircleOutlineGeometry;
  3010. /**
  3011. * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
  3012. * @param circleGeometry - A description of the circle.
  3013. * @returns The computed vertices and indices.
  3014. */
  3015. static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry | undefined;
  3016. }
  3017. /**
  3018. * A simple clock for keeping track of simulated time.
  3019. * @example
  3020. * // Create a clock that loops on Christmas day 2013 and runs in real-time.
  3021. * const clock = new Cesium.Clock({
  3022. * startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  3023. * currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
  3024. * stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
  3025. * clockRange : Cesium.ClockRange.LOOP_STOP,
  3026. * clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
  3027. * });
  3028. * @param [options] - Object with the following properties:
  3029. * @param [options.startTime] - The start time of the clock.
  3030. * @param [options.stopTime] - The stop time of the clock.
  3031. * @param [options.currentTime] - The current time.
  3032. * @param [options.multiplier = 1.0] - Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.
  3033. * @param [options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER] - Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  3034. * @param [options.clockRange = ClockRange.UNBOUNDED] - Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  3035. * @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.
  3036. * @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.
  3037. */
  3038. export class Clock {
  3039. constructor(options?: {
  3040. startTime?: JulianDate;
  3041. stopTime?: JulianDate;
  3042. currentTime?: JulianDate;
  3043. multiplier?: number;
  3044. clockStep?: ClockStep;
  3045. clockRange?: ClockRange;
  3046. canAnimate?: boolean;
  3047. shouldAnimate?: boolean;
  3048. });
  3049. /**
  3050. * The start time of the clock.
  3051. */
  3052. startTime: JulianDate;
  3053. /**
  3054. * The stop time of the clock.
  3055. */
  3056. stopTime: JulianDate;
  3057. /**
  3058. * Determines how the clock should behave when
  3059. * {@link Clock#startTime} or {@link Clock#stopTime}
  3060. * is reached.
  3061. */
  3062. clockRange: ClockRange;
  3063. /**
  3064. * Indicates whether {@link Clock#tick} can advance time. This could be false if data is being buffered,
  3065. * for example. The clock will only advance time when both
  3066. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3067. */
  3068. canAnimate: boolean;
  3069. /**
  3070. * An {@link Event} that is fired whenever {@link Clock#tick} is called.
  3071. */
  3072. onTick: Event;
  3073. /**
  3074. * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.
  3075. */
  3076. onStop: Event;
  3077. /**
  3078. * The current time.
  3079. * Changing this property will change
  3080. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3081. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3082. */
  3083. currentTime: JulianDate;
  3084. /**
  3085. * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.
  3086. * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.
  3087. * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the
  3088. * elapsed system time since the last call to {@link Clock#tick}.
  3089. * Changing this property will change
  3090. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3091. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3092. */
  3093. multiplier: number;
  3094. /**
  3095. * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
  3096. * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set
  3097. * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and
  3098. * {@link Clock#currentTime} to the current system clock time.
  3099. */
  3100. clockStep: ClockStep;
  3101. /**
  3102. * Indicates whether {@link Clock#tick} should attempt to advance time.
  3103. * The clock will only advance time when both
  3104. * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
  3105. * Changing this property will change
  3106. * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
  3107. * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
  3108. */
  3109. shouldAnimate: boolean;
  3110. /**
  3111. * Advances the clock from the current time based on the current configuration options.
  3112. * tick should be called every frame, regardless of whether animation is taking place
  3113. * or not. To control animation, use the {@link Clock#shouldAnimate} property.
  3114. * @returns The new value of the {@link Clock#currentTime} property.
  3115. */
  3116. tick(): JulianDate;
  3117. }
  3118. /**
  3119. * Constants used by {@link Clock#tick} to determine behavior
  3120. * when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
  3121. */
  3122. export enum ClockRange {
  3123. /**
  3124. * {@link Clock#tick} will always advances the clock in its current direction.
  3125. */
  3126. UNBOUNDED = 0,
  3127. /**
  3128. * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,
  3129. * {@link Clock#tick} will not advance {@link Clock#currentTime} any further.
  3130. */
  3131. CLAMPED = 1,
  3132. /**
  3133. * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance
  3134. * {@link Clock#currentTime} to the opposite end of the interval. When
  3135. * time is moving backwards, {@link Clock#tick} will not advance past
  3136. * {@link Clock#startTime}
  3137. */
  3138. LOOP_STOP = 2
  3139. }
  3140. /**
  3141. * Constants to determine how much time advances with each call
  3142. * to {@link Clock#tick}.
  3143. */
  3144. export enum ClockStep {
  3145. /**
  3146. * {@link Clock#tick} advances the current time by a fixed step,
  3147. * which is the number of seconds specified by {@link Clock#multiplier}.
  3148. */
  3149. TICK_DEPENDENT = 0,
  3150. /**
  3151. * {@link Clock#tick} advances the current time by the amount of system
  3152. * time elapsed since the previous call multiplied by {@link Clock#multiplier}.
  3153. */
  3154. SYSTEM_CLOCK_MULTIPLIER = 1,
  3155. /**
  3156. * {@link Clock#tick} sets the clock to the current system time;
  3157. * ignoring all other settings.
  3158. */
  3159. SYSTEM_CLOCK = 2
  3160. }
  3161. /**
  3162. * A color, specified using red, green, blue, and alpha values,
  3163. * which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).
  3164. * @param [red = 1.0] - The red component.
  3165. * @param [green = 1.0] - The green component.
  3166. * @param [blue = 1.0] - The blue component.
  3167. * @param [alpha = 1.0] - The alpha component.
  3168. */
  3169. export class Color {
  3170. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  3171. /**
  3172. * The red component.
  3173. */
  3174. red: number;
  3175. /**
  3176. * The green component.
  3177. */
  3178. green: number;
  3179. /**
  3180. * The blue component.
  3181. */
  3182. blue: number;
  3183. /**
  3184. * The alpha component.
  3185. */
  3186. alpha: number;
  3187. /**
  3188. * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,
  3189. * and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.
  3190. * @param cartesian - The source cartesian.
  3191. * @param [result] - The object onto which to store the result.
  3192. * @returns The modified result parameter or a new Color instance if one was not provided.
  3193. */
  3194. static fromCartesian4(cartesian: Cartesian4, result?: Color): Color;
  3195. /**
  3196. * Creates a new Color specified using red, green, blue, and alpha values
  3197. * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
  3198. * @param [red = 255] - The red component.
  3199. * @param [green = 255] - The green component.
  3200. * @param [blue = 255] - The blue component.
  3201. * @param [alpha = 255] - The alpha component.
  3202. * @param [result] - The object onto which to store the result.
  3203. * @returns The modified result parameter or a new Color instance if one was not provided.
  3204. */
  3205. static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color;
  3206. /**
  3207. * Creates a new Color that has the same red, green, and blue components
  3208. * of the specified color, but with the specified alpha value.
  3209. * @example
  3210. * const translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
  3211. * @param color - The base color
  3212. * @param alpha - The new alpha component.
  3213. * @param [result] - The object onto which to store the result.
  3214. * @returns The modified result parameter or a new Color instance if one was not provided.
  3215. */
  3216. static fromAlpha(color: Color, alpha: number, result?: Color): Color;
  3217. /**
  3218. * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
  3219. * of the system.
  3220. * @example
  3221. * const color = Cesium.Color.fromRgba(0x67ADDFFF);
  3222. * @param rgba - A single numeric unsigned 32-bit RGBA value.
  3223. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3224. * @returns The color object.
  3225. */
  3226. static fromRgba(rgba: number, result?: Color): Color;
  3227. /**
  3228. * Creates a Color instance from hue, saturation, and lightness.
  3229. * @param [hue = 0] - The hue angle 0...1
  3230. * @param [saturation = 0] - The saturation value 0...1
  3231. * @param [lightness = 0] - The lightness value 0...1
  3232. * @param [alpha = 1.0] - The alpha component 0...1
  3233. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3234. * @returns The color object.
  3235. */
  3236. static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number, result?: Color): Color;
  3237. /**
  3238. * Creates a random color using the provided options. For reproducible random colors, you should
  3239. * call {@link Math#setRandomNumberSeed} once at the beginning of your application.
  3240. * @example
  3241. * //Create a completely random color
  3242. * const color = Cesium.Color.fromRandom();
  3243. *
  3244. * //Create a random shade of yellow.
  3245. * const color1 = Cesium.Color.fromRandom({
  3246. * red : 1.0,
  3247. * green : 1.0,
  3248. * alpha : 1.0
  3249. * });
  3250. *
  3251. * //Create a random bright color.
  3252. * const color2 = Cesium.Color.fromRandom({
  3253. * minimumRed : 0.75,
  3254. * minimumGreen : 0.75,
  3255. * minimumBlue : 0.75,
  3256. * alpha : 1.0
  3257. * });
  3258. * @param [options] - Object with the following properties:
  3259. * @param [options.red] - If specified, the red component to use instead of a randomized value.
  3260. * @param [options.minimumRed = 0.0] - The maximum red value to generate if none was specified.
  3261. * @param [options.maximumRed = 1.0] - The minimum red value to generate if none was specified.
  3262. * @param [options.green] - If specified, the green component to use instead of a randomized value.
  3263. * @param [options.minimumGreen = 0.0] - The maximum green value to generate if none was specified.
  3264. * @param [options.maximumGreen = 1.0] - The minimum green value to generate if none was specified.
  3265. * @param [options.blue] - If specified, the blue component to use instead of a randomized value.
  3266. * @param [options.minimumBlue = 0.0] - The maximum blue value to generate if none was specified.
  3267. * @param [options.maximumBlue = 1.0] - The minimum blue value to generate if none was specified.
  3268. * @param [options.alpha] - If specified, the alpha component to use instead of a randomized value.
  3269. * @param [options.minimumAlpha = 0.0] - The maximum alpha value to generate if none was specified.
  3270. * @param [options.maximumAlpha = 1.0] - The minimum alpha value to generate if none was specified.
  3271. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3272. * @returns The modified result parameter or a new instance if result was undefined.
  3273. */
  3274. static fromRandom(options?: {
  3275. red?: number;
  3276. minimumRed?: number;
  3277. maximumRed?: number;
  3278. green?: number;
  3279. minimumGreen?: number;
  3280. maximumGreen?: number;
  3281. blue?: number;
  3282. minimumBlue?: number;
  3283. maximumBlue?: number;
  3284. alpha?: number;
  3285. minimumAlpha?: number;
  3286. maximumAlpha?: number;
  3287. }, result?: Color): Color;
  3288. /**
  3289. * Creates a Color instance from a CSS color value.
  3290. * @example
  3291. * const cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
  3292. * const green = Cesium.Color.fromCssColorString('green');
  3293. * @param color - The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.
  3294. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3295. * @returns The color object, or undefined if the string was not a valid CSS color.
  3296. */
  3297. static fromCssColorString(color: string, result?: Color): Color;
  3298. /**
  3299. * The number of elements used to pack the object into an array.
  3300. */
  3301. static packedLength: number;
  3302. /**
  3303. * Stores the provided instance into the provided array.
  3304. * @param value - The value to pack.
  3305. * @param array - The array to pack into.
  3306. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  3307. * @returns The array that was packed into
  3308. */
  3309. static pack(value: Color, array: number[], startingIndex?: number): number[];
  3310. /**
  3311. * Retrieves an instance from a packed array.
  3312. * @param array - The packed array.
  3313. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  3314. * @param [result] - The object into which to store the result.
  3315. * @returns The modified result parameter or a new Color instance if one was not provided.
  3316. */
  3317. static unpack(array: number[], startingIndex?: number, result?: Color): Color;
  3318. /**
  3319. * Converts a 'byte' color component in the range of 0 to 255 into
  3320. * a 'float' color component in the range of 0 to 1.0.
  3321. * @param number - The number to be converted.
  3322. * @returns The converted number.
  3323. */
  3324. static byteToFloat(number: number): number;
  3325. /**
  3326. * Converts a 'float' color component in the range of 0 to 1.0 into
  3327. * a 'byte' color component in the range of 0 to 255.
  3328. * @param number - The number to be converted.
  3329. * @returns The converted number.
  3330. */
  3331. static floatToByte(number: number): number;
  3332. /**
  3333. * Duplicates a Color.
  3334. * @param color - The Color to duplicate.
  3335. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3336. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
  3337. */
  3338. static clone(color: Color, result?: Color): Color;
  3339. /**
  3340. * Returns true if the first Color equals the second color.
  3341. * @param left - The first Color to compare for equality.
  3342. * @param right - The second Color to compare for equality.
  3343. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3344. */
  3345. static equals(left: Color, right: Color): boolean;
  3346. /**
  3347. * Returns a duplicate of a Color instance.
  3348. * @param [result] - The object to store the result in, if undefined a new instance will be created.
  3349. * @returns The modified result parameter or a new instance if result was undefined.
  3350. */
  3351. clone(result?: Color): Color;
  3352. /**
  3353. * Returns true if this Color equals other.
  3354. * @param other - The Color to compare for equality.
  3355. * @returns <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  3356. */
  3357. equals(other: Color): boolean;
  3358. /**
  3359. * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.
  3360. * @param other - The Color to compare for equality.
  3361. * @param [epsilon = 0.0] - The epsilon to use for equality testing.
  3362. * @returns <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.
  3363. */
  3364. equalsEpsilon(other: Color, epsilon?: number): boolean;
  3365. /**
  3366. * Creates a string representing this Color in the format '(red, green, blue, alpha)'.
  3367. * @returns A string representing this Color in the format '(red, green, blue, alpha)'.
  3368. */
  3369. toString(): string;
  3370. /**
  3371. * Creates a string containing the CSS color value for this color.
  3372. * @returns The CSS equivalent of this color.
  3373. */
  3374. toCssColorString(): string;
  3375. /**
  3376. * Creates a string containing CSS hex string color value for this color.
  3377. * @returns The CSS hex string equivalent of this color.
  3378. */
  3379. toCssHexString(): string;
  3380. /**
  3381. * Converts this color to an array of red, green, blue, and alpha values
  3382. * that are in the range of 0 to 255.
  3383. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  3384. * @returns The modified result parameter or a new instance if result was undefined.
  3385. */
  3386. toBytes(result?: number[]): number[];
  3387. /**
  3388. * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
  3389. * of the system.
  3390. * @example
  3391. * const rgba = Cesium.Color.BLUE.toRgba();
  3392. * @returns A single numeric unsigned 32-bit RGBA value.
  3393. */
  3394. toRgba(): number;
  3395. /**
  3396. * Brightens this color by the provided magnitude.
  3397. * @example
  3398. * const brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
  3399. * @param magnitude - A positive number indicating the amount to brighten.
  3400. * @param result - The object onto which to store the result.
  3401. * @returns The modified result parameter.
  3402. */
  3403. brighten(magnitude: number, result: Color): Color;
  3404. /**
  3405. * Darkens this color by the provided magnitude.
  3406. * @example
  3407. * const darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
  3408. * @param magnitude - A positive number indicating the amount to darken.
  3409. * @param result - The object onto which to store the result.
  3410. * @returns The modified result parameter.
  3411. */
  3412. darken(magnitude: number, result: Color): Color;
  3413. /**
  3414. * Creates a new Color that has the same red, green, and blue components
  3415. * as this Color, but with the specified alpha value.
  3416. * @example
  3417. * const translucentRed = Cesium.Color.RED.withAlpha(0.9);
  3418. * @param alpha - The new alpha component.
  3419. * @param [result] - The object onto which to store the result.
  3420. * @returns The modified result parameter or a new Color instance if one was not provided.
  3421. */
  3422. withAlpha(alpha: number, result?: Color): Color;
  3423. /**
  3424. * Computes the componentwise sum of two Colors.
  3425. * @param left - The first Color.
  3426. * @param right - The second Color.
  3427. * @param result - The object onto which to store the result.
  3428. * @returns The modified result parameter.
  3429. */
  3430. static add(left: Color, right: Color, result: Color): Color;
  3431. /**
  3432. * Computes the componentwise difference of two Colors.
  3433. * @param left - The first Color.
  3434. * @param right - The second Color.
  3435. * @param result - The object onto which to store the result.
  3436. * @returns The modified result parameter.
  3437. */
  3438. static subtract(left: Color, right: Color, result: Color): Color;
  3439. /**
  3440. * Computes the componentwise product of two Colors.
  3441. * @param left - The first Color.
  3442. * @param right - The second Color.
  3443. * @param result - The object onto which to store the result.
  3444. * @returns The modified result parameter.
  3445. */
  3446. static multiply(left: Color, right: Color, result: Color): Color;
  3447. /**
  3448. * Computes the componentwise quotient of two Colors.
  3449. * @param left - The first Color.
  3450. * @param right - The second Color.
  3451. * @param result - The object onto which to store the result.
  3452. * @returns The modified result parameter.
  3453. */
  3454. static divide(left: Color, right: Color, result: Color): Color;
  3455. /**
  3456. * Computes the componentwise modulus of two Colors.
  3457. * @param left - The first Color.
  3458. * @param right - The second Color.
  3459. * @param result - The object onto which to store the result.
  3460. * @returns The modified result parameter.
  3461. */
  3462. static mod(left: Color, right: Color, result: Color): Color;
  3463. /**
  3464. * Computes the linear interpolation or extrapolation at t between the provided colors.
  3465. * @param start - The color corresponding to t at 0.0.
  3466. * @param end - The color corresponding to t at 1.0.
  3467. * @param t - The point along t at which to interpolate.
  3468. * @param result - The object onto which to store the result.
  3469. * @returns The modified result parameter.
  3470. */
  3471. static lerp(start: Color, end: Color, t: number, result: Color): Color;
  3472. /**
  3473. * Multiplies the provided Color componentwise by the provided scalar.
  3474. * @param color - The Color to be scaled.
  3475. * @param scalar - The scalar to multiply with.
  3476. * @param result - The object onto which to store the result.
  3477. * @returns The modified result parameter.
  3478. */
  3479. static multiplyByScalar(color: Color, scalar: number, result: Color): Color;
  3480. /**
  3481. * Divides the provided Color componentwise by the provided scalar.
  3482. * @param color - The Color to be divided.
  3483. * @param scalar - The scalar to divide with.
  3484. * @param result - The object onto which to store the result.
  3485. * @returns The modified result parameter.
  3486. */
  3487. static divideByScalar(color: Color, scalar: number, result: Color): Color;
  3488. /**
  3489. * An immutable Color instance initialized to CSS color #F0F8FF
  3490. * <span class="colorSwath" style="background: #F0F8FF;"></span>
  3491. */
  3492. static readonly ALICEBLUE: Color;
  3493. /**
  3494. * An immutable Color instance initialized to CSS color #FAEBD7
  3495. * <span class="colorSwath" style="background: #FAEBD7;"></span>
  3496. */
  3497. static readonly ANTIQUEWHITE: Color;
  3498. /**
  3499. * An immutable Color instance initialized to CSS color #00FFFF
  3500. * <span class="colorSwath" style="background: #00FFFF;"></span>
  3501. */
  3502. static readonly AQUA: Color;
  3503. /**
  3504. * An immutable Color instance initialized to CSS color #7FFFD4
  3505. * <span class="colorSwath" style="background: #7FFFD4;"></span>
  3506. */
  3507. static readonly AQUAMARINE: Color;
  3508. /**
  3509. * An immutable Color instance initialized to CSS color #F0FFFF
  3510. * <span class="colorSwath" style="background: #F0FFFF;"></span>
  3511. */
  3512. static readonly AZURE: Color;
  3513. /**
  3514. * An immutable Color instance initialized to CSS color #F5F5DC
  3515. * <span class="colorSwath" style="background: #F5F5DC;"></span>
  3516. */
  3517. static readonly BEIGE: Color;
  3518. /**
  3519. * An immutable Color instance initialized to CSS color #FFE4C4
  3520. * <span class="colorSwath" style="background: #FFE4C4;"></span>
  3521. */
  3522. static readonly BISQUE: Color;
  3523. /**
  3524. * An immutable Color instance initialized to CSS color #000000
  3525. * <span class="colorSwath" style="background: #000000;"></span>
  3526. */
  3527. static readonly BLACK: Color;
  3528. /**
  3529. * An immutable Color instance initialized to CSS color #FFEBCD
  3530. * <span class="colorSwath" style="background: #FFEBCD;"></span>
  3531. */
  3532. static readonly BLANCHEDALMOND: Color;
  3533. /**
  3534. * An immutable Color instance initialized to CSS color #0000FF
  3535. * <span class="colorSwath" style="background: #0000FF;"></span>
  3536. */
  3537. static readonly BLUE: Color;
  3538. /**
  3539. * An immutable Color instance initialized to CSS color #8A2BE2
  3540. * <span class="colorSwath" style="background: #8A2BE2;"></span>
  3541. */
  3542. static readonly BLUEVIOLET: Color;
  3543. /**
  3544. * An immutable Color instance initialized to CSS color #A52A2A
  3545. * <span class="colorSwath" style="background: #A52A2A;"></span>
  3546. */
  3547. static readonly BROWN: Color;
  3548. /**
  3549. * An immutable Color instance initialized to CSS color #DEB887
  3550. * <span class="colorSwath" style="background: #DEB887;"></span>
  3551. */
  3552. static readonly BURLYWOOD: Color;
  3553. /**
  3554. * An immutable Color instance initialized to CSS color #5F9EA0
  3555. * <span class="colorSwath" style="background: #5F9EA0;"></span>
  3556. */
  3557. static readonly CADETBLUE: Color;
  3558. /**
  3559. * An immutable Color instance initialized to CSS color #7FFF00
  3560. * <span class="colorSwath" style="background: #7FFF00;"></span>
  3561. */
  3562. static readonly CHARTREUSE: Color;
  3563. /**
  3564. * An immutable Color instance initialized to CSS color #D2691E
  3565. * <span class="colorSwath" style="background: #D2691E;"></span>
  3566. */
  3567. static readonly CHOCOLATE: Color;
  3568. /**
  3569. * An immutable Color instance initialized to CSS color #FF7F50
  3570. * <span class="colorSwath" style="background: #FF7F50;"></span>
  3571. */
  3572. static readonly CORAL: Color;
  3573. /**
  3574. * An immutable Color instance initialized to CSS color #6495ED
  3575. * <span class="colorSwath" style="background: #6495ED;"></span>
  3576. */
  3577. static readonly CORNFLOWERBLUE: Color;
  3578. /**
  3579. * An immutable Color instance initialized to CSS color #FFF8DC
  3580. * <span class="colorSwath" style="background: #FFF8DC;"></span>
  3581. */
  3582. static readonly CORNSILK: Color;
  3583. /**
  3584. * An immutable Color instance initialized to CSS color #DC143C
  3585. * <span class="colorSwath" style="background: #DC143C;"></span>
  3586. */
  3587. static readonly CRIMSON: Color;
  3588. /**
  3589. * An immutable Color instance initialized to CSS color #00FFFF
  3590. * <span class="colorSwath" style="background: #00FFFF;"></span>
  3591. */
  3592. static readonly CYAN: Color;
  3593. /**
  3594. * An immutable Color instance initialized to CSS color #00008B
  3595. * <span class="colorSwath" style="background: #00008B;"></span>
  3596. */
  3597. static readonly DARKBLUE: Color;
  3598. /**
  3599. * An immutable Color instance initialized to CSS color #008B8B
  3600. * <span class="colorSwath" style="background: #008B8B;"></span>
  3601. */
  3602. static readonly DARKCYAN: Color;
  3603. /**
  3604. * An immutable Color instance initialized to CSS color #B8860B
  3605. * <span class="colorSwath" style="background: #B8860B;"></span>
  3606. */
  3607. static readonly DARKGOLDENROD: Color;
  3608. /**
  3609. * An immutable Color instance initialized to CSS color #A9A9A9
  3610. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3611. */
  3612. static readonly DARKGRAY: Color;
  3613. /**
  3614. * An immutable Color instance initialized to CSS color #006400
  3615. * <span class="colorSwath" style="background: #006400;"></span>
  3616. */
  3617. static readonly DARKGREEN: Color;
  3618. /**
  3619. * An immutable Color instance initialized to CSS color #A9A9A9
  3620. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  3621. */
  3622. static readonly DARKGREY: Color;
  3623. /**
  3624. * An immutable Color instance initialized to CSS color #BDB76B
  3625. * <span class="colorSwath" style="background: #BDB76B;"></span>
  3626. */
  3627. static readonly DARKKHAKI: Color;
  3628. /**
  3629. * An immutable Color instance initialized to CSS color #8B008B
  3630. * <span class="colorSwath" style="background: #8B008B;"></span>
  3631. */
  3632. static readonly DARKMAGENTA: Color;
  3633. /**
  3634. * An immutable Color instance initialized to CSS color #556B2F
  3635. * <span class="colorSwath" style="background: #556B2F;"></span>
  3636. */
  3637. static readonly DARKOLIVEGREEN: Color;
  3638. /**
  3639. * An immutable Color instance initialized to CSS color #FF8C00
  3640. * <span class="colorSwath" style="background: #FF8C00;"></span>
  3641. */
  3642. static readonly DARKORANGE: Color;
  3643. /**
  3644. * An immutable Color instance initialized to CSS color #9932CC
  3645. * <span class="colorSwath" style="background: #9932CC;"></span>
  3646. */
  3647. static readonly DARKORCHID: Color;
  3648. /**
  3649. * An immutable Color instance initialized to CSS color #8B0000
  3650. * <span class="colorSwath" style="background: #8B0000;"></span>
  3651. */
  3652. static readonly DARKRED: Color;
  3653. /**
  3654. * An immutable Color instance initialized to CSS color #E9967A
  3655. * <span class="colorSwath" style="background: #E9967A;"></span>
  3656. */
  3657. static readonly DARKSALMON: Color;
  3658. /**
  3659. * An immutable Color instance initialized to CSS color #8FBC8F
  3660. * <span class="colorSwath" style="background: #8FBC8F;"></span>
  3661. */
  3662. static readonly DARKSEAGREEN: Color;
  3663. /**
  3664. * An immutable Color instance initialized to CSS color #483D8B
  3665. * <span class="colorSwath" style="background: #483D8B;"></span>
  3666. */
  3667. static readonly DARKSLATEBLUE: Color;
  3668. /**
  3669. * An immutable Color instance initialized to CSS color #2F4F4F
  3670. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3671. */
  3672. static readonly DARKSLATEGRAY: Color;
  3673. /**
  3674. * An immutable Color instance initialized to CSS color #2F4F4F
  3675. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  3676. */
  3677. static readonly DARKSLATEGREY: Color;
  3678. /**
  3679. * An immutable Color instance initialized to CSS color #00CED1
  3680. * <span class="colorSwath" style="background: #00CED1;"></span>
  3681. */
  3682. static readonly DARKTURQUOISE: Color;
  3683. /**
  3684. * An immutable Color instance initialized to CSS color #9400D3
  3685. * <span class="colorSwath" style="background: #9400D3;"></span>
  3686. */
  3687. static readonly DARKVIOLET: Color;
  3688. /**
  3689. * An immutable Color instance initialized to CSS color #FF1493
  3690. * <span class="colorSwath" style="background: #FF1493;"></span>
  3691. */
  3692. static readonly DEEPPINK: Color;
  3693. /**
  3694. * An immutable Color instance initialized to CSS color #00BFFF
  3695. * <span class="colorSwath" style="background: #00BFFF;"></span>
  3696. */
  3697. static readonly DEEPSKYBLUE: Color;
  3698. /**
  3699. * An immutable Color instance initialized to CSS color #696969
  3700. * <span class="colorSwath" style="background: #696969;"></span>
  3701. */
  3702. static readonly DIMGRAY: Color;
  3703. /**
  3704. * An immutable Color instance initialized to CSS color #696969
  3705. * <span class="colorSwath" style="background: #696969;"></span>
  3706. */
  3707. static readonly DIMGREY: Color;
  3708. /**
  3709. * An immutable Color instance initialized to CSS color #1E90FF
  3710. * <span class="colorSwath" style="background: #1E90FF;"></span>
  3711. */
  3712. static readonly DODGERBLUE: Color;
  3713. /**
  3714. * An immutable Color instance initialized to CSS color #B22222
  3715. * <span class="colorSwath" style="background: #B22222;"></span>
  3716. */
  3717. static readonly FIREBRICK: Color;
  3718. /**
  3719. * An immutable Color instance initialized to CSS color #FFFAF0
  3720. * <span class="colorSwath" style="background: #FFFAF0;"></span>
  3721. */
  3722. static readonly FLORALWHITE: Color;
  3723. /**
  3724. * An immutable Color instance initialized to CSS color #228B22
  3725. * <span class="colorSwath" style="background: #228B22;"></span>
  3726. */
  3727. static readonly FORESTGREEN: Color;
  3728. /**
  3729. * An immutable Color instance initialized to CSS color #FF00FF
  3730. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3731. */
  3732. static readonly FUCHSIA: Color;
  3733. /**
  3734. * An immutable Color instance initialized to CSS color #DCDCDC
  3735. * <span class="colorSwath" style="background: #DCDCDC;"></span>
  3736. */
  3737. static readonly GAINSBORO: Color;
  3738. /**
  3739. * An immutable Color instance initialized to CSS color #F8F8FF
  3740. * <span class="colorSwath" style="background: #F8F8FF;"></span>
  3741. */
  3742. static readonly GHOSTWHITE: Color;
  3743. /**
  3744. * An immutable Color instance initialized to CSS color #FFD700
  3745. * <span class="colorSwath" style="background: #FFD700;"></span>
  3746. */
  3747. static readonly GOLD: Color;
  3748. /**
  3749. * An immutable Color instance initialized to CSS color #DAA520
  3750. * <span class="colorSwath" style="background: #DAA520;"></span>
  3751. */
  3752. static readonly GOLDENROD: Color;
  3753. /**
  3754. * An immutable Color instance initialized to CSS color #808080
  3755. * <span class="colorSwath" style="background: #808080;"></span>
  3756. */
  3757. static readonly GRAY: Color;
  3758. /**
  3759. * An immutable Color instance initialized to CSS color #008000
  3760. * <span class="colorSwath" style="background: #008000;"></span>
  3761. */
  3762. static readonly GREEN: Color;
  3763. /**
  3764. * An immutable Color instance initialized to CSS color #ADFF2F
  3765. * <span class="colorSwath" style="background: #ADFF2F;"></span>
  3766. */
  3767. static readonly GREENYELLOW: Color;
  3768. /**
  3769. * An immutable Color instance initialized to CSS color #808080
  3770. * <span class="colorSwath" style="background: #808080;"></span>
  3771. */
  3772. static readonly GREY: Color;
  3773. /**
  3774. * An immutable Color instance initialized to CSS color #F0FFF0
  3775. * <span class="colorSwath" style="background: #F0FFF0;"></span>
  3776. */
  3777. static readonly HONEYDEW: Color;
  3778. /**
  3779. * An immutable Color instance initialized to CSS color #FF69B4
  3780. * <span class="colorSwath" style="background: #FF69B4;"></span>
  3781. */
  3782. static readonly HOTPINK: Color;
  3783. /**
  3784. * An immutable Color instance initialized to CSS color #CD5C5C
  3785. * <span class="colorSwath" style="background: #CD5C5C;"></span>
  3786. */
  3787. static readonly INDIANRED: Color;
  3788. /**
  3789. * An immutable Color instance initialized to CSS color #4B0082
  3790. * <span class="colorSwath" style="background: #4B0082;"></span>
  3791. */
  3792. static readonly INDIGO: Color;
  3793. /**
  3794. * An immutable Color instance initialized to CSS color #FFFFF0
  3795. * <span class="colorSwath" style="background: #FFFFF0;"></span>
  3796. */
  3797. static readonly IVORY: Color;
  3798. /**
  3799. * An immutable Color instance initialized to CSS color #F0E68C
  3800. * <span class="colorSwath" style="background: #F0E68C;"></span>
  3801. */
  3802. static readonly KHAKI: Color;
  3803. /**
  3804. * An immutable Color instance initialized to CSS color #E6E6FA
  3805. * <span class="colorSwath" style="background: #E6E6FA;"></span>
  3806. */
  3807. static readonly LAVENDER: Color;
  3808. /**
  3809. * An immutable Color instance initialized to CSS color #FFF0F5
  3810. * <span class="colorSwath" style="background: #FFF0F5;"></span>
  3811. */
  3812. static readonly LAVENDAR_BLUSH: Color;
  3813. /**
  3814. * An immutable Color instance initialized to CSS color #7CFC00
  3815. * <span class="colorSwath" style="background: #7CFC00;"></span>
  3816. */
  3817. static readonly LAWNGREEN: Color;
  3818. /**
  3819. * An immutable Color instance initialized to CSS color #FFFACD
  3820. * <span class="colorSwath" style="background: #FFFACD;"></span>
  3821. */
  3822. static readonly LEMONCHIFFON: Color;
  3823. /**
  3824. * An immutable Color instance initialized to CSS color #ADD8E6
  3825. * <span class="colorSwath" style="background: #ADD8E6;"></span>
  3826. */
  3827. static readonly LIGHTBLUE: Color;
  3828. /**
  3829. * An immutable Color instance initialized to CSS color #F08080
  3830. * <span class="colorSwath" style="background: #F08080;"></span>
  3831. */
  3832. static readonly LIGHTCORAL: Color;
  3833. /**
  3834. * An immutable Color instance initialized to CSS color #E0FFFF
  3835. * <span class="colorSwath" style="background: #E0FFFF;"></span>
  3836. */
  3837. static readonly LIGHTCYAN: Color;
  3838. /**
  3839. * An immutable Color instance initialized to CSS color #FAFAD2
  3840. * <span class="colorSwath" style="background: #FAFAD2;"></span>
  3841. */
  3842. static readonly LIGHTGOLDENRODYELLOW: Color;
  3843. /**
  3844. * An immutable Color instance initialized to CSS color #D3D3D3
  3845. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3846. */
  3847. static readonly LIGHTGRAY: Color;
  3848. /**
  3849. * An immutable Color instance initialized to CSS color #90EE90
  3850. * <span class="colorSwath" style="background: #90EE90;"></span>
  3851. */
  3852. static readonly LIGHTGREEN: Color;
  3853. /**
  3854. * An immutable Color instance initialized to CSS color #D3D3D3
  3855. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  3856. */
  3857. static readonly LIGHTGREY: Color;
  3858. /**
  3859. * An immutable Color instance initialized to CSS color #FFB6C1
  3860. * <span class="colorSwath" style="background: #FFB6C1;"></span>
  3861. */
  3862. static readonly LIGHTPINK: Color;
  3863. /**
  3864. * An immutable Color instance initialized to CSS color #20B2AA
  3865. * <span class="colorSwath" style="background: #20B2AA;"></span>
  3866. */
  3867. static readonly LIGHTSEAGREEN: Color;
  3868. /**
  3869. * An immutable Color instance initialized to CSS color #87CEFA
  3870. * <span class="colorSwath" style="background: #87CEFA;"></span>
  3871. */
  3872. static readonly LIGHTSKYBLUE: Color;
  3873. /**
  3874. * An immutable Color instance initialized to CSS color #778899
  3875. * <span class="colorSwath" style="background: #778899;"></span>
  3876. */
  3877. static readonly LIGHTSLATEGRAY: Color;
  3878. /**
  3879. * An immutable Color instance initialized to CSS color #778899
  3880. * <span class="colorSwath" style="background: #778899;"></span>
  3881. */
  3882. static readonly LIGHTSLATEGREY: Color;
  3883. /**
  3884. * An immutable Color instance initialized to CSS color #B0C4DE
  3885. * <span class="colorSwath" style="background: #B0C4DE;"></span>
  3886. */
  3887. static readonly LIGHTSTEELBLUE: Color;
  3888. /**
  3889. * An immutable Color instance initialized to CSS color #FFFFE0
  3890. * <span class="colorSwath" style="background: #FFFFE0;"></span>
  3891. */
  3892. static readonly LIGHTYELLOW: Color;
  3893. /**
  3894. * An immutable Color instance initialized to CSS color #00FF00
  3895. * <span class="colorSwath" style="background: #00FF00;"></span>
  3896. */
  3897. static readonly LIME: Color;
  3898. /**
  3899. * An immutable Color instance initialized to CSS color #32CD32
  3900. * <span class="colorSwath" style="background: #32CD32;"></span>
  3901. */
  3902. static readonly LIMEGREEN: Color;
  3903. /**
  3904. * An immutable Color instance initialized to CSS color #FAF0E6
  3905. * <span class="colorSwath" style="background: #FAF0E6;"></span>
  3906. */
  3907. static readonly LINEN: Color;
  3908. /**
  3909. * An immutable Color instance initialized to CSS color #FF00FF
  3910. * <span class="colorSwath" style="background: #FF00FF;"></span>
  3911. */
  3912. static readonly MAGENTA: Color;
  3913. /**
  3914. * An immutable Color instance initialized to CSS color #800000
  3915. * <span class="colorSwath" style="background: #800000;"></span>
  3916. */
  3917. static readonly MAROON: Color;
  3918. /**
  3919. * An immutable Color instance initialized to CSS color #66CDAA
  3920. * <span class="colorSwath" style="background: #66CDAA;"></span>
  3921. */
  3922. static readonly MEDIUMAQUAMARINE: Color;
  3923. /**
  3924. * An immutable Color instance initialized to CSS color #0000CD
  3925. * <span class="colorSwath" style="background: #0000CD;"></span>
  3926. */
  3927. static readonly MEDIUMBLUE: Color;
  3928. /**
  3929. * An immutable Color instance initialized to CSS color #BA55D3
  3930. * <span class="colorSwath" style="background: #BA55D3;"></span>
  3931. */
  3932. static readonly MEDIUMORCHID: Color;
  3933. /**
  3934. * An immutable Color instance initialized to CSS color #9370DB
  3935. * <span class="colorSwath" style="background: #9370DB;"></span>
  3936. */
  3937. static readonly MEDIUMPURPLE: Color;
  3938. /**
  3939. * An immutable Color instance initialized to CSS color #3CB371
  3940. * <span class="colorSwath" style="background: #3CB371;"></span>
  3941. */
  3942. static readonly MEDIUMSEAGREEN: Color;
  3943. /**
  3944. * An immutable Color instance initialized to CSS color #7B68EE
  3945. * <span class="colorSwath" style="background: #7B68EE;"></span>
  3946. */
  3947. static readonly MEDIUMSLATEBLUE: Color;
  3948. /**
  3949. * An immutable Color instance initialized to CSS color #00FA9A
  3950. * <span class="colorSwath" style="background: #00FA9A;"></span>
  3951. */
  3952. static readonly MEDIUMSPRINGGREEN: Color;
  3953. /**
  3954. * An immutable Color instance initialized to CSS color #48D1CC
  3955. * <span class="colorSwath" style="background: #48D1CC;"></span>
  3956. */
  3957. static readonly MEDIUMTURQUOISE: Color;
  3958. /**
  3959. * An immutable Color instance initialized to CSS color #C71585
  3960. * <span class="colorSwath" style="background: #C71585;"></span>
  3961. */
  3962. static readonly MEDIUMVIOLETRED: Color;
  3963. /**
  3964. * An immutable Color instance initialized to CSS color #191970
  3965. * <span class="colorSwath" style="background: #191970;"></span>
  3966. */
  3967. static readonly MIDNIGHTBLUE: Color;
  3968. /**
  3969. * An immutable Color instance initialized to CSS color #F5FFFA
  3970. * <span class="colorSwath" style="background: #F5FFFA;"></span>
  3971. */
  3972. static readonly MINTCREAM: Color;
  3973. /**
  3974. * An immutable Color instance initialized to CSS color #FFE4E1
  3975. * <span class="colorSwath" style="background: #FFE4E1;"></span>
  3976. */
  3977. static readonly MISTYROSE: Color;
  3978. /**
  3979. * An immutable Color instance initialized to CSS color #FFE4B5
  3980. * <span class="colorSwath" style="background: #FFE4B5;"></span>
  3981. */
  3982. static readonly MOCCASIN: Color;
  3983. /**
  3984. * An immutable Color instance initialized to CSS color #FFDEAD
  3985. * <span class="colorSwath" style="background: #FFDEAD;"></span>
  3986. */
  3987. static readonly NAVAJOWHITE: Color;
  3988. /**
  3989. * An immutable Color instance initialized to CSS color #000080
  3990. * <span class="colorSwath" style="background: #000080;"></span>
  3991. */
  3992. static readonly NAVY: Color;
  3993. /**
  3994. * An immutable Color instance initialized to CSS color #FDF5E6
  3995. * <span class="colorSwath" style="background: #FDF5E6;"></span>
  3996. */
  3997. static readonly OLDLACE: Color;
  3998. /**
  3999. * An immutable Color instance initialized to CSS color #808000
  4000. * <span class="colorSwath" style="background: #808000;"></span>
  4001. */
  4002. static readonly OLIVE: Color;
  4003. /**
  4004. * An immutable Color instance initialized to CSS color #6B8E23
  4005. * <span class="colorSwath" style="background: #6B8E23;"></span>
  4006. */
  4007. static readonly OLIVEDRAB: Color;
  4008. /**
  4009. * An immutable Color instance initialized to CSS color #FFA500
  4010. * <span class="colorSwath" style="background: #FFA500;"></span>
  4011. */
  4012. static readonly ORANGE: Color;
  4013. /**
  4014. * An immutable Color instance initialized to CSS color #FF4500
  4015. * <span class="colorSwath" style="background: #FF4500;"></span>
  4016. */
  4017. static readonly ORANGERED: Color;
  4018. /**
  4019. * An immutable Color instance initialized to CSS color #DA70D6
  4020. * <span class="colorSwath" style="background: #DA70D6;"></span>
  4021. */
  4022. static readonly ORCHID: Color;
  4023. /**
  4024. * An immutable Color instance initialized to CSS color #EEE8AA
  4025. * <span class="colorSwath" style="background: #EEE8AA;"></span>
  4026. */
  4027. static readonly PALEGOLDENROD: Color;
  4028. /**
  4029. * An immutable Color instance initialized to CSS color #98FB98
  4030. * <span class="colorSwath" style="background: #98FB98;"></span>
  4031. */
  4032. static readonly PALEGREEN: Color;
  4033. /**
  4034. * An immutable Color instance initialized to CSS color #AFEEEE
  4035. * <span class="colorSwath" style="background: #AFEEEE;"></span>
  4036. */
  4037. static readonly PALETURQUOISE: Color;
  4038. /**
  4039. * An immutable Color instance initialized to CSS color #DB7093
  4040. * <span class="colorSwath" style="background: #DB7093;"></span>
  4041. */
  4042. static readonly PALEVIOLETRED: Color;
  4043. /**
  4044. * An immutable Color instance initialized to CSS color #FFEFD5
  4045. * <span class="colorSwath" style="background: #FFEFD5;"></span>
  4046. */
  4047. static readonly PAPAYAWHIP: Color;
  4048. /**
  4049. * An immutable Color instance initialized to CSS color #FFDAB9
  4050. * <span class="colorSwath" style="background: #FFDAB9;"></span>
  4051. */
  4052. static readonly PEACHPUFF: Color;
  4053. /**
  4054. * An immutable Color instance initialized to CSS color #CD853F
  4055. * <span class="colorSwath" style="background: #CD853F;"></span>
  4056. */
  4057. static readonly PERU: Color;
  4058. /**
  4059. * An immutable Color instance initialized to CSS color #FFC0CB
  4060. * <span class="colorSwath" style="background: #FFC0CB;"></span>
  4061. */
  4062. static readonly PINK: Color;
  4063. /**
  4064. * An immutable Color instance initialized to CSS color #DDA0DD
  4065. * <span class="colorSwath" style="background: #DDA0DD;"></span>
  4066. */
  4067. static readonly PLUM: Color;
  4068. /**
  4069. * An immutable Color instance initialized to CSS color #B0E0E6
  4070. * <span class="colorSwath" style="background: #B0E0E6;"></span>
  4071. */
  4072. static readonly POWDERBLUE: Color;
  4073. /**
  4074. * An immutable Color instance initialized to CSS color #800080
  4075. * <span class="colorSwath" style="background: #800080;"></span>
  4076. */
  4077. static readonly PURPLE: Color;
  4078. /**
  4079. * An immutable Color instance initialized to CSS color #FF0000
  4080. * <span class="colorSwath" style="background: #FF0000;"></span>
  4081. */
  4082. static readonly RED: Color;
  4083. /**
  4084. * An immutable Color instance initialized to CSS color #BC8F8F
  4085. * <span class="colorSwath" style="background: #BC8F8F;"></span>
  4086. */
  4087. static readonly ROSYBROWN: Color;
  4088. /**
  4089. * An immutable Color instance initialized to CSS color #4169E1
  4090. * <span class="colorSwath" style="background: #4169E1;"></span>
  4091. */
  4092. static readonly ROYALBLUE: Color;
  4093. /**
  4094. * An immutable Color instance initialized to CSS color #8B4513
  4095. * <span class="colorSwath" style="background: #8B4513;"></span>
  4096. */
  4097. static readonly SADDLEBROWN: Color;
  4098. /**
  4099. * An immutable Color instance initialized to CSS color #FA8072
  4100. * <span class="colorSwath" style="background: #FA8072;"></span>
  4101. */
  4102. static readonly SALMON: Color;
  4103. /**
  4104. * An immutable Color instance initialized to CSS color #F4A460
  4105. * <span class="colorSwath" style="background: #F4A460;"></span>
  4106. */
  4107. static readonly SANDYBROWN: Color;
  4108. /**
  4109. * An immutable Color instance initialized to CSS color #2E8B57
  4110. * <span class="colorSwath" style="background: #2E8B57;"></span>
  4111. */
  4112. static readonly SEAGREEN: Color;
  4113. /**
  4114. * An immutable Color instance initialized to CSS color #FFF5EE
  4115. * <span class="colorSwath" style="background: #FFF5EE;"></span>
  4116. */
  4117. static readonly SEASHELL: Color;
  4118. /**
  4119. * An immutable Color instance initialized to CSS color #A0522D
  4120. * <span class="colorSwath" style="background: #A0522D;"></span>
  4121. */
  4122. static readonly SIENNA: Color;
  4123. /**
  4124. * An immutable Color instance initialized to CSS color #C0C0C0
  4125. * <span class="colorSwath" style="background: #C0C0C0;"></span>
  4126. */
  4127. static readonly SILVER: Color;
  4128. /**
  4129. * An immutable Color instance initialized to CSS color #87CEEB
  4130. * <span class="colorSwath" style="background: #87CEEB;"></span>
  4131. */
  4132. static readonly SKYBLUE: Color;
  4133. /**
  4134. * An immutable Color instance initialized to CSS color #6A5ACD
  4135. * <span class="colorSwath" style="background: #6A5ACD;"></span>
  4136. */
  4137. static readonly SLATEBLUE: Color;
  4138. /**
  4139. * An immutable Color instance initialized to CSS color #708090
  4140. * <span class="colorSwath" style="background: #708090;"></span>
  4141. */
  4142. static readonly SLATEGRAY: Color;
  4143. /**
  4144. * An immutable Color instance initialized to CSS color #708090
  4145. * <span class="colorSwath" style="background: #708090;"></span>
  4146. */
  4147. static readonly SLATEGREY: Color;
  4148. /**
  4149. * An immutable Color instance initialized to CSS color #FFFAFA
  4150. * <span class="colorSwath" style="background: #FFFAFA;"></span>
  4151. */
  4152. static readonly SNOW: Color;
  4153. /**
  4154. * An immutable Color instance initialized to CSS color #00FF7F
  4155. * <span class="colorSwath" style="background: #00FF7F;"></span>
  4156. */
  4157. static readonly SPRINGGREEN: Color;
  4158. /**
  4159. * An immutable Color instance initialized to CSS color #4682B4
  4160. * <span class="colorSwath" style="background: #4682B4;"></span>
  4161. */
  4162. static readonly STEELBLUE: Color;
  4163. /**
  4164. * An immutable Color instance initialized to CSS color #D2B48C
  4165. * <span class="colorSwath" style="background: #D2B48C;"></span>
  4166. */
  4167. static readonly TAN: Color;
  4168. /**
  4169. * An immutable Color instance initialized to CSS color #008080
  4170. * <span class="colorSwath" style="background: #008080;"></span>
  4171. */
  4172. static readonly TEAL: Color;
  4173. /**
  4174. * An immutable Color instance initialized to CSS color #D8BFD8
  4175. * <span class="colorSwath" style="background: #D8BFD8;"></span>
  4176. */
  4177. static readonly THISTLE: Color;
  4178. /**
  4179. * An immutable Color instance initialized to CSS color #FF6347
  4180. * <span class="colorSwath" style="background: #FF6347;"></span>
  4181. */
  4182. static readonly TOMATO: Color;
  4183. /**
  4184. * An immutable Color instance initialized to CSS color #40E0D0
  4185. * <span class="colorSwath" style="background: #40E0D0;"></span>
  4186. */
  4187. static readonly TURQUOISE: Color;
  4188. /**
  4189. * An immutable Color instance initialized to CSS color #EE82EE
  4190. * <span class="colorSwath" style="background: #EE82EE;"></span>
  4191. */
  4192. static readonly VIOLET: Color;
  4193. /**
  4194. * An immutable Color instance initialized to CSS color #F5DEB3
  4195. * <span class="colorSwath" style="background: #F5DEB3;"></span>
  4196. */
  4197. static readonly WHEAT: Color;
  4198. /**
  4199. * An immutable Color instance initialized to CSS color #FFFFFF
  4200. * <span class="colorSwath" style="background: #FFFFFF;"></span>
  4201. */
  4202. static readonly WHITE: Color;
  4203. /**
  4204. * An immutable Color instance initialized to CSS color #F5F5F5
  4205. * <span class="colorSwath" style="background: #F5F5F5;"></span>
  4206. */
  4207. static readonly WHITESMOKE: Color;
  4208. /**
  4209. * An immutable Color instance initialized to CSS color #FFFF00
  4210. * <span class="colorSwath" style="background: #FFFF00;"></span>
  4211. */
  4212. static readonly YELLOW: Color;
  4213. /**
  4214. * An immutable Color instance initialized to CSS color #9ACD32
  4215. * <span class="colorSwath" style="background: #9ACD32;"></span>
  4216. */
  4217. static readonly YELLOWGREEN: Color;
  4218. /**
  4219. * An immutable Color instance initialized to CSS transparent.
  4220. * <span class="colorSwath" style="background: transparent;"></span>
  4221. */
  4222. static readonly TRANSPARENT: Color;
  4223. }
  4224. /**
  4225. * Value and type information for per-instance geometry color.
  4226. * @example
  4227. * const instance = new Cesium.GeometryInstance({
  4228. * geometry : Cesium.BoxGeometry.fromDimensions({
  4229. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  4230. * }),
  4231. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  4232. * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  4233. * id : 'box',
  4234. * attributes : {
  4235. * color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)
  4236. * }
  4237. * });
  4238. * @param [red = 1.0] - The red component.
  4239. * @param [green = 1.0] - The green component.
  4240. * @param [blue = 1.0] - The blue component.
  4241. * @param [alpha = 1.0] - The alpha component.
  4242. */
  4243. export class ColorGeometryInstanceAttribute {
  4244. constructor(red?: number, green?: number, blue?: number, alpha?: number);
  4245. /**
  4246. * The values for the attributes stored in a typed array.
  4247. */
  4248. value: Uint8Array;
  4249. /**
  4250. * The datatype of each component in the attribute, e.g., individual elements in
  4251. * {@link ColorGeometryInstanceAttribute#value}.
  4252. */
  4253. readonly componentDatatype: ComponentDatatype;
  4254. /**
  4255. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  4256. */
  4257. readonly componentsPerAttribute: number;
  4258. /**
  4259. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  4260. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  4261. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  4262. */
  4263. readonly normalize: boolean;
  4264. /**
  4265. * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.
  4266. * @example
  4267. * const instance = new Cesium.GeometryInstance({
  4268. * geometry : geometry,
  4269. * attributes : {
  4270. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),
  4271. * }
  4272. * });
  4273. * @param color - The color.
  4274. * @returns The new {@link ColorGeometryInstanceAttribute} instance.
  4275. */
  4276. static fromColor(color: Color): ColorGeometryInstanceAttribute;
  4277. /**
  4278. * Converts a color to a typed array that can be used to assign a color attribute.
  4279. * @example
  4280. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  4281. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);
  4282. * @param color - The color.
  4283. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  4284. * @returns The modified result parameter or a new instance if result was undefined.
  4285. */
  4286. static toValue(color: Color, result?: Uint8Array): Uint8Array;
  4287. /**
  4288. * Compares the provided ColorGeometryInstanceAttributes and returns
  4289. * <code>true</code> if they are equal, <code>false</code> otherwise.
  4290. * @param [left] - The first ColorGeometryInstanceAttribute.
  4291. * @param [right] - The second ColorGeometryInstanceAttribute.
  4292. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4293. */
  4294. static equals(left?: ColorGeometryInstanceAttribute, right?: ColorGeometryInstanceAttribute): boolean;
  4295. }
  4296. /**
  4297. * WebGL component datatypes. Components are intrinsics,
  4298. * which form attributes, which form vertices.
  4299. */
  4300. export enum ComponentDatatype {
  4301. /**
  4302. * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
  4303. * of an element in <code>Int8Array</code>.
  4304. */
  4305. BYTE = WebGLConstants.BYTE,
  4306. /**
  4307. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  4308. * of an element in <code>Uint8Array</code>.
  4309. */
  4310. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  4311. /**
  4312. * 16-bit signed short corresponding to <code>SHORT</code> and the type
  4313. * of an element in <code>Int16Array</code>.
  4314. */
  4315. SHORT = WebGLConstants.SHORT,
  4316. /**
  4317. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  4318. * of an element in <code>Uint16Array</code>.
  4319. */
  4320. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  4321. /**
  4322. * 32-bit signed int corresponding to <code>INT</code> and the type
  4323. * of an element in <code>Int32Array</code>.
  4324. */
  4325. INT = WebGLConstants.INT,
  4326. /**
  4327. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  4328. * of an element in <code>Uint32Array</code>.
  4329. */
  4330. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  4331. /**
  4332. * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
  4333. * of an element in <code>Float32Array</code>.
  4334. */
  4335. FLOAT = WebGLConstants.FLOAT,
  4336. /**
  4337. * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
  4338. * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
  4339. * and the type of an element in <code>Float64Array</code>.
  4340. */
  4341. DOUBLE = WebGLConstants.DOUBLE
  4342. }
  4343. /**
  4344. * Describes a compressed texture and contains a compressed texture buffer.
  4345. * @param internalFormat - The pixel format of the compressed texture.
  4346. * @param pixelDatatype - The pixel datatype of the compressed texture.
  4347. * @param width - The width of the texture.
  4348. * @param height - The height of the texture.
  4349. * @param buffer - The compressed texture buffer.
  4350. */
  4351. export class CompressedTextureBuffer {
  4352. constructor(internalFormat: PixelFormat, pixelDatatype: PixelDatatype, width: number, height: number, buffer: Uint8Array);
  4353. /**
  4354. * The format of the compressed texture.
  4355. */
  4356. readonly internalFormat: PixelFormat;
  4357. /**
  4358. * The datatype of the compressed texture.
  4359. */
  4360. readonly pixelDatatype: PixelDatatype;
  4361. /**
  4362. * The width of the texture.
  4363. */
  4364. readonly width: number;
  4365. /**
  4366. * The height of the texture.
  4367. */
  4368. readonly height: number;
  4369. /**
  4370. * The compressed texture buffer.
  4371. */
  4372. readonly bufferView: Uint8Array;
  4373. /**
  4374. * Creates a shallow clone of a compressed texture buffer.
  4375. * @param object - The compressed texture buffer to be cloned.
  4376. * @returns A shallow clone of the compressed texture buffer.
  4377. */
  4378. static clone(object: CompressedTextureBuffer): CompressedTextureBuffer;
  4379. /**
  4380. * Creates a shallow clone of this compressed texture buffer.
  4381. * @returns A shallow clone of the compressed texture buffer.
  4382. */
  4383. clone(): CompressedTextureBuffer;
  4384. }
  4385. /**
  4386. * A spline that evaluates to a constant value. Although this follows the {@link Spline} interface,
  4387. * it does not maintain an internal array of times since its value never changes.
  4388. * @example
  4389. * const position = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  4390. * const spline = new Cesium.ConstantSpline(position);
  4391. *
  4392. * const p0 = spline.evaluate(0.0);
  4393. * @param value - The constant value that the spline evaluates to.
  4394. */
  4395. export class ConstantSpline {
  4396. constructor(value: number | Cartesian3 | Quaternion);
  4397. /**
  4398. * The constant value that the spline evaluates to.
  4399. */
  4400. readonly value: number | Cartesian3 | Quaternion;
  4401. /**
  4402. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  4403. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  4404. *
  4405. * Since a constant spline has no internal times array, this will throw an error.
  4406. * @param time - The time.
  4407. */
  4408. findTimeInterval(time: number): void;
  4409. /**
  4410. * Wraps the given time to the period covered by the spline.
  4411. * @param time - The time.
  4412. * @returns The time, wrapped around to the updated animation.
  4413. */
  4414. wrapTime(time: number): number;
  4415. /**
  4416. * Clamps the given time to the period covered by the spline.
  4417. * @param time - The time.
  4418. * @returns The time, clamped to the animation period.
  4419. */
  4420. clampTime(time: number): number;
  4421. /**
  4422. * Evaluates the curve at a given time.
  4423. * @param time - The time at which to evaluate the curve.
  4424. * @param [result] - The object onto which to store the result.
  4425. * @returns The modified result parameter or the value that the constant spline represents.
  4426. */
  4427. evaluate(time: number, result?: Cartesian3 | Quaternion): number | Cartesian3 | Quaternion;
  4428. }
  4429. /**
  4430. * A description of a polygon composed of arbitrary coplanar positions.
  4431. * @example
  4432. * const polygonGeometry = new Cesium.CoplanarPolygonGeometry({
  4433. * polygonHierarchy: new Cesium.PolygonHierarchy(
  4434. * Cesium.Cartesian3.fromDegreesArrayHeights([
  4435. * -90.0, 30.0, 0.0,
  4436. * -90.0, 30.0, 300000.0,
  4437. * -80.0, 30.0, 300000.0,
  4438. * -80.0, 30.0, 0.0
  4439. * ]))
  4440. * });
  4441. * @param options - Object with the following properties:
  4442. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4443. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4444. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4445. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4446. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.
  4447. */
  4448. export class CoplanarPolygonGeometry {
  4449. constructor(options: {
  4450. polygonHierarchy: PolygonHierarchy;
  4451. stRotation?: number;
  4452. vertexFormat?: VertexFormat;
  4453. ellipsoid?: Ellipsoid;
  4454. textureCoordinates?: PolygonHierarchy;
  4455. });
  4456. /**
  4457. * The number of elements used to pack the object into an array.
  4458. */
  4459. packedLength: number;
  4460. /**
  4461. * A description of a coplanar polygon from an array of positions.
  4462. * @example
  4463. * // create a polygon from points
  4464. * const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
  4465. * positions : Cesium.Cartesian3.fromDegreesArray([
  4466. * -72.0, 40.0,
  4467. * -70.0, 35.0,
  4468. * -75.0, 30.0,
  4469. * -70.0, 30.0,
  4470. * -68.0, 40.0
  4471. * ])
  4472. * });
  4473. * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  4474. * @param options - Object with the following properties:
  4475. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4476. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4477. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  4478. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4479. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.
  4480. */
  4481. static fromPositions(options: {
  4482. positions: Cartesian3[];
  4483. vertexFormat?: VertexFormat;
  4484. stRotation?: number;
  4485. ellipsoid?: Ellipsoid;
  4486. textureCoordinates?: PolygonHierarchy;
  4487. }): CoplanarPolygonGeometry;
  4488. /**
  4489. * Stores the provided instance into the provided array.
  4490. * @param value - The value to pack.
  4491. * @param array - The array to pack into.
  4492. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4493. * @returns The array that was packed into
  4494. */
  4495. static pack(value: CoplanarPolygonGeometry, array: number[], startingIndex?: number): number[];
  4496. /**
  4497. * Retrieves an instance from a packed array.
  4498. * @param array - The packed array.
  4499. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4500. * @param [result] - The object into which to store the result.
  4501. * @returns The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
  4502. */
  4503. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonGeometry): CoplanarPolygonGeometry;
  4504. /**
  4505. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4506. * @param polygonGeometry - A description of the polygon.
  4507. * @returns The computed vertices and indices.
  4508. */
  4509. static createGeometry(polygonGeometry: CoplanarPolygonGeometry): Geometry | undefined;
  4510. }
  4511. /**
  4512. * A description of the outline of a polygon composed of arbitrary coplanar positions.
  4513. * @example
  4514. * const polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
  4515. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  4516. * -90.0, 30.0, 0.0,
  4517. * -90.0, 30.0, 1000.0,
  4518. * -80.0, 30.0, 1000.0,
  4519. * -80.0, 30.0, 0.0
  4520. * ])
  4521. * });
  4522. * const geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
  4523. * @param options - Object with the following properties:
  4524. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  4525. */
  4526. export class CoplanarPolygonOutlineGeometry {
  4527. constructor(options: {
  4528. polygonHierarchy: PolygonHierarchy;
  4529. });
  4530. /**
  4531. * The number of elements used to pack the object into an array.
  4532. */
  4533. packedLength: number;
  4534. /**
  4535. * A description of a coplanar polygon outline from an array of positions.
  4536. * @param options - Object with the following properties:
  4537. * @param options.positions - An array of positions that defined the corner points of the polygon.
  4538. */
  4539. static fromPositions(options: {
  4540. positions: Cartesian3[];
  4541. }): CoplanarPolygonOutlineGeometry;
  4542. /**
  4543. * Stores the provided instance into the provided array.
  4544. * @param value - The value to pack.
  4545. * @param array - The array to pack into.
  4546. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4547. * @returns The array that was packed into
  4548. */
  4549. static pack(value: CoplanarPolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  4550. /**
  4551. * Retrieves an instance from a packed array.
  4552. * @param array - The packed array.
  4553. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4554. * @param [result] - The object into which to store the result.
  4555. * @returns The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
  4556. */
  4557. static unpack(array: number[], startingIndex?: number, result?: CoplanarPolygonOutlineGeometry): CoplanarPolygonOutlineGeometry;
  4558. /**
  4559. * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
  4560. * @param polygonGeometry - A description of the polygon.
  4561. * @returns The computed vertices and indices.
  4562. */
  4563. static createGeometry(polygonGeometry: CoplanarPolygonOutlineGeometry): Geometry | undefined;
  4564. }
  4565. /**
  4566. * Style options for corners.
  4567. */
  4568. export enum CornerType {
  4569. /**
  4570. * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
  4571. *
  4572. * Corner has a smooth edge.
  4573. */
  4574. ROUNDED = 0,
  4575. /**
  4576. * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
  4577. *
  4578. * Corner point is the intersection of adjacent edges.
  4579. */
  4580. MITERED = 1,
  4581. /**
  4582. * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
  4583. *
  4584. * Corner is clipped.
  4585. */
  4586. BEVELED = 2
  4587. }
  4588. /**
  4589. * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  4590. * @example
  4591. * const corridor = new Cesium.CorridorGeometry({
  4592. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  4593. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4594. * width : 100000
  4595. * });
  4596. * @param options - Object with the following properties:
  4597. * @param options.positions - An array of positions that define the center of the corridor.
  4598. * @param options.width - The distance between the edges of the corridor in meters.
  4599. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4600. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4601. * @param [options.height = 0] - The distance in meters between the ellipsoid surface and the positions.
  4602. * @param [options.extrudedHeight] - The distance in meters between the ellipsoid surface and the extruded face.
  4603. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4604. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4605. */
  4606. export class CorridorGeometry {
  4607. constructor(options: {
  4608. positions: Cartesian3[];
  4609. width: number;
  4610. ellipsoid?: Ellipsoid;
  4611. granularity?: number;
  4612. height?: number;
  4613. extrudedHeight?: number;
  4614. vertexFormat?: VertexFormat;
  4615. cornerType?: CornerType;
  4616. });
  4617. /**
  4618. * The number of elements used to pack the object into an array.
  4619. */
  4620. packedLength: number;
  4621. /**
  4622. * Stores the provided instance into the provided array.
  4623. * @param value - The value to pack.
  4624. * @param array - The array to pack into.
  4625. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4626. * @returns The array that was packed into
  4627. */
  4628. static pack(value: CorridorGeometry, array: number[], startingIndex?: number): number[];
  4629. /**
  4630. * Retrieves an instance from a packed array.
  4631. * @param array - The packed array.
  4632. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4633. * @param [result] - The object into which to store the result.
  4634. * @returns The modified result parameter or a new CorridorGeometry instance if one was not provided.
  4635. */
  4636. static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry;
  4637. /**
  4638. * Computes the bounding rectangle given the provided options
  4639. * @param options - Object with the following properties:
  4640. * @param options.positions - An array of positions that define the center of the corridor.
  4641. * @param options.width - The distance between the edges of the corridor in meters.
  4642. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4643. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4644. * @param [result] - An object in which to store the result.
  4645. * @returns The result rectangle.
  4646. */
  4647. static computeRectangle(options: {
  4648. positions: Cartesian3[];
  4649. width: number;
  4650. ellipsoid?: Ellipsoid;
  4651. cornerType?: CornerType;
  4652. }, result?: Rectangle): Rectangle;
  4653. /**
  4654. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4655. * @param corridorGeometry - A description of the corridor.
  4656. * @returns The computed vertices and indices.
  4657. */
  4658. static createGeometry(corridorGeometry: CorridorGeometry): Geometry | undefined;
  4659. }
  4660. /**
  4661. * A description of a corridor outline.
  4662. * @example
  4663. * const corridor = new Cesium.CorridorOutlineGeometry({
  4664. * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
  4665. * width : 100000
  4666. * });
  4667. * @param options - Object with the following properties:
  4668. * @param options.positions - An array of positions that define the center of the corridor outline.
  4669. * @param options.width - The distance between the edges of the corridor outline.
  4670. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  4671. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  4672. * @param [options.height = 0] - The distance in meters between the positions and the ellipsoid surface.
  4673. * @param [options.extrudedHeight] - The distance in meters between the extruded face and the ellipsoid surface.
  4674. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  4675. */
  4676. export class CorridorOutlineGeometry {
  4677. constructor(options: {
  4678. positions: Cartesian3[];
  4679. width: number;
  4680. ellipsoid?: Ellipsoid;
  4681. granularity?: number;
  4682. height?: number;
  4683. extrudedHeight?: number;
  4684. cornerType?: CornerType;
  4685. });
  4686. /**
  4687. * The number of elements used to pack the object into an array.
  4688. */
  4689. packedLength: number;
  4690. /**
  4691. * Stores the provided instance into the provided array.
  4692. * @param value - The value to pack.
  4693. * @param array - The array to pack into.
  4694. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4695. * @returns The array that was packed into
  4696. */
  4697. static pack(value: CorridorOutlineGeometry, array: number[], startingIndex?: number): number[];
  4698. /**
  4699. * Retrieves an instance from a packed array.
  4700. * @param array - The packed array.
  4701. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4702. * @param [result] - The object into which to store the result.
  4703. * @returns The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
  4704. */
  4705. static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry;
  4706. /**
  4707. * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
  4708. * @param corridorOutlineGeometry - A description of the corridor.
  4709. * @returns The computed vertices and indices.
  4710. */
  4711. static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry | undefined;
  4712. }
  4713. /**
  4714. * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
  4715. * @example
  4716. * //Create a credit with a tooltip, image and link
  4717. * const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
  4718. * @param html - An string representing an html code snippet
  4719. * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
  4720. */
  4721. export class Credit {
  4722. constructor(html: string, showOnScreen?: boolean);
  4723. /**
  4724. * The credit content
  4725. */
  4726. readonly html: string;
  4727. /**
  4728. * Whether the credit should be displayed on screen or in a lightbox
  4729. */
  4730. showOnScreen: boolean;
  4731. /**
  4732. * Gets the credit element
  4733. */
  4734. readonly element: HTMLElement;
  4735. /**
  4736. * Returns true if the credits are equal
  4737. * @param left - The first credit
  4738. * @param right - The second credit
  4739. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4740. */
  4741. static equals(left: Credit, right: Credit): boolean;
  4742. /**
  4743. * Returns true if the credits are equal
  4744. * @param credit - The credit to compare to.
  4745. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  4746. */
  4747. equals(credit: Credit): boolean;
  4748. /**
  4749. * Duplicates a Credit instance.
  4750. * @param [credit] - The Credit to duplicate.
  4751. * @returns A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
  4752. */
  4753. static clone(credit?: Credit): Credit;
  4754. }
  4755. /**
  4756. * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
  4757. */
  4758. export namespace CubicRealPolynomial {
  4759. /**
  4760. * Provides the discriminant of the cubic equation from the supplied coefficients.
  4761. * @param a - The coefficient of the 3rd order monomial.
  4762. * @param b - The coefficient of the 2nd order monomial.
  4763. * @param c - The coefficient of the 1st order monomial.
  4764. * @param d - The coefficient of the 0th order monomial.
  4765. * @returns The value of the discriminant.
  4766. */
  4767. function computeDiscriminant(a: number, b: number, c: number, d: number): number;
  4768. /**
  4769. * Provides the real valued roots of the cubic polynomial with the provided coefficients.
  4770. * @param a - The coefficient of the 3rd order monomial.
  4771. * @param b - The coefficient of the 2nd order monomial.
  4772. * @param c - The coefficient of the 1st order monomial.
  4773. * @param d - The coefficient of the 0th order monomial.
  4774. * @returns The real valued roots.
  4775. */
  4776. function computeRealRoots(a: number, b: number, c: number, d: number): number[];
  4777. }
  4778. /**
  4779. * The culling volume defined by planes.
  4780. * @param [planes] - An array of clipping planes.
  4781. */
  4782. export class CullingVolume {
  4783. constructor(planes?: Cartesian4[]);
  4784. /**
  4785. * Each plane is represented by a Cartesian4 object, where the x, y, and z components
  4786. * define the unit vector normal to the plane, and the w component is the distance of the
  4787. * plane from the origin.
  4788. */
  4789. planes: Cartesian4[];
  4790. /**
  4791. * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
  4792. * The planes are aligned to the x, y, and z axes in world coordinates.
  4793. * @param boundingSphere - The bounding sphere used to create the culling volume.
  4794. * @param [result] - The object onto which to store the result.
  4795. * @returns The culling volume created from the bounding sphere.
  4796. */
  4797. static fromBoundingSphere(boundingSphere: BoundingSphere, result?: CullingVolume): CullingVolume;
  4798. /**
  4799. * Determines whether a bounding volume intersects the culling volume.
  4800. * @param boundingVolume - The bounding volume whose intersection with the culling volume is to be tested.
  4801. * @returns Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
  4802. */
  4803. computeVisibility(boundingVolume: any): Intersect;
  4804. }
  4805. export namespace CustomHeightmapTerrainProvider {
  4806. /**
  4807. * @param x - The X coordinate of the tile for which to request geometry.
  4808. * @param y - The Y coordinate of the tile for which to request geometry.
  4809. * @param level - The level of the tile for which to request geometry.
  4810. */
  4811. 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;
  4812. }
  4813. /**
  4814. * A simple {@link TerrainProvider} that gets height values from a callback function.
  4815. * It can be used for procedurally generated terrain or as a way to load custom
  4816. * heightmap data without creating a subclass of {@link TerrainProvider}.
  4817. *
  4818. * There are some limitations such as no water mask, no vertex normals, and no
  4819. * availability, so a full-fledged {@link TerrainProvider} subclass is better suited
  4820. * for these more sophisticated use cases.
  4821. * @example
  4822. * const viewer = new Cesium.Viewer("cesiumContainer", {
  4823. * terrainProvider: new Cesium.CustomHeightmapTerrainProvider({
  4824. * width: 32,
  4825. * height: 32,
  4826. * callback: function (x, y, level) {
  4827. * return new Float32Array(32 * 32); // all zeros
  4828. * },
  4829. * }),
  4830. * });
  4831. * @param options - Object with the following properties:
  4832. * @param options.callback - The callback function for requesting tile geometry.
  4833. * @param options.width - The number of columns per heightmap tile.
  4834. * @param options.height - The number of rows per heightmap tile.
  4835. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  4836. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  4837. * is used.
  4838. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  4839. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  4840. * parameter is specified, the WGS84 ellipsoid is used.
  4841. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  4842. */
  4843. export class CustomHeightmapTerrainProvider {
  4844. constructor(options: {
  4845. callback: CustomHeightmapTerrainProvider.GeometryCallback;
  4846. width: number;
  4847. height: number;
  4848. tilingScheme?: TilingScheme;
  4849. ellipsoid?: Ellipsoid;
  4850. credit?: Credit | string;
  4851. });
  4852. /**
  4853. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  4854. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  4855. * are passed an instance of {@link TileProviderError}.
  4856. */
  4857. readonly errorEvent: Event;
  4858. /**
  4859. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  4860. * the source of the terrain.
  4861. */
  4862. readonly credit: Credit;
  4863. /**
  4864. * Gets the tiling scheme used by this provider.
  4865. */
  4866. readonly tilingScheme: TilingScheme;
  4867. /**
  4868. * Gets a value indicating whether or not the provider is ready for use.
  4869. */
  4870. readonly ready: boolean;
  4871. /**
  4872. * Gets a promise that resolves to true when the provider is ready for use.
  4873. */
  4874. readonly readyPromise: Promise<boolean>;
  4875. /**
  4876. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  4877. * indicates which areas of the globe are water rather than land, so they can be rendered
  4878. * as a reflective surface with animated waves.
  4879. * Water mask is not supported by {@link CustomHeightmapTerrainProvider}, so the return
  4880. * value will always be false.
  4881. */
  4882. readonly hasWaterMask: boolean;
  4883. /**
  4884. * Gets a value indicating whether or not the requested tiles include vertex normals.
  4885. * Vertex normals are not supported by {@link CustomHeightmapTerrainProvider}, so the return
  4886. * value will always be false.
  4887. */
  4888. readonly hasVertexNormals: boolean;
  4889. /**
  4890. * Gets the number of columns per heightmap tile.
  4891. */
  4892. readonly width: boolean;
  4893. /**
  4894. * Gets the number of rows per heightmap tile.
  4895. */
  4896. readonly height: boolean;
  4897. /**
  4898. * Requests the geometry for a given tile. The result includes terrain
  4899. * data and indicates that all child tiles are available.
  4900. * @param x - The X coordinate of the tile for which to request geometry.
  4901. * @param y - The Y coordinate of the tile for which to request geometry.
  4902. * @param level - The level of the tile for which to request geometry.
  4903. * @param [request] - The request object. Intended for internal use only.
  4904. * @returns A promise for the requested geometry. If this method
  4905. * returns undefined instead of a promise, it is an indication that too many requests are already
  4906. * pending and the request will be retried later.
  4907. */
  4908. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  4909. /**
  4910. * Gets the maximum geometric error allowed in a tile at a given level.
  4911. * @param level - The tile level for which to get the maximum geometric error.
  4912. * @returns The maximum geometric error.
  4913. */
  4914. getLevelMaximumGeometricError(level: number): number;
  4915. /**
  4916. * Determines whether data for a tile is available to be loaded.
  4917. * @param x - The X coordinate of the tile for which to request geometry.
  4918. * @param y - The Y coordinate of the tile for which to request geometry.
  4919. * @param level - The level of the tile for which to request geometry.
  4920. * @returns Undefined if not supported, otherwise true or false.
  4921. */
  4922. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  4923. /**
  4924. * Makes sure we load availability data for a tile
  4925. * @param x - The X coordinate of the tile for which to request geometry.
  4926. * @param y - The Y coordinate of the tile for which to request geometry.
  4927. * @param level - The level of the tile for which to request geometry.
  4928. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  4929. */
  4930. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  4931. }
  4932. /**
  4933. * A description of a cylinder.
  4934. * @example
  4935. * // create cylinder geometry
  4936. * const cylinder = new Cesium.CylinderGeometry({
  4937. * length: 200000,
  4938. * topRadius: 80000,
  4939. * bottomRadius: 200000,
  4940. * });
  4941. * const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
  4942. * @param options - Object with the following properties:
  4943. * @param options.length - The length of the cylinder.
  4944. * @param options.topRadius - The radius of the top of the cylinder.
  4945. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4946. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4947. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  4948. */
  4949. export class CylinderGeometry {
  4950. constructor(options: {
  4951. length: number;
  4952. topRadius: number;
  4953. bottomRadius: number;
  4954. slices?: number;
  4955. vertexFormat?: VertexFormat;
  4956. });
  4957. /**
  4958. * The number of elements used to pack the object into an array.
  4959. */
  4960. static packedLength: number;
  4961. /**
  4962. * Stores the provided instance into the provided array.
  4963. * @param value - The value to pack.
  4964. * @param array - The array to pack into.
  4965. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  4966. * @returns The array that was packed into
  4967. */
  4968. static pack(value: CylinderGeometry, array: number[], startingIndex?: number): number[];
  4969. /**
  4970. * Retrieves an instance from a packed array.
  4971. * @param array - The packed array.
  4972. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  4973. * @param [result] - The object into which to store the result.
  4974. * @returns The modified result parameter or a new CylinderGeometry instance if one was not provided.
  4975. */
  4976. static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry;
  4977. /**
  4978. * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
  4979. * @param cylinderGeometry - A description of the cylinder.
  4980. * @returns The computed vertices and indices.
  4981. */
  4982. static createGeometry(cylinderGeometry: CylinderGeometry): Geometry | undefined;
  4983. }
  4984. /**
  4985. * A description of the outline of a cylinder.
  4986. * @example
  4987. * // create cylinder geometry
  4988. * const cylinder = new Cesium.CylinderOutlineGeometry({
  4989. * length: 200000,
  4990. * topRadius: 80000,
  4991. * bottomRadius: 200000,
  4992. * });
  4993. * const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
  4994. * @param options - Object with the following properties:
  4995. * @param options.length - The length of the cylinder.
  4996. * @param options.topRadius - The radius of the top of the cylinder.
  4997. * @param options.bottomRadius - The radius of the bottom of the cylinder.
  4998. * @param [options.slices = 128] - The number of edges around the perimeter of the cylinder.
  4999. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surfaces of the cylinder.
  5000. */
  5001. export class CylinderOutlineGeometry {
  5002. constructor(options: {
  5003. length: number;
  5004. topRadius: number;
  5005. bottomRadius: number;
  5006. slices?: number;
  5007. numberOfVerticalLines?: number;
  5008. });
  5009. /**
  5010. * The number of elements used to pack the object into an array.
  5011. */
  5012. static packedLength: number;
  5013. /**
  5014. * Stores the provided instance into the provided array.
  5015. * @param value - The value to pack.
  5016. * @param array - The array to pack into.
  5017. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5018. * @returns The array that was packed into
  5019. */
  5020. static pack(value: CylinderOutlineGeometry, array: number[], startingIndex?: number): number[];
  5021. /**
  5022. * Retrieves an instance from a packed array.
  5023. * @param array - The packed array.
  5024. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5025. * @param [result] - The object into which to store the result.
  5026. * @returns The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
  5027. */
  5028. static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry;
  5029. /**
  5030. * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
  5031. * @param cylinderGeometry - A description of the cylinder outline.
  5032. * @returns The computed vertices and indices.
  5033. */
  5034. static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry | undefined;
  5035. }
  5036. /**
  5037. * A simple proxy that appends the desired resource as the sole query parameter
  5038. * to the given proxy URL.
  5039. * @param proxy - The proxy URL that will be used to requests all resources.
  5040. */
  5041. export class DefaultProxy extends Proxy {
  5042. constructor(proxy: string);
  5043. /**
  5044. * Get the final URL to use to request a given resource.
  5045. * @param resource - The resource to request.
  5046. * @returns proxied resource
  5047. */
  5048. getURL(resource: string): string;
  5049. }
  5050. /**
  5051. * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
  5052. * argument out of range, etc. This exception should only be thrown during development;
  5053. * it usually indicates a bug in the calling code. This exception should never be
  5054. * caught; instead the calling code should strive not to generate it.
  5055. * <br /><br />
  5056. * On the other hand, a {@link RuntimeError} indicates an exception that may
  5057. * be thrown at runtime, e.g., out of memory, that the calling code should be prepared
  5058. * to catch.
  5059. * @param [message] - The error message for this exception.
  5060. */
  5061. export class DeveloperError extends Error {
  5062. constructor(message?: string);
  5063. /**
  5064. * 'DeveloperError' indicating that this exception was thrown due to a developer error.
  5065. */
  5066. readonly name: string;
  5067. /**
  5068. * The explanation for why this exception was thrown.
  5069. */
  5070. readonly message: string;
  5071. /**
  5072. * The stack trace of this exception, if available.
  5073. */
  5074. readonly stack: string;
  5075. }
  5076. /**
  5077. * Determines visibility based on the distance to the camera.
  5078. * @example
  5079. * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
  5080. * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
  5081. * @param [near = 0.0] - The smallest distance in the interval where the object is visible.
  5082. * @param [far = Number.MAX_VALUE] - The largest distance in the interval where the object is visible.
  5083. */
  5084. export class DistanceDisplayCondition {
  5085. constructor(near?: number, far?: number);
  5086. /**
  5087. * The smallest distance in the interval where the object is visible.
  5088. */
  5089. near: number;
  5090. /**
  5091. * The largest distance in the interval where the object is visible.
  5092. */
  5093. far: number;
  5094. /**
  5095. * The number of elements used to pack the object into an array.
  5096. */
  5097. static packedLength: number;
  5098. /**
  5099. * Stores the provided instance into the provided array.
  5100. * @param value - The value to pack.
  5101. * @param array - The array to pack into.
  5102. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5103. * @returns The array that was packed into
  5104. */
  5105. static pack(value: DistanceDisplayCondition, array: number[], startingIndex?: number): number[];
  5106. /**
  5107. * Retrieves an instance from a packed array.
  5108. * @param array - The packed array.
  5109. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5110. * @param [result] - The object into which to store the result.
  5111. * @returns The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
  5112. */
  5113. static unpack(array: number[], startingIndex?: number, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5114. /**
  5115. * Determines if two distance display conditions are equal.
  5116. * @param left - A distance display condition.
  5117. * @param right - Another distance display condition.
  5118. * @returns Whether the two distance display conditions are equal.
  5119. */
  5120. static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean;
  5121. /**
  5122. * Duplicates a distance display condition instance.
  5123. * @param [value] - The distance display condition to duplicate.
  5124. * @param [result] - The result onto which to store the result.
  5125. * @returns The duplicated instance.
  5126. */
  5127. static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5128. /**
  5129. * Duplicates this instance.
  5130. * @param [result] - The result onto which to store the result.
  5131. * @returns The duplicated instance.
  5132. */
  5133. clone(result?: DistanceDisplayCondition): DistanceDisplayCondition;
  5134. /**
  5135. * Determines if this distance display condition is equal to another.
  5136. * @param other - Another distance display condition.
  5137. * @returns Whether this distance display condition is equal to the other.
  5138. */
  5139. equals(other: DistanceDisplayCondition): boolean;
  5140. }
  5141. /**
  5142. * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
  5143. * @example
  5144. * const instance = new Cesium.GeometryInstance({
  5145. * geometry : new Cesium.BoxGeometry({
  5146. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  5147. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  5148. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  5149. * }),
  5150. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  5151. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  5152. * id : 'box',
  5153. * attributes : {
  5154. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
  5155. * }
  5156. * });
  5157. * @param [near = 0.0] - The near distance.
  5158. * @param [far = Number.MAX_VALUE] - The far distance.
  5159. */
  5160. export class DistanceDisplayConditionGeometryInstanceAttribute {
  5161. constructor(near?: number, far?: number);
  5162. /**
  5163. * The values for the attributes stored in a typed array.
  5164. */
  5165. value: Float32Array;
  5166. /**
  5167. * The datatype of each component in the attribute, e.g., individual elements in
  5168. * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5169. */
  5170. readonly componentDatatype: ComponentDatatype;
  5171. /**
  5172. * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
  5173. */
  5174. readonly componentsPerAttribute: number;
  5175. /**
  5176. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  5177. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  5178. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  5179. */
  5180. readonly normalize: boolean;
  5181. /**
  5182. * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
  5183. * @example
  5184. * const distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);
  5185. * const instance = new Cesium.GeometryInstance({
  5186. * geometry : geometry,
  5187. * attributes : {
  5188. * distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
  5189. * }
  5190. * });
  5191. * @param distanceDisplayCondition - The distance display condition.
  5192. * @returns The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
  5193. */
  5194. static fromDistanceDisplayCondition(distanceDisplayCondition: DistanceDisplayCondition): DistanceDisplayConditionGeometryInstanceAttribute;
  5195. /**
  5196. * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
  5197. * @example
  5198. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  5199. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
  5200. * @param distanceDisplayCondition - The distance display condition value.
  5201. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  5202. * @returns The modified result parameter or a new instance if result was undefined.
  5203. */
  5204. static toValue(distanceDisplayCondition: DistanceDisplayCondition, result?: Float32Array): Float32Array;
  5205. }
  5206. /**
  5207. * Easing functions for use with TweenCollection. These function are from
  5208. * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the
  5209. * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.
  5210. */
  5211. export namespace EasingFunction {
  5212. /**
  5213. * Linear easing.
  5214. */
  5215. const LINEAR_NONE: EasingFunction.Callback;
  5216. /**
  5217. * Quadratic in.
  5218. */
  5219. const QUADRATIC_IN: EasingFunction.Callback;
  5220. /**
  5221. * Quadratic out.
  5222. */
  5223. const QUADRATIC_OUT: EasingFunction.Callback;
  5224. /**
  5225. * Quadratic in then out.
  5226. */
  5227. const QUADRATIC_IN_OUT: EasingFunction.Callback;
  5228. /**
  5229. * Cubic in.
  5230. */
  5231. const CUBIC_IN: EasingFunction.Callback;
  5232. /**
  5233. * Cubic out.
  5234. */
  5235. const CUBIC_OUT: EasingFunction.Callback;
  5236. /**
  5237. * Cubic in then out.
  5238. */
  5239. const CUBIC_IN_OUT: EasingFunction.Callback;
  5240. /**
  5241. * Quartic in.
  5242. */
  5243. const QUARTIC_IN: EasingFunction.Callback;
  5244. /**
  5245. * Quartic out.
  5246. */
  5247. const QUARTIC_OUT: EasingFunction.Callback;
  5248. /**
  5249. * Quartic in then out.
  5250. */
  5251. const QUARTIC_IN_OUT: EasingFunction.Callback;
  5252. /**
  5253. * Quintic in.
  5254. */
  5255. const QUINTIC_IN: EasingFunction.Callback;
  5256. /**
  5257. * Quintic out.
  5258. */
  5259. const QUINTIC_OUT: EasingFunction.Callback;
  5260. /**
  5261. * Quintic in then out.
  5262. */
  5263. const QUINTIC_IN_OUT: EasingFunction.Callback;
  5264. /**
  5265. * Sinusoidal in.
  5266. */
  5267. const SINUSOIDAL_IN: EasingFunction.Callback;
  5268. /**
  5269. * Sinusoidal out.
  5270. */
  5271. const SINUSOIDAL_OUT: EasingFunction.Callback;
  5272. /**
  5273. * Sinusoidal in then out.
  5274. */
  5275. const SINUSOIDAL_IN_OUT: EasingFunction.Callback;
  5276. /**
  5277. * Exponential in.
  5278. */
  5279. const EXPONENTIAL_IN: EasingFunction.Callback;
  5280. /**
  5281. * Exponential out.
  5282. */
  5283. const EXPONENTIAL_OUT: EasingFunction.Callback;
  5284. /**
  5285. * Exponential in then out.
  5286. */
  5287. const EXPONENTIAL_IN_OUT: EasingFunction.Callback;
  5288. /**
  5289. * Circular in.
  5290. */
  5291. const CIRCULAR_IN: EasingFunction.Callback;
  5292. /**
  5293. * Circular out.
  5294. */
  5295. const CIRCULAR_OUT: EasingFunction.Callback;
  5296. /**
  5297. * Circular in then out.
  5298. */
  5299. const CIRCULAR_IN_OUT: EasingFunction.Callback;
  5300. /**
  5301. * Elastic in.
  5302. */
  5303. const ELASTIC_IN: EasingFunction.Callback;
  5304. /**
  5305. * Elastic out.
  5306. */
  5307. const ELASTIC_OUT: EasingFunction.Callback;
  5308. /**
  5309. * Elastic in then out.
  5310. */
  5311. const ELASTIC_IN_OUT: EasingFunction.Callback;
  5312. /**
  5313. * Back in.
  5314. */
  5315. const BACK_IN: EasingFunction.Callback;
  5316. /**
  5317. * Back out.
  5318. */
  5319. const BACK_OUT: EasingFunction.Callback;
  5320. /**
  5321. * Back in then out.
  5322. */
  5323. const BACK_IN_OUT: EasingFunction.Callback;
  5324. /**
  5325. * Bounce in.
  5326. */
  5327. const BOUNCE_IN: EasingFunction.Callback;
  5328. /**
  5329. * Bounce out.
  5330. */
  5331. const BOUNCE_OUT: EasingFunction.Callback;
  5332. /**
  5333. * Bounce in then out.
  5334. */
  5335. const BOUNCE_IN_OUT: EasingFunction.Callback;
  5336. /**
  5337. * Function interface for implementing a custom easing function.
  5338. * @example
  5339. * function quadraticIn(time) {
  5340. * return time * time;
  5341. * }
  5342. * @example
  5343. * function quadraticOut(time) {
  5344. * return time * (2.0 - time);
  5345. * }
  5346. * @param time - The time in the range <code>[0, 1]</code>.
  5347. */
  5348. type Callback = (time: number) => number;
  5349. }
  5350. /**
  5351. * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  5352. * @example
  5353. * // Create an ellipse.
  5354. * const ellipse = new Cesium.EllipseGeometry({
  5355. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5356. * semiMajorAxis : 500000.0,
  5357. * semiMinorAxis : 300000.0,
  5358. * rotation : Cesium.Math.toRadians(60.0)
  5359. * });
  5360. * const geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
  5361. * @param options - Object with the following properties:
  5362. * @param options.center - The ellipse's center point in the fixed frame.
  5363. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5364. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5365. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5366. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5367. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5368. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5369. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates counter-clockwise from north.
  5370. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5371. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5372. */
  5373. export class EllipseGeometry {
  5374. constructor(options: {
  5375. center: Cartesian3;
  5376. semiMajorAxis: number;
  5377. semiMinorAxis: number;
  5378. ellipsoid?: Ellipsoid;
  5379. height?: number;
  5380. extrudedHeight?: number;
  5381. rotation?: number;
  5382. stRotation?: number;
  5383. granularity?: number;
  5384. vertexFormat?: VertexFormat;
  5385. });
  5386. /**
  5387. * The number of elements used to pack the object into an array.
  5388. */
  5389. static packedLength: number;
  5390. /**
  5391. * Stores the provided instance into the provided array.
  5392. * @param value - The value to pack.
  5393. * @param array - The array to pack into.
  5394. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5395. * @returns The array that was packed into
  5396. */
  5397. static pack(value: EllipseGeometry, array: number[], startingIndex?: number): number[];
  5398. /**
  5399. * Retrieves an instance from a packed array.
  5400. * @param array - The packed array.
  5401. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5402. * @param [result] - The object into which to store the result.
  5403. * @returns The modified result parameter or a new EllipseGeometry instance if one was not provided.
  5404. */
  5405. static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry;
  5406. /**
  5407. * Computes the bounding rectangle based on the provided options
  5408. * @param options - Object with the following properties:
  5409. * @param options.center - The ellipse's center point in the fixed frame.
  5410. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5411. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5412. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5413. * @param [options.rotation = 0.0] - The angle of rotation counter-clockwise from north.
  5414. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The angular distance between points on the ellipse in radians.
  5415. * @param [result] - An object in which to store the result
  5416. * @returns The result rectangle
  5417. */
  5418. static computeRectangle(options: {
  5419. center: Cartesian3;
  5420. semiMajorAxis: number;
  5421. semiMinorAxis: number;
  5422. ellipsoid?: Ellipsoid;
  5423. rotation?: number;
  5424. granularity?: number;
  5425. }, result?: Rectangle): Rectangle;
  5426. /**
  5427. * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5428. * @param ellipseGeometry - A description of the ellipse.
  5429. * @returns The computed vertices and indices.
  5430. */
  5431. static createGeometry(ellipseGeometry: EllipseGeometry): Geometry | undefined;
  5432. }
  5433. /**
  5434. * A description of the outline of an ellipse on an ellipsoid.
  5435. * @example
  5436. * const ellipse = new Cesium.EllipseOutlineGeometry({
  5437. * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
  5438. * semiMajorAxis : 500000.0,
  5439. * semiMinorAxis : 300000.0,
  5440. * rotation : Cesium.Math.toRadians(60.0)
  5441. * });
  5442. * const geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
  5443. * @param options - Object with the following properties:
  5444. * @param options.center - The ellipse's center point in the fixed frame.
  5445. * @param options.semiMajorAxis - The length of the ellipse's semi-major axis in meters.
  5446. * @param options.semiMinorAxis - The length of the ellipse's semi-minor axis in meters.
  5447. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid the ellipse will be on.
  5448. * @param [options.height = 0.0] - The distance in meters between the ellipse and the ellipsoid surface.
  5449. * @param [options.extrudedHeight] - The distance in meters between the ellipse's extruded face and the ellipsoid surface.
  5450. * @param [options.rotation = 0.0] - The angle from north (counter-clockwise) in radians.
  5451. * @param [options.granularity = 0.02] - The angular distance between points on the ellipse in radians.
  5452. * @param [options.numberOfVerticalLines = 16] - Number of lines to draw between the top and bottom surface of an extruded ellipse.
  5453. */
  5454. export class EllipseOutlineGeometry {
  5455. constructor(options: {
  5456. center: Cartesian3;
  5457. semiMajorAxis: number;
  5458. semiMinorAxis: number;
  5459. ellipsoid?: Ellipsoid;
  5460. height?: number;
  5461. extrudedHeight?: number;
  5462. rotation?: number;
  5463. granularity?: number;
  5464. numberOfVerticalLines?: number;
  5465. });
  5466. /**
  5467. * The number of elements used to pack the object into an array.
  5468. */
  5469. static packedLength: number;
  5470. /**
  5471. * Stores the provided instance into the provided array.
  5472. * @param value - The value to pack.
  5473. * @param array - The array to pack into.
  5474. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5475. * @returns The array that was packed into
  5476. */
  5477. static pack(value: EllipseOutlineGeometry, array: number[], startingIndex?: number): number[];
  5478. /**
  5479. * Retrieves an instance from a packed array.
  5480. * @param array - The packed array.
  5481. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5482. * @param [result] - The object into which to store the result.
  5483. * @returns The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
  5484. */
  5485. static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry;
  5486. /**
  5487. * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
  5488. * @param ellipseGeometry - A description of the ellipse.
  5489. * @returns The computed vertices and indices.
  5490. */
  5491. static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry | undefined;
  5492. }
  5493. /**
  5494. * A quadratic surface defined in Cartesian coordinates by the equation
  5495. * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>. Primarily used
  5496. * by Cesium to represent the shape of planetary bodies.
  5497. *
  5498. * Rather than constructing this object directly, one of the provided
  5499. * constants is normally used.
  5500. * @param [x = 0] - The radius in the x direction.
  5501. * @param [y = 0] - The radius in the y direction.
  5502. * @param [z = 0] - The radius in the z direction.
  5503. */
  5504. export class Ellipsoid {
  5505. constructor(x?: number, y?: number, z?: number);
  5506. /**
  5507. * Gets the radii of the ellipsoid.
  5508. */
  5509. readonly radii: Cartesian3;
  5510. /**
  5511. * Gets the squared radii of the ellipsoid.
  5512. */
  5513. readonly radiiSquared: Cartesian3;
  5514. /**
  5515. * Gets the radii of the ellipsoid raise to the fourth power.
  5516. */
  5517. readonly radiiToTheFourth: Cartesian3;
  5518. /**
  5519. * Gets one over the radii of the ellipsoid.
  5520. */
  5521. readonly oneOverRadii: Cartesian3;
  5522. /**
  5523. * Gets one over the squared radii of the ellipsoid.
  5524. */
  5525. readonly oneOverRadiiSquared: Cartesian3;
  5526. /**
  5527. * Gets the minimum radius of the ellipsoid.
  5528. */
  5529. readonly minimumRadius: number;
  5530. /**
  5531. * Gets the maximum radius of the ellipsoid.
  5532. */
  5533. readonly maximumRadius: number;
  5534. /**
  5535. * Duplicates an Ellipsoid instance.
  5536. * @param ellipsoid - The ellipsoid to duplicate.
  5537. * @param [result] - The object onto which to store the result, or undefined if a new
  5538. * instance should be created.
  5539. * @returns The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
  5540. */
  5541. static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid;
  5542. /**
  5543. * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
  5544. * @param [cartesian = Cartesian3.ZERO] - The ellipsoid's radius in the x, y, and z directions.
  5545. * @param [result] - The object onto which to store the result, or undefined if a new
  5546. * instance should be created.
  5547. * @returns A new Ellipsoid instance.
  5548. */
  5549. static fromCartesian3(cartesian?: Cartesian3, result?: Ellipsoid): Ellipsoid;
  5550. /**
  5551. * An Ellipsoid instance initialized to the WGS84 standard.
  5552. */
  5553. static readonly WGS84: Ellipsoid;
  5554. /**
  5555. * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
  5556. */
  5557. static readonly UNIT_SPHERE: Ellipsoid;
  5558. /**
  5559. * An Ellipsoid instance initialized to a sphere with the lunar radius.
  5560. */
  5561. static readonly MOON: Ellipsoid;
  5562. /**
  5563. * Duplicates an Ellipsoid instance.
  5564. * @param [result] - The object onto which to store the result, or undefined if a new
  5565. * instance should be created.
  5566. * @returns The cloned Ellipsoid.
  5567. */
  5568. clone(result?: Ellipsoid): Ellipsoid;
  5569. /**
  5570. * The number of elements used to pack the object into an array.
  5571. */
  5572. static packedLength: number;
  5573. /**
  5574. * Stores the provided instance into the provided array.
  5575. * @param value - The value to pack.
  5576. * @param array - The array to pack into.
  5577. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5578. * @returns The array that was packed into
  5579. */
  5580. static pack(value: Ellipsoid, array: number[], startingIndex?: number): number[];
  5581. /**
  5582. * Retrieves an instance from a packed array.
  5583. * @param array - The packed array.
  5584. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5585. * @param [result] - The object into which to store the result.
  5586. * @returns The modified result parameter or a new Ellipsoid instance if one was not provided.
  5587. */
  5588. static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid;
  5589. /**
  5590. * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
  5591. * @param cartesian - The Cartesian for which to to determine the geocentric normal.
  5592. * @param [result] - The object onto which to store the result.
  5593. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5594. */
  5595. geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5596. /**
  5597. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5598. * @param cartographic - The cartographic position for which to to determine the geodetic normal.
  5599. * @param [result] - The object onto which to store the result.
  5600. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5601. */
  5602. geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5603. /**
  5604. * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
  5605. * @param cartesian - The Cartesian position for which to to determine the surface normal.
  5606. * @param [result] - The object onto which to store the result.
  5607. * @returns The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
  5608. */
  5609. geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5610. /**
  5611. * Converts the provided cartographic to Cartesian representation.
  5612. * @example
  5613. * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
  5614. * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
  5615. * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
  5616. * @param cartographic - The cartographic position.
  5617. * @param [result] - The object onto which to store the result.
  5618. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5619. */
  5620. cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  5621. /**
  5622. * Converts the provided array of cartographics to an array of Cartesians.
  5623. * @example
  5624. * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
  5625. * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
  5626. * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
  5627. * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
  5628. * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
  5629. * @param cartographics - An array of cartographic positions.
  5630. * @param [result] - The object onto which to store the result.
  5631. * @returns The modified result parameter or a new Array instance if none was provided.
  5632. */
  5633. cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[];
  5634. /**
  5635. * Converts the provided cartesian to cartographic representation.
  5636. * The cartesian is undefined at the center of the ellipsoid.
  5637. * @example
  5638. * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
  5639. * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
  5640. * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
  5641. * @param cartesian - The Cartesian position to convert to cartographic representation.
  5642. * @param [result] - The object onto which to store the result.
  5643. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
  5644. */
  5645. cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  5646. /**
  5647. * Converts the provided array of cartesians to an array of cartographics.
  5648. * @example
  5649. * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
  5650. * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
  5651. * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
  5652. * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
  5653. * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
  5654. * @param cartesians - An array of Cartesian positions.
  5655. * @param [result] - The object onto which to store the result.
  5656. * @returns The modified result parameter or a new Array instance if none was provided.
  5657. */
  5658. cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[];
  5659. /**
  5660. * Scales the provided Cartesian position along the geodetic surface normal
  5661. * so that it is on the surface of this ellipsoid. If the position is
  5662. * at the center of the ellipsoid, this function returns undefined.
  5663. * @param cartesian - The Cartesian position to scale.
  5664. * @param [result] - The object onto which to store the result.
  5665. * @returns The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
  5666. */
  5667. scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5668. /**
  5669. * Scales the provided Cartesian position along the geocentric surface normal
  5670. * so that it is on the surface of this ellipsoid.
  5671. * @param cartesian - The Cartesian position to scale.
  5672. * @param [result] - The object onto which to store the result.
  5673. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  5674. */
  5675. scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  5676. /**
  5677. * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
  5678. * its components by the result of {@link Ellipsoid#oneOverRadii}.
  5679. * @param position - The position to transform.
  5680. * @param [result] - The position to which to copy the result, or undefined to create and
  5681. * return a new instance.
  5682. * @returns The position expressed in the scaled space. The returned instance is the
  5683. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5684. */
  5685. transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5686. /**
  5687. * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
  5688. * its components by the result of {@link Ellipsoid#radii}.
  5689. * @param position - The position to transform.
  5690. * @param [result] - The position to which to copy the result, or undefined to create and
  5691. * return a new instance.
  5692. * @returns The position expressed in the unscaled space. The returned instance is the
  5693. * one passed as the result parameter if it is not undefined, or a new instance of it is.
  5694. */
  5695. transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3;
  5696. /**
  5697. * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
  5698. * <code>true</code> if they are equal, <code>false</code> otherwise.
  5699. * @param [right] - The other Ellipsoid.
  5700. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  5701. */
  5702. equals(right?: Ellipsoid): boolean;
  5703. /**
  5704. * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5705. * @returns A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
  5706. */
  5707. toString(): string;
  5708. /**
  5709. * Computes a point which is the intersection of the surface normal with the z-axis.
  5710. * @param position - the position. must be on the surface of the ellipsoid.
  5711. * @param [buffer = 0.0] - A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
  5712. * 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.
  5713. * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
  5714. * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
  5715. * @param [result] - The cartesian to which to copy the result, or undefined to create and
  5716. * return a new instance.
  5717. * @returns the intersection point if it's inside the ellipsoid, undefined otherwise
  5718. */
  5719. getSurfaceNormalIntersectionWithZAxis(position: Cartesian3, buffer?: number, result?: Cartesian3): Cartesian3 | undefined;
  5720. /**
  5721. * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
  5722. * Gauss-Legendre 10th order quadrature.
  5723. * @param rectangle - The rectangle used for computing the surface area.
  5724. * @returns The approximate area of the rectangle on the surface of this ellipsoid.
  5725. */
  5726. surfaceArea(rectangle: Rectangle): number;
  5727. }
  5728. /**
  5729. * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
  5730. * @param [start] - The initial planetodetic point on the path.
  5731. * @param [end] - The final planetodetic point on the path.
  5732. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the geodesic lies.
  5733. */
  5734. export class EllipsoidGeodesic {
  5735. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5736. /**
  5737. * Gets the ellipsoid.
  5738. */
  5739. readonly ellipsoid: Ellipsoid;
  5740. /**
  5741. * Gets the surface distance between the start and end point
  5742. */
  5743. readonly surfaceDistance: number;
  5744. /**
  5745. * Gets the initial planetodetic point on the path.
  5746. */
  5747. readonly start: Cartographic;
  5748. /**
  5749. * Gets the final planetodetic point on the path.
  5750. */
  5751. readonly end: Cartographic;
  5752. /**
  5753. * Gets the heading at the initial point.
  5754. */
  5755. readonly startHeading: number;
  5756. /**
  5757. * Gets the heading at the final point.
  5758. */
  5759. readonly endHeading: number;
  5760. /**
  5761. * Sets the start and end points of the geodesic
  5762. * @param start - The initial planetodetic point on the path.
  5763. * @param end - The final planetodetic point on the path.
  5764. */
  5765. setEndPoints(start: Cartographic, end: Cartographic): void;
  5766. /**
  5767. * Provides the location of a point at the indicated portion along the geodesic.
  5768. * @param fraction - The portion of the distance between the initial and final points.
  5769. * @param [result] - The object in which to store the result.
  5770. * @returns The location of the point along the geodesic.
  5771. */
  5772. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5773. /**
  5774. * Provides the location of a point at the indicated distance along the geodesic.
  5775. * @param distance - The distance from the inital point to the point of interest along the geodesic
  5776. * @param [result] - The object in which to store the result.
  5777. * @returns The location of the point along the geodesic.
  5778. */
  5779. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5780. }
  5781. /**
  5782. * A description of an ellipsoid centered at the origin.
  5783. * @example
  5784. * const ellipsoid = new Cesium.EllipsoidGeometry({
  5785. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  5786. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
  5787. * });
  5788. * const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
  5789. * @param [options] - Object with the following properties:
  5790. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5791. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5792. * @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.
  5793. * @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.
  5794. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5795. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5796. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  5797. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  5798. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  5799. */
  5800. export class EllipsoidGeometry {
  5801. constructor(options?: {
  5802. radii?: Cartesian3;
  5803. innerRadii?: Cartesian3;
  5804. minimumClock?: number;
  5805. maximumClock?: number;
  5806. minimumCone?: number;
  5807. maximumCone?: number;
  5808. stackPartitions?: number;
  5809. slicePartitions?: number;
  5810. vertexFormat?: VertexFormat;
  5811. });
  5812. /**
  5813. * The number of elements used to pack the object into an array.
  5814. */
  5815. static packedLength: number;
  5816. /**
  5817. * Stores the provided instance into the provided array.
  5818. * @param value - The value to pack.
  5819. * @param array - The array to pack into.
  5820. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5821. * @returns The array that was packed into
  5822. */
  5823. static pack(value: EllipsoidGeometry, array: number[], startingIndex?: number): number[];
  5824. /**
  5825. * Retrieves an instance from a packed array.
  5826. * @param array - The packed array.
  5827. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5828. * @param [result] - The object into which to store the result.
  5829. * @returns The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
  5830. */
  5831. static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry;
  5832. /**
  5833. * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5834. * @param ellipsoidGeometry - A description of the ellipsoid.
  5835. * @returns The computed vertices and indices.
  5836. */
  5837. static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry | undefined;
  5838. }
  5839. /**
  5840. * A description of the outline of an ellipsoid centered at the origin.
  5841. * @example
  5842. * const ellipsoid = new Cesium.EllipsoidOutlineGeometry({
  5843. * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
  5844. * stackPartitions: 6,
  5845. * slicePartitions: 5
  5846. * });
  5847. * const geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
  5848. * @param [options] - Object with the following properties:
  5849. * @param [options.radii = Cartesian3(1.0, 1.0, 1.0)] - The radii of the ellipsoid in the x, y, and z directions.
  5850. * @param [options.innerRadii = options.radii] - The inner radii of the ellipsoid in the x, y, and z directions.
  5851. * @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.
  5852. * @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.
  5853. * @param [options.minimumCone = 0.0] - The minimum angle measured from the positive z-axis and toward the negative z-axis.
  5854. * @param [options.maximumCone = PI] - The maximum angle measured from the positive z-axis and toward the negative z-axis.
  5855. * @param [options.stackPartitions = 10] - The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
  5856. * @param [options.slicePartitions = 8] - The count of slices for the ellipsoid (Equal to the number of radial lines).
  5857. * @param [options.subdivisions = 128] - The number of points per line, determining the granularity of the curvature.
  5858. */
  5859. export class EllipsoidOutlineGeometry {
  5860. constructor(options?: {
  5861. radii?: Cartesian3;
  5862. innerRadii?: Cartesian3;
  5863. minimumClock?: number;
  5864. maximumClock?: number;
  5865. minimumCone?: number;
  5866. maximumCone?: number;
  5867. stackPartitions?: number;
  5868. slicePartitions?: number;
  5869. subdivisions?: number;
  5870. });
  5871. /**
  5872. * The number of elements used to pack the object into an array.
  5873. */
  5874. static packedLength: number;
  5875. /**
  5876. * Stores the provided instance into the provided array.
  5877. * @param value - The value to pack.
  5878. * @param array - The array to pack into.
  5879. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  5880. * @returns The array that was packed into
  5881. */
  5882. static pack(value: EllipsoidOutlineGeometry, array: number[], startingIndex?: number): number[];
  5883. /**
  5884. * Retrieves an instance from a packed array.
  5885. * @param array - The packed array.
  5886. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  5887. * @param [result] - The object into which to store the result.
  5888. * @returns The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
  5889. */
  5890. static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry;
  5891. /**
  5892. * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
  5893. * @param ellipsoidGeometry - A description of the ellipsoid outline.
  5894. * @returns The computed vertices and indices.
  5895. */
  5896. static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry | undefined;
  5897. }
  5898. /**
  5899. * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
  5900. * @param [start] - The initial planetodetic point on the path.
  5901. * @param [end] - The final planetodetic point on the path.
  5902. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5903. */
  5904. export class EllipsoidRhumbLine {
  5905. constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid);
  5906. /**
  5907. * Gets the ellipsoid.
  5908. */
  5909. readonly ellipsoid: Ellipsoid;
  5910. /**
  5911. * Gets the surface distance between the start and end point
  5912. */
  5913. readonly surfaceDistance: number;
  5914. /**
  5915. * Gets the initial planetodetic point on the path.
  5916. */
  5917. readonly start: Cartographic;
  5918. /**
  5919. * Gets the final planetodetic point on the path.
  5920. */
  5921. readonly end: Cartographic;
  5922. /**
  5923. * Gets the heading from the start point to the end point.
  5924. */
  5925. readonly heading: number;
  5926. /**
  5927. * Create a rhumb line using an initial position with a heading and distance.
  5928. * @param start - The initial planetodetic point on the path.
  5929. * @param heading - The heading in radians.
  5930. * @param distance - The rhumb line distance between the start and end point.
  5931. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rhumb line lies.
  5932. * @param [result] - The object in which to store the result.
  5933. * @returns The EllipsoidRhumbLine object.
  5934. */
  5935. static fromStartHeadingDistance(start: Cartographic, heading: number, distance: number, ellipsoid?: Ellipsoid, result?: EllipsoidRhumbLine): EllipsoidRhumbLine;
  5936. /**
  5937. * Sets the start and end points of the rhumb line.
  5938. * @param start - The initial planetodetic point on the path.
  5939. * @param end - The final planetodetic point on the path.
  5940. */
  5941. setEndPoints(start: Cartographic, end: Cartographic): void;
  5942. /**
  5943. * Provides the location of a point at the indicated portion along the rhumb line.
  5944. * @param fraction - The portion of the distance between the initial and final points.
  5945. * @param [result] - The object in which to store the result.
  5946. * @returns The location of the point along the rhumb line.
  5947. */
  5948. interpolateUsingFraction(fraction: number, result?: Cartographic): Cartographic;
  5949. /**
  5950. * Provides the location of a point at the indicated distance along the rhumb line.
  5951. * @param distance - The distance from the inital point to the point of interest along the rhumbLine.
  5952. * @param [result] - The object in which to store the result.
  5953. * @returns The location of the point along the rhumb line.
  5954. */
  5955. interpolateUsingSurfaceDistance(distance: number, result?: Cartographic): Cartographic;
  5956. /**
  5957. * Provides the location of a point at the indicated longitude along the rhumb line.
  5958. * 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.
  5959. * @param intersectionLongitude - The longitude, in radians, at which to find the intersection point from the starting point using the heading.
  5960. * @param [result] - The object in which to store the result.
  5961. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5962. */
  5963. findIntersectionWithLongitude(intersectionLongitude: number, result?: Cartographic): Cartographic;
  5964. /**
  5965. * Provides the location of a point at the indicated latitude along the rhumb line.
  5966. * 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.
  5967. * @param intersectionLatitude - The latitude, in radians, at which to find the intersection point from the starting point using the heading.
  5968. * @param [result] - The object in which to store the result.
  5969. * @returns The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
  5970. */
  5971. findIntersectionWithLatitude(intersectionLatitude: number, result?: Cartographic): Cartographic;
  5972. }
  5973. /**
  5974. * A plane tangent to the provided ellipsoid at the provided origin.
  5975. * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
  5976. * If origin is at the center of the ellipsoid, an exception will be thrown.
  5977. * @param origin - The point on the surface of the ellipsoid where the tangent plane touches.
  5978. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  5979. */
  5980. export class EllipsoidTangentPlane {
  5981. constructor(origin: Cartesian3, ellipsoid?: Ellipsoid);
  5982. /**
  5983. * Gets the ellipsoid.
  5984. */
  5985. ellipsoid: Ellipsoid;
  5986. /**
  5987. * Gets the origin.
  5988. */
  5989. origin: Cartesian3;
  5990. /**
  5991. * Gets the plane which is tangent to the ellipsoid.
  5992. */
  5993. readonly plane: Plane;
  5994. /**
  5995. * Gets the local X-axis (east) of the tangent plane.
  5996. */
  5997. readonly xAxis: Cartesian3;
  5998. /**
  5999. * Gets the local Y-axis (north) of the tangent plane.
  6000. */
  6001. readonly yAxis: Cartesian3;
  6002. /**
  6003. * Gets the local Z-axis (up) of the tangent plane.
  6004. */
  6005. readonly zAxis: Cartesian3;
  6006. /**
  6007. * Creates a new instance from the provided ellipsoid and the center
  6008. * point of the provided Cartesians.
  6009. * @param cartesians - The list of positions surrounding the center point.
  6010. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  6011. * @returns The new instance of EllipsoidTangentPlane.
  6012. */
  6013. static fromPoints(cartesians: Cartesian3[], ellipsoid?: Ellipsoid): EllipsoidTangentPlane;
  6014. /**
  6015. * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
  6016. * @param cartesian - The point to project.
  6017. * @param [result] - The object onto which to store the result.
  6018. * @returns The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
  6019. */
  6020. projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  6021. /**
  6022. * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
  6023. * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
  6024. * @param cartesians - The array of points to project.
  6025. * @param [result] - The array of Cartesian2 instances onto which to store results.
  6026. * @returns The modified result parameter or a new array of Cartesian2 instances if none was provided.
  6027. */
  6028. projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  6029. /**
  6030. * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
  6031. * @param cartesian - The point to project.
  6032. * @param [result] - The object onto which to store the result.
  6033. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  6034. */
  6035. projectPointToNearestOnPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2;
  6036. /**
  6037. * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
  6038. * @param cartesians - The array of points to project.
  6039. * @param [result] - The array of Cartesian2 instances onto which to store results.
  6040. * @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>.
  6041. */
  6042. projectPointsToNearestOnPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[];
  6043. /**
  6044. * Computes the projection of the provided 2D position onto the 3D ellipsoid.
  6045. * @param cartesian - The points to project.
  6046. * @param [result] - The Cartesian3 instance to store result.
  6047. * @returns The modified result parameter or a new Cartesian3 instance if none was provided.
  6048. */
  6049. projectPointOntoEllipsoid(cartesian: Cartesian2, result?: Cartesian3): Cartesian3;
  6050. /**
  6051. * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
  6052. * @param cartesians - The array of points to project.
  6053. * @param [result] - The array of Cartesian3 instances onto which to store results.
  6054. * @returns The modified result parameter or a new array of Cartesian3 instances if none was provided.
  6055. */
  6056. projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[];
  6057. }
  6058. /**
  6059. * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
  6060. * surface.
  6061. * @param [options] - Object with the following properties:
  6062. * @param [options.tilingScheme] - The tiling scheme specifying how the ellipsoidal
  6063. * surface is broken into tiles. If this parameter is not provided, a {@link GeographicTilingScheme}
  6064. * is used.
  6065. * @param [options.ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  6066. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  6067. * parameter is specified, the WGS84 ellipsoid is used.
  6068. */
  6069. export class EllipsoidTerrainProvider {
  6070. constructor(options?: {
  6071. tilingScheme?: TilingScheme;
  6072. ellipsoid?: Ellipsoid;
  6073. });
  6074. /**
  6075. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  6076. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  6077. * are passed an instance of {@link TileProviderError}.
  6078. */
  6079. readonly errorEvent: Event;
  6080. /**
  6081. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  6082. * the source of the terrain. This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6083. */
  6084. readonly credit: Credit;
  6085. /**
  6086. * Gets the tiling scheme used by this provider. This function should
  6087. * not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6088. */
  6089. readonly tilingScheme: GeographicTilingScheme;
  6090. /**
  6091. * Gets a value indicating whether or not the provider is ready for use.
  6092. */
  6093. readonly ready: boolean;
  6094. /**
  6095. * Gets a promise that resolves to true when the provider is ready for use.
  6096. */
  6097. readonly readyPromise: Promise<boolean>;
  6098. /**
  6099. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  6100. * indicates which areas of the globe are water rather than land, so they can be rendered
  6101. * as a reflective surface with animated waves. This function should not be
  6102. * called before {@link EllipsoidTerrainProvider#ready} returns true.
  6103. */
  6104. readonly hasWaterMask: boolean;
  6105. /**
  6106. * Gets a value indicating whether or not the requested tiles include vertex normals.
  6107. * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
  6108. */
  6109. readonly hasVertexNormals: boolean;
  6110. /**
  6111. * Gets an object that can be used to determine availability of terrain from this provider, such as
  6112. * at points and in rectangles. This function should not be called before
  6113. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  6114. * information is not available.
  6115. */
  6116. readonly availability: TileAvailability;
  6117. /**
  6118. * Requests the geometry for a given tile. This function should not be called before
  6119. * {@link TerrainProvider#ready} returns true. The result includes terrain
  6120. * data and indicates that all child tiles are available.
  6121. * @param x - The X coordinate of the tile for which to request geometry.
  6122. * @param y - The Y coordinate of the tile for which to request geometry.
  6123. * @param level - The level of the tile for which to request geometry.
  6124. * @param [request] - The request object. Intended for internal use only.
  6125. * @returns A promise for the requested geometry. If this method
  6126. * returns undefined instead of a promise, it is an indication that too many requests are already
  6127. * pending and the request will be retried later.
  6128. */
  6129. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  6130. /**
  6131. * Gets the maximum geometric error allowed in a tile at a given level.
  6132. * @param level - The tile level for which to get the maximum geometric error.
  6133. * @returns The maximum geometric error.
  6134. */
  6135. getLevelMaximumGeometricError(level: number): number;
  6136. /**
  6137. * Determines whether data for a tile is available to be loaded.
  6138. * @param x - The X coordinate of the tile for which to request geometry.
  6139. * @param y - The Y coordinate of the tile for which to request geometry.
  6140. * @param level - The level of the tile for which to request geometry.
  6141. * @returns Undefined if not supported, otherwise true or false.
  6142. */
  6143. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  6144. /**
  6145. * Makes sure we load availability data for a tile
  6146. * @param x - The X coordinate of the tile for which to request geometry.
  6147. * @param y - The Y coordinate of the tile for which to request geometry.
  6148. * @param level - The level of the tile for which to request geometry.
  6149. * @returns This provider does not support loading availability.
  6150. */
  6151. loadTileDataAvailability(x: number, y: number, level: number): undefined;
  6152. }
  6153. /**
  6154. * A generic utility class for managing subscribers for a particular event.
  6155. * This class is usually instantiated inside of a container class and
  6156. * exposed as a property for others to subscribe to.
  6157. * @example
  6158. * MyObject.prototype.myListener = function(arg1, arg2) {
  6159. * this.myArg1Copy = arg1;
  6160. * this.myArg2Copy = arg2;
  6161. * }
  6162. *
  6163. * const myObjectInstance = new MyObject();
  6164. * const evt = new Cesium.Event();
  6165. * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
  6166. * evt.raiseEvent('1', '2');
  6167. * evt.removeEventListener(MyObject.prototype.myListener);
  6168. */
  6169. export class Event<Listener extends (...args: any[]) => void = (...args: any[]) => void> {
  6170. constructor();
  6171. /**
  6172. * The number of listeners currently subscribed to the event.
  6173. */
  6174. readonly numberOfListeners: number;
  6175. /**
  6176. * Registers a callback function to be executed whenever the event is raised.
  6177. * An optional scope can be provided to serve as the <code>this</code> pointer
  6178. * in which the function will execute.
  6179. * @param listener - The function to be executed when the event is raised.
  6180. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6181. * pointer in which the listener function will execute.
  6182. * @returns A function that will remove this event listener when invoked.
  6183. */
  6184. addEventListener(listener: Listener, scope?: any): Event.RemoveCallback;
  6185. /**
  6186. * Unregisters a previously registered callback.
  6187. * @param listener - The function to be unregistered.
  6188. * @param [scope] - The scope that was originally passed to addEventListener.
  6189. * @returns <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.
  6190. */
  6191. removeEventListener(listener: Listener, scope?: any): boolean;
  6192. /**
  6193. * Raises the event by calling each registered listener with all supplied arguments.
  6194. * @param arguments - This method takes any number of parameters and passes them through to the listener functions.
  6195. */
  6196. raiseEvent(...arguments: Parameters<Listener>[]): void;
  6197. }
  6198. export namespace Event {
  6199. /**
  6200. * A function that removes a listener.
  6201. */
  6202. type RemoveCallback = () => void;
  6203. }
  6204. /**
  6205. * A convenience object that simplifies the common pattern of attaching event listeners
  6206. * to several events, then removing all those listeners at once later, for example, in
  6207. * a destroy method.
  6208. * @example
  6209. * const helper = new Cesium.EventHelper();
  6210. *
  6211. * helper.add(someObject.event, listener1, this);
  6212. * helper.add(otherObject.event, listener2, this);
  6213. *
  6214. * // later...
  6215. * helper.removeAll();
  6216. */
  6217. export class EventHelper {
  6218. constructor();
  6219. /**
  6220. * Adds a listener to an event, and records the registration to be cleaned up later.
  6221. * @param event - The event to attach to.
  6222. * @param listener - The function to be executed when the event is raised.
  6223. * @param [scope] - An optional object scope to serve as the <code>this</code>
  6224. * pointer in which the listener function will execute.
  6225. * @returns A function that will remove this event listener when invoked.
  6226. */
  6227. add(event: Event, listener: (...params: any[]) => any, scope?: any): EventHelper.RemoveCallback;
  6228. /**
  6229. * Unregisters all previously added listeners.
  6230. */
  6231. removeAll(): void;
  6232. }
  6233. export namespace EventHelper {
  6234. /**
  6235. * A function that removes a listener.
  6236. */
  6237. type RemoveCallback = () => void;
  6238. }
  6239. /**
  6240. * Flags to enable experimental features in CesiumJS. Stability and performance
  6241. * may not be optimal when these are enabled. Experimental features are subject
  6242. * to change without Cesium's standard deprecation policy.
  6243. * <p>
  6244. * Experimental features must still uphold Cesium's quality standards. Here
  6245. * are some guidelines:
  6246. * </p>
  6247. * <ul>
  6248. * <li>Experimental features must have high unit test coverage like any other feature.</li>
  6249. * <li>Experimental features are intended for large features where there is benefit of merging some of the code sooner (e.g. to avoid long-running staging branches)</li>
  6250. * <li>Experimental flags should be short-lived. Make it clear in the PR what it would take to promote the feature to a regular feature.</li>
  6251. * <li>To avoid cluttering the code, check the flag in as few places as possible. Ideally this would be a single place.</li>
  6252. * </ul>
  6253. */
  6254. export namespace ExperimentalFeatures {
  6255. /**
  6256. * Toggles the usage of the ModelExperimental class.
  6257. */
  6258. var enableModelExperimental: boolean;
  6259. }
  6260. /**
  6261. * Constants to determine how an interpolated value is extrapolated
  6262. * when querying outside the bounds of available data.
  6263. */
  6264. export enum ExtrapolationType {
  6265. /**
  6266. * No extrapolation occurs.
  6267. */
  6268. NONE = 0,
  6269. /**
  6270. * The first or last value is used when outside the range of sample data.
  6271. */
  6272. HOLD = 1,
  6273. /**
  6274. * The value is extrapolated.
  6275. */
  6276. EXTRAPOLATE = 2
  6277. }
  6278. /**
  6279. * A set of functions to detect whether the current browser supports
  6280. * various features.
  6281. */
  6282. export namespace FeatureDetection {
  6283. /**
  6284. * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.
  6285. * @returns true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.
  6286. */
  6287. function supportsBasis(scene: Scene): boolean;
  6288. /**
  6289. * Detects whether the current browser supports the full screen standard.
  6290. * @returns true if the browser supports the full screen standard, false if not.
  6291. */
  6292. function supportsFullscreen(): boolean;
  6293. /**
  6294. * Detects whether the current browser supports typed arrays.
  6295. * @returns true if the browser supports typed arrays, false if not.
  6296. */
  6297. function supportsTypedArrays(): boolean;
  6298. /**
  6299. * Detects whether the current browser supports BigInt64Array typed arrays.
  6300. * @returns true if the browser supports BigInt64Array typed arrays, false if not.
  6301. */
  6302. function supportsBigInt64Array(): boolean;
  6303. /**
  6304. * Detects whether the current browser supports BigUint64Array typed arrays.
  6305. * @returns true if the browser supports BigUint64Array typed arrays, false if not.
  6306. */
  6307. function supportsBigUint64Array(): boolean;
  6308. /**
  6309. * Detects whether the current browser supports BigInt.
  6310. * @returns true if the browser supports BigInt, false if not.
  6311. */
  6312. function supportsBigInt(): boolean;
  6313. /**
  6314. * Detects whether the current browser supports Web Workers.
  6315. * @returns true if the browsers supports Web Workers, false if not.
  6316. */
  6317. function supportsWebWorkers(): boolean;
  6318. /**
  6319. * Detects whether the current browser supports Web Assembly.
  6320. * @returns true if the browsers supports Web Assembly, false if not.
  6321. */
  6322. function supportsWebAssembly(): boolean;
  6323. }
  6324. /**
  6325. * Describes a frustum at the given the origin and orientation.
  6326. * @param options - Object with the following properties:
  6327. * @param options.frustum - The frustum.
  6328. * @param options.origin - The origin of the frustum.
  6329. * @param options.orientation - The orientation of the frustum.
  6330. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  6331. */
  6332. export class FrustumGeometry {
  6333. constructor(options: {
  6334. frustum: PerspectiveFrustum | OrthographicFrustum;
  6335. origin: Cartesian3;
  6336. orientation: Quaternion;
  6337. vertexFormat?: VertexFormat;
  6338. });
  6339. /**
  6340. * The number of elements used to pack the object into an array.
  6341. */
  6342. packedLength: number;
  6343. /**
  6344. * Stores the provided instance into the provided array.
  6345. * @param value - The value to pack.
  6346. * @param array - The array to pack into.
  6347. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6348. * @returns The array that was packed into
  6349. */
  6350. static pack(value: FrustumGeometry, array: number[], startingIndex?: number): number[];
  6351. /**
  6352. * Retrieves an instance from a packed array.
  6353. * @param array - The packed array.
  6354. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6355. * @param [result] - The object into which to store the result.
  6356. */
  6357. static unpack(array: number[], startingIndex?: number, result?: FrustumGeometry): void;
  6358. /**
  6359. * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
  6360. * @param frustumGeometry - A description of the frustum.
  6361. * @returns The computed vertices and indices.
  6362. */
  6363. static createGeometry(frustumGeometry: FrustumGeometry): Geometry | undefined;
  6364. }
  6365. /**
  6366. * A description of the outline of a frustum with the given the origin and orientation.
  6367. * @param options - Object with the following properties:
  6368. * @param options.frustum - The frustum.
  6369. * @param options.origin - The origin of the frustum.
  6370. * @param options.orientation - The orientation of the frustum.
  6371. */
  6372. export class FrustumOutlineGeometry {
  6373. constructor(options: {
  6374. frustum: PerspectiveFrustum | OrthographicFrustum;
  6375. origin: Cartesian3;
  6376. orientation: Quaternion;
  6377. });
  6378. /**
  6379. * The number of elements used to pack the object into an array.
  6380. */
  6381. packedLength: number;
  6382. /**
  6383. * Stores the provided instance into the provided array.
  6384. * @param value - The value to pack.
  6385. * @param array - The array to pack into.
  6386. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  6387. * @returns The array that was packed into
  6388. */
  6389. static pack(value: FrustumOutlineGeometry, array: number[], startingIndex?: number): number[];
  6390. /**
  6391. * Retrieves an instance from a packed array.
  6392. * @param array - The packed array.
  6393. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  6394. * @param [result] - The object into which to store the result.
  6395. */
  6396. static unpack(array: number[], startingIndex?: number, result?: FrustumOutlineGeometry): void;
  6397. /**
  6398. * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
  6399. * @param frustumGeometry - A description of the frustum.
  6400. * @returns The computed vertices and indices.
  6401. */
  6402. static createGeometry(frustumGeometry: FrustumOutlineGeometry): Geometry | undefined;
  6403. }
  6404. /**
  6405. * Browser-independent functions for working with the standard fullscreen API.
  6406. */
  6407. export namespace Fullscreen {
  6408. /**
  6409. * The element that is currently fullscreen, if any. To simply check if the
  6410. * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
  6411. */
  6412. const element: any;
  6413. /**
  6414. * The name of the event on the document that is fired when fullscreen is
  6415. * entered or exited. This event name is intended for use with addEventListener.
  6416. * In your event handler, to determine if the browser is in fullscreen mode or not,
  6417. * use {@link Fullscreen#fullscreen}.
  6418. */
  6419. const changeEventName: string;
  6420. /**
  6421. * The name of the event that is fired when a fullscreen error
  6422. * occurs. This event name is intended for use with addEventListener.
  6423. */
  6424. const errorEventName: string;
  6425. /**
  6426. * Determine whether the browser will allow an element to be made fullscreen, or not.
  6427. * For example, by default, iframes cannot go fullscreen unless the containing page
  6428. * adds an "allowfullscreen" attribute (or prefixed equivalent).
  6429. */
  6430. const enabled: boolean;
  6431. /**
  6432. * Determines if the browser is currently in fullscreen mode.
  6433. */
  6434. const fullscreen: boolean;
  6435. /**
  6436. * Detects whether the browser supports the standard fullscreen API.
  6437. * @returns <code>true</code> if the browser supports the standard fullscreen API,
  6438. * <code>false</code> otherwise.
  6439. */
  6440. function supportsFullscreen(): boolean;
  6441. /**
  6442. * Asynchronously requests the browser to enter fullscreen mode on the given element.
  6443. * If fullscreen mode is not supported by the browser, does nothing.
  6444. * @example
  6445. * // Put the entire page into fullscreen.
  6446. * Cesium.Fullscreen.requestFullscreen(document.body)
  6447. *
  6448. * // Place only the Cesium canvas into fullscreen.
  6449. * Cesium.Fullscreen.requestFullscreen(scene.canvas)
  6450. * @param element - The HTML element which will be placed into fullscreen mode.
  6451. * @param [vrDevice] - The HMDVRDevice device.
  6452. */
  6453. function requestFullscreen(element: any, vrDevice?: any): void;
  6454. /**
  6455. * Asynchronously exits fullscreen mode. If the browser is not currently
  6456. * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
  6457. */
  6458. function exitFullscreen(): void;
  6459. }
  6460. /**
  6461. * The type of geocoding to be performed by a {@link GeocoderService}.
  6462. */
  6463. export enum GeocodeType {
  6464. /**
  6465. * Perform a search where the input is considered complete.
  6466. */
  6467. SEARCH = 0,
  6468. /**
  6469. * Perform an auto-complete using partial input, typically
  6470. * reserved for providing possible results as a user is typing.
  6471. */
  6472. AUTOCOMPLETE = 1
  6473. }
  6474. export namespace GeocoderService {
  6475. /**
  6476. * @property displayName - The display name for a location
  6477. * @property destination - The bounding box for a location
  6478. */
  6479. type Result = {
  6480. displayName: string;
  6481. destination: Rectangle | Cartesian3;
  6482. };
  6483. }
  6484. /**
  6485. * Provides geocoding through an external service. This type describes an interface and
  6486. * is not intended to be used.
  6487. */
  6488. export class GeocoderService {
  6489. constructor();
  6490. /**
  6491. * @param query - The query to be sent to the geocoder service
  6492. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  6493. */
  6494. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  6495. }
  6496. /**
  6497. * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
  6498. * them by the {@link Ellipsoid#maximumRadius}. This projection
  6499. * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
  6500. * is also known as EPSG:4326.
  6501. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  6502. */
  6503. export class GeographicProjection {
  6504. constructor(ellipsoid?: Ellipsoid);
  6505. /**
  6506. * Gets the {@link Ellipsoid}.
  6507. */
  6508. readonly ellipsoid: Ellipsoid;
  6509. /**
  6510. * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
  6511. * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
  6512. * ellipsoid. Z is the unmodified height.
  6513. * @param cartographic - The coordinates to project.
  6514. * @param [result] - An instance into which to copy the result. If this parameter is
  6515. * undefined, a new instance is created and returned.
  6516. * @returns The projected coordinates. If the result parameter is not undefined, the
  6517. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6518. * created and returned.
  6519. */
  6520. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  6521. /**
  6522. * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  6523. * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
  6524. * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
  6525. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  6526. * @param [result] - An instance into which to copy the result. If this parameter is
  6527. * undefined, a new instance is created and returned.
  6528. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  6529. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  6530. * created and returned.
  6531. */
  6532. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  6533. }
  6534. /**
  6535. * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
  6536. * longitude and latitude are directly mapped to X and Y. This projection is commonly
  6537. * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
  6538. * @param [options] - Object with the following properties:
  6539. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  6540. * the WGS84 ellipsoid.
  6541. * @param [options.rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the tiling scheme.
  6542. * @param [options.numberOfLevelZeroTilesX = 2] - The number of tiles in the X direction at level zero of
  6543. * the tile tree.
  6544. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  6545. * the tile tree.
  6546. */
  6547. export class GeographicTilingScheme {
  6548. constructor(options?: {
  6549. ellipsoid?: Ellipsoid;
  6550. rectangle?: Rectangle;
  6551. numberOfLevelZeroTilesX?: number;
  6552. numberOfLevelZeroTilesY?: number;
  6553. });
  6554. /**
  6555. * Gets the ellipsoid that is tiled by this tiling scheme.
  6556. */
  6557. ellipsoid: Ellipsoid;
  6558. /**
  6559. * Gets the rectangle, in radians, covered by this tiling scheme.
  6560. */
  6561. rectangle: Rectangle;
  6562. /**
  6563. * Gets the map projection used by this tiling scheme.
  6564. */
  6565. projection: MapProjection;
  6566. /**
  6567. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  6568. * @param level - The level-of-detail.
  6569. * @returns The number of tiles in the X direction at the given level.
  6570. */
  6571. getNumberOfXTilesAtLevel(level: number): number;
  6572. /**
  6573. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  6574. * @param level - The level-of-detail.
  6575. * @returns The number of tiles in the Y direction at the given level.
  6576. */
  6577. getNumberOfYTilesAtLevel(level: number): number;
  6578. /**
  6579. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  6580. * of this tiling scheme.
  6581. * @param rectangle - The rectangle to transform.
  6582. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6583. * should be created.
  6584. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  6585. * is undefined.
  6586. */
  6587. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  6588. /**
  6589. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  6590. * of the tiling scheme.
  6591. * @param x - The integer x coordinate of the tile.
  6592. * @param y - The integer y coordinate of the tile.
  6593. * @param level - The tile level-of-detail. Zero is the least detailed.
  6594. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6595. * should be created.
  6596. * @returns The specified 'result', or a new object containing the rectangle
  6597. * if 'result' is undefined.
  6598. */
  6599. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6600. /**
  6601. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  6602. * @param x - The integer x coordinate of the tile.
  6603. * @param y - The integer y coordinate of the tile.
  6604. * @param level - The tile level-of-detail. Zero is the least detailed.
  6605. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6606. * should be created.
  6607. * @returns The specified 'result', or a new object containing the rectangle
  6608. * if 'result' is undefined.
  6609. */
  6610. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  6611. /**
  6612. * Calculates the tile x, y coordinates of the tile containing
  6613. * a given cartographic position.
  6614. * @param position - The position.
  6615. * @param level - The tile level-of-detail. Zero is the least detailed.
  6616. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  6617. * should be created.
  6618. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  6619. * if 'result' is undefined.
  6620. */
  6621. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  6622. }
  6623. /**
  6624. * A geometry representation with attributes forming vertices and optional index data
  6625. * defining primitives. Geometries and an {@link Appearance}, which describes the shading,
  6626. * can be assigned to a {@link Primitive} for visualization. A <code>Primitive</code> can
  6627. * be created from many heterogeneous - in many cases - geometries for performance.
  6628. * <p>
  6629. * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
  6630. * </p>
  6631. * @example
  6632. * // Create geometry with a position attribute and indexed lines.
  6633. * const positions = new Float64Array([
  6634. * 0.0, 0.0, 0.0,
  6635. * 7500000.0, 0.0, 0.0,
  6636. * 0.0, 7500000.0, 0.0
  6637. * ]);
  6638. *
  6639. * const geometry = new Cesium.Geometry({
  6640. * attributes : {
  6641. * position : new Cesium.GeometryAttribute({
  6642. * componentDatatype : Cesium.ComponentDatatype.DOUBLE,
  6643. * componentsPerAttribute : 3,
  6644. * values : positions
  6645. * })
  6646. * },
  6647. * indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
  6648. * primitiveType : Cesium.PrimitiveType.LINES,
  6649. * boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
  6650. * });
  6651. * @param options - Object with the following properties:
  6652. * @param options.attributes - Attributes, which make up the geometry's vertices.
  6653. * @param [options.primitiveType = PrimitiveType.TRIANGLES] - The type of primitives in the geometry.
  6654. * @param [options.indices] - Optional index data that determines the primitives in the geometry.
  6655. * @param [options.boundingSphere] - An optional bounding sphere that fully enclosed the geometry.
  6656. */
  6657. export class Geometry {
  6658. constructor(options: {
  6659. attributes: GeometryAttributes;
  6660. primitiveType?: PrimitiveType;
  6661. indices?: Uint16Array | Uint32Array;
  6662. boundingSphere?: BoundingSphere;
  6663. });
  6664. /**
  6665. * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a
  6666. * {@link GeometryAttribute} containing the attribute's data.
  6667. * <p>
  6668. * Attributes are always stored non-interleaved in a Geometry.
  6669. * </p>
  6670. * <p>
  6671. * There are reserved attribute names with well-known semantics. The following attributes
  6672. * are created by a Geometry (depending on the provided {@link VertexFormat}.
  6673. * <ul>
  6674. * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li>
  6675. * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li>
  6676. * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li>
  6677. * <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>
  6678. * <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>
  6679. * </ul>
  6680. * </p>
  6681. * <p>
  6682. * The following attribute names are generally not created by a Geometry, but are added
  6683. * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
  6684. * the geometry for rendering.
  6685. * <ul>
  6686. * <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>
  6687. * <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>
  6688. * <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>
  6689. * <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>
  6690. * <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>
  6691. * <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>
  6692. * </ul>
  6693. * </p>
  6694. * @example
  6695. * geometry.attributes.position = new Cesium.GeometryAttribute({
  6696. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6697. * componentsPerAttribute : 3,
  6698. * values : new Float32Array(0)
  6699. * });
  6700. */
  6701. attributes: GeometryAttributes;
  6702. /**
  6703. * Optional index data that - along with {@link Geometry#primitiveType} -
  6704. * determines the primitives in the geometry.
  6705. */
  6706. indices: any[];
  6707. /**
  6708. * The type of primitives in the geometry. This is most often {@link PrimitiveType.TRIANGLES},
  6709. * but can varying based on the specific geometry.
  6710. */
  6711. primitiveType: PrimitiveType;
  6712. /**
  6713. * An optional bounding sphere that fully encloses the geometry. This is
  6714. * commonly used for culling.
  6715. */
  6716. boundingSphere: BoundingSphere;
  6717. /**
  6718. * Computes the number of vertices in a geometry. The runtime is linear with
  6719. * respect to the number of attributes in a vertex, not the number of vertices.
  6720. * @example
  6721. * const numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);
  6722. * @param geometry - The geometry.
  6723. * @returns The number of vertices in the geometry.
  6724. */
  6725. static computeNumberOfVertices(geometry: Geometry): number;
  6726. }
  6727. /**
  6728. * Values and type information for geometry attributes. A {@link Geometry}
  6729. * generally contains one or more attributes. All attributes together form
  6730. * the geometry's vertices.
  6731. * @example
  6732. * const geometry = new Cesium.Geometry({
  6733. * attributes : {
  6734. * position : new Cesium.GeometryAttribute({
  6735. * componentDatatype : Cesium.ComponentDatatype.FLOAT,
  6736. * componentsPerAttribute : 3,
  6737. * values : new Float32Array([
  6738. * 0.0, 0.0, 0.0,
  6739. * 7500000.0, 0.0, 0.0,
  6740. * 0.0, 7500000.0, 0.0
  6741. * ])
  6742. * })
  6743. * },
  6744. * primitiveType : Cesium.PrimitiveType.LINE_LOOP
  6745. * });
  6746. * @param [options] - Object with the following properties:
  6747. * @param [options.componentDatatype] - The datatype of each component in the attribute, e.g., individual elements in values.
  6748. * @param [options.componentsPerAttribute] - A number between 1 and 4 that defines the number of components in an attributes.
  6749. * @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.
  6750. * @param [options.values] - The values for the attributes stored in a typed array.
  6751. */
  6752. export class GeometryAttribute {
  6753. constructor(options?: {
  6754. componentDatatype?: ComponentDatatype;
  6755. componentsPerAttribute?: number;
  6756. normalize?: boolean;
  6757. values?: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6758. });
  6759. /**
  6760. * The datatype of each component in the attribute, e.g., individual elements in
  6761. * {@link GeometryAttribute#values}.
  6762. */
  6763. componentDatatype: ComponentDatatype;
  6764. /**
  6765. * A number between 1 and 4 that defines the number of components in an attributes.
  6766. * For example, a position attribute with x, y, and z components would have 3 as
  6767. * shown in the code example.
  6768. * @example
  6769. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6770. * attribute.componentsPerAttribute = 3;
  6771. * attribute.values = new Float32Array([
  6772. * 0.0, 0.0, 0.0,
  6773. * 7500000.0, 0.0, 0.0,
  6774. * 0.0, 7500000.0, 0.0
  6775. * ]);
  6776. */
  6777. componentsPerAttribute: number;
  6778. /**
  6779. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6780. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6781. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6782. * <p>
  6783. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6784. * </p>
  6785. * @example
  6786. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  6787. * attribute.componentsPerAttribute = 4;
  6788. * attribute.normalize = true;
  6789. * attribute.values = new Uint8Array([
  6790. * Cesium.Color.floatToByte(color.red),
  6791. * Cesium.Color.floatToByte(color.green),
  6792. * Cesium.Color.floatToByte(color.blue),
  6793. * Cesium.Color.floatToByte(color.alpha)
  6794. * ]);
  6795. */
  6796. normalize: boolean;
  6797. /**
  6798. * The values for the attributes stored in a typed array. In the code example,
  6799. * every three elements in <code>values</code> defines one attributes since
  6800. * <code>componentsPerAttribute</code> is 3.
  6801. * @example
  6802. * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
  6803. * attribute.componentsPerAttribute = 3;
  6804. * attribute.values = new Float32Array([
  6805. * 0.0, 0.0, 0.0,
  6806. * 7500000.0, 0.0, 0.0,
  6807. * 0.0, 7500000.0, 0.0
  6808. * ]);
  6809. */
  6810. values: number[] | Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  6811. }
  6812. /**
  6813. * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
  6814. * {@link GeometryAttribute} containing the attribute's data.
  6815. * <p>
  6816. * Attributes are always stored non-interleaved in a Geometry.
  6817. * </p>
  6818. */
  6819. export class GeometryAttributes {
  6820. constructor();
  6821. /**
  6822. * The 3D position attribute.
  6823. * <p>
  6824. * 64-bit floating-point (for precision). 3 components per attribute.
  6825. * </p>
  6826. */
  6827. position: GeometryAttribute;
  6828. /**
  6829. * The normal attribute (normalized), which is commonly used for lighting.
  6830. * <p>
  6831. * 32-bit floating-point. 3 components per attribute.
  6832. * </p>
  6833. */
  6834. normal: GeometryAttribute;
  6835. /**
  6836. * The 2D texture coordinate attribute.
  6837. * <p>
  6838. * 32-bit floating-point. 2 components per attribute
  6839. * </p>
  6840. */
  6841. st: GeometryAttribute;
  6842. /**
  6843. * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6844. * <p>
  6845. * 32-bit floating-point. 3 components per attribute.
  6846. * </p>
  6847. */
  6848. bitangent: GeometryAttribute;
  6849. /**
  6850. * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  6851. * <p>
  6852. * 32-bit floating-point. 3 components per attribute.
  6853. * </p>
  6854. */
  6855. tangent: GeometryAttribute;
  6856. /**
  6857. * The color attribute.
  6858. * <p>
  6859. * 8-bit unsigned integer. 4 components per attribute.
  6860. * </p>
  6861. */
  6862. color: GeometryAttribute;
  6863. }
  6864. /**
  6865. * Base class for all geometry creation utility classes that can be passed to {@link GeometryInstance}
  6866. * for asynchronous geometry creation.
  6867. */
  6868. export class GeometryFactory {
  6869. constructor();
  6870. /**
  6871. * Returns a geometry.
  6872. * @param geometryFactory - A description of the circle.
  6873. * @returns The computed vertices and indices.
  6874. */
  6875. static createGeometry(geometryFactory: GeometryFactory): Geometry | undefined;
  6876. }
  6877. /**
  6878. * Geometry instancing allows one {@link Geometry} object to be positions in several
  6879. * different locations and colored uniquely. For example, one {@link BoxGeometry} can
  6880. * be instanced several times, each with a different <code>modelMatrix</code> to change
  6881. * its position, rotation, and scale.
  6882. * @example
  6883. * // Create geometry for a box, and two instances that refer to it.
  6884. * // One instance positions the box on the bottom and colored aqua.
  6885. * // The other instance positions the box on the top and color white.
  6886. * const geometry = Cesium.BoxGeometry.fromDimensions({
  6887. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  6888. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6889. * });
  6890. * const instanceBottom = new Cesium.GeometryInstance({
  6891. * geometry : geometry,
  6892. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6893. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6894. * attributes : {
  6895. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6896. * },
  6897. * id : 'bottom'
  6898. * });
  6899. * const instanceTop = new Cesium.GeometryInstance({
  6900. * geometry : geometry,
  6901. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6902. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
  6903. * attributes : {
  6904. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  6905. * },
  6906. * id : 'top'
  6907. * });
  6908. * @param options - Object with the following properties:
  6909. * @param options.geometry - The geometry to instance.
  6910. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  6911. * @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}.
  6912. * @param [options.attributes] - Per-instance attributes like a show or color attribute shown in the example below.
  6913. */
  6914. export class GeometryInstance {
  6915. constructor(options: {
  6916. geometry: Geometry | GeometryFactory;
  6917. modelMatrix?: Matrix4;
  6918. id?: any;
  6919. attributes?: any;
  6920. });
  6921. /**
  6922. * The geometry being instanced.
  6923. */
  6924. geometry: Geometry;
  6925. /**
  6926. * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
  6927. * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  6928. * Local reference frames can be used by providing a different transformation matrix, like that returned
  6929. * by {@link Transforms.eastNorthUpToFixedFrame}.
  6930. */
  6931. modelMatrix: Matrix4;
  6932. /**
  6933. * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
  6934. */
  6935. id: any;
  6936. /**
  6937. * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
  6938. * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
  6939. */
  6940. attributes: any;
  6941. }
  6942. /**
  6943. * Values and type information for per-instance geometry attributes.
  6944. * @example
  6945. * const instance = new Cesium.GeometryInstance({
  6946. * geometry : Cesium.BoxGeometry.fromDimensions({
  6947. * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
  6948. * }),
  6949. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  6950. * Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  6951. * id : 'box',
  6952. * attributes : {
  6953. * color : new Cesium.GeometryInstanceAttribute({
  6954. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6955. * componentsPerAttribute : 4,
  6956. * normalize : true,
  6957. * value : [255, 255, 0, 255]
  6958. * })
  6959. * }
  6960. * });
  6961. * @param options - Object with the following properties:
  6962. * @param options.componentDatatype - The datatype of each component in the attribute, e.g., individual elements in values.
  6963. * @param options.componentsPerAttribute - A number between 1 and 4 that defines the number of components in an attributes.
  6964. * @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.
  6965. * @param options.value - The value for the attribute.
  6966. */
  6967. export class GeometryInstanceAttribute {
  6968. constructor(options: {
  6969. componentDatatype: ComponentDatatype;
  6970. componentsPerAttribute: number;
  6971. normalize?: boolean;
  6972. value: number[];
  6973. });
  6974. /**
  6975. * The datatype of each component in the attribute, e.g., individual elements in
  6976. * {@link GeometryInstanceAttribute#value}.
  6977. */
  6978. componentDatatype: ComponentDatatype;
  6979. /**
  6980. * A number between 1 and 4 that defines the number of components in an attributes.
  6981. * For example, a position attribute with x, y, and z components would have 3 as
  6982. * shown in the code example.
  6983. * @example
  6984. * show : new Cesium.GeometryInstanceAttribute({
  6985. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  6986. * componentsPerAttribute : 1,
  6987. * normalize : true,
  6988. * value : [1.0]
  6989. * })
  6990. */
  6991. componentsPerAttribute: number;
  6992. /**
  6993. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  6994. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  6995. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  6996. * <p>
  6997. * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
  6998. * </p>
  6999. * @example
  7000. * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
  7001. * attribute.componentsPerAttribute = 4;
  7002. * attribute.normalize = true;
  7003. * attribute.value = [
  7004. * Cesium.Color.floatToByte(color.red),
  7005. * Cesium.Color.floatToByte(color.green),
  7006. * Cesium.Color.floatToByte(color.blue),
  7007. * Cesium.Color.floatToByte(color.alpha)
  7008. * ];
  7009. */
  7010. normalize: boolean;
  7011. /**
  7012. * The values for the attributes stored in a typed array. In the code example,
  7013. * every three elements in <code>values</code> defines one attributes since
  7014. * <code>componentsPerAttribute</code> is 3.
  7015. * @example
  7016. * show : new Cesium.GeometryInstanceAttribute({
  7017. * componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
  7018. * componentsPerAttribute : 1,
  7019. * normalize : true,
  7020. * value : [1.0]
  7021. * })
  7022. */
  7023. value: number[];
  7024. }
  7025. /**
  7026. * Content pipeline functions for geometries.
  7027. */
  7028. export namespace GeometryPipeline {
  7029. /**
  7030. * Converts a geometry's triangle indices to line indices. If the geometry has an <code>indices</code>
  7031. * and its <code>primitiveType</code> is <code>TRIANGLES</code>, <code>TRIANGLE_STRIP</code>,
  7032. * <code>TRIANGLE_FAN</code>, it is converted to <code>LINES</code>; otherwise, the geometry is not changed.
  7033. * <p>
  7034. * This is commonly used to create a wireframe geometry for visual debugging.
  7035. * </p>
  7036. * @example
  7037. * geometry = Cesium.GeometryPipeline.toWireframe(geometry);
  7038. * @param geometry - The geometry to modify.
  7039. * @returns The modified <code>geometry</code> argument, with its triangle indices converted to lines.
  7040. */
  7041. function toWireframe(geometry: Geometry): Geometry;
  7042. /**
  7043. * Creates a new {@link Geometry} with <code>LINES</code> representing the provided
  7044. * attribute (<code>attributeName</code>) for the provided geometry. This is used to
  7045. * visualize vector attributes like normals, tangents, and bitangents.
  7046. * @example
  7047. * const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
  7048. * @param geometry - The <code>Geometry</code> instance with the attribute.
  7049. * @param [attributeName = 'normal'] - The name of the attribute.
  7050. * @param [length = 10000.0] - The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
  7051. * @returns A new <code>Geometry</code> instance with line segments for the vector.
  7052. */
  7053. function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry;
  7054. /**
  7055. * Creates an object that maps attribute names to unique locations (indices)
  7056. * for matching vertex attributes and shader programs.
  7057. * @example
  7058. * const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
  7059. * // Example output
  7060. * // {
  7061. * // 'position' : 0,
  7062. * // 'normal' : 1
  7063. * // }
  7064. * @param geometry - The geometry, which is not modified, to create the object for.
  7065. * @returns An object with attribute name / index pairs.
  7066. */
  7067. function createAttributeLocations(geometry: Geometry): any;
  7068. /**
  7069. * Reorders a geometry's attributes and <code>indices</code> to achieve better performance from the GPU's pre-vertex-shader cache.
  7070. * @example
  7071. * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
  7072. * @param geometry - The geometry to modify.
  7073. * @returns The modified <code>geometry</code> argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
  7074. */
  7075. function reorderForPreVertexCache(geometry: Geometry): Geometry;
  7076. /**
  7077. * Reorders a geometry's <code>indices</code> to achieve better performance from the GPU's
  7078. * post vertex-shader cache by using the Tipsify algorithm. If the geometry <code>primitiveType</code>
  7079. * is not <code>TRIANGLES</code> or the geometry does not have an <code>indices</code>, this function has no effect.
  7080. * @example
  7081. * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
  7082. * @param geometry - The geometry to modify.
  7083. * @param [cacheCapacity = 24] - The number of vertices that can be held in the GPU's vertex cache.
  7084. * @returns The modified <code>geometry</code> argument, with its indices reordered for the post-vertex-shader cache.
  7085. */
  7086. function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry;
  7087. /**
  7088. * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
  7089. * <code>indices</code> fit into unsigned shorts. This is used to meet the WebGL requirements
  7090. * when unsigned int indices are not supported.
  7091. * <p>
  7092. * If the geometry does not have any <code>indices</code>, this function has no effect.
  7093. * </p>
  7094. * @example
  7095. * const geometries = Cesium.GeometryPipeline.fitToUnsignedShortIndices(geometry);
  7096. * @param geometry - The geometry to be split into multiple geometries.
  7097. * @returns An array of geometries, each with indices that fit into unsigned shorts.
  7098. */
  7099. function fitToUnsignedShortIndices(geometry: Geometry): Geometry[];
  7100. /**
  7101. * Projects a geometry's 3D <code>position</code> attribute to 2D, replacing the <code>position</code>
  7102. * attribute with separate <code>position3D</code> and <code>position2D</code> attributes.
  7103. * <p>
  7104. * If the geometry does not have a <code>position</code>, this function has no effect.
  7105. * </p>
  7106. * @example
  7107. * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
  7108. * @param geometry - The geometry to modify.
  7109. * @param attributeName - The name of the attribute.
  7110. * @param attributeName3D - The name of the attribute in 3D.
  7111. * @param attributeName2D - The name of the attribute in 2D.
  7112. * @param [projection = new GeographicProjection()] - The projection to use.
  7113. * @returns The modified <code>geometry</code> argument with <code>position3D</code> and <code>position2D</code> attributes.
  7114. */
  7115. function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry;
  7116. /**
  7117. * Encodes floating-point geometry attribute values as two separate attributes to improve
  7118. * rendering precision.
  7119. * <p>
  7120. * This is commonly used to create high-precision position vertex attributes.
  7121. * </p>
  7122. * @example
  7123. * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
  7124. * @param geometry - The geometry to modify.
  7125. * @param attributeName - The name of the attribute.
  7126. * @param attributeHighName - The name of the attribute for the encoded high bits.
  7127. * @param attributeLowName - The name of the attribute for the encoded low bits.
  7128. * @returns The modified <code>geometry</code> argument, with its encoded attribute.
  7129. */
  7130. function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry;
  7131. /**
  7132. * Transforms a geometry instance to world coordinates. This changes
  7133. * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the
  7134. * following attributes if they are present: <code>position</code>, <code>normal</code>,
  7135. * <code>tangent</code>, and <code>bitangent</code>.
  7136. * @example
  7137. * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);
  7138. * @param instance - The geometry instance to modify.
  7139. * @returns The modified <code>instance</code> argument, with its attributes transforms to world coordinates.
  7140. */
  7141. function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance;
  7142. /**
  7143. * Computes per-vertex normals for a geometry containing <code>TRIANGLES</code> by averaging the normals of
  7144. * all triangles incident to the vertex. The result is a new <code>normal</code> attribute added to the geometry.
  7145. * This assumes a counter-clockwise winding order.
  7146. * @example
  7147. * Cesium.GeometryPipeline.computeNormal(geometry);
  7148. * @param geometry - The geometry to modify.
  7149. * @returns The modified <code>geometry</code> argument with the computed <code>normal</code> attribute.
  7150. */
  7151. function computeNormal(geometry: Geometry): Geometry;
  7152. /**
  7153. * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>.
  7154. * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry.
  7155. * This assumes a counter-clockwise winding order.
  7156. * <p>
  7157. * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors
  7158. * for an Arbitrary Mesh</a> by Eric Lengyel.
  7159. * </p>
  7160. * @example
  7161. * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
  7162. * @param geometry - The geometry to modify.
  7163. * @returns The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes.
  7164. */
  7165. function computeTangentAndBitangent(geometry: Geometry): Geometry;
  7166. /**
  7167. * Compresses and packs geometry normal attribute values to save memory.
  7168. * @example
  7169. * geometry = Cesium.GeometryPipeline.compressVertices(geometry);
  7170. * @param geometry - The geometry to modify.
  7171. * @returns The modified <code>geometry</code> argument, with its normals compressed and packed.
  7172. */
  7173. function compressVertices(geometry: Geometry): Geometry;
  7174. }
  7175. /**
  7176. * Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
  7177. * and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
  7178. * @param resourceOrUrl - The url of the Google Earth Enterprise server hosting the imagery
  7179. */
  7180. export class GoogleEarthEnterpriseMetadata {
  7181. constructor(resourceOrUrl: Resource | string);
  7182. /**
  7183. * True if imagery is available.
  7184. */
  7185. imageryPresent: boolean;
  7186. /**
  7187. * True if imagery is sent as a protocol buffer, false if sent as plain images. If undefined we will try both.
  7188. */
  7189. protoImagery: boolean;
  7190. /**
  7191. * True if terrain is available.
  7192. */
  7193. terrainPresent: boolean;
  7194. /**
  7195. * Exponent used to compute constant to calculate negative height values.
  7196. */
  7197. negativeAltitudeExponentBias: number;
  7198. /**
  7199. * Threshold where any numbers smaller are actually negative values. They are multiplied by -2^negativeAltitudeExponentBias.
  7200. */
  7201. negativeAltitudeThreshold: number;
  7202. /**
  7203. * Dictionary of provider id to copyright strings.
  7204. */
  7205. providers: any;
  7206. /**
  7207. * Key used to decode packets
  7208. */
  7209. key: ArrayBuffer;
  7210. /**
  7211. * Gets the name of the Google Earth Enterprise server.
  7212. */
  7213. readonly url: string;
  7214. /**
  7215. * Gets the proxy used for metadata requests.
  7216. */
  7217. readonly proxy: Proxy;
  7218. /**
  7219. * Gets the resource used for metadata requests.
  7220. */
  7221. readonly resource: Resource;
  7222. /**
  7223. * Gets a promise that resolves to true when the metadata is ready for use.
  7224. */
  7225. readonly readyPromise: Promise<boolean>;
  7226. /**
  7227. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  7228. * from a Google Earth Enterprise server.
  7229. * @param x - The tile's x coordinate.
  7230. * @param y - The tile's y coordinate.
  7231. * @param level - The tile's zoom level.
  7232. */
  7233. static tileXYToQuadKey(x: number, y: number, level: number): void;
  7234. /**
  7235. * Converts a tile's quadkey used to request an image from a Google Earth Enterprise server into the
  7236. * (x, y, level) position.
  7237. * @param quadkey - The tile's quad key
  7238. */
  7239. static quadKeyToTileXY(quadkey: string): void;
  7240. }
  7241. /**
  7242. * Terrain data for a single tile from a Google Earth Enterprise server.
  7243. * @example
  7244. * const buffer = ...
  7245. * const childTileMask = ...
  7246. * const terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({
  7247. * buffer : heightBuffer,
  7248. * childTileMask : childTileMask
  7249. * });
  7250. * @param options - Object with the following properties:
  7251. * @param options.buffer - The buffer containing terrain data.
  7252. * @param options.negativeAltitudeExponentBias - Multiplier for negative terrain heights that are encoded as very small positive values.
  7253. * @param options.negativeElevationThreshold - Threshold for negative values
  7254. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7255. * If a child's bit is set, geometry will be requested for that tile as well when it
  7256. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  7257. * instead upsampled from the parent. The bit values are as follows:
  7258. * <table>
  7259. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7260. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7261. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7262. * <tr><td>2</td><td>4</td><td>Northeast</td></tr>
  7263. * <tr><td>3</td><td>8</td><td>Northwest</td></tr>
  7264. * </table>
  7265. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7266. * otherwise, false.
  7267. * @param [options.credits] - Array of credits for this tile.
  7268. */
  7269. export class GoogleEarthEnterpriseTerrainData {
  7270. constructor(options: {
  7271. buffer: ArrayBuffer;
  7272. negativeAltitudeExponentBias: number;
  7273. negativeElevationThreshold: number;
  7274. childTileMask?: number;
  7275. createdByUpsampling?: boolean;
  7276. credits?: Credit[];
  7277. });
  7278. /**
  7279. * An array of credits for this tile
  7280. */
  7281. credits: Credit[];
  7282. /**
  7283. * The water mask included in this terrain data, if any. A water mask is a rectangular
  7284. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7285. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7286. */
  7287. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7288. /**
  7289. * Computes the terrain height at a specified longitude and latitude.
  7290. * @param rectangle - The rectangle covered by this terrain data.
  7291. * @param longitude - The longitude in radians.
  7292. * @param latitude - The latitude in radians.
  7293. * @returns The terrain height at the specified position. If the position
  7294. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7295. * incorrect for positions far outside the rectangle.
  7296. */
  7297. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7298. /**
  7299. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7300. * height samples in this instance, interpolated if necessary.
  7301. * @param tilingScheme - The tiling scheme of this terrain data.
  7302. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7303. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7304. * @param thisLevel - The level of this tile in the tiling scheme.
  7305. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7306. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7307. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7308. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7309. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  7310. * deferred.
  7311. */
  7312. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7313. /**
  7314. * Determines if a given child tile is available, based on the
  7315. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7316. * to be one of the four children of this tile. If non-child tile coordinates are
  7317. * given, the availability of the southeast child tile is returned.
  7318. * @param thisX - The tile X coordinate of this (the parent) tile.
  7319. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7320. * @param childX - The tile X coordinate of the child tile to check for availability.
  7321. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7322. * @returns True if the child tile is available; otherwise, false.
  7323. */
  7324. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7325. /**
  7326. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7327. * terrain data. If this value is false, the data was obtained from some other source, such
  7328. * as by downloading it from a remote server. This method should return true for instances
  7329. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7330. * @returns True if this instance was created by upsampling; otherwise, false.
  7331. */
  7332. wasCreatedByUpsampling(): boolean;
  7333. }
  7334. /**
  7335. * Provides tiled terrain using the Google Earth Enterprise REST API.
  7336. * @example
  7337. * const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  7338. * const gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
  7339. * metadata : geeMetadata
  7340. * });
  7341. * @param options - Object with the following properties:
  7342. * @param options.url - The url of the Google Earth Enterprise server hosting the imagery.
  7343. * @param options.metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
  7344. * @param [options.ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  7345. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  7346. */
  7347. export class GoogleEarthEnterpriseTerrainProvider {
  7348. constructor(options: {
  7349. url: Resource | string;
  7350. metadata: GoogleEarthEnterpriseMetadata;
  7351. ellipsoid?: Ellipsoid;
  7352. credit?: Credit | string;
  7353. });
  7354. /**
  7355. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  7356. */
  7357. readonly url: string;
  7358. /**
  7359. * Gets the proxy used by this provider.
  7360. */
  7361. readonly proxy: Proxy;
  7362. /**
  7363. * Gets the tiling scheme used by this provider. This function should
  7364. * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7365. */
  7366. readonly tilingScheme: TilingScheme;
  7367. /**
  7368. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  7369. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  7370. * are passed an instance of {@link TileProviderError}.
  7371. */
  7372. readonly errorEvent: Event;
  7373. /**
  7374. * Gets a value indicating whether or not the provider is ready for use.
  7375. */
  7376. readonly ready: boolean;
  7377. /**
  7378. * Gets a promise that resolves to true when the provider is ready for use.
  7379. */
  7380. readonly readyPromise: Promise<boolean>;
  7381. /**
  7382. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  7383. * the source of the terrain. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7384. */
  7385. readonly credit: Credit;
  7386. /**
  7387. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  7388. * indicates which areas of the globe are water rather than land, so they can be rendered
  7389. * as a reflective surface with animated waves. This function should not be
  7390. * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7391. */
  7392. readonly hasWaterMask: boolean;
  7393. /**
  7394. * Gets a value indicating whether or not the requested tiles include vertex normals.
  7395. * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
  7396. */
  7397. readonly hasVertexNormals: boolean;
  7398. /**
  7399. * Gets an object that can be used to determine availability of terrain from this provider, such as
  7400. * at points and in rectangles. This function should not be called before
  7401. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
  7402. * information is not available.
  7403. */
  7404. readonly availability: TileAvailability;
  7405. /**
  7406. * Requests the geometry for a given tile. This function should not be called before
  7407. * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
  7408. * may optionally include a water mask and an indication of which child tiles are available.
  7409. * @param x - The X coordinate of the tile for which to request geometry.
  7410. * @param y - The Y coordinate of the tile for which to request geometry.
  7411. * @param level - The level of the tile for which to request geometry.
  7412. * @param [request] - The request object. Intended for internal use only.
  7413. * @returns A promise for the requested geometry. If this method
  7414. * returns undefined instead of a promise, it is an indication that too many requests are already
  7415. * pending and the request will be retried later.
  7416. */
  7417. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  7418. /**
  7419. * Gets the maximum geometric error allowed in a tile at a given level.
  7420. * @param level - The tile level for which to get the maximum geometric error.
  7421. * @returns The maximum geometric error.
  7422. */
  7423. getLevelMaximumGeometricError(level: number): number;
  7424. /**
  7425. * Determines whether data for a tile is available to be loaded.
  7426. * @param x - The X coordinate of the tile for which to request geometry.
  7427. * @param y - The Y coordinate of the tile for which to request geometry.
  7428. * @param level - The level of the tile for which to request geometry.
  7429. * @returns Undefined if not supported, otherwise true or false.
  7430. */
  7431. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  7432. /**
  7433. * Makes sure we load availability data for a tile
  7434. * @param x - The X coordinate of the tile for which to request geometry.
  7435. * @param y - The Y coordinate of the tile for which to request geometry.
  7436. * @param level - The level of the tile for which to request geometry.
  7437. */
  7438. loadTileDataAvailability(x: number, y: number, level: number): undefined;
  7439. }
  7440. /**
  7441. * Represents a Gregorian date in a more precise format than the JavaScript Date object.
  7442. * In addition to submillisecond precision, this object can also represent leap seconds.
  7443. * @param [year] - The year as a whole number.
  7444. * @param [month] - The month as a whole number with range [1, 12].
  7445. * @param [day] - The day of the month as a whole number starting at 1.
  7446. * @param [hour] - The hour as a whole number with range [0, 23].
  7447. * @param [minute] - The minute of the hour as a whole number with range [0, 59].
  7448. * @param [second] - The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7449. * @param [millisecond] - The millisecond of the second as a floating point number with range [0.0, 1000.0).
  7450. * @param [isLeapSecond] - Whether this time is during a leap second.
  7451. */
  7452. export class GregorianDate {
  7453. constructor(year?: number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, isLeapSecond?: boolean);
  7454. /**
  7455. * Gets or sets the year as a whole number.
  7456. */
  7457. year: number;
  7458. /**
  7459. * Gets or sets the month as a whole number with range [1, 12].
  7460. */
  7461. month: number;
  7462. /**
  7463. * Gets or sets the day of the month as a whole number starting at 1.
  7464. */
  7465. day: number;
  7466. /**
  7467. * Gets or sets the hour as a whole number with range [0, 23].
  7468. */
  7469. hour: number;
  7470. /**
  7471. * Gets or sets the minute of the hour as a whole number with range [0, 59].
  7472. */
  7473. minute: number;
  7474. /**
  7475. * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
  7476. */
  7477. second: number;
  7478. /**
  7479. * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
  7480. */
  7481. millisecond: number;
  7482. /**
  7483. * Gets or sets whether this time is during a leap second.
  7484. */
  7485. isLeapSecond: boolean;
  7486. }
  7487. /**
  7488. * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
  7489. * @example
  7490. * const positions = Cesium.Cartesian3.fromDegreesArray([
  7491. * -112.1340164450331, 36.05494287836128,
  7492. * -112.08821010582645, 36.097804071380715,
  7493. * -112.13296079730024, 36.168769146801104
  7494. * ]);
  7495. *
  7496. * const geometry = new Cesium.GroundPolylineGeometry({
  7497. * positions : positions
  7498. * });
  7499. * @param options - Options with the following properties:
  7500. * @param options.positions - An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
  7501. * @param [options.width = 1.0] - The screen space width in pixels.
  7502. * @param [options.granularity = 9999.0] - The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
  7503. * @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.
  7504. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7505. */
  7506. export class GroundPolylineGeometry {
  7507. constructor(options: {
  7508. positions: Cartesian3[];
  7509. width?: number;
  7510. granularity?: number;
  7511. loop?: boolean;
  7512. arcType?: ArcType;
  7513. });
  7514. /**
  7515. * The screen space width in pixels.
  7516. */
  7517. width: number;
  7518. /**
  7519. * The distance interval used for interpolating options.points. Zero indicates no interpolation.
  7520. * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
  7521. */
  7522. granularity: boolean;
  7523. /**
  7524. * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
  7525. * If the geometry has two positions this parameter will be ignored.
  7526. */
  7527. loop: boolean;
  7528. /**
  7529. * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  7530. */
  7531. arcType: ArcType;
  7532. /**
  7533. * Stores the provided instance into the provided array.
  7534. * @param value - The value to pack.
  7535. * @param array - The array to pack into.
  7536. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  7537. * @returns The array that was packed into
  7538. */
  7539. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  7540. /**
  7541. * Retrieves an instance from a packed array.
  7542. * @param array - The packed array.
  7543. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  7544. * @param [result] - The object into which to store the result.
  7545. */
  7546. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  7547. }
  7548. /**
  7549. * Defines a heading angle, pitch angle, and range in a local frame.
  7550. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7551. * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
  7552. * angles are below the plane. Range is the distance from the center of the frame.
  7553. * @param [heading = 0.0] - The heading angle in radians.
  7554. * @param [pitch = 0.0] - The pitch angle in radians.
  7555. * @param [range = 0.0] - The distance from the center in meters.
  7556. */
  7557. export class HeadingPitchRange {
  7558. constructor(heading?: number, pitch?: number, range?: number);
  7559. /**
  7560. * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
  7561. */
  7562. heading: number;
  7563. /**
  7564. * Pitch is the rotation from the local xy-plane. Positive pitch angles
  7565. * are above the plane. Negative pitch angles are below the plane.
  7566. */
  7567. pitch: number;
  7568. /**
  7569. * Range is the distance from the center of the local frame.
  7570. */
  7571. range: number;
  7572. /**
  7573. * Duplicates a HeadingPitchRange instance.
  7574. * @param hpr - The HeadingPitchRange to duplicate.
  7575. * @param [result] - The object onto which to store the result.
  7576. * @returns The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
  7577. */
  7578. static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange;
  7579. }
  7580. /**
  7581. * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
  7582. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  7583. * the positive x axis.
  7584. * @param [heading = 0.0] - The heading component in radians.
  7585. * @param [pitch = 0.0] - The pitch component in radians.
  7586. * @param [roll = 0.0] - The roll component in radians.
  7587. */
  7588. export class HeadingPitchRoll {
  7589. constructor(heading?: number, pitch?: number, roll?: number);
  7590. /**
  7591. * Gets or sets the heading.
  7592. */
  7593. heading: number;
  7594. /**
  7595. * Gets or sets the pitch.
  7596. */
  7597. pitch: number;
  7598. /**
  7599. * Gets or sets the roll.
  7600. */
  7601. roll: number;
  7602. /**
  7603. * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  7604. * @param quaternion - The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
  7605. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7606. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7607. */
  7608. static fromQuaternion(quaternion: Quaternion, result?: HeadingPitchRoll): HeadingPitchRoll;
  7609. /**
  7610. * Returns a new HeadingPitchRoll instance from angles given in degrees.
  7611. * @param heading - the heading in degrees
  7612. * @param pitch - the pitch in degrees
  7613. * @param roll - the heading in degrees
  7614. * @param [result] - The object in which to store the result. If not provided, a new instance is created and returned.
  7615. * @returns A new HeadingPitchRoll instance
  7616. */
  7617. static fromDegrees(heading: number, pitch: number, roll: number, result?: HeadingPitchRoll): HeadingPitchRoll;
  7618. /**
  7619. * Duplicates a HeadingPitchRoll instance.
  7620. * @param headingPitchRoll - The HeadingPitchRoll to duplicate.
  7621. * @param [result] - The object onto which to store the result.
  7622. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
  7623. */
  7624. static clone(headingPitchRoll: HeadingPitchRoll, result?: HeadingPitchRoll): HeadingPitchRoll;
  7625. /**
  7626. * Compares the provided HeadingPitchRolls componentwise and returns
  7627. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7628. * @param [left] - The first HeadingPitchRoll.
  7629. * @param [right] - The second HeadingPitchRoll.
  7630. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  7631. */
  7632. static equals(left?: HeadingPitchRoll, right?: HeadingPitchRoll): boolean;
  7633. /**
  7634. * Compares the provided HeadingPitchRolls componentwise and returns
  7635. * <code>true</code> if they pass an absolute or relative tolerance test,
  7636. * <code>false</code> otherwise.
  7637. * @param [left] - The first HeadingPitchRoll.
  7638. * @param [right] - The second HeadingPitchRoll.
  7639. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7640. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7641. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  7642. */
  7643. static equalsEpsilon(left?: HeadingPitchRoll, right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7644. /**
  7645. * Duplicates this HeadingPitchRoll instance.
  7646. * @param [result] - The object onto which to store the result.
  7647. * @returns The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
  7648. */
  7649. clone(result?: HeadingPitchRoll): HeadingPitchRoll;
  7650. /**
  7651. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7652. * <code>true</code> if they are equal, <code>false</code> otherwise.
  7653. * @param [right] - The right hand side HeadingPitchRoll.
  7654. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  7655. */
  7656. equals(right?: HeadingPitchRoll): boolean;
  7657. /**
  7658. * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
  7659. * <code>true</code> if they pass an absolute or relative tolerance test,
  7660. * <code>false</code> otherwise.
  7661. * @param [right] - The right hand side HeadingPitchRoll.
  7662. * @param [relativeEpsilon = 0] - The relative epsilon tolerance to use for equality testing.
  7663. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  7664. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  7665. */
  7666. equalsEpsilon(right?: HeadingPitchRoll, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  7667. /**
  7668. * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
  7669. * @returns A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
  7670. */
  7671. toString(): string;
  7672. }
  7673. /**
  7674. * The encoding that is used for a heightmap
  7675. */
  7676. export enum HeightmapEncoding {
  7677. /**
  7678. * No encoding
  7679. */
  7680. NONE = 0,
  7681. /**
  7682. * LERC encoding
  7683. */
  7684. LERC = 1
  7685. }
  7686. /**
  7687. * Terrain data for a single tile where the terrain data is represented as a heightmap. A heightmap
  7688. * is a rectangular array of heights in row-major order from north to south and west to east.
  7689. * @example
  7690. * const buffer = ...
  7691. * const heightBuffer = new Uint16Array(buffer, 0, that._heightmapWidth * that._heightmapWidth);
  7692. * const childTileMask = new Uint8Array(buffer, heightBuffer.byteLength, 1)[0];
  7693. * const waterMask = new Uint8Array(buffer, heightBuffer.byteLength + 1, buffer.byteLength - heightBuffer.byteLength - 1);
  7694. * const terrainData = new Cesium.HeightmapTerrainData({
  7695. * buffer : heightBuffer,
  7696. * width : 65,
  7697. * height : 65,
  7698. * childTileMask : childTileMask,
  7699. * waterMask : waterMask
  7700. * });
  7701. * @param options - Object with the following properties:
  7702. * @param options.buffer - The buffer containing height data.
  7703. * @param options.width - The width (longitude direction) of the heightmap, in samples.
  7704. * @param options.height - The height (latitude direction) of the heightmap, in samples.
  7705. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  7706. * If a child's bit is set, geometry will be requested for that tile as well when it
  7707. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  7708. * instead upsampled from the parent. The bit values are as follows:
  7709. * <table>
  7710. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  7711. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  7712. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  7713. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  7714. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  7715. * </table>
  7716. * @param [options.waterMask] - The water mask included in this terrain data, if any. A water mask is a square
  7717. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7718. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7719. * @param [options.structure] - An object describing the structure of the height data.
  7720. * @param [options.structure.heightScale = 1.0] - The factor by which to multiply height samples in order to obtain
  7721. * the height above the heightOffset, in meters. The heightOffset is added to the resulting
  7722. * height after multiplying by the scale.
  7723. * @param [options.structure.heightOffset = 0.0] - The offset to add to the scaled height to obtain the final
  7724. * height in meters. The offset is added after the height sample is multiplied by the
  7725. * heightScale.
  7726. * @param [options.structure.elementsPerHeight = 1] - The number of elements in the buffer that make up a single height
  7727. * sample. This is usually 1, indicating that each element is a separate height sample. If
  7728. * it is greater than 1, that number of elements together form the height sample, which is
  7729. * computed according to the structure.elementMultiplier and structure.isBigEndian properties.
  7730. * @param [options.structure.stride = 1] - The number of elements to skip to get from the first element of
  7731. * one height to the first element of the next height.
  7732. * @param [options.structure.elementMultiplier = 256.0] - The multiplier used to compute the height value when the
  7733. * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
  7734. * is 256, the height is computed as follows:
  7735. * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
  7736. * This is assuming that the isBigEndian property is false. If it is true, the order of the
  7737. * elements is reversed.
  7738. * @param [options.structure.isBigEndian = false] - Indicates endianness of the elements in the buffer when the
  7739. * stride property is greater than 1. If this property is false, the first element is the
  7740. * low-order element. If it is true, the first element is the high-order element.
  7741. * @param [options.structure.lowestEncodedHeight] - The lowest value that can be stored in the height buffer. Any heights that are lower
  7742. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7743. * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
  7744. * not specified, no minimum value is enforced.
  7745. * @param [options.structure.highestEncodedHeight] - The highest value that can be stored in the height buffer. Any heights that are higher
  7746. * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
  7747. * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
  7748. * than 65535. If this parameter is not specified, no maximum value is enforced.
  7749. * @param [options.encoding = HeightmapEncoding.NONE] - The encoding that is used on the buffer.
  7750. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  7751. * otherwise, false.
  7752. */
  7753. export class HeightmapTerrainData {
  7754. constructor(options: {
  7755. buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
  7756. width: number;
  7757. height: number;
  7758. childTileMask?: number;
  7759. waterMask?: Uint8Array;
  7760. structure?: {
  7761. heightScale?: number;
  7762. heightOffset?: number;
  7763. elementsPerHeight?: number;
  7764. stride?: number;
  7765. elementMultiplier?: number;
  7766. isBigEndian?: boolean;
  7767. lowestEncodedHeight?: number;
  7768. highestEncodedHeight?: number;
  7769. };
  7770. encoding?: HeightmapEncoding;
  7771. createdByUpsampling?: boolean;
  7772. });
  7773. /**
  7774. * An array of credits for this tile.
  7775. */
  7776. credits: Credit[];
  7777. /**
  7778. * The water mask included in this terrain data, if any. A water mask is a square
  7779. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  7780. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  7781. */
  7782. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  7783. /**
  7784. * Computes the terrain height at a specified longitude and latitude.
  7785. * @param rectangle - The rectangle covered by this terrain data.
  7786. * @param longitude - The longitude in radians.
  7787. * @param latitude - The latitude in radians.
  7788. * @returns The terrain height at the specified position. If the position
  7789. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  7790. * incorrect for positions far outside the rectangle.
  7791. */
  7792. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  7793. /**
  7794. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  7795. * height samples in this instance, interpolated if necessary.
  7796. * @param tilingScheme - The tiling scheme of this terrain data.
  7797. * @param thisX - The X coordinate of this tile in the tiling scheme.
  7798. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  7799. * @param thisLevel - The level of this tile in the tiling scheme.
  7800. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7801. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  7802. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  7803. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  7804. * or undefined if the mesh is unavailable.
  7805. */
  7806. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<HeightmapTerrainData> | undefined;
  7807. /**
  7808. * Determines if a given child tile is available, based on the
  7809. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  7810. * to be one of the four children of this tile. If non-child tile coordinates are
  7811. * given, the availability of the southeast child tile is returned.
  7812. * @param thisX - The tile X coordinate of this (the parent) tile.
  7813. * @param thisY - The tile Y coordinate of this (the parent) tile.
  7814. * @param childX - The tile X coordinate of the child tile to check for availability.
  7815. * @param childY - The tile Y coordinate of the child tile to check for availability.
  7816. * @returns True if the child tile is available; otherwise, false.
  7817. */
  7818. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  7819. /**
  7820. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  7821. * terrain data. If this value is false, the data was obtained from some other source, such
  7822. * as by downloading it from a remote server. This method should return true for instances
  7823. * returned from a call to {@link HeightmapTerrainData#upsample}.
  7824. * @returns True if this instance was created by upsampling; otherwise, false.
  7825. */
  7826. wasCreatedByUpsampling(): boolean;
  7827. }
  7828. /**
  7829. * An {@link InterpolationAlgorithm} for performing Hermite interpolation.
  7830. */
  7831. export namespace HermitePolynomialApproximation {
  7832. /**
  7833. * Given the desired degree, returns the number of data points required for interpolation.
  7834. * @param degree - The desired degree of interpolation.
  7835. * @param [inputOrder = 0] - The order of the inputs (0 means just the data, 1 means the data and its derivative, etc).
  7836. * @returns The number of required data points needed for the desired degree of interpolation.
  7837. */
  7838. function getRequiredDataPoints(degree: number, inputOrder?: number): number;
  7839. /**
  7840. * Interpolates values using Hermite Polynomial Approximation.
  7841. * @param x - The independent variable for which the dependent variables will be interpolated.
  7842. * @param xTable - The array of independent variables to use to interpolate. The values
  7843. * in this array must be in increasing order and the same value must not occur twice in the array.
  7844. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7845. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7846. * @param yStride - The number of dependent variable values in yTable corresponding to
  7847. * each independent variable value in xTable.
  7848. * @param [result] - An existing array into which to store the result.
  7849. * @returns The array of interpolated values, or the result parameter if one was provided.
  7850. */
  7851. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  7852. /**
  7853. * Interpolates values using Hermite Polynomial Approximation.
  7854. * @param x - The independent variable for which the dependent variables will be interpolated.
  7855. * @param xTable - The array of independent variables to use to interpolate. The values
  7856. * in this array must be in increasing order and the same value must not occur twice in the array.
  7857. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  7858. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  7859. * @param yStride - The number of dependent variable values in yTable corresponding to
  7860. * each independent variable value in xTable.
  7861. * @param inputOrder - The number of derivatives supplied for input.
  7862. * @param outputOrder - The number of derivatives desired for output.
  7863. * @param [result] - An existing array into which to store the result.
  7864. * @returns The array of interpolated values, or the result parameter if one was provided.
  7865. */
  7866. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  7867. }
  7868. /**
  7869. * A Hermite spline is a cubic interpolating spline. Points, incoming tangents, outgoing tangents, and times
  7870. * must be defined for each control point. The outgoing tangents are defined for points [0, n - 2] and the incoming
  7871. * tangents are defined for points [1, n - 1]. For example, when interpolating a segment of the curve between <code>points[i]</code> and
  7872. * <code>points[i + 1]</code>, the tangents at the points will be <code>outTangents[i]</code> and <code>inTangents[i]</code>,
  7873. * respectively.
  7874. * @example
  7875. * // Create a G<sup>1</sup> continuous Hermite spline
  7876. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  7877. * const spline = new Cesium.HermiteSpline({
  7878. * times : times,
  7879. * points : [
  7880. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7881. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7882. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7883. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7884. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7885. * ],
  7886. * outTangents : [
  7887. * new Cesium.Cartesian3(1125196, -161816, 270551),
  7888. * new Cesium.Cartesian3(-996690.5, -365906.5, 184028.5),
  7889. * new Cesium.Cartesian3(-2096917, 48379.5, -292683.5),
  7890. * new Cesium.Cartesian3(-890902.5, 408999.5, -447115)
  7891. * ],
  7892. * inTangents : [
  7893. * new Cesium.Cartesian3(-1993381, -731813, 368057),
  7894. * new Cesium.Cartesian3(-4193834, 96759, -585367),
  7895. * new Cesium.Cartesian3(-1781805, 817999, -894230),
  7896. * new Cesium.Cartesian3(1165345, 112641, 47281)
  7897. * ]
  7898. * });
  7899. *
  7900. * const p0 = spline.evaluate(times[0]);
  7901. * @param options - Object with the following properties:
  7902. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  7903. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  7904. * @param options.points - The array of control points.
  7905. * @param options.inTangents - The array of incoming tangents at each control point.
  7906. * @param options.outTangents - The array of outgoing tangents at each control point.
  7907. */
  7908. export class HermiteSpline {
  7909. constructor(options: {
  7910. times: number[];
  7911. points: Cartesian3[];
  7912. inTangents: Cartesian3[];
  7913. outTangents: Cartesian3[];
  7914. });
  7915. /**
  7916. * An array of times for the control points.
  7917. */
  7918. readonly times: number[];
  7919. /**
  7920. * An array of control points.
  7921. */
  7922. readonly points: Cartesian3[];
  7923. /**
  7924. * An array of incoming tangents at each control point.
  7925. */
  7926. readonly inTangents: Cartesian3[];
  7927. /**
  7928. * An array of outgoing tangents at each control point.
  7929. */
  7930. readonly outTangents: Cartesian3[];
  7931. /**
  7932. * Creates a spline where the tangents at each control point are the same.
  7933. * The curves are guaranteed to be at least in the class C<sup>1</sup>.
  7934. * @example
  7935. * const points = [
  7936. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7937. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7938. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7939. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7940. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7941. * ];
  7942. *
  7943. * // Add tangents
  7944. * const tangents = new Array(points.length);
  7945. * tangents[0] = new Cesium.Cartesian3(1125196, -161816, 270551);
  7946. * const temp = new Cesium.Cartesian3();
  7947. * for (let i = 1; i < tangents.length - 1; ++i) {
  7948. * tangents[i] = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.subtract(points[i + 1], points[i - 1], temp), 0.5, new Cesium.Cartesian3());
  7949. * }
  7950. * tangents[tangents.length - 1] = new Cesium.Cartesian3(1165345, 112641, 47281);
  7951. *
  7952. * const spline = Cesium.HermiteSpline.createC1({
  7953. * times : times,
  7954. * points : points,
  7955. * tangents : tangents
  7956. * });
  7957. * @param options - Object with the following properties:
  7958. * @param options.times - The array of control point times.
  7959. * @param options.points - The array of control points.
  7960. * @param options.tangents - The array of tangents at the control points.
  7961. * @returns A hermite spline.
  7962. */
  7963. static createC1(options: {
  7964. times: number[];
  7965. points: Cartesian3[];
  7966. tangents: Cartesian3[];
  7967. }): HermiteSpline;
  7968. /**
  7969. * Creates a natural cubic spline. The tangents at the control points are generated
  7970. * to create a curve in the class C<sup>2</sup>.
  7971. * @example
  7972. * // Create a natural cubic spline above the earth from Philadelphia to Los Angeles.
  7973. * const spline = Cesium.HermiteSpline.createNaturalCubic({
  7974. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7975. * points : [
  7976. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  7977. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  7978. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  7979. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  7980. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  7981. * ]
  7982. * });
  7983. * @param options - Object with the following properties:
  7984. * @param options.times - The array of control point times.
  7985. * @param options.points - The array of control points.
  7986. * @returns A hermite spline, or a linear spline if less than 3 control points were given.
  7987. */
  7988. static createNaturalCubic(options: {
  7989. times: number[];
  7990. points: Cartesian3[];
  7991. }): HermiteSpline | LinearSpline;
  7992. /**
  7993. * Creates a clamped cubic spline. The tangents at the interior control points are generated
  7994. * to create a curve in the class C<sup>2</sup>.
  7995. * @example
  7996. * // Create a clamped cubic spline above the earth from Philadelphia to Los Angeles.
  7997. * const spline = Cesium.HermiteSpline.createClampedCubic({
  7998. * times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
  7999. * points : [
  8000. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  8001. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  8002. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  8003. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  8004. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  8005. * ],
  8006. * firstTangent : new Cesium.Cartesian3(1125196, -161816, 270551),
  8007. * lastTangent : new Cesium.Cartesian3(1165345, 112641, 47281)
  8008. * });
  8009. * @param options - Object with the following properties:
  8010. * @param options.times - The array of control point times.
  8011. * @param options.points - The array of control points.
  8012. * @param options.firstTangent - The outgoing tangent of the first control point.
  8013. * @param options.lastTangent - The incoming tangent of the last control point.
  8014. * @returns A hermite spline, or a linear spline if less than 3 control points were given.
  8015. */
  8016. static createClampedCubic(options: {
  8017. times: number[];
  8018. points: number[] | Cartesian3[];
  8019. firstTangent: Cartesian3;
  8020. lastTangent: Cartesian3;
  8021. }): HermiteSpline | LinearSpline;
  8022. /**
  8023. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  8024. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  8025. * @param time - The time.
  8026. * @returns The index for the element at the start of the interval.
  8027. */
  8028. findTimeInterval(time: number): number;
  8029. /**
  8030. * Wraps the given time to the period covered by the spline.
  8031. * @param time - The time.
  8032. * @returns The time, wrapped around to the updated animation.
  8033. */
  8034. wrapTime(time: number): number;
  8035. /**
  8036. * Clamps the given time to the period covered by the spline.
  8037. * @param time - The time.
  8038. * @returns The time, clamped to the animation period.
  8039. */
  8040. clampTime(time: number): number;
  8041. /**
  8042. * Evaluates the curve at a given time.
  8043. * @param time - The time at which to evaluate the curve.
  8044. * @param [result] - The object onto which to store the result.
  8045. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  8046. */
  8047. evaluate(time: number, result?: Cartesian3): Cartesian3;
  8048. }
  8049. /**
  8050. * Hilbert Order helper functions.
  8051. */
  8052. export namespace HilbertOrder { }
  8053. /**
  8054. * Constants for WebGL index datatypes. These corresponds to the
  8055. * <code>type</code> parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
  8056. */
  8057. export enum IndexDatatype {
  8058. /**
  8059. * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
  8060. * of an element in <code>Uint8Array</code>.
  8061. */
  8062. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  8063. /**
  8064. * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
  8065. * of an element in <code>Uint16Array</code>.
  8066. */
  8067. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  8068. /**
  8069. * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
  8070. * of an element in <code>Uint32Array</code>.
  8071. */
  8072. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT
  8073. }
  8074. export namespace InterpolationAlgorithm {
  8075. /**
  8076. * Gets the name of this interpolation algorithm.
  8077. */
  8078. var type: string;
  8079. /**
  8080. * Given the desired degree, returns the number of data points required for interpolation.
  8081. * @param degree - The desired degree of interpolation.
  8082. * @returns The number of required data points needed for the desired degree of interpolation.
  8083. */
  8084. function getRequiredDataPoints(degree: number): number;
  8085. /**
  8086. * Performs zero order interpolation.
  8087. * @param x - The independent variable for which the dependent variables will be interpolated.
  8088. * @param xTable - The array of independent variables to use to interpolate. The values
  8089. * in this array must be in increasing order and the same value must not occur twice in the array.
  8090. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8091. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8092. * @param yStride - The number of dependent variable values in yTable corresponding to
  8093. * each independent variable value in xTable.
  8094. * @param [result] - An existing array into which to store the result.
  8095. * @returns The array of interpolated values, or the result parameter if one was provided.
  8096. */
  8097. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8098. /**
  8099. * Performs higher order interpolation. Not all interpolators need to support high-order interpolation,
  8100. * if this function remains undefined on implementing objects, interpolateOrderZero will be used instead.
  8101. * @param x - The independent variable for which the dependent variables will be interpolated.
  8102. * @param xTable - The array of independent variables to use to interpolate. The values
  8103. * in this array must be in increasing order and the same value must not occur twice in the array.
  8104. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8105. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8106. * @param yStride - The number of dependent variable values in yTable corresponding to
  8107. * each independent variable value in xTable.
  8108. * @param inputOrder - The number of derivatives supplied for input.
  8109. * @param outputOrder - The number of derivatives desired for output.
  8110. * @param [result] - An existing array into which to store the result.
  8111. * @returns The array of interpolated values, or the result parameter if one was provided.
  8112. */
  8113. function interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[];
  8114. }
  8115. /**
  8116. * The interface for interpolation algorithms.
  8117. */
  8118. export interface InterpolationAlgorithm {
  8119. }
  8120. /**
  8121. * This enumerated type is used in determining where, relative to the frustum, an
  8122. * object is located. The object can either be fully contained within the frustum (INSIDE),
  8123. * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
  8124. * outside of the frustum's 6 planes (OUTSIDE).
  8125. */
  8126. export enum Intersect {
  8127. /**
  8128. * Represents that an object is not contained within the frustum.
  8129. */
  8130. OUTSIDE = -1,
  8131. /**
  8132. * Represents that an object intersects one of the frustum's planes.
  8133. */
  8134. INTERSECTING = 0,
  8135. /**
  8136. * Represents that an object is fully within the frustum.
  8137. */
  8138. INSIDE = 1
  8139. }
  8140. /**
  8141. * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
  8142. */
  8143. export namespace IntersectionTests {
  8144. /**
  8145. * Computes the intersection of a ray and a plane.
  8146. * @param ray - The ray.
  8147. * @param plane - The plane.
  8148. * @param [result] - The object onto which to store the result.
  8149. * @returns The intersection point or undefined if there is no intersections.
  8150. */
  8151. function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3;
  8152. /**
  8153. * 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.
  8154. *
  8155. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8156. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8157. * @param ray - The ray.
  8158. * @param p0 - The first vertex of the triangle.
  8159. * @param p1 - The second vertex of the triangle.
  8160. * @param p2 - The third vertex of the triangle.
  8161. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8162. * and return undefined for intersections with the back face.
  8163. * @returns The intersection as a parametric distance along the ray, or undefined if there is no intersection.
  8164. */
  8165. function rayTriangleParametric(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean): number;
  8166. /**
  8167. * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
  8168. *
  8169. * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
  8170. * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
  8171. * @param ray - The ray.
  8172. * @param p0 - The first vertex of the triangle.
  8173. * @param p1 - The second vertex of the triangle.
  8174. * @param p2 - The third vertex of the triangle.
  8175. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8176. * and return undefined for intersections with the back face.
  8177. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8178. * @returns The intersection point or undefined if there is no intersections.
  8179. */
  8180. function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8181. /**
  8182. * Computes the intersection of a line segment and a triangle.
  8183. * @param v0 - The an end point of the line segment.
  8184. * @param v1 - The other end point of the line segment.
  8185. * @param p0 - The first vertex of the triangle.
  8186. * @param p1 - The second vertex of the triangle.
  8187. * @param p2 - The third vertex of the triangle.
  8188. * @param [cullBackFaces = false] - If <code>true</code>, will only compute an intersection with the front face of the triangle
  8189. * and return undefined for intersections with the back face.
  8190. * @param [result] - The <code>Cartesian3</code> onto which to store the result.
  8191. * @returns The intersection point or undefined if there is no intersections.
  8192. */
  8193. function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3;
  8194. /**
  8195. * Computes the intersection points of a ray with a sphere.
  8196. * @param ray - The ray.
  8197. * @param sphere - The sphere.
  8198. * @param [result] - The result onto which to store the result.
  8199. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8200. */
  8201. function raySphere(ray: Ray, sphere: BoundingSphere, result?: Interval): Interval;
  8202. /**
  8203. * Computes the intersection points of a line segment with a sphere.
  8204. * @param p0 - An end point of the line segment.
  8205. * @param p1 - The other end point of the line segment.
  8206. * @param sphere - The sphere.
  8207. * @param [result] - The result onto which to store the result.
  8208. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8209. */
  8210. function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: Interval): Interval;
  8211. /**
  8212. * Computes the intersection points of a ray with an ellipsoid.
  8213. * @param ray - The ray.
  8214. * @param ellipsoid - The ellipsoid.
  8215. * @returns The interval containing scalar points along the ray or undefined if there are no intersections.
  8216. */
  8217. function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): Interval;
  8218. /**
  8219. * Provides the point along the ray which is nearest to the ellipsoid.
  8220. * @param ray - The ray.
  8221. * @param ellipsoid - The ellipsoid.
  8222. * @returns The nearest planetodetic point on the ray.
  8223. */
  8224. function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3;
  8225. /**
  8226. * Computes the intersection of a line segment and a plane.
  8227. * @example
  8228. * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8229. * const normal = ellipsoid.geodeticSurfaceNormal(origin);
  8230. * const plane = Cesium.Plane.fromPointNormal(origin, normal);
  8231. *
  8232. * const p0 = new Cesium.Cartesian3(...);
  8233. * const p1 = new Cesium.Cartesian3(...);
  8234. *
  8235. * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
  8236. * const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
  8237. * @param endPoint0 - An end point of the line segment.
  8238. * @param endPoint1 - The other end point of the line segment.
  8239. * @param plane - The plane.
  8240. * @param [result] - The object onto which to store the result.
  8241. * @returns The intersection point or undefined if there is no intersection.
  8242. */
  8243. function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3;
  8244. /**
  8245. * Computes the intersection of a triangle and a plane
  8246. * @example
  8247. * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  8248. * const normal = ellipsoid.geodeticSurfaceNormal(origin);
  8249. * const plane = Cesium.Plane.fromPointNormal(origin, normal);
  8250. *
  8251. * const p0 = new Cesium.Cartesian3(...);
  8252. * const p1 = new Cesium.Cartesian3(...);
  8253. * const p2 = new Cesium.Cartesian3(...);
  8254. *
  8255. * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
  8256. * const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
  8257. * @param p0 - First point of the triangle
  8258. * @param p1 - Second point of the triangle
  8259. * @param p2 - Third point of the triangle
  8260. * @param plane - Intersection plane
  8261. * @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)
  8262. */
  8263. function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any;
  8264. }
  8265. /**
  8266. * Contains functions for operating on 2D triangles.
  8267. */
  8268. export namespace Intersections2D {
  8269. /**
  8270. * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
  8271. * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
  8272. * 3, or 4 vertices.
  8273. * @example
  8274. * const result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
  8275. * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
  8276. * @param threshold - The threshold coordinate value at which to clip the triangle.
  8277. * @param keepAbove - true to keep the portion of the triangle above the threshold, or false
  8278. * to keep the portion below.
  8279. * @param u0 - The coordinate of the first vertex in the triangle, in counter-clockwise order.
  8280. * @param u1 - The coordinate of the second vertex in the triangle, in counter-clockwise order.
  8281. * @param u2 - The coordinate of the third vertex in the triangle, in counter-clockwise order.
  8282. * @param [result] - The array into which to copy the result. If this parameter is not supplied,
  8283. * a new array is constructed and returned.
  8284. * @returns The polygon that results after the clip, specified as a list of
  8285. * vertices. The vertices are specified in counter-clockwise order.
  8286. * Each vertex is either an index from the existing list (identified as
  8287. * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
  8288. * For new vertices, the -1 is followed by three additional numbers: the
  8289. * index of each of the two original vertices forming the line segment that
  8290. * the new vertex lies on, and the fraction of the distance from the first
  8291. * vertex to the second one.
  8292. */
  8293. function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[];
  8294. /**
  8295. * Compute the barycentric coordinates of a 2D position within a 2D triangle.
  8296. * @example
  8297. * const result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
  8298. * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
  8299. * @param x - The x coordinate of the position for which to find the barycentric coordinates.
  8300. * @param y - The y coordinate of the position for which to find the barycentric coordinates.
  8301. * @param x1 - The x coordinate of the triangle's first vertex.
  8302. * @param y1 - The y coordinate of the triangle's first vertex.
  8303. * @param x2 - The x coordinate of the triangle's second vertex.
  8304. * @param y2 - The y coordinate of the triangle's second vertex.
  8305. * @param x3 - The x coordinate of the triangle's third vertex.
  8306. * @param y3 - The y coordinate of the triangle's third vertex.
  8307. * @param [result] - The instance into to which to copy the result. If this parameter
  8308. * is undefined, a new instance is created and returned.
  8309. * @returns The barycentric coordinates of the position within the triangle.
  8310. */
  8311. function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3;
  8312. /**
  8313. * Compute the intersection between 2 line segments
  8314. * @example
  8315. * const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
  8316. * // result === new Cesium.Cartesian2(0.0, 1.0);
  8317. * @param x00 - The x coordinate of the first line's first vertex.
  8318. * @param y00 - The y coordinate of the first line's first vertex.
  8319. * @param x01 - The x coordinate of the first line's second vertex.
  8320. * @param y01 - The y coordinate of the first line's second vertex.
  8321. * @param x10 - The x coordinate of the second line's first vertex.
  8322. * @param y10 - The y coordinate of the second line's first vertex.
  8323. * @param x11 - The x coordinate of the second line's second vertex.
  8324. * @param y11 - The y coordinate of the second line's second vertex.
  8325. * @param [result] - The instance into to which to copy the result. If this parameter
  8326. * is undefined, a new instance is created and returned.
  8327. * @returns The intersection point, undefined if there is no intersection point or lines are coincident.
  8328. */
  8329. function computeLineSegmentLineSegmentIntersection(x00: number, y00: number, x01: number, y01: number, x10: number, y10: number, x11: number, y11: number, result?: Cartesian2): Cartesian2;
  8330. }
  8331. /**
  8332. * Represents the closed interval [start, stop].
  8333. * @param [start = 0.0] - The beginning of the interval.
  8334. * @param [stop = 0.0] - The end of the interval.
  8335. */
  8336. export class Interval {
  8337. constructor(start?: number, stop?: number);
  8338. /**
  8339. * The beginning of the interval.
  8340. */
  8341. start: number;
  8342. /**
  8343. * The end of the interval.
  8344. */
  8345. stop: number;
  8346. }
  8347. /**
  8348. * Default settings for accessing the Cesium ion API.
  8349. *
  8350. * An ion access token is only required if you are using any ion related APIs.
  8351. * A default access token is provided for evaluation purposes only.
  8352. * Sign up for a free ion account and get your own access token at {@link https://cesium.com}
  8353. */
  8354. export namespace Ion {
  8355. /**
  8356. * Gets or sets the default Cesium ion access token.
  8357. */
  8358. var defaultAccessToken: string;
  8359. /**
  8360. * Gets or sets the default Cesium ion server.
  8361. */
  8362. var defaultServer: string | Resource;
  8363. }
  8364. /**
  8365. * Provides geocoding through Cesium ion.
  8366. * @param options - Object with the following properties:
  8367. * @param options.scene - The scene
  8368. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8369. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8370. */
  8371. export class IonGeocoderService {
  8372. constructor(options: {
  8373. scene: Scene;
  8374. accessToken?: string;
  8375. server?: string | Resource;
  8376. });
  8377. /**
  8378. * @param query - The query to be sent to the geocoder service
  8379. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  8380. */
  8381. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  8382. }
  8383. /**
  8384. * A {@link Resource} instance that encapsulates Cesium ion asset access.
  8385. * This object is normally not instantiated directly, use {@link IonResource.fromAssetId}.
  8386. * @param endpoint - The result of the Cesium ion asset endpoint service.
  8387. * @param endpointResource - The resource used to retreive the endpoint.
  8388. */
  8389. export class IonResource extends Resource {
  8390. constructor(endpoint: any, endpointResource: Resource);
  8391. /**
  8392. * Asynchronously creates an instance.
  8393. * @example
  8394. * //Load a Cesium3DTileset with asset ID of 124624234
  8395. * viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
  8396. * @example
  8397. * //Load a CZML file with asset ID of 10890
  8398. * Cesium.IonResource.fromAssetId(10890)
  8399. * .then(function (resource) {
  8400. * viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
  8401. * });
  8402. * @param assetId - The Cesium ion asset id.
  8403. * @param [options] - An object with the following properties:
  8404. * @param [options.accessToken = Ion.defaultAccessToken] - The access token to use.
  8405. * @param [options.server = Ion.defaultServer] - The resource to the Cesium ion API server.
  8406. * @returns A Promise to am instance representing the Cesium ion Asset.
  8407. */
  8408. static fromAssetId(assetId: number, options?: {
  8409. accessToken?: string;
  8410. server?: string | Resource;
  8411. }): Promise<IonResource>;
  8412. /**
  8413. * Gets the credits required for attribution of the asset.
  8414. */
  8415. readonly credits: Credit[];
  8416. /**
  8417. * Duplicates a Resource instance.
  8418. * @param [result] - The object onto which to store the result.
  8419. * @returns The modified result parameter or a new Resource instance if one was not provided.
  8420. */
  8421. clone(result?: Resource): Resource;
  8422. /**
  8423. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  8424. * 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
  8425. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  8426. * @example
  8427. * // load a single image asynchronously
  8428. * resource.fetchImage().then(function(image) {
  8429. * // use the loaded image
  8430. * }).catch(function(error) {
  8431. * // an error occurred
  8432. * });
  8433. *
  8434. * // load several images in parallel
  8435. * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  8436. * // images is an array containing all the loaded images
  8437. * });
  8438. * @param [options] - An object with the following properties.
  8439. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  8440. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  8441. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  8442. * @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>.
  8443. * @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.
  8444. */
  8445. fetchImage(options?: {
  8446. preferBlob?: boolean;
  8447. preferImageBitmap?: boolean;
  8448. flipY?: boolean;
  8449. skipColorSpaceConversion?: boolean;
  8450. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  8451. }
  8452. /**
  8453. * Constants related to ISO8601 support.
  8454. */
  8455. export namespace Iso8601 {
  8456. /**
  8457. * A {@link JulianDate} representing the earliest time representable by an ISO8601 date.
  8458. * This is equivalent to the date string '0000-01-01T00:00:00Z'
  8459. */
  8460. const MINIMUM_VALUE: JulianDate;
  8461. /**
  8462. * A {@link JulianDate} representing the latest time representable by an ISO8601 date.
  8463. * This is equivalent to the date string '9999-12-31T24:00:00Z'
  8464. */
  8465. const MAXIMUM_VALUE: JulianDate;
  8466. /**
  8467. * A {@link TimeInterval} representing the largest interval representable by an ISO8601 interval.
  8468. * This is equivalent to the interval string '0000-01-01T00:00:00Z/9999-12-31T24:00:00Z'
  8469. */
  8470. const MAXIMUM_INTERVAL: TimeInterval;
  8471. }
  8472. /**
  8473. * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
  8474. * For increased precision, this class stores the whole number part of the date and the seconds
  8475. * part of the date in separate components. In order to be safe for arithmetic and represent
  8476. * leap seconds, the date is always stored in the International Atomic Time standard
  8477. * {@link TimeStandard.TAI}.
  8478. * @param [julianDayNumber = 0.0] - The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
  8479. * @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.
  8480. * @param [timeStandard = TimeStandard.UTC] - The time standard in which the first two parameters are defined.
  8481. */
  8482. export class JulianDate {
  8483. constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard);
  8484. /**
  8485. * Gets or sets the number of whole days.
  8486. */
  8487. dayNumber: number;
  8488. /**
  8489. * Gets or sets the number of seconds into the current day.
  8490. */
  8491. secondsOfDay: number;
  8492. /**
  8493. * Creates a new instance from a GregorianDate.
  8494. * @param date - A GregorianDate.
  8495. * @param [result] - An existing instance to use for the result.
  8496. * @returns The modified result parameter or a new instance if none was provided.
  8497. */
  8498. static fromGregorianDate(date: GregorianDate, result?: JulianDate): JulianDate;
  8499. /**
  8500. * Creates a new instance from a JavaScript Date.
  8501. * @param date - A JavaScript Date.
  8502. * @param [result] - An existing instance to use for the result.
  8503. * @returns The modified result parameter or a new instance if none was provided.
  8504. */
  8505. static fromDate(date: Date, result?: JulianDate): JulianDate;
  8506. /**
  8507. * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
  8508. * This method is superior to <code>Date.parse</code> because it will handle all valid formats defined by the ISO 8601
  8509. * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
  8510. * @param iso8601String - An ISO 8601 date.
  8511. * @param [result] - An existing instance to use for the result.
  8512. * @returns The modified result parameter or a new instance if none was provided.
  8513. */
  8514. static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate;
  8515. /**
  8516. * Creates a new instance that represents the current system time.
  8517. * This is equivalent to calling <code>JulianDate.fromDate(new Date());</code>.
  8518. * @param [result] - An existing instance to use for the result.
  8519. * @returns The modified result parameter or a new instance if none was provided.
  8520. */
  8521. static now(result?: JulianDate): JulianDate;
  8522. /**
  8523. * Creates a {@link GregorianDate} from the provided instance.
  8524. * @param julianDate - The date to be converted.
  8525. * @param [result] - An existing instance to use for the result.
  8526. * @returns The modified result parameter or a new instance if none was provided.
  8527. */
  8528. static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate;
  8529. /**
  8530. * Creates a JavaScript Date from the provided instance.
  8531. * Since JavaScript dates are only accurate to the nearest millisecond and
  8532. * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
  8533. * If the provided JulianDate is during a leap second, the previous second is used.
  8534. * @param julianDate - The date to be converted.
  8535. * @returns A new instance representing the provided date.
  8536. */
  8537. static toDate(julianDate: JulianDate): Date;
  8538. /**
  8539. * Creates an ISO8601 representation of the provided date.
  8540. * @param julianDate - The date to be converted.
  8541. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  8542. * @returns The ISO8601 representation of the provided date.
  8543. */
  8544. static toIso8601(julianDate: JulianDate, precision?: number): string;
  8545. /**
  8546. * Duplicates a JulianDate instance.
  8547. * @param julianDate - The date to duplicate.
  8548. * @param [result] - An existing instance to use for the result.
  8549. * @returns The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
  8550. */
  8551. static clone(julianDate: JulianDate, result?: JulianDate): JulianDate;
  8552. /**
  8553. * Compares two instances.
  8554. * @param left - The first instance.
  8555. * @param right - The second instance.
  8556. * @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.
  8557. */
  8558. static compare(left: JulianDate, right: JulianDate): number;
  8559. /**
  8560. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8561. * @param [left] - The first instance.
  8562. * @param [right] - The second instance.
  8563. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8564. */
  8565. static equals(left?: JulianDate, right?: JulianDate): boolean;
  8566. /**
  8567. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8568. * each other. That is, in order for the dates to be considered equal (and for
  8569. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8570. * seconds, must be less than <code>epsilon</code>.
  8571. * @param [left] - The first instance.
  8572. * @param [right] - The second instance.
  8573. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8574. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8575. */
  8576. static equalsEpsilon(left?: JulianDate, right?: JulianDate, epsilon?: number): boolean;
  8577. /**
  8578. * Computes the total number of whole and fractional days represented by the provided instance.
  8579. * @param julianDate - The date.
  8580. * @returns The Julian date as single floating point number.
  8581. */
  8582. static totalDays(julianDate: JulianDate): number;
  8583. /**
  8584. * Computes the difference in seconds between the provided instance.
  8585. * @param left - The first instance.
  8586. * @param right - The second instance.
  8587. * @returns The difference, in seconds, when subtracting <code>right</code> from <code>left</code>.
  8588. */
  8589. static secondsDifference(left: JulianDate, right: JulianDate): number;
  8590. /**
  8591. * Computes the difference in days between the provided instance.
  8592. * @param left - The first instance.
  8593. * @param right - The second instance.
  8594. * @returns The difference, in days, when subtracting <code>right</code> from <code>left</code>.
  8595. */
  8596. static daysDifference(left: JulianDate, right: JulianDate): number;
  8597. /**
  8598. * Computes the number of seconds the provided instance is ahead of UTC.
  8599. * @param julianDate - The date.
  8600. * @returns The number of seconds the provided instance is ahead of UTC
  8601. */
  8602. static computeTaiMinusUtc(julianDate: JulianDate): number;
  8603. /**
  8604. * Adds the provided number of seconds to the provided date instance.
  8605. * @param julianDate - The date.
  8606. * @param seconds - The number of seconds to add or subtract.
  8607. * @param result - An existing instance to use for the result.
  8608. * @returns The modified result parameter.
  8609. */
  8610. static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate;
  8611. /**
  8612. * Adds the provided number of minutes to the provided date instance.
  8613. * @param julianDate - The date.
  8614. * @param minutes - The number of minutes to add or subtract.
  8615. * @param result - An existing instance to use for the result.
  8616. * @returns The modified result parameter.
  8617. */
  8618. static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate;
  8619. /**
  8620. * Adds the provided number of hours to the provided date instance.
  8621. * @param julianDate - The date.
  8622. * @param hours - The number of hours to add or subtract.
  8623. * @param result - An existing instance to use for the result.
  8624. * @returns The modified result parameter.
  8625. */
  8626. static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate;
  8627. /**
  8628. * Adds the provided number of days to the provided date instance.
  8629. * @param julianDate - The date.
  8630. * @param days - The number of days to add or subtract.
  8631. * @param result - An existing instance to use for the result.
  8632. * @returns The modified result parameter.
  8633. */
  8634. static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate;
  8635. /**
  8636. * Compares the provided instances and returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8637. * @param left - The first instance.
  8638. * @param right - The second instance.
  8639. * @returns <code>true</code> if <code>left</code> is earlier than <code>right</code>, <code>false</code> otherwise.
  8640. */
  8641. static lessThan(left: JulianDate, right: JulianDate): boolean;
  8642. /**
  8643. * 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.
  8644. * @param left - The first instance.
  8645. * @param right - The second instance.
  8646. * @returns <code>true</code> if <code>left</code> is earlier than or equal to <code>right</code>, <code>false</code> otherwise.
  8647. */
  8648. static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8649. /**
  8650. * Compares the provided instances and returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8651. * @param left - The first instance.
  8652. * @param right - The second instance.
  8653. * @returns <code>true</code> if <code>left</code> is later than <code>right</code>, <code>false</code> otherwise.
  8654. */
  8655. static greaterThan(left: JulianDate, right: JulianDate): boolean;
  8656. /**
  8657. * 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.
  8658. * @param left - The first instance.
  8659. * @param right - The second instance.
  8660. * @returns <code>true</code> if <code>left</code> is later than or equal to <code>right</code>, <code>false</code> otherwise.
  8661. */
  8662. static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean;
  8663. /**
  8664. * Duplicates this instance.
  8665. * @param [result] - An existing instance to use for the result.
  8666. * @returns The modified result parameter or a new instance if none was provided.
  8667. */
  8668. clone(result?: JulianDate): JulianDate;
  8669. /**
  8670. * Compares this and the provided instance and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  8671. * @param [right] - The second instance.
  8672. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  8673. */
  8674. equals(right?: JulianDate): boolean;
  8675. /**
  8676. * Compares this and the provided instance and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  8677. * each other. That is, in order for the dates to be considered equal (and for
  8678. * this function to return <code>true</code>), the absolute value of the difference between them, in
  8679. * seconds, must be less than <code>epsilon</code>.
  8680. * @param [right] - The second instance.
  8681. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  8682. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  8683. */
  8684. equalsEpsilon(right?: JulianDate, epsilon?: number): boolean;
  8685. /**
  8686. * Creates a string representing this date in ISO8601 format.
  8687. * @returns A string representing this date in ISO8601 format.
  8688. */
  8689. toString(): string;
  8690. /**
  8691. * Gets or sets the list of leap seconds used throughout Cesium.
  8692. */
  8693. static leapSeconds: LeapSecond[];
  8694. }
  8695. /**
  8696. * This enumerated type is for representing keyboard modifiers. These are keys
  8697. * that are held down in addition to other event types.
  8698. */
  8699. export enum KeyboardEventModifier {
  8700. /**
  8701. * Represents the shift key being held down.
  8702. */
  8703. SHIFT = 0,
  8704. /**
  8705. * Represents the control key being held down.
  8706. */
  8707. CTRL = 1,
  8708. /**
  8709. * Represents the alt key being held down.
  8710. */
  8711. ALT = 2
  8712. }
  8713. /**
  8714. * An {@link InterpolationAlgorithm} for performing Lagrange interpolation.
  8715. */
  8716. export namespace LagrangePolynomialApproximation {
  8717. /**
  8718. * Given the desired degree, returns the number of data points required for interpolation.
  8719. * @param degree - The desired degree of interpolation.
  8720. * @returns The number of required data points needed for the desired degree of interpolation.
  8721. */
  8722. function getRequiredDataPoints(degree: number): number;
  8723. /**
  8724. * Interpolates values using Lagrange Polynomial Approximation.
  8725. * @param x - The independent variable for which the dependent variables will be interpolated.
  8726. * @param xTable - The array of independent variables to use to interpolate. The values
  8727. * in this array must be in increasing order and the same value must not occur twice in the array.
  8728. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8729. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8730. * @param yStride - The number of dependent variable values in yTable corresponding to
  8731. * each independent variable value in xTable.
  8732. * @param [result] - An existing array into which to store the result.
  8733. * @returns The array of interpolated values, or the result parameter if one was provided.
  8734. */
  8735. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8736. }
  8737. /**
  8738. * Describes a single leap second, which is constructed from a {@link JulianDate} and a
  8739. * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
  8740. * @param [date] - A Julian date representing the time of the leap second.
  8741. * @param [offset] - The cumulative number of seconds that TAI is ahead of UTC at the provided date.
  8742. */
  8743. export class LeapSecond {
  8744. constructor(date?: JulianDate, offset?: number);
  8745. /**
  8746. * Gets or sets the date at which this leap second occurs.
  8747. */
  8748. julianDate: JulianDate;
  8749. /**
  8750. * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
  8751. * of this leap second.
  8752. */
  8753. offset: number;
  8754. }
  8755. /**
  8756. * An {@link InterpolationAlgorithm} for performing linear interpolation.
  8757. */
  8758. export namespace LinearApproximation {
  8759. /**
  8760. * Given the desired degree, returns the number of data points required for interpolation.
  8761. * Since linear interpolation can only generate a first degree polynomial, this function
  8762. * always returns 2.
  8763. * @param degree - The desired degree of interpolation.
  8764. * @returns This function always returns 2.
  8765. */
  8766. function getRequiredDataPoints(degree: number): number;
  8767. /**
  8768. * Interpolates values using linear approximation.
  8769. * @param x - The independent variable for which the dependent variables will be interpolated.
  8770. * @param xTable - The array of independent variables to use to interpolate. The values
  8771. * in this array must be in increasing order and the same value must not occur twice in the array.
  8772. * @param yTable - The array of dependent variables to use to interpolate. For a set of three
  8773. * dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
  8774. * @param yStride - The number of dependent variable values in yTable corresponding to
  8775. * each independent variable value in xTable.
  8776. * @param [result] - An existing array into which to store the result.
  8777. * @returns The array of interpolated values, or the result parameter if one was provided.
  8778. */
  8779. function interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[];
  8780. }
  8781. /**
  8782. * A spline that uses piecewise linear interpolation to create a curve.
  8783. * @example
  8784. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  8785. * const spline = new Cesium.LinearSpline({
  8786. * times : times,
  8787. * points : [
  8788. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  8789. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  8790. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  8791. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  8792. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  8793. * ]
  8794. * });
  8795. *
  8796. * const p0 = spline.evaluate(times[0]);
  8797. * @param options - Object with the following properties:
  8798. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  8799. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  8800. * @param options.points - The array of control points.
  8801. */
  8802. export class LinearSpline {
  8803. constructor(options: {
  8804. times: number[];
  8805. points: number[] | Cartesian3[];
  8806. });
  8807. /**
  8808. * An array of times for the control points.
  8809. */
  8810. readonly times: number[];
  8811. /**
  8812. * An array of {@link Cartesian3} control points.
  8813. */
  8814. readonly points: number[] | Cartesian3[];
  8815. /**
  8816. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  8817. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  8818. * @param time - The time.
  8819. * @returns The index for the element at the start of the interval.
  8820. */
  8821. findTimeInterval(time: number): number;
  8822. /**
  8823. * Wraps the given time to the period covered by the spline.
  8824. * @param time - The time.
  8825. * @returns The time, wrapped around to the updated animation.
  8826. */
  8827. wrapTime(time: number): number;
  8828. /**
  8829. * Clamps the given time to the period covered by the spline.
  8830. * @param time - The time.
  8831. * @returns The time, clamped to the animation period.
  8832. */
  8833. clampTime(time: number): number;
  8834. /**
  8835. * Evaluates the curve at a given time.
  8836. * @param time - The time at which to evaluate the curve.
  8837. * @param [result] - The object onto which to store the result.
  8838. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  8839. */
  8840. evaluate(time: number, result?: Cartesian3): number | Cartesian3;
  8841. }
  8842. /**
  8843. * Defines how geodetic ellipsoid coordinates ({@link Cartographic}) project to a
  8844. * flat map like Cesium's 2D and Columbus View modes.
  8845. */
  8846. export class MapProjection {
  8847. constructor();
  8848. /**
  8849. * Gets the {@link Ellipsoid}.
  8850. */
  8851. readonly ellipsoid: Ellipsoid;
  8852. /**
  8853. * Projects {@link Cartographic} coordinates, in radians, to projection-specific map coordinates, in meters.
  8854. * @param cartographic - The coordinates to project.
  8855. * @param [result] - An instance into which to copy the result. If this parameter is
  8856. * undefined, a new instance is created and returned.
  8857. * @returns The projected coordinates. If the result parameter is not undefined, the
  8858. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8859. * created and returned.
  8860. */
  8861. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  8862. /**
  8863. * Unprojects projection-specific map {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
  8864. * coordinates, in radians.
  8865. * @param cartesian - The Cartesian position to unproject with height (z) in meters.
  8866. * @param [result] - An instance into which to copy the result. If this parameter is
  8867. * undefined, a new instance is created and returned.
  8868. * @returns The unprojected coordinates. If the result parameter is not undefined, the
  8869. * coordinates are copied there and that instance is returned. Otherwise, a new instance is
  8870. * created and returned.
  8871. */
  8872. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  8873. }
  8874. /**
  8875. * Math functions.
  8876. */
  8877. export namespace Math {
  8878. /**
  8879. * 0.1
  8880. */
  8881. const EPSILON1 = 0.1;
  8882. /**
  8883. * 0.01
  8884. */
  8885. const EPSILON2 = 0.01;
  8886. /**
  8887. * 0.001
  8888. */
  8889. const EPSILON3 = 0.001;
  8890. /**
  8891. * 0.0001
  8892. */
  8893. const EPSILON4 = 0.0001;
  8894. /**
  8895. * 0.00001
  8896. */
  8897. const EPSILON5 = 0.00001;
  8898. /**
  8899. * 0.000001
  8900. */
  8901. const EPSILON6 = 0.000001;
  8902. /**
  8903. * 0.0000001
  8904. */
  8905. const EPSILON7 = 1e-7;
  8906. /**
  8907. * 0.00000001
  8908. */
  8909. const EPSILON8 = 1e-8;
  8910. /**
  8911. * 0.000000001
  8912. */
  8913. const EPSILON9 = 1e-9;
  8914. /**
  8915. * 0.0000000001
  8916. */
  8917. const EPSILON10 = 1e-10;
  8918. /**
  8919. * 0.00000000001
  8920. */
  8921. const EPSILON11 = 1e-11;
  8922. /**
  8923. * 0.000000000001
  8924. */
  8925. const EPSILON12 = 1e-12;
  8926. /**
  8927. * 0.0000000000001
  8928. */
  8929. const EPSILON13 = 1e-13;
  8930. /**
  8931. * 0.00000000000001
  8932. */
  8933. const EPSILON14 = 1e-14;
  8934. /**
  8935. * 0.000000000000001
  8936. */
  8937. const EPSILON15 = 1e-15;
  8938. /**
  8939. * 0.0000000000000001
  8940. */
  8941. const EPSILON16 = 1e-16;
  8942. /**
  8943. * 0.00000000000000001
  8944. */
  8945. const EPSILON17 = 1e-17;
  8946. /**
  8947. * 0.000000000000000001
  8948. */
  8949. const EPSILON18 = 1e-18;
  8950. /**
  8951. * 0.0000000000000000001
  8952. */
  8953. const EPSILON19 = 1e-19;
  8954. /**
  8955. * 0.00000000000000000001
  8956. */
  8957. const EPSILON20 = 1e-20;
  8958. /**
  8959. * 0.000000000000000000001
  8960. */
  8961. const EPSILON21 = 1e-21;
  8962. /**
  8963. * The gravitational parameter of the Earth in meters cubed
  8964. * per second squared as defined by the WGS84 model: 3.986004418e14
  8965. */
  8966. const GRAVITATIONALPARAMETER = 398600441800000;
  8967. /**
  8968. * Radius of the sun in meters: 6.955e8
  8969. */
  8970. const SOLAR_RADIUS = 695500000;
  8971. /**
  8972. * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
  8973. * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
  8974. * Celestial Mechanics 82: 83-110, 2002.
  8975. */
  8976. const LUNAR_RADIUS = 1737400;
  8977. /**
  8978. * 64 * 1024
  8979. */
  8980. const SIXTY_FOUR_KILOBYTES: number;
  8981. /**
  8982. * 4 * 1024 * 1024 * 1024
  8983. */
  8984. const FOUR_GIGABYTES: number;
  8985. /**
  8986. * Returns the sign of the value; 1 if the value is positive, -1 if the value is
  8987. * negative, or 0 if the value is 0.
  8988. * @param value - The value to return the sign of.
  8989. * @returns The sign of value.
  8990. */
  8991. function sign(value: number): number;
  8992. /**
  8993. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
  8994. * This is similar to {@link Math#sign} except that returns 1.0 instead of
  8995. * 0.0 when the input value is 0.0.
  8996. * @param value - The value to return the sign of.
  8997. * @returns The sign of value.
  8998. */
  8999. function signNotZero(value: number): number;
  9000. /**
  9001. * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
  9002. * @param value - The scalar value in the range [-1.0, 1.0]
  9003. * @param [rangeMaximum = 255] - The maximum value in the mapped range, 255 by default.
  9004. * @returns A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
  9005. */
  9006. function toSNorm(value: number, rangeMaximum?: number): number;
  9007. /**
  9008. * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
  9009. * @param value - SNORM value in the range [0, rangeMaximum]
  9010. * @param [rangeMaximum = 255] - The maximum value in the SNORM range, 255 by default.
  9011. * @returns Scalar in the range [-1.0, 1.0].
  9012. */
  9013. function fromSNorm(value: number, rangeMaximum?: number): number;
  9014. /**
  9015. * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
  9016. * @param value - The scalar value in the range [rangeMinimum, rangeMaximum]
  9017. * @param rangeMinimum - The minimum value in the mapped range.
  9018. * @param rangeMaximum - The maximum value in the mapped range.
  9019. * @returns A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
  9020. */
  9021. function normalize(value: number, rangeMinimum: number, rangeMaximum: number): number;
  9022. /**
  9023. * Returns the hyperbolic sine of a number.
  9024. * The hyperbolic sine of <em>value</em> is defined to be
  9025. * (<em>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></em>)/2.0
  9026. * where <i>e</i> is Euler's number, approximately 2.71828183.
  9027. *
  9028. * <p>Special cases:
  9029. * <ul>
  9030. * <li>If the argument is NaN, then the result is NaN.</li>
  9031. *
  9032. * <li>If the argument is infinite, then the result is an infinity
  9033. * with the same sign as the argument.</li>
  9034. *
  9035. * <li>If the argument is zero, then the result is a zero with the
  9036. * same sign as the argument.</li>
  9037. * </ul>
  9038. * </p>
  9039. * @param value - The number whose hyperbolic sine is to be returned.
  9040. * @returns The hyperbolic sine of <code>value</code>.
  9041. */
  9042. function sinh(value: number): number;
  9043. /**
  9044. * Returns the hyperbolic cosine of a number.
  9045. * The hyperbolic cosine of <strong>value</strong> is defined to be
  9046. * (<em>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></em>)/2.0
  9047. * where <i>e</i> is Euler's number, approximately 2.71828183.
  9048. *
  9049. * <p>Special cases:
  9050. * <ul>
  9051. * <li>If the argument is NaN, then the result is NaN.</li>
  9052. *
  9053. * <li>If the argument is infinite, then the result is positive infinity.</li>
  9054. *
  9055. * <li>If the argument is zero, then the result is 1.0.</li>
  9056. * </ul>
  9057. * </p>
  9058. * @param value - The number whose hyperbolic cosine is to be returned.
  9059. * @returns The hyperbolic cosine of <code>value</code>.
  9060. */
  9061. function cosh(value: number): number;
  9062. /**
  9063. * Computes the linear interpolation of two values.
  9064. * @example
  9065. * const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
  9066. * @param p - The start value to interpolate.
  9067. * @param q - The end value to interpolate.
  9068. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  9069. * @returns The linearly interpolated value.
  9070. */
  9071. function lerp(p: number, q: number, time: number): number;
  9072. /**
  9073. * pi
  9074. */
  9075. const PI: number;
  9076. /**
  9077. * 1/pi
  9078. */
  9079. const ONE_OVER_PI: number;
  9080. /**
  9081. * pi/2
  9082. */
  9083. const PI_OVER_TWO: number;
  9084. /**
  9085. * pi/3
  9086. */
  9087. const PI_OVER_THREE: number;
  9088. /**
  9089. * pi/4
  9090. */
  9091. const PI_OVER_FOUR: number;
  9092. /**
  9093. * pi/6
  9094. */
  9095. const PI_OVER_SIX: number;
  9096. /**
  9097. * 3pi/2
  9098. */
  9099. const THREE_PI_OVER_TWO: number;
  9100. /**
  9101. * 2pi
  9102. */
  9103. const TWO_PI: number;
  9104. /**
  9105. * 1/2pi
  9106. */
  9107. const ONE_OVER_TWO_PI: number;
  9108. /**
  9109. * The number of radians in a degree.
  9110. */
  9111. const RADIANS_PER_DEGREE: number;
  9112. /**
  9113. * The number of degrees in a radian.
  9114. */
  9115. const DEGREES_PER_RADIAN: number;
  9116. /**
  9117. * The number of radians in an arc second.
  9118. */
  9119. const RADIANS_PER_ARCSECOND: number;
  9120. /**
  9121. * Converts degrees to radians.
  9122. * @param degrees - The angle to convert in degrees.
  9123. * @returns The corresponding angle in radians.
  9124. */
  9125. function toRadians(degrees: number): number;
  9126. /**
  9127. * Converts radians to degrees.
  9128. * @param radians - The angle to convert in radians.
  9129. * @returns The corresponding angle in degrees.
  9130. */
  9131. function toDegrees(radians: number): number;
  9132. /**
  9133. * Converts a longitude value, in radians, to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9134. * @example
  9135. * // Convert 270 degrees to -90 degrees longitude
  9136. * const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
  9137. * @param angle - The longitude value, in radians, to convert to the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9138. * @returns The equivalent longitude value in the range [<code>-Math.PI</code>, <code>Math.PI</code>).
  9139. */
  9140. function convertLongitudeRange(angle: number): number;
  9141. /**
  9142. * Convenience function that clamps a latitude value, in radians, to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9143. * Useful for sanitizing data before use in objects requiring correct range.
  9144. * @example
  9145. * // Clamp 108 degrees latitude to 90 degrees latitude
  9146. * const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
  9147. * @param angle - The latitude value, in radians, to clamp to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9148. * @returns The latitude value clamped to the range [<code>-Math.PI/2</code>, <code>Math.PI/2</code>).
  9149. */
  9150. function clampToLatitudeRange(angle: number): number;
  9151. /**
  9152. * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
  9153. * @param angle - in radians
  9154. * @returns The angle in the range [<code>-Math.PI</code>, <code>Math.PI</code>].
  9155. */
  9156. function negativePiToPi(angle: number): number;
  9157. /**
  9158. * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
  9159. * @param angle - in radians
  9160. * @returns The angle in the range [0, <code>Math.TWO_PI</code>].
  9161. */
  9162. function zeroToTwoPi(angle: number): number;
  9163. /**
  9164. * The modulo operation that also works for negative dividends.
  9165. * @param m - The dividend.
  9166. * @param n - The divisor.
  9167. * @returns The remainder.
  9168. */
  9169. function mod(m: number, n: number): number;
  9170. /**
  9171. * Determines if two values are equal using an absolute or relative tolerance test. This is useful
  9172. * to avoid problems due to roundoff error when comparing floating-point values directly. The values are
  9173. * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
  9174. * Use this test if you are unsure of the magnitudes of left and right.
  9175. * @example
  9176. * const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
  9177. * const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
  9178. * const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
  9179. * const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
  9180. * @param left - The first value to compare.
  9181. * @param right - The other value to compare.
  9182. * @param [relativeEpsilon = 0] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the relative tolerance test.
  9183. * @param [absoluteEpsilon = relativeEpsilon] - The maximum inclusive delta between <code>left</code> and <code>right</code> for the absolute tolerance test.
  9184. * @returns <code>true</code> if the values are equal within the epsilon; otherwise, <code>false</code>.
  9185. */
  9186. function equalsEpsilon(left: number, right: number, relativeEpsilon?: number, absoluteEpsilon?: number): boolean;
  9187. /**
  9188. * Determines if the left value is less than the right value. If the two values are within
  9189. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9190. * @param left - The first number to compare.
  9191. * @param right - The second number to compare.
  9192. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9193. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> by more than
  9194. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is greater or if the two
  9195. * values are nearly equal.
  9196. */
  9197. function lessThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9198. /**
  9199. * Determines if the left value is less than or equal to the right value. If the two values are within
  9200. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9201. * @param left - The first number to compare.
  9202. * @param right - The second number to compare.
  9203. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9204. * @returns <code>true</code> if <code>left</code> is less than <code>right</code> or if the
  9205. * the values are nearly equal.
  9206. */
  9207. function lessThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9208. /**
  9209. * Determines if the left value is greater the right value. If the two values are within
  9210. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns false.
  9211. * @param left - The first number to compare.
  9212. * @param right - The second number to compare.
  9213. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9214. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> by more than
  9215. * <code>absoluteEpsilon<code>. <code>false</code> if <code>left</code> is less or if the two
  9216. * values are nearly equal.
  9217. */
  9218. function greaterThan(left: number, right: number, absoluteEpsilon: number): boolean;
  9219. /**
  9220. * Determines if the left value is greater than or equal to the right value. If the two values are within
  9221. * <code>absoluteEpsilon</code> of each other, they are considered equal and this function returns true.
  9222. * @param left - The first number to compare.
  9223. * @param right - The second number to compare.
  9224. * @param absoluteEpsilon - The absolute epsilon to use in comparison.
  9225. * @returns <code>true</code> if <code>left</code> is greater than <code>right</code> or if the
  9226. * the values are nearly equal.
  9227. */
  9228. function greaterThanOrEquals(left: number, right: number, absoluteEpsilon: number): boolean;
  9229. /**
  9230. * Computes the factorial of the provided number.
  9231. * @example
  9232. * //Compute 7!, which is equal to 5040
  9233. * const computedFactorial = Cesium.Math.factorial(7);
  9234. * @param n - The number whose factorial is to be computed.
  9235. * @returns The factorial of the provided number or undefined if the number is less than 0.
  9236. */
  9237. function factorial(n: number): number;
  9238. /**
  9239. * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
  9240. * @example
  9241. * const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
  9242. * const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
  9243. * @param [n] - The number to be incremented.
  9244. * @param [maximumValue] - The maximum incremented value before rolling over to the minimum value.
  9245. * @param [minimumValue = 0.0] - The number reset to after the maximum value has been exceeded.
  9246. * @returns The incremented number.
  9247. */
  9248. function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number;
  9249. /**
  9250. * Determines if a non-negative integer is a power of two.
  9251. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  9252. * @example
  9253. * const t = Cesium.Math.isPowerOfTwo(16); // true
  9254. * const f = Cesium.Math.isPowerOfTwo(20); // false
  9255. * @param n - The integer to test in the range [0, (2^32)-1].
  9256. * @returns <code>true</code> if the number if a power of two; otherwise, <code>false</code>.
  9257. */
  9258. function isPowerOfTwo(n: number): boolean;
  9259. /**
  9260. * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.
  9261. * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.
  9262. * @example
  9263. * const n = Cesium.Math.nextPowerOfTwo(29); // 32
  9264. * const m = Cesium.Math.nextPowerOfTwo(32); // 32
  9265. * @param n - The integer to test in the range [0, 2^31].
  9266. * @returns The next power-of-two integer.
  9267. */
  9268. function nextPowerOfTwo(n: number): number;
  9269. /**
  9270. * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.
  9271. * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
  9272. * @example
  9273. * const n = Cesium.Math.previousPowerOfTwo(29); // 16
  9274. * const m = Cesium.Math.previousPowerOfTwo(32); // 32
  9275. * @param n - The integer to test in the range [0, (2^32)-1].
  9276. * @returns The previous power-of-two integer.
  9277. */
  9278. function previousPowerOfTwo(n: number): number;
  9279. /**
  9280. * Constraint a value to lie between two values.
  9281. * @param value - The value to clamp.
  9282. * @param min - The minimum value.
  9283. * @param max - The maximum value.
  9284. * @returns The clamped value such that min <= result <= max.
  9285. */
  9286. function clamp(value: number, min: number, max: number): number;
  9287. /**
  9288. * Sets the seed used by the random number generator
  9289. * in {@link Math#nextRandomNumber}.
  9290. * @param seed - An integer used as the seed.
  9291. */
  9292. function setRandomNumberSeed(seed: number): void;
  9293. /**
  9294. * Generates a random floating point number in the range of [0.0, 1.0)
  9295. * using a Mersenne twister.
  9296. * @returns A random number in the range of [0.0, 1.0).
  9297. */
  9298. function nextRandomNumber(): number;
  9299. /**
  9300. * Generates a random number between two numbers.
  9301. * @param min - The minimum value.
  9302. * @param max - The maximum value.
  9303. * @returns A random number between the min and max.
  9304. */
  9305. function randomBetween(min: number, max: number): number;
  9306. /**
  9307. * Computes <code>Math.acos(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9308. * so that the function will never return NaN.
  9309. * @param value - The value for which to compute acos.
  9310. * @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,
  9311. * whichever is closer, if the value is outside the range.
  9312. */
  9313. function acosClamped(value: number): number;
  9314. /**
  9315. * Computes <code>Math.asin(value)</code>, but first clamps <code>value</code> to the range [-1.0, 1.0]
  9316. * so that the function will never return NaN.
  9317. * @param value - The value for which to compute asin.
  9318. * @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,
  9319. * whichever is closer, if the value is outside the range.
  9320. */
  9321. function asinClamped(value: number): number;
  9322. /**
  9323. * Finds the chord length between two points given the circle's radius and the angle between the points.
  9324. * @param angle - The angle between the two points.
  9325. * @param radius - The radius of the circle.
  9326. * @returns The chord length.
  9327. */
  9328. function chordLength(angle: number, radius: number): number;
  9329. /**
  9330. * Finds the logarithm of a number to a base.
  9331. * @param number - The number.
  9332. * @param base - The base.
  9333. * @returns The result.
  9334. */
  9335. function logBase(number: number, base: number): number;
  9336. /**
  9337. * Finds the cube root of a number.
  9338. * Returns NaN if <code>number</code> is not provided.
  9339. * @param [number] - The number.
  9340. * @returns The result.
  9341. */
  9342. function cbrt(number?: number): number;
  9343. /**
  9344. * Finds the base 2 logarithm of a number.
  9345. * @param number - The number.
  9346. * @returns The result.
  9347. */
  9348. function log2(number: number): number;
  9349. /**
  9350. * Computes a fast approximation of Atan for input in the range [-1, 1].
  9351. *
  9352. * Based on Michal Drobot's approximation from ShaderFastLibs,
  9353. * which in turn is based on "Efficient approximations for the arctangent function,"
  9354. * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  9355. * Adapted from ShaderFastLibs under MIT License.
  9356. * @param x - An input number in the range [-1, 1]
  9357. * @returns An approximation of atan(x)
  9358. */
  9359. function fastApproximateAtan(x: number): number;
  9360. /**
  9361. * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
  9362. *
  9363. * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
  9364. * @param x - An input number that isn't zero if y is zero.
  9365. * @param y - An input number that isn't zero if x is zero.
  9366. * @returns An approximation of atan2(x, y)
  9367. */
  9368. function fastApproximateAtan2(x: number, y: number): number;
  9369. }
  9370. export interface Matrix2 extends ArrayLike<number> {
  9371. }
  9372. /**
  9373. * A 2x2 matrix, indexable as a column-major order array.
  9374. * Constructor parameters are in row-major order for code readability.
  9375. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9376. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9377. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9378. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9379. */
  9380. export class Matrix2 implements ArrayLike<number> {
  9381. constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number);
  9382. /**
  9383. * The number of elements used to pack the object into an array.
  9384. */
  9385. static packedLength: number;
  9386. /**
  9387. * Stores the provided instance into the provided array.
  9388. * @param value - The value to pack.
  9389. * @param array - The array to pack into.
  9390. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9391. * @returns The array that was packed into
  9392. */
  9393. static pack(value: Matrix2, array: number[], startingIndex?: number): number[];
  9394. /**
  9395. * Retrieves an instance from a packed array.
  9396. * @param array - The packed array.
  9397. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9398. * @param [result] - The object into which to store the result.
  9399. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9400. */
  9401. static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9402. /**
  9403. * Flattens an array of Matrix2s into an array of components. The components
  9404. * are stored in column-major order.
  9405. * @param array - The array of matrices to pack.
  9406. * @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.
  9407. * @returns The packed array.
  9408. */
  9409. static packArray(array: Matrix2[], result?: number[]): number[];
  9410. /**
  9411. * Unpacks an array of column-major matrix components into an array of Matrix2s.
  9412. * @param array - The array of components to unpack.
  9413. * @param [result] - The array onto which to store the result.
  9414. * @returns The unpacked array.
  9415. */
  9416. static unpackArray(array: number[], result?: Matrix2[]): Matrix2[];
  9417. /**
  9418. * Duplicates a Matrix2 instance.
  9419. * @param matrix - The matrix to duplicate.
  9420. * @param [result] - The object onto which to store the result.
  9421. * @returns The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
  9422. */
  9423. static clone(matrix: Matrix2, result?: Matrix2): Matrix2;
  9424. /**
  9425. * Creates a Matrix2 from 4 consecutive elements in an array.
  9426. * @example
  9427. * // Create the Matrix2:
  9428. * // [1.0, 2.0]
  9429. * // [1.0, 2.0]
  9430. *
  9431. * const v = [1.0, 1.0, 2.0, 2.0];
  9432. * const m = Cesium.Matrix2.fromArray(v);
  9433. *
  9434. * // Create same Matrix2 with using an offset into an array
  9435. * const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
  9436. * const m2 = Cesium.Matrix2.fromArray(v2, 2);
  9437. * @param array - The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9438. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9439. * @param [result] - The object onto which to store the result.
  9440. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9441. */
  9442. static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2;
  9443. /**
  9444. * Creates a Matrix2 instance from a column-major order array.
  9445. * @param values - The column-major order array.
  9446. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9447. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9448. */
  9449. static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2;
  9450. /**
  9451. * Creates a Matrix2 instance from a row-major order array.
  9452. * The resulting matrix will be in column-major order.
  9453. * @param values - The row-major order array.
  9454. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9455. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9456. */
  9457. static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2;
  9458. /**
  9459. * Computes a Matrix2 instance representing a non-uniform scale.
  9460. * @example
  9461. * // Creates
  9462. * // [7.0, 0.0]
  9463. * // [0.0, 8.0]
  9464. * const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
  9465. * @param scale - The x and y scale factors.
  9466. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9467. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9468. */
  9469. static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2;
  9470. /**
  9471. * Computes a Matrix2 instance representing a uniform scale.
  9472. * @example
  9473. * // Creates
  9474. * // [2.0, 0.0]
  9475. * // [0.0, 2.0]
  9476. * const m = Cesium.Matrix2.fromUniformScale(2.0);
  9477. * @param scale - The uniform scale factor.
  9478. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9479. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9480. */
  9481. static fromUniformScale(scale: number, result?: Matrix2): Matrix2;
  9482. /**
  9483. * Creates a rotation matrix.
  9484. * @example
  9485. * // Rotate a point 45 degrees counterclockwise.
  9486. * const p = new Cesium.Cartesian2(5, 6);
  9487. * const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
  9488. * const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
  9489. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9490. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9491. * @returns The modified result parameter, or a new Matrix2 instance if one was not provided.
  9492. */
  9493. static fromRotation(angle: number, result?: Matrix2): Matrix2;
  9494. /**
  9495. * Creates an Array from the provided Matrix2 instance.
  9496. * The array will be in column-major order.
  9497. * @param matrix - The matrix to use..
  9498. * @param [result] - The Array onto which to store the result.
  9499. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9500. */
  9501. static toArray(matrix: Matrix2, result?: number[]): number[];
  9502. /**
  9503. * Computes the array index of the element at the provided row and column.
  9504. * @example
  9505. * const myMatrix = new Cesium.Matrix2();
  9506. * const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
  9507. * const column1Row0 = myMatrix[column1Row0Index]
  9508. * myMatrix[column1Row0Index] = 10.0;
  9509. * @param row - The zero-based index of the row.
  9510. * @param column - The zero-based index of the column.
  9511. * @returns The index of the element at the provided row and column.
  9512. */
  9513. static getElementIndex(row: number, column: number): number;
  9514. /**
  9515. * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
  9516. * @param matrix - The matrix to use.
  9517. * @param index - The zero-based index of the column to retrieve.
  9518. * @param result - The object onto which to store the result.
  9519. * @returns The modified result parameter.
  9520. */
  9521. static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9522. /**
  9523. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
  9524. * @param matrix - The matrix to use.
  9525. * @param index - The zero-based index of the column to set.
  9526. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9527. * @param result - The object onto which to store the result.
  9528. * @returns The modified result parameter.
  9529. */
  9530. static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2;
  9531. /**
  9532. * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
  9533. * @param matrix - The matrix to use.
  9534. * @param index - The zero-based index of the row to retrieve.
  9535. * @param result - The object onto which to store the result.
  9536. * @returns The modified result parameter.
  9537. */
  9538. static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2;
  9539. /**
  9540. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
  9541. * @param matrix - The matrix to use.
  9542. * @param index - The zero-based index of the row to set.
  9543. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9544. * @param result - The object onto which to store the result.
  9545. * @returns The modified result parameter.
  9546. */
  9547. static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2;
  9548. /**
  9549. * Computes a new matrix that replaces the scale with the provided scale.
  9550. * This assumes the matrix is an affine transformation.
  9551. * @param matrix - The matrix to use.
  9552. * @param scale - The scale that replaces the scale of the provided matrix.
  9553. * @param result - The object onto which to store the result.
  9554. * @returns The modified result parameter.
  9555. */
  9556. static setScale(matrix: Matrix2, scale: Cartesian2, result: Matrix2): Matrix2;
  9557. /**
  9558. * Computes a new matrix that replaces the scale with the provided uniform scale.
  9559. * This assumes the matrix is an affine transformation.
  9560. * @param matrix - The matrix to use.
  9561. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  9562. * @param result - The object onto which to store the result.
  9563. * @returns The modified result parameter.
  9564. */
  9565. static setUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  9566. /**
  9567. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  9568. * @param matrix - The matrix.
  9569. * @param result - The object onto which to store the result.
  9570. * @returns The modified result parameter.
  9571. */
  9572. static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2;
  9573. /**
  9574. * Computes the maximum scale assuming the matrix is an affine transformation.
  9575. * The maximum scale is the maximum length of the column vectors.
  9576. * @param matrix - The matrix.
  9577. * @returns The maximum scale.
  9578. */
  9579. static getMaximumScale(matrix: Matrix2): number;
  9580. /**
  9581. * Sets the rotation assuming the matrix is an affine transformation.
  9582. * @param matrix - The matrix.
  9583. * @param rotation - The rotation matrix.
  9584. * @returns The modified result parameter.
  9585. */
  9586. static setRotation(matrix: Matrix2, rotation: Matrix2): Matrix2;
  9587. /**
  9588. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  9589. * @param matrix - The matrix.
  9590. * @param result - The object onto which to store the result.
  9591. * @returns The modified result parameter.
  9592. */
  9593. static getRotation(matrix: Matrix2, result: Matrix2): Matrix2;
  9594. /**
  9595. * Computes the product of two matrices.
  9596. * @param left - The first matrix.
  9597. * @param right - The second matrix.
  9598. * @param result - The object onto which to store the result.
  9599. * @returns The modified result parameter.
  9600. */
  9601. static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9602. /**
  9603. * Computes the sum of two matrices.
  9604. * @param left - The first matrix.
  9605. * @param right - The second matrix.
  9606. * @param result - The object onto which to store the result.
  9607. * @returns The modified result parameter.
  9608. */
  9609. static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9610. /**
  9611. * Computes the difference of two matrices.
  9612. * @param left - The first matrix.
  9613. * @param right - The second matrix.
  9614. * @param result - The object onto which to store the result.
  9615. * @returns The modified result parameter.
  9616. */
  9617. static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2;
  9618. /**
  9619. * Computes the product of a matrix and a column vector.
  9620. * @param matrix - The matrix.
  9621. * @param cartesian - The column.
  9622. * @param result - The object onto which to store the result.
  9623. * @returns The modified result parameter.
  9624. */
  9625. static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2;
  9626. /**
  9627. * Computes the product of a matrix and a scalar.
  9628. * @param matrix - The matrix.
  9629. * @param scalar - The number to multiply by.
  9630. * @param result - The object onto which to store the result.
  9631. * @returns The modified result parameter.
  9632. */
  9633. static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2;
  9634. /**
  9635. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  9636. * @example
  9637. * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
  9638. * Cesium.Matrix2.multiplyByScale(m, scale, m);
  9639. * @param matrix - The matrix on the left-hand side.
  9640. * @param scale - The non-uniform scale on the right-hand side.
  9641. * @param result - The object onto which to store the result.
  9642. * @returns The modified result parameter.
  9643. */
  9644. static multiplyByScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  9645. /**
  9646. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  9647. * @example
  9648. * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);
  9649. * Cesium.Matrix2.multiplyByUniformScale(m, scale, m);
  9650. * @param matrix - The matrix on the left-hand side.
  9651. * @param scale - The uniform scale on the right-hand side.
  9652. * @param result - The object onto which to store the result.
  9653. * @returns The modified result parameter.
  9654. */
  9655. static multiplyByUniformScale(matrix: Matrix2, scale: number, result: Matrix2): Matrix2;
  9656. /**
  9657. * Creates a negated copy of the provided matrix.
  9658. * @param matrix - The matrix to negate.
  9659. * @param result - The object onto which to store the result.
  9660. * @returns The modified result parameter.
  9661. */
  9662. static negate(matrix: Matrix2, result: Matrix2): Matrix2;
  9663. /**
  9664. * Computes the transpose of the provided matrix.
  9665. * @param matrix - The matrix to transpose.
  9666. * @param result - The object onto which to store the result.
  9667. * @returns The modified result parameter.
  9668. */
  9669. static transpose(matrix: Matrix2, result: Matrix2): Matrix2;
  9670. /**
  9671. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  9672. * @param matrix - The matrix with signed elements.
  9673. * @param result - The object onto which to store the result.
  9674. * @returns The modified result parameter.
  9675. */
  9676. static abs(matrix: Matrix2, result: Matrix2): Matrix2;
  9677. /**
  9678. * Compares the provided matrices componentwise and returns
  9679. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9680. * @param [left] - The first matrix.
  9681. * @param [right] - The second matrix.
  9682. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  9683. */
  9684. static equals(left?: Matrix2, right?: Matrix2): boolean;
  9685. /**
  9686. * Compares the provided matrices componentwise and returns
  9687. * <code>true</code> if they are within the provided epsilon,
  9688. * <code>false</code> otherwise.
  9689. * @param [left] - The first matrix.
  9690. * @param [right] - The second matrix.
  9691. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9692. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  9693. */
  9694. static equalsEpsilon(left?: Matrix2, right?: Matrix2, epsilon?: number): boolean;
  9695. /**
  9696. * An immutable Matrix2 instance initialized to the identity matrix.
  9697. */
  9698. static readonly IDENTITY: Matrix2;
  9699. /**
  9700. * An immutable Matrix2 instance initialized to the zero matrix.
  9701. */
  9702. static readonly ZERO: Matrix2;
  9703. /**
  9704. * The index into Matrix2 for column 0, row 0.
  9705. * @example
  9706. * const matrix = new Cesium.Matrix2();
  9707. * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
  9708. */
  9709. static readonly COLUMN0ROW0: number;
  9710. /**
  9711. * The index into Matrix2 for column 0, row 1.
  9712. * @example
  9713. * const matrix = new Cesium.Matrix2();
  9714. * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
  9715. */
  9716. static readonly COLUMN0ROW1: number;
  9717. /**
  9718. * The index into Matrix2 for column 1, row 0.
  9719. * @example
  9720. * const matrix = new Cesium.Matrix2();
  9721. * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
  9722. */
  9723. static readonly COLUMN1ROW0: number;
  9724. /**
  9725. * The index into Matrix2 for column 1, row 1.
  9726. * @example
  9727. * const matrix = new Cesium.Matrix2();
  9728. * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
  9729. */
  9730. static readonly COLUMN1ROW1: number;
  9731. /**
  9732. * Gets the number of items in the collection.
  9733. */
  9734. length: number;
  9735. /**
  9736. * Duplicates the provided Matrix2 instance.
  9737. * @param [result] - The object onto which to store the result.
  9738. * @returns The modified result parameter or a new Matrix2 instance if one was not provided.
  9739. */
  9740. clone(result?: Matrix2): Matrix2;
  9741. /**
  9742. * Compares this matrix to the provided matrix componentwise and returns
  9743. * <code>true</code> if they are equal, <code>false</code> otherwise.
  9744. * @param [right] - The right hand side matrix.
  9745. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  9746. */
  9747. equals(right?: Matrix2): boolean;
  9748. /**
  9749. * Compares this matrix to the provided matrix componentwise and returns
  9750. * <code>true</code> if they are within the provided epsilon,
  9751. * <code>false</code> otherwise.
  9752. * @param [right] - The right hand side matrix.
  9753. * @param [epsilon = 0] - The epsilon to use for equality testing.
  9754. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  9755. */
  9756. equalsEpsilon(right?: Matrix2, epsilon?: number): boolean;
  9757. /**
  9758. * Creates a string representing this Matrix with each row being
  9759. * on a separate line and in the format '(column0, column1)'.
  9760. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
  9761. */
  9762. toString(): string;
  9763. }
  9764. export interface Matrix3 extends ArrayLike<number> {
  9765. }
  9766. /**
  9767. * A 3x3 matrix, indexable as a column-major order array.
  9768. * Constructor parameters are in row-major order for code readability.
  9769. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  9770. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  9771. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  9772. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  9773. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  9774. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  9775. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  9776. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  9777. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  9778. */
  9779. export class Matrix3 implements ArrayLike<number> {
  9780. constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number);
  9781. /**
  9782. * The number of elements used to pack the object into an array.
  9783. */
  9784. static packedLength: number;
  9785. /**
  9786. * Stores the provided instance into the provided array.
  9787. * @param value - The value to pack.
  9788. * @param array - The array to pack into.
  9789. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  9790. * @returns The array that was packed into
  9791. */
  9792. static pack(value: Matrix3, array: number[], startingIndex?: number): number[];
  9793. /**
  9794. * Retrieves an instance from a packed array.
  9795. * @param array - The packed array.
  9796. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  9797. * @param [result] - The object into which to store the result.
  9798. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9799. */
  9800. static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9801. /**
  9802. * Flattens an array of Matrix3s into an array of components. The components
  9803. * are stored in column-major order.
  9804. * @param array - The array of matrices to pack.
  9805. * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 9 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 9) elements.
  9806. * @returns The packed array.
  9807. */
  9808. static packArray(array: Matrix3[], result?: number[]): number[];
  9809. /**
  9810. * Unpacks an array of column-major matrix components into an array of Matrix3s.
  9811. * @param array - The array of components to unpack.
  9812. * @param [result] - The array onto which to store the result.
  9813. * @returns The unpacked array.
  9814. */
  9815. static unpackArray(array: number[], result?: Matrix3[]): Matrix3[];
  9816. /**
  9817. * Duplicates a Matrix3 instance.
  9818. * @param matrix - The matrix to duplicate.
  9819. * @param [result] - The object onto which to store the result.
  9820. * @returns The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
  9821. */
  9822. static clone(matrix: Matrix3, result?: Matrix3): Matrix3;
  9823. /**
  9824. * Creates a Matrix3 from 9 consecutive elements in an array.
  9825. * @example
  9826. * // Create the Matrix3:
  9827. * // [1.0, 2.0, 3.0]
  9828. * // [1.0, 2.0, 3.0]
  9829. * // [1.0, 2.0, 3.0]
  9830. *
  9831. * const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9832. * const m = Cesium.Matrix3.fromArray(v);
  9833. *
  9834. * // Create same Matrix3 with using an offset into an array
  9835. * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
  9836. * const m2 = Cesium.Matrix3.fromArray(v2, 2);
  9837. * @param array - The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  9838. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  9839. * @param [result] - The object onto which to store the result.
  9840. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  9841. */
  9842. static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3;
  9843. /**
  9844. * Creates a Matrix3 instance from a column-major order array.
  9845. * @param values - The column-major order array.
  9846. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9847. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9848. */
  9849. static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3;
  9850. /**
  9851. * Creates a Matrix3 instance from a row-major order array.
  9852. * The resulting matrix will be in column-major order.
  9853. * @param values - The row-major order array.
  9854. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9855. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9856. */
  9857. static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3;
  9858. /**
  9859. * Computes a 3x3 rotation matrix from the provided quaternion.
  9860. * @param quaternion - the quaternion to use.
  9861. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9862. * @returns The 3x3 rotation matrix from this quaternion.
  9863. */
  9864. static fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3;
  9865. /**
  9866. * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
  9867. * @param headingPitchRoll - the headingPitchRoll to use.
  9868. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9869. * @returns The 3x3 rotation matrix from this headingPitchRoll.
  9870. */
  9871. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3;
  9872. /**
  9873. * Computes a Matrix3 instance representing a non-uniform scale.
  9874. * @example
  9875. * // Creates
  9876. * // [7.0, 0.0, 0.0]
  9877. * // [0.0, 8.0, 0.0]
  9878. * // [0.0, 0.0, 9.0]
  9879. * const m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9880. * @param scale - The x, y, and z scale factors.
  9881. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9882. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9883. */
  9884. static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3;
  9885. /**
  9886. * Computes a Matrix3 instance representing a uniform scale.
  9887. * @example
  9888. * // Creates
  9889. * // [2.0, 0.0, 0.0]
  9890. * // [0.0, 2.0, 0.0]
  9891. * // [0.0, 0.0, 2.0]
  9892. * const m = Cesium.Matrix3.fromUniformScale(2.0);
  9893. * @param scale - The uniform scale factor.
  9894. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9895. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9896. */
  9897. static fromUniformScale(scale: number, result?: Matrix3): Matrix3;
  9898. /**
  9899. * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
  9900. * @example
  9901. * // Creates
  9902. * // [0.0, -9.0, 8.0]
  9903. * // [9.0, 0.0, -7.0]
  9904. * // [-8.0, 7.0, 0.0]
  9905. * const m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  9906. * @param vector - the vector on the left hand side of the cross product operation.
  9907. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9908. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9909. */
  9910. static fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3;
  9911. /**
  9912. * Creates a rotation matrix around the x-axis.
  9913. * @example
  9914. * // Rotate a point 45 degrees counterclockwise around the x-axis.
  9915. * const p = new Cesium.Cartesian3(5, 6, 7);
  9916. * const m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));
  9917. * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9918. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9919. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9920. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9921. */
  9922. static fromRotationX(angle: number, result?: Matrix3): Matrix3;
  9923. /**
  9924. * Creates a rotation matrix around the y-axis.
  9925. * @example
  9926. * // Rotate a point 45 degrees counterclockwise around the y-axis.
  9927. * const p = new Cesium.Cartesian3(5, 6, 7);
  9928. * const m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));
  9929. * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9930. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9931. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9932. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9933. */
  9934. static fromRotationY(angle: number, result?: Matrix3): Matrix3;
  9935. /**
  9936. * Creates a rotation matrix around the z-axis.
  9937. * @example
  9938. * // Rotate a point 45 degrees counterclockwise around the z-axis.
  9939. * const p = new Cesium.Cartesian3(5, 6, 7);
  9940. * const m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));
  9941. * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
  9942. * @param angle - The angle, in radians, of the rotation. Positive angles are counterclockwise.
  9943. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  9944. * @returns The modified result parameter, or a new Matrix3 instance if one was not provided.
  9945. */
  9946. static fromRotationZ(angle: number, result?: Matrix3): Matrix3;
  9947. /**
  9948. * Creates an Array from the provided Matrix3 instance.
  9949. * The array will be in column-major order.
  9950. * @param matrix - The matrix to use..
  9951. * @param [result] - The Array onto which to store the result.
  9952. * @returns The modified Array parameter or a new Array instance if one was not provided.
  9953. */
  9954. static toArray(matrix: Matrix3, result?: number[]): number[];
  9955. /**
  9956. * Computes the array index of the element at the provided row and column.
  9957. * @example
  9958. * const myMatrix = new Cesium.Matrix3();
  9959. * const column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);
  9960. * const column1Row0 = myMatrix[column1Row0Index]
  9961. * myMatrix[column1Row0Index] = 10.0;
  9962. * @param column - The zero-based index of the column.
  9963. * @param row - The zero-based index of the row.
  9964. * @returns The index of the element at the provided row and column.
  9965. */
  9966. static getElementIndex(column: number, row: number): number;
  9967. /**
  9968. * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
  9969. * @param matrix - The matrix to use.
  9970. * @param index - The zero-based index of the column to retrieve.
  9971. * @param result - The object onto which to store the result.
  9972. * @returns The modified result parameter.
  9973. */
  9974. static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9975. /**
  9976. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
  9977. * @param matrix - The matrix to use.
  9978. * @param index - The zero-based index of the column to set.
  9979. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  9980. * @param result - The object onto which to store the result.
  9981. * @returns The modified result parameter.
  9982. */
  9983. static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  9984. /**
  9985. * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
  9986. * @param matrix - The matrix to use.
  9987. * @param index - The zero-based index of the row to retrieve.
  9988. * @param result - The object onto which to store the result.
  9989. * @returns The modified result parameter.
  9990. */
  9991. static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3;
  9992. /**
  9993. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
  9994. * @param matrix - The matrix to use.
  9995. * @param index - The zero-based index of the row to set.
  9996. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  9997. * @param result - The object onto which to store the result.
  9998. * @returns The modified result parameter.
  9999. */
  10000. static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3;
  10001. /**
  10002. * Computes a new matrix that replaces the scale with the provided scale.
  10003. * This assumes the matrix is an affine transformation.
  10004. * @param matrix - The matrix to use.
  10005. * @param scale - The scale that replaces the scale of the provided matrix.
  10006. * @param result - The object onto which to store the result.
  10007. * @returns The modified result parameter.
  10008. */
  10009. static setScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3;
  10010. /**
  10011. * Computes a new matrix that replaces the scale with the provided uniform scale.
  10012. * This assumes the matrix is an affine transformation.
  10013. * @param matrix - The matrix to use.
  10014. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  10015. * @param result - The object onto which to store the result.
  10016. * @returns The modified result parameter.
  10017. */
  10018. static setUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  10019. /**
  10020. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  10021. * @param matrix - The matrix.
  10022. * @param result - The object onto which to store the result.
  10023. * @returns The modified result parameter.
  10024. */
  10025. static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3;
  10026. /**
  10027. * Computes the maximum scale assuming the matrix is an affine transformation.
  10028. * The maximum scale is the maximum length of the column vectors.
  10029. * @param matrix - The matrix.
  10030. * @returns The maximum scale.
  10031. */
  10032. static getMaximumScale(matrix: Matrix3): number;
  10033. /**
  10034. * Sets the rotation assuming the matrix is an affine transformation.
  10035. * @param matrix - The matrix.
  10036. * @param rotation - The rotation matrix.
  10037. * @returns The modified result parameter.
  10038. */
  10039. static setRotation(matrix: Matrix3, rotation: Matrix3): Matrix3;
  10040. /**
  10041. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  10042. * @param matrix - The matrix.
  10043. * @param result - The object onto which to store the result.
  10044. * @returns The modified result parameter.
  10045. */
  10046. static getRotation(matrix: Matrix3, result: Matrix3): Matrix3;
  10047. /**
  10048. * Computes the product of two matrices.
  10049. * @param left - The first matrix.
  10050. * @param right - The second matrix.
  10051. * @param result - The object onto which to store the result.
  10052. * @returns The modified result parameter.
  10053. */
  10054. static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  10055. /**
  10056. * Computes the sum of two matrices.
  10057. * @param left - The first matrix.
  10058. * @param right - The second matrix.
  10059. * @param result - The object onto which to store the result.
  10060. * @returns The modified result parameter.
  10061. */
  10062. static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  10063. /**
  10064. * Computes the difference of two matrices.
  10065. * @param left - The first matrix.
  10066. * @param right - The second matrix.
  10067. * @param result - The object onto which to store the result.
  10068. * @returns The modified result parameter.
  10069. */
  10070. static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3;
  10071. /**
  10072. * Computes the product of a matrix and a column vector.
  10073. * @param matrix - The matrix.
  10074. * @param cartesian - The column.
  10075. * @param result - The object onto which to store the result.
  10076. * @returns The modified result parameter.
  10077. */
  10078. static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10079. /**
  10080. * Computes the product of a matrix and a scalar.
  10081. * @param matrix - The matrix.
  10082. * @param scalar - The number to multiply by.
  10083. * @param result - The object onto which to store the result.
  10084. * @returns The modified result parameter.
  10085. */
  10086. static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3;
  10087. /**
  10088. * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
  10089. * @example
  10090. * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);
  10091. * Cesium.Matrix3.multiplyByScale(m, scale, m);
  10092. * @param matrix - The matrix on the left-hand side.
  10093. * @param scale - The non-uniform scale on the right-hand side.
  10094. * @param result - The object onto which to store the result.
  10095. * @returns The modified result parameter.
  10096. */
  10097. static multiplyByScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  10098. /**
  10099. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  10100. * @example
  10101. * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromUniformScale(scale), m);
  10102. * Cesium.Matrix3.multiplyByUniformScale(m, scale, m);
  10103. * @param matrix - The matrix on the left-hand side.
  10104. * @param scale - The uniform scale on the right-hand side.
  10105. * @param result - The object onto which to store the result.
  10106. * @returns The modified result parameter.
  10107. */
  10108. static multiplyByUniformScale(matrix: Matrix3, scale: number, result: Matrix3): Matrix3;
  10109. /**
  10110. * Creates a negated copy of the provided matrix.
  10111. * @param matrix - The matrix to negate.
  10112. * @param result - The object onto which to store the result.
  10113. * @returns The modified result parameter.
  10114. */
  10115. static negate(matrix: Matrix3, result: Matrix3): Matrix3;
  10116. /**
  10117. * Computes the transpose of the provided matrix.
  10118. * @param matrix - The matrix to transpose.
  10119. * @param result - The object onto which to store the result.
  10120. * @returns The modified result parameter.
  10121. */
  10122. static transpose(matrix: Matrix3, result: Matrix3): Matrix3;
  10123. /**
  10124. * Computes the eigenvectors and eigenvalues of a symmetric matrix.
  10125. * <p>
  10126. * Returns a diagonal matrix and unitary matrix such that:
  10127. * <code>matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)</code>
  10128. * </p>
  10129. * <p>
  10130. * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
  10131. * of the unitary matrix are the corresponding eigenvectors.
  10132. * </p>
  10133. * @example
  10134. * const a = //... symetric matrix
  10135. * const result = {
  10136. * unitary : new Cesium.Matrix3(),
  10137. * diagonal : new Cesium.Matrix3()
  10138. * };
  10139. * Cesium.Matrix3.computeEigenDecomposition(a, result);
  10140. *
  10141. * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());
  10142. * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());
  10143. * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
  10144. *
  10145. * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue
  10146. * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector
  10147. * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)
  10148. * @param matrix - The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
  10149. * @param [result] - An object with unitary and diagonal properties which are matrices onto which to store the result.
  10150. * @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
  10151. */
  10152. static computeEigenDecomposition(matrix: Matrix3, result?: any): any;
  10153. /**
  10154. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10155. * @param matrix - The matrix with signed elements.
  10156. * @param result - The object onto which to store the result.
  10157. * @returns The modified result parameter.
  10158. */
  10159. static abs(matrix: Matrix3, result: Matrix3): Matrix3;
  10160. /**
  10161. * Computes the determinant of the provided matrix.
  10162. * @param matrix - The matrix to use.
  10163. * @returns The value of the determinant of the matrix.
  10164. */
  10165. static determinant(matrix: Matrix3): number;
  10166. /**
  10167. * Computes the inverse of the provided matrix.
  10168. * @param matrix - The matrix to invert.
  10169. * @param result - The object onto which to store the result.
  10170. * @returns The modified result parameter.
  10171. */
  10172. static inverse(matrix: Matrix3, result: Matrix3): Matrix3;
  10173. /**
  10174. * Computes the inverse transpose of a matrix.
  10175. * @param matrix - The matrix to transpose and invert.
  10176. * @param result - The object onto which to store the result.
  10177. * @returns The modified result parameter.
  10178. */
  10179. static inverseTranspose(matrix: Matrix3, result: Matrix3): Matrix3;
  10180. /**
  10181. * Compares the provided matrices componentwise and returns
  10182. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10183. * @param [left] - The first matrix.
  10184. * @param [right] - The second matrix.
  10185. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10186. */
  10187. static equals(left?: Matrix3, right?: Matrix3): boolean;
  10188. /**
  10189. * Compares the provided matrices componentwise and returns
  10190. * <code>true</code> if they are within the provided epsilon,
  10191. * <code>false</code> otherwise.
  10192. * @param [left] - The first matrix.
  10193. * @param [right] - The second matrix.
  10194. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10195. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10196. */
  10197. static equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean;
  10198. /**
  10199. * An immutable Matrix3 instance initialized to the identity matrix.
  10200. */
  10201. static readonly IDENTITY: Matrix3;
  10202. /**
  10203. * An immutable Matrix3 instance initialized to the zero matrix.
  10204. */
  10205. static readonly ZERO: Matrix3;
  10206. /**
  10207. * The index into Matrix3 for column 0, row 0.
  10208. */
  10209. static readonly COLUMN0ROW0: number;
  10210. /**
  10211. * The index into Matrix3 for column 0, row 1.
  10212. */
  10213. static readonly COLUMN0ROW1: number;
  10214. /**
  10215. * The index into Matrix3 for column 0, row 2.
  10216. */
  10217. static readonly COLUMN0ROW2: number;
  10218. /**
  10219. * The index into Matrix3 for column 1, row 0.
  10220. */
  10221. static readonly COLUMN1ROW0: number;
  10222. /**
  10223. * The index into Matrix3 for column 1, row 1.
  10224. */
  10225. static readonly COLUMN1ROW1: number;
  10226. /**
  10227. * The index into Matrix3 for column 1, row 2.
  10228. */
  10229. static readonly COLUMN1ROW2: number;
  10230. /**
  10231. * The index into Matrix3 for column 2, row 0.
  10232. */
  10233. static readonly COLUMN2ROW0: number;
  10234. /**
  10235. * The index into Matrix3 for column 2, row 1.
  10236. */
  10237. static readonly COLUMN2ROW1: number;
  10238. /**
  10239. * The index into Matrix3 for column 2, row 2.
  10240. */
  10241. static readonly COLUMN2ROW2: number;
  10242. /**
  10243. * Gets the number of items in the collection.
  10244. */
  10245. length: number;
  10246. /**
  10247. * Duplicates the provided Matrix3 instance.
  10248. * @param [result] - The object onto which to store the result.
  10249. * @returns The modified result parameter or a new Matrix3 instance if one was not provided.
  10250. */
  10251. clone(result?: Matrix3): Matrix3;
  10252. /**
  10253. * Compares this matrix to the provided matrix componentwise and returns
  10254. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10255. * @param [right] - The right hand side matrix.
  10256. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  10257. */
  10258. equals(right?: Matrix3): boolean;
  10259. /**
  10260. * Compares this matrix to the provided matrix componentwise and returns
  10261. * <code>true</code> if they are within the provided epsilon,
  10262. * <code>false</code> otherwise.
  10263. * @param [right] - The right hand side matrix.
  10264. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10265. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  10266. */
  10267. equalsEpsilon(right?: Matrix3, epsilon?: number): boolean;
  10268. /**
  10269. * Creates a string representing this Matrix with each row being
  10270. * on a separate line and in the format '(column0, column1, column2)'.
  10271. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
  10272. */
  10273. toString(): string;
  10274. }
  10275. export interface Matrix4 extends ArrayLike<number> {
  10276. }
  10277. /**
  10278. * A 4x4 matrix, indexable as a column-major order array.
  10279. * Constructor parameters are in row-major order for code readability.
  10280. * @param [column0Row0 = 0.0] - The value for column 0, row 0.
  10281. * @param [column1Row0 = 0.0] - The value for column 1, row 0.
  10282. * @param [column2Row0 = 0.0] - The value for column 2, row 0.
  10283. * @param [column3Row0 = 0.0] - The value for column 3, row 0.
  10284. * @param [column0Row1 = 0.0] - The value for column 0, row 1.
  10285. * @param [column1Row1 = 0.0] - The value for column 1, row 1.
  10286. * @param [column2Row1 = 0.0] - The value for column 2, row 1.
  10287. * @param [column3Row1 = 0.0] - The value for column 3, row 1.
  10288. * @param [column0Row2 = 0.0] - The value for column 0, row 2.
  10289. * @param [column1Row2 = 0.0] - The value for column 1, row 2.
  10290. * @param [column2Row2 = 0.0] - The value for column 2, row 2.
  10291. * @param [column3Row2 = 0.0] - The value for column 3, row 2.
  10292. * @param [column0Row3 = 0.0] - The value for column 0, row 3.
  10293. * @param [column1Row3 = 0.0] - The value for column 1, row 3.
  10294. * @param [column2Row3 = 0.0] - The value for column 2, row 3.
  10295. * @param [column3Row3 = 0.0] - The value for column 3, row 3.
  10296. */
  10297. export class Matrix4 implements ArrayLike<number> {
  10298. 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);
  10299. /**
  10300. * The number of elements used to pack the object into an array.
  10301. */
  10302. static packedLength: number;
  10303. /**
  10304. * Stores the provided instance into the provided array.
  10305. * @param value - The value to pack.
  10306. * @param array - The array to pack into.
  10307. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  10308. * @returns The array that was packed into
  10309. */
  10310. static pack(value: Matrix4, array: number[], startingIndex?: number): number[];
  10311. /**
  10312. * Retrieves an instance from a packed array.
  10313. * @param array - The packed array.
  10314. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  10315. * @param [result] - The object into which to store the result.
  10316. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10317. */
  10318. static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10319. /**
  10320. * Flattens an array of Matrix4s into an array of components. The components
  10321. * are stored in column-major order.
  10322. * @param array - The array of matrices to pack.
  10323. * @param [result] - The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements.
  10324. * @returns The packed array.
  10325. */
  10326. static packArray(array: Matrix4[], result?: number[]): number[];
  10327. /**
  10328. * Unpacks an array of column-major matrix components into an array of Matrix4s.
  10329. * @param array - The array of components to unpack.
  10330. * @param [result] - The array onto which to store the result.
  10331. * @returns The unpacked array.
  10332. */
  10333. static unpackArray(array: number[], result?: Matrix4[]): Matrix4[];
  10334. /**
  10335. * Duplicates a Matrix4 instance.
  10336. * @param matrix - The matrix to duplicate.
  10337. * @param [result] - The object onto which to store the result.
  10338. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
  10339. */
  10340. static clone(matrix: Matrix4, result?: Matrix4): Matrix4;
  10341. /**
  10342. * Creates a Matrix4 from 16 consecutive elements in an array.
  10343. * @example
  10344. * // Create the Matrix4:
  10345. * // [1.0, 2.0, 3.0, 4.0]
  10346. * // [1.0, 2.0, 3.0, 4.0]
  10347. * // [1.0, 2.0, 3.0, 4.0]
  10348. * // [1.0, 2.0, 3.0, 4.0]
  10349. *
  10350. * const 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];
  10351. * const m = Cesium.Matrix4.fromArray(v);
  10352. *
  10353. * // Create same Matrix4 with using an offset into an array
  10354. * const 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];
  10355. * const m2 = Cesium.Matrix4.fromArray(v2, 2);
  10356. * @param array - The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
  10357. * @param [startingIndex = 0] - The offset into the array of the first element, which corresponds to first column first row position in the matrix.
  10358. * @param [result] - The object onto which to store the result.
  10359. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  10360. */
  10361. static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4;
  10362. /**
  10363. * Computes a Matrix4 instance from a column-major order array.
  10364. * @param values - The column-major order array.
  10365. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10366. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10367. */
  10368. static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4;
  10369. /**
  10370. * Computes a Matrix4 instance from a row-major order array.
  10371. * The resulting matrix will be in column-major order.
  10372. * @param values - The row-major order array.
  10373. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10374. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10375. */
  10376. static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4;
  10377. /**
  10378. * Computes a Matrix4 instance from a Matrix3 representing the rotation
  10379. * and a Cartesian3 representing the translation.
  10380. * @param rotation - The upper left portion of the matrix representing the rotation.
  10381. * @param [translation = Cartesian3.ZERO] - The upper right portion of the matrix representing the translation.
  10382. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10383. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10384. */
  10385. static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4;
  10386. /**
  10387. * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
  10388. * representation with the rotation represented as a quaternion.
  10389. * @example
  10390. * const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  10391. * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
  10392. * Cesium.Quaternion.IDENTITY, // rotation
  10393. * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
  10394. * result);
  10395. * @param translation - The translation transformation.
  10396. * @param rotation - The rotation transformation.
  10397. * @param scale - The non-uniform scale transformation.
  10398. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10399. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10400. */
  10401. static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4;
  10402. /**
  10403. * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
  10404. * @param translationRotationScale - The instance.
  10405. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10406. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10407. */
  10408. static fromTranslationRotationScale(translationRotationScale: TranslationRotationScale, result?: Matrix4): Matrix4;
  10409. /**
  10410. * Creates a Matrix4 instance from a Cartesian3 representing the translation.
  10411. * @param translation - The upper right portion of the matrix representing the translation.
  10412. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10413. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10414. */
  10415. static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4;
  10416. /**
  10417. * Computes a Matrix4 instance representing a non-uniform scale.
  10418. * @example
  10419. * // Creates
  10420. * // [7.0, 0.0, 0.0, 0.0]
  10421. * // [0.0, 8.0, 0.0, 0.0]
  10422. * // [0.0, 0.0, 9.0, 0.0]
  10423. * // [0.0, 0.0, 0.0, 1.0]
  10424. * const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
  10425. * @param scale - The x, y, and z scale factors.
  10426. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10427. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10428. */
  10429. static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4;
  10430. /**
  10431. * Computes a Matrix4 instance representing a uniform scale.
  10432. * @example
  10433. * // Creates
  10434. * // [2.0, 0.0, 0.0, 0.0]
  10435. * // [0.0, 2.0, 0.0, 0.0]
  10436. * // [0.0, 0.0, 2.0, 0.0]
  10437. * // [0.0, 0.0, 0.0, 1.0]
  10438. * const m = Cesium.Matrix4.fromUniformScale(2.0);
  10439. * @param scale - The uniform scale factor.
  10440. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10441. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10442. */
  10443. static fromUniformScale(scale: number, result?: Matrix4): Matrix4;
  10444. /**
  10445. * Creates a rotation matrix.
  10446. * @param rotation - The rotation matrix.
  10447. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10448. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10449. */
  10450. static fromRotation(rotation: Matrix3, result?: Matrix4): Matrix4;
  10451. /**
  10452. * Computes a Matrix4 instance from a Camera.
  10453. * @param camera - The camera to use.
  10454. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  10455. * @returns The modified result parameter, or a new Matrix4 instance if one was not provided.
  10456. */
  10457. static fromCamera(camera: Camera, result?: Matrix4): Matrix4;
  10458. /**
  10459. * Computes a Matrix4 instance representing a perspective transformation matrix.
  10460. * @param fovY - The field of view along the Y axis in radians.
  10461. * @param aspectRatio - The aspect ratio.
  10462. * @param near - The distance to the near plane in meters.
  10463. * @param far - The distance to the far plane in meters.
  10464. * @param result - The object in which the result will be stored.
  10465. * @returns The modified result parameter.
  10466. */
  10467. static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4;
  10468. /**
  10469. * Computes a Matrix4 instance representing an orthographic transformation matrix.
  10470. * @param left - The number of meters to the left of the camera that will be in view.
  10471. * @param right - The number of meters to the right of the camera that will be in view.
  10472. * @param bottom - The number of meters below of the camera that will be in view.
  10473. * @param top - The number of meters above of the camera that will be in view.
  10474. * @param near - The distance to the near plane in meters.
  10475. * @param far - The distance to the far plane in meters.
  10476. * @param result - The object in which the result will be stored.
  10477. * @returns The modified result parameter.
  10478. */
  10479. static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10480. /**
  10481. * Computes a Matrix4 instance representing an off center perspective transformation.
  10482. * @param left - The number of meters to the left of the camera that will be in view.
  10483. * @param right - The number of meters to the right of the camera that will be in view.
  10484. * @param bottom - The number of meters below of the camera that will be in view.
  10485. * @param top - The number of meters above of the camera that will be in view.
  10486. * @param near - The distance to the near plane in meters.
  10487. * @param far - The distance to the far plane in meters.
  10488. * @param result - The object in which the result will be stored.
  10489. * @returns The modified result parameter.
  10490. */
  10491. static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4;
  10492. /**
  10493. * Computes a Matrix4 instance representing an infinite off center perspective transformation.
  10494. * @param left - The number of meters to the left of the camera that will be in view.
  10495. * @param right - The number of meters to the right of the camera that will be in view.
  10496. * @param bottom - The number of meters below of the camera that will be in view.
  10497. * @param top - The number of meters above of the camera that will be in view.
  10498. * @param near - The distance to the near plane in meters.
  10499. * @param result - The object in which the result will be stored.
  10500. * @returns The modified result parameter.
  10501. */
  10502. static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, result: Matrix4): Matrix4;
  10503. /**
  10504. * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
  10505. * @example
  10506. * // Create viewport transformation using an explicit viewport and depth range.
  10507. * const m = Cesium.Matrix4.computeViewportTransformation({
  10508. * x : 0.0,
  10509. * y : 0.0,
  10510. * width : 1024.0,
  10511. * height : 768.0
  10512. * }, 0.0, 1.0, new Cesium.Matrix4());
  10513. * @param [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] - The viewport's corners as shown in Example 1.
  10514. * @param [nearDepthRange = 0.0] - The near plane distance in window coordinates.
  10515. * @param [farDepthRange = 1.0] - The far plane distance in window coordinates.
  10516. * @param [result] - The object in which the result will be stored.
  10517. * @returns The modified result parameter.
  10518. */
  10519. static computeViewportTransformation(viewport?: any, nearDepthRange?: number, farDepthRange?: number, result?: Matrix4): Matrix4;
  10520. /**
  10521. * Computes a Matrix4 instance that transforms from world space to view space.
  10522. * @param position - The position of the camera.
  10523. * @param direction - The forward direction.
  10524. * @param up - The up direction.
  10525. * @param right - The right direction.
  10526. * @param result - The object in which the result will be stored.
  10527. * @returns The modified result parameter.
  10528. */
  10529. static computeView(position: Cartesian3, direction: Cartesian3, up: Cartesian3, right: Cartesian3, result: Matrix4): Matrix4;
  10530. /**
  10531. * Computes an Array from the provided Matrix4 instance.
  10532. * The array will be in column-major order.
  10533. * @example
  10534. * //create an array from an instance of Matrix4
  10535. * // m = [10.0, 14.0, 18.0, 22.0]
  10536. * // [11.0, 15.0, 19.0, 23.0]
  10537. * // [12.0, 16.0, 20.0, 24.0]
  10538. * // [13.0, 17.0, 21.0, 25.0]
  10539. * const a = Cesium.Matrix4.toArray(m);
  10540. *
  10541. * // m remains the same
  10542. * //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]
  10543. * @param matrix - The matrix to use..
  10544. * @param [result] - The Array onto which to store the result.
  10545. * @returns The modified Array parameter or a new Array instance if one was not provided.
  10546. */
  10547. static toArray(matrix: Matrix4, result?: number[]): number[];
  10548. /**
  10549. * Computes the array index of the element at the provided row and column.
  10550. * @example
  10551. * const myMatrix = new Cesium.Matrix4();
  10552. * const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
  10553. * const column1Row0 = myMatrix[column1Row0Index];
  10554. * myMatrix[column1Row0Index] = 10.0;
  10555. * @param row - The zero-based index of the row.
  10556. * @param column - The zero-based index of the column.
  10557. * @returns The index of the element at the provided row and column.
  10558. */
  10559. static getElementIndex(row: number, column: number): number;
  10560. /**
  10561. * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
  10562. * @example
  10563. * //returns a Cartesian4 instance with values from the specified column
  10564. * // m = [10.0, 11.0, 12.0, 13.0]
  10565. * // [14.0, 15.0, 16.0, 17.0]
  10566. * // [18.0, 19.0, 20.0, 21.0]
  10567. * // [22.0, 23.0, 24.0, 25.0]
  10568. *
  10569. * //Example 1: Creates an instance of Cartesian
  10570. * const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
  10571. * @example
  10572. * //Example 2: Sets values for Cartesian instance
  10573. * const a = new Cesium.Cartesian4();
  10574. * Cesium.Matrix4.getColumn(m, 2, a);
  10575. *
  10576. * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
  10577. * @param matrix - The matrix to use.
  10578. * @param index - The zero-based index of the column to retrieve.
  10579. * @param result - The object onto which to store the result.
  10580. * @returns The modified result parameter.
  10581. */
  10582. static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10583. /**
  10584. * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
  10585. * @example
  10586. * //creates a new Matrix4 instance with new column values from the Cartesian4 instance
  10587. * // m = [10.0, 11.0, 12.0, 13.0]
  10588. * // [14.0, 15.0, 16.0, 17.0]
  10589. * // [18.0, 19.0, 20.0, 21.0]
  10590. * // [22.0, 23.0, 24.0, 25.0]
  10591. *
  10592. * const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10593. *
  10594. * // m remains the same
  10595. * // a = [10.0, 11.0, 99.0, 13.0]
  10596. * // [14.0, 15.0, 98.0, 17.0]
  10597. * // [18.0, 19.0, 97.0, 21.0]
  10598. * // [22.0, 23.0, 96.0, 25.0]
  10599. * @param matrix - The matrix to use.
  10600. * @param index - The zero-based index of the column to set.
  10601. * @param cartesian - The Cartesian whose values will be assigned to the specified column.
  10602. * @param result - The object onto which to store the result.
  10603. * @returns The modified result parameter.
  10604. */
  10605. static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10606. /**
  10607. * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
  10608. * @example
  10609. * //returns a Cartesian4 instance with values from the specified column
  10610. * // m = [10.0, 11.0, 12.0, 13.0]
  10611. * // [14.0, 15.0, 16.0, 17.0]
  10612. * // [18.0, 19.0, 20.0, 21.0]
  10613. * // [22.0, 23.0, 24.0, 25.0]
  10614. *
  10615. * //Example 1: Returns an instance of Cartesian
  10616. * const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
  10617. * @example
  10618. * //Example 2: Sets values for a Cartesian instance
  10619. * const a = new Cesium.Cartesian4();
  10620. * Cesium.Matrix4.getRow(m, 2, a);
  10621. *
  10622. * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
  10623. * @param matrix - The matrix to use.
  10624. * @param index - The zero-based index of the row to retrieve.
  10625. * @param result - The object onto which to store the result.
  10626. * @returns The modified result parameter.
  10627. */
  10628. static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4;
  10629. /**
  10630. * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
  10631. * @example
  10632. * //create a new Matrix4 instance with new row values from the Cartesian4 instance
  10633. * // m = [10.0, 11.0, 12.0, 13.0]
  10634. * // [14.0, 15.0, 16.0, 17.0]
  10635. * // [18.0, 19.0, 20.0, 21.0]
  10636. * // [22.0, 23.0, 24.0, 25.0]
  10637. *
  10638. * const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
  10639. *
  10640. * // m remains the same
  10641. * // a = [10.0, 11.0, 12.0, 13.0]
  10642. * // [14.0, 15.0, 16.0, 17.0]
  10643. * // [99.0, 98.0, 97.0, 96.0]
  10644. * // [22.0, 23.0, 24.0, 25.0]
  10645. * @param matrix - The matrix to use.
  10646. * @param index - The zero-based index of the row to set.
  10647. * @param cartesian - The Cartesian whose values will be assigned to the specified row.
  10648. * @param result - The object onto which to store the result.
  10649. * @returns The modified result parameter.
  10650. */
  10651. static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Matrix4): Matrix4;
  10652. /**
  10653. * Computes a new matrix that replaces the translation in the rightmost column of the provided
  10654. * matrix with the provided translation. This assumes the matrix is an affine transformation.
  10655. * @param matrix - The matrix to use.
  10656. * @param translation - The translation that replaces the translation of the provided matrix.
  10657. * @param result - The object onto which to store the result.
  10658. * @returns The modified result parameter.
  10659. */
  10660. static setTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10661. /**
  10662. * Computes a new matrix that replaces the scale with the provided scale.
  10663. * This assumes the matrix is an affine transformation.
  10664. * @param matrix - The matrix to use.
  10665. * @param scale - The scale that replaces the scale of the provided matrix.
  10666. * @param result - The object onto which to store the result.
  10667. * @returns The modified result parameter.
  10668. */
  10669. static setScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10670. /**
  10671. * Computes a new matrix that replaces the scale with the provided uniform scale.
  10672. * This assumes the matrix is an affine transformation.
  10673. * @param matrix - The matrix to use.
  10674. * @param scale - The uniform scale that replaces the scale of the provided matrix.
  10675. * @param result - The object onto which to store the result.
  10676. * @returns The modified result parameter.
  10677. */
  10678. static setUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  10679. /**
  10680. * Extracts the non-uniform scale assuming the matrix is an affine transformation.
  10681. * @param matrix - The matrix.
  10682. * @param result - The object onto which to store the result.
  10683. * @returns The modified result parameter
  10684. */
  10685. static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10686. /**
  10687. * Computes the maximum scale assuming the matrix is an affine transformation.
  10688. * The maximum scale is the maximum length of the column vectors in the upper-left
  10689. * 3x3 matrix.
  10690. * @param matrix - The matrix.
  10691. * @returns The maximum scale.
  10692. */
  10693. static getMaximumScale(matrix: Matrix4): number;
  10694. /**
  10695. * Sets the rotation assuming the matrix is an affine transformation.
  10696. * @param matrix - The matrix.
  10697. * @param rotation - The rotation matrix.
  10698. * @returns The modified result parameter.
  10699. */
  10700. static setRotation(matrix: Matrix4, rotation: Matrix4): Matrix4;
  10701. /**
  10702. * Extracts the rotation matrix assuming the matrix is an affine transformation.
  10703. * @param matrix - The matrix.
  10704. * @param result - The object onto which to store the result.
  10705. * @returns The modified result parameter.
  10706. */
  10707. static getRotation(matrix: Matrix4, result: Matrix4): Matrix4;
  10708. /**
  10709. * Computes the product of two matrices.
  10710. * @param left - The first matrix.
  10711. * @param right - The second matrix.
  10712. * @param result - The object onto which to store the result.
  10713. * @returns The modified result parameter.
  10714. */
  10715. static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10716. /**
  10717. * Computes the sum of two matrices.
  10718. * @param left - The first matrix.
  10719. * @param right - The second matrix.
  10720. * @param result - The object onto which to store the result.
  10721. * @returns The modified result parameter.
  10722. */
  10723. static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10724. /**
  10725. * Computes the difference of two matrices.
  10726. * @param left - The first matrix.
  10727. * @param right - The second matrix.
  10728. * @param result - The object onto which to store the result.
  10729. * @returns The modified result parameter.
  10730. */
  10731. static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10732. /**
  10733. * Computes the product of two matrices assuming the matrices are affine transformation matrices,
  10734. * where the upper left 3x3 elements are any matrix, and
  10735. * the upper three elements in the fourth column are the translation.
  10736. * The bottom row is assumed to be [0, 0, 0, 1].
  10737. * The matrix is not verified to be in the proper form.
  10738. * This method is faster than computing the product for general 4x4
  10739. * matrices using {@link Matrix4.multiply}.
  10740. * @example
  10741. * const 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);
  10742. * const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
  10743. * const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
  10744. * @param left - The first matrix.
  10745. * @param right - The second matrix.
  10746. * @param result - The object onto which to store the result.
  10747. * @returns The modified result parameter.
  10748. */
  10749. static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4;
  10750. /**
  10751. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10752. * by a 3x3 rotation matrix. This is an optimization
  10753. * for <code>Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);</code> with less allocations and arithmetic operations.
  10754. * @example
  10755. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
  10756. * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
  10757. * @param matrix - The matrix on the left-hand side.
  10758. * @param rotation - The 3x3 rotation matrix on the right-hand side.
  10759. * @param result - The object onto which to store the result.
  10760. * @returns The modified result parameter.
  10761. */
  10762. static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4;
  10763. /**
  10764. * Multiplies a transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10765. * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
  10766. * for <code>Matrix4.multiply(m, Matrix4.fromTranslation(position), m);</code> with less allocations and arithmetic operations.
  10767. * @example
  10768. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
  10769. * Cesium.Matrix4.multiplyByTranslation(m, position, m);
  10770. * @param matrix - The matrix on the left-hand side.
  10771. * @param translation - The translation on the right-hand side.
  10772. * @param result - The object onto which to store the result.
  10773. * @returns The modified result parameter.
  10774. */
  10775. static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4;
  10776. /**
  10777. * Multiplies an affine transformation matrix (with a bottom row of <code>[0.0, 0.0, 0.0, 1.0]</code>)
  10778. * by an implicit non-uniform scale matrix. This is an optimization
  10779. * for <code>Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);</code>, where
  10780. * <code>m</code> must be an affine matrix.
  10781. * This function performs fewer allocations and arithmetic operations.
  10782. * @example
  10783. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
  10784. * Cesium.Matrix4.multiplyByScale(m, scale, m);
  10785. * @param matrix - The affine matrix on the left-hand side.
  10786. * @param scale - The non-uniform scale on the right-hand side.
  10787. * @param result - The object onto which to store the result.
  10788. * @returns The modified result parameter.
  10789. */
  10790. static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4;
  10791. /**
  10792. * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
  10793. * @example
  10794. * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
  10795. * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
  10796. * @param matrix - The matrix on the left-hand side.
  10797. * @param scale - The uniform scale on the right-hand side.
  10798. * @param result - The object onto which to store the result.
  10799. * @returns The modified result parameter.
  10800. */
  10801. static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4;
  10802. /**
  10803. * Computes the product of a matrix and a column vector.
  10804. * @param matrix - The matrix.
  10805. * @param cartesian - The vector.
  10806. * @param result - The object onto which to store the result.
  10807. * @returns The modified result parameter.
  10808. */
  10809. static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4;
  10810. /**
  10811. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10812. * with a {@link Cartesian4} with a <code>w</code> component of zero.
  10813. * @example
  10814. * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10815. * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
  10816. * // A shortcut for
  10817. * // Cartesian3 p = ...
  10818. * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
  10819. * @param matrix - The matrix.
  10820. * @param cartesian - The point.
  10821. * @param result - The object onto which to store the result.
  10822. * @returns The modified result parameter.
  10823. */
  10824. static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10825. /**
  10826. * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
  10827. * with a {@link Cartesian4} with a <code>w</code> component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
  10828. * @example
  10829. * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
  10830. * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
  10831. * @param matrix - The matrix.
  10832. * @param cartesian - The point.
  10833. * @param result - The object onto which to store the result.
  10834. * @returns The modified result parameter.
  10835. */
  10836. static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3;
  10837. /**
  10838. * Computes the product of a matrix and a scalar.
  10839. * @example
  10840. * //create a Matrix4 instance which is a scaled version of the supplied Matrix4
  10841. * // m = [10.0, 11.0, 12.0, 13.0]
  10842. * // [14.0, 15.0, 16.0, 17.0]
  10843. * // [18.0, 19.0, 20.0, 21.0]
  10844. * // [22.0, 23.0, 24.0, 25.0]
  10845. *
  10846. * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
  10847. *
  10848. * // m remains the same
  10849. * // a = [-20.0, -22.0, -24.0, -26.0]
  10850. * // [-28.0, -30.0, -32.0, -34.0]
  10851. * // [-36.0, -38.0, -40.0, -42.0]
  10852. * // [-44.0, -46.0, -48.0, -50.0]
  10853. * @param matrix - The matrix.
  10854. * @param scalar - The number to multiply by.
  10855. * @param result - The object onto which to store the result.
  10856. * @returns The modified result parameter.
  10857. */
  10858. static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4;
  10859. /**
  10860. * Computes a negated copy of the provided matrix.
  10861. * @example
  10862. * //create a new Matrix4 instance which is a negation of a Matrix4
  10863. * // m = [10.0, 11.0, 12.0, 13.0]
  10864. * // [14.0, 15.0, 16.0, 17.0]
  10865. * // [18.0, 19.0, 20.0, 21.0]
  10866. * // [22.0, 23.0, 24.0, 25.0]
  10867. *
  10868. * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
  10869. *
  10870. * // m remains the same
  10871. * // a = [-10.0, -11.0, -12.0, -13.0]
  10872. * // [-14.0, -15.0, -16.0, -17.0]
  10873. * // [-18.0, -19.0, -20.0, -21.0]
  10874. * // [-22.0, -23.0, -24.0, -25.0]
  10875. * @param matrix - The matrix to negate.
  10876. * @param result - The object onto which to store the result.
  10877. * @returns The modified result parameter.
  10878. */
  10879. static negate(matrix: Matrix4, result: Matrix4): Matrix4;
  10880. /**
  10881. * Computes the transpose of the provided matrix.
  10882. * @example
  10883. * //returns transpose of a Matrix4
  10884. * // m = [10.0, 11.0, 12.0, 13.0]
  10885. * // [14.0, 15.0, 16.0, 17.0]
  10886. * // [18.0, 19.0, 20.0, 21.0]
  10887. * // [22.0, 23.0, 24.0, 25.0]
  10888. *
  10889. * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
  10890. *
  10891. * // m remains the same
  10892. * // a = [10.0, 14.0, 18.0, 22.0]
  10893. * // [11.0, 15.0, 19.0, 23.0]
  10894. * // [12.0, 16.0, 20.0, 24.0]
  10895. * // [13.0, 17.0, 21.0, 25.0]
  10896. * @param matrix - The matrix to transpose.
  10897. * @param result - The object onto which to store the result.
  10898. * @returns The modified result parameter.
  10899. */
  10900. static transpose(matrix: Matrix4, result: Matrix4): Matrix4;
  10901. /**
  10902. * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
  10903. * @param matrix - The matrix with signed elements.
  10904. * @param result - The object onto which to store the result.
  10905. * @returns The modified result parameter.
  10906. */
  10907. static abs(matrix: Matrix4, result: Matrix4): Matrix4;
  10908. /**
  10909. * Compares the provided matrices componentwise and returns
  10910. * <code>true</code> if they are equal, <code>false</code> otherwise.
  10911. * @example
  10912. * //compares two Matrix4 instances
  10913. *
  10914. * // a = [10.0, 14.0, 18.0, 22.0]
  10915. * // [11.0, 15.0, 19.0, 23.0]
  10916. * // [12.0, 16.0, 20.0, 24.0]
  10917. * // [13.0, 17.0, 21.0, 25.0]
  10918. *
  10919. * // b = [10.0, 14.0, 18.0, 22.0]
  10920. * // [11.0, 15.0, 19.0, 23.0]
  10921. * // [12.0, 16.0, 20.0, 24.0]
  10922. * // [13.0, 17.0, 21.0, 25.0]
  10923. *
  10924. * if(Cesium.Matrix4.equals(a,b)) {
  10925. * console.log("Both matrices are equal");
  10926. * } else {
  10927. * console.log("They are not equal");
  10928. * }
  10929. *
  10930. * //Prints "Both matrices are equal" on the console
  10931. * @param [left] - The first matrix.
  10932. * @param [right] - The second matrix.
  10933. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  10934. */
  10935. static equals(left?: Matrix4, right?: Matrix4): boolean;
  10936. /**
  10937. * Compares the provided matrices componentwise and returns
  10938. * <code>true</code> if they are within the provided epsilon,
  10939. * <code>false</code> otherwise.
  10940. * @example
  10941. * //compares two Matrix4 instances
  10942. *
  10943. * // a = [10.5, 14.5, 18.5, 22.5]
  10944. * // [11.5, 15.5, 19.5, 23.5]
  10945. * // [12.5, 16.5, 20.5, 24.5]
  10946. * // [13.5, 17.5, 21.5, 25.5]
  10947. *
  10948. * // b = [10.0, 14.0, 18.0, 22.0]
  10949. * // [11.0, 15.0, 19.0, 23.0]
  10950. * // [12.0, 16.0, 20.0, 24.0]
  10951. * // [13.0, 17.0, 21.0, 25.0]
  10952. *
  10953. * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
  10954. * console.log("Difference between both the matrices is less than 0.1");
  10955. * } else {
  10956. * console.log("Difference between both the matrices is not less than 0.1");
  10957. * }
  10958. *
  10959. * //Prints "Difference between both the matrices is not less than 0.1" on the console
  10960. * @param [left] - The first matrix.
  10961. * @param [right] - The second matrix.
  10962. * @param [epsilon = 0] - The epsilon to use for equality testing.
  10963. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  10964. */
  10965. static equalsEpsilon(left?: Matrix4, right?: Matrix4, epsilon?: number): boolean;
  10966. /**
  10967. * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.
  10968. * @param matrix - The matrix to use.
  10969. * @param result - The object onto which to store the result.
  10970. * @returns The modified result parameter.
  10971. */
  10972. static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3;
  10973. /**
  10974. * Gets the upper left 3x3 matrix of the provided matrix.
  10975. * @example
  10976. * // returns a Matrix3 instance from a Matrix4 instance
  10977. *
  10978. * // m = [10.0, 14.0, 18.0, 22.0]
  10979. * // [11.0, 15.0, 19.0, 23.0]
  10980. * // [12.0, 16.0, 20.0, 24.0]
  10981. * // [13.0, 17.0, 21.0, 25.0]
  10982. *
  10983. * const b = new Cesium.Matrix3();
  10984. * Cesium.Matrix4.getMatrix3(m,b);
  10985. *
  10986. * // b = [10.0, 14.0, 18.0]
  10987. * // [11.0, 15.0, 19.0]
  10988. * // [12.0, 16.0, 20.0]
  10989. * @param matrix - The matrix to use.
  10990. * @param result - The object onto which to store the result.
  10991. * @returns The modified result parameter.
  10992. */
  10993. static getMatrix3(matrix: Matrix4, result: Matrix3): Matrix3;
  10994. /**
  10995. * Computes the inverse of the provided matrix using Cramers Rule.
  10996. * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
  10997. * If the matrix is a proper rigid transformation, it is more efficient
  10998. * to invert it with {@link Matrix4.inverseTransformation}.
  10999. * @param matrix - The matrix to invert.
  11000. * @param result - The object onto which to store the result.
  11001. * @returns The modified result parameter.
  11002. */
  11003. static inverse(matrix: Matrix4, result: Matrix4): Matrix4;
  11004. /**
  11005. * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,
  11006. * where the upper left 3x3 elements are a rotation matrix,
  11007. * and the upper three elements in the fourth column are the translation.
  11008. * The bottom row is assumed to be [0, 0, 0, 1].
  11009. * The matrix is not verified to be in the proper form.
  11010. * This method is faster than computing the inverse for a general 4x4
  11011. * matrix using {@link Matrix4.inverse}.
  11012. * @param matrix - The matrix to invert.
  11013. * @param result - The object onto which to store the result.
  11014. * @returns The modified result parameter.
  11015. */
  11016. static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4;
  11017. /**
  11018. * Computes the inverse transpose of a matrix.
  11019. * @param matrix - The matrix to transpose and invert.
  11020. * @param result - The object onto which to store the result.
  11021. * @returns The modified result parameter.
  11022. */
  11023. static inverseTranspose(matrix: Matrix4, result: Matrix4): Matrix4;
  11024. /**
  11025. * An immutable Matrix4 instance initialized to the identity matrix.
  11026. */
  11027. static readonly IDENTITY: Matrix4;
  11028. /**
  11029. * An immutable Matrix4 instance initialized to the zero matrix.
  11030. */
  11031. static readonly ZERO: Matrix4;
  11032. /**
  11033. * The index into Matrix4 for column 0, row 0.
  11034. */
  11035. static readonly COLUMN0ROW0: number;
  11036. /**
  11037. * The index into Matrix4 for column 0, row 1.
  11038. */
  11039. static readonly COLUMN0ROW1: number;
  11040. /**
  11041. * The index into Matrix4 for column 0, row 2.
  11042. */
  11043. static readonly COLUMN0ROW2: number;
  11044. /**
  11045. * The index into Matrix4 for column 0, row 3.
  11046. */
  11047. static readonly COLUMN0ROW3: number;
  11048. /**
  11049. * The index into Matrix4 for column 1, row 0.
  11050. */
  11051. static readonly COLUMN1ROW0: number;
  11052. /**
  11053. * The index into Matrix4 for column 1, row 1.
  11054. */
  11055. static readonly COLUMN1ROW1: number;
  11056. /**
  11057. * The index into Matrix4 for column 1, row 2.
  11058. */
  11059. static readonly COLUMN1ROW2: number;
  11060. /**
  11061. * The index into Matrix4 for column 1, row 3.
  11062. */
  11063. static readonly COLUMN1ROW3: number;
  11064. /**
  11065. * The index into Matrix4 for column 2, row 0.
  11066. */
  11067. static readonly COLUMN2ROW0: number;
  11068. /**
  11069. * The index into Matrix4 for column 2, row 1.
  11070. */
  11071. static readonly COLUMN2ROW1: number;
  11072. /**
  11073. * The index into Matrix4 for column 2, row 2.
  11074. */
  11075. static readonly COLUMN2ROW2: number;
  11076. /**
  11077. * The index into Matrix4 for column 2, row 3.
  11078. */
  11079. static readonly COLUMN2ROW3: number;
  11080. /**
  11081. * The index into Matrix4 for column 3, row 0.
  11082. */
  11083. static readonly COLUMN3ROW0: number;
  11084. /**
  11085. * The index into Matrix4 for column 3, row 1.
  11086. */
  11087. static readonly COLUMN3ROW1: number;
  11088. /**
  11089. * The index into Matrix4 for column 3, row 2.
  11090. */
  11091. static readonly COLUMN3ROW2: number;
  11092. /**
  11093. * The index into Matrix4 for column 3, row 3.
  11094. */
  11095. static readonly COLUMN3ROW3: number;
  11096. /**
  11097. * Gets the number of items in the collection.
  11098. */
  11099. length: number;
  11100. /**
  11101. * Duplicates the provided Matrix4 instance.
  11102. * @param [result] - The object onto which to store the result.
  11103. * @returns The modified result parameter or a new Matrix4 instance if one was not provided.
  11104. */
  11105. clone(result?: Matrix4): Matrix4;
  11106. /**
  11107. * Compares this matrix to the provided matrix componentwise and returns
  11108. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11109. * @param [right] - The right hand side matrix.
  11110. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11111. */
  11112. equals(right?: Matrix4): boolean;
  11113. /**
  11114. * Compares this matrix to the provided matrix componentwise and returns
  11115. * <code>true</code> if they are within the provided epsilon,
  11116. * <code>false</code> otherwise.
  11117. * @param [right] - The right hand side matrix.
  11118. * @param [epsilon = 0] - The epsilon to use for equality testing.
  11119. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  11120. */
  11121. equalsEpsilon(right?: Matrix4, epsilon?: number): boolean;
  11122. /**
  11123. * Computes a string representing this Matrix with each row being
  11124. * on a separate line and in the format '(column0, column1, column2, column3)'.
  11125. * @returns A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
  11126. */
  11127. toString(): string;
  11128. }
  11129. /**
  11130. * A spline that linearly interpolates over an array of weight values used by morph targets.
  11131. * @example
  11132. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  11133. * const weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
  11134. * const spline = new Cesium.WeightSpline({
  11135. * times : times,
  11136. * weights : weights
  11137. * });
  11138. *
  11139. * const p0 = spline.evaluate(times[0]);
  11140. * @param options - Object with the following properties:
  11141. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  11142. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  11143. * @param options.weights - The array of floating-point control weights given. The weights are ordered such
  11144. * that all weights for the targets are given in chronological order and order in which they appear in
  11145. * 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) ...]
  11146. * where i and j in w(i,j) are the time indices and target indices, respectively.
  11147. */
  11148. export class MorphWeightSpline {
  11149. constructor(options: {
  11150. times: number[];
  11151. weights: number[];
  11152. });
  11153. /**
  11154. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  11155. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  11156. * @param time - The time.
  11157. * @returns The index for the element at the start of the interval.
  11158. */
  11159. findTimeInterval(time: number): number;
  11160. /**
  11161. * Wraps the given time to the period covered by the spline.
  11162. * @param time - The time.
  11163. * @returns The time, wrapped around to the updated animation.
  11164. */
  11165. wrapTime(time: number): number;
  11166. /**
  11167. * Clamps the given time to the period covered by the spline.
  11168. * @param time - The time.
  11169. * @returns The time, clamped to the animation period.
  11170. */
  11171. clampTime(time: number): number;
  11172. /**
  11173. * Evaluates the curve at a given time.
  11174. * @param time - The time at which to evaluate the curve.
  11175. * @param [result] - The object onto which to store the result.
  11176. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  11177. */
  11178. evaluate(time: number, result?: number[]): number[];
  11179. }
  11180. /**
  11181. * Represents a scalar value's lower and upper bound at a near distance and far distance in eye space.
  11182. * @param [near = 0.0] - The lower bound of the camera range.
  11183. * @param [nearValue = 0.0] - The value at the lower bound of the camera range.
  11184. * @param [far = 1.0] - The upper bound of the camera range.
  11185. * @param [farValue = 0.0] - The value at the upper bound of the camera range.
  11186. */
  11187. export class NearFarScalar {
  11188. constructor(near?: number, nearValue?: number, far?: number, farValue?: number);
  11189. /**
  11190. * The lower bound of the camera range.
  11191. */
  11192. near: number;
  11193. /**
  11194. * The value at the lower bound of the camera range.
  11195. */
  11196. nearValue: number;
  11197. /**
  11198. * The upper bound of the camera range.
  11199. */
  11200. far: number;
  11201. /**
  11202. * The value at the upper bound of the camera range.
  11203. */
  11204. farValue: number;
  11205. /**
  11206. * Duplicates a NearFarScalar instance.
  11207. * @param nearFarScalar - The NearFarScalar to duplicate.
  11208. * @param [result] - The object onto which to store the result.
  11209. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided. (Returns undefined if nearFarScalar is undefined)
  11210. */
  11211. static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar;
  11212. /**
  11213. * The number of elements used to pack the object into an array.
  11214. */
  11215. static packedLength: number;
  11216. /**
  11217. * Stores the provided instance into the provided array.
  11218. * @param value - The value to pack.
  11219. * @param array - The array to pack into.
  11220. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11221. * @returns The array that was packed into
  11222. */
  11223. static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[];
  11224. /**
  11225. * Retrieves an instance from a packed array.
  11226. * @param array - The packed array.
  11227. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11228. * @param [result] - The object into which to store the result.
  11229. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  11230. */
  11231. static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar;
  11232. /**
  11233. * Compares the provided NearFarScalar and returns <code>true</code> if they are equal,
  11234. * <code>false</code> otherwise.
  11235. * @param [left] - The first NearFarScalar.
  11236. * @param [right] - The second NearFarScalar.
  11237. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  11238. */
  11239. static equals(left?: NearFarScalar, right?: NearFarScalar): boolean;
  11240. /**
  11241. * Duplicates this instance.
  11242. * @param [result] - The object onto which to store the result.
  11243. * @returns The modified result parameter or a new NearFarScalar instance if one was not provided.
  11244. */
  11245. clone(result?: NearFarScalar): NearFarScalar;
  11246. /**
  11247. * Compares this instance to the provided NearFarScalar and returns <code>true</code> if they are equal,
  11248. * <code>false</code> otherwise.
  11249. * @param [right] - The right hand side NearFarScalar.
  11250. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  11251. */
  11252. equals(right?: NearFarScalar): boolean;
  11253. }
  11254. /**
  11255. * Creates an Occluder derived from an object's position and radius, as well as the camera position.
  11256. * The occluder can be used to determine whether or not other objects are visible or hidden behind the
  11257. * visible horizon defined by the occluder and camera position.
  11258. * @example
  11259. * // Construct an occluder one unit away from the origin with a radius of one.
  11260. * const cameraPosition = Cesium.Cartesian3.ZERO;
  11261. * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 1);
  11262. * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  11263. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11264. * @param cameraPosition - The coordinate of the viewer/camera.
  11265. */
  11266. export class Occluder {
  11267. constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3);
  11268. /**
  11269. * The position of the occluder.
  11270. */
  11271. position: Cartesian3;
  11272. /**
  11273. * The radius of the occluder.
  11274. */
  11275. radius: number;
  11276. /**
  11277. * The position of the camera.
  11278. */
  11279. cameraPosition: Cartesian3;
  11280. /**
  11281. * Creates an occluder from a bounding sphere and the camera position.
  11282. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11283. * @param cameraPosition - The coordinate of the viewer/camera.
  11284. * @param [result] - The object onto which to store the result.
  11285. * @returns The occluder derived from an object's position and radius, as well as the camera position.
  11286. */
  11287. static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder;
  11288. /**
  11289. * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
  11290. * @example
  11291. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11292. * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  11293. * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  11294. * const point = new Cesium.Cartesian3(0, 0, -3);
  11295. * occluder.isPointVisible(point); //returns true
  11296. * @param occludee - The point surrounding the occludee object.
  11297. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  11298. */
  11299. isPointVisible(occludee: Cartesian3): boolean;
  11300. /**
  11301. * Determines whether or not a sphere, the <code>occludee</code>, is hidden from view by the occluder.
  11302. * @example
  11303. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11304. * const littleSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1), 0.25);
  11305. * const occluder = new Cesium.Occluder(littleSphere, cameraPosition);
  11306. * const bigSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -3), 1);
  11307. * occluder.isBoundingSphereVisible(bigSphere); //returns true
  11308. * @param occludee - The bounding sphere surrounding the occludee object.
  11309. * @returns <code>true</code> if the occludee is visible; otherwise <code>false</code>.
  11310. */
  11311. isBoundingSphereVisible(occludee: BoundingSphere): boolean;
  11312. /**
  11313. * Determine to what extent an occludee is visible (not visible, partially visible, or fully visible).
  11314. * @example
  11315. * const sphere1 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -1.5), 0.5);
  11316. * const sphere2 = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -2.5), 0.5);
  11317. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11318. * const occluder = new Cesium.Occluder(sphere1, cameraPosition);
  11319. * occluder.computeVisibility(sphere2); //returns Visibility.NONE
  11320. * @param occludeeBS - The bounding sphere of the occludee.
  11321. * @returns Visibility.NONE if the occludee is not visible,
  11322. * Visibility.PARTIAL if the occludee is partially visible, or
  11323. * Visibility.FULL if the occludee is fully visible.
  11324. */
  11325. computeVisibility(occludeeBS: BoundingSphere): Visibility;
  11326. /**
  11327. * Computes a point that can be used as the occludee position to the visibility functions.
  11328. * Use a radius of zero for the occludee radius. Typically, a user computes a bounding sphere around
  11329. * an object that is used for visibility; however it is also possible to compute a point that if
  11330. * seen/not seen would also indicate if an object is visible/not visible. This function is better
  11331. * called for objects that do not move relative to the occluder and is large, such as a chunk of
  11332. * terrain. You are better off not calling this and using the object's bounding sphere for objects
  11333. * such as a satellite or ground vehicle.
  11334. * @example
  11335. * const cameraPosition = new Cesium.Cartesian3(0, 0, 0);
  11336. * const occluderBoundingSphere = new Cesium.BoundingSphere(new Cesium.Cartesian3(0, 0, -8), 2);
  11337. * const occluder = new Cesium.Occluder(occluderBoundingSphere, cameraPosition);
  11338. * const positions = [new Cesium.Cartesian3(-0.25, 0, -5.3), new Cesium.Cartesian3(0.25, 0, -5.3)];
  11339. * const tileOccluderSphere = Cesium.BoundingSphere.fromPoints(positions);
  11340. * const occludeePosition = tileOccluderSphere.center;
  11341. * const occludeePt = Cesium.Occluder.computeOccludeePoint(occluderBoundingSphere, occludeePosition, positions);
  11342. * @param occluderBoundingSphere - The bounding sphere surrounding the occluder.
  11343. * @param occludeePosition - The point where the occludee (bounding sphere of radius 0) is located.
  11344. * @param positions - List of altitude points on the horizon near the surface of the occluder.
  11345. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11346. * which is a boolean value.
  11347. */
  11348. static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any;
  11349. /**
  11350. * Computes a point that can be used as the occludee position to the visibility functions from a rectangle.
  11351. * @param rectangle - The rectangle used to create a bounding sphere.
  11352. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine positions of the rectangle.
  11353. * @returns An object containing two attributes: <code>occludeePoint</code> and <code>valid</code>
  11354. * which is a boolean value.
  11355. */
  11356. static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any;
  11357. }
  11358. /**
  11359. * Provides geocoding via a {@link https://opencagedata.com/|OpenCage} server.
  11360. * @example
  11361. * // Configure a Viewer to use the OpenCage Geocoder
  11362. * const viewer = new Cesium.Viewer('cesiumContainer', {
  11363. * geocoder: new Cesium.OpenCageGeocoderService('https://api.opencagedata.com/geocode/v1/', '<API key>')
  11364. * });
  11365. * @param url - The endpoint to the OpenCage server.
  11366. * @param apiKey - The OpenCage API Key.
  11367. * @param [params] - An object with the following properties (See https://opencagedata.com/api#forward-opt):
  11368. * @param [params.abbrv] - When set to 1 we attempt to abbreviate and shorten the formatted string we return.
  11369. * @param [options.add_request] - When set to 1 the various request parameters are added to the response for ease of debugging.
  11370. * @param [options.bounds] - Provides the geocoder with a hint to the region that the query resides in.
  11371. * @param [options.countrycode] - Restricts the results to the specified country or countries (as defined by the ISO 3166-1 Alpha 2 standard).
  11372. * @param [options.jsonp] - Wraps the returned JSON with a function name.
  11373. * @param [options.language] - An IETF format language code.
  11374. * @param [options.limit] - The maximum number of results we should return.
  11375. * @param [options.min_confidence] - An integer from 1-10. Only results with at least this confidence will be returned.
  11376. * @param [options.no_annotations] - When set to 1 results will not contain annotations.
  11377. * @param [options.no_dedupe] - When set to 1 results will not be deduplicated.
  11378. * @param [options.no_record] - When set to 1 the query contents are not logged.
  11379. * @param [options.pretty] - When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.
  11380. * @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).
  11381. */
  11382. export class OpenCageGeocoderService {
  11383. constructor(url: Resource | string, apiKey: string, params?: {
  11384. abbrv?: number;
  11385. });
  11386. /**
  11387. * The Resource used to access the OpenCage endpoint.
  11388. */
  11389. readonly url: Resource;
  11390. /**
  11391. * Optional params passed to OpenCage in order to customize geocoding
  11392. */
  11393. readonly params: any;
  11394. /**
  11395. * @param query - The query to be sent to the geocoder service
  11396. */
  11397. geocode(query: string): Promise<GeocoderService.Result[]>;
  11398. }
  11399. /**
  11400. * Creates an instance of an OrientedBoundingBox.
  11401. * 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.
  11402. * @example
  11403. * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
  11404. * const center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
  11405. * const halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
  11406. *
  11407. * const obb = new Cesium.OrientedBoundingBox(center, halfAxes);
  11408. * @param [center = Cartesian3.ZERO] - The center of the box.
  11409. * @param [halfAxes = Matrix3.ZERO] - The three orthogonal half-axes of the bounding box.
  11410. * Equivalently, the transformation matrix, to rotate and scale a 0x0x0
  11411. * cube centered at the origin.
  11412. */
  11413. export class OrientedBoundingBox {
  11414. constructor(center?: Cartesian3, halfAxes?: Matrix3);
  11415. /**
  11416. * The center of the box.
  11417. */
  11418. center: Cartesian3;
  11419. /**
  11420. * The transformation matrix, to rotate the box to the right position.
  11421. */
  11422. halfAxes: Matrix3;
  11423. /**
  11424. * The number of elements used to pack the object into an array.
  11425. */
  11426. static packedLength: number;
  11427. /**
  11428. * Stores the provided instance into the provided array.
  11429. * @param value - The value to pack.
  11430. * @param array - The array to pack into.
  11431. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11432. * @returns The array that was packed into
  11433. */
  11434. static pack(value: OrientedBoundingBox, array: number[], startingIndex?: number): number[];
  11435. /**
  11436. * Retrieves an instance from a packed array.
  11437. * @param array - The packed array.
  11438. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11439. * @param [result] - The object into which to store the result.
  11440. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11441. */
  11442. static unpack(array: number[], startingIndex?: number, result?: OrientedBoundingBox): OrientedBoundingBox;
  11443. /**
  11444. * Computes an instance of an OrientedBoundingBox of the given positions.
  11445. * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
  11446. * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
  11447. * @example
  11448. * // Compute an object oriented bounding box enclosing two points.
  11449. * const box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
  11450. * @param [positions] - List of {@link Cartesian3} points that the bounding box will enclose.
  11451. * @param [result] - The object onto which to store the result.
  11452. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11453. */
  11454. static fromPoints(positions?: Cartesian3[], result?: OrientedBoundingBox): OrientedBoundingBox;
  11455. /**
  11456. * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
  11457. * There are no guarantees about the orientation of the bounding box.
  11458. * @param rectangle - The cartographic rectangle on the surface of the ellipsoid.
  11459. * @param [minimumHeight = 0.0] - The minimum height (elevation) within the tile.
  11460. * @param [maximumHeight = 0.0] - The maximum height (elevation) within the tile.
  11461. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle is defined.
  11462. * @param [result] - The object onto which to store the result.
  11463. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  11464. */
  11465. static fromRectangle(rectangle: Rectangle, minimumHeight?: number, maximumHeight?: number, ellipsoid?: Ellipsoid, result?: OrientedBoundingBox): OrientedBoundingBox;
  11466. /**
  11467. * Computes an OrientedBoundingBox that bounds an affine transformation.
  11468. * @param transformation - The affine transformation.
  11469. * @param [result] - The object onto which to store the result.
  11470. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided.
  11471. */
  11472. static fromTransformation(transformation: Matrix4, result?: OrientedBoundingBox): OrientedBoundingBox;
  11473. /**
  11474. * Duplicates a OrientedBoundingBox instance.
  11475. * @param box - The bounding box to duplicate.
  11476. * @param [result] - The object onto which to store the result.
  11477. * @returns The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
  11478. */
  11479. static clone(box: OrientedBoundingBox, result?: OrientedBoundingBox): OrientedBoundingBox;
  11480. /**
  11481. * Determines which side of a plane the oriented bounding box is located.
  11482. * @param box - The oriented bounding box to test.
  11483. * @param plane - The plane to test against.
  11484. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11485. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11486. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11487. * intersects the plane.
  11488. */
  11489. static intersectPlane(box: OrientedBoundingBox, plane: Plane): Intersect;
  11490. /**
  11491. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11492. * @example
  11493. * // Sort bounding boxes from back to front
  11494. * boxes.sort(function(a, b) {
  11495. * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
  11496. * });
  11497. * @param box - The box.
  11498. * @param cartesian - The point
  11499. * @returns The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.
  11500. */
  11501. static distanceSquaredTo(box: OrientedBoundingBox, cartesian: Cartesian3): number;
  11502. /**
  11503. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11504. * <br>
  11505. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11506. * closest and farthest planes from position that intersect the bounding box.
  11507. * @param box - The bounding box to calculate the distance to.
  11508. * @param position - The position to calculate the distance from.
  11509. * @param direction - The direction from position.
  11510. * @param [result] - A Interval to store the nearest and farthest distances.
  11511. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11512. */
  11513. static computePlaneDistances(box: OrientedBoundingBox, position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11514. /**
  11515. * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
  11516. * @param box - The oriented bounding box.
  11517. * @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
  11518. * @returns The modified result parameter or a new array if none was provided.
  11519. */
  11520. static computeCorners(box: OrientedBoundingBox, result?: Cartesian3[]): Cartesian3[];
  11521. /**
  11522. * Computes a transformation matrix from an oriented bounding box.
  11523. * @param box - The oriented bounding box.
  11524. * @param result - The object onto which to store the result.
  11525. * @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
  11526. */
  11527. static computeTransformation(box: OrientedBoundingBox, result: Matrix4): Matrix4;
  11528. /**
  11529. * Determines whether or not a bounding box is hidden from view by the occluder.
  11530. * @param box - The bounding box surrounding the occludee object.
  11531. * @param occluder - The occluder.
  11532. * @returns <code>true</code> if the box is not visible; otherwise <code>false</code>.
  11533. */
  11534. static isOccluded(box: OrientedBoundingBox, occluder: Occluder): boolean;
  11535. /**
  11536. * Determines which side of a plane the oriented bounding box is located.
  11537. * @param plane - The plane to test against.
  11538. * @returns {@link Intersect.INSIDE} if the entire box is on the side of the plane
  11539. * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
  11540. * on the opposite side, and {@link Intersect.INTERSECTING} if the box
  11541. * intersects the plane.
  11542. */
  11543. intersectPlane(plane: Plane): Intersect;
  11544. /**
  11545. * Computes the estimated distance squared from the closest point on a bounding box to a point.
  11546. * @example
  11547. * // Sort bounding boxes from back to front
  11548. * boxes.sort(function(a, b) {
  11549. * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
  11550. * });
  11551. * @param cartesian - The point
  11552. * @returns The estimated distance squared from the bounding sphere to the point.
  11553. */
  11554. distanceSquaredTo(cartesian: Cartesian3): number;
  11555. /**
  11556. * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
  11557. * <br>
  11558. * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
  11559. * closest and farthest planes from position that intersect the bounding box.
  11560. * @param position - The position to calculate the distance from.
  11561. * @param direction - The direction from position.
  11562. * @param [result] - A Interval to store the nearest and farthest distances.
  11563. * @returns The nearest and farthest distances on the bounding box from position in direction.
  11564. */
  11565. computePlaneDistances(position: Cartesian3, direction: Cartesian3, result?: Interval): Interval;
  11566. /**
  11567. * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
  11568. * @param [result] - An array of eight {@link Cartesian3} instances onto which to store the corners.
  11569. * @returns The modified result parameter or a new array if none was provided.
  11570. */
  11571. computeCorners(result?: Cartesian3[]): Cartesian3[];
  11572. /**
  11573. * Computes a transformation matrix from an oriented bounding box.
  11574. * @param result - The object onto which to store the result.
  11575. * @returns The modified result parameter or a new {@link Matrix4} instance if none was provided.
  11576. */
  11577. computeTransformation(result: Matrix4): Matrix4;
  11578. /**
  11579. * Determines whether or not a bounding box is hidden from view by the occluder.
  11580. * @param occluder - The occluder.
  11581. * @returns <code>true</code> if the sphere is not visible; otherwise <code>false</code>.
  11582. */
  11583. isOccluded(occluder: Occluder): boolean;
  11584. /**
  11585. * Compares the provided OrientedBoundingBox componentwise and returns
  11586. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11587. * @param left - The first OrientedBoundingBox.
  11588. * @param right - The second OrientedBoundingBox.
  11589. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  11590. */
  11591. static equals(left: OrientedBoundingBox, right: OrientedBoundingBox): boolean;
  11592. /**
  11593. * Duplicates this OrientedBoundingBox instance.
  11594. * @param [result] - The object onto which to store the result.
  11595. * @returns The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
  11596. */
  11597. clone(result?: OrientedBoundingBox): OrientedBoundingBox;
  11598. /**
  11599. * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
  11600. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11601. * @param [right] - The right hand side OrientedBoundingBox.
  11602. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11603. */
  11604. equals(right?: OrientedBoundingBox): boolean;
  11605. }
  11606. /**
  11607. * The viewing frustum is defined by 6 planes.
  11608. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11609. * define the unit vector normal to the plane, and the w component is the distance of the
  11610. * plane from the origin/camera position.
  11611. * @example
  11612. * const maxRadii = ellipsoid.maximumRadius;
  11613. *
  11614. * const frustum = new Cesium.OrthographicFrustum();
  11615. * frustum.near = 0.01 * maxRadii;
  11616. * frustum.far = 50.0 * maxRadii;
  11617. * @param [options] - An object with the following properties:
  11618. * @param [options.width] - The width of the frustum in meters.
  11619. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11620. * @param [options.near = 1.0] - The distance of the near plane.
  11621. * @param [options.far = 500000000.0] - The distance of the far plane.
  11622. */
  11623. export class OrthographicFrustum {
  11624. constructor(options?: {
  11625. width?: number;
  11626. aspectRatio?: number;
  11627. near?: number;
  11628. far?: number;
  11629. });
  11630. /**
  11631. * The horizontal width of the frustum in meters.
  11632. */
  11633. width: number;
  11634. /**
  11635. * The aspect ratio of the frustum's width to it's height.
  11636. */
  11637. aspectRatio: number;
  11638. /**
  11639. * The distance of the near plane.
  11640. */
  11641. near: number;
  11642. /**
  11643. * The distance of the far plane.
  11644. */
  11645. far: number;
  11646. /**
  11647. * The number of elements used to pack the object into an array.
  11648. */
  11649. static packedLength: number;
  11650. /**
  11651. * Stores the provided instance into the provided array.
  11652. * @param value - The value to pack.
  11653. * @param array - The array to pack into.
  11654. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11655. * @returns The array that was packed into
  11656. */
  11657. static pack(value: OrthographicFrustum, array: number[], startingIndex?: number): number[];
  11658. /**
  11659. * Retrieves an instance from a packed array.
  11660. * @param array - The packed array.
  11661. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11662. * @param [result] - The object into which to store the result.
  11663. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11664. */
  11665. static unpack(array: number[], startingIndex?: number, result?: OrthographicFrustum): OrthographicFrustum;
  11666. /**
  11667. * Gets the orthographic projection matrix computed from the view frustum.
  11668. */
  11669. readonly projectionMatrix: Matrix4;
  11670. /**
  11671. * Creates a culling volume for this frustum.
  11672. * @example
  11673. * // Check if a bounding volume intersects the frustum.
  11674. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11675. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  11676. * @param position - The eye position.
  11677. * @param direction - The view direction.
  11678. * @param up - The up direction.
  11679. * @returns A culling volume at the given position and orientation.
  11680. */
  11681. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11682. /**
  11683. * Returns the pixel's width and height in meters.
  11684. * @example
  11685. * // Example 1
  11686. * // Get the width and height of a pixel.
  11687. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, 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 OrthographicFrustum instance.
  11698. * @param [result] - The object onto which to store the result.
  11699. * @returns The modified result parameter or a new OrthographicFrustum instance if one was not provided.
  11700. */
  11701. clone(result?: OrthographicFrustum): OrthographicFrustum;
  11702. /**
  11703. * Compares the provided OrthographicFrustum componentwise and returns
  11704. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11705. * @param [other] - The right hand side OrthographicFrustum.
  11706. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11707. */
  11708. equals(other?: OrthographicFrustum): boolean;
  11709. /**
  11710. * Compares the provided OrthographicFrustum 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 OrthographicFrustum.
  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: OrthographicFrustum, 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. * const maxRadii = ellipsoid.maximumRadius;
  11727. *
  11728. * const frustum = new Cesium.OrthographicOffCenterFrustum();
  11729. * frustum.right = maxRadii * Cesium.Math.PI;
  11730. * frustum.left = -c.frustum.right;
  11731. * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
  11732. * frustum.bottom = -c.frustum.top;
  11733. * frustum.near = 0.01 * maxRadii;
  11734. * frustum.far = 50.0 * maxRadii;
  11735. * @param [options] - An object with the following properties:
  11736. * @param [options.left] - The left clipping plane distance.
  11737. * @param [options.right] - The right clipping plane distance.
  11738. * @param [options.top] - The top clipping plane distance.
  11739. * @param [options.bottom] - The bottom clipping plane distance.
  11740. * @param [options.near = 1.0] - The near clipping plane distance.
  11741. * @param [options.far = 500000000.0] - The far clipping plane distance.
  11742. */
  11743. export class OrthographicOffCenterFrustum {
  11744. constructor(options?: {
  11745. left?: number;
  11746. right?: number;
  11747. top?: number;
  11748. bottom?: number;
  11749. near?: number;
  11750. far?: number;
  11751. });
  11752. /**
  11753. * The left clipping plane.
  11754. */
  11755. left: number;
  11756. /**
  11757. * The right clipping plane.
  11758. */
  11759. right: number;
  11760. /**
  11761. * The top clipping plane.
  11762. */
  11763. top: number;
  11764. /**
  11765. * The bottom clipping plane.
  11766. */
  11767. bottom: number;
  11768. /**
  11769. * The distance of the near plane.
  11770. */
  11771. near: number;
  11772. /**
  11773. * The distance of the far plane.
  11774. */
  11775. far: number;
  11776. /**
  11777. * Gets the orthographic projection matrix computed from the view frustum.
  11778. */
  11779. readonly projectionMatrix: Matrix4;
  11780. /**
  11781. * Creates a culling volume for this frustum.
  11782. * @example
  11783. * // Check if a bounding volume intersects the frustum.
  11784. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  11785. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  11786. * @param position - The eye position.
  11787. * @param direction - The view direction.
  11788. * @param up - The up direction.
  11789. * @returns A culling volume at the given position and orientation.
  11790. */
  11791. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  11792. /**
  11793. * Returns the pixel's width and height in meters.
  11794. * @example
  11795. * // Example 1
  11796. * // Get the width and height of a pixel.
  11797. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
  11798. * @param drawingBufferWidth - The width of the drawing buffer.
  11799. * @param drawingBufferHeight - The height of the drawing buffer.
  11800. * @param distance - The distance to the near plane in meters.
  11801. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  11802. * @param result - The object onto which to store the result.
  11803. * @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.
  11804. */
  11805. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  11806. /**
  11807. * Returns a duplicate of a OrthographicOffCenterFrustum instance.
  11808. * @param [result] - The object onto which to store the result.
  11809. * @returns The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
  11810. */
  11811. clone(result?: OrthographicOffCenterFrustum): OrthographicOffCenterFrustum;
  11812. /**
  11813. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11814. * <code>true</code> if they are equal, <code>false</code> otherwise.
  11815. * @param [other] - The right hand side OrthographicOffCenterFrustum.
  11816. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  11817. */
  11818. equals(other?: OrthographicOffCenterFrustum): boolean;
  11819. /**
  11820. * Compares the provided OrthographicOffCenterFrustum componentwise and returns
  11821. * <code>true</code> if they pass an absolute or relative tolerance test,
  11822. * <code>false</code> otherwise.
  11823. * @param other - The right hand side OrthographicOffCenterFrustum.
  11824. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  11825. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  11826. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  11827. */
  11828. equalsEpsilon(other: OrthographicOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  11829. }
  11830. export namespace Packable {
  11831. /**
  11832. * The number of elements used to pack the object into an array.
  11833. */
  11834. var packedLength: number;
  11835. /**
  11836. * Stores the provided instance into the provided array.
  11837. * @param value - The value to pack.
  11838. * @param array - The array to pack into.
  11839. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11840. */
  11841. function pack(value: any, array: number[], startingIndex?: number): void;
  11842. /**
  11843. * Retrieves an instance from a packed array.
  11844. * @param array - The packed array.
  11845. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11846. * @param [result] - The object into which to store the result.
  11847. * @returns The modified result parameter or a new Object instance if one was not provided.
  11848. */
  11849. function unpack(array: number[], startingIndex?: number, result?: any): any;
  11850. }
  11851. /**
  11852. * Static interface for types which can store their values as packed
  11853. * elements in an array. These methods and properties are expected to be
  11854. * defined on a constructor function.
  11855. */
  11856. export interface Packable {
  11857. }
  11858. /**
  11859. * Static interface for {@link Packable} types which are interpolated in a
  11860. * different representation than their packed value. These methods and
  11861. * properties are expected to be defined on a constructor function.
  11862. */
  11863. export namespace PackableForInterpolation {
  11864. /**
  11865. * The number of elements used to store the object into an array in its interpolatable form.
  11866. */
  11867. var packedInterpolationLength: number;
  11868. /**
  11869. * Converts a packed array into a form suitable for interpolation.
  11870. * @param packedArray - The packed array.
  11871. * @param [startingIndex = 0] - The index of the first element to be converted.
  11872. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  11873. * @param [result] - The object into which to store the result.
  11874. */
  11875. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  11876. /**
  11877. * Retrieves an instance from a packed array converted with {@link PackableForInterpolation.convertPackedArrayForInterpolation}.
  11878. * @param array - The array previously packed for interpolation.
  11879. * @param sourceArray - The original packed array.
  11880. * @param [startingIndex = 0] - The startingIndex used to convert the array.
  11881. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  11882. * @param [result] - The object into which to store the result.
  11883. * @returns The modified result parameter or a new Object instance if one was not provided.
  11884. */
  11885. function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any;
  11886. }
  11887. /**
  11888. * Provides geocoding via a {@link https://pelias.io/|Pelias} server.
  11889. * @example
  11890. * // Configure a Viewer to use the Pelias server hosted by https://geocode.earth/
  11891. * const viewer = new Cesium.Viewer('cesiumContainer', {
  11892. * geocoder: new Cesium.PeliasGeocoderService(new Cesium.Resource({
  11893. * url: 'https://api.geocode.earth/v1/',
  11894. * queryParameters: {
  11895. * api_key: '<Your geocode.earth API key>'
  11896. * }
  11897. * }))
  11898. * });
  11899. * @param url - The endpoint to the Pelias server.
  11900. */
  11901. export class PeliasGeocoderService {
  11902. constructor(url: Resource | string);
  11903. /**
  11904. * The Resource used to access the Pelias endpoint.
  11905. */
  11906. readonly url: Resource;
  11907. /**
  11908. * @param query - The query to be sent to the geocoder service
  11909. * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
  11910. */
  11911. geocode(query: string, type?: GeocodeType): Promise<GeocoderService.Result[]>;
  11912. }
  11913. /**
  11914. * The viewing frustum is defined by 6 planes.
  11915. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  11916. * define the unit vector normal to the plane, and the w component is the distance of the
  11917. * plane from the origin/camera position.
  11918. * @example
  11919. * const frustum = new Cesium.PerspectiveFrustum({
  11920. * fov : Cesium.Math.PI_OVER_THREE,
  11921. * aspectRatio : canvas.clientWidth / canvas.clientHeight
  11922. * near : 1.0,
  11923. * far : 1000.0
  11924. * });
  11925. * @param [options] - An object with the following properties:
  11926. * @param [options.fov] - The angle of the field of view (FOV), in radians.
  11927. * @param [options.aspectRatio] - The aspect ratio of the frustum's width to it's height.
  11928. * @param [options.near = 1.0] - The distance of the near plane.
  11929. * @param [options.far = 500000000.0] - The distance of the far plane.
  11930. * @param [options.xOffset = 0.0] - The offset in the x direction.
  11931. * @param [options.yOffset = 0.0] - The offset in the y direction.
  11932. */
  11933. export class PerspectiveFrustum {
  11934. constructor(options?: {
  11935. fov?: number;
  11936. aspectRatio?: number;
  11937. near?: number;
  11938. far?: number;
  11939. xOffset?: number;
  11940. yOffset?: number;
  11941. });
  11942. /**
  11943. * The angle of the field of view (FOV), in radians. This angle will be used
  11944. * as the horizontal FOV if the width is greater than the height, otherwise
  11945. * it will be the vertical FOV.
  11946. */
  11947. fov: number;
  11948. /**
  11949. * The aspect ratio of the frustum's width to it's height.
  11950. */
  11951. aspectRatio: number;
  11952. /**
  11953. * The distance of the near plane.
  11954. */
  11955. near: number;
  11956. /**
  11957. * The distance of the far plane.
  11958. */
  11959. far: number;
  11960. /**
  11961. * Offsets the frustum in the x direction.
  11962. */
  11963. xOffset: number;
  11964. /**
  11965. * Offsets the frustum in the y direction.
  11966. */
  11967. yOffset: number;
  11968. /**
  11969. * The number of elements used to pack the object into an array.
  11970. */
  11971. static packedLength: number;
  11972. /**
  11973. * Stores the provided instance into the provided array.
  11974. * @param value - The value to pack.
  11975. * @param array - The array to pack into.
  11976. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  11977. * @returns The array that was packed into
  11978. */
  11979. static pack(value: PerspectiveFrustum, array: number[], startingIndex?: number): number[];
  11980. /**
  11981. * Retrieves an instance from a packed array.
  11982. * @param array - The packed array.
  11983. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  11984. * @param [result] - The object into which to store the result.
  11985. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  11986. */
  11987. static unpack(array: number[], startingIndex?: number, result?: PerspectiveFrustum): PerspectiveFrustum;
  11988. /**
  11989. * Gets the perspective projection matrix computed from the view frustum.
  11990. */
  11991. readonly projectionMatrix: Matrix4;
  11992. /**
  11993. * The perspective projection matrix computed from the view frustum with an infinite far plane.
  11994. */
  11995. readonly infiniteProjectionMatrix: Matrix4;
  11996. /**
  11997. * Gets the angle of the vertical field of view, in radians.
  11998. */
  11999. readonly fovy: number;
  12000. /**
  12001. * Creates a culling volume for this frustum.
  12002. * @example
  12003. * // Check if a bounding volume intersects the frustum.
  12004. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  12005. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  12006. * @param position - The eye position.
  12007. * @param direction - The view direction.
  12008. * @param up - The up direction.
  12009. * @returns A culling volume at the given position and orientation.
  12010. */
  12011. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  12012. /**
  12013. * Returns the pixel's width and height in meters.
  12014. * @example
  12015. * // Example 1
  12016. * // Get the width and height of a pixel.
  12017. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  12018. * @example
  12019. * // Example 2
  12020. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  12021. * // For example, get the size of a pixel of an image on a billboard.
  12022. * const position = camera.position;
  12023. * const direction = camera.direction;
  12024. * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  12025. * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  12026. * const distance = Cesium.Cartesian3.magnitude(toCenterProj);
  12027. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  12028. * @param drawingBufferWidth - The width of the drawing buffer.
  12029. * @param drawingBufferHeight - The height of the drawing buffer.
  12030. * @param distance - The distance to the near plane in meters.
  12031. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  12032. * @param result - The object onto which to store the result.
  12033. * @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.
  12034. */
  12035. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  12036. /**
  12037. * Returns a duplicate of a PerspectiveFrustum instance.
  12038. * @param [result] - The object onto which to store the result.
  12039. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  12040. */
  12041. clone(result?: PerspectiveFrustum): PerspectiveFrustum;
  12042. /**
  12043. * Compares the provided PerspectiveFrustum componentwise and returns
  12044. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12045. * @param [other] - The right hand side PerspectiveFrustum.
  12046. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  12047. */
  12048. equals(other?: PerspectiveFrustum): boolean;
  12049. /**
  12050. * Compares the provided PerspectiveFrustum componentwise and returns
  12051. * <code>true</code> if they pass an absolute or relative tolerance test,
  12052. * <code>false</code> otherwise.
  12053. * @param other - The right hand side PerspectiveFrustum.
  12054. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  12055. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  12056. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  12057. */
  12058. equalsEpsilon(other: PerspectiveFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  12059. }
  12060. /**
  12061. * The viewing frustum is defined by 6 planes.
  12062. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  12063. * define the unit vector normal to the plane, and the w component is the distance of the
  12064. * plane from the origin/camera position.
  12065. * @example
  12066. * const frustum = new Cesium.PerspectiveOffCenterFrustum({
  12067. * left : -1.0,
  12068. * right : 1.0,
  12069. * top : 1.0,
  12070. * bottom : -1.0,
  12071. * near : 1.0,
  12072. * far : 100.0
  12073. * });
  12074. * @param [options] - An object with the following properties:
  12075. * @param [options.left] - The left clipping plane distance.
  12076. * @param [options.right] - The right clipping plane distance.
  12077. * @param [options.top] - The top clipping plane distance.
  12078. * @param [options.bottom] - The bottom clipping plane distance.
  12079. * @param [options.near = 1.0] - The near clipping plane distance.
  12080. * @param [options.far = 500000000.0] - The far clipping plane distance.
  12081. */
  12082. export class PerspectiveOffCenterFrustum {
  12083. constructor(options?: {
  12084. left?: number;
  12085. right?: number;
  12086. top?: number;
  12087. bottom?: number;
  12088. near?: number;
  12089. far?: number;
  12090. });
  12091. /**
  12092. * Defines the left clipping plane.
  12093. */
  12094. left: number;
  12095. /**
  12096. * Defines the right clipping plane.
  12097. */
  12098. right: number;
  12099. /**
  12100. * Defines the top clipping plane.
  12101. */
  12102. top: number;
  12103. /**
  12104. * Defines the bottom clipping plane.
  12105. */
  12106. bottom: number;
  12107. /**
  12108. * The distance of the near plane.
  12109. */
  12110. near: number;
  12111. /**
  12112. * The distance of the far plane.
  12113. */
  12114. far: number;
  12115. /**
  12116. * Gets the perspective projection matrix computed from the view frustum.
  12117. */
  12118. readonly projectionMatrix: Matrix4;
  12119. /**
  12120. * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
  12121. */
  12122. readonly infiniteProjectionMatrix: Matrix4;
  12123. /**
  12124. * Creates a culling volume for this frustum.
  12125. * @example
  12126. * // Check if a bounding volume intersects the frustum.
  12127. * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
  12128. * const intersect = cullingVolume.computeVisibility(boundingVolume);
  12129. * @param position - The eye position.
  12130. * @param direction - The view direction.
  12131. * @param up - The up direction.
  12132. * @returns A culling volume at the given position and orientation.
  12133. */
  12134. computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume;
  12135. /**
  12136. * Returns the pixel's width and height in meters.
  12137. * @example
  12138. * // Example 1
  12139. * // Get the width and height of a pixel.
  12140. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
  12141. * @example
  12142. * // Example 2
  12143. * // Get the width and height of a pixel if the near plane was set to 'distance'.
  12144. * // For example, get the size of a pixel of an image on a billboard.
  12145. * const position = camera.position;
  12146. * const direction = camera.direction;
  12147. * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
  12148. * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
  12149. * const distance = Cesium.Cartesian3.magnitude(toCenterProj);
  12150. * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
  12151. * @param drawingBufferWidth - The width of the drawing buffer.
  12152. * @param drawingBufferHeight - The height of the drawing buffer.
  12153. * @param distance - The distance to the near plane in meters.
  12154. * @param pixelRatio - The scaling factor from pixel space to coordinate space.
  12155. * @param result - The object onto which to store the result.
  12156. * @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.
  12157. */
  12158. getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, pixelRatio: number, result: Cartesian2): Cartesian2;
  12159. /**
  12160. * Returns a duplicate of a PerspectiveOffCenterFrustum instance.
  12161. * @param [result] - The object onto which to store the result.
  12162. * @returns The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
  12163. */
  12164. clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum;
  12165. /**
  12166. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  12167. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12168. * @param [other] - The right hand side PerspectiveOffCenterFrustum.
  12169. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  12170. */
  12171. equals(other?: PerspectiveOffCenterFrustum): boolean;
  12172. /**
  12173. * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
  12174. * <code>true</code> if they pass an absolute or relative tolerance test,
  12175. * <code>false</code> otherwise.
  12176. * @param other - The right hand side PerspectiveOffCenterFrustum.
  12177. * @param relativeEpsilon - The relative epsilon tolerance to use for equality testing.
  12178. * @param [absoluteEpsilon = relativeEpsilon] - The absolute epsilon tolerance to use for equality testing.
  12179. * @returns <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
  12180. */
  12181. equalsEpsilon(other: PerspectiveOffCenterFrustum, relativeEpsilon: number, absoluteEpsilon?: number): boolean;
  12182. }
  12183. /**
  12184. * A utility class for generating custom map pins as canvas elements.
  12185. * <br /><br />
  12186. * <div align='center'>
  12187. * <img src='Images/PinBuilder.png' width='500'/><br />
  12188. * Example pins generated using both the maki icon set, which ships with Cesium, and single character text.
  12189. * </div>
  12190. */
  12191. export class PinBuilder {
  12192. constructor();
  12193. /**
  12194. * Creates an empty pin of the specified color and size.
  12195. * @param color - The color of the pin.
  12196. * @param size - The size of the pin, in pixels.
  12197. * @returns The canvas element that represents the generated pin.
  12198. */
  12199. fromColor(color: Color, size: number): HTMLCanvasElement;
  12200. /**
  12201. * Creates a pin with the specified icon, color, and size.
  12202. * @param url - The url of the image to be stamped onto the pin.
  12203. * @param color - The color of the pin.
  12204. * @param size - The size of the pin, in pixels.
  12205. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  12206. */
  12207. fromUrl(url: Resource | string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  12208. /**
  12209. * Creates a pin with the specified {@link https://www.mapbox.com/maki/|maki} icon identifier, color, and size.
  12210. * @param id - The id of the maki icon to be stamped onto the pin.
  12211. * @param color - The color of the pin.
  12212. * @param size - The size of the pin, in pixels.
  12213. * @returns The canvas element or a Promise to the canvas element that represents the generated pin.
  12214. */
  12215. fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise<HTMLCanvasElement>;
  12216. /**
  12217. * Creates a pin with the specified text, color, and size. The text will be sized to be as large as possible
  12218. * while still being contained completely within the pin.
  12219. * @param text - The text to be stamped onto the pin.
  12220. * @param color - The color of the pin.
  12221. * @param size - The size of the pin, in pixels.
  12222. * @returns The canvas element that represents the generated pin.
  12223. */
  12224. fromText(text: string, color: Color, size: number): HTMLCanvasElement;
  12225. }
  12226. /**
  12227. * The format of a pixel, i.e., the number of components it has and what they represent.
  12228. */
  12229. export enum PixelFormat {
  12230. /**
  12231. * A pixel format containing a depth value.
  12232. */
  12233. DEPTH_COMPONENT = WebGLConstants.DEPTH_COMPONENT,
  12234. /**
  12235. * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
  12236. */
  12237. DEPTH_STENCIL = WebGLConstants.DEPTH_STENCIL,
  12238. /**
  12239. * A pixel format containing an alpha channel.
  12240. */
  12241. ALPHA = WebGLConstants.ALPHA,
  12242. /**
  12243. * A pixel format containing red, green, and blue channels.
  12244. */
  12245. RGB = WebGLConstants.RGB,
  12246. /**
  12247. * A pixel format containing red, green, blue, and alpha channels.
  12248. */
  12249. RGBA = WebGLConstants.RGBA,
  12250. /**
  12251. * A pixel format containing a luminance (intensity) channel.
  12252. */
  12253. LUMINANCE = WebGLConstants.LUMINANCE,
  12254. /**
  12255. * A pixel format containing luminance (intensity) and alpha channels.
  12256. */
  12257. LUMINANCE_ALPHA = WebGLConstants.LUMINANCE_ALPHA,
  12258. /**
  12259. * A pixel format containing red, green, and blue channels that is DXT1 compressed.
  12260. */
  12261. RGB_DXT1 = WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
  12262. /**
  12263. * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
  12264. */
  12265. RGBA_DXT1 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
  12266. /**
  12267. * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
  12268. */
  12269. RGBA_DXT3 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
  12270. /**
  12271. * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
  12272. */
  12273. RGBA_DXT5 = WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
  12274. /**
  12275. * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
  12276. */
  12277. RGB_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
  12278. /**
  12279. * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
  12280. */
  12281. RGB_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
  12282. /**
  12283. * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
  12284. */
  12285. RGBA_PVRTC_4BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
  12286. /**
  12287. * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
  12288. */
  12289. RGBA_PVRTC_2BPPV1 = WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
  12290. /**
  12291. * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.
  12292. */
  12293. RGBA_ASTC = WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,
  12294. /**
  12295. * A pixel format containing red, green, and blue channels that is ETC1 compressed.
  12296. */
  12297. RGB_ETC1 = WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,
  12298. /**
  12299. * A pixel format containing red, green, and blue channels that is ETC2 compressed.
  12300. */
  12301. RGB8_ETC2 = WebGLConstants.COMPRESSED_RGB8_ETC2,
  12302. /**
  12303. * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.
  12304. */
  12305. RGBA8_ETC2_EAC = WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,
  12306. /**
  12307. * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.
  12308. */
  12309. RGBA_BC7 = WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM
  12310. }
  12311. /**
  12312. * A plane in Hessian Normal Form defined by
  12313. * <pre>
  12314. * ax + by + cz + d = 0
  12315. * </pre>
  12316. * where (a, b, c) is the plane's <code>normal</code>, d is the signed
  12317. * <code>distance</code> to the plane, and (x, y, z) is any point on
  12318. * the plane.
  12319. * @example
  12320. * // The plane x=0
  12321. * const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
  12322. * @param normal - The plane's normal (normalized).
  12323. * @param distance - The shortest distance from the origin to the plane. The sign of
  12324. * <code>distance</code> determines which side of the plane the origin
  12325. * is on. If <code>distance</code> is positive, the origin is in the half-space
  12326. * in the direction of the normal; if negative, the origin is in the half-space
  12327. * opposite to the normal; if zero, the plane passes through the origin.
  12328. */
  12329. export class Plane {
  12330. constructor(normal: Cartesian3, distance: number);
  12331. /**
  12332. * The plane's normal.
  12333. */
  12334. normal: Cartesian3;
  12335. /**
  12336. * The shortest distance from the origin to the plane. The sign of
  12337. * <code>distance</code> determines which side of the plane the origin
  12338. * is on. If <code>distance</code> is positive, the origin is in the half-space
  12339. * in the direction of the normal; if negative, the origin is in the half-space
  12340. * opposite to the normal; if zero, the plane passes through the origin.
  12341. */
  12342. distance: number;
  12343. /**
  12344. * Creates a plane from a normal and a point on the plane.
  12345. * @example
  12346. * const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  12347. * const normal = ellipsoid.geodeticSurfaceNormal(point);
  12348. * const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
  12349. * @param point - The point on the plane.
  12350. * @param normal - The plane's normal (normalized).
  12351. * @param [result] - The object onto which to store the result.
  12352. * @returns A new plane instance or the modified result parameter.
  12353. */
  12354. static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane;
  12355. /**
  12356. * Creates a plane from the general equation
  12357. * @param coefficients - The plane's normal (normalized).
  12358. * @param [result] - The object onto which to store the result.
  12359. * @returns A new plane instance or the modified result parameter.
  12360. */
  12361. static fromCartesian4(coefficients: Cartesian4, result?: Plane): Plane;
  12362. /**
  12363. * Computes the signed shortest distance of a point to a plane.
  12364. * The sign of the distance determines which side of the plane the point
  12365. * is on. If the distance is positive, the point is in the half-space
  12366. * in the direction of the normal; if negative, the point is in the half-space
  12367. * opposite to the normal; if zero, the plane passes through the point.
  12368. * @param plane - The plane.
  12369. * @param point - The point.
  12370. * @returns The signed shortest distance of the point to the plane.
  12371. */
  12372. static getPointDistance(plane: Plane, point: Cartesian3): number;
  12373. /**
  12374. * Projects a point onto the plane.
  12375. * @param plane - The plane to project the point onto
  12376. * @param point - The point to project onto the plane
  12377. * @param [result] - The result point. If undefined, a new Cartesian3 will be created.
  12378. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided.
  12379. */
  12380. static projectPointOntoPlane(plane: Plane, point: Cartesian3, result?: Cartesian3): Cartesian3;
  12381. /**
  12382. * Transforms the plane by the given transformation matrix.
  12383. * @param plane - The plane.
  12384. * @param transform - The transformation matrix.
  12385. * @param [result] - The object into which to store the result.
  12386. * @returns The plane transformed by the given transformation matrix.
  12387. */
  12388. static transform(plane: Plane, transform: Matrix4, result?: Plane): Plane;
  12389. /**
  12390. * Duplicates a Plane instance.
  12391. * @param plane - The plane to duplicate.
  12392. * @param [result] - The object onto which to store the result.
  12393. * @returns The modified result parameter or a new Plane instance if one was not provided.
  12394. */
  12395. static clone(plane: Plane, result?: Plane): Plane;
  12396. /**
  12397. * Compares the provided Planes by normal and distance and returns
  12398. * <code>true</code> if they are equal, <code>false</code> otherwise.
  12399. * @param left - The first plane.
  12400. * @param right - The second plane.
  12401. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  12402. */
  12403. static equals(left: Plane, right: Plane): boolean;
  12404. /**
  12405. * A constant initialized to the XY plane passing through the origin, with normal in positive Z.
  12406. */
  12407. static readonly ORIGIN_XY_PLANE: Plane;
  12408. /**
  12409. * A constant initialized to the YZ plane passing through the origin, with normal in positive X.
  12410. */
  12411. static readonly ORIGIN_YZ_PLANE: Plane;
  12412. /**
  12413. * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
  12414. */
  12415. static readonly ORIGIN_ZX_PLANE: Plane;
  12416. }
  12417. /**
  12418. * Describes geometry representing a plane centered at the origin, with a unit width and length.
  12419. * @example
  12420. * const planeGeometry = new Cesium.PlaneGeometry({
  12421. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  12422. * });
  12423. * @param [options] - Object with the following properties:
  12424. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12425. */
  12426. export class PlaneGeometry {
  12427. constructor(options?: {
  12428. vertexFormat?: VertexFormat;
  12429. });
  12430. /**
  12431. * The number of elements used to pack the object into an array.
  12432. */
  12433. static 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: PlaneGeometry, 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 PlaneGeometry instance if one was not provided.
  12448. */
  12449. static unpack(array: number[], startingIndex?: number, result?: PlaneGeometry): PlaneGeometry;
  12450. /**
  12451. * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
  12452. * @param planeGeometry - A description of the plane.
  12453. * @returns The computed vertices and indices.
  12454. */
  12455. static createGeometry(planeGeometry: PlaneGeometry): Geometry | undefined;
  12456. }
  12457. /**
  12458. * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
  12459. */
  12460. export class PlaneOutlineGeometry {
  12461. constructor();
  12462. /**
  12463. * The number of elements used to pack the object into an array.
  12464. */
  12465. static packedLength: number;
  12466. /**
  12467. * Stores the provided instance into the provided array.
  12468. * @param value - The value to pack.
  12469. * @param array - The array to pack into.
  12470. * @returns The array that was packed into
  12471. */
  12472. static pack(value: PlaneOutlineGeometry, array: number[]): number[];
  12473. /**
  12474. * Retrieves an instance from a packed array.
  12475. * @param array - The packed array.
  12476. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12477. * @param [result] - The object into which to store the result.
  12478. * @returns The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
  12479. */
  12480. static unpack(array: number[], startingIndex?: number, result?: PlaneOutlineGeometry): PlaneOutlineGeometry;
  12481. /**
  12482. * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
  12483. * @returns The computed vertices and indices.
  12484. */
  12485. static createGeometry(): Geometry | undefined;
  12486. }
  12487. /**
  12488. * 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}.
  12489. * @example
  12490. * // 1. create a polygon from points
  12491. * const polygon = new Cesium.PolygonGeometry({
  12492. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12493. * Cesium.Cartesian3.fromDegreesArray([
  12494. * -72.0, 40.0,
  12495. * -70.0, 35.0,
  12496. * -75.0, 30.0,
  12497. * -70.0, 30.0,
  12498. * -68.0, 40.0
  12499. * ])
  12500. * )
  12501. * });
  12502. * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12503. *
  12504. * // 2. create a nested polygon with holes
  12505. * const polygonWithHole = new Cesium.PolygonGeometry({
  12506. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12507. * Cesium.Cartesian3.fromDegreesArray([
  12508. * -109.0, 30.0,
  12509. * -95.0, 30.0,
  12510. * -95.0, 40.0,
  12511. * -109.0, 40.0
  12512. * ]),
  12513. * [new Cesium.PolygonHierarchy(
  12514. * Cesium.Cartesian3.fromDegreesArray([
  12515. * -107.0, 31.0,
  12516. * -107.0, 39.0,
  12517. * -97.0, 39.0,
  12518. * -97.0, 31.0
  12519. * ]),
  12520. * [new Cesium.PolygonHierarchy(
  12521. * Cesium.Cartesian3.fromDegreesArray([
  12522. * -105.0, 33.0,
  12523. * -99.0, 33.0,
  12524. * -99.0, 37.0,
  12525. * -105.0, 37.0
  12526. * ]),
  12527. * [new Cesium.PolygonHierarchy(
  12528. * Cesium.Cartesian3.fromDegreesArray([
  12529. * -103.0, 34.0,
  12530. * -101.0, 34.0,
  12531. * -101.0, 36.0,
  12532. * -103.0, 36.0
  12533. * ])
  12534. * )]
  12535. * )]
  12536. * )]
  12537. * )
  12538. * });
  12539. * const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
  12540. *
  12541. * // 3. create extruded polygon
  12542. * const extrudedPolygon = new Cesium.PolygonGeometry({
  12543. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12544. * Cesium.Cartesian3.fromDegreesArray([
  12545. * -72.0, 40.0,
  12546. * -70.0, 35.0,
  12547. * -75.0, 30.0,
  12548. * -70.0, 30.0,
  12549. * -68.0, 40.0
  12550. * ])
  12551. * ),
  12552. * extrudedHeight: 300000
  12553. * });
  12554. * const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
  12555. * @param options - Object with the following properties:
  12556. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12557. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12558. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12559. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12560. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12561. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12562. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12563. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12564. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12565. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12566. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12567. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  12568. */
  12569. export class PolygonGeometry {
  12570. constructor(options: {
  12571. polygonHierarchy: PolygonHierarchy;
  12572. height?: number;
  12573. extrudedHeight?: number;
  12574. vertexFormat?: VertexFormat;
  12575. stRotation?: number;
  12576. ellipsoid?: Ellipsoid;
  12577. granularity?: number;
  12578. perPositionHeight?: boolean;
  12579. closeTop?: boolean;
  12580. closeBottom?: boolean;
  12581. arcType?: ArcType;
  12582. textureCoordinates?: PolygonHierarchy;
  12583. });
  12584. /**
  12585. * The number of elements used to pack the object into an array.
  12586. */
  12587. packedLength: number;
  12588. /**
  12589. * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
  12590. * @example
  12591. * // create a polygon from points
  12592. * const polygon = Cesium.PolygonGeometry.fromPositions({
  12593. * positions : Cesium.Cartesian3.fromDegreesArray([
  12594. * -72.0, 40.0,
  12595. * -70.0, 35.0,
  12596. * -75.0, 30.0,
  12597. * -70.0, 30.0,
  12598. * -68.0, 40.0
  12599. * ])
  12600. * });
  12601. * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
  12602. * @param options - Object with the following properties:
  12603. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12604. * @param [options.height = 0.0] - The height of the polygon.
  12605. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12606. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12607. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  12608. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12609. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12610. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12611. * @param [options.closeTop = true] - When false, leaves off the top of an extruded polygon open.
  12612. * @param [options.closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  12613. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12614. * @param [options.textureCoordinates] - Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  12615. */
  12616. static fromPositions(options: {
  12617. positions: Cartesian3[];
  12618. height?: number;
  12619. extrudedHeight?: number;
  12620. vertexFormat?: VertexFormat;
  12621. stRotation?: number;
  12622. ellipsoid?: Ellipsoid;
  12623. granularity?: number;
  12624. perPositionHeight?: boolean;
  12625. closeTop?: boolean;
  12626. closeBottom?: boolean;
  12627. arcType?: ArcType;
  12628. textureCoordinates?: PolygonHierarchy;
  12629. }): PolygonGeometry;
  12630. /**
  12631. * Stores the provided instance into the provided array.
  12632. * @param value - The value to pack.
  12633. * @param array - The array to pack into.
  12634. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12635. * @returns The array that was packed into
  12636. */
  12637. static pack(value: PolygonGeometry, array: number[], startingIndex?: number): number[];
  12638. /**
  12639. * Retrieves an instance from a packed array.
  12640. * @param array - The packed array.
  12641. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12642. * @param [result] - The object into which to store the result.
  12643. */
  12644. static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): void;
  12645. /**
  12646. * Returns the bounding rectangle given the provided options
  12647. * @param options - Object with the following properties:
  12648. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12649. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
  12650. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12651. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12652. * @param [result] - An object in which to store the result.
  12653. * @returns The result rectangle
  12654. */
  12655. static computeRectangle(options: {
  12656. polygonHierarchy: PolygonHierarchy;
  12657. granularity?: number;
  12658. arcType?: ArcType;
  12659. ellipsoid?: Ellipsoid;
  12660. }, result?: Rectangle): Rectangle;
  12661. /**
  12662. * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
  12663. * @param polygonGeometry - A description of the polygon.
  12664. * @returns The computed vertices and indices.
  12665. */
  12666. static createGeometry(polygonGeometry: PolygonGeometry): Geometry | undefined;
  12667. }
  12668. /**
  12669. * An hierarchy of linear rings which define a polygon and its holes.
  12670. * The holes themselves may also have holes which nest inner polygons.
  12671. * @param [positions] - A linear ring defining the outer boundary of the polygon or hole.
  12672. * @param [holes] - An array of polygon hierarchies defining holes in the polygon.
  12673. */
  12674. export class PolygonHierarchy {
  12675. constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]);
  12676. /**
  12677. * A linear ring defining the outer boundary of the polygon or hole.
  12678. */
  12679. positions: Cartesian3[];
  12680. /**
  12681. * An array of polygon hierarchies defining holes in the polygon.
  12682. */
  12683. holes: PolygonHierarchy[];
  12684. }
  12685. /**
  12686. * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
  12687. * @example
  12688. * // 1. create a polygon outline from points
  12689. * const polygon = new Cesium.PolygonOutlineGeometry({
  12690. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12691. * Cesium.Cartesian3.fromDegreesArray([
  12692. * -72.0, 40.0,
  12693. * -70.0, 35.0,
  12694. * -75.0, 30.0,
  12695. * -70.0, 30.0,
  12696. * -68.0, 40.0
  12697. * ])
  12698. * )
  12699. * });
  12700. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12701. *
  12702. * // 2. create a nested polygon with holes outline
  12703. * const polygonWithHole = new Cesium.PolygonOutlineGeometry({
  12704. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12705. * Cesium.Cartesian3.fromDegreesArray([
  12706. * -109.0, 30.0,
  12707. * -95.0, 30.0,
  12708. * -95.0, 40.0,
  12709. * -109.0, 40.0
  12710. * ]),
  12711. * [new Cesium.PolygonHierarchy(
  12712. * Cesium.Cartesian3.fromDegreesArray([
  12713. * -107.0, 31.0,
  12714. * -107.0, 39.0,
  12715. * -97.0, 39.0,
  12716. * -97.0, 31.0
  12717. * ]),
  12718. * [new Cesium.PolygonHierarchy(
  12719. * Cesium.Cartesian3.fromDegreesArray([
  12720. * -105.0, 33.0,
  12721. * -99.0, 33.0,
  12722. * -99.0, 37.0,
  12723. * -105.0, 37.0
  12724. * ]),
  12725. * [new Cesium.PolygonHierarchy(
  12726. * Cesium.Cartesian3.fromDegreesArray([
  12727. * -103.0, 34.0,
  12728. * -101.0, 34.0,
  12729. * -101.0, 36.0,
  12730. * -103.0, 36.0
  12731. * ])
  12732. * )]
  12733. * )]
  12734. * )]
  12735. * )
  12736. * });
  12737. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);
  12738. *
  12739. * // 3. create extruded polygon outline
  12740. * const extrudedPolygon = new Cesium.PolygonOutlineGeometry({
  12741. * polygonHierarchy : new Cesium.PolygonHierarchy(
  12742. * Cesium.Cartesian3.fromDegreesArray([
  12743. * -72.0, 40.0,
  12744. * -70.0, 35.0,
  12745. * -75.0, 30.0,
  12746. * -70.0, 30.0,
  12747. * -68.0, 40.0
  12748. * ])
  12749. * ),
  12750. * extrudedHeight: 300000
  12751. * });
  12752. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
  12753. * @param options - Object with the following properties:
  12754. * @param options.polygonHierarchy - A polygon hierarchy that can include holes.
  12755. * @param [options.height = 0.0] - The distance in meters between the polygon and the ellipsoid surface.
  12756. * @param [options.extrudedHeight] - The distance in meters between the polygon's extruded face and the ellipsoid surface.
  12757. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12758. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12759. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12760. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12761. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
  12762. */
  12763. export class PolygonOutlineGeometry {
  12764. constructor(options: {
  12765. polygonHierarchy: PolygonHierarchy;
  12766. height?: number;
  12767. extrudedHeight?: number;
  12768. vertexFormat?: VertexFormat;
  12769. ellipsoid?: Ellipsoid;
  12770. granularity?: number;
  12771. perPositionHeight?: boolean;
  12772. arcType?: ArcType;
  12773. });
  12774. /**
  12775. * The number of elements used to pack the object into an array.
  12776. */
  12777. packedLength: number;
  12778. /**
  12779. * Stores the provided instance into the provided array.
  12780. * @param value - The value to pack.
  12781. * @param array - The array to pack into.
  12782. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12783. * @returns The array that was packed into
  12784. */
  12785. static pack(value: PolygonOutlineGeometry, array: number[], startingIndex?: number): number[];
  12786. /**
  12787. * Retrieves an instance from a packed array.
  12788. * @param array - The packed array.
  12789. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12790. * @param [result] - The object into which to store the result.
  12791. * @returns The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
  12792. */
  12793. static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry;
  12794. /**
  12795. * A description of a polygon outline from an array of positions.
  12796. * @example
  12797. * // create a polygon from points
  12798. * const polygon = Cesium.PolygonOutlineGeometry.fromPositions({
  12799. * positions : Cesium.Cartesian3.fromDegreesArray([
  12800. * -72.0, 40.0,
  12801. * -70.0, 35.0,
  12802. * -75.0, 30.0,
  12803. * -70.0, 30.0,
  12804. * -68.0, 40.0
  12805. * ])
  12806. * });
  12807. * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
  12808. * @param options - Object with the following properties:
  12809. * @param options.positions - An array of positions that defined the corner points of the polygon.
  12810. * @param [options.height = 0.0] - The height of the polygon.
  12811. * @param [options.extrudedHeight] - The height of the polygon extrusion.
  12812. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12813. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12814. * @param [options.perPositionHeight = false] - Use the height of options.positions for each position instead of using options.height to determine the height.
  12815. * @param [options.arcType = ArcType.GEODESIC] - The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
  12816. */
  12817. static fromPositions(options: {
  12818. positions: Cartesian3[];
  12819. height?: number;
  12820. extrudedHeight?: number;
  12821. ellipsoid?: Ellipsoid;
  12822. granularity?: number;
  12823. perPositionHeight?: boolean;
  12824. arcType?: ArcType;
  12825. }): PolygonOutlineGeometry;
  12826. /**
  12827. * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
  12828. * @param polygonGeometry - A description of the polygon outline.
  12829. * @returns The computed vertices and indices.
  12830. */
  12831. static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry | undefined;
  12832. }
  12833. /**
  12834. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  12835. * and each additional position defines a line segment from the previous position. The polyline is capable of
  12836. * displaying with a material.
  12837. * @example
  12838. * // A polyline with two connected line segments
  12839. * const polyline = new Cesium.PolylineGeometry({
  12840. * positions : Cesium.Cartesian3.fromDegreesArray([
  12841. * 0.0, 0.0,
  12842. * 5.0, 0.0,
  12843. * 5.0, 5.0
  12844. * ]),
  12845. * width : 10.0
  12846. * });
  12847. * const geometry = Cesium.PolylineGeometry.createGeometry(polyline);
  12848. * @param options - Object with the following properties:
  12849. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  12850. * @param [options.width = 1.0] - The width in pixels.
  12851. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  12852. * @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.
  12853. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  12854. * @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.
  12855. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12856. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12857. */
  12858. export class PolylineGeometry {
  12859. constructor(options: {
  12860. positions: Cartesian3[];
  12861. width?: number;
  12862. colors?: Color[];
  12863. colorsPerVertex?: boolean;
  12864. arcType?: ArcType;
  12865. granularity?: number;
  12866. vertexFormat?: VertexFormat;
  12867. ellipsoid?: Ellipsoid;
  12868. });
  12869. /**
  12870. * The number of elements used to pack the object into an array.
  12871. */
  12872. packedLength: number;
  12873. /**
  12874. * Stores the provided instance into the provided array.
  12875. * @param value - The value to pack.
  12876. * @param array - The array to pack into.
  12877. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12878. * @returns The array that was packed into
  12879. */
  12880. static pack(value: PolylineGeometry, array: number[], startingIndex?: number): number[];
  12881. /**
  12882. * Retrieves an instance from a packed array.
  12883. * @param array - The packed array.
  12884. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12885. * @param [result] - The object into which to store the result.
  12886. * @returns The modified result parameter or a new PolylineGeometry instance if one was not provided.
  12887. */
  12888. static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry;
  12889. /**
  12890. * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
  12891. * @param polylineGeometry - A description of the polyline.
  12892. * @returns The computed vertices and indices.
  12893. */
  12894. static createGeometry(polylineGeometry: PolylineGeometry): Geometry | undefined;
  12895. }
  12896. /**
  12897. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12898. * @example
  12899. * function computeCircle(radius) {
  12900. * const positions = [];
  12901. * for (let i = 0; i < 360; i++) {
  12902. * const radians = Cesium.Math.toRadians(i);
  12903. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12904. * }
  12905. * return positions;
  12906. * }
  12907. *
  12908. * const volume = new Cesium.PolylineVolumeGeometry({
  12909. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
  12910. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12911. * -72.0, 40.0,
  12912. * -70.0, 35.0
  12913. * ]),
  12914. * shapePositions : computeCircle(100000.0)
  12915. * });
  12916. * @param options - Object with the following properties:
  12917. * @param options.polylinePositions - An array of {@link Cartesian3} positions that define the center of the polyline volume.
  12918. * @param options.shapePositions - An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
  12919. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12920. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12921. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  12922. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12923. */
  12924. export class PolylineVolumeGeometry {
  12925. constructor(options: {
  12926. polylinePositions: Cartesian3[];
  12927. shapePositions: Cartesian2[];
  12928. ellipsoid?: Ellipsoid;
  12929. granularity?: number;
  12930. vertexFormat?: VertexFormat;
  12931. cornerType?: CornerType;
  12932. });
  12933. /**
  12934. * The number of elements used to pack the object into an array.
  12935. */
  12936. packedLength: number;
  12937. /**
  12938. * Stores the provided instance into the provided array.
  12939. * @param value - The value to pack.
  12940. * @param array - The array to pack into.
  12941. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  12942. * @returns The array that was packed into
  12943. */
  12944. static pack(value: PolylineVolumeGeometry, array: number[], startingIndex?: number): number[];
  12945. /**
  12946. * Retrieves an instance from a packed array.
  12947. * @param array - The packed array.
  12948. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  12949. * @param [result] - The object into which to store the result.
  12950. * @returns The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
  12951. */
  12952. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry;
  12953. /**
  12954. * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  12955. * @param polylineVolumeGeometry - A description of the polyline volume.
  12956. * @returns The computed vertices and indices.
  12957. */
  12958. static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry | undefined;
  12959. }
  12960. /**
  12961. * A description of a polyline with a volume (a 2D shape extruded along a polyline).
  12962. * @example
  12963. * function computeCircle(radius) {
  12964. * const positions = [];
  12965. * for (let i = 0; i < 360; i++) {
  12966. * const radians = Cesium.Math.toRadians(i);
  12967. * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
  12968. * }
  12969. * return positions;
  12970. * }
  12971. *
  12972. * const volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
  12973. * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
  12974. * -72.0, 40.0,
  12975. * -70.0, 35.0
  12976. * ]),
  12977. * shapePositions : computeCircle(100000.0)
  12978. * });
  12979. * @param options - Object with the following properties:
  12980. * @param options.polylinePositions - An array of positions that define the center of the polyline volume.
  12981. * @param options.shapePositions - An array of positions that define the shape to be extruded along the polyline
  12982. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  12983. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  12984. * @param [options.cornerType = CornerType.ROUNDED] - Determines the style of the corners.
  12985. */
  12986. export class PolylineVolumeOutlineGeometry {
  12987. constructor(options: {
  12988. polylinePositions: Cartesian3[];
  12989. shapePositions: Cartesian2[];
  12990. ellipsoid?: Ellipsoid;
  12991. granularity?: number;
  12992. cornerType?: CornerType;
  12993. });
  12994. /**
  12995. * The number of elements used to pack the object into an array.
  12996. */
  12997. packedLength: number;
  12998. /**
  12999. * Stores the provided instance into the provided array.
  13000. * @param value - The value to pack.
  13001. * @param array - The array to pack into.
  13002. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13003. * @returns The array that was packed into
  13004. */
  13005. static pack(value: PolylineVolumeOutlineGeometry, array: number[], startingIndex?: number): number[];
  13006. /**
  13007. * Retrieves an instance from a packed array.
  13008. * @param array - The packed array.
  13009. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13010. * @param [result] - The object into which to store the result.
  13011. * @returns The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.
  13012. */
  13013. static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry;
  13014. /**
  13015. * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
  13016. * @param polylineVolumeOutlineGeometry - A description of the polyline volume outline.
  13017. * @returns The computed vertices and indices.
  13018. */
  13019. static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry | undefined;
  13020. }
  13021. /**
  13022. * The type of a geometric primitive, i.e., points, lines, and triangles.
  13023. */
  13024. export enum PrimitiveType {
  13025. /**
  13026. * Points primitive where each vertex (or index) is a separate point.
  13027. */
  13028. POINTS = WebGLConstants.POINTS,
  13029. /**
  13030. * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
  13031. */
  13032. LINES = WebGLConstants.LINES,
  13033. /**
  13034. * Line loop primitive where each vertex (or index) after the first connects a line to
  13035. * the previous vertex, and the last vertex implicitly connects to the first.
  13036. */
  13037. LINE_LOOP = WebGLConstants.LINE_LOOP,
  13038. /**
  13039. * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
  13040. */
  13041. LINE_STRIP = WebGLConstants.LINE_STRIP,
  13042. /**
  13043. * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
  13044. */
  13045. TRIANGLES = WebGLConstants.TRIANGLES,
  13046. /**
  13047. * Triangle strip primitive where each vertex (or index) after the first two connect to
  13048. * the previous two vertices forming a triangle. For example, this can be used to model a wall.
  13049. */
  13050. TRIANGLE_STRIP = WebGLConstants.TRIANGLE_STRIP,
  13051. /**
  13052. * Triangle fan primitive where each vertex (or index) after the first two connect to
  13053. * the previous vertex and the first vertex forming a triangle. For example, this can be used
  13054. * to model a cone or circle.
  13055. */
  13056. TRIANGLE_FAN = WebGLConstants.TRIANGLE_FAN
  13057. }
  13058. /**
  13059. * Base class for proxying requested made by {@link Resource}.
  13060. */
  13061. export class Proxy {
  13062. constructor();
  13063. /**
  13064. * Get the final URL to use to request a given resource.
  13065. * @param resource - The resource to request.
  13066. * @returns proxied resource
  13067. */
  13068. getURL(resource: string): string;
  13069. }
  13070. /**
  13071. * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
  13072. */
  13073. export namespace QuadraticRealPolynomial {
  13074. /**
  13075. * Provides the discriminant of the quadratic equation from the supplied coefficients.
  13076. * @param a - The coefficient of the 2nd order monomial.
  13077. * @param b - The coefficient of the 1st order monomial.
  13078. * @param c - The coefficient of the 0th order monomial.
  13079. * @returns The value of the discriminant.
  13080. */
  13081. function computeDiscriminant(a: number, b: number, c: number): number;
  13082. /**
  13083. * Provides the real valued roots of the quadratic polynomial with the provided coefficients.
  13084. * @param a - The coefficient of the 2nd order monomial.
  13085. * @param b - The coefficient of the 1st order monomial.
  13086. * @param c - The coefficient of the 0th order monomial.
  13087. * @returns The real valued roots.
  13088. */
  13089. function computeRealRoots(a: number, b: number, c: number): number[];
  13090. }
  13091. /**
  13092. * Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized
  13093. * mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed
  13094. * as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner
  13095. * of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile
  13096. * and 32767 at the maximum height in the tile.
  13097. * @example
  13098. * const data = new Cesium.QuantizedMeshTerrainData({
  13099. * minimumHeight : -100,
  13100. * maximumHeight : 2101,
  13101. * quantizedVertices : new Uint16Array([// order is SW NW SE NE
  13102. * // longitude
  13103. * 0, 0, 32767, 32767,
  13104. * // latitude
  13105. * 0, 32767, 0, 32767,
  13106. * // heights
  13107. * 16384, 0, 32767, 16384]),
  13108. * indices : new Uint16Array([0, 3, 1,
  13109. * 0, 2, 3]),
  13110. * boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),
  13111. * orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),
  13112. * horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),
  13113. * westIndices : [0, 1],
  13114. * southIndices : [0, 1],
  13115. * eastIndices : [2, 3],
  13116. * northIndices : [1, 3],
  13117. * westSkirtHeight : 1.0,
  13118. * southSkirtHeight : 1.0,
  13119. * eastSkirtHeight : 1.0,
  13120. * northSkirtHeight : 1.0
  13121. * });
  13122. * @param options - Object with the following properties:
  13123. * @param options.quantizedVertices - The buffer containing the quantized mesh.
  13124. * @param options.indices - The indices specifying how the quantized vertices are linked
  13125. * together into triangles. Each three indices specifies one triangle.
  13126. * @param options.minimumHeight - The minimum terrain height within the tile, in meters above the ellipsoid.
  13127. * @param options.maximumHeight - The maximum terrain height within the tile, in meters above the ellipsoid.
  13128. * @param options.boundingSphere - A sphere bounding all of the vertices in the mesh.
  13129. * @param [options.orientedBoundingBox] - An OrientedBoundingBox bounding all of the vertices in the mesh.
  13130. * @param options.horizonOcclusionPoint - The horizon occlusion point of the mesh. If this point
  13131. * is below the horizon, the entire tile is assumed to be below the horizon as well.
  13132. * The point is expressed in ellipsoid-scaled coordinates.
  13133. * @param options.westIndices - The indices of the vertices on the western edge of the tile.
  13134. * @param options.southIndices - The indices of the vertices on the southern edge of the tile.
  13135. * @param options.eastIndices - The indices of the vertices on the eastern edge of the tile.
  13136. * @param options.northIndices - The indices of the vertices on the northern edge of the tile.
  13137. * @param options.westSkirtHeight - The height of the skirt to add on the western edge of the tile.
  13138. * @param options.southSkirtHeight - The height of the skirt to add on the southern edge of the tile.
  13139. * @param options.eastSkirtHeight - The height of the skirt to add on the eastern edge of the tile.
  13140. * @param options.northSkirtHeight - The height of the skirt to add on the northern edge of the tile.
  13141. * @param [options.childTileMask = 15] - A bit mask indicating which of this tile's four children exist.
  13142. * If a child's bit is set, geometry will be requested for that tile as well when it
  13143. * is needed. If the bit is cleared, the child tile is not requested and geometry is
  13144. * instead upsampled from the parent. The bit values are as follows:
  13145. * <table>
  13146. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  13147. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  13148. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  13149. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  13150. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  13151. * </table>
  13152. * @param [options.createdByUpsampling = false] - True if this instance was created by upsampling another instance;
  13153. * otherwise, false.
  13154. * @param [options.encodedNormals] - The buffer containing per vertex normals, encoded using 'oct' encoding
  13155. * @param [options.waterMask] - The buffer containing the watermask.
  13156. * @param [options.credits] - Array of credits for this tile.
  13157. */
  13158. export class QuantizedMeshTerrainData {
  13159. constructor(options: {
  13160. quantizedVertices: Uint16Array;
  13161. indices: Uint16Array | Uint32Array;
  13162. minimumHeight: number;
  13163. maximumHeight: number;
  13164. boundingSphere: BoundingSphere;
  13165. orientedBoundingBox?: OrientedBoundingBox;
  13166. horizonOcclusionPoint: Cartesian3;
  13167. westIndices: number[];
  13168. southIndices: number[];
  13169. eastIndices: number[];
  13170. northIndices: number[];
  13171. westSkirtHeight: number;
  13172. southSkirtHeight: number;
  13173. eastSkirtHeight: number;
  13174. northSkirtHeight: number;
  13175. childTileMask?: number;
  13176. createdByUpsampling?: boolean;
  13177. encodedNormals?: Uint8Array;
  13178. waterMask?: Uint8Array;
  13179. credits?: Credit[];
  13180. });
  13181. /**
  13182. * An array of credits for this tile.
  13183. */
  13184. credits: Credit[];
  13185. /**
  13186. * The water mask included in this terrain data, if any. A water mask is a rectangular
  13187. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  13188. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  13189. */
  13190. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  13191. /**
  13192. * Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the
  13193. * vertices in this instance, interpolated if necessary.
  13194. * @param tilingScheme - The tiling scheme of this terrain data.
  13195. * @param thisX - The X coordinate of this tile in the tiling scheme.
  13196. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  13197. * @param thisLevel - The level of this tile in the tiling scheme.
  13198. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  13199. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  13200. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  13201. * @returns A promise for upsampled heightmap terrain data for the descendant tile,
  13202. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  13203. * deferred.
  13204. */
  13205. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<QuantizedMeshTerrainData> | undefined;
  13206. /**
  13207. * Computes the terrain height at a specified longitude and latitude.
  13208. * @param rectangle - The rectangle covered by this terrain data.
  13209. * @param longitude - The longitude in radians.
  13210. * @param latitude - The latitude in radians.
  13211. * @returns The terrain height at the specified position. The position is clamped to
  13212. * the rectangle, so expect incorrect results for positions far outside the rectangle.
  13213. */
  13214. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  13215. /**
  13216. * Determines if a given child tile is available, based on the
  13217. * {@link HeightmapTerrainData.childTileMask}. The given child tile coordinates are assumed
  13218. * to be one of the four children of this tile. If non-child tile coordinates are
  13219. * given, the availability of the southeast child tile is returned.
  13220. * @param thisX - The tile X coordinate of this (the parent) tile.
  13221. * @param thisY - The tile Y coordinate of this (the parent) tile.
  13222. * @param childX - The tile X coordinate of the child tile to check for availability.
  13223. * @param childY - The tile Y coordinate of the child tile to check for availability.
  13224. * @returns True if the child tile is available; otherwise, false.
  13225. */
  13226. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  13227. /**
  13228. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  13229. * terrain data. If this value is false, the data was obtained from some other source, such
  13230. * as by downloading it from a remote server. This method should return true for instances
  13231. * returned from a call to {@link HeightmapTerrainData#upsample}.
  13232. * @returns True if this instance was created by upsampling; otherwise, false.
  13233. */
  13234. wasCreatedByUpsampling(): boolean;
  13235. }
  13236. /**
  13237. * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
  13238. */
  13239. export namespace QuarticRealPolynomial {
  13240. /**
  13241. * Provides the discriminant of the quartic equation from the supplied coefficients.
  13242. * @param a - The coefficient of the 4th order monomial.
  13243. * @param b - The coefficient of the 3rd order monomial.
  13244. * @param c - The coefficient of the 2nd order monomial.
  13245. * @param d - The coefficient of the 1st order monomial.
  13246. * @param e - The coefficient of the 0th order monomial.
  13247. * @returns The value of the discriminant.
  13248. */
  13249. function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number;
  13250. /**
  13251. * Provides the real valued roots of the quartic polynomial with the provided coefficients.
  13252. * @param a - The coefficient of the 4th order monomial.
  13253. * @param b - The coefficient of the 3rd order monomial.
  13254. * @param c - The coefficient of the 2nd order monomial.
  13255. * @param d - The coefficient of the 1st order monomial.
  13256. * @param e - The coefficient of the 0th order monomial.
  13257. * @returns The real valued roots.
  13258. */
  13259. function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[];
  13260. }
  13261. /**
  13262. * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
  13263. * @param [x = 0.0] - The X component.
  13264. * @param [y = 0.0] - The Y component.
  13265. * @param [z = 0.0] - The Z component.
  13266. * @param [w = 0.0] - The W component.
  13267. */
  13268. export class Quaternion {
  13269. constructor(x?: number, y?: number, z?: number, w?: number);
  13270. /**
  13271. * The X component.
  13272. */
  13273. x: number;
  13274. /**
  13275. * The Y component.
  13276. */
  13277. y: number;
  13278. /**
  13279. * The Z component.
  13280. */
  13281. z: number;
  13282. /**
  13283. * The W component.
  13284. */
  13285. w: number;
  13286. /**
  13287. * Computes a quaternion representing a rotation around an axis.
  13288. * @param axis - The axis of rotation.
  13289. * @param angle - The angle in radians to rotate around the axis.
  13290. * @param [result] - The object onto which to store the result.
  13291. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13292. */
  13293. static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion;
  13294. /**
  13295. * Computes a Quaternion from the provided Matrix3 instance.
  13296. * @param matrix - The rotation matrix.
  13297. * @param [result] - The object onto which to store the result.
  13298. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13299. */
  13300. static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion;
  13301. /**
  13302. * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
  13303. * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
  13304. * the positive x axis.
  13305. * @param headingPitchRoll - The rotation expressed as a heading, pitch and roll.
  13306. * @param [result] - The object onto which to store the result.
  13307. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  13308. */
  13309. static fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Quaternion): Quaternion;
  13310. /**
  13311. * The number of elements used to pack the object into an array.
  13312. */
  13313. static packedLength: number;
  13314. /**
  13315. * Stores the provided instance into the provided array.
  13316. * @param value - The value to pack.
  13317. * @param array - The array to pack into.
  13318. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13319. * @returns The array that was packed into
  13320. */
  13321. static pack(value: Quaternion, array: number[], startingIndex?: number): number[];
  13322. /**
  13323. * Retrieves an instance from a packed array.
  13324. * @param array - The packed array.
  13325. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13326. * @param [result] - The object into which to store the result.
  13327. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13328. */
  13329. static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion;
  13330. /**
  13331. * The number of elements used to store the object into an array in its interpolatable form.
  13332. */
  13333. static packedInterpolationLength: number;
  13334. /**
  13335. * Converts a packed array into a form suitable for interpolation.
  13336. * @param packedArray - The packed array.
  13337. * @param [startingIndex = 0] - The index of the first element to be converted.
  13338. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  13339. * @param [result] - The object into which to store the result.
  13340. */
  13341. static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  13342. /**
  13343. * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
  13344. * @param array - The array previously packed for interpolation.
  13345. * @param sourceArray - The original packed array.
  13346. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  13347. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  13348. * @param [result] - The object into which to store the result.
  13349. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13350. */
  13351. static unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion;
  13352. /**
  13353. * Duplicates a Quaternion instance.
  13354. * @param quaternion - The quaternion to duplicate.
  13355. * @param [result] - The object onto which to store the result.
  13356. * @returns The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
  13357. */
  13358. static clone(quaternion: Quaternion, result?: Quaternion): Quaternion;
  13359. /**
  13360. * Computes the conjugate of the provided quaternion.
  13361. * @param quaternion - The quaternion to conjugate.
  13362. * @param result - The object onto which to store the result.
  13363. * @returns The modified result parameter.
  13364. */
  13365. static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13366. /**
  13367. * Computes magnitude squared for the provided quaternion.
  13368. * @param quaternion - The quaternion to conjugate.
  13369. * @returns The magnitude squared.
  13370. */
  13371. static magnitudeSquared(quaternion: Quaternion): number;
  13372. /**
  13373. * Computes magnitude for the provided quaternion.
  13374. * @param quaternion - The quaternion to conjugate.
  13375. * @returns The magnitude.
  13376. */
  13377. static magnitude(quaternion: Quaternion): number;
  13378. /**
  13379. * Computes the normalized form of the provided quaternion.
  13380. * @param quaternion - The quaternion to normalize.
  13381. * @param result - The object onto which to store the result.
  13382. * @returns The modified result parameter.
  13383. */
  13384. static normalize(quaternion: Quaternion, result: Quaternion): Quaternion;
  13385. /**
  13386. * Computes the inverse of the provided quaternion.
  13387. * @param quaternion - The quaternion to normalize.
  13388. * @param result - The object onto which to store the result.
  13389. * @returns The modified result parameter.
  13390. */
  13391. static inverse(quaternion: Quaternion, result: Quaternion): Quaternion;
  13392. /**
  13393. * Computes the componentwise sum of two quaternions.
  13394. * @param left - The first quaternion.
  13395. * @param right - The second quaternion.
  13396. * @param result - The object onto which to store the result.
  13397. * @returns The modified result parameter.
  13398. */
  13399. static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13400. /**
  13401. * Computes the componentwise difference of two quaternions.
  13402. * @param left - The first quaternion.
  13403. * @param right - The second quaternion.
  13404. * @param result - The object onto which to store the result.
  13405. * @returns The modified result parameter.
  13406. */
  13407. static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13408. /**
  13409. * Negates the provided quaternion.
  13410. * @param quaternion - The quaternion to be negated.
  13411. * @param result - The object onto which to store the result.
  13412. * @returns The modified result parameter.
  13413. */
  13414. static negate(quaternion: Quaternion, result: Quaternion): Quaternion;
  13415. /**
  13416. * Computes the dot (scalar) product of two quaternions.
  13417. * @param left - The first quaternion.
  13418. * @param right - The second quaternion.
  13419. * @returns The dot product.
  13420. */
  13421. static dot(left: Quaternion, right: Quaternion): number;
  13422. /**
  13423. * Computes the product of two quaternions.
  13424. * @param left - The first quaternion.
  13425. * @param right - The second quaternion.
  13426. * @param result - The object onto which to store the result.
  13427. * @returns The modified result parameter.
  13428. */
  13429. static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion;
  13430. /**
  13431. * Multiplies the provided quaternion componentwise by the provided scalar.
  13432. * @param quaternion - The quaternion to be scaled.
  13433. * @param scalar - The scalar to multiply with.
  13434. * @param result - The object onto which to store the result.
  13435. * @returns The modified result parameter.
  13436. */
  13437. static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13438. /**
  13439. * Divides the provided quaternion componentwise by the provided scalar.
  13440. * @param quaternion - The quaternion to be divided.
  13441. * @param scalar - The scalar to divide by.
  13442. * @param result - The object onto which to store the result.
  13443. * @returns The modified result parameter.
  13444. */
  13445. static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion;
  13446. /**
  13447. * Computes the axis of rotation of the provided quaternion.
  13448. * @param quaternion - The quaternion to use.
  13449. * @param result - The object onto which to store the result.
  13450. * @returns The modified result parameter.
  13451. */
  13452. static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13453. /**
  13454. * Computes the angle of rotation of the provided quaternion.
  13455. * @param quaternion - The quaternion to use.
  13456. * @returns The angle of rotation.
  13457. */
  13458. static computeAngle(quaternion: Quaternion): number;
  13459. /**
  13460. * Computes the linear interpolation or extrapolation at t using the provided quaternions.
  13461. * @param start - The value corresponding to t at 0.0.
  13462. * @param end - The value corresponding to t at 1.0.
  13463. * @param t - The point along t at which to interpolate.
  13464. * @param result - The object onto which to store the result.
  13465. * @returns The modified result parameter.
  13466. */
  13467. static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13468. /**
  13469. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13470. * @param start - The value corresponding to t at 0.0.
  13471. * @param end - The value corresponding to t at 1.0.
  13472. * @param t - The point along t at which to interpolate.
  13473. * @param result - The object onto which to store the result.
  13474. * @returns The modified result parameter.
  13475. */
  13476. static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13477. /**
  13478. * The logarithmic quaternion function.
  13479. * @param quaternion - The unit quaternion.
  13480. * @param result - The object onto which to store the result.
  13481. * @returns The modified result parameter.
  13482. */
  13483. static log(quaternion: Quaternion, result: Cartesian3): Cartesian3;
  13484. /**
  13485. * The exponential quaternion function.
  13486. * @param cartesian - The cartesian.
  13487. * @param result - The object onto which to store the result.
  13488. * @returns The modified result parameter.
  13489. */
  13490. static exp(cartesian: Cartesian3, result: Quaternion): Quaternion;
  13491. /**
  13492. * Computes an inner quadrangle point.
  13493. * <p>This will compute quaternions that ensure a squad curve is C<sup>1</sup>.</p>
  13494. * @param q0 - The first quaternion.
  13495. * @param q1 - The second quaternion.
  13496. * @param q2 - The third quaternion.
  13497. * @param result - The object onto which to store the result.
  13498. * @returns The modified result parameter.
  13499. */
  13500. static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion;
  13501. /**
  13502. * Computes the spherical quadrangle interpolation between quaternions.
  13503. * @example
  13504. * // 1. compute the squad interpolation between two quaternions on a curve
  13505. * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());
  13506. * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());
  13507. * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());
  13508. *
  13509. * // 2. compute the squad interpolation as above but where the first quaternion is a end point.
  13510. * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());
  13511. * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());
  13512. * @param q0 - The first quaternion.
  13513. * @param q1 - The second quaternion.
  13514. * @param s0 - The first inner quadrangle.
  13515. * @param s1 - The second inner quadrangle.
  13516. * @param t - The time in [0,1] used to interpolate.
  13517. * @param result - The object onto which to store the result.
  13518. * @returns The modified result parameter.
  13519. */
  13520. static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13521. /**
  13522. * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
  13523. * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10<sup>-6</sup>.
  13524. * @param start - The value corresponding to t at 0.0.
  13525. * @param end - The value corresponding to t at 1.0.
  13526. * @param t - The point along t at which to interpolate.
  13527. * @param result - The object onto which to store the result.
  13528. * @returns The modified result parameter.
  13529. */
  13530. static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion;
  13531. /**
  13532. * Computes the spherical quadrangle interpolation between quaternions.
  13533. * An implementation that is faster than {@link Quaternion#squad}, but less accurate.
  13534. * @param q0 - The first quaternion.
  13535. * @param q1 - The second quaternion.
  13536. * @param s0 - The first inner quadrangle.
  13537. * @param s1 - The second inner quadrangle.
  13538. * @param t - The time in [0,1] used to interpolate.
  13539. * @param result - The object onto which to store the result.
  13540. * @returns The modified result parameter or a new instance if none was provided.
  13541. */
  13542. static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion;
  13543. /**
  13544. * Compares the provided quaternions componentwise and returns
  13545. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13546. * @param [left] - The first quaternion.
  13547. * @param [right] - The second quaternion.
  13548. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13549. */
  13550. static equals(left?: Quaternion, right?: Quaternion): boolean;
  13551. /**
  13552. * Compares the provided quaternions componentwise and returns
  13553. * <code>true</code> if they are within the provided epsilon,
  13554. * <code>false</code> otherwise.
  13555. * @param [left] - The first quaternion.
  13556. * @param [right] - The second quaternion.
  13557. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13558. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13559. */
  13560. static equalsEpsilon(left?: Quaternion, right?: Quaternion, epsilon?: number): boolean;
  13561. /**
  13562. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
  13563. */
  13564. static readonly ZERO: Quaternion;
  13565. /**
  13566. * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
  13567. */
  13568. static readonly IDENTITY: Quaternion;
  13569. /**
  13570. * Duplicates this Quaternion instance.
  13571. * @param [result] - The object onto which to store the result.
  13572. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  13573. */
  13574. clone(result?: Quaternion): Quaternion;
  13575. /**
  13576. * Compares this and the provided quaternion componentwise and returns
  13577. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13578. * @param [right] - The right hand side quaternion.
  13579. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  13580. */
  13581. equals(right?: Quaternion): boolean;
  13582. /**
  13583. * Compares this and the provided quaternion componentwise and returns
  13584. * <code>true</code> if they are within the provided epsilon,
  13585. * <code>false</code> otherwise.
  13586. * @param [right] - The right hand side quaternion.
  13587. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13588. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13589. */
  13590. equalsEpsilon(right?: Quaternion, epsilon?: number): boolean;
  13591. /**
  13592. * Returns a string representing this quaternion in the format (x, y, z, w).
  13593. * @returns A string representing this Quaternion.
  13594. */
  13595. toString(): string;
  13596. }
  13597. /**
  13598. * A spline that uses spherical linear (slerp) interpolation to create a quaternion curve.
  13599. * The generated curve is in the class C<sup>1</sup>.
  13600. * @param options - Object with the following properties:
  13601. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point.
  13602. * The values are in no way connected to the clock time. They are the parameterization for the curve.
  13603. * @param options.points - The array of {@link Quaternion} control points.
  13604. */
  13605. export class QuaternionSpline {
  13606. constructor(options: {
  13607. times: number[];
  13608. points: Quaternion[];
  13609. });
  13610. /**
  13611. * An array of times for the control points.
  13612. */
  13613. readonly times: number[];
  13614. /**
  13615. * An array of {@link Quaternion} control points.
  13616. */
  13617. readonly points: Quaternion[];
  13618. /**
  13619. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  13620. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  13621. * @param time - The time.
  13622. * @returns The index for the element at the start of the interval.
  13623. */
  13624. findTimeInterval(time: number): number;
  13625. /**
  13626. * Wraps the given time to the period covered by the spline.
  13627. * @param time - The time.
  13628. * @returns The time, wrapped around to the updated animation.
  13629. */
  13630. wrapTime(time: number): number;
  13631. /**
  13632. * Clamps the given time to the period covered by the spline.
  13633. * @param time - The time.
  13634. * @returns The time, clamped to the animation period.
  13635. */
  13636. clampTime(time: number): number;
  13637. /**
  13638. * Evaluates the curve at a given time.
  13639. * @param time - The time at which to evaluate the curve.
  13640. * @param [result] - The object onto which to store the result.
  13641. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  13642. */
  13643. evaluate(time: number, result?: Quaternion): Quaternion;
  13644. }
  13645. /**
  13646. * A queue that can enqueue items at the end, and dequeue items from the front.
  13647. */
  13648. export class Queue {
  13649. constructor();
  13650. /**
  13651. * The length of the queue.
  13652. */
  13653. readonly length: number;
  13654. /**
  13655. * Enqueues the specified item.
  13656. * @param item - The item to enqueue.
  13657. */
  13658. enqueue(item: any): void;
  13659. /**
  13660. * Dequeues an item. Returns undefined if the queue is empty.
  13661. * @returns The the dequeued item.
  13662. */
  13663. dequeue(): any;
  13664. /**
  13665. * Returns the item at the front of the queue. Returns undefined if the queue is empty.
  13666. * @returns The item at the front of the queue.
  13667. */
  13668. peek(): any;
  13669. /**
  13670. * Check whether this queue contains the specified item.
  13671. * @param item - The item to search for.
  13672. */
  13673. contains(item: any): void;
  13674. /**
  13675. * Remove all items from the queue.
  13676. */
  13677. clear(): void;
  13678. /**
  13679. * Sort the items in the queue in-place.
  13680. * @param compareFunction - A function that defines the sort order.
  13681. */
  13682. sort(compareFunction: Queue.Comparator): void;
  13683. }
  13684. export namespace Queue {
  13685. /**
  13686. * A function used to compare two items while sorting a queue.
  13687. * @example
  13688. * function compareNumbers(a, b) {
  13689. * return a - b;
  13690. * }
  13691. * @param a - An item in the array.
  13692. * @param b - An item in the array.
  13693. */
  13694. type Comparator = (a: any, b: any) => number;
  13695. }
  13696. /**
  13697. * Represents a ray that extends infinitely from the provided origin in the provided direction.
  13698. * @param [origin = Cartesian3.ZERO] - The origin of the ray.
  13699. * @param [direction = Cartesian3.ZERO] - The direction of the ray.
  13700. */
  13701. export class Ray {
  13702. constructor(origin?: Cartesian3, direction?: Cartesian3);
  13703. /**
  13704. * The origin of the ray.
  13705. */
  13706. origin: Cartesian3;
  13707. /**
  13708. * The direction of the ray.
  13709. */
  13710. direction: Cartesian3;
  13711. /**
  13712. * Duplicates a Ray instance.
  13713. * @param ray - The ray to duplicate.
  13714. * @param [result] - The object onto which to store the result.
  13715. * @returns The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
  13716. */
  13717. static clone(ray: Ray, result?: Ray): Ray;
  13718. /**
  13719. * Computes the point along the ray given by r(t) = o + t*d,
  13720. * where o is the origin of the ray and d is the direction.
  13721. * @example
  13722. * //Get the first intersection point of a ray and an ellipsoid.
  13723. * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
  13724. * const point = Cesium.Ray.getPoint(ray, intersection.start);
  13725. * @param ray - The ray.
  13726. * @param t - A scalar value.
  13727. * @param [result] - The object in which the result will be stored.
  13728. * @returns The modified result parameter, or a new instance if none was provided.
  13729. */
  13730. static getPoint(ray: Ray, t: number, result?: Cartesian3): Cartesian3;
  13731. }
  13732. /**
  13733. * A two dimensional region specified as longitude and latitude coordinates.
  13734. * @param [west = 0.0] - The westernmost longitude, in radians, in the range [-Pi, Pi].
  13735. * @param [south = 0.0] - The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13736. * @param [east = 0.0] - The easternmost longitude, in radians, in the range [-Pi, Pi].
  13737. * @param [north = 0.0] - The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
  13738. */
  13739. export class Rectangle {
  13740. constructor(west?: number, south?: number, east?: number, north?: number);
  13741. /**
  13742. * The westernmost longitude in radians in the range [-Pi, Pi].
  13743. */
  13744. west: number;
  13745. /**
  13746. * The southernmost latitude in radians in the range [-Pi/2, Pi/2].
  13747. */
  13748. south: number;
  13749. /**
  13750. * The easternmost longitude in radians in the range [-Pi, Pi].
  13751. */
  13752. east: number;
  13753. /**
  13754. * The northernmost latitude in radians in the range [-Pi/2, Pi/2].
  13755. */
  13756. north: number;
  13757. /**
  13758. * Gets the width of the rectangle in radians.
  13759. */
  13760. readonly width: number;
  13761. /**
  13762. * Gets the height of the rectangle in radians.
  13763. */
  13764. readonly height: number;
  13765. /**
  13766. * The number of elements used to pack the object into an array.
  13767. */
  13768. static packedLength: number;
  13769. /**
  13770. * Stores the provided instance into the provided array.
  13771. * @param value - The value to pack.
  13772. * @param array - The array to pack into.
  13773. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  13774. * @returns The array that was packed into
  13775. */
  13776. static pack(value: Rectangle, array: number[], startingIndex?: number): number[];
  13777. /**
  13778. * Retrieves an instance from a packed array.
  13779. * @param array - The packed array.
  13780. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  13781. * @param [result] - The object into which to store the result.
  13782. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13783. */
  13784. static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle;
  13785. /**
  13786. * Computes the width of a rectangle in radians.
  13787. * @param rectangle - The rectangle to compute the width of.
  13788. * @returns The width.
  13789. */
  13790. static computeWidth(rectangle: Rectangle): number;
  13791. /**
  13792. * Computes the height of a rectangle in radians.
  13793. * @param rectangle - The rectangle to compute the height of.
  13794. * @returns The height.
  13795. */
  13796. static computeHeight(rectangle: Rectangle): number;
  13797. /**
  13798. * Creates a rectangle given the boundary longitude and latitude in degrees.
  13799. * @example
  13800. * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
  13801. * @param [west = 0.0] - The westernmost longitude in degrees in the range [-180.0, 180.0].
  13802. * @param [south = 0.0] - The southernmost latitude in degrees in the range [-90.0, 90.0].
  13803. * @param [east = 0.0] - The easternmost longitude in degrees in the range [-180.0, 180.0].
  13804. * @param [north = 0.0] - The northernmost latitude in degrees in the range [-90.0, 90.0].
  13805. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13806. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13807. */
  13808. static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13809. /**
  13810. * Creates a rectangle given the boundary longitude and latitude in radians.
  13811. * @example
  13812. * const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
  13813. * @param [west = 0.0] - The westernmost longitude in radians in the range [-Math.PI, Math.PI].
  13814. * @param [south = 0.0] - The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13815. * @param [east = 0.0] - The easternmost longitude in radians in the range [-Math.PI, Math.PI].
  13816. * @param [north = 0.0] - The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
  13817. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13818. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13819. */
  13820. static fromRadians(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle;
  13821. /**
  13822. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13823. * @param cartographics - The list of Cartographic instances.
  13824. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13825. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13826. */
  13827. static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle;
  13828. /**
  13829. * Creates the smallest possible Rectangle that encloses all positions in the provided array.
  13830. * @param cartesians - The list of Cartesian instances.
  13831. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid the cartesians are on.
  13832. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13833. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13834. */
  13835. static fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
  13836. /**
  13837. * Duplicates a Rectangle.
  13838. * @param rectangle - The rectangle to clone.
  13839. * @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
  13840. * @returns The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
  13841. */
  13842. static clone(rectangle: Rectangle, result?: Rectangle): Rectangle;
  13843. /**
  13844. * Compares the provided Rectangles componentwise and returns
  13845. * <code>true</code> if they pass an absolute or relative tolerance test,
  13846. * <code>false</code> otherwise.
  13847. * @param [left] - The first Rectangle.
  13848. * @param [right] - The second Rectangle.
  13849. * @param [absoluteEpsilon = 0] - The absolute epsilon tolerance to use for equality testing.
  13850. * @returns <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
  13851. */
  13852. static equalsEpsilon(left?: Rectangle, right?: Rectangle, absoluteEpsilon?: number): boolean;
  13853. /**
  13854. * Duplicates this Rectangle.
  13855. * @param [result] - The object onto which to store the result.
  13856. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13857. */
  13858. clone(result?: Rectangle): Rectangle;
  13859. /**
  13860. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13861. * <code>true</code> if they are equal, <code>false</code> otherwise.
  13862. * @param [other] - The Rectangle to compare.
  13863. * @returns <code>true</code> if the Rectangles are equal, <code>false</code> otherwise.
  13864. */
  13865. equals(other?: Rectangle): boolean;
  13866. /**
  13867. * Compares the provided rectangles and returns <code>true</code> if they are equal,
  13868. * <code>false</code> otherwise.
  13869. * @param [left] - The first Rectangle.
  13870. * @param [right] - The second Rectangle.
  13871. * @returns <code>true</code> if left and right are equal; otherwise <code>false</code>.
  13872. */
  13873. static equals(left?: Rectangle, right?: Rectangle): boolean;
  13874. /**
  13875. * Compares the provided Rectangle with this Rectangle componentwise and returns
  13876. * <code>true</code> if they are within the provided epsilon,
  13877. * <code>false</code> otherwise.
  13878. * @param [other] - The Rectangle to compare.
  13879. * @param [epsilon = 0] - The epsilon to use for equality testing.
  13880. * @returns <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise.
  13881. */
  13882. equalsEpsilon(other?: Rectangle, epsilon?: number): boolean;
  13883. /**
  13884. * Checks a Rectangle's properties and throws if they are not in valid ranges.
  13885. * @param rectangle - The rectangle to validate
  13886. */
  13887. static validate(rectangle: Rectangle): void;
  13888. /**
  13889. * Computes the southwest corner of a rectangle.
  13890. * @param rectangle - The rectangle for which to find the corner
  13891. * @param [result] - The object onto which to store the result.
  13892. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13893. */
  13894. static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13895. /**
  13896. * Computes the northwest corner of a rectangle.
  13897. * @param rectangle - The rectangle for which to find the corner
  13898. * @param [result] - The object onto which to store the result.
  13899. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13900. */
  13901. static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13902. /**
  13903. * Computes the northeast corner of a rectangle.
  13904. * @param rectangle - The rectangle for which to find the corner
  13905. * @param [result] - The object onto which to store the result.
  13906. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13907. */
  13908. static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13909. /**
  13910. * Computes the southeast corner of a rectangle.
  13911. * @param rectangle - The rectangle for which to find the corner
  13912. * @param [result] - The object onto which to store the result.
  13913. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13914. */
  13915. static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13916. /**
  13917. * Computes the center of a rectangle.
  13918. * @param rectangle - The rectangle for which to find the center
  13919. * @param [result] - The object onto which to store the result.
  13920. * @returns The modified result parameter or a new Cartographic instance if none was provided.
  13921. */
  13922. static center(rectangle: Rectangle, result?: Cartographic): Cartographic;
  13923. /**
  13924. * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
  13925. * latitude and longitude in radians and produces a correct intersection, taking into account the fact that
  13926. * the same angle can be represented with multiple values as well as the wrapping of longitude at the
  13927. * anti-meridian. For a simple intersection that ignores these factors and can be used with projected
  13928. * coordinates, see {@link Rectangle.simpleIntersection}.
  13929. * @param rectangle - On rectangle to find an intersection
  13930. * @param otherRectangle - Another rectangle to find an intersection
  13931. * @param [result] - The object onto which to store the result.
  13932. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13933. */
  13934. static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13935. /**
  13936. * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
  13937. * does not attempt to put the angular coordinates into a consistent range or to account for crossing the
  13938. * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
  13939. * and longitude (i.e. projected coordinates).
  13940. * @param rectangle - On rectangle to find an intersection
  13941. * @param otherRectangle - Another rectangle to find an intersection
  13942. * @param [result] - The object onto which to store the result.
  13943. * @returns The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
  13944. */
  13945. static simpleIntersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle | undefined;
  13946. /**
  13947. * Computes a rectangle that is the union of two rectangles.
  13948. * @param rectangle - A rectangle to enclose in rectangle.
  13949. * @param otherRectangle - A rectangle to enclose in a rectangle.
  13950. * @param [result] - The object onto which to store the result.
  13951. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13952. */
  13953. static union(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle;
  13954. /**
  13955. * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
  13956. * @param rectangle - A rectangle to expand.
  13957. * @param cartographic - A cartographic to enclose in a rectangle.
  13958. * @param [result] - The object onto which to store the result.
  13959. * @returns The modified result parameter or a new Rectangle instance if one was not provided.
  13960. */
  13961. static expand(rectangle: Rectangle, cartographic: Cartographic, result?: Rectangle): Rectangle;
  13962. /**
  13963. * Returns true if the cartographic is on or inside the rectangle, false otherwise.
  13964. * @param rectangle - The rectangle
  13965. * @param cartographic - The cartographic to test.
  13966. * @returns true if the provided cartographic is inside the rectangle, false otherwise.
  13967. */
  13968. static contains(rectangle: Rectangle, cartographic: Cartographic): boolean;
  13969. /**
  13970. * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
  13971. * {@link BoundingSphere#fromPoints}. Sampling is necessary to account
  13972. * for rectangles that cover the poles or cross the equator.
  13973. * @param rectangle - The rectangle to subsample.
  13974. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use.
  13975. * @param [surfaceHeight = 0.0] - The height of the rectangle above the ellipsoid.
  13976. * @param [result] - The array of Cartesians onto which to store the result.
  13977. * @returns The modified result parameter or a new Array of Cartesians instances if none was provided.
  13978. */
  13979. static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[];
  13980. /**
  13981. * Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].
  13982. * @param rectangle - The rectangle to subsection.
  13983. * @param westLerp - The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.
  13984. * @param southLerp - The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.
  13985. * @param eastLerp - The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.
  13986. * @param northLerp - The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.
  13987. * @param [result] - The object onto which to store the result.
  13988. * @returns The modified result parameter or a new Rectangle instance if none was provided.
  13989. */
  13990. static subsection(rectangle: Rectangle, westLerp: number, southLerp: number, eastLerp: number, northLerp: number, result?: Rectangle): Rectangle;
  13991. /**
  13992. * The largest possible rectangle.
  13993. */
  13994. static readonly MAX_VALUE: Rectangle;
  13995. }
  13996. /**
  13997. * 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}.
  13998. * @example
  13999. * // 1. create a rectangle
  14000. * const rectangle = new Cesium.RectangleGeometry({
  14001. * ellipsoid : Cesium.Ellipsoid.WGS84,
  14002. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  14003. * height : 10000.0
  14004. * });
  14005. * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  14006. *
  14007. * // 2. create an extruded rectangle without a top
  14008. * const rectangle = new Cesium.RectangleGeometry({
  14009. * ellipsoid : Cesium.Ellipsoid.WGS84,
  14010. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  14011. * height : 10000.0,
  14012. * extrudedHeight: 300000
  14013. * });
  14014. * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
  14015. * @param options - Object with the following properties:
  14016. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  14017. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  14018. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  14019. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  14020. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  14021. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  14022. * @param [options.stRotation = 0.0] - The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
  14023. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  14024. */
  14025. export class RectangleGeometry {
  14026. constructor(options: {
  14027. rectangle: Rectangle;
  14028. vertexFormat?: VertexFormat;
  14029. ellipsoid?: Ellipsoid;
  14030. granularity?: number;
  14031. height?: number;
  14032. rotation?: number;
  14033. stRotation?: number;
  14034. extrudedHeight?: number;
  14035. });
  14036. /**
  14037. * The number of elements used to pack the object into an array.
  14038. */
  14039. static packedLength: number;
  14040. /**
  14041. * Stores the provided instance into the provided array.
  14042. * @param value - The value to pack.
  14043. * @param array - The array to pack into.
  14044. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14045. * @returns The array that was packed into
  14046. */
  14047. static pack(value: RectangleGeometry, array: number[], startingIndex?: number): number[];
  14048. /**
  14049. * Retrieves an instance from a packed array.
  14050. * @param array - The packed array.
  14051. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14052. * @param [result] - The object into which to store the result.
  14053. * @returns The modified result parameter or a new RectangleGeometry instance if one was not provided.
  14054. */
  14055. static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry;
  14056. /**
  14057. * Computes the bounding rectangle based on the provided options
  14058. * @param options - Object with the following properties:
  14059. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  14060. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  14061. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  14062. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  14063. * @param [result] - An object in which to store the result.
  14064. * @returns The result rectangle
  14065. */
  14066. static computeRectangle(options: {
  14067. rectangle: Rectangle;
  14068. ellipsoid?: Ellipsoid;
  14069. granularity?: number;
  14070. rotation?: number;
  14071. }, result?: Rectangle): Rectangle;
  14072. /**
  14073. * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
  14074. * @param rectangleGeometry - A description of the rectangle.
  14075. * @returns The computed vertices and indices.
  14076. */
  14077. static createGeometry(rectangleGeometry: RectangleGeometry): Geometry | undefined;
  14078. }
  14079. /**
  14080. * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
  14081. * @example
  14082. * const rectangle = new Cesium.RectangleOutlineGeometry({
  14083. * ellipsoid : Cesium.Ellipsoid.WGS84,
  14084. * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  14085. * height : 10000.0
  14086. * });
  14087. * const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
  14088. * @param options - Object with the following properties:
  14089. * @param options.rectangle - A cartographic rectangle with north, south, east and west properties in radians.
  14090. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid on which the rectangle lies.
  14091. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  14092. * @param [options.height = 0.0] - The distance in meters between the rectangle and the ellipsoid surface.
  14093. * @param [options.rotation = 0.0] - The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
  14094. * @param [options.extrudedHeight] - The distance in meters between the rectangle's extruded face and the ellipsoid surface.
  14095. */
  14096. export class RectangleOutlineGeometry {
  14097. constructor(options: {
  14098. rectangle: Rectangle;
  14099. ellipsoid?: Ellipsoid;
  14100. granularity?: number;
  14101. height?: number;
  14102. rotation?: number;
  14103. extrudedHeight?: number;
  14104. });
  14105. /**
  14106. * The number of elements used to pack the object into an array.
  14107. */
  14108. static packedLength: number;
  14109. /**
  14110. * Stores the provided instance into the provided array.
  14111. * @param value - The value to pack.
  14112. * @param array - The array to pack into.
  14113. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  14114. * @returns The array that was packed into
  14115. */
  14116. static pack(value: RectangleOutlineGeometry, array: number[], startingIndex?: number): number[];
  14117. /**
  14118. * Retrieves an instance from a packed array.
  14119. * @param array - The packed array.
  14120. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  14121. * @param [result] - The object into which to store the result.
  14122. * @returns The modified result parameter or a new Quaternion instance if one was not provided.
  14123. */
  14124. static unpack(array: number[], startingIndex?: number, result?: RectangleOutlineGeometry): RectangleOutlineGeometry;
  14125. /**
  14126. * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
  14127. * @param rectangleGeometry - A description of the rectangle outline.
  14128. * @returns The computed vertices and indices.
  14129. */
  14130. static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry | undefined;
  14131. }
  14132. /**
  14133. * Constants for identifying well-known reference frames.
  14134. */
  14135. export enum ReferenceFrame {
  14136. /**
  14137. * The fixed frame.
  14138. */
  14139. FIXED = 0,
  14140. /**
  14141. * The inertial frame.
  14142. */
  14143. INERTIAL = 1
  14144. }
  14145. /**
  14146. * Stores information for making a request. In general this does not need to be constructed directly.
  14147. * @param [options] - An object with the following properties:
  14148. * @param [options.url] - The url to request.
  14149. * @param [options.requestFunction] - The function that makes the actual data request.
  14150. * @param [options.cancelFunction] - The function that is called when the request is cancelled.
  14151. * @param [options.priorityFunction] - The function that is called to update the request's priority, which occurs once per frame.
  14152. * @param [options.priority = 0.0] - The initial priority of the request.
  14153. * @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.
  14154. * @param [options.throttleByServer = false] - Whether to throttle the request by server.
  14155. * @param [options.type = RequestType.OTHER] - The type of request.
  14156. */
  14157. export class Request {
  14158. constructor(options?: {
  14159. url?: string;
  14160. requestFunction?: Request.RequestCallback;
  14161. cancelFunction?: Request.CancelCallback;
  14162. priorityFunction?: Request.PriorityCallback;
  14163. priority?: number;
  14164. throttle?: boolean;
  14165. throttleByServer?: boolean;
  14166. type?: RequestType;
  14167. });
  14168. /**
  14169. * The URL to request.
  14170. */
  14171. url: string;
  14172. /**
  14173. * The function that makes the actual data request.
  14174. */
  14175. requestFunction: Request.RequestCallback;
  14176. /**
  14177. * The function that is called when the request is cancelled.
  14178. */
  14179. cancelFunction: Request.CancelCallback;
  14180. /**
  14181. * The function that is called to update the request's priority, which occurs once per frame.
  14182. */
  14183. priorityFunction: Request.PriorityCallback;
  14184. /**
  14185. * Priority is a unit-less value where lower values represent higher priority.
  14186. * For world-based objects, this is usually the distance from the camera.
  14187. * A request that does not have a priority function defaults to a priority of 0.
  14188. *
  14189. * If priorityFunction is defined, this value is updated every frame with the result of that call.
  14190. */
  14191. priority: number;
  14192. /**
  14193. * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
  14194. * request will be throttled and sent based on priority.
  14195. */
  14196. readonly throttle: boolean;
  14197. /**
  14198. * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
  14199. * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
  14200. * to <code>true</code> is preferable for requests going through HTTP/1 servers.
  14201. */
  14202. readonly throttleByServer: boolean;
  14203. /**
  14204. * Type of request.
  14205. */
  14206. readonly type: RequestType;
  14207. /**
  14208. * The current state of the request.
  14209. */
  14210. readonly state: RequestState;
  14211. /**
  14212. * Duplicates a Request instance.
  14213. * @param [result] - The object onto which to store the result.
  14214. * @returns The modified result parameter or a new Resource instance if one was not provided.
  14215. */
  14216. clone(result?: Request): Request;
  14217. }
  14218. export namespace Request {
  14219. /**
  14220. * The function that makes the actual data request.
  14221. */
  14222. type RequestCallback = () => Promise<void>;
  14223. /**
  14224. * The function that is called when the request is cancelled.
  14225. */
  14226. type CancelCallback = () => void;
  14227. /**
  14228. * The function that is called to update the request's priority, which occurs once per frame.
  14229. */
  14230. type PriorityCallback = () => number;
  14231. }
  14232. /**
  14233. * An event that is raised when a request encounters an error.
  14234. * @param [statusCode] - The HTTP error status code, such as 404.
  14235. * @param [response] - The response included along with the error.
  14236. * @param [responseHeaders] - The response headers, represented either as an object literal or as a
  14237. * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
  14238. */
  14239. export class RequestErrorEvent {
  14240. constructor(statusCode?: number, response?: any, responseHeaders?: string | any);
  14241. /**
  14242. * The HTTP error status code, such as 404. If the error does not have a particular
  14243. * HTTP code, this property will be undefined.
  14244. */
  14245. statusCode: number;
  14246. /**
  14247. * The response included along with the error. If the error does not include a response,
  14248. * this property will be undefined.
  14249. */
  14250. response: any;
  14251. /**
  14252. * The headers included in the response, represented as an object literal of key/value pairs.
  14253. * If the error does not include any headers, this property will be undefined.
  14254. */
  14255. responseHeaders: any;
  14256. /**
  14257. * Creates a string representing this RequestErrorEvent.
  14258. * @returns A string representing the provided RequestErrorEvent.
  14259. */
  14260. toString(): string;
  14261. }
  14262. /**
  14263. * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
  14264. * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
  14265. * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
  14266. * 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.
  14267. */
  14268. export namespace RequestScheduler {
  14269. /**
  14270. * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
  14271. */
  14272. var maximumRequests: number;
  14273. /**
  14274. * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
  14275. * listed in {@link requestsByServer} do not observe this limit.
  14276. */
  14277. var maximumRequestsPerServer: number;
  14278. /**
  14279. * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
  14280. * @example
  14281. * RequestScheduler.requestsByServer = {
  14282. * 'api.cesium.com:443': 18,
  14283. * 'assets.cesium.com:443': 18
  14284. * };
  14285. */
  14286. var requestsByServer: any;
  14287. /**
  14288. * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
  14289. */
  14290. var throttleRequests: boolean;
  14291. }
  14292. /**
  14293. * State of the request.
  14294. */
  14295. export enum RequestState {
  14296. /**
  14297. * Initial unissued state.
  14298. */
  14299. UNISSUED = 0,
  14300. /**
  14301. * Issued but not yet active. Will become active when open slots are available.
  14302. */
  14303. ISSUED = 1,
  14304. /**
  14305. * Actual http request has been sent.
  14306. */
  14307. ACTIVE = 2,
  14308. /**
  14309. * Request completed successfully.
  14310. */
  14311. RECEIVED = 3,
  14312. /**
  14313. * Request was cancelled, either explicitly or automatically because of low priority.
  14314. */
  14315. CANCELLED = 4,
  14316. /**
  14317. * Request failed.
  14318. */
  14319. FAILED = 5
  14320. }
  14321. /**
  14322. * An enum identifying the type of request. Used for finer grained logging and priority sorting.
  14323. */
  14324. export enum RequestType {
  14325. /**
  14326. * Terrain request.
  14327. */
  14328. TERRAIN = 0,
  14329. /**
  14330. * Imagery request.
  14331. */
  14332. IMAGERY = 1,
  14333. /**
  14334. * 3D Tiles request.
  14335. */
  14336. TILES3D = 2,
  14337. /**
  14338. * Other request.
  14339. */
  14340. OTHER = 3
  14341. }
  14342. export namespace Resource {
  14343. /**
  14344. * Initialization options for the Resource constructor
  14345. * @property url - The url of the resource.
  14346. * @property [queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14347. * @property [templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14348. * @property [headers = {}] - Additional HTTP headers that will be sent.
  14349. * @property [proxy] - A proxy to be used when loading the resource.
  14350. * @property [retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14351. * @property [retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14352. * @property [request] - A Request object that will be used. Intended for internal use only.
  14353. */
  14354. type ConstructorOptions = {
  14355. url: string;
  14356. queryParameters?: any;
  14357. templateValues?: any;
  14358. headers?: any;
  14359. proxy?: Proxy;
  14360. retryCallback?: Resource.RetryCallback;
  14361. retryAttempts?: number;
  14362. request?: Request;
  14363. };
  14364. /**
  14365. * A function that returns the value of the property.
  14366. * @param [resource] - The resource that failed to load.
  14367. * @param [error] - The error that occurred during the loading of the resource.
  14368. */
  14369. type RetryCallback = (resource?: Resource, error?: Error) => boolean | Promise<boolean>;
  14370. }
  14371. /**
  14372. * 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.
  14373. * @example
  14374. * function refreshTokenRetryCallback(resource, error) {
  14375. * if (error.statusCode === 403) {
  14376. * // 403 status code means a new token should be generated
  14377. * return getNewAccessToken()
  14378. * .then(function(token) {
  14379. * resource.queryParameters.access_token = token;
  14380. * return true;
  14381. * })
  14382. * .catch(function() {
  14383. * return false;
  14384. * });
  14385. * }
  14386. *
  14387. * return false;
  14388. * }
  14389. *
  14390. * const resource = new Resource({
  14391. * url: 'http://server.com/path/to/resource.json',
  14392. * proxy: new DefaultProxy('/proxy/'),
  14393. * headers: {
  14394. * 'X-My-Header': 'valueOfHeader'
  14395. * },
  14396. * queryParameters: {
  14397. * 'access_token': '123-435-456-000'
  14398. * },
  14399. * retryCallback: refreshTokenRetryCallback,
  14400. * retryAttempts: 1
  14401. * });
  14402. * @param options - A url or an object describing initialization options
  14403. */
  14404. export class Resource {
  14405. constructor(options: string | Resource.ConstructorOptions);
  14406. /**
  14407. * Additional HTTP headers that will be sent with the request.
  14408. */
  14409. headers: any;
  14410. /**
  14411. * A Request object that will be used. Intended for internal use only.
  14412. */
  14413. request: Request;
  14414. /**
  14415. * A proxy to be used when loading the resource.
  14416. */
  14417. proxy: Proxy;
  14418. /**
  14419. * 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.
  14420. */
  14421. retryCallback: (...params: any[]) => any;
  14422. /**
  14423. * The number of times the retryCallback should be called before giving up.
  14424. */
  14425. retryAttempts: number;
  14426. /**
  14427. * Returns true if blobs are supported.
  14428. */
  14429. static readonly isBlobSupported: boolean;
  14430. /**
  14431. * Query parameters appended to the url.
  14432. */
  14433. readonly queryParameters: any;
  14434. /**
  14435. * The key/value pairs used to replace template parameters in the url.
  14436. */
  14437. readonly templateValues: any;
  14438. /**
  14439. * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
  14440. */
  14441. url: string;
  14442. /**
  14443. * The file extension of the resource.
  14444. */
  14445. readonly extension: string;
  14446. /**
  14447. * True if the Resource refers to a data URI.
  14448. */
  14449. isDataUri: boolean;
  14450. /**
  14451. * True if the Resource refers to a blob URI.
  14452. */
  14453. isBlobUri: boolean;
  14454. /**
  14455. * True if the Resource refers to a cross origin URL.
  14456. */
  14457. isCrossOriginUrl: boolean;
  14458. /**
  14459. * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
  14460. */
  14461. hasHeaders: boolean;
  14462. /**
  14463. * Override Object#toString so that implicit string conversion gives the
  14464. * complete URL represented by this Resource.
  14465. * @returns The URL represented by this Resource
  14466. */
  14467. toString(): string;
  14468. /**
  14469. * Returns the url, optional with the query string and processed by a proxy.
  14470. * @param [query = false] - If true, the query string is included.
  14471. * @param [proxy = false] - If true, the url is processed by the proxy object, if defined.
  14472. * @returns The url with all the requested components.
  14473. */
  14474. getUrlComponent(query?: boolean, proxy?: boolean): string;
  14475. /**
  14476. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14477. * 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.
  14478. * @param params - The query parameters
  14479. * @param [useAsDefault = false] - If true the params will be used as the default values, so they will only be set if they are undefined.
  14480. */
  14481. setQueryParameters(params: any, useAsDefault?: boolean): void;
  14482. /**
  14483. * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
  14484. * as opposed to adding them one at a time to the queryParameters property.
  14485. * @param params - The query parameters
  14486. */
  14487. appendQueryParameters(params: any): void;
  14488. /**
  14489. * Combines the specified object and the existing template values. This allows you to add many values at once,
  14490. * 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.
  14491. * @param template - The template values
  14492. * @param [useAsDefault = false] - If true the values will be used as the default values, so they will only be set if they are undefined.
  14493. */
  14494. setTemplateValues(template: any, useAsDefault?: boolean): void;
  14495. /**
  14496. * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
  14497. * @param options - An object with the following properties
  14498. * @param [options.url] - The url that will be resolved relative to the url of the current instance.
  14499. * @param [options.queryParameters] - An object containing query parameters that will be combined with those of the current instance.
  14500. * @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.
  14501. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14502. * @param [options.proxy] - A proxy to be used when loading the resource.
  14503. * @param [options.retryCallback] - The function to call when loading the resource fails.
  14504. * @param [options.retryAttempts] - The number of times the retryCallback should be called before giving up.
  14505. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14506. * @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.
  14507. * @returns The resource derived from the current one.
  14508. */
  14509. getDerivedResource(options: {
  14510. url?: string;
  14511. queryParameters?: any;
  14512. templateValues?: any;
  14513. headers?: any;
  14514. proxy?: Proxy;
  14515. retryCallback?: Resource.RetryCallback;
  14516. retryAttempts?: number;
  14517. request?: Request;
  14518. preserveQueryParameters?: boolean;
  14519. }): Resource;
  14520. /**
  14521. * Duplicates a Resource instance.
  14522. * @param [result] - The object onto which to store the result.
  14523. * @returns The modified result parameter or a new Resource instance if one was not provided.
  14524. */
  14525. clone(result?: Resource): Resource;
  14526. /**
  14527. * Returns the base path of the Resource.
  14528. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  14529. * @returns The base URI of the resource
  14530. */
  14531. getBaseUri(includeQuery?: boolean): string;
  14532. /**
  14533. * Appends a forward slash to the URL.
  14534. */
  14535. appendForwardSlash(): void;
  14536. /**
  14537. * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
  14538. * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
  14539. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14540. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14541. * @example
  14542. * // load a single URL asynchronously
  14543. * resource.fetchArrayBuffer().then(function(arrayBuffer) {
  14544. * // use the data
  14545. * }).catch(function(error) {
  14546. * // an error occurred
  14547. * });
  14548. * @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.
  14549. */
  14550. fetchArrayBuffer(): Promise<ArrayBuffer> | undefined;
  14551. /**
  14552. * Creates a Resource and calls fetchArrayBuffer() on it.
  14553. * @param options - A url or an object with the following properties
  14554. * @param options.url - The url of the resource.
  14555. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14556. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14557. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14558. * @param [options.proxy] - A proxy to be used when loading the resource.
  14559. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14560. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14561. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14562. * @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.
  14563. */
  14564. static fetchArrayBuffer(options: {
  14565. url: string;
  14566. queryParameters?: any;
  14567. templateValues?: any;
  14568. headers?: any;
  14569. proxy?: Proxy;
  14570. retryCallback?: Resource.RetryCallback;
  14571. retryAttempts?: number;
  14572. request?: Request;
  14573. }): Promise<ArrayBuffer> | undefined;
  14574. /**
  14575. * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
  14576. * a Blob once loaded, or reject if the resource failed to load. The data is loaded
  14577. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14578. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14579. * @example
  14580. * // load a single URL asynchronously
  14581. * resource.fetchBlob().then(function(blob) {
  14582. * // use the data
  14583. * }).catch(function(error) {
  14584. * // an error occurred
  14585. * });
  14586. * @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.
  14587. */
  14588. fetchBlob(): Promise<Blob> | undefined;
  14589. /**
  14590. * Creates a Resource and calls fetchBlob() on it.
  14591. * @param options - A url or an object with the following properties
  14592. * @param options.url - The url of the resource.
  14593. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14594. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14595. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14596. * @param [options.proxy] - A proxy to be used when loading the resource.
  14597. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14598. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14599. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14600. * @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.
  14601. */
  14602. static fetchBlob(options: {
  14603. url: string;
  14604. queryParameters?: any;
  14605. templateValues?: any;
  14606. headers?: any;
  14607. proxy?: Proxy;
  14608. retryCallback?: Resource.RetryCallback;
  14609. retryAttempts?: number;
  14610. request?: Request;
  14611. }): Promise<Blob> | undefined;
  14612. /**
  14613. * Asynchronously loads the given image resource. Returns a promise that will resolve to
  14614. * 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
  14615. * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
  14616. * @example
  14617. * // load a single image asynchronously
  14618. * resource.fetchImage().then(function(image) {
  14619. * // use the loaded image
  14620. * }).catch(function(error) {
  14621. * // an error occurred
  14622. * });
  14623. *
  14624. * // load several images in parallel
  14625. * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
  14626. * // images is an array containing all the loaded images
  14627. * });
  14628. * @param [options] - An object with the following properties.
  14629. * @param [options.preferBlob = false] - If true, we will load the image via a blob.
  14630. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14631. * @param [options.flipY = false] - If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.
  14632. * @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>.
  14633. * @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.
  14634. */
  14635. fetchImage(options?: {
  14636. preferBlob?: boolean;
  14637. preferImageBitmap?: boolean;
  14638. flipY?: boolean;
  14639. skipColorSpaceConversion?: boolean;
  14640. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  14641. /**
  14642. * Creates a Resource and calls fetchImage() on it.
  14643. * @param options - A url or an object with the following properties
  14644. * @param options.url - The url of the resource.
  14645. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14646. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14647. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14648. * @param [options.proxy] - A proxy to be used when loading the resource.
  14649. * @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>.
  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.preferBlob = false] - If true, we will load the image via a blob.
  14654. * @param [options.preferImageBitmap = false] - If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.
  14655. * @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>.
  14656. * @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.
  14657. */
  14658. static fetchImage(options: {
  14659. url: string;
  14660. queryParameters?: any;
  14661. templateValues?: any;
  14662. headers?: any;
  14663. proxy?: Proxy;
  14664. flipY?: boolean;
  14665. retryCallback?: Resource.RetryCallback;
  14666. retryAttempts?: number;
  14667. request?: Request;
  14668. preferBlob?: boolean;
  14669. preferImageBitmap?: boolean;
  14670. skipColorSpaceConversion?: boolean;
  14671. }): Promise<ImageBitmap | HTMLImageElement> | undefined;
  14672. /**
  14673. * Asynchronously loads the given resource as text. Returns a promise that will resolve to
  14674. * a String once loaded, or reject if the resource failed to load. The data is loaded
  14675. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14676. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14677. * @example
  14678. * // load text from a URL, setting a custom header
  14679. * const resource = new Resource({
  14680. * url: 'http://someUrl.com/someJson.txt',
  14681. * headers: {
  14682. * 'X-Custom-Header' : 'some value'
  14683. * }
  14684. * });
  14685. * resource.fetchText().then(function(text) {
  14686. * // Do something with the text
  14687. * }).catch(function(error) {
  14688. * // an error occurred
  14689. * });
  14690. * @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.
  14691. */
  14692. fetchText(): Promise<string> | undefined;
  14693. /**
  14694. * Creates a Resource and calls fetchText() on it.
  14695. * @param options - A url or an object with the following properties
  14696. * @param options.url - The url of the resource.
  14697. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14698. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14699. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14700. * @param [options.proxy] - A proxy to be used when loading the resource.
  14701. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14702. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14703. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14704. * @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.
  14705. */
  14706. static fetchText(options: {
  14707. url: string;
  14708. queryParameters?: any;
  14709. templateValues?: any;
  14710. headers?: any;
  14711. proxy?: Proxy;
  14712. retryCallback?: Resource.RetryCallback;
  14713. retryAttempts?: number;
  14714. request?: Request;
  14715. }): Promise<string> | undefined;
  14716. /**
  14717. * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
  14718. * a JSON object once loaded, or reject if the resource failed to load. The data is loaded
  14719. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14720. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
  14721. * adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not
  14722. * already specified.
  14723. * @example
  14724. * resource.fetchJson().then(function(jsonData) {
  14725. * // Do something with the JSON object
  14726. * }).catch(function(error) {
  14727. * // an error occurred
  14728. * });
  14729. * @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.
  14730. */
  14731. fetchJson(): Promise<any> | undefined;
  14732. /**
  14733. * Creates a Resource and calls fetchJson() on it.
  14734. * @param options - A url or an object with the following properties
  14735. * @param options.url - The url of the resource.
  14736. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14737. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14738. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14739. * @param [options.proxy] - A proxy to be used when loading the resource.
  14740. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14741. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14742. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14743. * @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.
  14744. */
  14745. static fetchJson(options: {
  14746. url: string;
  14747. queryParameters?: any;
  14748. templateValues?: any;
  14749. headers?: any;
  14750. proxy?: Proxy;
  14751. retryCallback?: Resource.RetryCallback;
  14752. retryAttempts?: number;
  14753. request?: Request;
  14754. }): Promise<any> | undefined;
  14755. /**
  14756. * Asynchronously loads the given resource as XML. Returns a promise that will resolve to
  14757. * an XML Document once loaded, or reject if the resource failed to load. The data is loaded
  14758. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14759. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14760. * @example
  14761. * // load XML from a URL, setting a custom header
  14762. * Cesium.loadXML('http://someUrl.com/someXML.xml', {
  14763. * 'X-Custom-Header' : 'some value'
  14764. * }).then(function(document) {
  14765. * // Do something with the document
  14766. * }).catch(function(error) {
  14767. * // an error occurred
  14768. * });
  14769. * @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.
  14770. */
  14771. fetchXML(): Promise<XMLDocument> | undefined;
  14772. /**
  14773. * Creates a Resource and calls fetchXML() on it.
  14774. * @param options - A url or an object with the following properties
  14775. * @param options.url - The url of the resource.
  14776. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14777. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14778. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14779. * @param [options.proxy] - A proxy to be used when loading the resource.
  14780. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14781. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14782. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14783. * @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.
  14784. */
  14785. static fetchXML(options: {
  14786. url: string;
  14787. queryParameters?: any;
  14788. templateValues?: any;
  14789. headers?: any;
  14790. proxy?: Proxy;
  14791. retryCallback?: Resource.RetryCallback;
  14792. retryAttempts?: number;
  14793. request?: Request;
  14794. }): Promise<XMLDocument> | undefined;
  14795. /**
  14796. * Requests a resource using JSONP.
  14797. * @example
  14798. * // load a data asynchronously
  14799. * resource.fetchJsonp().then(function(data) {
  14800. * // use the loaded data
  14801. * }).catch(function(error) {
  14802. * // an error occurred
  14803. * });
  14804. * @param [callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14805. * @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.
  14806. */
  14807. fetchJsonp(callbackParameterName?: string): Promise<any> | undefined;
  14808. /**
  14809. * Creates a Resource from a URL and calls fetchJsonp() on it.
  14810. * @param options - A url or an object with the following properties
  14811. * @param options.url - The url of the resource.
  14812. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14813. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14814. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14815. * @param [options.proxy] - A proxy to be used when loading the resource.
  14816. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14817. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14818. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14819. * @param [options.callbackParameterName = 'callback'] - The callback parameter name that the server expects.
  14820. * @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.
  14821. */
  14822. static fetchJsonp(options: {
  14823. url: string;
  14824. queryParameters?: any;
  14825. templateValues?: any;
  14826. headers?: any;
  14827. proxy?: Proxy;
  14828. retryCallback?: Resource.RetryCallback;
  14829. retryAttempts?: number;
  14830. request?: Request;
  14831. callbackParameterName?: string;
  14832. }): Promise<any> | undefined;
  14833. /**
  14834. * Asynchronously loads the given resource. Returns a promise that will resolve to
  14835. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14836. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14837. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
  14838. * the more specific functions eg. fetchJson, fetchBlob, etc.
  14839. * @example
  14840. * resource.fetch()
  14841. * .then(function(body) {
  14842. * // use the data
  14843. * }).catch(function(error) {
  14844. * // an error occurred
  14845. * });
  14846. * @param [options] - Object with the following properties:
  14847. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14848. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14849. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14850. * @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.
  14851. */
  14852. fetch(options?: {
  14853. responseType?: string;
  14854. headers?: any;
  14855. overrideMimeType?: string;
  14856. }): Promise<any> | undefined;
  14857. /**
  14858. * Creates a Resource from a URL and calls fetch() on it.
  14859. * @param options - A url or an object with the following properties
  14860. * @param options.url - The url of the resource.
  14861. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14862. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14863. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14864. * @param [options.proxy] - A proxy to be used when loading the resource.
  14865. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14866. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14867. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14868. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14869. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14870. * @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.
  14871. */
  14872. static fetch(options: {
  14873. url: string;
  14874. queryParameters?: any;
  14875. templateValues?: any;
  14876. headers?: any;
  14877. proxy?: Proxy;
  14878. retryCallback?: Resource.RetryCallback;
  14879. retryAttempts?: number;
  14880. request?: Request;
  14881. responseType?: string;
  14882. overrideMimeType?: string;
  14883. }): Promise<any> | undefined;
  14884. /**
  14885. * Asynchronously deletes the given resource. Returns a promise that will resolve to
  14886. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14887. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14888. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14889. * @example
  14890. * resource.delete()
  14891. * .then(function(body) {
  14892. * // use the data
  14893. * }).catch(function(error) {
  14894. * // an error occurred
  14895. * });
  14896. * @param [options] - Object with the following properties:
  14897. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14898. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14899. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14900. * @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.
  14901. */
  14902. delete(options?: {
  14903. responseType?: string;
  14904. headers?: any;
  14905. overrideMimeType?: string;
  14906. }): Promise<any> | undefined;
  14907. /**
  14908. * Creates a Resource from a URL and calls delete() on it.
  14909. * @param options - A url or an object with the following properties
  14910. * @param options.url - The url of the resource.
  14911. * @param [options.data] - Data that is posted with the resource.
  14912. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14913. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14914. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14915. * @param [options.proxy] - A proxy to be used when loading the resource.
  14916. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14917. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14918. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14919. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14920. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14921. * @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.
  14922. */
  14923. static delete(options: {
  14924. url: string;
  14925. data?: any;
  14926. queryParameters?: any;
  14927. templateValues?: any;
  14928. headers?: any;
  14929. proxy?: Proxy;
  14930. retryCallback?: Resource.RetryCallback;
  14931. retryAttempts?: number;
  14932. request?: Request;
  14933. responseType?: string;
  14934. overrideMimeType?: string;
  14935. }): Promise<any> | undefined;
  14936. /**
  14937. * Asynchronously gets headers the given resource. Returns a promise that will resolve to
  14938. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14939. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14940. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14941. * @example
  14942. * resource.head()
  14943. * .then(function(headers) {
  14944. * // use the data
  14945. * }).catch(function(error) {
  14946. * // an error occurred
  14947. * });
  14948. * @param [options] - Object with the following properties:
  14949. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14950. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  14951. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14952. * @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.
  14953. */
  14954. head(options?: {
  14955. responseType?: string;
  14956. headers?: any;
  14957. overrideMimeType?: string;
  14958. }): Promise<any> | undefined;
  14959. /**
  14960. * Creates a Resource from a URL and calls head() on it.
  14961. * @param options - A url or an object with the following properties
  14962. * @param options.url - The url of the resource.
  14963. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  14964. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  14965. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  14966. * @param [options.proxy] - A proxy to be used when loading the resource.
  14967. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  14968. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  14969. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  14970. * @param [options.responseType] - The type of response. This controls the type of item returned.
  14971. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  14972. * @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.
  14973. */
  14974. static head(options: {
  14975. url: string;
  14976. queryParameters?: any;
  14977. templateValues?: any;
  14978. headers?: any;
  14979. proxy?: Proxy;
  14980. retryCallback?: Resource.RetryCallback;
  14981. retryAttempts?: number;
  14982. request?: Request;
  14983. responseType?: string;
  14984. overrideMimeType?: string;
  14985. }): Promise<any> | undefined;
  14986. /**
  14987. * Asynchronously gets options the given resource. Returns a promise that will resolve to
  14988. * the result once loaded, or reject if the resource failed to load. The data is loaded
  14989. * using XMLHttpRequest, which means that in order to make requests to another origin,
  14990. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  14991. * @example
  14992. * resource.options()
  14993. * .then(function(headers) {
  14994. * // use the data
  14995. * }).catch(function(error) {
  14996. * // an error occurred
  14997. * });
  14998. * @param [options] - Object with the following properties:
  14999. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15000. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  15001. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15002. * @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.
  15003. */
  15004. options(options?: {
  15005. responseType?: string;
  15006. headers?: any;
  15007. overrideMimeType?: string;
  15008. }): Promise<any> | undefined;
  15009. /**
  15010. * Creates a Resource from a URL and calls options() on it.
  15011. * @param options - A url or an object with the following properties
  15012. * @param options.url - The url of the resource.
  15013. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15014. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15015. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15016. * @param [options.proxy] - A proxy to be used when loading the resource.
  15017. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15018. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15019. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15020. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15021. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15022. * @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.
  15023. */
  15024. static options(options: {
  15025. url: string;
  15026. queryParameters?: any;
  15027. templateValues?: any;
  15028. headers?: any;
  15029. proxy?: Proxy;
  15030. retryCallback?: Resource.RetryCallback;
  15031. retryAttempts?: number;
  15032. request?: Request;
  15033. responseType?: string;
  15034. overrideMimeType?: string;
  15035. }): Promise<any> | undefined;
  15036. /**
  15037. * Asynchronously posts data to the given resource. Returns a promise that will resolve to
  15038. * the result once loaded, or reject if the resource failed to load. The data is loaded
  15039. * using XMLHttpRequest, which means that in order to make requests to another origin,
  15040. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  15041. * @example
  15042. * resource.post(data)
  15043. * .then(function(result) {
  15044. * // use the result
  15045. * }).catch(function(error) {
  15046. * // an error occurred
  15047. * });
  15048. * @param data - Data that is posted with the resource.
  15049. * @param [options] - Object with the following properties:
  15050. * @param [options.data] - Data that is posted with the resource.
  15051. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15052. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  15053. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15054. * @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.
  15055. */
  15056. post(data: any, options?: {
  15057. data?: any;
  15058. responseType?: string;
  15059. headers?: any;
  15060. overrideMimeType?: string;
  15061. }): Promise<any> | undefined;
  15062. /**
  15063. * Creates a Resource from a URL and calls post() on it.
  15064. * @param options - A url or an object with the following properties
  15065. * @param options.url - The url of the resource.
  15066. * @param options.data - Data that is posted with the resource.
  15067. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15068. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15069. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15070. * @param [options.proxy] - A proxy to be used when loading the resource.
  15071. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15072. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15073. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15074. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15075. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15076. * @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.
  15077. */
  15078. static post(options: {
  15079. url: string;
  15080. data: any;
  15081. queryParameters?: any;
  15082. templateValues?: any;
  15083. headers?: any;
  15084. proxy?: Proxy;
  15085. retryCallback?: Resource.RetryCallback;
  15086. retryAttempts?: number;
  15087. request?: Request;
  15088. responseType?: string;
  15089. overrideMimeType?: string;
  15090. }): Promise<any> | undefined;
  15091. /**
  15092. * Asynchronously puts data to the given resource. Returns a promise that will resolve to
  15093. * the result once loaded, or reject if the resource failed to load. The data is loaded
  15094. * using XMLHttpRequest, which means that in order to make requests to another origin,
  15095. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  15096. * @example
  15097. * resource.put(data)
  15098. * .then(function(result) {
  15099. * // use the result
  15100. * }).catch(function(error) {
  15101. * // an error occurred
  15102. * });
  15103. * @param data - Data that is posted with the resource.
  15104. * @param [options] - Object with the following properties:
  15105. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15106. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  15107. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15108. * @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.
  15109. */
  15110. put(data: any, options?: {
  15111. responseType?: string;
  15112. headers?: any;
  15113. overrideMimeType?: string;
  15114. }): Promise<any> | undefined;
  15115. /**
  15116. * Creates a Resource from a URL and calls put() on it.
  15117. * @param options - A url or an object with the following properties
  15118. * @param options.url - The url of the resource.
  15119. * @param options.data - Data that is posted with the resource.
  15120. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15121. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15122. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15123. * @param [options.proxy] - A proxy to be used when loading the resource.
  15124. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15125. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15126. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15127. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15128. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15129. * @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.
  15130. */
  15131. static put(options: {
  15132. url: string;
  15133. data: any;
  15134. queryParameters?: any;
  15135. templateValues?: any;
  15136. headers?: any;
  15137. proxy?: Proxy;
  15138. retryCallback?: Resource.RetryCallback;
  15139. retryAttempts?: number;
  15140. request?: Request;
  15141. responseType?: string;
  15142. overrideMimeType?: string;
  15143. }): Promise<any> | undefined;
  15144. /**
  15145. * Asynchronously patches data to the given resource. Returns a promise that will resolve to
  15146. * the result once loaded, or reject if the resource failed to load. The data is loaded
  15147. * using XMLHttpRequest, which means that in order to make requests to another origin,
  15148. * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
  15149. * @example
  15150. * resource.patch(data)
  15151. * .then(function(result) {
  15152. * // use the result
  15153. * }).catch(function(error) {
  15154. * // an error occurred
  15155. * });
  15156. * @param data - Data that is posted with the resource.
  15157. * @param [options] - Object with the following properties:
  15158. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15159. * @param [options.headers] - Additional HTTP headers to send with the request, if any.
  15160. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15161. * @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.
  15162. */
  15163. patch(data: any, options?: {
  15164. responseType?: string;
  15165. headers?: any;
  15166. overrideMimeType?: string;
  15167. }): Promise<any> | undefined;
  15168. /**
  15169. * Creates a Resource from a URL and calls patch() on it.
  15170. * @param options - A url or an object with the following properties
  15171. * @param options.url - The url of the resource.
  15172. * @param options.data - Data that is posted with the resource.
  15173. * @param [options.queryParameters] - An object containing query parameters that will be sent when retrieving the resource.
  15174. * @param [options.templateValues] - Key/Value pairs that are used to replace template values (eg. {x}).
  15175. * @param [options.headers = {}] - Additional HTTP headers that will be sent.
  15176. * @param [options.proxy] - A proxy to be used when loading the resource.
  15177. * @param [options.retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
  15178. * @param [options.retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
  15179. * @param [options.request] - A Request object that will be used. Intended for internal use only.
  15180. * @param [options.responseType] - The type of response. This controls the type of item returned.
  15181. * @param [options.overrideMimeType] - Overrides the MIME type returned by the server.
  15182. * @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.
  15183. */
  15184. static patch(options: {
  15185. url: string;
  15186. data: any;
  15187. queryParameters?: any;
  15188. templateValues?: any;
  15189. headers?: any;
  15190. proxy?: Proxy;
  15191. retryCallback?: Resource.RetryCallback;
  15192. retryAttempts?: number;
  15193. request?: Request;
  15194. responseType?: string;
  15195. overrideMimeType?: string;
  15196. }): Promise<any> | undefined;
  15197. /**
  15198. * A resource instance initialized to the current browser location
  15199. */
  15200. static readonly DEFAULT: Resource;
  15201. }
  15202. /**
  15203. * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
  15204. * out of memory, could not compile shader, etc. If a function may throw this
  15205. * exception, the calling code should be prepared to catch it.
  15206. * <br /><br />
  15207. * On the other hand, a {@link DeveloperError} indicates an exception due
  15208. * to a developer error, e.g., invalid argument, that usually indicates a bug in the
  15209. * calling code.
  15210. * @param [message] - The error message for this exception.
  15211. */
  15212. export class RuntimeError extends Error {
  15213. constructor(message?: string);
  15214. /**
  15215. * 'RuntimeError' indicating that this exception was thrown due to a runtime error.
  15216. */
  15217. readonly name: string;
  15218. /**
  15219. * The explanation for why this exception was thrown.
  15220. */
  15221. readonly message: string;
  15222. /**
  15223. * The stack trace of this exception, if available.
  15224. */
  15225. readonly stack: string;
  15226. }
  15227. export namespace ScreenSpaceEventHandler {
  15228. /**
  15229. * An Event that occurs at a single position on screen.
  15230. */
  15231. type PositionedEvent = {
  15232. position: Cartesian2;
  15233. };
  15234. /**
  15235. * @param event - The event which triggered the listener
  15236. */
  15237. type PositionedEventCallback = (event: ScreenSpaceEventHandler.PositionedEvent) => void;
  15238. /**
  15239. * An Event that starts at one position and ends at another.
  15240. */
  15241. type MotionEvent = {
  15242. startPosition: Cartesian2;
  15243. endPosition: Cartesian2;
  15244. };
  15245. /**
  15246. * @param event - The event which triggered the listener
  15247. */
  15248. type MotionEventCallback = (event: ScreenSpaceEventHandler.MotionEvent) => void;
  15249. /**
  15250. * An Event that occurs at a two positions on screen.
  15251. */
  15252. type TwoPointEvent = {
  15253. position1: Cartesian2;
  15254. position2: Cartesian2;
  15255. };
  15256. /**
  15257. * @param event - The event which triggered the listener
  15258. */
  15259. type TwoPointEventCallback = (event: ScreenSpaceEventHandler.TwoPointEvent) => void;
  15260. /**
  15261. * An Event that starts at a two positions on screen and moves to two other positions.
  15262. */
  15263. type TwoPointMotionEvent = {
  15264. position1: Cartesian2;
  15265. position2: Cartesian2;
  15266. previousPosition1: Cartesian2;
  15267. previousPosition2: Cartesian2;
  15268. };
  15269. /**
  15270. * @param event - The event which triggered the listener
  15271. */
  15272. type TwoPointMotionEventCallback = (event: ScreenSpaceEventHandler.TwoPointMotionEvent) => void;
  15273. /**
  15274. * @param delta - The amount that the mouse wheel moved
  15275. */
  15276. type WheelEventCallback = (delta: number) => void;
  15277. }
  15278. /**
  15279. * Handles user input events. Custom functions can be added to be executed on
  15280. * when the user enters input.
  15281. * @param [element = document] - The element to add events to.
  15282. */
  15283. export class ScreenSpaceEventHandler {
  15284. constructor(element?: HTMLCanvasElement);
  15285. /**
  15286. * Set a function to be executed on an input event.
  15287. * @param action - Function to be executed when the input event occurs.
  15288. * @param type - The ScreenSpaceEventType of input event.
  15289. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15290. * event occurs.
  15291. */
  15292. setInputAction(action: ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback, type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): void;
  15293. /**
  15294. * Returns the function to be executed on an input event.
  15295. * @param type - The ScreenSpaceEventType of input event.
  15296. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15297. * event occurs.
  15298. * @returns The function to be executed on an input event.
  15299. */
  15300. getInputAction(type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback;
  15301. /**
  15302. * Removes the function to be executed on an input event.
  15303. * @param type - The ScreenSpaceEventType of input event.
  15304. * @param [modifier] - A KeyboardEventModifier key that is held when a <code>type</code>
  15305. * event occurs.
  15306. */
  15307. removeInputAction(type: ScreenSpaceEventType, modifier?: KeyboardEventModifier): void;
  15308. /**
  15309. * Returns true if this object was destroyed; otherwise, false.
  15310. * <br /><br />
  15311. * If this object was destroyed, it should not be used; calling any function other than
  15312. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15313. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  15314. */
  15315. isDestroyed(): boolean;
  15316. /**
  15317. * Removes listeners held by this object.
  15318. * <br /><br />
  15319. * Once an object is destroyed, it should not be used; calling any function other than
  15320. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  15321. * assign the return value (<code>undefined</code>) to the object as done in the example.
  15322. * @example
  15323. * handler = handler && handler.destroy();
  15324. */
  15325. destroy(): void;
  15326. /**
  15327. * The amount of time, in milliseconds, that mouse events will be disabled after
  15328. * receiving any touch events, such that any emulated mouse events will be ignored.
  15329. */
  15330. static mouseEmulationIgnoreMilliseconds: number;
  15331. /**
  15332. * The amount of time, in milliseconds, before a touch on the screen becomes a
  15333. * touch and hold.
  15334. */
  15335. static touchHoldDelayMilliseconds: number;
  15336. }
  15337. /**
  15338. * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down.
  15339. */
  15340. export enum ScreenSpaceEventType {
  15341. /**
  15342. * Represents a mouse left button down event.
  15343. */
  15344. LEFT_DOWN = 0,
  15345. /**
  15346. * Represents a mouse left button up event.
  15347. */
  15348. LEFT_UP = 1,
  15349. /**
  15350. * Represents a mouse left click event.
  15351. */
  15352. LEFT_CLICK = 2,
  15353. /**
  15354. * Represents a mouse left double click event.
  15355. */
  15356. LEFT_DOUBLE_CLICK = 3,
  15357. /**
  15358. * Represents a mouse left button down event.
  15359. */
  15360. RIGHT_DOWN = 5,
  15361. /**
  15362. * Represents a mouse right button up event.
  15363. */
  15364. RIGHT_UP = 6,
  15365. /**
  15366. * Represents a mouse right click event.
  15367. */
  15368. RIGHT_CLICK = 7,
  15369. /**
  15370. * Represents a mouse middle button down event.
  15371. */
  15372. MIDDLE_DOWN = 10,
  15373. /**
  15374. * Represents a mouse middle button up event.
  15375. */
  15376. MIDDLE_UP = 11,
  15377. /**
  15378. * Represents a mouse middle click event.
  15379. */
  15380. MIDDLE_CLICK = 12,
  15381. /**
  15382. * Represents a mouse move event.
  15383. */
  15384. MOUSE_MOVE = 15,
  15385. /**
  15386. * Represents a mouse wheel event.
  15387. */
  15388. WHEEL = 16,
  15389. /**
  15390. * Represents the start of a two-finger event on a touch surface.
  15391. */
  15392. PINCH_START = 17,
  15393. /**
  15394. * Represents the end of a two-finger event on a touch surface.
  15395. */
  15396. PINCH_END = 18,
  15397. /**
  15398. * Represents a change of a two-finger event on a touch surface.
  15399. */
  15400. PINCH_MOVE = 19
  15401. }
  15402. /**
  15403. * Value and type information for per-instance geometry attribute that determines if the geometry instance will be shown.
  15404. * @example
  15405. * const instance = new Cesium.GeometryInstance({
  15406. * geometry : new Cesium.BoxGeometry({
  15407. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
  15408. * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
  15409. * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
  15410. * }),
  15411. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  15412. * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
  15413. * id : 'box',
  15414. * attributes : {
  15415. * show : new Cesium.ShowGeometryInstanceAttribute(false)
  15416. * }
  15417. * });
  15418. * @param [show = true] - Determines if the geometry instance will be shown.
  15419. */
  15420. export class ShowGeometryInstanceAttribute {
  15421. constructor(show?: boolean);
  15422. /**
  15423. * The values for the attributes stored in a typed array.
  15424. */
  15425. value: Uint8Array;
  15426. /**
  15427. * The datatype of each component in the attribute, e.g., individual elements in
  15428. * {@link ColorGeometryInstanceAttribute#value}.
  15429. */
  15430. readonly componentDatatype: ComponentDatatype;
  15431. /**
  15432. * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
  15433. */
  15434. readonly componentsPerAttribute: number;
  15435. /**
  15436. * When <code>true</code> and <code>componentDatatype</code> is an integer format,
  15437. * indicate that the components should be mapped to the range [0, 1] (unsigned)
  15438. * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  15439. */
  15440. readonly normalize: boolean;
  15441. /**
  15442. * Converts a boolean show to a typed array that can be used to assign a show attribute.
  15443. * @example
  15444. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  15445. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true, attributes.show);
  15446. * @param show - The show value.
  15447. * @param [result] - The array to store the result in, if undefined a new instance will be created.
  15448. * @returns The modified result parameter or a new instance if result was undefined.
  15449. */
  15450. static toValue(show: boolean, result?: Uint8Array): Uint8Array;
  15451. }
  15452. /**
  15453. * Contains functions for finding the Cartesian coordinates of the sun and the moon in the
  15454. * Earth-centered inertial frame.
  15455. */
  15456. export namespace Simon1994PlanetaryPositions {
  15457. /**
  15458. * Computes the position of the Sun in the Earth-centered inertial frame
  15459. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15460. * @param [result] - The object onto which to store the result.
  15461. * @returns Calculated sun position
  15462. */
  15463. function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15464. /**
  15465. * Computes the position of the Moon in the Earth-centered inertial frame
  15466. * @param [julianDate] - The time at which to compute the Sun's position, if not provided the current system time is used.
  15467. * @param [result] - The object onto which to store the result.
  15468. * @returns Calculated moon position
  15469. */
  15470. function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3;
  15471. }
  15472. /**
  15473. * A description of a polyline modeled as a line strip; the first two positions define a line segment,
  15474. * and each additional position defines a line segment from the previous position.
  15475. * @example
  15476. * // A polyline with two connected line segments
  15477. * const polyline = new Cesium.SimplePolylineGeometry({
  15478. * positions : Cesium.Cartesian3.fromDegreesArray([
  15479. * 0.0, 0.0,
  15480. * 5.0, 0.0,
  15481. * 5.0, 5.0
  15482. * ])
  15483. * });
  15484. * const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
  15485. * @param options - Object with the following properties:
  15486. * @param options.positions - An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
  15487. * @param [options.colors] - An Array of {@link Color} defining the per vertex or per segment colors.
  15488. * @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.
  15489. * @param [options.arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  15490. * @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.
  15491. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid to be used as a reference.
  15492. */
  15493. export class SimplePolylineGeometry {
  15494. constructor(options: {
  15495. positions: Cartesian3[];
  15496. colors?: Color[];
  15497. colorsPerVertex?: boolean;
  15498. arcType?: ArcType;
  15499. granularity?: number;
  15500. ellipsoid?: Ellipsoid;
  15501. });
  15502. /**
  15503. * The number of elements used to pack the object into an array.
  15504. */
  15505. packedLength: number;
  15506. /**
  15507. * Stores the provided instance into the provided array.
  15508. * @param value - The value to pack.
  15509. * @param array - The array to pack into.
  15510. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15511. * @returns The array that was packed into
  15512. */
  15513. static pack(value: SimplePolylineGeometry, array: number[], startingIndex?: number): number[];
  15514. /**
  15515. * Retrieves an instance from a packed array.
  15516. * @param array - The packed array.
  15517. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15518. * @param [result] - The object into which to store the result.
  15519. * @returns The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
  15520. */
  15521. static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry;
  15522. /**
  15523. * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
  15524. * @param simplePolylineGeometry - A description of the polyline.
  15525. * @returns The computed vertices and indices.
  15526. */
  15527. static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry | undefined;
  15528. }
  15529. /**
  15530. * A description of a sphere centered at the origin.
  15531. * @example
  15532. * const sphere = new Cesium.SphereGeometry({
  15533. * radius : 100.0,
  15534. * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
  15535. * });
  15536. * const geometry = Cesium.SphereGeometry.createGeometry(sphere);
  15537. * @param [options] - Object with the following properties:
  15538. * @param [options.radius = 1.0] - The radius of the sphere.
  15539. * @param [options.stackPartitions = 64] - The number of times to partition the ellipsoid into stacks.
  15540. * @param [options.slicePartitions = 64] - The number of times to partition the ellipsoid into radial slices.
  15541. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  15542. */
  15543. export class SphereGeometry {
  15544. constructor(options?: {
  15545. radius?: number;
  15546. stackPartitions?: number;
  15547. slicePartitions?: number;
  15548. vertexFormat?: VertexFormat;
  15549. });
  15550. /**
  15551. * The number of elements used to pack the object into an array.
  15552. */
  15553. static packedLength: number;
  15554. /**
  15555. * Stores the provided instance into the provided array.
  15556. * @param value - The value to pack.
  15557. * @param array - The array to pack into.
  15558. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15559. * @returns The array that was packed into
  15560. */
  15561. static pack(value: SphereGeometry, array: number[], startingIndex?: number): number[];
  15562. /**
  15563. * Retrieves an instance from a packed array.
  15564. * @param array - The packed array.
  15565. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15566. * @param [result] - The object into which to store the result.
  15567. * @returns The modified result parameter or a new SphereGeometry instance if one was not provided.
  15568. */
  15569. static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry;
  15570. /**
  15571. * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
  15572. * @param sphereGeometry - A description of the sphere.
  15573. * @returns The computed vertices and indices.
  15574. */
  15575. static createGeometry(sphereGeometry: SphereGeometry): Geometry | undefined;
  15576. }
  15577. /**
  15578. * A description of the outline of a sphere.
  15579. * @example
  15580. * const sphere = new Cesium.SphereOutlineGeometry({
  15581. * radius : 100.0,
  15582. * stackPartitions : 6,
  15583. * slicePartitions: 5
  15584. * });
  15585. * const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
  15586. * @param [options] - Object with the following properties:
  15587. * @param [options.radius = 1.0] - The radius of the sphere.
  15588. * @param [options.stackPartitions = 10] - The count of stacks for the sphere (1 greater than the number of parallel lines).
  15589. * @param [options.slicePartitions = 8] - The count of slices for the sphere (Equal to the number of radial lines).
  15590. * @param [options.subdivisions = 200] - The number of points per line, determining the granularity of the curvature .
  15591. */
  15592. export class SphereOutlineGeometry {
  15593. constructor(options?: {
  15594. radius?: number;
  15595. stackPartitions?: number;
  15596. slicePartitions?: number;
  15597. subdivisions?: number;
  15598. });
  15599. /**
  15600. * The number of elements used to pack the object into an array.
  15601. */
  15602. static packedLength: number;
  15603. /**
  15604. * Stores the provided instance into the provided array.
  15605. * @param value - The value to pack.
  15606. * @param array - The array to pack into.
  15607. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  15608. * @returns The array that was packed into
  15609. */
  15610. static pack(value: SphereOutlineGeometry, array: number[], startingIndex?: number): number[];
  15611. /**
  15612. * Retrieves an instance from a packed array.
  15613. * @param array - The packed array.
  15614. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  15615. * @param [result] - The object into which to store the result.
  15616. * @returns The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
  15617. */
  15618. static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry;
  15619. /**
  15620. * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
  15621. * @param sphereGeometry - A description of the sphere outline.
  15622. * @returns The computed vertices and indices.
  15623. */
  15624. static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry | undefined;
  15625. }
  15626. /**
  15627. * A set of curvilinear 3-dimensional coordinates.
  15628. * @param [clock = 0.0] - The angular coordinate lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
  15629. * @param [cone = 0.0] - The angular coordinate measured from the positive z-axis and toward the negative z-axis.
  15630. * @param [magnitude = 1.0] - The linear coordinate measured from the origin.
  15631. */
  15632. export class Spherical {
  15633. constructor(clock?: number, cone?: number, magnitude?: number);
  15634. /**
  15635. * The clock component.
  15636. */
  15637. clock: number;
  15638. /**
  15639. * The cone component.
  15640. */
  15641. cone: number;
  15642. /**
  15643. * The magnitude component.
  15644. */
  15645. magnitude: number;
  15646. /**
  15647. * Converts the provided Cartesian3 into Spherical coordinates.
  15648. * @param cartesian3 - The Cartesian3 to be converted to Spherical.
  15649. * @param [result] - The object in which the result will be stored, if undefined a new instance will be created.
  15650. * @returns The modified result parameter, or a new instance if one was not provided.
  15651. */
  15652. static fromCartesian3(cartesian3: Cartesian3, result?: Spherical): Spherical;
  15653. /**
  15654. * Creates a duplicate of a Spherical.
  15655. * @param spherical - The spherical to clone.
  15656. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15657. * @returns The modified result parameter or a new instance if result was undefined. (Returns undefined if spherical is undefined)
  15658. */
  15659. static clone(spherical: Spherical, result?: Spherical): Spherical;
  15660. /**
  15661. * Computes the normalized version of the provided spherical.
  15662. * @param spherical - The spherical to be normalized.
  15663. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15664. * @returns The modified result parameter or a new instance if result was undefined.
  15665. */
  15666. static normalize(spherical: Spherical, result?: Spherical): Spherical;
  15667. /**
  15668. * Returns true if the first spherical is equal to the second spherical, false otherwise.
  15669. * @param left - The first Spherical to be compared.
  15670. * @param right - The second Spherical to be compared.
  15671. * @returns true if the first spherical is equal to the second spherical, false otherwise.
  15672. */
  15673. static equals(left: Spherical, right: Spherical): boolean;
  15674. /**
  15675. * Returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15676. * @param left - The first Spherical to be compared.
  15677. * @param right - The second Spherical to be compared.
  15678. * @param [epsilon = 0.0] - The epsilon to compare against.
  15679. * @returns true if the first spherical is within the provided epsilon of the second spherical, false otherwise.
  15680. */
  15681. static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean;
  15682. /**
  15683. * Returns true if this spherical is equal to the provided spherical, false otherwise.
  15684. * @param other - The Spherical to be compared.
  15685. * @returns true if this spherical is equal to the provided spherical, false otherwise.
  15686. */
  15687. equals(other: Spherical): boolean;
  15688. /**
  15689. * Creates a duplicate of this Spherical.
  15690. * @param [result] - The object to store the result into, if undefined a new instance will be created.
  15691. * @returns The modified result parameter or a new instance if result was undefined.
  15692. */
  15693. clone(result?: Spherical): Spherical;
  15694. /**
  15695. * Returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15696. * @param other - The Spherical to be compared.
  15697. * @param epsilon - The epsilon to compare against.
  15698. * @returns true if this spherical is within the provided epsilon of the provided spherical, false otherwise.
  15699. */
  15700. equalsEpsilon(other: Spherical, epsilon: number): boolean;
  15701. /**
  15702. * Returns a string representing this instance in the format (clock, cone, magnitude).
  15703. * @returns A string representing this instance.
  15704. */
  15705. toString(): string;
  15706. }
  15707. /**
  15708. * Creates a curve parameterized and evaluated by time. This type describes an interface
  15709. * and is not intended to be instantiated directly.
  15710. */
  15711. export class Spline {
  15712. constructor();
  15713. /**
  15714. * An array of times for the control points.
  15715. */
  15716. times: number[];
  15717. /**
  15718. * An array of control points.
  15719. */
  15720. points: Cartesian3[] | Quaternion[];
  15721. /**
  15722. * Evaluates the curve at a given time.
  15723. * @param time - The time at which to evaluate the curve.
  15724. * @param [result] - The object onto which to store the result.
  15725. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  15726. */
  15727. evaluate(time: number, result?: Cartesian3 | Quaternion | number[]): Cartesian3 | Quaternion | number[];
  15728. /**
  15729. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  15730. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  15731. * @param time - The time.
  15732. * @param startIndex - The index from which to start the search.
  15733. * @returns The index for the element at the start of the interval.
  15734. */
  15735. findTimeInterval(time: number, startIndex: number): number;
  15736. /**
  15737. * Wraps the given time to the period covered by the spline.
  15738. * @param time - The time.
  15739. * @returns The time, wrapped around the animation period.
  15740. */
  15741. wrapTime(time: number): number;
  15742. /**
  15743. * Clamps the given time to the period covered by the spline.
  15744. * @param time - The time.
  15745. * @returns The time, clamped to the animation period.
  15746. */
  15747. clampTime(time: number): number;
  15748. }
  15749. /**
  15750. * A spline that is composed of piecewise constants representing a step function.
  15751. * @example
  15752. * const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
  15753. * const spline = new Cesium.SteppedSpline({
  15754. * times : times,
  15755. * points : [
  15756. * new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
  15757. * new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
  15758. * new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
  15759. * new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
  15760. * new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
  15761. * ]
  15762. * });
  15763. *
  15764. * const p0 = spline.evaluate(times[0]);
  15765. * @param options - Object with the following properties:
  15766. * @param options.times - An array of strictly increasing, unit-less, floating-point times at each point. The values are in no way connected to the clock time. They are the parameterization for the curve.
  15767. * @param options.points - The array of control points.
  15768. */
  15769. export class SteppedSpline {
  15770. constructor(options: {
  15771. times: number[];
  15772. points: number[] | Cartesian3[] | Quaternion[];
  15773. });
  15774. /**
  15775. * An array of times for the control points.
  15776. */
  15777. readonly times: number[];
  15778. /**
  15779. * An array of control points.
  15780. */
  15781. readonly points: number[] | Cartesian3[] | Quaternion[];
  15782. /**
  15783. * Finds an index <code>i</code> in <code>times</code> such that the parameter
  15784. * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
  15785. * @param time - The time.
  15786. * @param startIndex - The index from which to start the search.
  15787. * @returns The index for the element at the start of the interval.
  15788. */
  15789. findTimeInterval(time: number, startIndex: number): number;
  15790. /**
  15791. * Wraps the given time to the period covered by the spline.
  15792. * @param time - The time.
  15793. * @returns The time, wrapped around to the updated animation.
  15794. */
  15795. wrapTime(time: number): number;
  15796. /**
  15797. * Clamps the given time to the period covered by the spline.
  15798. * @param time - The time.
  15799. * @returns The time, clamped to the animation period.
  15800. */
  15801. clampTime(time: number): number;
  15802. /**
  15803. * Evaluates the curve at a given time.
  15804. * @param time - The time at which to evaluate the curve.
  15805. * @param [result] - The object onto which to store the result.
  15806. * @returns The modified result parameter or a new instance of the point on the curve at the given time.
  15807. */
  15808. evaluate(time: number, result?: Cartesian3 | Quaternion): number | Cartesian3 | Quaternion;
  15809. }
  15810. /**
  15811. * A wrapper around a web worker that allows scheduling tasks for a given worker,
  15812. * returning results asynchronously via a promise.
  15813. *
  15814. * The Worker is not constructed until a task is scheduled.
  15815. * @param workerPath - The Url to the worker. This can either be an absolute path or relative to the Cesium Workers folder.
  15816. * @param [maximumActiveTasks = Number.POSITIVE_INFINITY] - The maximum number of active tasks. Once exceeded,
  15817. * scheduleTask will not queue any more tasks, allowing
  15818. * work to be rescheduled in future frames.
  15819. */
  15820. export class TaskProcessor {
  15821. constructor(workerPath: string, maximumActiveTasks?: number);
  15822. /**
  15823. * Schedule a task to be processed by the web worker asynchronously. If there are currently more
  15824. * tasks active than the maximum set by the constructor, will immediately return undefined.
  15825. * Otherwise, returns a promise that will resolve to the result posted back by the worker when
  15826. * finished.
  15827. * @example
  15828. * const taskProcessor = new Cesium.TaskProcessor('myWorkerPath');
  15829. * const promise = taskProcessor.scheduleTask({
  15830. * someParameter : true,
  15831. * another : 'hello'
  15832. * });
  15833. * if (!Cesium.defined(promise)) {
  15834. * // too many active tasks - try again later
  15835. * } else {
  15836. * promise.then(function(result) {
  15837. * // use the result of the task
  15838. * });
  15839. * }
  15840. * @param parameters - Any input data that will be posted to the worker.
  15841. * @param [transferableObjects] - An array of objects contained in parameters that should be
  15842. * transferred to the worker instead of copied.
  15843. * @returns Either a promise that will resolve to the result when available, or undefined
  15844. * if there are too many active tasks,
  15845. */
  15846. scheduleTask(parameters: any, transferableObjects?: object[]): Promise<object> | undefined;
  15847. /**
  15848. * Posts a message to a web worker with configuration to initialize loading
  15849. * and compiling a web assembly module asychronously, as well as an optional
  15850. * fallback JavaScript module to use if Web Assembly is not supported.
  15851. * @param [webAssemblyOptions] - An object with the following properties:
  15852. * @param [webAssemblyOptions.modulePath] - The path of the web assembly JavaScript wrapper module.
  15853. * @param [webAssemblyOptions.wasmBinaryFile] - The path of the web assembly binary file.
  15854. * @param [webAssemblyOptions.fallbackModulePath] - The path of the fallback JavaScript module to use if web assembly is not supported.
  15855. * @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.
  15856. */
  15857. initWebAssemblyModule(webAssemblyOptions?: {
  15858. modulePath?: string;
  15859. wasmBinaryFile?: string;
  15860. fallbackModulePath?: string;
  15861. }): Promise<object>;
  15862. /**
  15863. * Returns true if this object was destroyed; otherwise, false.
  15864. * <br /><br />
  15865. * If this object was destroyed, it should not be used; calling any function other than
  15866. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15867. * @returns True if this object was destroyed; otherwise, false.
  15868. */
  15869. isDestroyed(): boolean;
  15870. /**
  15871. * Destroys this object. This will immediately terminate the Worker.
  15872. * <br /><br />
  15873. * Once an object is destroyed, it should not be used; calling any function other than
  15874. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  15875. */
  15876. destroy(): void;
  15877. }
  15878. /**
  15879. * Terrain data for a single tile. This type describes an
  15880. * interface and is not intended to be instantiated directly.
  15881. */
  15882. export class TerrainData {
  15883. constructor();
  15884. /**
  15885. * An array of credits for this tile.
  15886. */
  15887. credits: Credit[];
  15888. /**
  15889. * The water mask included in this terrain data, if any. A water mask is a rectangular
  15890. * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
  15891. * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
  15892. */
  15893. waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
  15894. /**
  15895. * Computes the terrain height at a specified longitude and latitude.
  15896. * @param rectangle - The rectangle covered by this terrain data.
  15897. * @param longitude - The longitude in radians.
  15898. * @param latitude - The latitude in radians.
  15899. * @returns The terrain height at the specified position. If the position
  15900. * is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
  15901. * incorrect for positions far outside the rectangle.
  15902. */
  15903. interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
  15904. /**
  15905. * Determines if a given child tile is available, based on the
  15906. * {@link TerrainData#childTileMask}. The given child tile coordinates are assumed
  15907. * to be one of the four children of this tile. If non-child tile coordinates are
  15908. * given, the availability of the southeast child tile is returned.
  15909. * @param thisX - The tile X coordinate of this (the parent) tile.
  15910. * @param thisY - The tile Y coordinate of this (the parent) tile.
  15911. * @param childX - The tile X coordinate of the child tile to check for availability.
  15912. * @param childY - The tile Y coordinate of the child tile to check for availability.
  15913. * @returns True if the child tile is available; otherwise, false.
  15914. */
  15915. isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
  15916. /**
  15917. * Upsamples this terrain data for use by a descendant tile.
  15918. * @param tilingScheme - The tiling scheme of this terrain data.
  15919. * @param thisX - The X coordinate of this tile in the tiling scheme.
  15920. * @param thisY - The Y coordinate of this tile in the tiling scheme.
  15921. * @param thisLevel - The level of this tile in the tiling scheme.
  15922. * @param descendantX - The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15923. * @param descendantY - The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
  15924. * @param descendantLevel - The level within the tiling scheme of the descendant tile for which we are upsampling.
  15925. * @returns A promise for upsampled terrain data for the descendant tile,
  15926. * or undefined if too many asynchronous upsample operations are in progress and the request has been
  15927. * deferred.
  15928. */
  15929. upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData> | undefined;
  15930. /**
  15931. * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
  15932. * terrain data. If this value is false, the data was obtained from some other source, such
  15933. * as by downloading it from a remote server. This method should return true for instances
  15934. * returned from a call to {@link TerrainData#upsample}.
  15935. * @returns True if this instance was created by upsampling; otherwise, false.
  15936. */
  15937. wasCreatedByUpsampling(): boolean;
  15938. }
  15939. export namespace TerrainProvider {
  15940. /**
  15941. * A function that is called when an error occurs.
  15942. * @param err - An object holding details about the error that occurred.
  15943. */
  15944. type ErrorEvent = (this: TerrainProvider, err: TileProviderError) => void;
  15945. }
  15946. /**
  15947. * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
  15948. * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an
  15949. * interface and is not intended to be instantiated directly.
  15950. */
  15951. export class TerrainProvider {
  15952. constructor();
  15953. /**
  15954. * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
  15955. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  15956. * are passed an instance of {@link TileProviderError}.
  15957. */
  15958. readonly errorEvent: Event<TerrainProvider.ErrorEvent>;
  15959. /**
  15960. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  15961. * the source of the terrain. This function should
  15962. * not be called before {@link TerrainProvider#ready} returns true.
  15963. */
  15964. readonly credit: Credit;
  15965. /**
  15966. * Gets the tiling scheme used by the provider. This function should
  15967. * not be called before {@link TerrainProvider#ready} returns true.
  15968. */
  15969. readonly tilingScheme: TilingScheme;
  15970. /**
  15971. * Gets a value indicating whether or not the provider is ready for use.
  15972. */
  15973. readonly ready: boolean;
  15974. /**
  15975. * Gets a promise that resolves to true when the provider is ready for use.
  15976. */
  15977. readonly readyPromise: Promise<boolean>;
  15978. /**
  15979. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  15980. * indicates which areas of the globe are water rather than land, so they can be rendered
  15981. * as a reflective surface with animated waves. This function should not be
  15982. * called before {@link TerrainProvider#ready} returns true.
  15983. */
  15984. readonly hasWaterMask: boolean;
  15985. /**
  15986. * Gets a value indicating whether or not the requested tiles include vertex normals.
  15987. * This function should not be called before {@link TerrainProvider#ready} returns true.
  15988. */
  15989. readonly hasVertexNormals: boolean;
  15990. /**
  15991. * Gets an object that can be used to determine availability of terrain from this provider, such as
  15992. * at points and in rectangles. This function should not be called before
  15993. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  15994. * information is not available.
  15995. */
  15996. readonly availability: TileAvailability;
  15997. /**
  15998. * Gets a list of indices for a triangle mesh representing a regular grid. Calling
  15999. * this function multiple times with the same grid width and height returns the
  16000. * same list of indices. The total number of vertices must be less than or equal
  16001. * to 65536.
  16002. * @param width - The number of vertices in the regular grid in the horizontal direction.
  16003. * @param height - The number of vertices in the regular grid in the vertical direction.
  16004. * @returns The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
  16005. */
  16006. static getRegularGridIndices(width: number, height: number): Uint16Array | Uint32Array;
  16007. /**
  16008. * Specifies the quality of terrain created from heightmaps. A value of 1.0 will
  16009. * ensure that adjacent heightmap vertices are separated by no more than
  16010. * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.
  16011. * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
  16012. * screen pixels between adjacent heightmap vertices and thus rendering more quickly.
  16013. */
  16014. static heightmapTerrainQuality: number;
  16015. /**
  16016. * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
  16017. * @param ellipsoid - The ellipsoid to which the terrain is attached.
  16018. * @param tileImageWidth - The width, in pixels, of the heightmap associated with a single tile.
  16019. * @param numberOfTilesAtLevelZero - The number of tiles in the horizontal direction at tile level zero.
  16020. * @returns An estimated geometric error.
  16021. */
  16022. static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number;
  16023. /**
  16024. * Requests the geometry for a given tile. This function should not be called before
  16025. * {@link TerrainProvider#ready} returns true. The result must include terrain data and
  16026. * may optionally include a water mask and an indication of which child tiles are available.
  16027. * @param x - The X coordinate of the tile for which to request geometry.
  16028. * @param y - The Y coordinate of the tile for which to request geometry.
  16029. * @param level - The level of the tile for which to request geometry.
  16030. * @param [request] - The request object. Intended for internal use only.
  16031. * @returns A promise for the requested geometry. If this method
  16032. * returns undefined instead of a promise, it is an indication that too many requests are already
  16033. * pending and the request will be retried later.
  16034. */
  16035. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  16036. /**
  16037. * Gets the maximum geometric error allowed in a tile at a given level. This function should not be
  16038. * called before {@link TerrainProvider#ready} returns true.
  16039. * @param level - The tile level for which to get the maximum geometric error.
  16040. * @returns The maximum geometric error.
  16041. */
  16042. getLevelMaximumGeometricError(level: number): number;
  16043. /**
  16044. * Determines whether data for a tile is available to be loaded.
  16045. * @param x - The X coordinate of the tile for which to request geometry.
  16046. * @param y - The Y coordinate of the tile for which to request geometry.
  16047. * @param level - The level of the tile for which to request geometry.
  16048. * @returns Undefined if not supported by the terrain provider, otherwise true or false.
  16049. */
  16050. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  16051. /**
  16052. * Makes sure we load availability data for a tile
  16053. * @param x - The X coordinate of the tile for which to request geometry.
  16054. * @param y - The Y coordinate of the tile for which to request geometry.
  16055. * @param level - The level of the tile for which to request geometry.
  16056. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  16057. */
  16058. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  16059. }
  16060. /**
  16061. * Reports the availability of tiles in a {@link TilingScheme}.
  16062. * @param tilingScheme - The tiling scheme in which to report availability.
  16063. * @param maximumLevel - The maximum tile level that is potentially available.
  16064. */
  16065. export class TileAvailability {
  16066. constructor(tilingScheme: TilingScheme, maximumLevel: number);
  16067. /**
  16068. * Marks a rectangular range of tiles in a particular level as being available. For best performance,
  16069. * add your ranges in order of increasing level.
  16070. * @param level - The level.
  16071. * @param startX - The X coordinate of the first available tiles at the level.
  16072. * @param startY - The Y coordinate of the first available tiles at the level.
  16073. * @param endX - The X coordinate of the last available tiles at the level.
  16074. * @param endY - The Y coordinate of the last available tiles at the level.
  16075. */
  16076. addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void;
  16077. /**
  16078. * Determines the level of the most detailed tile covering the position. This function
  16079. * usually completes in time logarithmic to the number of rectangles added with
  16080. * {@link TileAvailability#addAvailableTileRange}.
  16081. * @param position - The position for which to determine the maximum available level. The height component is ignored.
  16082. * @returns The level of the most detailed tile covering the position.
  16083. */
  16084. computeMaximumLevelAtPosition(position: Cartographic): number;
  16085. /**
  16086. * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed
  16087. * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this
  16088. * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function
  16089. * usually completes in time logarithmic to the number of rectangles added with
  16090. * {@link TileAvailability#addAvailableTileRange}.
  16091. * @param rectangle - The rectangle.
  16092. * @returns The best available level for the entire rectangle.
  16093. */
  16094. computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number;
  16095. /**
  16096. * Determines if a particular tile is available.
  16097. * @param level - The tile level to check.
  16098. * @param x - The X coordinate of the tile to check.
  16099. * @param y - The Y coordinate of the tile to check.
  16100. * @returns True if the tile is available; otherwise, false.
  16101. */
  16102. isTileAvailable(level: number, x: number, y: number): boolean;
  16103. /**
  16104. * Computes a bit mask indicating which of a tile's four children exist.
  16105. * If a child's bit is set, a tile is available for that child. If it is cleared,
  16106. * the tile is not available. The bit values are as follows:
  16107. * <table>
  16108. * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
  16109. * <tr><td>0</td><td>1</td><td>Southwest</td></tr>
  16110. * <tr><td>1</td><td>2</td><td>Southeast</td></tr>
  16111. * <tr><td>2</td><td>4</td><td>Northwest</td></tr>
  16112. * <tr><td>3</td><td>8</td><td>Northeast</td></tr>
  16113. * </table>
  16114. * @param level - The level of the parent tile.
  16115. * @param x - The X coordinate of the parent tile.
  16116. * @param y - The Y coordinate of the parent tile.
  16117. * @returns The bit mask indicating child availability.
  16118. */
  16119. computeChildMaskForTile(level: number, x: number, y: number): number;
  16120. }
  16121. /**
  16122. * Provides details about an error that occurred in an {@link ImageryProvider} or a {@link TerrainProvider}.
  16123. * @param provider - The imagery or terrain provider that experienced the error.
  16124. * @param message - A message describing the error.
  16125. * @param [x] - The X coordinate of the tile that experienced the error, or undefined if the error
  16126. * is not specific to a particular tile.
  16127. * @param [y] - The Y coordinate of the tile that experienced the error, or undefined if the error
  16128. * is not specific to a particular tile.
  16129. * @param [level] - The level of the tile that experienced the error, or undefined if the error
  16130. * is not specific to a particular tile.
  16131. * @param [timesRetried = 0] - The number of times this operation has been retried.
  16132. * @param [error] - The error or exception that occurred, if any.
  16133. */
  16134. export class TileProviderError {
  16135. constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error);
  16136. /**
  16137. * The {@link ImageryProvider} or {@link TerrainProvider} that experienced the error.
  16138. */
  16139. provider: ImageryProvider | TerrainProvider;
  16140. /**
  16141. * The message describing the error.
  16142. */
  16143. message: string;
  16144. /**
  16145. * The X coordinate of the tile that experienced the error. If the error is not specific
  16146. * to a particular tile, this property will be undefined.
  16147. */
  16148. x: number;
  16149. /**
  16150. * The Y coordinate of the tile that experienced the error. If the error is not specific
  16151. * to a particular tile, this property will be undefined.
  16152. */
  16153. y: number;
  16154. /**
  16155. * The level-of-detail of the tile that experienced the error. If the error is not specific
  16156. * to a particular tile, this property will be undefined.
  16157. */
  16158. level: number;
  16159. /**
  16160. * The number of times this operation has been retried.
  16161. */
  16162. timesRetried: number;
  16163. /**
  16164. * True if the failed operation should be retried; otherwise, false. The imagery or terrain provider
  16165. * will set the initial value of this property before raising the event, but any listeners
  16166. * can change it. The value after the last listener is invoked will be acted upon.
  16167. */
  16168. retry: boolean;
  16169. /**
  16170. * The error or exception that occurred, if any.
  16171. */
  16172. error: Error;
  16173. /**
  16174. * Handles an error in an {@link ImageryProvider} or {@link TerrainProvider} by raising an event if it has any listeners, or by
  16175. * logging the error to the console if the event has no listeners. This method also tracks the number
  16176. * of times the operation has been retried and will automatically retry if requested to do so by the
  16177. * event listeners.
  16178. * @param previousError - The error instance returned by this function the last
  16179. * time it was called for this error, or undefined if this is the first time this error has
  16180. * occurred.
  16181. * @param provider - The imagery or terrain provider that encountered the error.
  16182. * @param event - The event to raise to inform listeners of the error.
  16183. * @param message - The message describing the error.
  16184. * @param x - The X coordinate of the tile that experienced the error, or undefined if the
  16185. * error is not specific to a particular tile.
  16186. * @param y - The Y coordinate of the tile that experienced the error, or undefined if the
  16187. * error is not specific to a particular tile.
  16188. * @param level - The level-of-detail of the tile that experienced the error, or undefined if the
  16189. * error is not specific to a particular tile.
  16190. * @param retryFunction - The function to call to retry the operation. If undefined, the
  16191. * operation will not be retried.
  16192. * @param [errorDetails] - The error or exception that occurred, if any.
  16193. * @returns The error instance that was passed to the event listeners and that
  16194. * should be passed to this function the next time it is called for the same error in order
  16195. * to track retry counts.
  16196. */
  16197. static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, errorDetails?: Error): TileProviderError;
  16198. /**
  16199. * Handles success of an operation by resetting the retry count of a previous error, if any. This way,
  16200. * if the error occurs again in the future, the listeners will be informed that it has not yet been retried.
  16201. * @param previousError - The previous error, or undefined if this operation has
  16202. * not previously resulted in an error.
  16203. */
  16204. static handleSuccess(previousError: TileProviderError): void;
  16205. }
  16206. export namespace TileProviderError {
  16207. /**
  16208. * A function that will be called to retry the operation.
  16209. */
  16210. type RetryFunction = () => void;
  16211. }
  16212. /**
  16213. * A tiling scheme for geometry or imagery on the surface of an ellipsoid. At level-of-detail zero,
  16214. * the coarsest, least-detailed level, the number of tiles is configurable.
  16215. * At level of detail one, each of the level zero tiles has four children, two in each direction.
  16216. * At level of detail two, each of the level one tiles has four children, two in each direction.
  16217. * This continues for as many levels as are present in the geometry or imagery source.
  16218. */
  16219. export class TilingScheme {
  16220. constructor();
  16221. /**
  16222. * Gets the ellipsoid that is tiled by the tiling scheme.
  16223. */
  16224. ellipsoid: Ellipsoid;
  16225. /**
  16226. * Gets the rectangle, in radians, covered by this tiling scheme.
  16227. */
  16228. rectangle: Rectangle;
  16229. /**
  16230. * Gets the map projection used by the tiling scheme.
  16231. */
  16232. projection: MapProjection;
  16233. /**
  16234. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  16235. * @param level - The level-of-detail.
  16236. * @returns The number of tiles in the X direction at the given level.
  16237. */
  16238. getNumberOfXTilesAtLevel(level: number): number;
  16239. /**
  16240. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  16241. * @param level - The level-of-detail.
  16242. * @returns The number of tiles in the Y direction at the given level.
  16243. */
  16244. getNumberOfYTilesAtLevel(level: number): number;
  16245. /**
  16246. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  16247. * of this tiling scheme.
  16248. * @param rectangle - The rectangle to transform.
  16249. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16250. * should be created.
  16251. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  16252. * is undefined.
  16253. */
  16254. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  16255. /**
  16256. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  16257. * of the tiling scheme.
  16258. * @param x - The integer x coordinate of the tile.
  16259. * @param y - The integer y coordinate of the tile.
  16260. * @param level - The tile level-of-detail. Zero is the least detailed.
  16261. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16262. * should be created.
  16263. * @returns The specified 'result', or a new object containing the rectangle
  16264. * if 'result' is undefined.
  16265. */
  16266. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16267. /**
  16268. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  16269. * @param x - The integer x coordinate of the tile.
  16270. * @param y - The integer y coordinate of the tile.
  16271. * @param level - The tile level-of-detail. Zero is the least detailed.
  16272. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16273. * should be created.
  16274. * @returns The specified 'result', or a new object containing the rectangle
  16275. * if 'result' is undefined.
  16276. */
  16277. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  16278. /**
  16279. * Calculates the tile x, y coordinates of the tile containing
  16280. * a given cartographic position.
  16281. * @param position - The position.
  16282. * @param level - The tile level-of-detail. Zero is the least detailed.
  16283. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  16284. * should be created.
  16285. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  16286. * if 'result' is undefined.
  16287. */
  16288. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  16289. }
  16290. /**
  16291. * An interval defined by a start and a stop time; optionally including those times as part of the interval.
  16292. * Arbitrary data can optionally be associated with each instance for used with {@link TimeIntervalCollection}.
  16293. * @example
  16294. * // Create an instance that spans August 1st, 1980 and is associated
  16295. * // with a Cartesian position.
  16296. * const timeInterval = new Cesium.TimeInterval({
  16297. * start : Cesium.JulianDate.fromIso8601('1980-08-01T00:00:00Z'),
  16298. * stop : Cesium.JulianDate.fromIso8601('1980-08-02T00:00:00Z'),
  16299. * isStartIncluded : true,
  16300. * isStopIncluded : false,
  16301. * data : Cesium.Cartesian3.fromDegrees(39.921037, -75.170082)
  16302. * });
  16303. * @example
  16304. * // Create two instances from ISO 8601 intervals with associated numeric data
  16305. * // then compute their intersection, summing the data they contain.
  16306. * const left = Cesium.TimeInterval.fromIso8601({
  16307. * iso8601 : '2000/2010',
  16308. * data : 2
  16309. * });
  16310. *
  16311. * const right = Cesium.TimeInterval.fromIso8601({
  16312. * iso8601 : '1995/2005',
  16313. * data : 3
  16314. * });
  16315. *
  16316. * //The result of the below intersection will be an interval equivalent to
  16317. * //const intersection = Cesium.TimeInterval.fromIso8601({
  16318. * // iso8601 : '2000/2005',
  16319. * // data : 5
  16320. * //});
  16321. * const intersection = new Cesium.TimeInterval();
  16322. * Cesium.TimeInterval.intersect(left, right, intersection, function(leftData, rightData) {
  16323. * return leftData + rightData;
  16324. * });
  16325. * @example
  16326. * // Check if an interval contains a specific time.
  16327. * const dateToCheck = Cesium.JulianDate.fromIso8601('1982-09-08T11:30:00Z');
  16328. * const containsDate = Cesium.TimeInterval.contains(timeInterval, dateToCheck);
  16329. * @param [options] - Object with the following properties:
  16330. * @param [options.start = new JulianDate()] - The start time of the interval.
  16331. * @param [options.stop = new JulianDate()] - The stop time of the interval.
  16332. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16333. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16334. * @param [options.data] - Arbitrary data associated with this interval.
  16335. */
  16336. export class TimeInterval {
  16337. constructor(options?: {
  16338. start?: JulianDate;
  16339. stop?: JulianDate;
  16340. isStartIncluded?: boolean;
  16341. isStopIncluded?: boolean;
  16342. data?: any;
  16343. });
  16344. /**
  16345. * Gets or sets the start time of this interval.
  16346. */
  16347. start: JulianDate;
  16348. /**
  16349. * Gets or sets the stop time of this interval.
  16350. */
  16351. stop: JulianDate;
  16352. /**
  16353. * Gets or sets the data associated with this interval.
  16354. */
  16355. data: any;
  16356. /**
  16357. * Gets or sets whether or not the start time is included in this interval.
  16358. */
  16359. isStartIncluded: boolean;
  16360. /**
  16361. * Gets or sets whether or not the stop time is included in this interval.
  16362. */
  16363. isStopIncluded: boolean;
  16364. /**
  16365. * Gets whether or not this interval is empty.
  16366. */
  16367. readonly isEmpty: boolean;
  16368. /**
  16369. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} interval.
  16370. * @param options - Object with the following properties:
  16371. * @param options.iso8601 - An ISO 8601 interval.
  16372. * @param [options.isStartIncluded = true] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16373. * @param [options.isStopIncluded = true] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16374. * @param [options.data] - Arbitrary data associated with this interval.
  16375. * @param [result] - An existing instance to use for the result.
  16376. * @returns The modified result parameter or a new instance if none was provided.
  16377. */
  16378. static fromIso8601(options: {
  16379. iso8601: string;
  16380. isStartIncluded?: boolean;
  16381. isStopIncluded?: boolean;
  16382. data?: any;
  16383. }, result?: TimeInterval): TimeInterval;
  16384. /**
  16385. * Creates an ISO8601 representation of the provided interval.
  16386. * @param timeInterval - The interval to be converted.
  16387. * @param [precision] - The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
  16388. * @returns The ISO8601 representation of the provided interval.
  16389. */
  16390. static toIso8601(timeInterval: TimeInterval, precision?: number): string;
  16391. /**
  16392. * Duplicates the provided instance.
  16393. * @param [timeInterval] - The instance to clone.
  16394. * @param [result] - An existing instance to use for the result.
  16395. * @returns The modified result parameter or a new instance if none was provided.
  16396. */
  16397. static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval;
  16398. /**
  16399. * Compares two instances and returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16400. * @param [left] - The first instance.
  16401. * @param [right] - The second instance.
  16402. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16403. * @returns <code>true</code> if the dates are equal; otherwise, <code>false</code>.
  16404. */
  16405. static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  16406. /**
  16407. * Compares two instances and returns <code>true</code> if they are within <code>epsilon</code> seconds of
  16408. * each other. That is, in order for the dates to be considered equal (and for
  16409. * this function to return <code>true</code>), the absolute value of the difference between them, in
  16410. * seconds, must be less than <code>epsilon</code>.
  16411. * @param [left] - The first instance.
  16412. * @param [right] - The second instance.
  16413. * @param [epsilon = 0] - The maximum number of seconds that should separate the two instances.
  16414. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16415. * @returns <code>true</code> if the two dates are within <code>epsilon</code> seconds of each other; otherwise <code>false</code>.
  16416. */
  16417. static equalsEpsilon(left?: TimeInterval, right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  16418. /**
  16419. * Computes the intersection of two intervals, optionally merging their data.
  16420. * @param left - The first interval.
  16421. * @param [right] - The second interval.
  16422. * @param [result] - An existing instance to use for the result.
  16423. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  16424. * @returns The modified result parameter.
  16425. */
  16426. static intersect(left: TimeInterval, right?: TimeInterval, result?: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval;
  16427. /**
  16428. * Checks if the specified date is inside the provided interval.
  16429. * @param timeInterval - The interval.
  16430. * @param julianDate - The date to check.
  16431. * @returns <code>true</code> if the interval contains the specified date, <code>false</code> otherwise.
  16432. */
  16433. static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean;
  16434. /**
  16435. * Duplicates this instance.
  16436. * @param [result] - An existing instance to use for the result.
  16437. * @returns The modified result parameter or a new instance if none was provided.
  16438. */
  16439. clone(result?: TimeInterval): TimeInterval;
  16440. /**
  16441. * Compares this instance against the provided instance componentwise and returns
  16442. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16443. * @param [right] - The right hand side interval.
  16444. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16445. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16446. */
  16447. equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean;
  16448. /**
  16449. * Compares this instance against the provided instance componentwise and returns
  16450. * <code>true</code> if they are within the provided epsilon,
  16451. * <code>false</code> otherwise.
  16452. * @param [right] - The right hand side interval.
  16453. * @param [epsilon = 0] - The epsilon to use for equality testing.
  16454. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16455. * @returns <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
  16456. */
  16457. equalsEpsilon(right?: TimeInterval, epsilon?: number, dataComparer?: TimeInterval.DataComparer): boolean;
  16458. /**
  16459. * Creates a string representing this TimeInterval in ISO8601 format.
  16460. * @returns A string representing this TimeInterval in ISO8601 format.
  16461. */
  16462. toString(): string;
  16463. /**
  16464. * An immutable empty interval.
  16465. */
  16466. static readonly EMPTY: TimeInterval;
  16467. }
  16468. export namespace TimeInterval {
  16469. /**
  16470. * Function interface for merging interval data.
  16471. * @param leftData - The first data instance.
  16472. * @param rightData - The second data instance.
  16473. */
  16474. type MergeCallback = (leftData: any, rightData: any) => any;
  16475. /**
  16476. * Function interface for comparing interval data.
  16477. * @param leftData - The first data instance.
  16478. * @param rightData - The second data instance.
  16479. */
  16480. type DataComparer = (leftData: any, rightData: any) => boolean;
  16481. }
  16482. /**
  16483. * A non-overlapping collection of {@link TimeInterval} instances sorted by start time.
  16484. * @param [intervals] - An array of intervals to add to the collection.
  16485. */
  16486. export class TimeIntervalCollection {
  16487. constructor(intervals?: TimeInterval[]);
  16488. /**
  16489. * Gets an event that is raised whenever the collection of intervals change.
  16490. */
  16491. readonly changedEvent: Event;
  16492. /**
  16493. * Gets the start time of the collection.
  16494. */
  16495. readonly start: JulianDate;
  16496. /**
  16497. * Gets whether or not the start time is included in the collection.
  16498. */
  16499. readonly isStartIncluded: boolean;
  16500. /**
  16501. * Gets the stop time of the collection.
  16502. */
  16503. readonly stop: JulianDate;
  16504. /**
  16505. * Gets whether or not the stop time is included in the collection.
  16506. */
  16507. readonly isStopIncluded: boolean;
  16508. /**
  16509. * Gets the number of intervals in the collection.
  16510. */
  16511. readonly length: number;
  16512. /**
  16513. * Gets whether or not the collection is empty.
  16514. */
  16515. readonly isEmpty: boolean;
  16516. /**
  16517. * Compares this instance against the provided instance componentwise and returns
  16518. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16519. * @param [right] - The right hand side collection.
  16520. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16521. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16522. */
  16523. equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean;
  16524. /**
  16525. * Gets the interval at the specified index.
  16526. * @param index - The index of the interval to retrieve.
  16527. * @returns The interval at the specified index, or <code>undefined</code> if no interval exists as that index.
  16528. */
  16529. get(index: number): TimeInterval | undefined;
  16530. /**
  16531. * Removes all intervals from the collection.
  16532. */
  16533. removeAll(): void;
  16534. /**
  16535. * Finds and returns the interval that contains the specified date.
  16536. * @param date - The date to search for.
  16537. * @returns The interval containing the specified date, <code>undefined</code> if no such interval exists.
  16538. */
  16539. findIntervalContainingDate(date: JulianDate): TimeInterval | undefined;
  16540. /**
  16541. * Finds and returns the data for the interval that contains the specified date.
  16542. * @param date - The date to search for.
  16543. * @returns The data for the interval containing the specified date, or <code>undefined</code> if no such interval exists.
  16544. */
  16545. findDataForIntervalContainingDate(date: JulianDate): any;
  16546. /**
  16547. * Checks if the specified date is inside this collection.
  16548. * @param julianDate - The date to check.
  16549. * @returns <code>true</code> if the collection contains the specified date, <code>false</code> otherwise.
  16550. */
  16551. contains(julianDate: JulianDate): boolean;
  16552. /**
  16553. * Finds and returns the index of the interval in the collection that contains the specified date.
  16554. * @param date - The date to search for.
  16555. * @returns The index of the interval that contains the specified date, if no such interval exists,
  16556. * it returns a negative number which is the bitwise complement of the index of the next interval that
  16557. * starts after the date, or if no interval starts after the specified date, the bitwise complement of
  16558. * the length of the collection.
  16559. */
  16560. indexOf(date: JulianDate): number;
  16561. /**
  16562. * Returns the first interval in the collection that matches the specified parameters.
  16563. * All parameters are optional and <code>undefined</code> parameters are treated as a don't care condition.
  16564. * @param [options] - Object with the following properties:
  16565. * @param [options.start] - The start time of the interval.
  16566. * @param [options.stop] - The stop time of the interval.
  16567. * @param [options.isStartIncluded] - <code>true</code> if <code>options.start</code> is included in the interval, <code>false</code> otherwise.
  16568. * @param [options.isStopIncluded] - <code>true</code> if <code>options.stop</code> is included in the interval, <code>false</code> otherwise.
  16569. * @returns The first interval in the collection that matches the specified parameters.
  16570. */
  16571. findInterval(options?: {
  16572. start?: JulianDate;
  16573. stop?: JulianDate;
  16574. isStartIncluded?: boolean;
  16575. isStopIncluded?: boolean;
  16576. }): TimeInterval | undefined;
  16577. /**
  16578. * Adds an interval to the collection, merging intervals that contain the same data and
  16579. * splitting intervals of different data as needed in order to maintain a non-overlapping collection.
  16580. * The data in the new interval takes precedence over any existing intervals in the collection.
  16581. * @param interval - The interval to add.
  16582. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16583. */
  16584. addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void;
  16585. /**
  16586. * Removes the specified interval from this interval collection, creating a hole over the specified interval.
  16587. * The data property of the input interval is ignored.
  16588. * @param interval - The interval to remove.
  16589. * @returns <code>true</code> if the interval was removed, <code>false</code> if no part of the interval was in the collection.
  16590. */
  16591. removeInterval(interval: TimeInterval): boolean;
  16592. /**
  16593. * Creates a new instance that is the intersection of this collection and the provided collection.
  16594. * @param other - The collection to intersect with.
  16595. * @param [dataComparer] - A function which compares the data of the two intervals. If omitted, reference equality is used.
  16596. * @param [mergeCallback] - A function which merges the data of the two intervals. If omitted, the data from the left interval will be used.
  16597. * @returns A new TimeIntervalCollection which is the intersection of this collection and the provided collection.
  16598. */
  16599. intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection;
  16600. /**
  16601. * Creates a new instance from a JulianDate array.
  16602. * @param options - Object with the following properties:
  16603. * @param options.julianDates - An array of ISO 8601 dates.
  16604. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16605. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16606. * @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.
  16607. * @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.
  16608. * @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.
  16609. * @param [result] - An existing instance to use for the result.
  16610. * @returns The modified result parameter or a new instance if none was provided.
  16611. */
  16612. static fromJulianDateArray(options: {
  16613. julianDates: JulianDate[];
  16614. isStartIncluded?: boolean;
  16615. isStopIncluded?: boolean;
  16616. leadingInterval?: boolean;
  16617. trailingInterval?: boolean;
  16618. dataCallback?: (...params: any[]) => any;
  16619. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16620. /**
  16621. * Creates a new instance from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} time interval (start/end/duration).
  16622. * @param options - Object with the following properties:
  16623. * @param options.iso8601 - An ISO 8601 interval.
  16624. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16625. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16626. * @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.
  16627. * @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.
  16628. * @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.
  16629. * @param [result] - An existing instance to use for the result.
  16630. * @returns The modified result parameter or a new instance if none was provided.
  16631. */
  16632. static fromIso8601(options: {
  16633. iso8601: string;
  16634. isStartIncluded?: boolean;
  16635. isStopIncluded?: boolean;
  16636. leadingInterval?: boolean;
  16637. trailingInterval?: boolean;
  16638. dataCallback?: (...params: any[]) => any;
  16639. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16640. /**
  16641. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date array.
  16642. * @param options - Object with the following properties:
  16643. * @param options.iso8601Dates - An array of ISO 8601 dates.
  16644. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16645. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16646. * @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.
  16647. * @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.
  16648. * @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.
  16649. * @param [result] - An existing instance to use for the result.
  16650. * @returns The modified result parameter or a new instance if none was provided.
  16651. */
  16652. static fromIso8601DateArray(options: {
  16653. iso8601Dates: string[];
  16654. isStartIncluded?: boolean;
  16655. isStopIncluded?: boolean;
  16656. leadingInterval?: boolean;
  16657. trailingInterval?: boolean;
  16658. dataCallback?: (...params: any[]) => any;
  16659. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16660. /**
  16661. * Creates a new instance from a {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} duration array.
  16662. * @param options - Object with the following properties:
  16663. * @param options.epoch - An date that the durations are relative to.
  16664. * @param options.iso8601Durations - An array of ISO 8601 durations.
  16665. * @param [options.relativeToPrevious = false] - <code>true</code> if durations are relative to previous date, <code>false</code> if always relative to the epoch.
  16666. * @param [options.isStartIncluded = true] - <code>true</code> if start time is included in the interval, <code>false</code> otherwise.
  16667. * @param [options.isStopIncluded = true] - <code>true</code> if stop time is included in the interval, <code>false</code> otherwise.
  16668. * @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.
  16669. * @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.
  16670. * @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.
  16671. * @param [result] - An existing instance to use for the result.
  16672. * @returns The modified result parameter or a new instance if none was provided.
  16673. */
  16674. static fromIso8601DurationArray(options: {
  16675. epoch: JulianDate;
  16676. iso8601Durations: string;
  16677. relativeToPrevious?: boolean;
  16678. isStartIncluded?: boolean;
  16679. isStopIncluded?: boolean;
  16680. leadingInterval?: boolean;
  16681. trailingInterval?: boolean;
  16682. dataCallback?: (...params: any[]) => any;
  16683. }, result?: TimeIntervalCollection): TimeIntervalCollection;
  16684. }
  16685. /**
  16686. * Provides the type of time standards which JulianDate can take as input.
  16687. */
  16688. export enum TimeStandard {
  16689. /**
  16690. * Represents the coordinated Universal Time (UTC) time standard.
  16691. *
  16692. * UTC is related to TAI according to the relationship
  16693. * <code>UTC = TAI - deltaT</code> where <code>deltaT</code> is the number of leap
  16694. * seconds which have been introduced as of the time in TAI.
  16695. */
  16696. UTC = 0,
  16697. /**
  16698. * Represents the International Atomic Time (TAI) time standard.
  16699. * TAI is the principal time standard to which the other time standards are related.
  16700. */
  16701. TAI = 1
  16702. }
  16703. /**
  16704. * Contains functions for transforming positions to various reference frames.
  16705. */
  16706. export namespace Transforms {
  16707. /**
  16708. * Generates a function that computes a 4x4 transformation matrix from a reference frame
  16709. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16710. * @param firstAxis - name of the first axis of the local reference frame. Must be
  16711. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16712. * @param secondAxis - name of the second axis of the local reference frame. Must be
  16713. * 'east', 'north', 'up', 'west', 'south' or 'down'.
  16714. * @returns The function that will computes a
  16715. * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,
  16716. */
  16717. function localFrameToFixedFrameGenerator(firstAxis: string, secondAxis: string): Transforms.LocalFrameToFixedFrame;
  16718. /**
  16719. * Computes a 4x4 transformation matrix from a reference frame
  16720. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16721. * @param origin - The center point of the local reference frame.
  16722. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16723. * @param [result] - The object onto which to store the result.
  16724. */
  16725. type LocalFrameToFixedFrame = (origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4) => Matrix4;
  16726. /**
  16727. * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
  16728. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16729. * The local axes are defined as:
  16730. * <ul>
  16731. * <li>The <code>x</code> axis points in the local east direction.</li>
  16732. * <li>The <code>y</code> axis points in the local north direction.</li>
  16733. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16734. * </ul>
  16735. * @example
  16736. * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16737. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16738. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  16739. * @param origin - The center point of the local reference frame.
  16740. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16741. * @param [result] - The object onto which to store the result.
  16742. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16743. */
  16744. function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16745. /**
  16746. * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes
  16747. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16748. * The local axes are defined as:
  16749. * <ul>
  16750. * <li>The <code>x</code> axis points in the local north direction.</li>
  16751. * <li>The <code>y</code> axis points in the local east direction.</li>
  16752. * <li>The <code>z</code> axis points in the opposite direction of the ellipsoid surface normal which passes through the position.</li>
  16753. * </ul>
  16754. * @example
  16755. * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
  16756. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16757. * const transform = Cesium.Transforms.northEastDownToFixedFrame(center);
  16758. * @param origin - The center point of the local reference frame.
  16759. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16760. * @param [result] - The object onto which to store the result.
  16761. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16762. */
  16763. function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16764. /**
  16765. * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes
  16766. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16767. * The local axes are defined as:
  16768. * <ul>
  16769. * <li>The <code>x</code> axis points in the local north direction.</li>
  16770. * <li>The <code>y</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16771. * <li>The <code>z</code> axis points in the local east direction.</li>
  16772. * </ul>
  16773. * @example
  16774. * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
  16775. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16776. * const transform = Cesium.Transforms.northUpEastToFixedFrame(center);
  16777. * @param origin - The center point of the local reference frame.
  16778. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16779. * @param [result] - The object onto which to store the result.
  16780. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16781. */
  16782. function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16783. /**
  16784. * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes
  16785. * centered at the provided origin to the provided ellipsoid's fixed reference frame.
  16786. * The local axes are defined as:
  16787. * <ul>
  16788. * <li>The <code>x</code> axis points in the local north direction.</li>
  16789. * <li>The <code>y</code> axis points in the local west direction.</li>
  16790. * <li>The <code>z</code> axis points in the direction of the ellipsoid surface normal which passes through the position.</li>
  16791. * </ul>
  16792. * @example
  16793. * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
  16794. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16795. * const transform = Cesium.Transforms.northWestUpToFixedFrame(center);
  16796. * @param origin - The center point of the local reference frame.
  16797. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16798. * @param [result] - The object onto which to store the result.
  16799. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16800. */
  16801. function northWestUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4;
  16802. /**
  16803. * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
  16804. * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north
  16805. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16806. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16807. * @example
  16808. * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16809. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16810. * const heading = -Cesium.Math.PI_OVER_TWO;
  16811. * const pitch = Cesium.Math.PI_OVER_FOUR;
  16812. * const roll = 0.0;
  16813. * const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  16814. * const transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);
  16815. * @param origin - The center point of the local reference frame.
  16816. * @param headingPitchRoll - The heading, pitch, and roll.
  16817. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16818. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16819. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16820. * @param [result] - The object onto which to store the result.
  16821. * @returns The modified result parameter or a new Matrix4 instance if none was provided.
  16822. */
  16823. function headingPitchRollToFixedFrame(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Matrix4): Matrix4;
  16824. /**
  16825. * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
  16826. * centered at the provided origin. Heading is the rotation from the local north
  16827. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16828. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16829. * @example
  16830. * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
  16831. * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16832. * const heading = -Cesium.Math.PI_OVER_TWO;
  16833. * const pitch = Cesium.Math.PI_OVER_FOUR;
  16834. * const roll = 0.0;
  16835. * const hpr = new HeadingPitchRoll(heading, pitch, roll);
  16836. * const quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);
  16837. * @param origin - The center point of the local reference frame.
  16838. * @param headingPitchRoll - The heading, pitch, and roll.
  16839. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16840. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16841. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16842. * @param [result] - The object onto which to store the result.
  16843. * @returns The modified result parameter or a new Quaternion instance if none was provided.
  16844. */
  16845. function headingPitchRollQuaternion(origin: Cartesian3, headingPitchRoll: HeadingPitchRoll, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: Quaternion): Quaternion;
  16846. /**
  16847. * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north
  16848. * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
  16849. * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
  16850. * @param transform - The transform
  16851. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16852. * @param [fixedFrameTransform = Transforms.eastNorthUpToFixedFrame] - A 4x4 transformation
  16853. * matrix from a reference frame to the provided ellipsoid's fixed reference frame
  16854. * @param [result] - The object onto which to store the result.
  16855. * @returns The modified result parameter or a new HeadingPitchRoll instance if none was provided.
  16856. */
  16857. function fixedFrameToHeadingPitchRoll(transform: Matrix4, ellipsoid?: Ellipsoid, fixedFrameTransform?: Transforms.LocalFrameToFixedFrame, result?: HeadingPitchRoll): HeadingPitchRoll;
  16858. /**
  16859. * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the
  16860. * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.
  16861. * @example
  16862. * //Set the view to the inertial frame.
  16863. * scene.postUpdate.addEventListener(function(scene, time) {
  16864. * const now = Cesium.JulianDate.now();
  16865. * const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());
  16866. * const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));
  16867. * const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());
  16868. * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
  16869. * camera.lookAtTransform(transform, offset);
  16870. * });
  16871. * @param date - The time at which to compute the rotation matrix.
  16872. * @param [result] - The object onto which to store the result.
  16873. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16874. */
  16875. function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16876. /**
  16877. * Preloads the data necessary to transform between the ICRF and Fixed axes, in either
  16878. * direction, over a given interval. This function returns a promise that, when resolved,
  16879. * indicates that the preload has completed.
  16880. * @example
  16881. * const interval = new Cesium.TimeInterval(...);
  16882. * Promise.resolve(Cesium.Transforms.preloadIcrfFixed(interval)).then(function() {
  16883. * // the data is now loaded
  16884. * });
  16885. * @param timeInterval - The interval to preload.
  16886. * @returns A promise that, when resolved, indicates that the preload has completed
  16887. * and evaluation of the transformation between the fixed and ICRF axes will
  16888. * no longer return undefined for a time inside the interval.
  16889. */
  16890. function preloadIcrfFixed(timeInterval: TimeInterval): Promise<void>;
  16891. /**
  16892. * Computes a rotation matrix to transform a point or vector from the International Celestial
  16893. * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)
  16894. * at a given time. This function may return undefined if the data necessary to
  16895. * do the transformation is not yet loaded.
  16896. * @example
  16897. * scene.postUpdate.addEventListener(function(scene, time) {
  16898. * // View in ICRF.
  16899. * const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
  16900. * if (Cesium.defined(icrfToFixed)) {
  16901. * const offset = Cesium.Cartesian3.clone(camera.position);
  16902. * const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
  16903. * camera.lookAtTransform(transform, offset);
  16904. * }
  16905. * });
  16906. * @param date - The time at which to compute the rotation matrix.
  16907. * @param [result] - The object onto which to store the result. If this parameter is
  16908. * not specified, a new instance is created and returned.
  16909. * @returns The rotation matrix, or undefined if the data necessary to do the
  16910. * transformation is not yet loaded.
  16911. */
  16912. function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16913. /**
  16914. * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)
  16915. * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes
  16916. * at a given time. This function may return undefined if the data necessary to
  16917. * do the transformation is not yet loaded.
  16918. * @example
  16919. * // Transform a point from the ICRF axes to the Fixed axes.
  16920. * const now = Cesium.JulianDate.now();
  16921. * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  16922. * const fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);
  16923. * let pointInInertial = new Cesium.Cartesian3();
  16924. * if (Cesium.defined(fixedToIcrf)) {
  16925. * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
  16926. * }
  16927. * @param date - The time at which to compute the rotation matrix.
  16928. * @param [result] - The object onto which to store the result. If this parameter is
  16929. * not specified, a new instance is created and returned.
  16930. * @returns The rotation matrix, or undefined if the data necessary to do the
  16931. * transformation is not yet loaded.
  16932. */
  16933. function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3;
  16934. /**
  16935. * Transform a point from model coordinates to window coordinates.
  16936. * @param modelViewProjectionMatrix - The 4x4 model-view-projection matrix.
  16937. * @param viewportTransformation - The 4x4 viewport transformation.
  16938. * @param point - The point to transform.
  16939. * @param [result] - The object onto which to store the result.
  16940. * @returns The modified result parameter or a new Cartesian2 instance if none was provided.
  16941. */
  16942. function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2;
  16943. /**
  16944. * Transform a position and velocity to a rotation matrix.
  16945. * @param position - The position to transform.
  16946. * @param velocity - The velocity vector to transform.
  16947. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose fixed frame is used in the transformation.
  16948. * @param [result] - The object onto which to store the result.
  16949. * @returns The modified result parameter or a new Matrix3 instance if none was provided.
  16950. */
  16951. function rotationMatrixFromPositionVelocity(position: Cartesian3, velocity: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix3): Matrix3;
  16952. }
  16953. /**
  16954. * An affine transformation defined by a translation, rotation, and scale.
  16955. * @param [translation = Cartesian3.ZERO] - A {@link Cartesian3} specifying the (x, y, z) translation to apply to the node.
  16956. * @param [rotation = Quaternion.IDENTITY] - A {@link Quaternion} specifying the (x, y, z, w) rotation to apply to the node.
  16957. * @param [scale = new Cartesian3(1.0, 1.0, 1.0)] - A {@link Cartesian3} specifying the (x, y, z) scaling to apply to the node.
  16958. */
  16959. export class TranslationRotationScale {
  16960. constructor(translation?: Cartesian3, rotation?: Quaternion, scale?: Cartesian3);
  16961. /**
  16962. * Gets or sets the (x, y, z) translation to apply to the node.
  16963. */
  16964. translation: Cartesian3;
  16965. /**
  16966. * Gets or sets the (x, y, z, w) rotation to apply to the node.
  16967. */
  16968. rotation: Quaternion;
  16969. /**
  16970. * Gets or sets the (x, y, z) scaling to apply to the node.
  16971. */
  16972. scale: Cartesian3;
  16973. /**
  16974. * Compares this instance against the provided instance and returns
  16975. * <code>true</code> if they are equal, <code>false</code> otherwise.
  16976. * @param [right] - The right hand side TranslationRotationScale.
  16977. * @returns <code>true</code> if they are equal, <code>false</code> otherwise.
  16978. */
  16979. equals(right?: TranslationRotationScale): boolean;
  16980. }
  16981. /**
  16982. * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve
  16983. * a system of linear equations where the coefficient matrix is a tridiagonal matrix.
  16984. */
  16985. export namespace TridiagonalSystemSolver {
  16986. /**
  16987. * Solves a tridiagonal system of linear equations.
  16988. * @example
  16989. * const lowerDiagonal = [1.0, 1.0, 1.0, 1.0];
  16990. * const diagonal = [2.0, 4.0, 4.0, 4.0, 2.0];
  16991. * const upperDiagonal = [1.0, 1.0, 1.0, 1.0];
  16992. * const rightHandSide = [
  16993. * new Cesium.Cartesian3(410757.0, -1595711.0, 1375302.0),
  16994. * new Cesium.Cartesian3(-5986705.0, -2190640.0, 1099600.0),
  16995. * new Cesium.Cartesian3(-12593180.0, 288588.0, -1755549.0),
  16996. * new Cesium.Cartesian3(-5349898.0, 2457005.0, -2685438.0),
  16997. * new Cesium.Cartesian3(845820.0, 1573488.0, -1205591.0)
  16998. * ];
  16999. *
  17000. * const solution = Cesium.TridiagonalSystemSolver.solve(lowerDiagonal, diagonal, upperDiagonal, rightHandSide);
  17001. * @param diagonal - An array with length <code>n</code> that contains the diagonal of the coefficient matrix.
  17002. * @param lower - An array with length <code>n - 1</code> that contains the lower diagonal of the coefficient matrix.
  17003. * @param upper - An array with length <code>n - 1</code> that contains the upper diagonal of the coefficient matrix.
  17004. * @param right - An array of Cartesians with length <code>n</code> that is the right side of the system of equations.
  17005. * @returns An array of Cartesians with length <code>n</code> that is the solution to the tridiagonal system of equations.
  17006. */
  17007. function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[];
  17008. }
  17009. /**
  17010. * A singleton that contains all of the servers that are trusted. Credentials will be sent with
  17011. * any requests to these servers.
  17012. */
  17013. export namespace TrustedServers {
  17014. /**
  17015. * Adds a trusted server to the registry
  17016. * @example
  17017. * // Add a trusted server
  17018. * TrustedServers.add('my.server.com', 80);
  17019. * @param host - The host to be added.
  17020. * @param port - The port used to access the host.
  17021. */
  17022. function add(host: string, port: number): void;
  17023. /**
  17024. * Removes a trusted server from the registry
  17025. * @example
  17026. * // Remove a trusted server
  17027. * TrustedServers.remove('my.server.com', 80);
  17028. * @param host - The host to be removed.
  17029. * @param port - The port used to access the host.
  17030. */
  17031. function remove(host: string, port: number): void;
  17032. /**
  17033. * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
  17034. * @example
  17035. * // Add server
  17036. * TrustedServers.add('my.server.com', 81);
  17037. *
  17038. * // Check if server is trusted
  17039. * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
  17040. * // my.server.com:81 is trusted
  17041. * }
  17042. * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
  17043. * // my.server.com isn't trusted
  17044. * }
  17045. * @param url - The url to be tested against the trusted list
  17046. * @returns Returns true if url is trusted, false otherwise.
  17047. */
  17048. function contains(url: string): boolean;
  17049. /**
  17050. * Clears the registry
  17051. * @example
  17052. * // Remove a trusted server
  17053. * TrustedServers.clear();
  17054. */
  17055. function clear(): void;
  17056. }
  17057. /**
  17058. * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
  17059. * retrieved from a {@link http://vr-theworld.com/|VT MÄK VR-TheWorld server}.
  17060. * @example
  17061. * const terrainProvider = new Cesium.VRTheWorldTerrainProvider({
  17062. * url : 'https://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/'
  17063. * });
  17064. * viewer.terrainProvider = terrainProvider;
  17065. * @param options - Object with the following properties:
  17066. * @param options.url - The URL of the VR-TheWorld TileMap.
  17067. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid. If this parameter is not
  17068. * specified, the WGS84 ellipsoid is used.
  17069. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  17070. */
  17071. export class VRTheWorldTerrainProvider {
  17072. constructor(options: {
  17073. url: Resource | string;
  17074. ellipsoid?: Ellipsoid;
  17075. credit?: Credit | string;
  17076. });
  17077. /**
  17078. * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
  17079. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  17080. * are passed an instance of {@link TileProviderError}.
  17081. */
  17082. readonly errorEvent: Event;
  17083. /**
  17084. * Gets the credit to display when this terrain provider is active. Typically this is used to credit
  17085. * the source of the terrain. This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17086. */
  17087. readonly credit: Credit;
  17088. /**
  17089. * Gets the tiling scheme used by this provider. This function should
  17090. * not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17091. */
  17092. readonly tilingScheme: GeographicTilingScheme;
  17093. /**
  17094. * Gets a value indicating whether or not the provider is ready for use.
  17095. */
  17096. readonly ready: boolean;
  17097. /**
  17098. * Gets a promise that resolves to true when the provider is ready for use.
  17099. */
  17100. readonly readyPromise: Promise<boolean>;
  17101. /**
  17102. * Gets a value indicating whether or not the provider includes a water mask. The water mask
  17103. * indicates which areas of the globe are water rather than land, so they can be rendered
  17104. * as a reflective surface with animated waves. This function should not be
  17105. * called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17106. */
  17107. readonly hasWaterMask: boolean;
  17108. /**
  17109. * Gets a value indicating whether or not the requested tiles include vertex normals.
  17110. * This function should not be called before {@link VRTheWorldTerrainProvider#ready} returns true.
  17111. */
  17112. readonly hasVertexNormals: boolean;
  17113. /**
  17114. * Gets an object that can be used to determine availability of terrain from this provider, such as
  17115. * at points and in rectangles. This function should not be called before
  17116. * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
  17117. * information is not available.
  17118. */
  17119. readonly availability: TileAvailability;
  17120. /**
  17121. * Requests the geometry for a given tile. This function should not be called before
  17122. * {@link VRTheWorldTerrainProvider#ready} returns true. The result includes terrain
  17123. * data and indicates that all child tiles are available.
  17124. * @param x - The X coordinate of the tile for which to request geometry.
  17125. * @param y - The Y coordinate of the tile for which to request geometry.
  17126. * @param level - The level of the tile for which to request geometry.
  17127. * @param [request] - The request object. Intended for internal use only.
  17128. * @returns A promise for the requested geometry. If this method
  17129. * returns undefined instead of a promise, it is an indication that too many requests are already
  17130. * pending and the request will be retried later.
  17131. */
  17132. requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData> | undefined;
  17133. /**
  17134. * Gets the maximum geometric error allowed in a tile at a given level.
  17135. * @param level - The tile level for which to get the maximum geometric error.
  17136. * @returns The maximum geometric error.
  17137. */
  17138. getLevelMaximumGeometricError(level: number): number;
  17139. /**
  17140. * Determines whether data for a tile is available to be loaded.
  17141. * @param x - The X coordinate of the tile for which to request geometry.
  17142. * @param y - The Y coordinate of the tile for which to request geometry.
  17143. * @param level - The level of the tile for which to request geometry.
  17144. * @returns Undefined if not supported, otherwise true or false.
  17145. */
  17146. getTileDataAvailable(x: number, y: number, level: number): boolean | undefined;
  17147. /**
  17148. * Makes sure we load availability data for a tile
  17149. * @param x - The X coordinate of the tile for which to request geometry.
  17150. * @param y - The Y coordinate of the tile for which to request geometry.
  17151. * @param level - The level of the tile for which to request geometry.
  17152. * @returns Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
  17153. */
  17154. loadTileDataAvailability(x: number, y: number, level: number): undefined | Promise<void>;
  17155. }
  17156. /**
  17157. * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
  17158. * to a {@link Geometry} to request that certain properties be computed, e.g., just position,
  17159. * position and normal, etc.
  17160. * @example
  17161. * // Create a vertex format with position and 2D texture coordinate attributes.
  17162. * const format = new Cesium.VertexFormat({
  17163. * position : true,
  17164. * st : true
  17165. * });
  17166. * @param [options] - An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
  17167. */
  17168. export class VertexFormat {
  17169. constructor(options?: any);
  17170. /**
  17171. * When <code>true</code>, the vertex has a 3D position attribute.
  17172. * <p>
  17173. * 64-bit floating-point (for precision). 3 components per attribute.
  17174. * </p>
  17175. */
  17176. position: boolean;
  17177. /**
  17178. * When <code>true</code>, the vertex has a normal attribute (normalized), which is commonly used for lighting.
  17179. * <p>
  17180. * 32-bit floating-point. 3 components per attribute.
  17181. * </p>
  17182. */
  17183. normal: boolean;
  17184. /**
  17185. * When <code>true</code>, the vertex has a 2D texture coordinate attribute.
  17186. * <p>
  17187. * 32-bit floating-point. 2 components per attribute
  17188. * </p>
  17189. */
  17190. st: boolean;
  17191. /**
  17192. * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  17193. * <p>
  17194. * 32-bit floating-point. 3 components per attribute.
  17195. * </p>
  17196. */
  17197. bitangent: boolean;
  17198. /**
  17199. * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
  17200. * <p>
  17201. * 32-bit floating-point. 3 components per attribute.
  17202. * </p>
  17203. */
  17204. tangent: boolean;
  17205. /**
  17206. * When <code>true</code>, the vertex has an RGB color attribute.
  17207. * <p>
  17208. * 8-bit unsigned byte. 3 components per attribute.
  17209. * </p>
  17210. */
  17211. color: boolean;
  17212. /**
  17213. * An immutable vertex format with only a position attribute.
  17214. */
  17215. static readonly POSITION_ONLY: VertexFormat;
  17216. /**
  17217. * An immutable vertex format with position and normal attributes.
  17218. * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.
  17219. */
  17220. static readonly POSITION_AND_NORMAL: VertexFormat;
  17221. /**
  17222. * An immutable vertex format with position, normal, and st attributes.
  17223. * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}
  17224. * is <code>TEXTURED/code>.
  17225. */
  17226. static readonly POSITION_NORMAL_AND_ST: VertexFormat;
  17227. /**
  17228. * An immutable vertex format with position and st attributes.
  17229. * This is compatible with {@link EllipsoidSurfaceAppearance}.
  17230. */
  17231. static readonly POSITION_AND_ST: VertexFormat;
  17232. /**
  17233. * An immutable vertex format with position and color attributes.
  17234. */
  17235. static readonly POSITION_AND_COLOR: VertexFormat;
  17236. /**
  17237. * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
  17238. */
  17239. static readonly ALL: VertexFormat;
  17240. /**
  17241. * An immutable vertex format with position, normal, and st attributes.
  17242. * This is compatible with most appearances and materials; however
  17243. * normal and st attributes are not always required. When this is
  17244. * known in advance, another <code>VertexFormat</code> should be used.
  17245. */
  17246. static readonly DEFAULT: VertexFormat;
  17247. /**
  17248. * The number of elements used to pack the object into an array.
  17249. */
  17250. static packedLength: number;
  17251. /**
  17252. * Stores the provided instance into the provided array.
  17253. * @param value - The value to pack.
  17254. * @param array - The array to pack into.
  17255. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17256. * @returns The array that was packed into
  17257. */
  17258. static pack(value: VertexFormat, array: number[], startingIndex?: number): number[];
  17259. /**
  17260. * Retrieves an instance from a packed array.
  17261. * @param array - The packed array.
  17262. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17263. * @param [result] - The object into which to store the result.
  17264. * @returns The modified result parameter or a new VertexFormat instance if one was not provided.
  17265. */
  17266. static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat;
  17267. /**
  17268. * Duplicates a VertexFormat instance.
  17269. * @param vertexFormat - The vertex format to duplicate.
  17270. * @param [result] - The object onto which to store the result.
  17271. * @returns The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
  17272. */
  17273. static clone(vertexFormat: VertexFormat, result?: VertexFormat): VertexFormat;
  17274. }
  17275. /**
  17276. * Synchronizes a video element with a simulation clock.
  17277. * @param [options] - Object with the following properties:
  17278. * @param [options.clock] - The clock instance used to drive the video.
  17279. * @param [options.element] - The video element to be synchronized.
  17280. * @param [options.epoch = Iso8601.MINIMUM_VALUE] - The simulation time that marks the start of the video.
  17281. * @param [options.tolerance = 1.0] - The maximum amount of time, in seconds, that the clock and video can diverge.
  17282. */
  17283. export class VideoSynchronizer {
  17284. constructor(options?: {
  17285. clock?: Clock;
  17286. element?: HTMLVideoElement;
  17287. epoch?: JulianDate;
  17288. tolerance?: number;
  17289. });
  17290. /**
  17291. * Gets or sets the simulation time that marks the start of the video.
  17292. */
  17293. epoch: JulianDate;
  17294. /**
  17295. * Gets or sets the amount of time in seconds the video's currentTime
  17296. * and the clock's currentTime can diverge before a video seek is performed.
  17297. * Lower values make the synchronization more accurate but video
  17298. * performance might suffer. Higher values provide better performance
  17299. * but at the cost of accuracy.
  17300. */
  17301. tolerance: number;
  17302. /**
  17303. * Gets or sets the clock used to drive the video element.
  17304. */
  17305. clock: Clock;
  17306. /**
  17307. * Gets or sets the video element to synchronize.
  17308. */
  17309. element: HTMLVideoElement;
  17310. /**
  17311. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  17312. */
  17313. destroy(): void;
  17314. /**
  17315. * Returns true if this object was destroyed; otherwise, false.
  17316. * @returns True if this object was destroyed; otherwise, false.
  17317. */
  17318. isDestroyed(): boolean;
  17319. }
  17320. /**
  17321. * This enumerated type is used in determining to what extent an object, the occludee,
  17322. * is visible during horizon culling. An occluder may fully block an occludee, in which case
  17323. * it has no visibility, may partially block an occludee from view, or may not block it at all,
  17324. * leading to full visibility.
  17325. */
  17326. export enum Visibility {
  17327. /**
  17328. * Represents that no part of an object is visible.
  17329. */
  17330. NONE = -1,
  17331. /**
  17332. * Represents that part, but not all, of an object is visible
  17333. */
  17334. PARTIAL = 0,
  17335. /**
  17336. * Represents that an object is visible in its entirety.
  17337. */
  17338. FULL = 1
  17339. }
  17340. /**
  17341. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  17342. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17343. * @example
  17344. * // create a wall that spans from ground level to 10000 meters
  17345. * const wall = new Cesium.WallGeometry({
  17346. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  17347. * 19.0, 47.0, 10000.0,
  17348. * 19.0, 48.0, 10000.0,
  17349. * 20.0, 48.0, 10000.0,
  17350. * 20.0, 47.0, 10000.0,
  17351. * 19.0, 47.0, 10000.0
  17352. * ])
  17353. * });
  17354. * const geometry = Cesium.WallGeometry.createGeometry(wall);
  17355. * @param options - Object with the following properties:
  17356. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17357. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  17358. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  17359. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17360. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  17361. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17362. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17363. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  17364. */
  17365. export class WallGeometry {
  17366. constructor(options: {
  17367. positions: Cartesian3[];
  17368. granularity?: number;
  17369. maximumHeights?: number[];
  17370. minimumHeights?: number[];
  17371. ellipsoid?: Ellipsoid;
  17372. vertexFormat?: VertexFormat;
  17373. });
  17374. /**
  17375. * The number of elements used to pack the object into an array.
  17376. */
  17377. packedLength: number;
  17378. /**
  17379. * Stores the provided instance into the provided array.
  17380. * @param value - The value to pack.
  17381. * @param array - The array to pack into.
  17382. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17383. * @returns The array that was packed into
  17384. */
  17385. static pack(value: WallGeometry, array: number[], startingIndex?: number): number[];
  17386. /**
  17387. * Retrieves an instance from a packed array.
  17388. * @param array - The packed array.
  17389. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17390. * @param [result] - The object into which to store the result.
  17391. * @returns The modified result parameter or a new WallGeometry instance if one was not provided.
  17392. */
  17393. static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry;
  17394. /**
  17395. * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
  17396. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17397. * @example
  17398. * // create a wall that spans from 10000 meters to 20000 meters
  17399. * const wall = Cesium.WallGeometry.fromConstantHeights({
  17400. * positions : Cesium.Cartesian3.fromDegreesArray([
  17401. * 19.0, 47.0,
  17402. * 19.0, 48.0,
  17403. * 20.0, 48.0,
  17404. * 20.0, 47.0,
  17405. * 19.0, 47.0,
  17406. * ]),
  17407. * minimumHeight : 20000.0,
  17408. * maximumHeight : 10000.0
  17409. * });
  17410. * const geometry = Cesium.WallGeometry.createGeometry(wall);
  17411. * @param options - Object with the following properties:
  17412. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17413. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  17414. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17415. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  17416. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17417. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17418. * @param [options.vertexFormat = VertexFormat.DEFAULT] - The vertex attributes to be computed.
  17419. */
  17420. static fromConstantHeights(options: {
  17421. positions: Cartesian3[];
  17422. maximumHeight?: number;
  17423. minimumHeight?: number;
  17424. ellipsoid?: Ellipsoid;
  17425. vertexFormat?: VertexFormat;
  17426. }): WallGeometry;
  17427. /**
  17428. * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
  17429. * @param wallGeometry - A description of the wall.
  17430. * @returns The computed vertices and indices.
  17431. */
  17432. static createGeometry(wallGeometry: WallGeometry): Geometry | undefined;
  17433. }
  17434. /**
  17435. * A description of a wall outline. A wall is defined by a series of points,
  17436. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17437. * @example
  17438. * // create a wall outline that spans from ground level to 10000 meters
  17439. * const wall = new Cesium.WallOutlineGeometry({
  17440. * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
  17441. * 19.0, 47.0, 10000.0,
  17442. * 19.0, 48.0, 10000.0,
  17443. * 20.0, 48.0, 10000.0,
  17444. * 20.0, 47.0, 10000.0,
  17445. * 19.0, 47.0, 10000.0
  17446. * ])
  17447. * });
  17448. * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  17449. * @param options - Object with the following properties:
  17450. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17451. * @param [options.granularity = Math.RADIANS_PER_DEGREE] - The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
  17452. * @param [options.maximumHeights] - An array parallel to <code>positions</code> that give the maximum height of the
  17453. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17454. * @param [options.minimumHeights] - An array parallel to <code>positions</code> that give the minimum height of the
  17455. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17456. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17457. */
  17458. export class WallOutlineGeometry {
  17459. constructor(options: {
  17460. positions: Cartesian3[];
  17461. granularity?: number;
  17462. maximumHeights?: number[];
  17463. minimumHeights?: number[];
  17464. ellipsoid?: Ellipsoid;
  17465. });
  17466. /**
  17467. * The number of elements used to pack the object into an array.
  17468. */
  17469. packedLength: number;
  17470. /**
  17471. * Stores the provided instance into the provided array.
  17472. * @param value - The value to pack.
  17473. * @param array - The array to pack into.
  17474. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  17475. * @returns The array that was packed into
  17476. */
  17477. static pack(value: WallOutlineGeometry, array: number[], startingIndex?: number): number[];
  17478. /**
  17479. * Retrieves an instance from a packed array.
  17480. * @param array - The packed array.
  17481. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  17482. * @param [result] - The object into which to store the result.
  17483. * @returns The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
  17484. */
  17485. static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry;
  17486. /**
  17487. * A description of a walloutline. A wall is defined by a series of points,
  17488. * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
  17489. * @example
  17490. * // create a wall that spans from 10000 meters to 20000 meters
  17491. * const wall = Cesium.WallOutlineGeometry.fromConstantHeights({
  17492. * positions : Cesium.Cartesian3.fromDegreesArray([
  17493. * 19.0, 47.0,
  17494. * 19.0, 48.0,
  17495. * 20.0, 48.0,
  17496. * 20.0, 47.0,
  17497. * 19.0, 47.0,
  17498. * ]),
  17499. * minimumHeight : 20000.0,
  17500. * maximumHeight : 10000.0
  17501. * });
  17502. * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
  17503. * @param options - Object with the following properties:
  17504. * @param options.positions - An array of Cartesian objects, which are the points of the wall.
  17505. * @param [options.maximumHeight] - A constant that defines the maximum height of the
  17506. * wall at <code>positions</code>. If undefined, the height of each position in used.
  17507. * @param [options.minimumHeight] - A constant that defines the minimum height of the
  17508. * wall at <code>positions</code>. If undefined, the height at each position is 0.0.
  17509. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for coordinate manipulation
  17510. */
  17511. static fromConstantHeights(options: {
  17512. positions: Cartesian3[];
  17513. maximumHeight?: number;
  17514. minimumHeight?: number;
  17515. ellipsoid?: Ellipsoid;
  17516. }): WallOutlineGeometry;
  17517. /**
  17518. * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
  17519. * @param wallGeometry - A description of the wall outline.
  17520. * @returns The computed vertices and indices.
  17521. */
  17522. static createGeometry(wallGeometry: WallOutlineGeometry): Geometry | undefined;
  17523. }
  17524. /**
  17525. * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This
  17526. * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using
  17527. * the spherical (rather than ellipsoidal) equations.
  17528. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
  17529. */
  17530. export class WebMercatorProjection {
  17531. constructor(ellipsoid?: Ellipsoid);
  17532. /**
  17533. * Gets the {@link Ellipsoid}.
  17534. */
  17535. readonly ellipsoid: Ellipsoid;
  17536. /**
  17537. * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
  17538. * in the range -PI/2 to PI/2.
  17539. * @param mercatorAngle - The angle to convert.
  17540. * @returns The geodetic latitude in radians.
  17541. */
  17542. static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number;
  17543. /**
  17544. * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
  17545. * angle in the range -PI to PI.
  17546. * @param latitude - The geodetic latitude in radians.
  17547. * @returns The Mercator angle.
  17548. */
  17549. static geodeticLatitudeToMercatorAngle(latitude: number): number;
  17550. /**
  17551. * The maximum latitude (both North and South) supported by a Web Mercator
  17552. * (EPSG:3857) projection. Technically, the Mercator projection is defined
  17553. * for any latitude up to (but not including) 90 degrees, but it makes sense
  17554. * to cut it off sooner because it grows exponentially with increasing latitude.
  17555. * The logic behind this particular cutoff value, which is the one used by
  17556. * Google Maps, Bing Maps, and Esri, is that it makes the projection
  17557. * square. That is, the rectangle is equal in the X and Y directions.
  17558. *
  17559. * The constant value is computed by calling:
  17560. * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
  17561. */
  17562. static MaximumLatitude: number;
  17563. /**
  17564. * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
  17565. * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
  17566. * is copied unmodified to the Z coordinate.
  17567. * @param cartographic - The cartographic coordinates in radians.
  17568. * @param [result] - The instance to which to copy the result, or undefined if a
  17569. * new instance should be created.
  17570. * @returns The equivalent web mercator X, Y, Z coordinates, in meters.
  17571. */
  17572. project(cartographic: Cartographic, result?: Cartesian3): Cartesian3;
  17573. /**
  17574. * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
  17575. * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
  17576. * height.
  17577. * @param cartesian - The web mercator Cartesian position to unrproject with height (z) in meters.
  17578. * @param [result] - The instance to which to copy the result, or undefined if a
  17579. * new instance should be created.
  17580. * @returns The equivalent cartographic coordinates.
  17581. */
  17582. unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic;
  17583. }
  17584. /**
  17585. * A tiling scheme for geometry referenced to a {@link WebMercatorProjection}, EPSG:3857. This is
  17586. * the tiling scheme used by Google Maps, Microsoft Bing Maps, and most of ESRI ArcGIS Online.
  17587. * @param [options] - Object with the following properties:
  17588. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid whose surface is being tiled. Defaults to
  17589. * the WGS84 ellipsoid.
  17590. * @param [options.numberOfLevelZeroTilesX = 1] - The number of tiles in the X direction at level zero of
  17591. * the tile tree.
  17592. * @param [options.numberOfLevelZeroTilesY = 1] - The number of tiles in the Y direction at level zero of
  17593. * the tile tree.
  17594. * @param [options.rectangleSouthwestInMeters] - The southwest corner of the rectangle covered by the
  17595. * tiling scheme, in meters. If this parameter or rectangleNortheastInMeters is not specified, the entire
  17596. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  17597. * direction, resulting in a square projection.
  17598. * @param [options.rectangleNortheastInMeters] - The northeast corner of the rectangle covered by the
  17599. * tiling scheme, in meters. If this parameter or rectangleSouthwestInMeters is not specified, the entire
  17600. * globe is covered in the longitude direction and an equal distance is covered in the latitude
  17601. * direction, resulting in a square projection.
  17602. */
  17603. export class WebMercatorTilingScheme {
  17604. constructor(options?: {
  17605. ellipsoid?: Ellipsoid;
  17606. numberOfLevelZeroTilesX?: number;
  17607. numberOfLevelZeroTilesY?: number;
  17608. rectangleSouthwestInMeters?: Cartesian2;
  17609. rectangleNortheastInMeters?: Cartesian2;
  17610. });
  17611. /**
  17612. * Gets the ellipsoid that is tiled by this tiling scheme.
  17613. */
  17614. ellipsoid: Ellipsoid;
  17615. /**
  17616. * Gets the rectangle, in radians, covered by this tiling scheme.
  17617. */
  17618. rectangle: Rectangle;
  17619. /**
  17620. * Gets the map projection used by this tiling scheme.
  17621. */
  17622. projection: MapProjection;
  17623. /**
  17624. * Gets the total number of tiles in the X direction at a specified level-of-detail.
  17625. * @param level - The level-of-detail.
  17626. * @returns The number of tiles in the X direction at the given level.
  17627. */
  17628. getNumberOfXTilesAtLevel(level: number): number;
  17629. /**
  17630. * Gets the total number of tiles in the Y direction at a specified level-of-detail.
  17631. * @param level - The level-of-detail.
  17632. * @returns The number of tiles in the Y direction at the given level.
  17633. */
  17634. getNumberOfYTilesAtLevel(level: number): number;
  17635. /**
  17636. * Transforms a rectangle specified in geodetic radians to the native coordinate system
  17637. * of this tiling scheme.
  17638. * @param rectangle - The rectangle to transform.
  17639. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17640. * should be created.
  17641. * @returns The specified 'result', or a new object containing the native rectangle if 'result'
  17642. * is undefined.
  17643. */
  17644. rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle;
  17645. /**
  17646. * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
  17647. * of the tiling scheme.
  17648. * @param x - The integer x coordinate of the tile.
  17649. * @param y - The integer y coordinate of the tile.
  17650. * @param level - The tile level-of-detail. Zero is the least detailed.
  17651. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17652. * should be created.
  17653. * @returns The specified 'result', or a new object containing the rectangle
  17654. * if 'result' is undefined.
  17655. */
  17656. tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17657. /**
  17658. * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
  17659. * @param x - The integer x coordinate of the tile.
  17660. * @param y - The integer y coordinate of the tile.
  17661. * @param level - The tile level-of-detail. Zero is the least detailed.
  17662. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17663. * should be created.
  17664. * @returns The specified 'result', or a new object containing the rectangle
  17665. * if 'result' is undefined.
  17666. */
  17667. tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle;
  17668. /**
  17669. * Calculates the tile x, y coordinates of the tile containing
  17670. * a given cartographic position.
  17671. * @param position - The position.
  17672. * @param level - The tile level-of-detail. Zero is the least detailed.
  17673. * @param [result] - The instance to which to copy the result, or undefined if a new instance
  17674. * should be created.
  17675. * @returns The specified 'result', or a new object containing the tile x, y coordinates
  17676. * if 'result' is undefined.
  17677. */
  17678. positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2;
  17679. }
  17680. /**
  17681. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  17682. */
  17683. export enum WindingOrder {
  17684. /**
  17685. * Vertices are in clockwise order.
  17686. */
  17687. CLOCKWISE = WebGLConstants.CW,
  17688. /**
  17689. * Vertices are in counter-clockwise order.
  17690. */
  17691. COUNTER_CLOCKWISE = WebGLConstants.CCW
  17692. }
  17693. /**
  17694. * Computes the barycentric coordinates for a point with respect to a triangle.
  17695. * @example
  17696. * // Returns Cartesian3.UNIT_X
  17697. * const p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);
  17698. * const b = Cesium.barycentricCoordinates(p,
  17699. * new Cesium.Cartesian3(-1.0, 0.0, 0.0),
  17700. * new Cesium.Cartesian3( 1.0, 0.0, 0.0),
  17701. * new Cesium.Cartesian3( 0.0, 1.0, 1.0));
  17702. * @param point - The point to test.
  17703. * @param p0 - The first point of the triangle, corresponding to the barycentric x-axis.
  17704. * @param p1 - The second point of the triangle, corresponding to the barycentric y-axis.
  17705. * @param p2 - The third point of the triangle, corresponding to the barycentric z-axis.
  17706. * @param [result] - The object onto which to store the result.
  17707. * @returns The modified result parameter or a new Cartesian3 instance if one was not provided. If the triangle is degenerate the function will return undefined.
  17708. */
  17709. export function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3 | undefined;
  17710. /**
  17711. * Finds an item in a sorted array.
  17712. * @example
  17713. * // Create a comparator function to search through an array of numbers.
  17714. * function comparator(a, b) {
  17715. * return a - b;
  17716. * };
  17717. * const numbers = [0, 2, 4, 6, 8];
  17718. * const index = Cesium.binarySearch(numbers, 6, comparator); // 3
  17719. * @param array - The sorted array to search.
  17720. * @param itemToFind - The item to find in the array.
  17721. * @param comparator - The function to use to compare the item to
  17722. * elements in the array.
  17723. * @returns The index of <code>itemToFind</code> in the array, if it exists. If <code>itemToFind</code>
  17724. * does not exist, the return value is a negative number which is the bitwise complement (~)
  17725. * of the index before which the itemToFind should be inserted in order to maintain the
  17726. * sorted order of the array.
  17727. */
  17728. export function binarySearch(array: any[], itemToFind: any, comparator: binarySearchComparator): number;
  17729. /**
  17730. * A function used to compare two items while performing a binary search.
  17731. * @example
  17732. * function compareNumbers(a, b) {
  17733. * return a - b;
  17734. * }
  17735. * @param a - An item in the array.
  17736. * @param b - The item being searched for.
  17737. */
  17738. export type binarySearchComparator = (a: any, b: any) => number;
  17739. /**
  17740. * Given a relative URL under the Cesium base URL, returns an absolute URL.
  17741. * @example
  17742. * const viewer = new Cesium.Viewer("cesiumContainer", {
  17743. * imageryProvider: new Cesium.TileMapServiceImageryProvider({
  17744. * url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
  17745. * }),
  17746. * baseLayerPicker: false,
  17747. * });
  17748. * @param relativeUrl - The relative path.
  17749. * @returns The absolutely URL representation of the provided path.
  17750. */
  17751. export function buildModuleUrl(relativeUrl: string): string;
  17752. /**
  17753. * A browser-independent function to cancel an animation frame requested using {@link requestAnimationFrame}.
  17754. * @param requestID - The value returned by {@link requestAnimationFrame}.
  17755. */
  17756. export function cancelAnimationFrame(requestID: number): void;
  17757. /**
  17758. * Clones an object, returning a new object containing the same properties.
  17759. * @param object - The object to clone.
  17760. * @param [deep = false] - If true, all properties will be deep cloned recursively.
  17761. * @returns The cloned object.
  17762. */
  17763. export function clone(object: any, deep?: boolean): any;
  17764. /**
  17765. * Merges two objects, copying their properties onto a new combined object. When two objects have the same
  17766. * property, the value of the property on the first object is used. If either object is undefined,
  17767. * it will be treated as an empty object.
  17768. * @example
  17769. * const object1 = {
  17770. * propOne : 1,
  17771. * propTwo : {
  17772. * value1 : 10
  17773. * }
  17774. * }
  17775. * const object2 = {
  17776. * propTwo : 2
  17777. * }
  17778. * const final = Cesium.combine(object1, object2);
  17779. *
  17780. * // final === {
  17781. * // propOne : 1,
  17782. * // propTwo : {
  17783. * // value1 : 10
  17784. * // }
  17785. * // }
  17786. * @param [object1] - The first object to merge.
  17787. * @param [object2] - The second object to merge.
  17788. * @param [deep = false] - Perform a recursive merge.
  17789. * @returns The combined object containing all properties from both objects.
  17790. */
  17791. export function combine(object1?: any, object2?: any, deep?: boolean): any;
  17792. /**
  17793. * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time.
  17794. * @example
  17795. * this.guid = Cesium.createGuid();
  17796. */
  17797. export function createGuid(): string;
  17798. /**
  17799. * Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.
  17800. * @example
  17801. * // Create Cesium World Terrain with default settings
  17802. * const viewer = new Cesium.Viewer('cesiumContainer', {
  17803. * terrainProvider : Cesium.createWorldTerrain();
  17804. * });
  17805. * @example
  17806. * // Create Cesium World Terrain with water and normals.
  17807. * const viewer1 = new Cesium.Viewer('cesiumContainer', {
  17808. * terrainProvider : Cesium.createWorldTerrain({
  17809. * requestWaterMask : true,
  17810. * requestVertexNormals : true
  17811. * });
  17812. * });
  17813. * @param [options] - Object with the following properties:
  17814. * @param [options.requestVertexNormals = false] - Flag that indicates if the client should request additional lighting information from the server if available.
  17815. * @param [options.requestWaterMask = false] - Flag that indicates if the client should request per tile water masks from the server if available.
  17816. */
  17817. export function createWorldTerrain(options?: {
  17818. requestVertexNormals?: boolean;
  17819. requestWaterMask?: boolean;
  17820. }): CesiumTerrainProvider;
  17821. /**
  17822. * Returns the first parameter if not undefined, otherwise the second parameter.
  17823. * Useful for setting a default value for a parameter.
  17824. * @example
  17825. * param = Cesium.defaultValue(param, 'default');
  17826. * @returns Returns the first parameter if not undefined, otherwise the second parameter.
  17827. */
  17828. export function defaultValue(a: any, b: any): any;
  17829. /**
  17830. * @example
  17831. * if (Cesium.defined(positions)) {
  17832. * doSomething();
  17833. * } else {
  17834. * doSomethingElse();
  17835. * }
  17836. * @param value - The object.
  17837. * @returns Returns true if the object is defined, returns false otherwise.
  17838. */
  17839. export function defined(value: any): boolean;
  17840. /**
  17841. * Destroys an object. Each of the object's functions, including functions in its prototype,
  17842. * is replaced with a function that throws a {@link DeveloperError}, except for the object's
  17843. * <code>isDestroyed</code> function, which is set to a function that returns <code>true</code>.
  17844. * The object's properties are removed with <code>delete</code>.
  17845. * <br /><br />
  17846. * This function is used by objects that hold native resources, e.g., WebGL resources, which
  17847. * need to be explicitly released. Client code calls an object's <code>destroy</code> function,
  17848. * which then releases the native resource and calls <code>destroyObject</code> to put itself
  17849. * in a destroyed state.
  17850. * @example
  17851. * // How a texture would destroy itself.
  17852. * this.destroy = function () {
  17853. * _gl.deleteTexture(_texture);
  17854. * return Cesium.destroyObject(this);
  17855. * };
  17856. * @param object - The object to destroy.
  17857. * @param [message] - The message to include in the exception that is thrown if
  17858. * a destroyed object's function is called.
  17859. */
  17860. export function destroyObject(object: any, message?: string): void;
  17861. /**
  17862. * Formats an error object into a String. If available, uses name, message, and stack
  17863. * properties, otherwise, falls back on toString().
  17864. * @param object - The item to find in the array.
  17865. * @returns A string containing the formatted error.
  17866. */
  17867. export function formatError(object: any): string;
  17868. /**
  17869. * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.
  17870. * @example
  17871. * //absolute Uri will be "https://test.com/awesome.png";
  17872. * const absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');
  17873. * @param relative - The relative Uri.
  17874. * @param [base] - The base Uri.
  17875. * @returns The absolute Uri of the given relative Uri.
  17876. */
  17877. export function getAbsoluteUri(relative: string, base?: string): string;
  17878. /**
  17879. * Given a URI, returns the base path of the URI.
  17880. * @example
  17881. * // basePath will be "/Gallery/";
  17882. * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');
  17883. *
  17884. * // basePath will be "/Gallery/?value=true&example=false";
  17885. * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);
  17886. * @param uri - The Uri.
  17887. * @param [includeQuery = false] - Whether or not to include the query string and fragment form the uri
  17888. * @returns The base path of the Uri.
  17889. */
  17890. export function getBaseUri(uri: string, includeQuery?: boolean): string;
  17891. /**
  17892. * Given a URI, returns the extension of the URI.
  17893. * @example
  17894. * //extension will be "czml";
  17895. * const extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');
  17896. * @param uri - The Uri.
  17897. * @returns The extension of the Uri.
  17898. */
  17899. export function getExtensionFromUri(uri: string): string;
  17900. /**
  17901. * Given a URI, returns the last segment of the URI, removing any path or query information.
  17902. * @example
  17903. * //fileName will be"simple.czml";
  17904. * const fileName = Cesium.getFilenameFromUri('/Gallery/simple.czml?value=true&example=false');
  17905. * @param uri - The Uri.
  17906. * @returns The last segment of the Uri.
  17907. */
  17908. export function getFilenameFromUri(uri: string): string;
  17909. /**
  17910. * Extract a pixel array from a loaded image. Draws the image
  17911. * into a canvas so it can read the pixels back.
  17912. * @param image - The image to extract pixels from.
  17913. * @param width - The width of the image. If not defined, then image.width is assigned.
  17914. * @param height - The height of the image. If not defined, then image.height is assigned.
  17915. * @returns The pixels of the image.
  17916. */
  17917. export function getImagePixels(image: HTMLImageElement | ImageBitmap, width: number, height: number): ImageData;
  17918. /**
  17919. * Gets a timestamp that can be used in measuring the time between events. Timestamps
  17920. * are expressed in milliseconds, but it is not specified what the milliseconds are
  17921. * measured from. This function uses performance.now() if it is available, or Date.now()
  17922. * otherwise.
  17923. * @returns The timestamp in milliseconds since some unspecified reference time.
  17924. */
  17925. export function getTimestamp(): number;
  17926. /**
  17927. * Determines if a given date is a leap year.
  17928. * @example
  17929. * const leapYear = Cesium.isLeapYear(2000); // true
  17930. * @param year - The year to be tested.
  17931. * @returns True if <code>year</code> is a leap year.
  17932. */
  17933. export function isLeapYear(year: number): boolean;
  17934. /**
  17935. * A stable merge sort.
  17936. * @example
  17937. * // Assume array contains BoundingSpheres in world coordinates.
  17938. * // Sort them in ascending order of distance from the camera.
  17939. * const position = camera.positionWC;
  17940. * Cesium.mergeSort(array, function(a, b, position) {
  17941. * return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position);
  17942. * }, position);
  17943. * @param array - The array to sort.
  17944. * @param comparator - The function to use to compare elements in the array.
  17945. * @param [userDefinedObject] - Any item to pass as the third parameter to <code>comparator</code>.
  17946. */
  17947. export function mergeSort(array: any[], comparator: mergeSortComparator, userDefinedObject?: any): void;
  17948. /**
  17949. * A function used to compare two items while performing a merge sort.
  17950. * @example
  17951. * function compareNumbers(a, b, userDefinedObject) {
  17952. * return a - b;
  17953. * }
  17954. * @param a - An item in the array.
  17955. * @param b - An item in the array.
  17956. * @param [userDefinedObject] - An object that was passed to {@link mergeSort}.
  17957. */
  17958. export type mergeSortComparator = (a: any, b: any, userDefinedObject?: any) => number;
  17959. /**
  17960. * Converts an object representing a set of name/value pairs into a query string,
  17961. * with names and values encoded properly for use in a URL. Values that are arrays
  17962. * will produce multiple values with the same name.
  17963. * @example
  17964. * const str = Cesium.objectToQuery({
  17965. * key1 : 'some value',
  17966. * key2 : 'a/b',
  17967. * key3 : ['x', 'y']
  17968. * });
  17969. * @param obj - The object containing data to encode.
  17970. * @returns An encoded query string.
  17971. */
  17972. export function objectToQuery(obj: any): string;
  17973. /**
  17974. * Determines if a point is inside a triangle.
  17975. * @example
  17976. * // Returns true
  17977. * const p = new Cesium.Cartesian2(0.25, 0.25);
  17978. * const b = Cesium.pointInsideTriangle(p,
  17979. * new Cesium.Cartesian2(0.0, 0.0),
  17980. * new Cesium.Cartesian2(1.0, 0.0),
  17981. * new Cesium.Cartesian2(0.0, 1.0));
  17982. * @param point - The point to test.
  17983. * @param p0 - The first point of the triangle.
  17984. * @param p1 - The second point of the triangle.
  17985. * @param p2 - The third point of the triangle.
  17986. * @returns <code>true</code> if the point is inside the triangle; otherwise, <code>false</code>.
  17987. */
  17988. export function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean;
  17989. /**
  17990. * Parses a query string into an object, where the keys and values of the object are the
  17991. * name/value pairs from the query string, decoded. If a name appears multiple times,
  17992. * the value in the object will be an array of values.
  17993. * @example
  17994. * const obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
  17995. * // obj will be:
  17996. * // {
  17997. * // key1 : 'some value',
  17998. * // key2 : 'a/b',
  17999. * // key3 : ['x', 'y']
  18000. * // }
  18001. * @param queryString - The query string.
  18002. * @returns An object containing the parameters parsed from the query string.
  18003. */
  18004. export function queryToObject(queryString: string): any;
  18005. /**
  18006. * A browser-independent function to request a new animation frame. This is used to create
  18007. * an application's draw loop as shown in the example below.
  18008. * @example
  18009. * // Create a draw loop using requestAnimationFrame. The
  18010. * // tick callback function is called for every animation frame.
  18011. * function tick() {
  18012. * scene.render();
  18013. * Cesium.requestAnimationFrame(tick);
  18014. * }
  18015. * tick();
  18016. * @param callback - The function to call when the next frame should be drawn.
  18017. * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request.
  18018. */
  18019. export function requestAnimationFrame(callback: requestAnimationFrameCallback): number;
  18020. /**
  18021. * A function that will be called when the next frame should be drawn.
  18022. * @param timestamp - A timestamp for the frame, in milliseconds.
  18023. */
  18024. export type requestAnimationFrameCallback = (timestamp: number) => void;
  18025. /**
  18026. * Initiates a terrain height query for an array of {@link Cartographic} positions by
  18027. * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation
  18028. * matches the triangles used to render the terrain at the specified level. The query
  18029. * happens asynchronously, so this function returns a promise that is resolved when
  18030. * the query completes. Each point height is modified in place. If a height can not be
  18031. * determined because no terrain data is available for the specified level at that location,
  18032. * or another error occurs, the height is set to undefined. As is typical of the
  18033. * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid
  18034. * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other
  18035. * words, it will not necessarily be 0.0 if sampled in the ocean. This function needs the
  18036. * terrain level of detail as input, if you need to get the altitude of the terrain as precisely
  18037. * as possible (i.e. with maximum level of detail) use {@link sampleTerrainMostDetailed}.
  18038. * @example
  18039. * // Query the terrain height of two Cartographic positions
  18040. * const terrainProvider = Cesium.createWorldTerrain();
  18041. * const positions = [
  18042. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  18043. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  18044. * ];
  18045. * const promise = Cesium.sampleTerrain(terrainProvider, 11, positions);
  18046. * Promise.resolve(promise).then(function(updatedPositions) {
  18047. * // positions[0].height and positions[1].height have been updated.
  18048. * // updatedPositions is just a reference to positions.
  18049. * });
  18050. * @param terrainProvider - The terrain provider from which to query heights.
  18051. * @param level - The terrain level-of-detail from which to query terrain heights.
  18052. * @param positions - The positions to update with terrain heights.
  18053. * @returns A promise that resolves to the provided list of positions when terrain the query has completed.
  18054. */
  18055. export function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise<Cartographic[]>;
  18056. /**
  18057. * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset.
  18058. * @example
  18059. * // Query the terrain height of two Cartographic positions
  18060. * const terrainProvider = Cesium.createWorldTerrain();
  18061. * const positions = [
  18062. * Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
  18063. * Cesium.Cartographic.fromDegrees(87.0, 28.0)
  18064. * ];
  18065. * const promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  18066. * Promise.resolve(promise).then(function(updatedPositions) {
  18067. * // positions[0].height and positions[1].height have been updated.
  18068. * // updatedPositions is just a reference to positions.
  18069. * });
  18070. * @param terrainProvider - The terrain provider from which to query heights.
  18071. * @param positions - The positions to update with terrain heights.
  18072. * @returns A promise that resolves to the provided list of positions when terrain the query has completed. This
  18073. * promise will reject if the terrain provider's `availability` property is undefined.
  18074. */
  18075. export function sampleTerrainMostDetailed(terrainProvider: TerrainProvider, positions: Cartographic[]): Promise<Cartographic[]>;
  18076. /**
  18077. * Subdivides an array into a number of smaller, equal sized arrays.
  18078. * @param array - The array to divide.
  18079. * @param numberOfArrays - The number of arrays to divide the provided array into.
  18080. */
  18081. export function subdivideArray(array: any[], numberOfArrays: number): void;
  18082. /**
  18083. * Writes the given text into a new canvas. The canvas will be sized to fit the text.
  18084. * If text is blank, returns undefined.
  18085. * @param text - The text to write.
  18086. * @param [options] - Object with the following properties:
  18087. * @param [options.font = '10px sans-serif'] - The CSS font to use.
  18088. * @param [options.textBaseline = 'bottom'] - The baseline of the text.
  18089. * @param [options.fill = true] - Whether to fill the text.
  18090. * @param [options.stroke = false] - Whether to stroke the text.
  18091. * @param [options.fillColor = Color.WHITE] - The fill color.
  18092. * @param [options.strokeColor = Color.BLACK] - The stroke color.
  18093. * @param [options.strokeWidth = 1] - The stroke width.
  18094. * @param [options.backgroundColor = Color.TRANSPARENT] - The background color of the canvas.
  18095. * @param [options.padding = 0] - The pixel size of the padding to add around the text.
  18096. * @returns A new canvas with the given text drawn into it. The dimensions object
  18097. * from measureText will also be added to the returned canvas. If text is
  18098. * blank, returns undefined.
  18099. */
  18100. export function writeTextToCanvas(text: string, options?: {
  18101. font?: string;
  18102. textBaseline?: string;
  18103. fill?: boolean;
  18104. stroke?: boolean;
  18105. fillColor?: Color;
  18106. strokeColor?: Color;
  18107. strokeWidth?: number;
  18108. backgroundColor?: Color;
  18109. padding?: number;
  18110. }): HTMLCanvasElement | undefined;
  18111. export namespace BillboardGraphics {
  18112. /**
  18113. * Initialization options for the BillboardGraphics constructor
  18114. * @property [show = true] - A boolean Property specifying the visibility of the billboard.
  18115. * @property [image] - A Property specifying the Image, URI, or Canvas to use for the billboard.
  18116. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the image size.
  18117. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  18118. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  18119. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  18120. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  18121. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  18122. * @property [color = Color.WHITE] - A Property specifying the tint {@link Color} of the image.
  18123. * @property [rotation = 0] - A numeric Property specifying the rotation about the alignedAxis.
  18124. * @property [alignedAxis = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the unit vector axis of rotation.
  18125. * @property [sizeInMeters] - A boolean Property specifying whether this billboard's size should be measured in meters.
  18126. * @property [width] - A numeric Property specifying the width of the billboard in pixels, overriding the native size.
  18127. * @property [height] - A numeric Property specifying the height of the billboard in pixels, overriding the native size.
  18128. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance from the camera.
  18129. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  18130. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  18131. * @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.
  18132. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this billboard will be displayed.
  18133. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  18134. */
  18135. type ConstructorOptions = {
  18136. show?: Property | boolean;
  18137. image?: Property | string | HTMLCanvasElement;
  18138. scale?: Property | number;
  18139. pixelOffset?: Property | Cartesian2;
  18140. eyeOffset?: Property | Cartesian3;
  18141. horizontalOrigin?: Property | HorizontalOrigin;
  18142. verticalOrigin?: Property | VerticalOrigin;
  18143. heightReference?: Property | HeightReference;
  18144. color?: Property | Color;
  18145. rotation?: Property | number;
  18146. alignedAxis?: Property | Cartesian3;
  18147. sizeInMeters?: Property | boolean;
  18148. width?: Property | number;
  18149. height?: Property | number;
  18150. scaleByDistance?: Property | NearFarScalar;
  18151. translucencyByDistance?: Property | NearFarScalar;
  18152. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  18153. imageSubRegion?: Property | BoundingRectangle;
  18154. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18155. disableDepthTestDistance?: Property | number;
  18156. };
  18157. }
  18158. /**
  18159. * Describes a two dimensional icon located at the position of the containing {@link Entity}.
  18160. * <p>
  18161. * <div align='center'>
  18162. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  18163. * Example billboards
  18164. * </div>
  18165. * </p>
  18166. * @param [options] - Object describing initialization options
  18167. */
  18168. export class BillboardGraphics {
  18169. constructor(options?: BillboardGraphics.ConstructorOptions);
  18170. /**
  18171. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18172. */
  18173. readonly definitionChanged: Event;
  18174. /**
  18175. * Gets or sets the boolean Property specifying the visibility of the billboard.
  18176. */
  18177. show: Property | undefined;
  18178. /**
  18179. * Gets or sets the Property specifying the Image, URI, or Canvas to use for the billboard.
  18180. */
  18181. image: Property | undefined;
  18182. /**
  18183. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  18184. * A scale greater than <code>1.0</code> enlarges the billboard while a scale less than <code>1.0</code> shrinks it.
  18185. * <p>
  18186. * <div align='center'>
  18187. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  18188. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>, and <code>2.0</code>.
  18189. * </div>
  18190. * </p>
  18191. */
  18192. scale: Property | undefined;
  18193. /**
  18194. * Gets or sets the {@link Cartesian2} Property specifying the billboard's pixel offset in screen space
  18195. * from the origin of this billboard. This is commonly used to align multiple billboards and labels at
  18196. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  18197. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  18198. * <p>
  18199. * <div align='center'>
  18200. * <table border='0' cellpadding='5'><tr>
  18201. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  18202. * <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>
  18203. * </tr></table>
  18204. * The billboard's origin is indicated by the yellow point.
  18205. * </div>
  18206. * </p>
  18207. */
  18208. pixelOffset: Property | undefined;
  18209. /**
  18210. * Gets or sets the {@link Cartesian3} Property specifying the billboard's offset in eye coordinates.
  18211. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  18212. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  18213. * <p>
  18214. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  18215. * arrange a billboard above its corresponding 3D model.
  18216. * </p>
  18217. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  18218. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  18219. * <p>
  18220. * <div align='center'>
  18221. * <table border='0' cellpadding='5'><tr>
  18222. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  18223. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  18224. * </tr></table>
  18225. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code>
  18226. * </div>
  18227. * </p>
  18228. */
  18229. eyeOffset: Property | undefined;
  18230. /**
  18231. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  18232. */
  18233. horizontalOrigin: Property | undefined;
  18234. /**
  18235. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  18236. */
  18237. verticalOrigin: Property | undefined;
  18238. /**
  18239. * Gets or sets the Property specifying the {@link HeightReference}.
  18240. */
  18241. heightReference: Property | undefined;
  18242. /**
  18243. * Gets or sets the Property specifying the {@link Color} that is multiplied with the <code>image</code>.
  18244. * This has two common use cases. First, the same white texture may be used by many different billboards,
  18245. * each with a different color, to create colored billboards. Second, the color's alpha component can be
  18246. * used to make the billboard translucent as shown below. An alpha of <code>0.0</code> makes the billboard
  18247. * transparent, and <code>1.0</code> makes the billboard opaque.
  18248. * <p>
  18249. * <div align='center'>
  18250. * <table border='0' cellpadding='5'><tr>
  18251. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  18252. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  18253. * </tr></table>
  18254. * </div>
  18255. * </p>
  18256. */
  18257. color: Property | undefined;
  18258. /**
  18259. * Gets or sets the numeric Property specifying the rotation of the image
  18260. * counter clockwise from the <code>alignedAxis</code>.
  18261. */
  18262. rotation: Property | undefined;
  18263. /**
  18264. * Gets or sets the {@link Cartesian3} Property specifying the unit vector axis of rotation
  18265. * in the fixed frame. When set to Cartesian3.ZERO the rotation is from the top of the screen.
  18266. */
  18267. alignedAxis: Property | undefined;
  18268. /**
  18269. * Gets or sets the boolean Property specifying if this billboard's size will be measured in meters.
  18270. */
  18271. sizeInMeters: Property | undefined;
  18272. /**
  18273. * Gets or sets the numeric Property specifying the width of the billboard in pixels.
  18274. * When undefined, the native width is used.
  18275. */
  18276. width: Property | undefined;
  18277. /**
  18278. * Gets or sets the numeric Property specifying the height of the billboard in pixels.
  18279. * When undefined, the native height is used.
  18280. */
  18281. height: Property | undefined;
  18282. /**
  18283. * Gets or sets {@link NearFarScalar} Property specifying the scale of the billboard based on the distance from the camera.
  18284. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  18285. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18286. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18287. * Outside of these ranges the billboard's scale remains clamped to the nearest bound.
  18288. */
  18289. scaleByDistance: Property | undefined;
  18290. /**
  18291. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the billboard based on the distance from the camera.
  18292. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  18293. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18294. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18295. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound.
  18296. */
  18297. translucencyByDistance: Property | undefined;
  18298. /**
  18299. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the billboard based on the distance from the camera.
  18300. * A billboard's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  18301. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  18302. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  18303. * Outside of these ranges the billboard's pixel offset remains clamped to the nearest bound.
  18304. */
  18305. pixelOffsetScaleByDistance: Property | undefined;
  18306. /**
  18307. * Gets or sets the Property specifying a {@link BoundingRectangle} that defines a
  18308. * sub-region of the <code>image</code> to use for the billboard, rather than the entire image,
  18309. * measured in pixels from the bottom-left.
  18310. */
  18311. imageSubRegion: Property | undefined;
  18312. /**
  18313. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this billboard will be displayed.
  18314. */
  18315. distanceDisplayCondition: Property | undefined;
  18316. /**
  18317. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  18318. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  18319. */
  18320. disableDepthTestDistance: Property | undefined;
  18321. /**
  18322. * Duplicates this instance.
  18323. * @param [result] - The object onto which to store the result.
  18324. * @returns The modified result parameter or a new instance if one was not provided.
  18325. */
  18326. clone(result?: BillboardGraphics): BillboardGraphics;
  18327. /**
  18328. * Assigns each unassigned property on this object to the value
  18329. * of the same property on the provided source object.
  18330. * @param source - The object to be merged into this object.
  18331. */
  18332. merge(source: BillboardGraphics): void;
  18333. }
  18334. /**
  18335. * A {@link Visualizer} which maps {@link Entity#billboard} to a {@link Billboard}.
  18336. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  18337. * @param entityCollection - The entityCollection to visualize.
  18338. */
  18339. export class BillboardVisualizer {
  18340. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  18341. /**
  18342. * Updates the primitives created by this visualizer to match their
  18343. * Entity counterpart at the given time.
  18344. * @param time - The time to update to.
  18345. * @returns This function always returns true.
  18346. */
  18347. update(time: JulianDate): boolean;
  18348. /**
  18349. * Returns true if this object was destroyed; otherwise, false.
  18350. * @returns True if this object was destroyed; otherwise, false.
  18351. */
  18352. isDestroyed(): boolean;
  18353. /**
  18354. * Removes and destroys all primitives created by this instance.
  18355. */
  18356. destroy(): void;
  18357. }
  18358. /**
  18359. * A {@link GeometryUpdater} for boxes.
  18360. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  18361. * @param entity - The entity containing the geometry to be visualized.
  18362. * @param scene - The scene where visualization is taking place.
  18363. */
  18364. export class BoxGeometryUpdater {
  18365. constructor(entity: Entity, scene: Scene);
  18366. /**
  18367. * Creates the geometry instance which represents the fill of the geometry.
  18368. * @param time - The time to use when retrieving initial attribute values.
  18369. * @returns The geometry instance representing the filled portion of the geometry.
  18370. */
  18371. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  18372. /**
  18373. * Creates the geometry instance which represents the outline of the geometry.
  18374. * @param time - The time to use when retrieving initial attribute values.
  18375. * @returns The geometry instance representing the outline portion of the geometry.
  18376. */
  18377. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  18378. }
  18379. export namespace BoxGraphics {
  18380. /**
  18381. * Initialization options for the BoxGraphics constructor
  18382. * @property [show = true] - A boolean Property specifying the visibility of the box.
  18383. * @property [dimensions] - A {@link Cartesian3} Property specifying the length, width, and height of the box.
  18384. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  18385. * @property [fill = true] - A boolean Property specifying whether the box is filled with the provided material.
  18386. * @property [material = Color.WHITE] - A Property specifying the material used to fill the box.
  18387. * @property [outline = false] - A boolean Property specifying whether the box is outlined.
  18388. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  18389. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  18390. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the box casts or receives shadows from light sources.
  18391. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this box will be displayed.
  18392. */
  18393. type ConstructorOptions = {
  18394. show?: Property | boolean;
  18395. dimensions?: Property | Cartesian3;
  18396. heightReference?: Property | HeightReference;
  18397. fill?: Property | boolean;
  18398. material?: MaterialProperty | Color;
  18399. outline?: Property | boolean;
  18400. outlineColor?: Property | Color;
  18401. outlineWidth?: Property | number;
  18402. shadows?: Property | ShadowMode;
  18403. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  18404. };
  18405. }
  18406. /**
  18407. * Describes a box. The center position and orientation are determined by the containing {@link Entity}.
  18408. * @param [options] - Object describing initialization options
  18409. */
  18410. export class BoxGraphics {
  18411. constructor(options?: BoxGraphics.ConstructorOptions);
  18412. /**
  18413. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18414. */
  18415. readonly definitionChanged: Event;
  18416. /**
  18417. * Gets or sets the boolean Property specifying the visibility of the box.
  18418. */
  18419. show: Property | undefined;
  18420. /**
  18421. * Gets or sets {@link Cartesian3} Property property specifying the length, width, and height of the box.
  18422. */
  18423. dimensions: Property | undefined;
  18424. /**
  18425. * Gets or sets the Property specifying the {@link HeightReference}.
  18426. */
  18427. heightReference: Property | undefined;
  18428. /**
  18429. * Gets or sets the boolean Property specifying whether the box is filled with the provided material.
  18430. */
  18431. fill: Property | undefined;
  18432. /**
  18433. * Gets or sets the material used to fill the box.
  18434. */
  18435. material: MaterialProperty | undefined;
  18436. /**
  18437. * Gets or sets the Property specifying whether the box is outlined.
  18438. */
  18439. outline: Property | undefined;
  18440. /**
  18441. * Gets or sets the Property specifying the {@link Color} of the outline.
  18442. */
  18443. outlineColor: Property | undefined;
  18444. /**
  18445. * Gets or sets the numeric Property specifying the width of the outline.
  18446. * <p>
  18447. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  18448. * </p>
  18449. */
  18450. outlineWidth: Property | undefined;
  18451. /**
  18452. * Get or sets the enum Property specifying whether the box
  18453. * casts or receives shadows from light sources.
  18454. */
  18455. shadows: Property | undefined;
  18456. /**
  18457. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this box will be displayed.
  18458. */
  18459. distanceDisplayCondition: Property | undefined;
  18460. /**
  18461. * Duplicates this instance.
  18462. * @param [result] - The object onto which to store the result.
  18463. * @returns The modified result parameter or a new instance if one was not provided.
  18464. */
  18465. clone(result?: BoxGraphics): BoxGraphics;
  18466. /**
  18467. * Assigns each unassigned property on this object to the value
  18468. * of the same property on the provided source object.
  18469. * @param source - The object to be merged into this object.
  18470. */
  18471. merge(source: BoxGraphics): void;
  18472. }
  18473. /**
  18474. * A {@link Property} whose value is lazily evaluated by a callback function.
  18475. * @param callback - The function to be called when the property is evaluated.
  18476. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  18477. */
  18478. export class CallbackProperty {
  18479. constructor(callback: CallbackProperty.Callback, isConstant: boolean);
  18480. /**
  18481. * Gets a value indicating if this property is constant.
  18482. */
  18483. readonly isConstant: boolean;
  18484. /**
  18485. * Gets the event that is raised whenever the definition of this property changes.
  18486. * The definition is changed whenever setCallback is called.
  18487. */
  18488. readonly definitionChanged: Event;
  18489. /**
  18490. * Gets the value of the property.
  18491. * @param time - The time for which to retrieve the value.
  18492. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18493. * @returns The modified result parameter or a new instance if the result parameter was not supplied or is unsupported.
  18494. */
  18495. getValue(time: JulianDate, result?: any): any;
  18496. /**
  18497. * Sets the callback to be used.
  18498. * @param callback - The function to be called when the property is evaluated.
  18499. * @param isConstant - <code>true</code> when the callback function returns the same value every time, <code>false</code> if the value will change.
  18500. */
  18501. setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void;
  18502. /**
  18503. * Compares this property to the provided property and returns
  18504. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18505. * @param [other] - The other property.
  18506. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18507. */
  18508. equals(other?: Property): boolean;
  18509. }
  18510. export namespace CallbackProperty {
  18511. /**
  18512. * A function that returns the value of the property.
  18513. * @param time - The time for which to retrieve the value.
  18514. * @param [result] - The object to store the value into. If omitted, the function must create and return a new instance.
  18515. */
  18516. type Callback = (time: JulianDate, result?: any) => any;
  18517. }
  18518. export namespace Cesium3DTilesetGraphics {
  18519. /**
  18520. * Initialization options for the Cesium3DTilesetGraphics constructor
  18521. * @property [show = true] - A boolean Property specifying the visibility of the tileset.
  18522. * @property [uri] - A string or Resource Property specifying the URI of the tileset.
  18523. * @property [maximumScreenSpaceError] - A number or Property specifying the maximum screen space error used to drive level of detail refinement.
  18524. */
  18525. type ConstructorOptions = {
  18526. show?: Property | boolean;
  18527. uri?: Property | string | Resource;
  18528. maximumScreenSpaceError?: Property | number;
  18529. };
  18530. }
  18531. /**
  18532. * A 3D Tiles tileset represented by an {@link Entity}.
  18533. * The tileset modelMatrix is determined by the containing Entity position and orientation
  18534. * or is left unset if position is undefined.
  18535. * @param [options] - Object describing initialization options
  18536. */
  18537. export class Cesium3DTilesetGraphics {
  18538. constructor(options?: Cesium3DTilesetGraphics.ConstructorOptions);
  18539. /**
  18540. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  18541. */
  18542. readonly definitionChanged: Event;
  18543. /**
  18544. * Gets or sets the boolean Property specifying the visibility of the model.
  18545. */
  18546. show: Property | undefined;
  18547. /**
  18548. * Gets or sets the string Property specifying the URI of the glTF asset.
  18549. */
  18550. uri: Property | undefined;
  18551. /**
  18552. * Gets or sets the maximum screen space error used to drive level of detail refinement.
  18553. */
  18554. maximumScreenSpaceError: Property | undefined;
  18555. /**
  18556. * Duplicates this instance.
  18557. * @param [result] - The object onto which to store the result.
  18558. * @returns The modified result parameter or a new instance if one was not provided.
  18559. */
  18560. clone(result?: Cesium3DTilesetGraphics): Cesium3DTilesetGraphics;
  18561. /**
  18562. * Assigns each unassigned property on this object to the value
  18563. * of the same property on the provided source object.
  18564. * @param source - The object to be merged into this object.
  18565. */
  18566. merge(source: Cesium3DTilesetGraphics): void;
  18567. }
  18568. /**
  18569. * A {@link Visualizer} which maps {@link Entity#tileset} to a {@link Cesium3DTileset}.
  18570. * @param scene - The scene the primitives will be rendered in.
  18571. * @param entityCollection - The entityCollection to visualize.
  18572. */
  18573. export class Cesium3DTilesetVisualizer {
  18574. constructor(scene: Scene, entityCollection: EntityCollection);
  18575. /**
  18576. * Updates models created this visualizer to match their
  18577. * Entity counterpart at the given time.
  18578. * @param time - The time to update to.
  18579. * @returns This function always returns true.
  18580. */
  18581. update(time: JulianDate): boolean;
  18582. /**
  18583. * Returns true if this object was destroyed; otherwise, false.
  18584. * @returns True if this object was destroyed; otherwise, false.
  18585. */
  18586. isDestroyed(): boolean;
  18587. /**
  18588. * Removes and destroys all primitives created by this instance.
  18589. */
  18590. destroy(): void;
  18591. }
  18592. /**
  18593. * A {@link MaterialProperty} that maps to checkerboard {@link Material} uniforms.
  18594. * @param [options] - Object with the following properties:
  18595. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  18596. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  18597. * @param [options.repeat = new Cartesian2(2.0, 2.0)] - A {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18598. */
  18599. export class CheckerboardMaterialProperty {
  18600. constructor(options?: {
  18601. evenColor?: Property | Color;
  18602. oddColor?: Property | Color;
  18603. repeat?: Property | Cartesian2;
  18604. });
  18605. /**
  18606. * Gets a value indicating if this property is constant. A property is considered
  18607. * constant if getValue always returns the same result for the current definition.
  18608. */
  18609. readonly isConstant: boolean;
  18610. /**
  18611. * Gets the event that is raised whenever the definition of this property changes.
  18612. * The definition is considered to have changed if a call to getValue would return
  18613. * a different result for the same time.
  18614. */
  18615. readonly definitionChanged: Event;
  18616. /**
  18617. * Gets or sets the Property specifying the first {@link Color}.
  18618. */
  18619. evenColor: Property | undefined;
  18620. /**
  18621. * Gets or sets the Property specifying the second {@link Color}.
  18622. */
  18623. oddColor: Property | undefined;
  18624. /**
  18625. * Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
  18626. */
  18627. repeat: Property | undefined;
  18628. /**
  18629. * Gets the {@link Material} type at the provided time.
  18630. * @param time - The time for which to retrieve the type.
  18631. * @returns The type of material.
  18632. */
  18633. getType(time: JulianDate): string;
  18634. /**
  18635. * Gets the value of the property at the provided time.
  18636. * @param time - The time for which to retrieve the value.
  18637. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18638. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18639. */
  18640. getValue(time: JulianDate, result?: any): any;
  18641. /**
  18642. * Compares this property to the provided property and returns
  18643. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18644. * @param [other] - The other property.
  18645. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18646. */
  18647. equals(other?: Property): boolean;
  18648. }
  18649. /**
  18650. * A {@link MaterialProperty} that maps to solid color {@link Material} uniforms.
  18651. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  18652. */
  18653. export class ColorMaterialProperty {
  18654. constructor(color?: Property | Color);
  18655. /**
  18656. * Gets a value indicating if this property is constant. A property is considered
  18657. * constant if getValue always returns the same result for the current definition.
  18658. */
  18659. readonly isConstant: boolean;
  18660. /**
  18661. * Gets the event that is raised whenever the definition of this property changes.
  18662. * The definition is considered to have changed if a call to getValue would return
  18663. * a different result for the same time.
  18664. */
  18665. readonly definitionChanged: Event;
  18666. /**
  18667. * Gets or sets the {@link Color} {@link Property}.
  18668. */
  18669. color: Property | undefined;
  18670. /**
  18671. * Gets the {@link Material} type at the provided time.
  18672. * @param time - The time for which to retrieve the type.
  18673. * @returns The type of material.
  18674. */
  18675. getType(time: JulianDate): string;
  18676. /**
  18677. * Gets the value of the property at the provided time.
  18678. * @param time - The time for which to retrieve the value.
  18679. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18680. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18681. */
  18682. getValue(time: JulianDate, result?: any): any;
  18683. /**
  18684. * Compares this property to the provided property and returns
  18685. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18686. * @param [other] - The other property.
  18687. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18688. */
  18689. equals(other?: Property): boolean;
  18690. }
  18691. /**
  18692. * Non-destructively composites multiple {@link EntityCollection} instances into a single collection.
  18693. * If a Entity with the same ID exists in multiple collections, it is non-destructively
  18694. * merged into a single new entity instance. If an entity has the same property in multiple
  18695. * collections, the property of the Entity in the last collection of the list it
  18696. * belongs to is used. CompositeEntityCollection can be used almost anywhere that a
  18697. * EntityCollection is used.
  18698. * @param [collections] - The initial list of EntityCollection instances to merge.
  18699. * @param [owner] - The data source (or composite entity collection) which created this collection.
  18700. */
  18701. export class CompositeEntityCollection {
  18702. constructor(collections?: EntityCollection[], owner?: DataSource | CompositeEntityCollection);
  18703. /**
  18704. * Gets the event that is fired when entities are added or removed from the collection.
  18705. * The generated event is a {@link EntityCollection.collectionChangedEventCallback}.
  18706. */
  18707. readonly collectionChanged: Event;
  18708. /**
  18709. * Gets a globally unique identifier for this collection.
  18710. */
  18711. readonly id: string;
  18712. /**
  18713. * Gets the array of Entity instances in the collection.
  18714. * This array should not be modified directly.
  18715. */
  18716. readonly values: Entity[];
  18717. /**
  18718. * Gets the owner of this composite entity collection, ie. the data source or composite entity collection which created it.
  18719. */
  18720. readonly owner: DataSource | CompositeEntityCollection;
  18721. /**
  18722. * Adds a collection to the composite.
  18723. * @param collection - the collection to add.
  18724. * @param [index] - the index to add the collection at. If omitted, the collection will
  18725. * added on top of all existing collections.
  18726. */
  18727. addCollection(collection: EntityCollection, index?: number): void;
  18728. /**
  18729. * Removes a collection from this composite, if present.
  18730. * @param collection - The collection to remove.
  18731. * @returns true if the collection was in the composite and was removed,
  18732. * false if the collection was not in the composite.
  18733. */
  18734. removeCollection(collection: EntityCollection): boolean;
  18735. /**
  18736. * Removes all collections from this composite.
  18737. */
  18738. removeAllCollections(): void;
  18739. /**
  18740. * Checks to see if the composite contains a given collection.
  18741. * @param collection - the collection to check for.
  18742. * @returns true if the composite contains the collection, false otherwise.
  18743. */
  18744. containsCollection(collection: EntityCollection): boolean;
  18745. /**
  18746. * Returns true if the provided entity is in this collection, false otherwise.
  18747. * @param entity - The entity.
  18748. * @returns true if the provided entity is in this collection, false otherwise.
  18749. */
  18750. contains(entity: Entity): boolean;
  18751. /**
  18752. * Determines the index of a given collection in the composite.
  18753. * @param collection - The collection to find the index of.
  18754. * @returns The index of the collection in the composite, or -1 if the collection does not exist in the composite.
  18755. */
  18756. indexOfCollection(collection: EntityCollection): number;
  18757. /**
  18758. * Gets a collection by index from the composite.
  18759. * @param index - the index to retrieve.
  18760. */
  18761. getCollection(index: number): void;
  18762. /**
  18763. * Gets the number of collections in this composite.
  18764. */
  18765. getCollectionsLength(): void;
  18766. /**
  18767. * Raises a collection up one position in the composite.
  18768. * @param collection - the collection to move.
  18769. */
  18770. raiseCollection(collection: EntityCollection): void;
  18771. /**
  18772. * Lowers a collection down one position in the composite.
  18773. * @param collection - the collection to move.
  18774. */
  18775. lowerCollection(collection: EntityCollection): void;
  18776. /**
  18777. * Raises a collection to the top of the composite.
  18778. * @param collection - the collection to move.
  18779. */
  18780. raiseCollectionToTop(collection: EntityCollection): void;
  18781. /**
  18782. * Lowers a collection to the bottom of the composite.
  18783. * @param collection - the collection to move.
  18784. */
  18785. lowerCollectionToBottom(collection: EntityCollection): void;
  18786. /**
  18787. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  18788. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  18789. * point a single event will be raised that covers all suspended operations.
  18790. * This allows for many items to be added and removed efficiently.
  18791. * While events are suspended, recompositing of the collections will
  18792. * also be suspended, as this can be a costly operation.
  18793. * This function can be safely called multiple times as long as there
  18794. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18795. */
  18796. suspendEvents(): void;
  18797. /**
  18798. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  18799. * when an item is added or removed. Any modifications made while while events were suspended
  18800. * will be triggered as a single event when this function is called. This function also ensures
  18801. * the collection is recomposited if events are also resumed.
  18802. * This function is reference counted and can safely be called multiple times as long as there
  18803. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  18804. */
  18805. resumeEvents(): void;
  18806. /**
  18807. * Computes the maximum availability of the entities in the collection.
  18808. * If the collection contains a mix of infinitely available data and non-infinite data,
  18809. * It will return the interval pertaining to the non-infinite data only. If all
  18810. * data is infinite, an infinite interval will be returned.
  18811. * @returns The availability of entities in the collection.
  18812. */
  18813. computeAvailability(): TimeInterval;
  18814. /**
  18815. * Gets an entity with the specified id.
  18816. * @param id - The id of the entity to retrieve.
  18817. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  18818. */
  18819. getById(id: string): Entity | undefined;
  18820. }
  18821. /**
  18822. * A {@link CompositeProperty} which is also a {@link MaterialProperty}.
  18823. */
  18824. export class CompositeMaterialProperty {
  18825. constructor();
  18826. /**
  18827. * Gets a value indicating if this property is constant. A property is considered
  18828. * constant if getValue always returns the same result for the current definition.
  18829. */
  18830. readonly isConstant: boolean;
  18831. /**
  18832. * Gets the event that is raised whenever the definition of this property changes.
  18833. * The definition is changed whenever setValue is called with data different
  18834. * than the current value.
  18835. */
  18836. readonly definitionChanged: Event;
  18837. /**
  18838. * Gets the interval collection.
  18839. */
  18840. intervals: TimeIntervalCollection;
  18841. /**
  18842. * Gets the {@link Material} type at the provided time.
  18843. * @param time - The time for which to retrieve the type.
  18844. * @returns The type of material.
  18845. */
  18846. getType(time: JulianDate): string;
  18847. /**
  18848. * Gets the value of the property at the provided time.
  18849. * @param time - The time for which to retrieve the value.
  18850. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18851. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18852. */
  18853. getValue(time: JulianDate, result?: any): any;
  18854. /**
  18855. * Compares this property to the provided property and returns
  18856. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18857. * @param [other] - The other property.
  18858. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18859. */
  18860. equals(other?: Property): boolean;
  18861. }
  18862. /**
  18863. * A {@link CompositeProperty} which is also a {@link PositionProperty}.
  18864. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18865. */
  18866. export class CompositePositionProperty {
  18867. constructor(referenceFrame?: ReferenceFrame);
  18868. /**
  18869. * Gets a value indicating if this property is constant. A property is considered
  18870. * constant if getValue always returns the same result for the current definition.
  18871. */
  18872. readonly isConstant: boolean;
  18873. /**
  18874. * Gets the event that is raised whenever the definition of this property changes.
  18875. * The definition is changed whenever setValue is called with data different
  18876. * than the current value.
  18877. */
  18878. readonly definitionChanged: Event;
  18879. /**
  18880. * Gets the interval collection.
  18881. */
  18882. intervals: TimeIntervalCollection;
  18883. /**
  18884. * Gets or sets the reference frame which this position presents itself as.
  18885. * Each PositionProperty making up this object has it's own reference frame,
  18886. * so this property merely exposes a "preferred" reference frame for clients
  18887. * to use.
  18888. */
  18889. referenceFrame: ReferenceFrame;
  18890. /**
  18891. * Gets the value of the property at the provided time in the fixed frame.
  18892. * @param time - The time for which to retrieve the value.
  18893. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18894. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18895. */
  18896. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  18897. /**
  18898. * Gets the value of the property at the provided time and in the provided reference frame.
  18899. * @param time - The time for which to retrieve the value.
  18900. * @param referenceFrame - The desired referenceFrame of the result.
  18901. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18902. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18903. */
  18904. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  18905. /**
  18906. * Compares this property to the provided property and returns
  18907. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18908. * @param [other] - The other property.
  18909. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18910. */
  18911. equals(other?: Property): boolean;
  18912. }
  18913. /**
  18914. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  18915. * data property of each {@link TimeInterval} is another Property instance which is
  18916. * evaluated at the provided time.
  18917. * @example
  18918. * const constantProperty = ...;
  18919. * const sampledProperty = ...;
  18920. *
  18921. * //Create a composite property from two previously defined properties
  18922. * //where the property is valid on August 1st, 2012 and uses a constant
  18923. * //property for the first half of the day and a sampled property for the
  18924. * //remaining half.
  18925. * const composite = new Cesium.CompositeProperty();
  18926. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18927. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T12:00:00.00Z',
  18928. * data : constantProperty
  18929. * }));
  18930. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  18931. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-02T00:00:00.00Z',
  18932. * isStartIncluded : false,
  18933. * isStopIncluded : false,
  18934. * data : sampledProperty
  18935. * }));
  18936. */
  18937. export class CompositeProperty {
  18938. constructor();
  18939. /**
  18940. * Gets a value indicating if this property is constant. A property is considered
  18941. * constant if getValue always returns the same result for the current definition.
  18942. */
  18943. readonly isConstant: boolean;
  18944. /**
  18945. * Gets the event that is raised whenever the definition of this property changes.
  18946. * The definition is changed whenever setValue is called with data different
  18947. * than the current value.
  18948. */
  18949. readonly definitionChanged: Event;
  18950. /**
  18951. * Gets the interval collection.
  18952. */
  18953. intervals: TimeIntervalCollection;
  18954. /**
  18955. * Gets the value of the property at the provided time.
  18956. * @param time - The time for which to retrieve the value.
  18957. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18958. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18959. */
  18960. getValue(time: JulianDate, result?: any): any;
  18961. /**
  18962. * Compares this property to the provided property and returns
  18963. * <code>true</code> if they are equal, <code>false</code> otherwise.
  18964. * @param [other] - The other property.
  18965. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  18966. */
  18967. equals(other?: Property): boolean;
  18968. }
  18969. /**
  18970. * A {@link PositionProperty} whose value does not change in respect to the
  18971. * {@link ReferenceFrame} in which is it defined.
  18972. * @param [value] - The property value.
  18973. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  18974. */
  18975. export class ConstantPositionProperty {
  18976. constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame);
  18977. /**
  18978. * Gets a value indicating if this property is constant. A property is considered
  18979. * constant if getValue always returns the same result for the current definition.
  18980. */
  18981. readonly isConstant: boolean;
  18982. /**
  18983. * Gets the event that is raised whenever the definition of this property changes.
  18984. * The definition is considered to have changed if a call to getValue would return
  18985. * a different result for the same time.
  18986. */
  18987. readonly definitionChanged: Event;
  18988. /**
  18989. * Gets the reference frame in which the position is defined.
  18990. */
  18991. referenceFrame: ReferenceFrame;
  18992. /**
  18993. * Gets the value of the property at the provided time in the fixed frame.
  18994. * @param time - The time for which to retrieve the value.
  18995. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  18996. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  18997. */
  18998. getValue(time: JulianDate, result?: any): any;
  18999. /**
  19000. * Sets the value of the property.
  19001. * @param value - The property value.
  19002. * @param [referenceFrame = this.referenceFrame] - The reference frame in which the position is defined.
  19003. */
  19004. setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void;
  19005. /**
  19006. * Gets the value of the property at the provided time and in the provided reference frame.
  19007. * @param time - The time for which to retrieve the value.
  19008. * @param referenceFrame - The desired referenceFrame of the result.
  19009. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19010. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19011. */
  19012. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  19013. /**
  19014. * Compares this property to the provided property and returns
  19015. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19016. * @param [other] - The other property.
  19017. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19018. */
  19019. equals(other?: Property): boolean;
  19020. }
  19021. /**
  19022. * A {@link Property} whose value does not change with respect to simulation time.
  19023. * @param [value] - The property value.
  19024. */
  19025. export class ConstantProperty {
  19026. constructor(value?: any);
  19027. /**
  19028. * Gets a value indicating if this property is constant.
  19029. * This property always returns <code>true</code>.
  19030. */
  19031. readonly isConstant: boolean;
  19032. /**
  19033. * Gets the event that is raised whenever the definition of this property changes.
  19034. * The definition is changed whenever setValue is called with data different
  19035. * than the current value.
  19036. */
  19037. readonly definitionChanged: Event;
  19038. /**
  19039. * Gets the value of the property.
  19040. * @param [time] - The time for which to retrieve the value. This parameter is unused since the value does not change with respect to time.
  19041. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  19042. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  19043. */
  19044. getValue(time?: JulianDate, result?: any): any;
  19045. /**
  19046. * Sets the value of the property.
  19047. * @param value - The property value.
  19048. */
  19049. setValue(value: any): void;
  19050. /**
  19051. * Compares this property to the provided property and returns
  19052. * <code>true</code> if they are equal, <code>false</code> otherwise.
  19053. * @param [other] - The other property.
  19054. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  19055. */
  19056. equals(other?: Property): boolean;
  19057. /**
  19058. * Gets this property's value.
  19059. * @returns This property's value.
  19060. */
  19061. valueOf(): any;
  19062. /**
  19063. * Creates a string representing this property's value.
  19064. * @returns A string representing the property's value.
  19065. */
  19066. toString(): string;
  19067. }
  19068. /**
  19069. * A {@link GeometryUpdater} for corridors.
  19070. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19071. * @param entity - The entity containing the geometry to be visualized.
  19072. * @param scene - The scene where visualization is taking place.
  19073. */
  19074. export class CorridorGeometryUpdater {
  19075. constructor(entity: Entity, scene: Scene);
  19076. /**
  19077. * Creates the geometry instance which represents the fill of the geometry.
  19078. * @param time - The time to use when retrieving initial attribute values.
  19079. * @returns The geometry instance representing the filled portion of the geometry.
  19080. */
  19081. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19082. /**
  19083. * Creates the geometry instance which represents the outline of the geometry.
  19084. * @param time - The time to use when retrieving initial attribute values.
  19085. * @returns The geometry instance representing the outline portion of the geometry.
  19086. */
  19087. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19088. }
  19089. export namespace CorridorGraphics {
  19090. /**
  19091. * Initialization options for the CorridorGraphics constructor
  19092. * @property [show = true] - A boolean Property specifying the visibility of the corridor.
  19093. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  19094. * @property [width] - A numeric Property specifying the distance between the edges of the corridor.
  19095. * @property [height = 0] - A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.
  19096. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  19097. * @property [extrudedHeight] - A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.
  19098. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  19099. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  19100. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the distance between each latitude and longitude.
  19101. * @property [fill = true] - A boolean Property specifying whether the corridor is filled with the provided material.
  19102. * @property [material = Color.WHITE] - A Property specifying the material used to fill the corridor.
  19103. * @property [outline = false] - A boolean Property specifying whether the corridor is outlined.
  19104. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19105. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19106. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the corridor casts or receives shadows from light sources.
  19107. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this corridor will be displayed.
  19108. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  19109. * @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.
  19110. */
  19111. type ConstructorOptions = {
  19112. show?: Property | boolean;
  19113. positions?: Property | Cartesian3[];
  19114. width?: Property | number;
  19115. height?: Property | number;
  19116. heightReference?: Property | HeightReference;
  19117. extrudedHeight?: Property | number;
  19118. extrudedHeightReference?: Property | HeightReference;
  19119. cornerType?: Property | CornerType;
  19120. granularity?: Property | number;
  19121. fill?: Property | boolean;
  19122. material?: MaterialProperty | Color;
  19123. outline?: Property | boolean;
  19124. outlineColor?: Property | Color;
  19125. outlineWidth?: Property | number;
  19126. shadows?: Property | ShadowMode;
  19127. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19128. classificationType?: Property | ClassificationType;
  19129. zIndex?: ConstantProperty | number;
  19130. };
  19131. }
  19132. /**
  19133. * Describes a corridor, which is a shape defined by a centerline and width that
  19134. * conforms to the curvature of the globe. It can be placed on the surface or at altitude
  19135. * and can optionally be extruded into a volume.
  19136. * @param [options] - Object describing initialization options
  19137. */
  19138. export class CorridorGraphics {
  19139. constructor(options?: CorridorGraphics.ConstructorOptions);
  19140. /**
  19141. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19142. */
  19143. readonly definitionChanged: Event;
  19144. /**
  19145. * Gets or sets the boolean Property specifying the visibility of the corridor.
  19146. */
  19147. show: Property | undefined;
  19148. /**
  19149. * Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
  19150. */
  19151. positions: Property | undefined;
  19152. /**
  19153. * Gets or sets the numeric Property specifying the width of the outline.
  19154. */
  19155. width: Property | undefined;
  19156. /**
  19157. * Gets or sets the numeric Property specifying the altitude of the corridor.
  19158. */
  19159. height: Property | undefined;
  19160. /**
  19161. * Gets or sets the Property specifying the {@link HeightReference}.
  19162. */
  19163. heightReference: Property | undefined;
  19164. /**
  19165. * Gets or sets the numeric Property specifying the altitude of the corridor extrusion.
  19166. * Setting this property creates a corridor shaped volume starting at height and ending
  19167. * at this altitude.
  19168. */
  19169. extrudedHeight: Property | undefined;
  19170. /**
  19171. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  19172. */
  19173. extrudedHeightReference: Property | undefined;
  19174. /**
  19175. * Gets or sets the {@link CornerType} Property specifying how corners are styled.
  19176. */
  19177. cornerType: Property | undefined;
  19178. /**
  19179. * Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.
  19180. */
  19181. granularity: Property | undefined;
  19182. /**
  19183. * Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.
  19184. */
  19185. fill: Property | undefined;
  19186. /**
  19187. * Gets or sets the Property specifying the material used to fill the corridor.
  19188. */
  19189. material: MaterialProperty | undefined;
  19190. /**
  19191. * Gets or sets the Property specifying whether the corridor is outlined.
  19192. */
  19193. outline: Property | undefined;
  19194. /**
  19195. * Gets or sets the Property specifying the {@link Color} of the outline.
  19196. */
  19197. outlineColor: Property | undefined;
  19198. /**
  19199. * Gets or sets the numeric Property specifying the width of the outline.
  19200. * <p>
  19201. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  19202. * </p>
  19203. */
  19204. outlineWidth: Property | undefined;
  19205. /**
  19206. * Get or sets the enum Property specifying whether the corridor
  19207. * casts or receives shadows from light sources.
  19208. */
  19209. shadows: Property | undefined;
  19210. /**
  19211. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this corridor will be displayed.
  19212. */
  19213. distanceDisplayCondition: Property | undefined;
  19214. /**
  19215. * Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
  19216. */
  19217. classificationType: Property | undefined;
  19218. /**
  19219. * 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.
  19220. */
  19221. zIndex: ConstantProperty | undefined;
  19222. /**
  19223. * Duplicates this instance.
  19224. * @param [result] - The object onto which to store the result.
  19225. * @returns The modified result parameter or a new instance if one was not provided.
  19226. */
  19227. clone(result?: CorridorGraphics): CorridorGraphics;
  19228. /**
  19229. * Assigns each unassigned property on this object to the value
  19230. * of the same property on the provided source object.
  19231. * @param source - The object to be merged into this object.
  19232. */
  19233. merge(source: CorridorGraphics): void;
  19234. }
  19235. /**
  19236. * A {@link DataSource} implementation which can be used to manually manage a group of entities.
  19237. * @example
  19238. * const dataSource = new Cesium.CustomDataSource('myData');
  19239. *
  19240. * const entity = dataSource.entities.add({
  19241. * position : Cesium.Cartesian3.fromDegrees(1, 2, 0),
  19242. * billboard : {
  19243. * image : 'image.png'
  19244. * }
  19245. * });
  19246. *
  19247. * viewer.dataSources.add(dataSource);
  19248. * @param [name] - A human-readable name for this instance.
  19249. */
  19250. export class CustomDataSource {
  19251. constructor(name?: string);
  19252. /**
  19253. * Gets or sets a human-readable name for this instance.
  19254. */
  19255. name: string;
  19256. /**
  19257. * Gets or sets the clock for this instance.
  19258. */
  19259. clock: DataSourceClock;
  19260. /**
  19261. * Gets the collection of {@link Entity} instances.
  19262. */
  19263. entities: EntityCollection;
  19264. /**
  19265. * Gets or sets whether the data source is currently loading data.
  19266. */
  19267. isLoading: boolean;
  19268. /**
  19269. * Gets an event that will be raised when the underlying data changes.
  19270. */
  19271. changedEvent: Event;
  19272. /**
  19273. * Gets an event that will be raised if an error is encountered during processing.
  19274. */
  19275. errorEvent: Event;
  19276. /**
  19277. * Gets an event that will be raised when the data source either starts or stops loading.
  19278. */
  19279. loadingEvent: Event;
  19280. /**
  19281. * Gets whether or not this data source should be displayed.
  19282. */
  19283. show: boolean;
  19284. /**
  19285. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19286. */
  19287. clustering: EntityCluster;
  19288. /**
  19289. * Updates the data source to the provided time. This function is optional and
  19290. * is not required to be implemented. It is provided for data sources which
  19291. * retrieve data based on the current animation time or scene state.
  19292. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19293. * @param time - The simulation time.
  19294. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19295. */
  19296. update(time: JulianDate): boolean;
  19297. }
  19298. /**
  19299. * A {@link GeometryUpdater} for cylinders.
  19300. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19301. * @param entity - The entity containing the geometry to be visualized.
  19302. * @param scene - The scene where visualization is taking place.
  19303. */
  19304. export class CylinderGeometryUpdater {
  19305. constructor(entity: Entity, scene: Scene);
  19306. /**
  19307. * Creates the geometry instance which represents the fill of the geometry.
  19308. * @param time - The time to use when retrieving initial attribute values.
  19309. * @returns The geometry instance representing the filled portion of the geometry.
  19310. */
  19311. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19312. /**
  19313. * Creates the geometry instance which represents the outline of the geometry.
  19314. * @param time - The time to use when retrieving initial attribute values.
  19315. * @returns The geometry instance representing the outline portion of the geometry.
  19316. */
  19317. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19318. }
  19319. export namespace CylinderGraphics {
  19320. /**
  19321. * Initialization options for the CylinderGraphics constructor
  19322. * @property [show = true] - A boolean Property specifying the visibility of the cylinder.
  19323. * @property [length] - A numeric Property specifying the length of the cylinder.
  19324. * @property [topRadius] - A numeric Property specifying the radius of the top of the cylinder.
  19325. * @property [bottomRadius] - A numeric Property specifying the radius of the bottom of the cylinder.
  19326. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  19327. * @property [fill = true] - A boolean Property specifying whether the cylinder is filled with the provided material.
  19328. * @property [material = Color.WHITE] - A Property specifying the material used to fill the cylinder.
  19329. * @property [outline = false] - A boolean Property specifying whether the cylinder is outlined.
  19330. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19331. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19332. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19333. * @property [slices = 128] - The number of edges around the perimeter of the cylinder.
  19334. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the cylinder casts or receives shadows from light sources.
  19335. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this cylinder will be displayed.
  19336. */
  19337. type ConstructorOptions = {
  19338. show?: Property | boolean;
  19339. length?: Property | number;
  19340. topRadius?: Property | number;
  19341. bottomRadius?: Property | number;
  19342. heightReference?: Property | HeightReference;
  19343. fill?: Property | boolean;
  19344. material?: MaterialProperty | Color;
  19345. outline?: Property | boolean;
  19346. outlineColor?: Property | Color;
  19347. outlineWidth?: Property | number;
  19348. numberOfVerticalLines?: Property | number;
  19349. slices?: Property | number;
  19350. shadows?: Property | ShadowMode;
  19351. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19352. };
  19353. }
  19354. /**
  19355. * Describes a cylinder, truncated cone, or cone defined by a length, top radius, and bottom radius.
  19356. * The center position and orientation are determined by the containing {@link Entity}.
  19357. * @param [options] - Object describing initialization options
  19358. */
  19359. export class CylinderGraphics {
  19360. constructor(options?: CylinderGraphics.ConstructorOptions);
  19361. /**
  19362. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19363. */
  19364. readonly definitionChanged: Event;
  19365. /**
  19366. * Gets or sets the boolean Property specifying the visibility of the cylinder.
  19367. */
  19368. show: Property | undefined;
  19369. /**
  19370. * Gets or sets the numeric Property specifying the length of the cylinder.
  19371. */
  19372. length: Property | undefined;
  19373. /**
  19374. * Gets or sets the numeric Property specifying the radius of the top of the cylinder.
  19375. */
  19376. topRadius: Property | undefined;
  19377. /**
  19378. * Gets or sets the numeric Property specifying the radius of the bottom of the cylinder.
  19379. */
  19380. bottomRadius: Property | undefined;
  19381. /**
  19382. * Gets or sets the Property specifying the {@link HeightReference}.
  19383. */
  19384. heightReference: Property | undefined;
  19385. /**
  19386. * Gets or sets the boolean Property specifying whether the cylinder is filled with the provided material.
  19387. */
  19388. fill: Property | undefined;
  19389. /**
  19390. * Gets or sets the Property specifying the material used to fill the cylinder.
  19391. */
  19392. material: MaterialProperty | undefined;
  19393. /**
  19394. * Gets or sets the boolean Property specifying whether the cylinder is outlined.
  19395. */
  19396. outline: Property | undefined;
  19397. /**
  19398. * Gets or sets the Property specifying the {@link Color} of the outline.
  19399. */
  19400. outlineColor: Property | undefined;
  19401. /**
  19402. * Gets or sets the numeric Property specifying the width of the outline.
  19403. * <p>
  19404. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  19405. * </p>
  19406. */
  19407. outlineWidth: Property | undefined;
  19408. /**
  19409. * Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19410. */
  19411. numberOfVerticalLines: Property | undefined;
  19412. /**
  19413. * Gets or sets the Property specifying the number of edges around the perimeter of the cylinder.
  19414. */
  19415. slices: Property | undefined;
  19416. /**
  19417. * Get or sets the enum Property specifying whether the cylinder
  19418. * casts or receives shadows from light sources.
  19419. */
  19420. shadows: Property | undefined;
  19421. /**
  19422. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this cylinder will be displayed.
  19423. */
  19424. distanceDisplayCondition: Property | undefined;
  19425. /**
  19426. * Duplicates this instance.
  19427. * @param [result] - The object onto which to store the result.
  19428. * @returns The modified result parameter or a new instance if one was not provided.
  19429. */
  19430. clone(result?: CylinderGraphics): CylinderGraphics;
  19431. /**
  19432. * Assigns each unassigned property on this object to the value
  19433. * of the same property on the provided source object.
  19434. * @param source - The object to be merged into this object.
  19435. */
  19436. merge(source: CylinderGraphics): void;
  19437. }
  19438. export namespace CzmlDataSource {
  19439. /**
  19440. * Initialization options for the <code>load</code> method.
  19441. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  19442. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  19443. */
  19444. type LoadOptions = {
  19445. sourceUri?: Resource | string;
  19446. credit?: Credit | string;
  19447. };
  19448. type UpdaterFunction = (entity: Entity, packet: any, entityCollection: EntityCollection, sourceUri: string) => void;
  19449. }
  19450. /**
  19451. * A {@link DataSource} which processes {@link https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide|CZML}.
  19452. * @param [name] - An optional name for the data source. This value will be overwritten if a loaded document contains a name.
  19453. */
  19454. export class CzmlDataSource {
  19455. constructor(name?: string);
  19456. /**
  19457. * Creates a Promise to a new instance loaded with the provided CZML data.
  19458. * @param czml - A url or CZML object to be processed.
  19459. * @param [options] - An object specifying configuration options
  19460. * @returns A promise that resolves to the new instance once the data is processed.
  19461. */
  19462. static load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19463. /**
  19464. * Gets a human-readable name for this instance.
  19465. */
  19466. name: string;
  19467. /**
  19468. * Gets the clock settings defined by the loaded CZML. If no clock is explicitly
  19469. * defined in the CZML, the combined availability of all objects is returned. If
  19470. * only static data exists, this value is undefined.
  19471. */
  19472. clock: DataSourceClock;
  19473. /**
  19474. * Gets the collection of {@link Entity} instances.
  19475. */
  19476. entities: EntityCollection;
  19477. /**
  19478. * Gets a value indicating if the data source is currently loading data.
  19479. */
  19480. isLoading: boolean;
  19481. /**
  19482. * Gets an event that will be raised when the underlying data changes.
  19483. */
  19484. changedEvent: Event;
  19485. /**
  19486. * Gets an event that will be raised if an error is encountered during processing.
  19487. */
  19488. errorEvent: Event;
  19489. /**
  19490. * Gets an event that will be raised when the data source either starts or stops loading.
  19491. */
  19492. loadingEvent: Event;
  19493. /**
  19494. * Gets whether or not this data source should be displayed.
  19495. */
  19496. show: boolean;
  19497. /**
  19498. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19499. */
  19500. clustering: EntityCluster;
  19501. /**
  19502. * Gets the credit that will be displayed for the data source
  19503. */
  19504. credit: Credit;
  19505. /**
  19506. * Gets the array of CZML processing functions.
  19507. */
  19508. static updaters: CzmlDataSource.UpdaterFunction[];
  19509. /**
  19510. * Processes the provided url or CZML object without clearing any existing data.
  19511. * @param czml - A url or CZML object to be processed.
  19512. * @param [options] - An object specifying configuration options
  19513. * @returns A promise that resolves to this instances once the data is processed.
  19514. */
  19515. process(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19516. /**
  19517. * Loads the provided url or CZML object, replacing any existing data.
  19518. * @param czml - A url or CZML object to be processed.
  19519. * @param [options] - An object specifying configuration options
  19520. * @returns A promise that resolves to this instances once the data is processed.
  19521. */
  19522. load(czml: Resource | string | any, options?: CzmlDataSource.LoadOptions): Promise<CzmlDataSource>;
  19523. /**
  19524. * Updates the data source to the provided time. This function is optional and
  19525. * is not required to be implemented. It is provided for data sources which
  19526. * retrieve data based on the current animation time or scene state.
  19527. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19528. * @param time - The simulation time.
  19529. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19530. */
  19531. update(time: JulianDate): boolean;
  19532. /**
  19533. * A helper function used by custom CZML updater functions
  19534. * which creates or updates a {@link Property} from a CZML packet.
  19535. * @param type - The constructor function for the property being processed.
  19536. * @param object - The object on which the property will be added or updated.
  19537. * @param propertyName - The name of the property on the object.
  19538. * @param packetData - The CZML packet being processed.
  19539. * @param interval - A constraining interval for which the data is valid.
  19540. * @param sourceUri - The originating uri of the data being processed.
  19541. * @param entityCollection - The collection being processsed.
  19542. */
  19543. static processPacketData(type: (...params: any[]) => any, object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19544. /**
  19545. * A helper function used by custom CZML updater functions
  19546. * which creates or updates a {@link PositionProperty} from a CZML packet.
  19547. * @param object - The object on which the property will be added or updated.
  19548. * @param propertyName - The name of the property on the object.
  19549. * @param packetData - The CZML packet being processed.
  19550. * @param interval - A constraining interval for which the data is valid.
  19551. * @param sourceUri - The originating uri of the data being processed.
  19552. * @param entityCollection - The collection being processsed.
  19553. */
  19554. static processPositionPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19555. /**
  19556. * A helper function used by custom CZML updater functions
  19557. * which creates or updates a {@link MaterialProperty} from a CZML packet.
  19558. * @param object - The object on which the property will be added or updated.
  19559. * @param propertyName - The name of the property on the object.
  19560. * @param packetData - The CZML packet being processed.
  19561. * @param interval - A constraining interval for which the data is valid.
  19562. * @param sourceUri - The originating uri of the data being processed.
  19563. * @param entityCollection - The collection being processsed.
  19564. */
  19565. static processMaterialPacketData(object: any, propertyName: string, packetData: any, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void;
  19566. }
  19567. /**
  19568. * Defines the interface for data sources, which turn arbitrary data into a
  19569. * {@link EntityCollection} for generic consumption. This object is an interface
  19570. * for documentation purposes and is not intended to be instantiated directly.
  19571. */
  19572. export class DataSource {
  19573. constructor();
  19574. /**
  19575. * Gets a human-readable name for this instance.
  19576. */
  19577. name: string;
  19578. /**
  19579. * Gets the preferred clock settings for this data source.
  19580. */
  19581. clock: DataSourceClock;
  19582. /**
  19583. * Gets the collection of {@link Entity} instances.
  19584. */
  19585. entities: EntityCollection;
  19586. /**
  19587. * Gets a value indicating if the data source is currently loading data.
  19588. */
  19589. isLoading: boolean;
  19590. /**
  19591. * Gets an event that will be raised when the underlying data changes.
  19592. */
  19593. changedEvent: Event;
  19594. /**
  19595. * Gets an event that will be raised if an error is encountered during processing.
  19596. */
  19597. errorEvent: Event<(arg0: this, arg1: RequestErrorEvent) => void>;
  19598. /**
  19599. * Gets an event that will be raised when the value of isLoading changes.
  19600. */
  19601. loadingEvent: Event<(arg0: this, arg1: boolean) => void>;
  19602. /**
  19603. * Gets whether or not this data source should be displayed.
  19604. */
  19605. show: boolean;
  19606. /**
  19607. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  19608. */
  19609. clustering: EntityCluster;
  19610. /**
  19611. * Updates the data source to the provided time. This function is optional and
  19612. * is not required to be implemented. It is provided for data sources which
  19613. * retrieve data based on the current animation time or scene state.
  19614. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  19615. * @param time - The simulation time.
  19616. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  19617. */
  19618. update(time: JulianDate): boolean;
  19619. }
  19620. /**
  19621. * Represents desired clock settings for a particular {@link DataSource}. These settings may be applied
  19622. * to the {@link Clock} when the DataSource is loaded.
  19623. */
  19624. export class DataSourceClock {
  19625. constructor();
  19626. /**
  19627. * Gets the event that is raised whenever a new property is assigned.
  19628. */
  19629. readonly definitionChanged: Event;
  19630. /**
  19631. * Gets or sets the desired start time of the clock.
  19632. * See {@link Clock#startTime}.
  19633. */
  19634. startTime: JulianDate;
  19635. /**
  19636. * Gets or sets the desired stop time of the clock.
  19637. * See {@link Clock#stopTime}.
  19638. */
  19639. stopTime: JulianDate;
  19640. /**
  19641. * Gets or sets the desired current time when this data source is loaded.
  19642. * See {@link Clock#currentTime}.
  19643. */
  19644. currentTime: JulianDate;
  19645. /**
  19646. * Gets or sets the desired clock range setting.
  19647. * See {@link Clock#clockRange}.
  19648. */
  19649. clockRange: ClockRange;
  19650. /**
  19651. * Gets or sets the desired clock step setting.
  19652. * See {@link Clock#clockStep}.
  19653. */
  19654. clockStep: ClockStep;
  19655. /**
  19656. * Gets or sets the desired clock multiplier.
  19657. * See {@link Clock#multiplier}.
  19658. */
  19659. multiplier: number;
  19660. /**
  19661. * Duplicates a DataSourceClock instance.
  19662. * @param [result] - The object onto which to store the result.
  19663. * @returns The modified result parameter or a new instance if one was not provided.
  19664. */
  19665. clone(result?: DataSourceClock): DataSourceClock;
  19666. /**
  19667. * Returns true if this DataSourceClock is equivalent to the other
  19668. * @param other - The other DataSourceClock to compare to.
  19669. * @returns <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
  19670. */
  19671. equals(other: DataSourceClock): boolean;
  19672. /**
  19673. * Assigns each unassigned property on this object to the value
  19674. * of the same property on the provided source object.
  19675. * @param source - The object to be merged into this object.
  19676. */
  19677. merge(source: DataSourceClock): void;
  19678. /**
  19679. * Gets the value of this clock instance as a {@link Clock} object.
  19680. * @returns The modified result parameter or a new instance if one was not provided.
  19681. */
  19682. getValue(): Clock;
  19683. }
  19684. /**
  19685. * A collection of {@link DataSource} instances.
  19686. */
  19687. export class DataSourceCollection {
  19688. constructor();
  19689. /**
  19690. * Gets the number of data sources in this collection.
  19691. */
  19692. readonly length: number;
  19693. /**
  19694. * An event that is raised when a data source is added to the collection.
  19695. * Event handlers are passed the data source that was added.
  19696. */
  19697. readonly dataSourceAdded: Event;
  19698. /**
  19699. * An event that is raised when a data source is removed from the collection.
  19700. * Event handlers are passed the data source that was removed.
  19701. */
  19702. readonly dataSourceRemoved: Event;
  19703. /**
  19704. * An event that is raised when a data source changes position in the collection. Event handlers are passed the data source
  19705. * that was moved, its new index after the move, and its old index prior to the move.
  19706. */
  19707. readonly dataSourceMoved: Event;
  19708. /**
  19709. * Adds a data source to the collection.
  19710. * @param dataSource - A data source or a promise to a data source to add to the collection.
  19711. * When passing a promise, the data source will not actually be added
  19712. * to the collection until the promise resolves successfully.
  19713. * @returns A Promise that resolves once the data source has been added to the collection.
  19714. */
  19715. add(dataSource: DataSource | Promise<DataSource>): Promise<DataSource>;
  19716. /**
  19717. * Removes a data source from this collection, if present.
  19718. * @param dataSource - The data source to remove.
  19719. * @param [destroy = false] - Whether to destroy the data source in addition to removing it.
  19720. * @returns true if the data source was in the collection and was removed,
  19721. * false if the data source was not in the collection.
  19722. */
  19723. remove(dataSource: DataSource, destroy?: boolean): boolean;
  19724. /**
  19725. * Removes all data sources from this collection.
  19726. * @param [destroy = false] - whether to destroy the data sources in addition to removing them.
  19727. */
  19728. removeAll(destroy?: boolean): void;
  19729. /**
  19730. * Checks to see if the collection contains a given data source.
  19731. * @param dataSource - The data source to check for.
  19732. * @returns true if the collection contains the data source, false otherwise.
  19733. */
  19734. contains(dataSource: DataSource): boolean;
  19735. /**
  19736. * Determines the index of a given data source in the collection.
  19737. * @param dataSource - The data source to find the index of.
  19738. * @returns The index of the data source in the collection, or -1 if the data source does not exist in the collection.
  19739. */
  19740. indexOf(dataSource: DataSource): number;
  19741. /**
  19742. * Gets a data source by index from the collection.
  19743. * @param index - the index to retrieve.
  19744. * @returns The data source at the specified index.
  19745. */
  19746. get(index: number): DataSource;
  19747. /**
  19748. * Gets a data source by name from the collection.
  19749. * @param name - The name to retrieve.
  19750. * @returns A list of all data sources matching the provided name.
  19751. */
  19752. getByName(name: string): DataSource[];
  19753. /**
  19754. * Raises a data source up one position in the collection.
  19755. * @param dataSource - The data source to move.
  19756. */
  19757. raise(dataSource: DataSource): void;
  19758. /**
  19759. * Lowers a data source down one position in the collection.
  19760. * @param dataSource - The data source to move.
  19761. */
  19762. lower(dataSource: DataSource): void;
  19763. /**
  19764. * Raises a data source to the top of the collection.
  19765. * @param dataSource - The data source to move.
  19766. */
  19767. raiseToTop(dataSource: DataSource): void;
  19768. /**
  19769. * Lowers a data source to the bottom of the collection.
  19770. * @param dataSource - The data source to move.
  19771. */
  19772. lowerToBottom(dataSource: DataSource): void;
  19773. /**
  19774. * Returns true if this object was destroyed; otherwise, false.
  19775. * If this object was destroyed, it should not be used; calling any function other than
  19776. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19777. * @returns true if this object was destroyed; otherwise, false.
  19778. */
  19779. isDestroyed(): boolean;
  19780. /**
  19781. * Destroys the resources held by all data sources in this collection. Explicitly destroying this
  19782. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  19783. * collector. Once this object is destroyed, it should not be used; calling any function other than
  19784. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19785. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19786. * @example
  19787. * dataSourceCollection = dataSourceCollection && dataSourceCollection.destroy();
  19788. */
  19789. destroy(): void;
  19790. }
  19791. /**
  19792. * Visualizes a collection of {@link DataSource} instances.
  19793. * @param options - Object with the following properties:
  19794. * @param options.scene - The scene in which to display the data.
  19795. * @param options.dataSourceCollection - The data sources to display.
  19796. * @param [options.visualizersCallback = DataSourceDisplay.defaultVisualizersCallback] - A function which creates an array of visualizers used for visualization.
  19797. * If undefined, all standard visualizers are used.
  19798. */
  19799. export class DataSourceDisplay {
  19800. constructor(options: {
  19801. scene: Scene;
  19802. dataSourceCollection: DataSourceCollection;
  19803. visualizersCallback?: DataSourceDisplay.VisualizersCallback;
  19804. });
  19805. /**
  19806. * Gets or sets the default function which creates an array of visualizers used for visualization.
  19807. * By default, this function uses all standard visualizers.
  19808. */
  19809. static defaultVisualizersCallback(): void;
  19810. /**
  19811. * Gets the scene associated with this display.
  19812. */
  19813. scene: Scene;
  19814. /**
  19815. * Gets the collection of data sources to display.
  19816. */
  19817. dataSources: DataSourceCollection;
  19818. /**
  19819. * Gets the default data source instance which can be used to
  19820. * manually create and visualize entities not tied to
  19821. * a specific data source. This instance is always available
  19822. * and does not appear in the list dataSources collection.
  19823. */
  19824. defaultDataSource: CustomDataSource;
  19825. /**
  19826. * Gets a value indicating whether or not all entities in the data source are ready
  19827. */
  19828. readonly ready: boolean;
  19829. /**
  19830. * Returns true if this object was destroyed; otherwise, false.
  19831. * <br /><br />
  19832. * If this object was destroyed, it should not be used; calling any function other than
  19833. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  19834. * @returns True if this object was destroyed; otherwise, false.
  19835. */
  19836. isDestroyed(): boolean;
  19837. /**
  19838. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  19839. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  19840. * <br /><br />
  19841. * Once an object is destroyed, it should not be used; calling any function other than
  19842. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  19843. * assign the return value (<code>undefined</code>) to the object as done in the example.
  19844. * @example
  19845. * dataSourceDisplay = dataSourceDisplay.destroy();
  19846. */
  19847. destroy(): void;
  19848. /**
  19849. * Updates the display to the provided time.
  19850. * @param time - The simulation time.
  19851. * @returns True if all data sources are ready to be displayed, false otherwise.
  19852. */
  19853. update(time: JulianDate): boolean;
  19854. }
  19855. export namespace DataSourceDisplay {
  19856. /**
  19857. * A function which creates an array of visualizers used for visualization.
  19858. * @example
  19859. * function createVisualizers(scene, dataSource) {
  19860. * return [new Cesium.BillboardVisualizer(scene, dataSource.entities)];
  19861. * }
  19862. * @param scene - The scene to create visualizers for.
  19863. * @param dataSource - The data source to create visualizers for.
  19864. */
  19865. type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[];
  19866. }
  19867. /**
  19868. * A {@link GeometryUpdater} for ellipses.
  19869. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  19870. * @param entity - The entity containing the geometry to be visualized.
  19871. * @param scene - The scene where visualization is taking place.
  19872. */
  19873. export class EllipseGeometryUpdater {
  19874. constructor(entity: Entity, scene: Scene);
  19875. /**
  19876. * Creates the geometry instance which represents the fill of the geometry.
  19877. * @param time - The time to use when retrieving initial attribute values.
  19878. * @returns The geometry instance representing the filled portion of the geometry.
  19879. */
  19880. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  19881. /**
  19882. * Creates the geometry instance which represents the outline of the geometry.
  19883. * @param time - The time to use when retrieving initial attribute values.
  19884. * @returns The geometry instance representing the outline portion of the geometry.
  19885. */
  19886. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  19887. /**
  19888. * Gets a value indicating if the geometry should be drawn on terrain.
  19889. */
  19890. readonly onTerrain: boolean;
  19891. }
  19892. export namespace EllipseGraphics {
  19893. /**
  19894. * Initialization options for the EllipseGraphics constructor
  19895. * @property [show = true] - A boolean Property specifying the visibility of the ellipse.
  19896. * @property [semiMajorAxis] - The numeric Property specifying the semi-major axis.
  19897. * @property [semiMinorAxis] - The numeric Property specifying the semi-minor axis.
  19898. * @property [height = 0] - A numeric Property specifying the altitude of the ellipse relative to the ellipsoid surface.
  19899. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  19900. * @property [extrudedHeight] - A numeric Property specifying the altitude of the ellipse's extruded face relative to the ellipsoid surface.
  19901. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  19902. * @property [rotation = 0.0] - A numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19903. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19904. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the ellipse.
  19905. * @property [fill = true] - A boolean Property specifying whether the ellipse is filled with the provided material.
  19906. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipse.
  19907. * @property [outline = false] - A boolean Property specifying whether the ellipse is outlined.
  19908. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  19909. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  19910. * @property [numberOfVerticalLines = 16] - A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  19911. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipse casts or receives shadows from light sources.
  19912. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipse will be displayed.
  19913. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  19914. * @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.
  19915. */
  19916. type ConstructorOptions = {
  19917. show?: Property | boolean;
  19918. semiMajorAxis?: Property | number;
  19919. semiMinorAxis?: Property | number;
  19920. height?: Property | number;
  19921. heightReference?: Property | HeightReference;
  19922. extrudedHeight?: Property | number;
  19923. extrudedHeightReference?: Property | HeightReference;
  19924. rotation?: Property | number;
  19925. stRotation?: Property | number;
  19926. granularity?: Property | number;
  19927. fill?: Property | boolean;
  19928. material?: MaterialProperty | Color;
  19929. outline?: Property | boolean;
  19930. outlineColor?: Property | Color;
  19931. outlineWidth?: Property | number;
  19932. numberOfVerticalLines?: Property | number;
  19933. shadows?: Property | ShadowMode;
  19934. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  19935. classificationType?: Property | ClassificationType;
  19936. zIndex?: ConstantProperty | number;
  19937. };
  19938. }
  19939. /**
  19940. * Describes an ellipse defined by a center point and semi-major and semi-minor axes.
  19941. * The ellipse conforms to the curvature of the globe and can be placed on the surface or
  19942. * at altitude and can optionally be extruded into a volume.
  19943. * The center point is determined by the containing {@link Entity}.
  19944. * @param [options] - Object describing initialization options
  19945. */
  19946. export class EllipseGraphics {
  19947. constructor(options?: EllipseGraphics.ConstructorOptions);
  19948. /**
  19949. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  19950. */
  19951. readonly definitionChanged: Event;
  19952. /**
  19953. * Gets or sets the boolean Property specifying the visibility of the ellipse.
  19954. */
  19955. show: Property | undefined;
  19956. /**
  19957. * Gets or sets the numeric Property specifying the semi-major axis.
  19958. */
  19959. semiMajorAxis: Property | undefined;
  19960. /**
  19961. * Gets or sets the numeric Property specifying the semi-minor axis.
  19962. */
  19963. semiMinorAxis: Property | undefined;
  19964. /**
  19965. * Gets or sets the numeric Property specifying the altitude of the ellipse.
  19966. */
  19967. height: Property | undefined;
  19968. /**
  19969. * Gets or sets the Property specifying the {@link HeightReference}.
  19970. */
  19971. heightReference: Property | undefined;
  19972. /**
  19973. * Gets or sets the numeric Property specifying the altitude of the ellipse extrusion.
  19974. * Setting this property creates volume starting at height and ending at this altitude.
  19975. */
  19976. extrudedHeight: Property | undefined;
  19977. /**
  19978. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  19979. */
  19980. extrudedHeightReference: Property | undefined;
  19981. /**
  19982. * Gets or sets the numeric property specifying the rotation of the ellipse counter-clockwise from north.
  19983. */
  19984. rotation: Property | undefined;
  19985. /**
  19986. * Gets or sets the numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
  19987. */
  19988. stRotation: Property | undefined;
  19989. /**
  19990. * Gets or sets the numeric Property specifying the angular distance between points on the ellipse.
  19991. */
  19992. granularity: Property | undefined;
  19993. /**
  19994. * Gets or sets the boolean Property specifying whether the ellipse is filled with the provided material.
  19995. */
  19996. fill: Property | undefined;
  19997. /**
  19998. * Gets or sets the Property specifying the material used to fill the ellipse.
  19999. */
  20000. material: MaterialProperty | undefined;
  20001. /**
  20002. * Gets or sets the Property specifying whether the ellipse is outlined.
  20003. */
  20004. outline: Property | undefined;
  20005. /**
  20006. * Gets or sets the Property specifying the {@link Color} of the outline.
  20007. */
  20008. outlineColor: Property | undefined;
  20009. /**
  20010. * Gets or sets the numeric Property specifying the width of the outline.
  20011. * <p>
  20012. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  20013. * </p>
  20014. */
  20015. outlineWidth: Property | undefined;
  20016. /**
  20017. * Gets or sets the numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
  20018. */
  20019. numberOfVerticalLines: Property | undefined;
  20020. /**
  20021. * Get or sets the enum Property specifying whether the ellipse
  20022. * casts or receives shadows from light sources.
  20023. */
  20024. shadows: Property | undefined;
  20025. /**
  20026. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipse will be displayed.
  20027. */
  20028. distanceDisplayCondition: Property | undefined;
  20029. /**
  20030. * Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
  20031. */
  20032. classificationType: Property | undefined;
  20033. /**
  20034. * 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
  20035. */
  20036. zIndex: ConstantProperty | undefined;
  20037. /**
  20038. * Duplicates this instance.
  20039. * @param [result] - The object onto which to store the result.
  20040. * @returns The modified result parameter or a new instance if one was not provided.
  20041. */
  20042. clone(result?: EllipseGraphics): EllipseGraphics;
  20043. /**
  20044. * Assigns each unassigned property on this object to the value
  20045. * of the same property on the provided source object.
  20046. * @param source - The object to be merged into this object.
  20047. */
  20048. merge(source: EllipseGraphics): void;
  20049. }
  20050. /**
  20051. * A {@link GeometryUpdater} for ellipsoids.
  20052. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  20053. * @param entity - The entity containing the geometry to be visualized.
  20054. * @param scene - The scene where visualization is taking place.
  20055. */
  20056. export class EllipsoidGeometryUpdater {
  20057. constructor(entity: Entity, scene: Scene);
  20058. /**
  20059. * Creates the geometry instance which represents the fill of the geometry.
  20060. * @param time - The time to use when retrieving initial attribute values.
  20061. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  20062. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  20063. * @returns The geometry instance representing the filled portion of the geometry.
  20064. */
  20065. createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  20066. /**
  20067. * Creates the geometry instance which represents the outline of the geometry.
  20068. * @param time - The time to use when retrieving initial attribute values.
  20069. * @param [skipModelMatrix = false] - Whether to compute a model matrix for the geometry instance
  20070. * @param [modelMatrixResult] - Used to store the result of the model matrix calculation
  20071. * @returns The geometry instance representing the outline portion of the geometry.
  20072. */
  20073. createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance;
  20074. }
  20075. export namespace EllipsoidGraphics {
  20076. /**
  20077. * Initialization options for the EllipsoidGraphics constructor
  20078. * @property [show = true] - A boolean Property specifying the visibility of the ellipsoid.
  20079. * @property [radii] - A {@link Cartesian3} Property specifying the radii of the ellipsoid.
  20080. * @property [innerRadii] - A {@link Cartesian3} Property specifying the inner radii of the ellipsoid.
  20081. * @property [minimumClock = 0.0] - A Property specifying the minimum clock angle of the ellipsoid.
  20082. * @property [maximumClock = 2*PI] - A Property specifying the maximum clock angle of the ellipsoid.
  20083. * @property [minimumCone = 0.0] - A Property specifying the minimum cone angle of the ellipsoid.
  20084. * @property [maximumCone = PI] - A Property specifying the maximum cone angle of the ellipsoid.
  20085. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height from the entity position is relative to.
  20086. * @property [fill = true] - A boolean Property specifying whether the ellipsoid is filled with the provided material.
  20087. * @property [material = Color.WHITE] - A Property specifying the material used to fill the ellipsoid.
  20088. * @property [outline = false] - A boolean Property specifying whether the ellipsoid is outlined.
  20089. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  20090. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  20091. * @property [stackPartitions = 64] - A Property specifying the number of stacks.
  20092. * @property [slicePartitions = 64] - A Property specifying the number of radial slices.
  20093. * @property [subdivisions = 128] - A Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  20094. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the ellipsoid casts or receives shadows from light sources.
  20095. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this ellipsoid will be displayed.
  20096. */
  20097. type ConstructorOptions = {
  20098. show?: Property | boolean;
  20099. radii?: Property | Cartesian3;
  20100. innerRadii?: Property | Cartesian3;
  20101. minimumClock?: Property | number;
  20102. maximumClock?: Property | number;
  20103. minimumCone?: Property | number;
  20104. maximumCone?: Property | number;
  20105. heightReference?: Property | HeightReference;
  20106. fill?: Property | boolean;
  20107. material?: MaterialProperty | Color;
  20108. outline?: Property | boolean;
  20109. outlineColor?: Property | Color;
  20110. outlineWidth?: Property | number;
  20111. stackPartitions?: Property | number;
  20112. slicePartitions?: Property | number;
  20113. subdivisions?: Property | number;
  20114. shadows?: Property | ShadowMode;
  20115. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  20116. };
  20117. }
  20118. /**
  20119. * Describe an ellipsoid or sphere. The center position and orientation are determined by the containing {@link Entity}.
  20120. * @param [options] - Object describing initialization options
  20121. */
  20122. export class EllipsoidGraphics {
  20123. constructor(options?: EllipsoidGraphics.ConstructorOptions);
  20124. /**
  20125. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  20126. */
  20127. readonly definitionChanged: Event;
  20128. /**
  20129. * Gets or sets the boolean Property specifying the visibility of the ellipsoid.
  20130. */
  20131. show: Property | undefined;
  20132. /**
  20133. * Gets or sets the {@link Cartesian3} {@link Property} specifying the radii of the ellipsoid.
  20134. */
  20135. radii: Property | undefined;
  20136. /**
  20137. * Gets or sets the {@link Cartesian3} {@link Property} specifying the inner radii of the ellipsoid.
  20138. */
  20139. innerRadii: Property | undefined;
  20140. /**
  20141. * Gets or sets the Property specifying the minimum clock angle of the ellipsoid.
  20142. */
  20143. minimumClock: Property | undefined;
  20144. /**
  20145. * Gets or sets the Property specifying the maximum clock angle of the ellipsoid.
  20146. */
  20147. maximumClock: Property | undefined;
  20148. /**
  20149. * Gets or sets the Property specifying the minimum cone angle of the ellipsoid.
  20150. */
  20151. minimumCone: Property | undefined;
  20152. /**
  20153. * Gets or sets the Property specifying the maximum cone angle of the ellipsoid.
  20154. */
  20155. maximumCone: Property | undefined;
  20156. /**
  20157. * Gets or sets the Property specifying the {@link HeightReference}.
  20158. */
  20159. heightReference: Property | undefined;
  20160. /**
  20161. * Gets or sets the boolean Property specifying whether the ellipsoid is filled with the provided material.
  20162. */
  20163. fill: Property | undefined;
  20164. /**
  20165. * Gets or sets the Property specifying the material used to fill the ellipsoid.
  20166. */
  20167. material: MaterialProperty;
  20168. /**
  20169. * Gets or sets the Property specifying whether the ellipsoid is outlined.
  20170. */
  20171. outline: Property | undefined;
  20172. /**
  20173. * Gets or sets the Property specifying the {@link Color} of the outline.
  20174. */
  20175. outlineColor: Property | undefined;
  20176. /**
  20177. * Gets or sets the numeric Property specifying the width of the outline.
  20178. * <p>
  20179. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  20180. * </p>
  20181. */
  20182. outlineWidth: Property | undefined;
  20183. /**
  20184. * Gets or sets the Property specifying the number of stacks.
  20185. */
  20186. stackPartitions: Property | undefined;
  20187. /**
  20188. * Gets or sets the Property specifying the number of radial slices per 360 degrees.
  20189. */
  20190. slicePartitions: Property | undefined;
  20191. /**
  20192. * Gets or sets the Property specifying the number of samples per outline ring, determining the granularity of the curvature.
  20193. */
  20194. subdivisions: Property | undefined;
  20195. /**
  20196. * Get or sets the enum Property specifying whether the ellipsoid
  20197. * casts or receives shadows from light sources.
  20198. */
  20199. shadows: Property | undefined;
  20200. /**
  20201. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this ellipsoid will be displayed.
  20202. */
  20203. distanceDisplayCondition: Property | undefined;
  20204. /**
  20205. * Duplicates this instance.
  20206. * @param [result] - The object onto which to store the result.
  20207. * @returns The modified result parameter or a new instance if one was not provided.
  20208. */
  20209. clone(result?: EllipsoidGraphics): EllipsoidGraphics;
  20210. /**
  20211. * Assigns each unassigned property on this object to the value
  20212. * of the same property on the provided source object.
  20213. * @param source - The object to be merged into this object.
  20214. */
  20215. merge(source: EllipsoidGraphics): void;
  20216. }
  20217. export namespace Entity {
  20218. /**
  20219. * Initialization options for the Entity constructor
  20220. * @property [id] - A unique identifier for this object. If none is provided, a GUID is generated.
  20221. * @property [name] - A human readable name to display to users. It does not have to be unique.
  20222. * @property [availability] - The availability, if any, associated with this object.
  20223. * @property [show] - A boolean value indicating if the entity and its children are displayed.
  20224. * @property [description] - A string Property specifying an HTML description for this entity.
  20225. * @property [position] - A Property specifying the entity position.
  20226. * @property [orientation] - A Property specifying the entity orientation.
  20227. * @property [viewFrom] - A suggested initial offset for viewing this object.
  20228. * @property [parent] - A parent entity to associate with this entity.
  20229. * @property [billboard] - A billboard to associate with this entity.
  20230. * @property [box] - A box to associate with this entity.
  20231. * @property [corridor] - A corridor to associate with this entity.
  20232. * @property [cylinder] - A cylinder to associate with this entity.
  20233. * @property [ellipse] - A ellipse to associate with this entity.
  20234. * @property [ellipsoid] - A ellipsoid to associate with this entity.
  20235. * @property [label] - A options.label to associate with this entity.
  20236. * @property [model] - A model to associate with this entity.
  20237. * @property [tileset] - A 3D Tiles tileset to associate with this entity.
  20238. * @property [path] - A path to associate with this entity.
  20239. * @property [plane] - A plane to associate with this entity.
  20240. * @property [point] - A point to associate with this entity.
  20241. * @property [polygon] - A polygon to associate with this entity.
  20242. * @property [polyline] - A polyline to associate with this entity.
  20243. * @property [properties] - Arbitrary properties to associate with this entity.
  20244. * @property [polylineVolume] - A polylineVolume to associate with this entity.
  20245. * @property [rectangle] - A rectangle to associate with this entity.
  20246. * @property [wall] - A wall to associate with this entity.
  20247. */
  20248. type ConstructorOptions = {
  20249. id?: string;
  20250. name?: string;
  20251. availability?: TimeIntervalCollection;
  20252. show?: boolean;
  20253. description?: Property | string;
  20254. position?: PositionProperty | Cartesian3;
  20255. orientation?: Property;
  20256. viewFrom?: Property;
  20257. parent?: Entity;
  20258. billboard?: BillboardGraphics | BillboardGraphics.ConstructorOptions;
  20259. box?: BoxGraphics | BoxGraphics.ConstructorOptions;
  20260. corridor?: CorridorGraphics | CorridorGraphics.ConstructorOptions;
  20261. cylinder?: CylinderGraphics | CylinderGraphics.ConstructorOptions;
  20262. ellipse?: EllipseGraphics | EllipseGraphics.ConstructorOptions;
  20263. ellipsoid?: EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions;
  20264. label?: LabelGraphics | LabelGraphics.ConstructorOptions;
  20265. model?: ModelGraphics | ModelGraphics.ConstructorOptions;
  20266. tileset?: Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions;
  20267. path?: PathGraphics | PathGraphics.ConstructorOptions;
  20268. plane?: PlaneGraphics | PlaneGraphics.ConstructorOptions;
  20269. point?: PointGraphics | PointGraphics.ConstructorOptions;
  20270. polygon?: PolygonGraphics | PolygonGraphics.ConstructorOptions;
  20271. polyline?: PolylineGraphics | PolylineGraphics.ConstructorOptions;
  20272. properties?: PropertyBag | {
  20273. [key: string]: any;
  20274. };
  20275. polylineVolume?: PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions;
  20276. rectangle?: RectangleGraphics | RectangleGraphics.ConstructorOptions;
  20277. wall?: WallGraphics | WallGraphics.ConstructorOptions;
  20278. };
  20279. }
  20280. /**
  20281. * Entity instances aggregate multiple forms of visualization into a single high-level object.
  20282. * They can be created manually and added to {@link Viewer#entities} or be produced by
  20283. * data sources, such as {@link CzmlDataSource} and {@link GeoJsonDataSource}.
  20284. * @param [options] - Object describing initialization options
  20285. */
  20286. export class Entity {
  20287. constructor(options?: Entity.ConstructorOptions);
  20288. /**
  20289. * Gets or sets the entity collection that this entity belongs to.
  20290. */
  20291. entityCollection: EntityCollection;
  20292. /**
  20293. * The availability, if any, associated with this object.
  20294. * If availability is undefined, it is assumed that this object's
  20295. * other properties will return valid data for any provided time.
  20296. * If availability exists, the objects other properties will only
  20297. * provide valid data if queried within the given interval.
  20298. */
  20299. availability: TimeIntervalCollection | undefined;
  20300. /**
  20301. * Gets the unique ID associated with this object.
  20302. */
  20303. id: string;
  20304. /**
  20305. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  20306. */
  20307. readonly definitionChanged: Event;
  20308. /**
  20309. * Gets or sets the name of the object. The name is intended for end-user
  20310. * consumption and does not need to be unique.
  20311. */
  20312. name: string | undefined;
  20313. /**
  20314. * Gets or sets whether this entity should be displayed. When set to true,
  20315. * the entity is only displayed if the parent entity's show property is also true.
  20316. */
  20317. show: boolean;
  20318. /**
  20319. * Gets whether this entity is being displayed, taking into account
  20320. * the visibility of any ancestor entities.
  20321. */
  20322. isShowing: boolean;
  20323. /**
  20324. * Gets or sets the parent object.
  20325. */
  20326. parent: Entity | undefined;
  20327. /**
  20328. * Gets the names of all properties registered on this instance.
  20329. */
  20330. propertyNames: string[];
  20331. /**
  20332. * Gets or sets the billboard.
  20333. */
  20334. billboard: BillboardGraphics | undefined;
  20335. /**
  20336. * Gets or sets the box.
  20337. */
  20338. box: BoxGraphics | undefined;
  20339. /**
  20340. * Gets or sets the corridor.
  20341. */
  20342. corridor: CorridorGraphics | undefined;
  20343. /**
  20344. * Gets or sets the cylinder.
  20345. */
  20346. cylinder: CylinderGraphics | undefined;
  20347. /**
  20348. * Gets or sets the description.
  20349. */
  20350. description: Property | undefined;
  20351. /**
  20352. * Gets or sets the ellipse.
  20353. */
  20354. ellipse: EllipseGraphics | undefined;
  20355. /**
  20356. * Gets or sets the ellipsoid.
  20357. */
  20358. ellipsoid: EllipsoidGraphics | undefined;
  20359. /**
  20360. * Gets or sets the label.
  20361. */
  20362. label: LabelGraphics | undefined;
  20363. /**
  20364. * Gets or sets the model.
  20365. */
  20366. model: ModelGraphics | undefined;
  20367. /**
  20368. * Gets or sets the tileset.
  20369. */
  20370. tileset: Cesium3DTilesetGraphics | undefined;
  20371. /**
  20372. * Gets or sets the orientation.
  20373. */
  20374. orientation: Property | undefined;
  20375. /**
  20376. * Gets or sets the path.
  20377. */
  20378. path: PathGraphics | undefined;
  20379. /**
  20380. * Gets or sets the plane.
  20381. */
  20382. plane: PlaneGraphics | undefined;
  20383. /**
  20384. * Gets or sets the point graphic.
  20385. */
  20386. point: PointGraphics | undefined;
  20387. /**
  20388. * Gets or sets the polygon.
  20389. */
  20390. polygon: PolygonGraphics | undefined;
  20391. /**
  20392. * Gets or sets the polyline.
  20393. */
  20394. polyline: PolylineGraphics | undefined;
  20395. /**
  20396. * Gets or sets the polyline volume.
  20397. */
  20398. polylineVolume: PolylineVolumeGraphics | undefined;
  20399. /**
  20400. * Gets or sets the bag of arbitrary properties associated with this entity.
  20401. */
  20402. properties: PropertyBag | undefined;
  20403. /**
  20404. * Gets or sets the position.
  20405. */
  20406. position: PositionProperty | undefined;
  20407. /**
  20408. * Gets or sets the rectangle.
  20409. */
  20410. rectangle: RectangleGraphics | undefined;
  20411. /**
  20412. * Gets or sets the suggested initial offset when tracking this object.
  20413. * The offset is typically defined in the east-north-up reference frame,
  20414. * but may be another frame depending on the object's velocity.
  20415. */
  20416. viewFrom: Property | undefined;
  20417. /**
  20418. * Gets or sets the wall.
  20419. */
  20420. wall: WallGraphics | undefined;
  20421. /**
  20422. * Given a time, returns true if this object should have data during that time.
  20423. * @param time - The time to check availability for.
  20424. * @returns true if the object should have data during the provided time, false otherwise.
  20425. */
  20426. isAvailable(time: JulianDate): boolean;
  20427. /**
  20428. * Adds a property to this object. Once a property is added, it can be
  20429. * observed with {@link Entity#definitionChanged} and composited
  20430. * with {@link CompositeEntityCollection}
  20431. * @param propertyName - The name of the property to add.
  20432. */
  20433. addProperty(propertyName: string): void;
  20434. /**
  20435. * Removed a property previously added with addProperty.
  20436. * @param propertyName - The name of the property to remove.
  20437. */
  20438. removeProperty(propertyName: string): void;
  20439. /**
  20440. * Assigns each unassigned property on this object to the value
  20441. * of the same property on the provided source object.
  20442. * @param source - The object to be merged into this object.
  20443. */
  20444. merge(source: Entity): void;
  20445. /**
  20446. * Computes the model matrix for the entity's transform at specified time. Returns undefined if orientation or position
  20447. * are undefined.
  20448. * @param time - The time to retrieve model matrix for.
  20449. * @param [result] - The object onto which to store the result.
  20450. * @returns The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position or orientation are undefined.
  20451. */
  20452. computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4;
  20453. /**
  20454. * Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles.
  20455. * If this feature is not supported, Entities with non-color materials but no `height` will
  20456. * instead be rendered as if height is 0.
  20457. * @param scene - The current scene.
  20458. * @returns Whether or not the current scene supports materials for entities on terrain.
  20459. */
  20460. static supportsMaterialsforEntitiesOnTerrain(scene: Scene): boolean;
  20461. /**
  20462. * Checks if the given Scene supports polylines clamped to terrain or 3D Tiles.
  20463. * If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at
  20464. * the provided heights and using the `arcType` parameter instead of clamped to the ground.
  20465. * @param scene - The current scene.
  20466. * @returns Whether or not the current scene supports polylines on terrain or 3D TIles.
  20467. */
  20468. static supportsPolylinesOnTerrain(scene: Scene): boolean;
  20469. }
  20470. /**
  20471. * Defines how screen space objects (billboards, points, labels) are clustered.
  20472. * @param [options] - An object with the following properties:
  20473. * @param [options.enabled = false] - Whether or not to enable clustering.
  20474. * @param [options.pixelRange = 80] - The pixel range to extend the screen space bounding box.
  20475. * @param [options.minimumClusterSize = 2] - The minimum number of screen space objects that can be clustered.
  20476. * @param [options.clusterBillboards = true] - Whether or not to cluster the billboards of an entity.
  20477. * @param [options.clusterLabels = true] - Whether or not to cluster the labels of an entity.
  20478. * @param [options.clusterPoints = true] - Whether or not to cluster the points of an entity.
  20479. * @param [options.show = true] - Determines if the entities in the cluster will be shown.
  20480. */
  20481. export class EntityCluster {
  20482. constructor(options?: {
  20483. enabled?: boolean;
  20484. pixelRange?: number;
  20485. minimumClusterSize?: number;
  20486. clusterBillboards?: boolean;
  20487. clusterLabels?: boolean;
  20488. clusterPoints?: boolean;
  20489. show?: boolean;
  20490. });
  20491. /**
  20492. * Determines if entities in this collection will be shown.
  20493. */
  20494. show: boolean;
  20495. /**
  20496. * Gets or sets whether clustering is enabled.
  20497. */
  20498. enabled: boolean;
  20499. /**
  20500. * Gets or sets the pixel range to extend the screen space bounding box.
  20501. */
  20502. pixelRange: number;
  20503. /**
  20504. * Gets or sets the minimum number of screen space objects that can be clustered.
  20505. */
  20506. minimumClusterSize: number;
  20507. /**
  20508. * Gets the event that will be raised when a new cluster will be displayed. The signature of the event listener is {@link EntityCluster.newClusterCallback}.
  20509. */
  20510. clusterEvent: Event<EntityCluster.newClusterCallback>;
  20511. /**
  20512. * Gets or sets whether clustering billboard entities is enabled.
  20513. */
  20514. clusterBillboards: boolean;
  20515. /**
  20516. * Gets or sets whether clustering labels entities is enabled.
  20517. */
  20518. clusterLabels: boolean;
  20519. /**
  20520. * Gets or sets whether clustering point entities is enabled.
  20521. */
  20522. clusterPoints: boolean;
  20523. /**
  20524. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  20525. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  20526. * <p>
  20527. * Unlike other objects that use WebGL resources, this object can be reused. For example, if a data source is removed
  20528. * from a data source collection and added to another.
  20529. * </p>
  20530. */
  20531. destroy(): void;
  20532. }
  20533. export namespace EntityCluster {
  20534. /**
  20535. * A event listener function used to style clusters.
  20536. * @example
  20537. * // The default cluster values.
  20538. * dataSource.clustering.clusterEvent.addEventListener(function(entities, cluster) {
  20539. * cluster.label.show = true;
  20540. * cluster.label.text = entities.length.toLocaleString();
  20541. * });
  20542. * @param clusteredEntities - An array of the entities contained in the cluster.
  20543. * @param cluster - An object containing the Billboard, Label, and Point
  20544. * primitives that represent this cluster of entities.
  20545. */
  20546. type newClusterCallback = (clusteredEntities: Entity[], cluster: {
  20547. billboard: Billboard;
  20548. label: Label;
  20549. point: PointPrimitive;
  20550. }) => void;
  20551. }
  20552. /**
  20553. * An observable collection of {@link Entity} instances where each entity has a unique id.
  20554. * @param [owner] - The data source (or composite entity collection) which created this collection.
  20555. */
  20556. export class EntityCollection {
  20557. constructor(owner?: DataSource | CompositeEntityCollection);
  20558. /**
  20559. * Prevents {@link EntityCollection#collectionChanged} events from being raised
  20560. * until a corresponding call is made to {@link EntityCollection#resumeEvents}, at which
  20561. * point a single event will be raised that covers all suspended operations.
  20562. * This allows for many items to be added and removed efficiently.
  20563. * This function can be safely called multiple times as long as there
  20564. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  20565. */
  20566. suspendEvents(): void;
  20567. /**
  20568. * Resumes raising {@link EntityCollection#collectionChanged} events immediately
  20569. * when an item is added or removed. Any modifications made while while events were suspended
  20570. * will be triggered as a single event when this function is called.
  20571. * This function is reference counted and can safely be called multiple times as long as there
  20572. * are corresponding calls to {@link EntityCollection#resumeEvents}.
  20573. */
  20574. resumeEvents(): void;
  20575. /**
  20576. * Gets the event that is fired when entities are added or removed from the collection.
  20577. * The generated event is a {@link EntityCollection.CollectionChangedEventCallback}.
  20578. */
  20579. readonly collectionChanged: Event<EntityCollection.CollectionChangedEventCallback>;
  20580. /**
  20581. * Gets a globally unique identifier for this collection.
  20582. */
  20583. readonly id: string;
  20584. /**
  20585. * Gets the array of Entity instances in the collection.
  20586. * This array should not be modified directly.
  20587. */
  20588. readonly values: Entity[];
  20589. /**
  20590. * Gets whether or not this entity collection should be
  20591. * displayed. When true, each entity is only displayed if
  20592. * its own show property is also true.
  20593. */
  20594. show: boolean;
  20595. /**
  20596. * Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
  20597. */
  20598. readonly owner: DataSource | CompositeEntityCollection;
  20599. /**
  20600. * Computes the maximum availability of the entities in the collection.
  20601. * If the collection contains a mix of infinitely available data and non-infinite data,
  20602. * it will return the interval pertaining to the non-infinite data only. If all
  20603. * data is infinite, an infinite interval will be returned.
  20604. * @returns The availability of entities in the collection.
  20605. */
  20606. computeAvailability(): TimeInterval;
  20607. /**
  20608. * Add an entity to the collection.
  20609. * @param entity - The entity to be added.
  20610. * @returns The entity that was added.
  20611. */
  20612. add(entity: Entity | Entity.ConstructorOptions): Entity;
  20613. /**
  20614. * Removes an entity from the collection.
  20615. * @param entity - The entity to be removed.
  20616. * @returns true if the item was removed, false if it did not exist in the collection.
  20617. */
  20618. remove(entity: Entity): boolean;
  20619. /**
  20620. * Returns true if the provided entity is in this collection, false otherwise.
  20621. * @param entity - The entity.
  20622. * @returns true if the provided entity is in this collection, false otherwise.
  20623. */
  20624. contains(entity: Entity): boolean;
  20625. /**
  20626. * Removes an entity with the provided id from the collection.
  20627. * @param id - The id of the entity to remove.
  20628. * @returns true if the item was removed, false if no item with the provided id existed in the collection.
  20629. */
  20630. removeById(id: string): boolean;
  20631. /**
  20632. * Removes all Entities from the collection.
  20633. */
  20634. removeAll(): void;
  20635. /**
  20636. * Gets an entity with the specified id.
  20637. * @param id - The id of the entity to retrieve.
  20638. * @returns The entity with the provided id or undefined if the id did not exist in the collection.
  20639. */
  20640. getById(id: string): Entity | undefined;
  20641. /**
  20642. * Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.
  20643. * @param id - The id of the entity to retrieve or create.
  20644. * @returns The new or existing object.
  20645. */
  20646. getOrCreateEntity(id: string): Entity;
  20647. }
  20648. export namespace EntityCollection {
  20649. /**
  20650. * The signature of the event generated by {@link EntityCollection#collectionChanged}.
  20651. * @param collection - The collection that triggered the event.
  20652. * @param added - The array of {@link Entity} instances that have been added to the collection.
  20653. * @param removed - The array of {@link Entity} instances that have been removed from the collection.
  20654. * @param changed - The array of {@link Entity} instances that have been modified.
  20655. */
  20656. type CollectionChangedEventCallback = (collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]) => void;
  20657. }
  20658. /**
  20659. * A utility object for tracking an entity with the camera.
  20660. * @param entity - The entity to track with the camera.
  20661. * @param scene - The scene to use.
  20662. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to use for orienting the camera.
  20663. */
  20664. export class EntityView {
  20665. constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid);
  20666. /**
  20667. * The entity to track with the camera.
  20668. */
  20669. entity: Entity;
  20670. /**
  20671. * The scene in which to track the object.
  20672. */
  20673. scene: Scene;
  20674. /**
  20675. * The ellipsoid to use for orienting the camera.
  20676. */
  20677. ellipsoid: Ellipsoid;
  20678. /**
  20679. * The bounding sphere of the object.
  20680. */
  20681. boundingSphere: BoundingSphere;
  20682. /**
  20683. * Gets or sets a camera offset that will be used to
  20684. * initialize subsequent EntityViews.
  20685. */
  20686. static defaultOffset3D: Cartesian3;
  20687. /**
  20688. * Should be called each animation frame to update the camera
  20689. * to the latest settings.
  20690. * @param time - The current animation time.
  20691. * @param [boundingSphere] - bounding sphere of the object.
  20692. */
  20693. update(time: JulianDate, boundingSphere?: BoundingSphere): void;
  20694. }
  20695. export namespace GeoJsonDataSource {
  20696. /**
  20697. * Initialization options for the <code>load</code> method.
  20698. * @property [sourceUri] - Overrides the url to use for resolving relative links.
  20699. * @property [describe = GeoJsonDataSource.defaultDescribeProperty] - A function which returns a Property object (or just a string).
  20700. * @property [markerSize = GeoJsonDataSource.markerSize] - The default size of the map pin created for each point, in pixels.
  20701. * @property [markerSymbol = GeoJsonDataSource.markerSymbol] - The default symbol of the map pin created for each point.
  20702. * @property [markerColor = GeoJsonDataSource.markerColor] - The default color of the map pin created for each point.
  20703. * @property [stroke = GeoJsonDataSource.stroke] - The default color of polylines and polygon outlines.
  20704. * @property [strokeWidth = GeoJsonDataSource.strokeWidth] - The default width of polylines and polygon outlines.
  20705. * @property [fill = GeoJsonDataSource.fill] - The default color for polygon interiors.
  20706. * @property [clampToGround = GeoJsonDataSource.clampToGround] - true if we want the geometry features (polygons or linestrings) clamped to the ground.
  20707. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  20708. */
  20709. type LoadOptions = {
  20710. sourceUri?: string;
  20711. describe?: GeoJsonDataSource.describe;
  20712. markerSize?: number;
  20713. markerSymbol?: string;
  20714. markerColor?: Color;
  20715. stroke?: Color;
  20716. strokeWidth?: number;
  20717. fill?: Color;
  20718. clampToGround?: boolean;
  20719. credit?: Credit | string;
  20720. };
  20721. /**
  20722. * This callback is displayed as part of the GeoJsonDataSource class.
  20723. * @param properties - The properties of the feature.
  20724. * @param nameProperty - The property key that Cesium estimates to have the name of the feature.
  20725. */
  20726. type describe = (properties: any, nameProperty: string) => void;
  20727. }
  20728. /**
  20729. * A {@link DataSource} which processes both
  20730. * {@link http://www.geojson.org/|GeoJSON} and {@link https://github.com/mbostock/topojson|TopoJSON} data.
  20731. * {@link https://github.com/mapbox/simplestyle-spec|simplestyle-spec} properties will also be used if they
  20732. * are present.
  20733. * @example
  20734. * const viewer = new Cesium.Viewer('cesiumContainer');
  20735. * viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson', {
  20736. * stroke: Cesium.Color.HOTPINK,
  20737. * fill: Cesium.Color.PINK,
  20738. * strokeWidth: 3,
  20739. * markerSymbol: '?'
  20740. * }));
  20741. * @param [name] - The name of this data source. If undefined, a name will be taken from
  20742. * the name of the GeoJSON file.
  20743. */
  20744. export class GeoJsonDataSource {
  20745. constructor(name?: string);
  20746. /**
  20747. * Creates a Promise to a new instance loaded with the provided GeoJSON or TopoJSON data.
  20748. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20749. * @param [options] - An object specifying configuration options
  20750. * @returns A promise that will resolve when the data is loaded.
  20751. */
  20752. static load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20753. /**
  20754. * Gets or sets the default size of the map pin created for each point, in pixels.
  20755. */
  20756. static markerSize: number;
  20757. /**
  20758. * Gets or sets the default symbol of the map pin created for each point.
  20759. * This can be any valid {@link http://mapbox.com/maki/|Maki} identifier, any single character,
  20760. * or blank if no symbol is to be used.
  20761. */
  20762. static markerSymbol: string;
  20763. /**
  20764. * Gets or sets the default color of the map pin created for each point.
  20765. */
  20766. static markerColor: Color;
  20767. /**
  20768. * Gets or sets the default color of polylines and polygon outlines.
  20769. */
  20770. static stroke: Color;
  20771. /**
  20772. * Gets or sets the default width of polylines and polygon outlines.
  20773. */
  20774. static strokeWidth: number;
  20775. /**
  20776. * Gets or sets default color for polygon interiors.
  20777. */
  20778. static fill: Color;
  20779. /**
  20780. * Gets or sets default of whether to clamp to the ground.
  20781. */
  20782. static clampToGround: boolean;
  20783. /**
  20784. * Gets an object that maps the name of a crs to a callback function which takes a GeoJSON coordinate
  20785. * and transforms it into a WGS84 Earth-fixed Cartesian. Older versions of GeoJSON which
  20786. * supported the EPSG type can be added to this list as well, by specifying the complete EPSG name,
  20787. * for example 'EPSG:4326'.
  20788. */
  20789. static crsNames: any;
  20790. /**
  20791. * Gets an object that maps the href property of a crs link to a callback function
  20792. * which takes the crs properties object and returns a Promise that resolves
  20793. * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20794. * Items in this object take precedence over those defined in <code>crsLinkHrefs</code>, assuming
  20795. * the link has a type specified.
  20796. */
  20797. static crsLinkHrefs: any;
  20798. /**
  20799. * Gets an object that maps the type property of a crs link to a callback function
  20800. * which takes the crs properties object and returns a Promise that resolves
  20801. * to a function that takes a GeoJSON coordinate and transforms it into a WGS84 Earth-fixed Cartesian.
  20802. * Items in <code>crsLinkHrefs</code> take precedence over this object.
  20803. */
  20804. static crsLinkTypes: any;
  20805. /**
  20806. * Gets or sets a human-readable name for this instance.
  20807. */
  20808. name: string;
  20809. /**
  20810. * This DataSource only defines static data, therefore this property is always undefined.
  20811. */
  20812. clock: DataSourceClock;
  20813. /**
  20814. * Gets the collection of {@link Entity} instances.
  20815. */
  20816. entities: EntityCollection;
  20817. /**
  20818. * Gets a value indicating if the data source is currently loading data.
  20819. */
  20820. isLoading: boolean;
  20821. /**
  20822. * Gets an event that will be raised when the underlying data changes.
  20823. */
  20824. changedEvent: Event;
  20825. /**
  20826. * Gets an event that will be raised if an error is encountered during processing.
  20827. */
  20828. errorEvent: Event;
  20829. /**
  20830. * Gets an event that will be raised when the data source either starts or stops loading.
  20831. */
  20832. loadingEvent: Event;
  20833. /**
  20834. * Gets whether or not this data source should be displayed.
  20835. */
  20836. show: boolean;
  20837. /**
  20838. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  20839. */
  20840. clustering: EntityCluster;
  20841. /**
  20842. * Gets the credit that will be displayed for the data source
  20843. */
  20844. credit: Credit;
  20845. /**
  20846. * Asynchronously loads the provided GeoJSON or TopoJSON data, replacing any existing data.
  20847. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20848. * @param [options] - An object specifying configuration options
  20849. * @returns a promise that will resolve when the GeoJSON is loaded.
  20850. */
  20851. load(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20852. /**
  20853. * Asynchronously loads the provided GeoJSON or TopoJSON data, without replacing any existing data.
  20854. * @param data - A url, GeoJSON object, or TopoJSON object to be loaded.
  20855. * @param [options] - An object specifying configuration options
  20856. * @returns a promise that will resolve when the GeoJSON is loaded.
  20857. */
  20858. process(data: Resource | string | any, options?: GeoJsonDataSource.LoadOptions): Promise<GeoJsonDataSource>;
  20859. /**
  20860. * Updates the data source to the provided time. This function is optional and
  20861. * is not required to be implemented. It is provided for data sources which
  20862. * retrieve data based on the current animation time or scene state.
  20863. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  20864. * @param time - The simulation time.
  20865. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  20866. */
  20867. update(time: JulianDate): boolean;
  20868. }
  20869. /**
  20870. * An abstract class for updating geometry entities.
  20871. * @param options - An object with the following properties:
  20872. * @param options.entity - The entity containing the geometry to be visualized.
  20873. * @param options.scene - The scene where visualization is taking place.
  20874. * @param options.geometryOptions - Options for the geometry
  20875. * @param options.geometryPropertyName - The geometry property name
  20876. * @param options.observedPropertyNames - The entity properties this geometry cares about
  20877. */
  20878. export class GeometryUpdater {
  20879. constructor(options: {
  20880. entity: Entity;
  20881. scene: Scene;
  20882. geometryOptions: any;
  20883. geometryPropertyName: string;
  20884. observedPropertyNames: string[];
  20885. });
  20886. /**
  20887. * Gets the unique ID associated with this updater
  20888. */
  20889. readonly id: string;
  20890. /**
  20891. * Gets the entity associated with this geometry.
  20892. */
  20893. readonly entity: Entity;
  20894. /**
  20895. * Gets a value indicating if the geometry has a fill component.
  20896. */
  20897. readonly fillEnabled: boolean;
  20898. /**
  20899. * Gets a value indicating if fill visibility varies with simulation time.
  20900. */
  20901. readonly hasConstantFill: boolean;
  20902. /**
  20903. * Gets the material property used to fill the geometry.
  20904. */
  20905. readonly fillMaterialProperty: MaterialProperty;
  20906. /**
  20907. * Gets a value indicating if the geometry has an outline component.
  20908. */
  20909. readonly outlineEnabled: boolean;
  20910. /**
  20911. * Gets a value indicating if the geometry has an outline component.
  20912. */
  20913. readonly hasConstantOutline: boolean;
  20914. /**
  20915. * Gets the {@link Color} property for the geometry outline.
  20916. */
  20917. readonly outlineColorProperty: Property;
  20918. /**
  20919. * Gets the constant with of the geometry outline, in pixels.
  20920. * This value is only valid if isDynamic is false.
  20921. */
  20922. readonly outlineWidth: number;
  20923. /**
  20924. * Gets the property specifying whether the geometry
  20925. * casts or receives shadows from light sources.
  20926. */
  20927. readonly shadowsProperty: Property;
  20928. /**
  20929. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  20930. */
  20931. readonly distanceDisplayConditionProperty: Property;
  20932. /**
  20933. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  20934. */
  20935. readonly classificationTypeProperty: Property;
  20936. /**
  20937. * Gets a value indicating if the geometry is time-varying.
  20938. * If true, all visualization is delegated to a DynamicGeometryUpdater
  20939. * returned by GeometryUpdater#createDynamicUpdater.
  20940. */
  20941. readonly isDynamic: boolean;
  20942. /**
  20943. * Gets a value indicating if the geometry is closed.
  20944. * This property is only valid for static geometry.
  20945. */
  20946. readonly isClosed: boolean;
  20947. /**
  20948. * Gets an event that is raised whenever the public properties
  20949. * of this updater change.
  20950. */
  20951. readonly geometryChanged: boolean;
  20952. /**
  20953. * Checks if the geometry is outlined at the provided time.
  20954. * @param time - The time for which to retrieve visibility.
  20955. * @returns true if geometry is outlined at the provided time, false otherwise.
  20956. */
  20957. isOutlineVisible(time: JulianDate): boolean;
  20958. /**
  20959. * Checks if the geometry is filled at the provided time.
  20960. * @param time - The time for which to retrieve visibility.
  20961. * @returns true if geometry is filled at the provided time, false otherwise.
  20962. */
  20963. isFilled(time: JulianDate): boolean;
  20964. /**
  20965. * Creates the geometry instance which represents the fill of the geometry.
  20966. * @param time - The time to use when retrieving initial attribute values.
  20967. * @returns The geometry instance representing the filled portion of the geometry.
  20968. */
  20969. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  20970. /**
  20971. * Creates the geometry instance which represents the outline of the geometry.
  20972. * @param time - The time to use when retrieving initial attribute values.
  20973. * @returns The geometry instance representing the outline portion of the geometry.
  20974. */
  20975. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  20976. /**
  20977. * Returns true if this object was destroyed; otherwise, false.
  20978. * @returns True if this object was destroyed; otherwise, false.
  20979. */
  20980. isDestroyed(): boolean;
  20981. /**
  20982. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  20983. */
  20984. destroy(): void;
  20985. }
  20986. /**
  20987. * A general purpose visualizer for geometry represented by {@link Primitive} instances.
  20988. * @param scene - The scene the primitives will be rendered in.
  20989. * @param entityCollection - The entityCollection to visualize.
  20990. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  20991. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  20992. */
  20993. export class GeometryVisualizer {
  20994. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  20995. /**
  20996. * Updates all of the primitives created by this visualizer to match their
  20997. * Entity counterpart at the given time.
  20998. * @param time - The time to update to.
  20999. * @returns True if the visualizer successfully updated to the provided time,
  21000. * false if the visualizer is waiting for asynchronous primitives to be created.
  21001. */
  21002. update(time: JulianDate): boolean;
  21003. /**
  21004. * Returns true if this object was destroyed; otherwise, false.
  21005. * @returns True if this object was destroyed; otherwise, false.
  21006. */
  21007. isDestroyed(): boolean;
  21008. /**
  21009. * Removes and destroys all primitives created by this instance.
  21010. */
  21011. destroy(): void;
  21012. }
  21013. /**
  21014. * A {@link DataSource} which processes the GPS Exchange Format (GPX).
  21015. * @example
  21016. * const viewer = new Cesium.Viewer('cesiumContainer');
  21017. * viewer.dataSources.add(Cesium.GpxDataSource.load('../../SampleData/track.gpx'));
  21018. */
  21019. export class GpxDataSource {
  21020. constructor();
  21021. /**
  21022. * Creates a Promise to a new instance loaded with the provided GPX data.
  21023. * @param data - A url, parsed GPX document, or Blob containing binary GPX data.
  21024. * @param [options] - An object with the following properties:
  21025. * @param [options.clampToGround] - True if the symbols should be rendered at the same height as the terrain
  21026. * @param [options.waypointImage] - Image to use for waypoint billboards.
  21027. * @param [options.trackImage] - Image to use for track billboards.
  21028. * @param [options.trackColor] - Color to use for track lines.
  21029. * @param [options.routeColor] - Color to use for route lines.
  21030. * @returns A promise that will resolve to a new GpxDataSource instance once the gpx is loaded.
  21031. */
  21032. static load(data: string | Document | Blob, options?: {
  21033. clampToGround?: boolean;
  21034. waypointImage?: string;
  21035. trackImage?: string;
  21036. trackColor?: string;
  21037. routeColor?: string;
  21038. }): Promise<GpxDataSource>;
  21039. /**
  21040. * Gets a human-readable name for this instance.
  21041. * This will be automatically be set to the GPX document name on load.
  21042. */
  21043. name: string;
  21044. /**
  21045. * Gets the version of the GPX Schema in use.
  21046. */
  21047. version: string;
  21048. /**
  21049. * Gets the creator of the GPX document.
  21050. */
  21051. creator: string;
  21052. /**
  21053. * Gets an object containing metadata about the GPX file.
  21054. */
  21055. metadata: any;
  21056. /**
  21057. * Gets the clock settings defined by the loaded GPX. This represents the total
  21058. * availability interval for all time-dynamic data. If the GPX does not contain
  21059. * time-dynamic data, this value is undefined.
  21060. */
  21061. clock: DataSourceClock;
  21062. /**
  21063. * Gets the collection of {@link Entity} instances.
  21064. */
  21065. entities: EntityCollection;
  21066. /**
  21067. * Gets a value indicating if the data source is currently loading data.
  21068. */
  21069. isLoading: boolean;
  21070. /**
  21071. * Gets an event that will be raised when the underlying data changes.
  21072. */
  21073. changedEvent: Event;
  21074. /**
  21075. * Gets an event that will be raised if an error is encountered during processing.
  21076. */
  21077. errorEvent: Event;
  21078. /**
  21079. * Gets an event that will be raised when the data source either starts or stops loading.
  21080. */
  21081. loadingEvent: Event;
  21082. /**
  21083. * Gets whether or not this data source should be displayed.
  21084. */
  21085. show: boolean;
  21086. /**
  21087. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  21088. */
  21089. clustering: EntityCluster;
  21090. /**
  21091. * Updates the data source to the provided time. This function is optional and
  21092. * is not required to be implemented. It is provided for data sources which
  21093. * retrieve data based on the current animation time or scene state.
  21094. * If implemented, update will be called by {@link DataSourceDisplay} once a frame.
  21095. * @param time - The simulation time.
  21096. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  21097. */
  21098. update(time: JulianDate): boolean;
  21099. /**
  21100. * Asynchronously loads the provided GPX data, replacing any existing data.
  21101. * @param data - A url, parsed GPX document, or Blob containing binary GPX data or a parsed GPX document.
  21102. * @param [options] - An object with the following properties:
  21103. * @param [options.clampToGround] - True if the symbols should be rendered at the same height as the terrain
  21104. * @param [options.waypointImage] - Image to use for waypoint billboards.
  21105. * @param [options.trackImage] - Image to use for track billboards.
  21106. * @param [options.trackColor] - Color to use for track lines.
  21107. * @param [options.routeColor] - Color to use for route lines.
  21108. * @returns A promise that will resolve to this instances once the GPX is loaded.
  21109. */
  21110. load(data: string | Document | Blob, options?: {
  21111. clampToGround?: boolean;
  21112. waypointImage?: string;
  21113. trackImage?: string;
  21114. trackColor?: string;
  21115. routeColor?: string;
  21116. }): Promise<GpxDataSource>;
  21117. }
  21118. /**
  21119. * A {@link MaterialProperty} that maps to grid {@link Material} uniforms.
  21120. * @param [options] - Object with the following properties:
  21121. * @param [options.color = Color.WHITE] - A Property specifying the grid {@link Color}.
  21122. * @param [options.cellAlpha = 0.1] - A numeric Property specifying cell alpha values.
  21123. * @param [options.lineCount = new Cartesian2(8, 8)] - A {@link Cartesian2} Property specifying the number of grid lines along each axis.
  21124. * @param [options.lineThickness = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  21125. * @param [options.lineOffset = new Cartesian2(0.0, 0.0)] - A {@link Cartesian2} Property specifying starting offset of grid lines along each axis.
  21126. */
  21127. export class GridMaterialProperty {
  21128. constructor(options?: {
  21129. color?: Property | Color;
  21130. cellAlpha?: Property | number;
  21131. lineCount?: Property | Cartesian2;
  21132. lineThickness?: Property | Cartesian2;
  21133. lineOffset?: Property | Cartesian2;
  21134. });
  21135. /**
  21136. * Gets a value indicating if this property is constant. A property is considered
  21137. * constant if getValue always returns the same result for the current definition.
  21138. */
  21139. readonly isConstant: boolean;
  21140. /**
  21141. * Gets the event that is raised whenever the definition of this property changes.
  21142. * The definition is considered to have changed if a call to getValue would return
  21143. * a different result for the same time.
  21144. */
  21145. readonly definitionChanged: Event;
  21146. /**
  21147. * Gets or sets the Property specifying the grid {@link Color}.
  21148. */
  21149. color: Property | undefined;
  21150. /**
  21151. * Gets or sets the numeric Property specifying cell alpha values.
  21152. */
  21153. cellAlpha: Property | undefined;
  21154. /**
  21155. * Gets or sets the {@link Cartesian2} Property specifying the number of grid lines along each axis.
  21156. */
  21157. lineCount: Property | undefined;
  21158. /**
  21159. * Gets or sets the {@link Cartesian2} Property specifying the thickness of grid lines along each axis.
  21160. */
  21161. lineThickness: Property | undefined;
  21162. /**
  21163. * Gets or sets the {@link Cartesian2} Property specifying the starting offset of grid lines along each axis.
  21164. */
  21165. lineOffset: Property | undefined;
  21166. /**
  21167. * Gets the {@link Material} type at the provided time.
  21168. * @param time - The time for which to retrieve the type.
  21169. * @returns The type of material.
  21170. */
  21171. getType(time: JulianDate): string;
  21172. /**
  21173. * Gets the value of the property at the provided time.
  21174. * @param time - The time for which to retrieve the value.
  21175. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21176. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21177. */
  21178. getValue(time: JulianDate, result?: any): any;
  21179. /**
  21180. * Compares this property to the provided property and returns
  21181. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21182. * @param [other] - The other property.
  21183. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21184. */
  21185. equals(other?: Property): boolean;
  21186. }
  21187. /**
  21188. * An abstract class for updating ground geometry entities.
  21189. * @param options - An object with the following properties:
  21190. * @param options.entity - The entity containing the geometry to be visualized.
  21191. * @param options.scene - The scene where visualization is taking place.
  21192. * @param options.geometryOptions - Options for the geometry
  21193. * @param options.geometryPropertyName - The geometry property name
  21194. * @param options.observedPropertyNames - The entity properties this geometry cares about
  21195. */
  21196. export class GroundGeometryUpdater {
  21197. constructor(options: {
  21198. entity: Entity;
  21199. scene: Scene;
  21200. geometryOptions: any;
  21201. geometryPropertyName: string;
  21202. observedPropertyNames: string[];
  21203. });
  21204. /**
  21205. * Gets the zindex
  21206. */
  21207. readonly zIndex: number;
  21208. /**
  21209. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  21210. */
  21211. destroy(): void;
  21212. }
  21213. /**
  21214. * A {@link MaterialProperty} that maps to image {@link Material} uniforms.
  21215. * @param [options] - Object with the following properties:
  21216. * @param [options.image] - A Property specifying the Image, URL, Canvas, or Video.
  21217. * @param [options.repeat = new Cartesian2(1.0, 1.0)] - A {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  21218. * @param [options.color = Color.WHITE] - The color applied to the image
  21219. * @param [options.transparent = false] - Set to true when the image has transparency (for example, when a png has transparent sections)
  21220. */
  21221. export class ImageMaterialProperty {
  21222. constructor(options?: {
  21223. image?: Property | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
  21224. repeat?: Property | Cartesian2;
  21225. color?: Property | Color;
  21226. transparent?: Property | boolean;
  21227. });
  21228. /**
  21229. * Gets a value indicating if this property is constant. A property is considered
  21230. * constant if getValue always returns the same result for the current definition.
  21231. */
  21232. readonly isConstant: boolean;
  21233. /**
  21234. * Gets the event that is raised whenever the definition of this property changes.
  21235. * The definition is considered to have changed if a call to getValue would return
  21236. * a different result for the same time.
  21237. */
  21238. readonly definitionChanged: Event;
  21239. /**
  21240. * Gets or sets the Property specifying Image, URL, Canvas, or Video to use.
  21241. */
  21242. image: Property | undefined;
  21243. /**
  21244. * Gets or sets the {@link Cartesian2} Property specifying the number of times the image repeats in each direction.
  21245. */
  21246. repeat: Property | undefined;
  21247. /**
  21248. * Gets or sets the Color Property specifying the desired color applied to the image.
  21249. */
  21250. color: Property | undefined;
  21251. /**
  21252. * Gets or sets the Boolean Property specifying whether the image has transparency
  21253. */
  21254. transparent: Property | undefined;
  21255. /**
  21256. * Gets the {@link Material} type at the provided time.
  21257. * @param time - The time for which to retrieve the type.
  21258. * @returns The type of material.
  21259. */
  21260. getType(time: JulianDate): string;
  21261. /**
  21262. * Gets the value of the property at the provided time.
  21263. * @param time - The time for which to retrieve the value.
  21264. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21265. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21266. */
  21267. getValue(time: JulianDate, result?: any): any;
  21268. /**
  21269. * Compares this property to the provided property and returns
  21270. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21271. * @param [other] - The other property.
  21272. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21273. */
  21274. equals(other?: Property): boolean;
  21275. }
  21276. /**
  21277. * Representation of <Camera> from KML
  21278. * @param position - camera position
  21279. * @param headingPitchRoll - camera orientation
  21280. */
  21281. export class KmlCamera {
  21282. constructor(position: Cartesian3, headingPitchRoll: HeadingPitchRoll);
  21283. }
  21284. export namespace KmlDataSource {
  21285. /**
  21286. * Initialization options for the `load` method.
  21287. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  21288. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  21289. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  21290. * @property [screenOverlayContainer] - A container for ScreenOverlay images.
  21291. */
  21292. type LoadOptions = {
  21293. sourceUri?: string;
  21294. clampToGround?: boolean;
  21295. ellipsoid?: Ellipsoid;
  21296. screenOverlayContainer?: Element | string;
  21297. };
  21298. /**
  21299. * Options for constructing a new KmlDataSource, or calling the static `load` method.
  21300. * @property [camera] - The camera that is used for viewRefreshModes and sending camera properties to network links.
  21301. * @property [canvas] - The canvas that is used for sending viewer properties to network links.
  21302. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  21303. * @property [sourceUri] - Overrides the url to use for resolving relative links and other KML network features.
  21304. * @property [clampToGround = false] - true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
  21305. * @property [ellipsoid = Ellipsoid.WGS84] - The global ellipsoid used for geographical calculations.
  21306. * @property [screenOverlayContainer] - A container for ScreenOverlay images.
  21307. */
  21308. type ConstructorOptions = {
  21309. camera?: Camera;
  21310. canvas?: HTMLCanvasElement;
  21311. credit?: Credit | string;
  21312. sourceUri?: string;
  21313. clampToGround?: boolean;
  21314. ellipsoid?: Ellipsoid;
  21315. screenOverlayContainer?: Element | string;
  21316. };
  21317. }
  21318. /**
  21319. * A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
  21320. * <p>
  21321. * KML support in Cesium is incomplete, but a large amount of the standard,
  21322. * as well as Google's <code>gx</code> extension namespace, is supported. See Github issue
  21323. * {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
  21324. * detailed list of what is and isn't supported. Cesium will also write information to the
  21325. * console when it encounters most unsupported features.
  21326. * </p>
  21327. * <p>
  21328. * Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
  21329. * is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
  21330. * under the <code>kml</code> property.
  21331. * </p>
  21332. * @example
  21333. * const viewer = new Cesium.Viewer('cesiumContainer');
  21334. * viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',
  21335. * {
  21336. * camera: viewer.scene.camera,
  21337. * canvas: viewer.scene.canvas
  21338. * })
  21339. * );
  21340. * @param [options] - Object describing initialization options
  21341. */
  21342. export class KmlDataSource {
  21343. constructor(options?: KmlDataSource.ConstructorOptions);
  21344. /**
  21345. * The current size of this Canvas will be used to populate the Link parameters
  21346. * for client height and width.
  21347. */
  21348. canvas: HTMLCanvasElement | undefined;
  21349. /**
  21350. * The position and orientation of this {@link Camera} will be used to
  21351. * populate various camera parameters when making network requests.
  21352. * Camera movement will determine when to trigger NetworkLink refresh if
  21353. * <code>viewRefreshMode</code> is <code>onStop</code>.
  21354. */
  21355. camera: Camera | undefined;
  21356. /**
  21357. * Creates a Promise to a new instance loaded with the provided KML data.
  21358. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  21359. * @param [options] - An object specifying configuration options
  21360. * @returns A promise that will resolve to a new KmlDataSource instance once the KML is loaded.
  21361. */
  21362. static load(data: Resource | string | Document | Blob, options?: KmlDataSource.ConstructorOptions): Promise<KmlDataSource>;
  21363. /**
  21364. * Gets or sets a human-readable name for this instance.
  21365. * This will be automatically be set to the KML document name on load.
  21366. */
  21367. name: string;
  21368. /**
  21369. * Gets the clock settings defined by the loaded KML. This represents the total
  21370. * availability interval for all time-dynamic data. If the KML does not contain
  21371. * time-dynamic data, this value is undefined.
  21372. */
  21373. clock: DataSourceClock;
  21374. /**
  21375. * Gets the collection of {@link Entity} instances.
  21376. */
  21377. entities: EntityCollection;
  21378. /**
  21379. * Gets a value indicating if the data source is currently loading data.
  21380. */
  21381. isLoading: boolean;
  21382. /**
  21383. * Gets an event that will be raised when the underlying data changes.
  21384. */
  21385. changedEvent: Event;
  21386. /**
  21387. * Gets an event that will be raised if an error is encountered during processing.
  21388. */
  21389. errorEvent: Event;
  21390. /**
  21391. * Gets an event that will be raised when the data source either starts or stops loading.
  21392. */
  21393. loadingEvent: Event;
  21394. /**
  21395. * Gets an event that will be raised when the data source refreshes a network link.
  21396. */
  21397. refreshEvent: Event;
  21398. /**
  21399. * Gets an event that will be raised when the data source finds an unsupported node type.
  21400. */
  21401. unsupportedNodeEvent: Event;
  21402. /**
  21403. * Gets whether or not this data source should be displayed.
  21404. */
  21405. show: boolean;
  21406. /**
  21407. * Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
  21408. */
  21409. clustering: EntityCluster;
  21410. /**
  21411. * Gets the credit that will be displayed for the data source
  21412. */
  21413. credit: Credit;
  21414. /**
  21415. * Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.
  21416. */
  21417. kmlTours: KmlTour[];
  21418. /**
  21419. * Asynchronously loads the provided KML data, replacing any existing data.
  21420. * @param data - A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
  21421. * @param [options] - An object specifying configuration options
  21422. * @returns A promise that will resolve to this instances once the KML is loaded.
  21423. */
  21424. load(data: Resource | string | Document | Blob, options?: KmlDataSource.LoadOptions): Promise<KmlDataSource>;
  21425. /**
  21426. * Cleans up any non-entity elements created by the data source. Currently this only affects ScreenOverlay elements.
  21427. */
  21428. destroy(): void;
  21429. /**
  21430. * Updates any NetworkLink that require updating.
  21431. * @param time - The simulation time.
  21432. * @returns True if this data source is ready to be displayed at the provided time, false otherwise.
  21433. */
  21434. update(time: JulianDate): boolean;
  21435. }
  21436. /**
  21437. * Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.
  21438. */
  21439. export class KmlFeatureData {
  21440. constructor();
  21441. /**
  21442. * Gets the atom syndication format author field.
  21443. */
  21444. author: KmlFeatureData.Author;
  21445. /**
  21446. * Gets the link.
  21447. */
  21448. link: KmlFeatureData.Link;
  21449. /**
  21450. * Gets the unstructured address field.
  21451. */
  21452. address: string;
  21453. /**
  21454. * Gets the phone number.
  21455. */
  21456. phoneNumber: string;
  21457. /**
  21458. * Gets the snippet.
  21459. */
  21460. snippet: string;
  21461. /**
  21462. * Gets the extended data, parsed into a JSON object.
  21463. * Currently only the <code>Data</code> property is supported.
  21464. * <code>SchemaData</code> and custom data are ignored.
  21465. */
  21466. extendedData: string;
  21467. }
  21468. export namespace KmlFeatureData {
  21469. /**
  21470. * @property name - Gets the name.
  21471. * @property uri - Gets the URI.
  21472. * @property age - Gets the email.
  21473. */
  21474. type Author = {
  21475. name: string;
  21476. uri: string;
  21477. age: number;
  21478. };
  21479. /**
  21480. * @property href - Gets the href.
  21481. * @property hreflang - Gets the language of the linked resource.
  21482. * @property rel - Gets the link relation.
  21483. * @property type - Gets the link type.
  21484. * @property title - Gets the link title.
  21485. * @property length - Gets the link length.
  21486. */
  21487. type Link = {
  21488. href: string;
  21489. hreflang: string;
  21490. rel: string;
  21491. type: string;
  21492. title: string;
  21493. length: string;
  21494. };
  21495. }
  21496. /**
  21497. * @param position - camera position
  21498. * @param headingPitchRange - camera orientation
  21499. */
  21500. export class KmlLookAt {
  21501. constructor(position: Cartesian3, headingPitchRange: HeadingPitchRange);
  21502. }
  21503. /**
  21504. * Describes a KmlTour, which uses KmlTourFlyTo, and KmlTourWait to
  21505. * guide the camera to a specified destinations on given time intervals.
  21506. * @param name - name parsed from KML
  21507. * @param id - id parsed from KML
  21508. * @param playlist - array with KmlTourFlyTos and KmlTourWaits
  21509. */
  21510. export class KmlTour {
  21511. constructor(name: string, id: string, playlist: any[]);
  21512. /**
  21513. * Id of kml gx:Tour entry
  21514. */
  21515. id: string;
  21516. /**
  21517. * Tour name
  21518. */
  21519. name: string;
  21520. /**
  21521. * Index of current entry from playlist
  21522. */
  21523. playlistIndex: number;
  21524. /**
  21525. * Array of playlist entries
  21526. */
  21527. playlist: any[];
  21528. /**
  21529. * Event will be called when tour starts to play,
  21530. * before any playlist entry starts to play.
  21531. */
  21532. tourStart: Event;
  21533. /**
  21534. * Event will be called when all playlist entries are
  21535. * played, or tour playback being canceled.
  21536. *
  21537. * If tour playback was terminated, event callback will
  21538. * be called with terminated=true parameter.
  21539. */
  21540. tourEnd: Event;
  21541. /**
  21542. * Event will be called when entry from playlist starts to play.
  21543. *
  21544. * Event callback will be called with curent entry as first parameter.
  21545. */
  21546. entryStart: Event;
  21547. /**
  21548. * Event will be called when entry from playlist ends to play.
  21549. *
  21550. * Event callback will be called with following parameters:
  21551. * 1. entry - entry
  21552. * 2. terminated - true if playback was terminated by calling {@link KmlTour#stop}
  21553. */
  21554. entryEnd: Event;
  21555. /**
  21556. * Add entry to this tour playlist.
  21557. * @param entry - an entry to add to the playlist.
  21558. */
  21559. addPlaylistEntry(entry: KmlTourFlyTo | KmlTourWait): void;
  21560. /**
  21561. * Play this tour.
  21562. * @param viewer - viewer widget.
  21563. * @param [cameraOptions] - these options will be merged with {@link Camera#flyTo}
  21564. * options for FlyTo playlist entries.
  21565. */
  21566. play(viewer: Viewer, cameraOptions?: any): void;
  21567. /**
  21568. * Stop curently playing tour.
  21569. */
  21570. stop(): void;
  21571. }
  21572. /**
  21573. * Transitions the KmlTour to the next destination. This transition is facilitated
  21574. * using a specified flyToMode over a given number of seconds.
  21575. * @param duration - entry duration
  21576. * @param flyToMode - KML fly to mode: bounce, smooth, etc
  21577. * @param view - KmlCamera or KmlLookAt
  21578. */
  21579. export class KmlTourFlyTo {
  21580. constructor(duration: number, flyToMode: string, view: KmlCamera | KmlLookAt);
  21581. /**
  21582. * Play this playlist entry
  21583. * @param done - function which will be called when playback ends
  21584. * @param camera - Cesium camera
  21585. * @param [cameraOptions] - which will be merged with camera flyTo options. See {@link Camera#flyTo}
  21586. */
  21587. play(done: KmlTourFlyTo.DoneCallback, camera: Camera, cameraOptions?: any): void;
  21588. /**
  21589. * Stop execution of curent entry. Cancel camera flyTo
  21590. */
  21591. stop(): void;
  21592. /**
  21593. * Returns options for {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere}
  21594. * depends on this.view type.
  21595. * @param cameraOptions - options to merge with generated. See {@link Camera#flyTo}
  21596. * @returns {@link Camera#flyTo} or {@link Camera#flyToBoundingSphere} options
  21597. */
  21598. getCameraOptions(cameraOptions: any): any;
  21599. }
  21600. export namespace KmlTourFlyTo {
  21601. /**
  21602. * A function that will be executed when the flight completes.
  21603. * @param terminated - true if {@link KmlTourFlyTo#stop} was
  21604. * called before entry done playback.
  21605. */
  21606. type DoneCallback = (terminated: boolean) => void;
  21607. }
  21608. /**
  21609. * Pauses the KmlTour for a given number of seconds.
  21610. * @param duration - entry duration
  21611. */
  21612. export class KmlTourWait {
  21613. constructor(duration: number);
  21614. /**
  21615. * Play this playlist entry
  21616. * @param done - function which will be called when playback ends
  21617. */
  21618. play(done: KmlTourWait.DoneCallback): void;
  21619. /**
  21620. * Stop execution of curent entry, cancel curent timeout
  21621. */
  21622. stop(): void;
  21623. }
  21624. export namespace KmlTourWait {
  21625. /**
  21626. * A function which will be called when playback ends.
  21627. * @param terminated - true if {@link KmlTourWait#stop} was
  21628. * called before entry done playback.
  21629. */
  21630. type DoneCallback = (terminated: boolean) => void;
  21631. }
  21632. export namespace LabelGraphics {
  21633. /**
  21634. * Initialization options for the LabelGraphics constructor
  21635. * @property [show = true] - A boolean Property specifying the visibility of the label.
  21636. * @property [text] - A Property specifying the text. Explicit newlines '\n' are supported.
  21637. * @property [font = '30px sans-serif'] - A Property specifying the CSS font.
  21638. * @property [style = LabelStyle.FILL] - A Property specifying the {@link LabelStyle}.
  21639. * @property [scale = 1.0] - A numeric Property specifying the scale to apply to the text.
  21640. * @property [showBackground = false] - A boolean Property specifying the visibility of the background behind the label.
  21641. * @property [backgroundColor = new Color(0.165, 0.165, 0.165, 0.8)] - A Property specifying the background {@link Color}.
  21642. * @property [backgroundPadding = new Cartesian2(7, 5)] - A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.
  21643. * @property [pixelOffset = Cartesian2.ZERO] - A {@link Cartesian2} Property specifying the pixel offset.
  21644. * @property [eyeOffset = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the eye offset.
  21645. * @property [horizontalOrigin = HorizontalOrigin.CENTER] - A Property specifying the {@link HorizontalOrigin}.
  21646. * @property [verticalOrigin = VerticalOrigin.CENTER] - A Property specifying the {@link VerticalOrigin}.
  21647. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21648. * @property [fillColor = Color.WHITE] - A Property specifying the fill {@link Color}.
  21649. * @property [outlineColor = Color.BLACK] - A Property specifying the outline {@link Color}.
  21650. * @property [outlineWidth = 1.0] - A numeric Property specifying the outline width.
  21651. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  21652. * @property [pixelOffsetScaleByDistance] - A {@link NearFarScalar} Property used to set pixelOffset based on distance from the camera.
  21653. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to set scale based on distance from the camera.
  21654. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this label will be displayed.
  21655. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  21656. */
  21657. type ConstructorOptions = {
  21658. show?: Property | boolean;
  21659. text?: Property | string;
  21660. font?: Property | string;
  21661. style?: Property | LabelStyle;
  21662. scale?: Property | number;
  21663. showBackground?: Property | boolean;
  21664. backgroundColor?: Property | Color;
  21665. backgroundPadding?: Property | Cartesian2;
  21666. pixelOffset?: Property | Cartesian2;
  21667. eyeOffset?: Property | Cartesian3;
  21668. horizontalOrigin?: Property | HorizontalOrigin;
  21669. verticalOrigin?: Property | VerticalOrigin;
  21670. heightReference?: Property | HeightReference;
  21671. fillColor?: Property | Color;
  21672. outlineColor?: Property | Color;
  21673. outlineWidth?: Property | number;
  21674. translucencyByDistance?: Property | NearFarScalar;
  21675. pixelOffsetScaleByDistance?: Property | NearFarScalar;
  21676. scaleByDistance?: Property | NearFarScalar;
  21677. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21678. disableDepthTestDistance?: Property | number;
  21679. };
  21680. }
  21681. /**
  21682. * Describes a two dimensional label located at the position of the containing {@link Entity}.
  21683. * <p>
  21684. * <div align='center'>
  21685. * <img src='Images/Label.png' width='400' height='300' /><br />
  21686. * Example labels
  21687. * </div>
  21688. * </p>
  21689. * @param [options] - Object describing initialization options
  21690. */
  21691. export class LabelGraphics {
  21692. constructor(options?: LabelGraphics.ConstructorOptions);
  21693. /**
  21694. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21695. */
  21696. readonly definitionChanged: Event;
  21697. /**
  21698. * Gets or sets the boolean Property specifying the visibility of the label.
  21699. */
  21700. show: Property | undefined;
  21701. /**
  21702. * Gets or sets the string Property specifying the text of the label.
  21703. * Explicit newlines '\n' are supported.
  21704. */
  21705. text: Property | undefined;
  21706. /**
  21707. * Gets or sets the string Property specifying the font in CSS syntax.
  21708. */
  21709. font: Property | undefined;
  21710. /**
  21711. * Gets or sets the Property specifying the {@link LabelStyle}.
  21712. */
  21713. style: Property | undefined;
  21714. /**
  21715. * Gets or sets the numeric Property specifying the uniform scale to apply to the image.
  21716. * A scale greater than <code>1.0</code> enlarges the label while a scale less than <code>1.0</code> shrinks it.
  21717. * <p>
  21718. * <div align='center'>
  21719. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  21720. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  21721. * and <code>2.0</code>.
  21722. * </div>
  21723. * </p>
  21724. */
  21725. scale: Property | undefined;
  21726. /**
  21727. * Gets or sets the boolean Property specifying the visibility of the background behind the label.
  21728. */
  21729. showBackground: Property | undefined;
  21730. /**
  21731. * Gets or sets the Property specifying the background {@link Color}.
  21732. */
  21733. backgroundColor: Property | undefined;
  21734. /**
  21735. * Gets or sets the {@link Cartesian2} Property specifying the label's horizontal and vertical
  21736. * background padding in pixels.
  21737. */
  21738. backgroundPadding: Property | undefined;
  21739. /**
  21740. * Gets or sets the {@link Cartesian2} Property specifying the label's pixel offset in screen space
  21741. * from the origin of this label. This is commonly used to align multiple labels and labels at
  21742. * the same position, e.g., an image and text. The screen space origin is the top, left corner of the
  21743. * canvas; <code>x</code> increases from left to right, and <code>y</code> increases from top to bottom.
  21744. * <p>
  21745. * <div align='center'>
  21746. * <table border='0' cellpadding='5'><tr>
  21747. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  21748. * <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>
  21749. * </tr></table>
  21750. * The label's origin is indicated by the yellow point.
  21751. * </div>
  21752. * </p>
  21753. */
  21754. pixelOffset: Property | undefined;
  21755. /**
  21756. * Gets or sets the {@link Cartesian3} Property specifying the label's offset in eye coordinates.
  21757. * Eye coordinates is a left-handed coordinate system, where <code>x</code> points towards the viewer's
  21758. * right, <code>y</code> points up, and <code>z</code> points into the screen.
  21759. * <p>
  21760. * An eye offset is commonly used to arrange multiple labels or objects at the same position, e.g., to
  21761. * arrange a label above its corresponding 3D model.
  21762. * </p>
  21763. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  21764. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  21765. * <p>
  21766. * <div align='center'>
  21767. * <table border='0' cellpadding='5'><tr>
  21768. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  21769. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  21770. * </tr></table>
  21771. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  21772. * </div>
  21773. * </p>
  21774. */
  21775. eyeOffset: Property | undefined;
  21776. /**
  21777. * Gets or sets the Property specifying the {@link HorizontalOrigin}.
  21778. */
  21779. horizontalOrigin: Property | undefined;
  21780. /**
  21781. * Gets or sets the Property specifying the {@link VerticalOrigin}.
  21782. */
  21783. verticalOrigin: Property | undefined;
  21784. /**
  21785. * Gets or sets the Property specifying the {@link HeightReference}.
  21786. */
  21787. heightReference: Property | undefined;
  21788. /**
  21789. * Gets or sets the Property specifying the fill {@link Color}.
  21790. */
  21791. fillColor: Property | undefined;
  21792. /**
  21793. * Gets or sets the Property specifying the outline {@link Color}.
  21794. */
  21795. outlineColor: Property | undefined;
  21796. /**
  21797. * Gets or sets the numeric Property specifying the outline width.
  21798. */
  21799. outlineWidth: Property | undefined;
  21800. /**
  21801. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the label based on the distance from the camera.
  21802. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  21803. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21804. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21805. * Outside of these ranges the label's translucency remains clamped to the nearest bound.
  21806. */
  21807. translucencyByDistance: Property | undefined;
  21808. /**
  21809. * Gets or sets {@link NearFarScalar} Property specifying the pixel offset of the label based on the distance from the camera.
  21810. * A label's pixel offset will interpolate between the {@link NearFarScalar#nearValue} and
  21811. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21812. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21813. * Outside of these ranges the label's pixel offset remains clamped to the nearest bound.
  21814. */
  21815. pixelOffsetScaleByDistance: Property | undefined;
  21816. /**
  21817. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  21818. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  21819. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  21820. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  21821. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  21822. * scaleByDistance will be disabled.
  21823. */
  21824. scaleByDistance: Property | undefined;
  21825. /**
  21826. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this label will be displayed.
  21827. */
  21828. distanceDisplayCondition: Property | undefined;
  21829. /**
  21830. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  21831. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  21832. */
  21833. disableDepthTestDistance: Property | undefined;
  21834. /**
  21835. * Duplicates this instance.
  21836. * @param [result] - The object onto which to store the result.
  21837. * @returns The modified result parameter or a new instance if one was not provided.
  21838. */
  21839. clone(result?: LabelGraphics): LabelGraphics;
  21840. /**
  21841. * Assigns each unassigned property on this object to the value
  21842. * of the same property on the provided source object.
  21843. * @param source - The object to be merged into this object.
  21844. */
  21845. merge(source: LabelGraphics): void;
  21846. }
  21847. /**
  21848. * A {@link Visualizer} which maps the {@link LabelGraphics} instance
  21849. * in {@link Entity#label} to a {@link Label}.
  21850. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  21851. * @param entityCollection - The entityCollection to visualize.
  21852. */
  21853. export class LabelVisualizer {
  21854. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  21855. /**
  21856. * Updates the primitives created by this visualizer to match their
  21857. * Entity counterpart at the given time.
  21858. * @param time - The time to update to.
  21859. * @returns This function always returns true.
  21860. */
  21861. update(time: JulianDate): boolean;
  21862. /**
  21863. * Returns true if this object was destroyed; otherwise, false.
  21864. * @returns True if this object was destroyed; otherwise, false.
  21865. */
  21866. isDestroyed(): boolean;
  21867. /**
  21868. * Removes and destroys all primitives created by this instance.
  21869. */
  21870. destroy(): void;
  21871. }
  21872. /**
  21873. * The interface for all {@link Property} objects that represent {@link Material} uniforms.
  21874. * This type defines an interface and cannot be instantiated directly.
  21875. */
  21876. export class MaterialProperty {
  21877. constructor();
  21878. /**
  21879. * Gets a value indicating if this property is constant. A property is considered
  21880. * constant if getValue always returns the same result for the current definition.
  21881. */
  21882. readonly isConstant: boolean;
  21883. /**
  21884. * Gets the event that is raised whenever the definition of this property changes.
  21885. * The definition is considered to have changed if a call to getValue would return
  21886. * a different result for the same time.
  21887. */
  21888. readonly definitionChanged: Event;
  21889. /**
  21890. * Gets the {@link Material} type at the provided time.
  21891. * @param time - The time for which to retrieve the type.
  21892. * @returns The type of material.
  21893. */
  21894. getType(time: JulianDate): string;
  21895. /**
  21896. * Gets the value of the property at the provided time.
  21897. * @param time - The time for which to retrieve the value.
  21898. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  21899. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  21900. */
  21901. getValue(time: JulianDate, result?: any): any;
  21902. /**
  21903. * Compares this property to the provided property and returns
  21904. * <code>true</code> if they are equal, <code>false</code> otherwise.
  21905. * @param [other] - The other property.
  21906. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  21907. */
  21908. equals(other?: Property): boolean;
  21909. }
  21910. export namespace ModelGraphics {
  21911. /**
  21912. * Initialization options for the ModelGraphics constructor
  21913. * @property [show = true] - A boolean Property specifying the visibility of the model.
  21914. * @property [uri] - A string or Resource Property specifying the URI of the glTF asset.
  21915. * @property [scale = 1.0] - A numeric Property specifying a uniform linear scale.
  21916. * @property [minimumPixelSize = 0.0] - A numeric Property specifying the approximate minimum pixel size of the model regardless of zoom.
  21917. * @property [maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  21918. * @property [incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  21919. * @property [runAnimations = true] - A boolean Property specifying if glTF animations specified in the model should be started.
  21920. * @property [clampAnimations = true] - A boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  21921. * @property [shadows = ShadowMode.ENABLED] - An enum Property specifying whether the model casts or receives shadows from light sources.
  21922. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  21923. * @property [silhouetteColor = Color.RED] - A Property specifying the {@link Color} of the silhouette.
  21924. * @property [silhouetteSize = 0.0] - A numeric Property specifying the size of the silhouette in pixels.
  21925. * @property [color = Color.WHITE] - A Property specifying the {@link Color} that blends with the model's rendered color.
  21926. * @property [colorBlendMode = ColorBlendMode.HIGHLIGHT] - An enum Property specifying how the color blends with the model.
  21927. * @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.
  21928. * @property [imageBasedLightingFactor = new Cartesian2(1.0, 1.0)] - A property specifying the contribution from diffuse and specular image-based lighting.
  21929. * @property [lightColor] - A property specifying the light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  21930. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this model will be displayed.
  21931. * @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.
  21932. * @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.
  21933. * @property [clippingPlanes] - A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  21934. */
  21935. type ConstructorOptions = {
  21936. show?: Property | boolean;
  21937. uri?: Property | string | Resource;
  21938. scale?: Property | number;
  21939. minimumPixelSize?: Property | number;
  21940. maximumScale?: Property | number;
  21941. incrementallyLoadTextures?: Property | boolean;
  21942. runAnimations?: Property | boolean;
  21943. clampAnimations?: Property | boolean;
  21944. shadows?: Property | ShadowMode;
  21945. heightReference?: Property | HeightReference;
  21946. silhouetteColor?: Property | Color;
  21947. silhouetteSize?: Property | number;
  21948. color?: Property | Color;
  21949. colorBlendMode?: Property | ColorBlendMode;
  21950. colorBlendAmount?: Property | number;
  21951. imageBasedLightingFactor?: Property | Cartesian2;
  21952. lightColor?: Property | Color;
  21953. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  21954. nodeTransformations?: PropertyBag | {
  21955. [key: string]: TranslationRotationScale;
  21956. };
  21957. articulations?: PropertyBag | {
  21958. [key: string]: number;
  21959. };
  21960. clippingPlanes?: Property | ClippingPlaneCollection;
  21961. };
  21962. }
  21963. /**
  21964. * A 3D model based on {@link https://github.com/KhronosGroup/glTF|glTF}, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  21965. * The position and orientation of the model is determined by the containing {@link Entity}.
  21966. * <p>
  21967. * Cesium includes support for glTF geometry, materials, animations, and skinning.
  21968. * Cameras and lights are not currently supported.
  21969. * </p>
  21970. * @param [options] - Object describing initialization options
  21971. */
  21972. export class ModelGraphics {
  21973. constructor(options?: ModelGraphics.ConstructorOptions);
  21974. /**
  21975. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  21976. */
  21977. readonly definitionChanged: Event;
  21978. /**
  21979. * Gets or sets the boolean Property specifying the visibility of the model.
  21980. */
  21981. show: Property | undefined;
  21982. /**
  21983. * Gets or sets the string Property specifying the URI of the glTF asset.
  21984. */
  21985. uri: Property | undefined;
  21986. /**
  21987. * Gets or sets the numeric Property specifying a uniform linear scale
  21988. * for this model. Values greater than 1.0 increase the size of the model while
  21989. * values less than 1.0 decrease it.
  21990. */
  21991. scale: Property | undefined;
  21992. /**
  21993. * Gets or sets the numeric Property specifying the approximate minimum
  21994. * pixel size of the model regardless of zoom. This can be used to ensure that
  21995. * a model is visible even when the viewer zooms out. When <code>0.0</code>,
  21996. * no minimum size is enforced.
  21997. */
  21998. minimumPixelSize: Property | undefined;
  21999. /**
  22000. * Gets or sets the numeric Property specifying the maximum scale
  22001. * size of a model. This property is used as an upper limit for
  22002. * {@link ModelGraphics#minimumPixelSize}.
  22003. */
  22004. maximumScale: Property | undefined;
  22005. /**
  22006. * Get or sets the boolean Property specifying whether textures
  22007. * may continue to stream in after the model is loaded.
  22008. */
  22009. incrementallyLoadTextures: Property | undefined;
  22010. /**
  22011. * Gets or sets the boolean Property specifying if glTF animations should be run.
  22012. */
  22013. runAnimations: Property | undefined;
  22014. /**
  22015. * Gets or sets the boolean Property specifying if glTF animations should hold the last pose for time durations with no keyframes.
  22016. */
  22017. clampAnimations: Property | undefined;
  22018. /**
  22019. * Get or sets the enum Property specifying whether the model
  22020. * casts or receives shadows from light sources.
  22021. */
  22022. shadows: Property | undefined;
  22023. /**
  22024. * Gets or sets the Property specifying the {@link HeightReference}.
  22025. */
  22026. heightReference: Property | undefined;
  22027. /**
  22028. * Gets or sets the Property specifying the {@link Color} of the silhouette.
  22029. */
  22030. silhouetteColor: Property | undefined;
  22031. /**
  22032. * Gets or sets the numeric Property specifying the size of the silhouette in pixels.
  22033. */
  22034. silhouetteSize: Property | undefined;
  22035. /**
  22036. * Gets or sets the Property specifying the {@link Color} that blends with the model's rendered color.
  22037. */
  22038. color: Property | undefined;
  22039. /**
  22040. * Gets or sets the enum Property specifying how the color blends with the model.
  22041. */
  22042. colorBlendMode: Property | undefined;
  22043. /**
  22044. * A numeric Property specifying the color strength when the <code>colorBlendMode</code> is MIX.
  22045. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  22046. * any value in-between resulting in a mix of the two.
  22047. */
  22048. colorBlendAmount: Property | undefined;
  22049. /**
  22050. * A property specifying the {@link Cartesian2} used to scale the diffuse and specular image-based lighting contribution to the final color.
  22051. */
  22052. imageBasedLightingFactor: Property | undefined;
  22053. /**
  22054. * A property specifying the {@link Cartesian3} light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  22055. */
  22056. lightColor: Property | undefined;
  22057. /**
  22058. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this model will be displayed.
  22059. */
  22060. distanceDisplayCondition: Property | undefined;
  22061. /**
  22062. * Gets or sets the set of node transformations to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  22063. * names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
  22064. * The transformation is applied after the node's existing transformation as specified in the glTF, and does not replace the node's existing transformation.
  22065. */
  22066. nodeTransformations: PropertyBag;
  22067. /**
  22068. * Gets or sets the set of articulation values to apply to this model. This is represented as an {@link PropertyBag}, where keys are
  22069. * composed as the name of the articulation, a single space, and the name of the stage.
  22070. */
  22071. articulations: PropertyBag;
  22072. /**
  22073. * A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  22074. */
  22075. clippingPlanes: Property | undefined;
  22076. /**
  22077. * Duplicates this instance.
  22078. * @param [result] - The object onto which to store the result.
  22079. * @returns The modified result parameter or a new instance if one was not provided.
  22080. */
  22081. clone(result?: ModelGraphics): ModelGraphics;
  22082. /**
  22083. * Assigns each unassigned property on this object to the value
  22084. * of the same property on the provided source object.
  22085. * @param source - The object to be merged into this object.
  22086. */
  22087. merge(source: ModelGraphics): void;
  22088. }
  22089. /**
  22090. * A {@link Visualizer} which maps {@link Entity#model} to a {@link Model}.
  22091. * @param scene - The scene the primitives will be rendered in.
  22092. * @param entityCollection - The entityCollection to visualize.
  22093. */
  22094. export class ModelVisualizer {
  22095. constructor(scene: Scene, entityCollection: EntityCollection);
  22096. /**
  22097. * Updates models created this visualizer to match their
  22098. * Entity counterpart at the given time.
  22099. * @param time - The time to update to.
  22100. * @returns This function always returns true.
  22101. */
  22102. update(time: JulianDate): boolean;
  22103. /**
  22104. * Returns true if this object was destroyed; otherwise, false.
  22105. * @returns True if this object was destroyed; otherwise, false.
  22106. */
  22107. isDestroyed(): boolean;
  22108. /**
  22109. * Removes and destroys all primitives created by this instance.
  22110. */
  22111. destroy(): void;
  22112. }
  22113. /**
  22114. * A {@link Property} that produces {@link TranslationRotationScale} data.
  22115. * @param [options] - Object with the following properties:
  22116. * @param [options.translation = Cartesian3.ZERO] - A {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  22117. * @param [options.rotation = Quaternion.IDENTITY] - A {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  22118. * @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.
  22119. */
  22120. export class NodeTransformationProperty {
  22121. constructor(options?: {
  22122. translation?: Property | Cartesian3;
  22123. rotation?: Property | Quaternion;
  22124. scale?: Property | Cartesian3;
  22125. });
  22126. /**
  22127. * Gets a value indicating if this property is constant. A property is considered
  22128. * constant if getValue always returns the same result for the current definition.
  22129. */
  22130. readonly isConstant: boolean;
  22131. /**
  22132. * Gets the event that is raised whenever the definition of this property changes.
  22133. * The definition is considered to have changed if a call to getValue would return
  22134. * a different result for the same time.
  22135. */
  22136. readonly definitionChanged: Event;
  22137. /**
  22138. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) translation to apply to the node.
  22139. */
  22140. translation: Property | undefined;
  22141. /**
  22142. * Gets or sets the {@link Quaternion} Property specifying the (x, y, z, w) rotation to apply to the node.
  22143. */
  22144. rotation: Property | undefined;
  22145. /**
  22146. * Gets or sets the {@link Cartesian3} Property specifying the (x, y, z) scaling to apply to the node.
  22147. */
  22148. scale: Property | undefined;
  22149. /**
  22150. * Gets the value of the property at the provided time.
  22151. * @param time - The time for which to retrieve the value.
  22152. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22153. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22154. */
  22155. getValue(time: JulianDate, result?: TranslationRotationScale): TranslationRotationScale;
  22156. /**
  22157. * Compares this property to the provided property and returns
  22158. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22159. * @param [other] - The other property.
  22160. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22161. */
  22162. equals(other?: Property): boolean;
  22163. }
  22164. export namespace PathGraphics {
  22165. /**
  22166. * Initialization options for the PathGraphics constructor
  22167. * @property [show = true] - A boolean Property specifying the visibility of the path.
  22168. * @property [leadTime] - A Property specifying the number of seconds in front the object to show.
  22169. * @property [trailTime] - A Property specifying the number of seconds behind of the object to show.
  22170. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  22171. * @property [resolution = 60] - A numeric Property specifying the maximum number of seconds to step when sampling the position.
  22172. * @property [material = Color.WHITE] - A Property specifying the material used to draw the path.
  22173. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this path will be displayed.
  22174. */
  22175. type ConstructorOptions = {
  22176. show?: Property | boolean;
  22177. leadTime?: Property | number;
  22178. trailTime?: Property | number;
  22179. width?: Property | number;
  22180. resolution?: Property | number;
  22181. material?: MaterialProperty | Color;
  22182. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22183. };
  22184. }
  22185. /**
  22186. * Describes a polyline defined as the path made by an {@link Entity} as it moves over time.
  22187. * @param [options] - Object describing initialization options
  22188. */
  22189. export class PathGraphics {
  22190. constructor(options?: PathGraphics.ConstructorOptions);
  22191. /**
  22192. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22193. */
  22194. readonly definitionChanged: Event;
  22195. /**
  22196. * Gets or sets the boolean Property specifying the visibility of the path.
  22197. */
  22198. show: Property | undefined;
  22199. /**
  22200. * Gets or sets the Property specifying the number of seconds in front of the object to show.
  22201. */
  22202. leadTime: Property | undefined;
  22203. /**
  22204. * Gets or sets the Property specifying the number of seconds behind the object to show.
  22205. */
  22206. trailTime: Property | undefined;
  22207. /**
  22208. * Gets or sets the numeric Property specifying the width in pixels.
  22209. */
  22210. width: Property | undefined;
  22211. /**
  22212. * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
  22213. */
  22214. resolution: Property | undefined;
  22215. /**
  22216. * Gets or sets the Property specifying the material used to draw the path.
  22217. */
  22218. material: MaterialProperty;
  22219. /**
  22220. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.
  22221. */
  22222. distanceDisplayCondition: Property | undefined;
  22223. /**
  22224. * Duplicates this instance.
  22225. * @param [result] - The object onto which to store the result.
  22226. * @returns The modified result parameter or a new instance if one was not provided.
  22227. */
  22228. clone(result?: PathGraphics): PathGraphics;
  22229. /**
  22230. * Assigns each unassigned property on this object to the value
  22231. * of the same property on the provided source object.
  22232. * @param source - The object to be merged into this object.
  22233. */
  22234. merge(source: PathGraphics): void;
  22235. }
  22236. /**
  22237. * A {@link Visualizer} which maps {@link Entity#path} to a {@link Polyline}.
  22238. * @param scene - The scene the primitives will be rendered in.
  22239. * @param entityCollection - The entityCollection to visualize.
  22240. */
  22241. export class PathVisualizer {
  22242. constructor(scene: Scene, entityCollection: EntityCollection);
  22243. /**
  22244. * Updates all of the primitives created by this visualizer to match their
  22245. * Entity counterpart at the given time.
  22246. * @param time - The time to update to.
  22247. * @returns This function always returns true.
  22248. */
  22249. update(time: JulianDate): boolean;
  22250. /**
  22251. * Returns true if this object was destroyed; otherwise, false.
  22252. * @returns True if this object was destroyed; otherwise, false.
  22253. */
  22254. isDestroyed(): boolean;
  22255. /**
  22256. * Removes and destroys all primitives created by this instance.
  22257. */
  22258. destroy(): void;
  22259. }
  22260. /**
  22261. * A {@link GeometryUpdater} for planes.
  22262. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22263. * @param entity - The entity containing the geometry to be visualized.
  22264. * @param scene - The scene where visualization is taking place.
  22265. */
  22266. export class PlaneGeometryUpdater {
  22267. constructor(entity: Entity, scene: Scene);
  22268. /**
  22269. * Creates the geometry instance which represents the fill of the geometry.
  22270. * @param time - The time to use when retrieving initial attribute values.
  22271. * @returns The geometry instance representing the filled portion of the geometry.
  22272. */
  22273. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22274. /**
  22275. * Creates the geometry instance which represents the outline of the geometry.
  22276. * @param time - The time to use when retrieving initial attribute values.
  22277. * @returns The geometry instance representing the outline portion of the geometry.
  22278. */
  22279. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22280. }
  22281. export namespace PlaneGraphics {
  22282. /**
  22283. * Initialization options for the PlaneGraphics constructor
  22284. * @property [show = true] - A boolean Property specifying the visibility of the plane.
  22285. * @property [plane] - A {@link Plane} Property specifying the normal and distance for the plane.
  22286. * @property [dimensions] - A {@link Cartesian2} Property specifying the width and height of the plane.
  22287. * @property [fill = true] - A boolean Property specifying whether the plane is filled with the provided material.
  22288. * @property [material = Color.WHITE] - A Property specifying the material used to fill the plane.
  22289. * @property [outline = false] - A boolean Property specifying whether the plane is outlined.
  22290. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22291. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22292. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the plane casts or receives shadows from light sources.
  22293. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this plane will be displayed.
  22294. */
  22295. type ConstructorOptions = {
  22296. show?: Property | boolean;
  22297. plane?: Property | Plane;
  22298. dimensions?: Property | Cartesian2;
  22299. fill?: Property | boolean;
  22300. material?: MaterialProperty | Color;
  22301. outline?: Property | boolean;
  22302. outlineColor?: Property | Color;
  22303. outlineWidth?: Property | number;
  22304. shadows?: Property | ShadowMode;
  22305. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22306. };
  22307. }
  22308. /**
  22309. * Describes a plane. The center position and orientation are determined by the containing {@link Entity}.
  22310. * @param [options] - Object describing initialization options
  22311. */
  22312. export class PlaneGraphics {
  22313. constructor(options?: PlaneGraphics.ConstructorOptions);
  22314. /**
  22315. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22316. */
  22317. readonly definitionChanged: Event;
  22318. /**
  22319. * Gets or sets the boolean Property specifying the visibility of the plane.
  22320. */
  22321. show: Property | undefined;
  22322. /**
  22323. * Gets or sets the {@link Plane} Property specifying the normal and distance of the plane.
  22324. */
  22325. plane: Property | undefined;
  22326. /**
  22327. * Gets or sets the {@link Cartesian2} Property specifying the width and height of the plane.
  22328. */
  22329. dimensions: Property | undefined;
  22330. /**
  22331. * Gets or sets the boolean Property specifying whether the plane is filled with the provided material.
  22332. */
  22333. fill: Property | undefined;
  22334. /**
  22335. * Gets or sets the material used to fill the plane.
  22336. */
  22337. material: MaterialProperty;
  22338. /**
  22339. * Gets or sets the Property specifying whether the plane is outlined.
  22340. */
  22341. outline: Property | undefined;
  22342. /**
  22343. * Gets or sets the Property specifying the {@link Color} of the outline.
  22344. */
  22345. outlineColor: Property | undefined;
  22346. /**
  22347. * Gets or sets the numeric Property specifying the width of the outline.
  22348. * <p>
  22349. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  22350. * </p>
  22351. */
  22352. outlineWidth: Property | undefined;
  22353. /**
  22354. * Get or sets the enum Property specifying whether the plane
  22355. * casts or receives shadows from light sources.
  22356. */
  22357. shadows: Property | undefined;
  22358. /**
  22359. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this plane will be displayed.
  22360. */
  22361. distanceDisplayCondition: Property | undefined;
  22362. /**
  22363. * Duplicates this instance.
  22364. * @param [result] - The object onto which to store the result.
  22365. * @returns The modified result parameter or a new instance if one was not provided.
  22366. */
  22367. clone(result?: PlaneGraphics): PlaneGraphics;
  22368. /**
  22369. * Assigns each unassigned property on this object to the value
  22370. * of the same property on the provided source object.
  22371. * @param source - The object to be merged into this object.
  22372. */
  22373. merge(source: PlaneGraphics): void;
  22374. }
  22375. export namespace PointGraphics {
  22376. /**
  22377. * Initialization options for the PointGraphics constructor
  22378. * @property [show = true] - A boolean Property specifying the visibility of the point.
  22379. * @property [pixelSize = 1] - A numeric Property specifying the size in pixels.
  22380. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  22381. * @property [color = Color.WHITE] - A Property specifying the {@link Color} of the point.
  22382. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22383. * @property [outlineWidth = 0] - A numeric Property specifying the the outline width in pixels.
  22384. * @property [scaleByDistance] - A {@link NearFarScalar} Property used to scale the point based on distance.
  22385. * @property [translucencyByDistance] - A {@link NearFarScalar} Property used to set translucency based on distance from the camera.
  22386. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this point will be displayed.
  22387. * @property [disableDepthTestDistance] - A Property specifying the distance from the camera at which to disable the depth test to.
  22388. */
  22389. type ConstructorOptions = {
  22390. show?: Property | boolean;
  22391. pixelSize?: Property | number;
  22392. heightReference?: Property | HeightReference;
  22393. color?: Property | Color;
  22394. outlineColor?: Property | Color;
  22395. outlineWidth?: Property | number;
  22396. scaleByDistance?: Property | NearFarScalar;
  22397. translucencyByDistance?: Property | NearFarScalar;
  22398. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22399. disableDepthTestDistance?: Property | number;
  22400. };
  22401. }
  22402. /**
  22403. * Describes a graphical point located at the position of the containing {@link Entity}.
  22404. * @param [options] - Object describing initialization options
  22405. */
  22406. export class PointGraphics {
  22407. constructor(options?: PointGraphics.ConstructorOptions);
  22408. /**
  22409. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22410. */
  22411. readonly definitionChanged: Event;
  22412. /**
  22413. * Gets or sets the boolean Property specifying the visibility of the point.
  22414. */
  22415. show: Property | undefined;
  22416. /**
  22417. * Gets or sets the numeric Property specifying the size in pixels.
  22418. */
  22419. pixelSize: Property | undefined;
  22420. /**
  22421. * Gets or sets the Property specifying the {@link HeightReference}.
  22422. */
  22423. heightReference: Property | undefined;
  22424. /**
  22425. * Gets or sets the Property specifying the {@link Color} of the point.
  22426. */
  22427. color: Property | undefined;
  22428. /**
  22429. * Gets or sets the Property specifying the {@link Color} of the outline.
  22430. */
  22431. outlineColor: Property | undefined;
  22432. /**
  22433. * Gets or sets the numeric Property specifying the the outline width in pixels.
  22434. */
  22435. outlineWidth: Property | undefined;
  22436. /**
  22437. * Gets or sets the {@link NearFarScalar} Property used to scale the point based on distance.
  22438. * If undefined, a constant size is used.
  22439. */
  22440. scaleByDistance: Property | undefined;
  22441. /**
  22442. * Gets or sets {@link NearFarScalar} Property specifying the translucency of the point based on the distance from the camera.
  22443. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  22444. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  22445. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  22446. * Outside of these ranges the points's translucency remains clamped to the nearest bound.
  22447. */
  22448. translucencyByDistance: Property | undefined;
  22449. /**
  22450. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this point will be displayed.
  22451. */
  22452. distanceDisplayCondition: Property | undefined;
  22453. /**
  22454. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  22455. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  22456. */
  22457. disableDepthTestDistance: Property | undefined;
  22458. /**
  22459. * Duplicates this instance.
  22460. * @param [result] - The object onto which to store the result.
  22461. * @returns The modified result parameter or a new instance if one was not provided.
  22462. */
  22463. clone(result?: PointGraphics): PointGraphics;
  22464. /**
  22465. * Assigns each unassigned property on this object to the value
  22466. * of the same property on the provided source object.
  22467. * @param source - The object to be merged into this object.
  22468. */
  22469. merge(source: PointGraphics): void;
  22470. }
  22471. /**
  22472. * A {@link Visualizer} which maps {@link Entity#point} to a {@link PointPrimitive}.
  22473. * @param entityCluster - The entity cluster to manage the collection of billboards and optionally cluster with other entities.
  22474. * @param entityCollection - The entityCollection to visualize.
  22475. */
  22476. export class PointVisualizer {
  22477. constructor(entityCluster: EntityCluster, entityCollection: EntityCollection);
  22478. /**
  22479. * Updates the primitives created by this visualizer to match their
  22480. * Entity counterpart at the given time.
  22481. * @param time - The time to update to.
  22482. * @returns This function always returns true.
  22483. */
  22484. update(time: JulianDate): boolean;
  22485. /**
  22486. * Returns true if this object was destroyed; otherwise, false.
  22487. * @returns True if this object was destroyed; otherwise, false.
  22488. */
  22489. isDestroyed(): boolean;
  22490. /**
  22491. * Removes and destroys all primitives created by this instance.
  22492. */
  22493. destroy(): void;
  22494. }
  22495. /**
  22496. * A {@link GeometryUpdater} for polygons.
  22497. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22498. * @param entity - The entity containing the geometry to be visualized.
  22499. * @param scene - The scene where visualization is taking place.
  22500. */
  22501. export class PolygonGeometryUpdater {
  22502. constructor(entity: Entity, scene: Scene);
  22503. /**
  22504. * Creates the geometry instance which represents the fill of the geometry.
  22505. * @param time - The time to use when retrieving initial attribute values.
  22506. * @returns The geometry instance representing the filled portion of the geometry.
  22507. */
  22508. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22509. /**
  22510. * Creates the geometry instance which represents the outline of the geometry.
  22511. * @param time - The time to use when retrieving initial attribute values.
  22512. * @returns The geometry instance representing the outline portion of the geometry.
  22513. */
  22514. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22515. }
  22516. export namespace PolygonGraphics {
  22517. /**
  22518. * Initialization options for the PolygonGraphics constructor
  22519. * @property [show = true] - A boolean Property specifying the visibility of the polygon.
  22520. * @property [hierarchy] - A Property specifying the {@link PolygonHierarchy}.
  22521. * @property [height = 0] - A numeric Property specifying the altitude of the polygon relative to the ellipsoid surface.
  22522. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  22523. * @property [extrudedHeight] - A numeric Property specifying the altitude of the polygon's extruded face relative to the ellipsoid surface.
  22524. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  22525. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.
  22526. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  22527. * @property [fill = true] - A boolean Property specifying whether the polygon is filled with the provided material.
  22528. * @property [material = Color.WHITE] - A Property specifying the material used to fill the polygon.
  22529. * @property [outline = false] - A boolean Property specifying whether the polygon is outlined.
  22530. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  22531. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  22532. * @property [perPositionHeight = false] - A boolean specifying whether or not the height of each position is used.
  22533. * @property [closeTop = true] - When false, leaves off the top of an extruded polygon open.
  22534. * @property [closeBottom = true] - When false, leaves off the bottom of an extruded polygon open.
  22535. * @property [arcType = ArcType.GEODESIC] - The type of line the polygon edges must follow.
  22536. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polygon casts or receives shadows from light sources.
  22537. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polygon will be displayed.
  22538. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  22539. * @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.
  22540. * @property [textureCoordinates] - A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  22541. */
  22542. type ConstructorOptions = {
  22543. show?: Property | boolean;
  22544. hierarchy?: Property | PolygonHierarchy;
  22545. height?: Property | number;
  22546. heightReference?: Property | HeightReference;
  22547. extrudedHeight?: Property | number;
  22548. extrudedHeightReference?: Property | HeightReference;
  22549. stRotation?: Property | number;
  22550. granularity?: Property | number;
  22551. fill?: Property | boolean;
  22552. material?: MaterialProperty | Color;
  22553. outline?: Property | boolean;
  22554. outlineColor?: Property | Color;
  22555. outlineWidth?: Property | number;
  22556. perPositionHeight?: Property | boolean;
  22557. closeTop?: boolean | boolean;
  22558. closeBottom?: boolean | boolean;
  22559. arcType?: Property | ArcType;
  22560. shadows?: Property | ShadowMode;
  22561. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22562. classificationType?: Property | ClassificationType;
  22563. zIndex?: ConstantProperty | number;
  22564. textureCoordinates?: Property | PolygonHierarchy;
  22565. };
  22566. }
  22567. /**
  22568. * Describes a polygon defined by an hierarchy of linear rings which make up the outer shape and any nested holes.
  22569. * The polygon conforms to the curvature of the globe and can be placed on the surface or
  22570. * at altitude and can optionally be extruded into a volume.
  22571. * @param [options] - Object describing initialization options
  22572. */
  22573. export class PolygonGraphics {
  22574. constructor(options?: PolygonGraphics.ConstructorOptions);
  22575. /**
  22576. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  22577. */
  22578. readonly definitionChanged: Event;
  22579. /**
  22580. * Gets or sets the boolean Property specifying the visibility of the polygon.
  22581. */
  22582. show: Property | undefined;
  22583. /**
  22584. * Gets or sets the Property specifying the {@link PolygonHierarchy}.
  22585. */
  22586. hierarchy: Property | undefined;
  22587. /**
  22588. * Gets or sets the numeric Property specifying the constant altitude of the polygon.
  22589. */
  22590. height: Property | undefined;
  22591. /**
  22592. * Gets or sets the Property specifying the {@link HeightReference}.
  22593. */
  22594. heightReference: Property | undefined;
  22595. /**
  22596. * Gets or sets the numeric Property specifying the altitude of the polygon extrusion.
  22597. * If {@link PolygonGraphics#perPositionHeight} is false, the volume starts at {@link PolygonGraphics#height} and ends at this altitude.
  22598. * If {@link PolygonGraphics#perPositionHeight} is true, the volume starts at the height of each {@link PolygonGraphics#hierarchy} position and ends at this altitude.
  22599. */
  22600. extrudedHeight: Property | undefined;
  22601. /**
  22602. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  22603. */
  22604. extrudedHeightReference: Property | undefined;
  22605. /**
  22606. * Gets or sets the numeric property specifying the rotation of the polygon texture counter-clockwise from north. Only has an effect if textureCoordinates is not defined.
  22607. */
  22608. stRotation: Property | undefined;
  22609. /**
  22610. * Gets or sets the numeric Property specifying the angular distance between points on the polygon.
  22611. */
  22612. granularity: Property | undefined;
  22613. /**
  22614. * Gets or sets the boolean Property specifying whether the polygon is filled with the provided material.
  22615. */
  22616. fill: Property | undefined;
  22617. /**
  22618. * Gets or sets the Property specifying the material used to fill the polygon.
  22619. */
  22620. material: MaterialProperty;
  22621. /**
  22622. * Gets or sets the Property specifying whether the polygon is outlined.
  22623. */
  22624. outline: Property | undefined;
  22625. /**
  22626. * Gets or sets the Property specifying the {@link Color} of the outline.
  22627. */
  22628. outlineColor: Property | undefined;
  22629. /**
  22630. * Gets or sets the numeric Property specifying the width of the outline.
  22631. * <p>
  22632. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  22633. * </p>
  22634. */
  22635. outlineWidth: Property | undefined;
  22636. /**
  22637. * Gets or sets the boolean specifying whether or not the the height of each position is used.
  22638. * If true, the shape will have non-uniform altitude defined by the height of each {@link PolygonGraphics#hierarchy} position.
  22639. * If false, the shape will have a constant altitude as specified by {@link PolygonGraphics#height}.
  22640. */
  22641. perPositionHeight: Property | undefined;
  22642. /**
  22643. * Gets or sets a boolean specifying whether or not the top of an extruded polygon is included.
  22644. */
  22645. closeTop: Property | undefined;
  22646. /**
  22647. * Gets or sets a boolean specifying whether or not the bottom of an extruded polygon is included.
  22648. */
  22649. closeBottom: Property | undefined;
  22650. /**
  22651. * Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.
  22652. */
  22653. arcType: Property | undefined;
  22654. /**
  22655. * Get or sets the enum Property specifying whether the polygon
  22656. * casts or receives shadows from light sources.
  22657. */
  22658. shadows: Property | undefined;
  22659. /**
  22660. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polygon will be displayed.
  22661. */
  22662. distanceDisplayCondition: Property | undefined;
  22663. /**
  22664. * Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
  22665. */
  22666. classificationType: Property | undefined;
  22667. /**
  22668. * 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.
  22669. */
  22670. zIndex: ConstantProperty | undefined;
  22671. /**
  22672. * A Property specifying texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
  22673. */
  22674. textureCoordinates: Property | undefined;
  22675. /**
  22676. * Duplicates this instance.
  22677. * @param [result] - The object onto which to store the result.
  22678. * @returns The modified result parameter or a new instance if one was not provided.
  22679. */
  22680. clone(result?: PolygonGraphics): PolygonGraphics;
  22681. /**
  22682. * Assigns each unassigned property on this object to the value
  22683. * of the same property on the provided source object.
  22684. * @param source - The object to be merged into this object.
  22685. */
  22686. merge(source: PolygonGraphics): void;
  22687. }
  22688. /**
  22689. * A {@link MaterialProperty} that maps to PolylineArrow {@link Material} uniforms.
  22690. * @param [color = Color.WHITE] - The {@link Color} Property to be used.
  22691. */
  22692. export class PolylineArrowMaterialProperty {
  22693. constructor(color?: Property | Color);
  22694. /**
  22695. * Gets a value indicating if this property is constant. A property is considered
  22696. * constant if getValue always returns the same result for the current definition.
  22697. */
  22698. readonly isConstant: boolean;
  22699. /**
  22700. * Gets the event that is raised whenever the definition of this property changes.
  22701. * The definition is considered to have changed if a call to getValue would return
  22702. * a different result for the same time.
  22703. */
  22704. readonly definitionChanged: Event;
  22705. /**
  22706. * Gets or sets the {@link Color} {@link Property}.
  22707. */
  22708. color: Property | undefined;
  22709. /**
  22710. * Gets the {@link Material} type at the provided time.
  22711. * @param time - The time for which to retrieve the type.
  22712. * @returns The type of material.
  22713. */
  22714. getType(time: JulianDate): string;
  22715. /**
  22716. * Gets the value of the property at the provided time.
  22717. * @param time - The time for which to retrieve the value.
  22718. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22719. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22720. */
  22721. getValue(time: JulianDate, result?: any): any;
  22722. /**
  22723. * Compares this property to the provided property and returns
  22724. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22725. * @param [other] - The other property.
  22726. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22727. */
  22728. equals(other?: Property): boolean;
  22729. }
  22730. /**
  22731. * A {@link MaterialProperty} that maps to polyline dash {@link Material} uniforms.
  22732. * @param [options] - Object with the following properties:
  22733. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22734. * @param [options.gapColor = Color.TRANSPARENT] - A Property specifying the {@link Color} of the gaps in the line.
  22735. * @param [options.dashLength = 16.0] - A numeric Property specifying the length of the dash pattern in pixels.
  22736. * @param [options.dashPattern = 255.0] - A numeric Property specifying a 16 bit pattern for the dash
  22737. */
  22738. export class PolylineDashMaterialProperty {
  22739. constructor(options?: {
  22740. color?: Property | Color;
  22741. gapColor?: Property | Color;
  22742. dashLength?: Property | number;
  22743. dashPattern?: Property | number;
  22744. });
  22745. /**
  22746. * Gets a value indicating if this property is constant. A property is considered
  22747. * constant if getValue always returns the same result for the current definition.
  22748. */
  22749. readonly isConstant: boolean;
  22750. /**
  22751. * Gets the event that is raised whenever the definition of this property changes.
  22752. * The definition is considered to have changed if a call to getValue would return
  22753. * a different result for the same time.
  22754. */
  22755. readonly definitionChanged: Event;
  22756. /**
  22757. * Gets or sets the Property specifying the {@link Color} of the line.
  22758. */
  22759. color: Property | undefined;
  22760. /**
  22761. * Gets or sets the Property specifying the {@link Color} of the gaps in the line.
  22762. */
  22763. gapColor: Property | undefined;
  22764. /**
  22765. * Gets or sets the numeric Property specifying the length of a dash cycle
  22766. */
  22767. dashLength: Property | undefined;
  22768. /**
  22769. * Gets or sets the numeric Property specifying a dash pattern
  22770. */
  22771. dashPattern: Property | undefined;
  22772. /**
  22773. * Gets the {@link Material} type at the provided time.
  22774. * @param time - The time for which to retrieve the type.
  22775. * @returns The type of material.
  22776. */
  22777. getType(time: JulianDate): string;
  22778. /**
  22779. * Gets the value of the property at the provided time.
  22780. * @param time - The time for which to retrieve the value.
  22781. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22782. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22783. */
  22784. getValue(time: JulianDate, result?: any): any;
  22785. /**
  22786. * Compares this property to the provided property and returns
  22787. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22788. * @param [other] - The other property.
  22789. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22790. */
  22791. equals(other?: Property): boolean;
  22792. }
  22793. /**
  22794. * A {@link GeometryUpdater} for polylines.
  22795. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  22796. * @param entity - The entity containing the geometry to be visualized.
  22797. * @param scene - The scene where visualization is taking place.
  22798. */
  22799. export class PolylineGeometryUpdater {
  22800. constructor(entity: Entity, scene: Scene);
  22801. /**
  22802. * Gets the unique ID associated with this updater
  22803. */
  22804. readonly id: string;
  22805. /**
  22806. * Gets the entity associated with this geometry.
  22807. */
  22808. readonly entity: Entity;
  22809. /**
  22810. * Gets a value indicating if the geometry has a fill component.
  22811. */
  22812. readonly fillEnabled: boolean;
  22813. /**
  22814. * Gets a value indicating if fill visibility varies with simulation time.
  22815. */
  22816. readonly hasConstantFill: boolean;
  22817. /**
  22818. * Gets the material property used to fill the geometry.
  22819. */
  22820. readonly fillMaterialProperty: MaterialProperty;
  22821. /**
  22822. * Gets the material property used to fill the geometry when it fails the depth test.
  22823. */
  22824. readonly depthFailMaterialProperty: MaterialProperty;
  22825. /**
  22826. * Gets a value indicating if the geometry has an outline component.
  22827. */
  22828. readonly outlineEnabled: boolean;
  22829. /**
  22830. * Gets a value indicating if outline visibility varies with simulation time.
  22831. */
  22832. readonly hasConstantOutline: boolean;
  22833. /**
  22834. * Gets the {@link Color} property for the geometry outline.
  22835. */
  22836. readonly outlineColorProperty: Property;
  22837. /**
  22838. * Gets the property specifying whether the geometry
  22839. * casts or receives shadows from light sources.
  22840. */
  22841. readonly shadowsProperty: Property;
  22842. /**
  22843. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this geometry will be displayed.
  22844. */
  22845. readonly distanceDisplayConditionProperty: Property;
  22846. /**
  22847. * Gets or sets the {@link ClassificationType} Property specifying if this geometry will classify terrain, 3D Tiles, or both when on the ground.
  22848. */
  22849. readonly classificationTypeProperty: Property;
  22850. /**
  22851. * Gets a value indicating if the geometry is time-varying.
  22852. * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
  22853. * returned by GeometryUpdater#createDynamicUpdater.
  22854. */
  22855. readonly isDynamic: boolean;
  22856. /**
  22857. * Gets a value indicating if the geometry is closed.
  22858. * This property is only valid for static geometry.
  22859. */
  22860. readonly isClosed: boolean;
  22861. /**
  22862. * Gets an event that is raised whenever the public properties
  22863. * of this updater change.
  22864. */
  22865. readonly geometryChanged: boolean;
  22866. /**
  22867. * Gets a value indicating if the path of the line.
  22868. */
  22869. readonly arcType: ArcType;
  22870. /**
  22871. * Gets a value indicating if the geometry is clamped to the ground.
  22872. * Returns false if polylines on terrain is not supported.
  22873. */
  22874. readonly clampToGround: boolean;
  22875. /**
  22876. * Gets the zindex
  22877. */
  22878. readonly zIndex: number;
  22879. /**
  22880. * Checks if the geometry is outlined at the provided time.
  22881. * @param time - The time for which to retrieve visibility.
  22882. * @returns true if geometry is outlined at the provided time, false otherwise.
  22883. */
  22884. isOutlineVisible(time: JulianDate): boolean;
  22885. /**
  22886. * Checks if the geometry is filled at the provided time.
  22887. * @param time - The time for which to retrieve visibility.
  22888. * @returns true if geometry is filled at the provided time, false otherwise.
  22889. */
  22890. isFilled(time: JulianDate): boolean;
  22891. /**
  22892. * Creates the geometry instance which represents the fill of the geometry.
  22893. * @param time - The time to use when retrieving initial attribute values.
  22894. * @returns The geometry instance representing the filled portion of the geometry.
  22895. */
  22896. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  22897. /**
  22898. * Creates the geometry instance which represents the outline of the geometry.
  22899. * @param time - The time to use when retrieving initial attribute values.
  22900. * @returns The geometry instance representing the outline portion of the geometry.
  22901. */
  22902. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  22903. /**
  22904. * Returns true if this object was destroyed; otherwise, false.
  22905. * @returns True if this object was destroyed; otherwise, false.
  22906. */
  22907. isDestroyed(): boolean;
  22908. /**
  22909. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  22910. */
  22911. destroy(): void;
  22912. }
  22913. /**
  22914. * A {@link MaterialProperty} that maps to polyline glow {@link Material} uniforms.
  22915. * @param [options] - Object with the following properties:
  22916. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  22917. * @param [options.glowPower = 0.25] - A numeric Property specifying the strength of the glow, as a percentage of the total line width.
  22918. * @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.
  22919. */
  22920. export class PolylineGlowMaterialProperty {
  22921. constructor(options?: {
  22922. color?: Property | Color;
  22923. glowPower?: Property | number;
  22924. taperPower?: Property | number;
  22925. });
  22926. /**
  22927. * Gets a value indicating if this property is constant. A property is considered
  22928. * constant if getValue always returns the same result for the current definition.
  22929. */
  22930. readonly isConstant: boolean;
  22931. /**
  22932. * Gets the event that is raised whenever the definition of this property changes.
  22933. * The definition is considered to have changed if a call to getValue would return
  22934. * a different result for the same time.
  22935. */
  22936. readonly definitionChanged: Event;
  22937. /**
  22938. * Gets or sets the Property specifying the {@link Color} of the line.
  22939. */
  22940. color: Property | undefined;
  22941. /**
  22942. * Gets or sets the numeric Property specifying the strength of the glow, as a percentage of the total line width (less than 1.0).
  22943. */
  22944. glowPower: Property | undefined;
  22945. /**
  22946. * 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.
  22947. */
  22948. taperPower: Property | undefined;
  22949. /**
  22950. * Gets the {@link Material} type at the provided time.
  22951. * @param time - The time for which to retrieve the type.
  22952. * @returns The type of material.
  22953. */
  22954. getType(time: JulianDate): string;
  22955. /**
  22956. * Gets the value of the property at the provided time.
  22957. * @param time - The time for which to retrieve the value.
  22958. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  22959. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  22960. */
  22961. getValue(time: JulianDate, result?: any): any;
  22962. /**
  22963. * Compares this property to the provided property and returns
  22964. * <code>true</code> if they are equal, <code>false</code> otherwise.
  22965. * @param [other] - The other property.
  22966. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  22967. */
  22968. equals(other?: Property): boolean;
  22969. }
  22970. export namespace PolylineGraphics {
  22971. /**
  22972. * Initialization options for the PolylineGraphics constructor
  22973. * @property [show = true] - A boolean Property specifying the visibility of the polyline.
  22974. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions that define the line strip.
  22975. * @property [width = 1.0] - A numeric Property specifying the width in pixels.
  22976. * @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.
  22977. * @property [material = Color.WHITE] - A Property specifying the material used to draw the polyline.
  22978. * @property [depthFailMaterial] - A property specifying the material used to draw the polyline when it is below the terrain.
  22979. * @property [arcType = ArcType.GEODESIC] - The type of line the polyline segments must follow.
  22980. * @property [clampToGround = false] - A boolean Property specifying whether the Polyline should be clamped to the ground.
  22981. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the polyline casts or receives shadows from light sources.
  22982. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this polyline will be displayed.
  22983. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  22984. * @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.
  22985. */
  22986. type ConstructorOptions = {
  22987. show?: Property | boolean;
  22988. positions?: Property | Cartesian3[];
  22989. width?: Property | number;
  22990. granularity?: Property | number;
  22991. material?: MaterialProperty | Color;
  22992. depthFailMaterial?: MaterialProperty | Color;
  22993. arcType?: Property | ArcType;
  22994. clampToGround?: Property | boolean;
  22995. shadows?: Property | ShadowMode;
  22996. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  22997. classificationType?: Property | ClassificationType;
  22998. zIndex?: Property | number;
  22999. };
  23000. }
  23001. /**
  23002. * Describes a polyline. The first two positions define a line segment,
  23003. * and each additional position defines a line segment from the previous position. The segments
  23004. * can be linear connected points, great arcs, or clamped to terrain.
  23005. * @param [options] - Object describing initialization options
  23006. */
  23007. export class PolylineGraphics {
  23008. constructor(options?: PolylineGraphics.ConstructorOptions);
  23009. /**
  23010. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23011. */
  23012. readonly definitionChanged: Event;
  23013. /**
  23014. * Gets or sets the boolean Property specifying the visibility of the polyline.
  23015. */
  23016. show: Property | undefined;
  23017. /**
  23018. * Gets or sets the Property specifying the array of {@link Cartesian3}
  23019. * positions that define the line strip.
  23020. */
  23021. positions: Property | undefined;
  23022. /**
  23023. * Gets or sets the numeric Property specifying the width in pixels.
  23024. */
  23025. width: Property | undefined;
  23026. /**
  23027. * 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.
  23028. */
  23029. granularity: Property | undefined;
  23030. /**
  23031. * Gets or sets the Property specifying the material used to draw the polyline.
  23032. */
  23033. material: MaterialProperty;
  23034. /**
  23035. * Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.
  23036. * <p>
  23037. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  23038. * there may be artifacts.
  23039. * </p>
  23040. */
  23041. depthFailMaterial: MaterialProperty;
  23042. /**
  23043. * Gets or sets the {@link ArcType} Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.
  23044. */
  23045. arcType: Property | undefined;
  23046. /**
  23047. * Gets or sets the boolean Property specifying whether the polyline
  23048. * should be clamped to the ground.
  23049. */
  23050. clampToGround: Property | undefined;
  23051. /**
  23052. * Get or sets the enum Property specifying whether the polyline
  23053. * casts or receives shadows from light sources.
  23054. */
  23055. shadows: Property | undefined;
  23056. /**
  23057. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this polyline will be displayed.
  23058. */
  23059. distanceDisplayCondition: Property | undefined;
  23060. /**
  23061. * Gets or sets the {@link ClassificationType} Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
  23062. */
  23063. classificationType: Property | undefined;
  23064. /**
  23065. * 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.
  23066. */
  23067. zIndex: ConstantProperty | undefined;
  23068. /**
  23069. * Duplicates this instance.
  23070. * @param [result] - The object onto which to store the result.
  23071. * @returns The modified result parameter or a new instance if one was not provided.
  23072. */
  23073. clone(result?: PolylineGraphics): PolylineGraphics;
  23074. /**
  23075. * Assigns each unassigned property on this object to the value
  23076. * of the same property on the provided source object.
  23077. * @param source - The object to be merged into this object.
  23078. */
  23079. merge(source: PolylineGraphics): void;
  23080. }
  23081. /**
  23082. * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms.
  23083. * @param [options] - Object with the following properties:
  23084. * @param [options.color = Color.WHITE] - A Property specifying the {@link Color} of the line.
  23085. * @param [options.outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23086. * @param [options.outlineWidth = 1.0] - A numeric Property specifying the width of the outline, in pixels.
  23087. */
  23088. export class PolylineOutlineMaterialProperty {
  23089. constructor(options?: {
  23090. color?: Property | Color;
  23091. outlineColor?: Property | Color;
  23092. outlineWidth?: Property | number;
  23093. });
  23094. /**
  23095. * Gets a value indicating if this property is constant. A property is considered
  23096. * constant if getValue always returns the same result for the current definition.
  23097. */
  23098. readonly isConstant: boolean;
  23099. /**
  23100. * Gets the event that is raised whenever the definition of this property changes.
  23101. * The definition is considered to have changed if a call to getValue would return
  23102. * a different result for the same time.
  23103. */
  23104. readonly definitionChanged: Event;
  23105. /**
  23106. * Gets or sets the Property specifying the {@link Color} of the line.
  23107. */
  23108. color: Property | undefined;
  23109. /**
  23110. * Gets or sets the Property specifying the {@link Color} of the outline.
  23111. */
  23112. outlineColor: Property | undefined;
  23113. /**
  23114. * Gets or sets the numeric Property specifying the width of the outline.
  23115. */
  23116. outlineWidth: Property | undefined;
  23117. /**
  23118. * Gets the {@link Material} type at the provided time.
  23119. * @param time - The time for which to retrieve the type.
  23120. * @returns The type of material.
  23121. */
  23122. getType(time: JulianDate): string;
  23123. /**
  23124. * Gets the value of the property at the provided time.
  23125. * @param time - The time for which to retrieve the value.
  23126. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23127. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23128. */
  23129. getValue(time: JulianDate, result?: any): any;
  23130. /**
  23131. * Compares this property to the provided property and returns
  23132. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23133. * @param [other] - The other property.
  23134. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23135. */
  23136. equals(other?: Property): boolean;
  23137. }
  23138. /**
  23139. * A visualizer for polylines represented by {@link Primitive} instances.
  23140. * @param scene - The scene the primitives will be rendered in.
  23141. * @param entityCollection - The entityCollection to visualize.
  23142. * @param [primitives = scene.primitives] - A collection to add primitives related to the entities
  23143. * @param [groundPrimitives = scene.groundPrimitives] - A collection to add ground primitives related to the entities
  23144. */
  23145. export class PolylineVisualizer {
  23146. constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection);
  23147. /**
  23148. * Updates all of the primitives created by this visualizer to match their
  23149. * Entity counterpart at the given time.
  23150. * @param time - The time to update to.
  23151. * @returns True if the visualizer successfully updated to the provided time,
  23152. * false if the visualizer is waiting for asynchronous primitives to be created.
  23153. */
  23154. update(time: JulianDate): boolean;
  23155. /**
  23156. * Returns true if this object was destroyed; otherwise, false.
  23157. * @returns True if this object was destroyed; otherwise, false.
  23158. */
  23159. isDestroyed(): boolean;
  23160. /**
  23161. * Removes and destroys all primitives created by this instance.
  23162. */
  23163. destroy(): void;
  23164. }
  23165. /**
  23166. * A {@link GeometryUpdater} for polyline volumes.
  23167. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  23168. * @param entity - The entity containing the geometry to be visualized.
  23169. * @param scene - The scene where visualization is taking place.
  23170. */
  23171. export class PolylineVolumeGeometryUpdater {
  23172. constructor(entity: Entity, scene: Scene);
  23173. /**
  23174. * Creates the geometry instance which represents the fill of the geometry.
  23175. * @param time - The time to use when retrieving initial attribute values.
  23176. * @returns The geometry instance representing the filled portion of the geometry.
  23177. */
  23178. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23179. /**
  23180. * Creates the geometry instance which represents the outline of the geometry.
  23181. * @param time - The time to use when retrieving initial attribute values.
  23182. * @returns The geometry instance representing the outline portion of the geometry.
  23183. */
  23184. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23185. }
  23186. export namespace PolylineVolumeGraphics {
  23187. /**
  23188. * Initialization options for the PolylineVolumeGraphics constructor
  23189. * @property [show = true] - A boolean Property specifying the visibility of the volume.
  23190. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the line strip.
  23191. * @property [shape] - A Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  23192. * @property [cornerType = CornerType.ROUNDED] - A {@link CornerType} Property specifying the style of the corners.
  23193. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  23194. * @property [fill = true] - A boolean Property specifying whether the volume is filled with the provided material.
  23195. * @property [material = Color.WHITE] - A Property specifying the material used to fill the volume.
  23196. * @property [outline = false] - A boolean Property specifying whether the volume is outlined.
  23197. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23198. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23199. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the volume casts or receives shadows from light sources.
  23200. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this volume will be displayed.
  23201. */
  23202. type ConstructorOptions = {
  23203. show?: Property | boolean;
  23204. positions?: Property | Cartesian3[];
  23205. shape?: Property | Cartesian2[];
  23206. cornerType?: Property | CornerType;
  23207. granularity?: Property | number;
  23208. fill?: Property | boolean;
  23209. material?: MaterialProperty | Color;
  23210. outline?: Property | boolean;
  23211. outlineColor?: Property | Color;
  23212. outlineWidth?: Property | number;
  23213. shadows?: Property | ShadowMode;
  23214. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23215. };
  23216. }
  23217. /**
  23218. * Describes a polyline volume defined as a line strip and corresponding two dimensional shape which is extruded along it.
  23219. * The resulting volume conforms to the curvature of the globe.
  23220. * @param [options] - Object describing initialization options
  23221. */
  23222. export class PolylineVolumeGraphics {
  23223. constructor(options?: PolylineVolumeGraphics.ConstructorOptions);
  23224. /**
  23225. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23226. */
  23227. readonly definitionChanged: Event;
  23228. /**
  23229. * Gets or sets the boolean Property specifying the visibility of the volume.
  23230. */
  23231. show: Property | undefined;
  23232. /**
  23233. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the line strip.
  23234. */
  23235. positions: Property | undefined;
  23236. /**
  23237. * Gets or sets the Property specifying the array of {@link Cartesian2} positions which define the shape to be extruded.
  23238. */
  23239. shape: Property | undefined;
  23240. /**
  23241. * Gets or sets the {@link CornerType} Property specifying the style of the corners.
  23242. */
  23243. cornerType: Property | undefined;
  23244. /**
  23245. * Gets or sets the numeric Property specifying the angular distance between points on the volume.
  23246. */
  23247. granularity: Property | undefined;
  23248. /**
  23249. * Gets or sets the boolean Property specifying whether the volume is filled with the provided material.
  23250. */
  23251. fill: Property | undefined;
  23252. /**
  23253. * Gets or sets the Property specifying the material used to fill the volume.
  23254. */
  23255. material: MaterialProperty;
  23256. /**
  23257. * Gets or sets the Property specifying whether the volume is outlined.
  23258. */
  23259. outline: Property | undefined;
  23260. /**
  23261. * Gets or sets the Property specifying the {@link Color} of the outline.
  23262. */
  23263. outlineColor: Property | undefined;
  23264. /**
  23265. * Gets or sets the numeric Property specifying the width of the outline.
  23266. * <p>
  23267. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  23268. * </p>
  23269. */
  23270. outlineWidth: Property | undefined;
  23271. /**
  23272. * Get or sets the enum Property specifying whether the volume
  23273. * casts or receives shadows from light sources.
  23274. */
  23275. shadows: Property | undefined;
  23276. /**
  23277. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this volume will be displayed.
  23278. */
  23279. distanceDisplayCondition: Property | undefined;
  23280. /**
  23281. * Duplicates this instance.
  23282. * @param [result] - The object onto which to store the result.
  23283. * @returns The modified result parameter or a new instance if one was not provided.
  23284. */
  23285. clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics;
  23286. /**
  23287. * Assigns each unassigned property on this object to the value
  23288. * of the same property on the provided source object.
  23289. * @param source - The object to be merged into this object.
  23290. */
  23291. merge(source: PolylineVolumeGraphics): void;
  23292. }
  23293. /**
  23294. * The interface for all {@link Property} objects that define a world
  23295. * location as a {@link Cartesian3} with an associated {@link ReferenceFrame}.
  23296. * This type defines an interface and cannot be instantiated directly.
  23297. */
  23298. export class PositionProperty {
  23299. constructor();
  23300. /**
  23301. * Gets a value indicating if this property is constant. A property is considered
  23302. * constant if getValue always returns the same result for the current definition.
  23303. */
  23304. readonly isConstant: boolean;
  23305. /**
  23306. * Gets the event that is raised whenever the definition of this property changes.
  23307. * The definition is considered to have changed if a call to getValue would return
  23308. * a different result for the same time.
  23309. */
  23310. readonly definitionChanged: Event;
  23311. /**
  23312. * Gets the reference frame that the position is defined in.
  23313. */
  23314. referenceFrame: ReferenceFrame;
  23315. /**
  23316. * Gets the value of the property at the provided time in the fixed frame.
  23317. * @param time - The time for which to retrieve the value.
  23318. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23319. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23320. */
  23321. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  23322. /**
  23323. * Gets the value of the property at the provided time and in the provided reference frame.
  23324. * @param time - The time for which to retrieve the value.
  23325. * @param referenceFrame - The desired referenceFrame of the result.
  23326. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23327. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23328. */
  23329. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  23330. /**
  23331. * Compares this property to the provided property and returns
  23332. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23333. * @param [other] - The other property.
  23334. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23335. */
  23336. equals(other?: Property): boolean;
  23337. }
  23338. /**
  23339. * A {@link Property} whose value is an array whose items are the computed value
  23340. * of other PositionProperty instances.
  23341. * @param [value] - An array of Property instances.
  23342. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23343. */
  23344. export class PositionPropertyArray {
  23345. constructor(value?: Property[], referenceFrame?: ReferenceFrame);
  23346. /**
  23347. * Gets a value indicating if this property is constant. This property
  23348. * is considered constant if all property items in the array are constant.
  23349. */
  23350. readonly isConstant: boolean;
  23351. /**
  23352. * Gets the event that is raised whenever the definition of this property changes.
  23353. * The definition is changed whenever setValue is called with data different
  23354. * than the current value or one of the properties in the array also changes.
  23355. */
  23356. readonly definitionChanged: Event;
  23357. /**
  23358. * Gets the reference frame in which the position is defined.
  23359. */
  23360. referenceFrame: ReferenceFrame;
  23361. /**
  23362. * Gets the value of the property.
  23363. * @param time - The time for which to retrieve the value.
  23364. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23365. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23366. */
  23367. getValue(time: JulianDate, result?: Cartesian3[]): Cartesian3[];
  23368. /**
  23369. * Gets the value of the property at the provided time and in the provided reference frame.
  23370. * @param time - The time for which to retrieve the value.
  23371. * @param referenceFrame - The desired referenceFrame of the result.
  23372. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23373. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23374. */
  23375. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3[]): Cartesian3[];
  23376. /**
  23377. * Sets the value of the property.
  23378. * @param value - An array of Property instances.
  23379. */
  23380. setValue(value: Property[]): void;
  23381. /**
  23382. * Compares this property to the provided property and returns
  23383. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23384. * @param [other] - The other property.
  23385. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23386. */
  23387. equals(other?: Property): boolean;
  23388. }
  23389. /**
  23390. * The interface for all properties, which represent a value that can optionally vary over time.
  23391. * This type defines an interface and cannot be instantiated directly.
  23392. */
  23393. export class Property {
  23394. constructor();
  23395. /**
  23396. * Gets a value indicating if this property is constant. A property is considered
  23397. * constant if getValue always returns the same result for the current definition.
  23398. */
  23399. readonly isConstant: boolean;
  23400. /**
  23401. * Gets the event that is raised whenever the definition of this property changes.
  23402. * The definition is considered to have changed if a call to getValue would return
  23403. * a different result for the same time.
  23404. */
  23405. readonly definitionChanged: Event;
  23406. /**
  23407. * Gets the value of the property at the provided time.
  23408. * @param time - The time for which to retrieve the value.
  23409. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23410. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23411. */
  23412. getValue(time: JulianDate, result?: any): any;
  23413. /**
  23414. * Compares this property to the provided property and returns
  23415. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23416. * @param [other] - The other property.
  23417. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23418. */
  23419. equals(other?: Property): boolean;
  23420. }
  23421. /**
  23422. * A {@link Property} whose value is an array whose items are the computed value
  23423. * of other property instances.
  23424. * @param [value] - An array of Property instances.
  23425. */
  23426. export class PropertyArray {
  23427. constructor(value?: Property[]);
  23428. /**
  23429. * Gets a value indicating if this property is constant. This property
  23430. * is considered constant if all property items in the array are constant.
  23431. */
  23432. readonly isConstant: boolean;
  23433. /**
  23434. * Gets the event that is raised whenever the definition of this property changes.
  23435. * The definition is changed whenever setValue is called with data different
  23436. * than the current value or one of the properties in the array also changes.
  23437. */
  23438. readonly definitionChanged: Event;
  23439. /**
  23440. * Gets the value of the property.
  23441. * @param time - The time for which to retrieve the value.
  23442. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23443. * @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.
  23444. */
  23445. getValue(time: JulianDate, result?: object[]): object[];
  23446. /**
  23447. * Sets the value of the property.
  23448. * @param value - An array of Property instances.
  23449. */
  23450. setValue(value: Property[]): void;
  23451. /**
  23452. * Compares this property to the provided property and returns
  23453. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23454. * @param [other] - The other property.
  23455. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23456. */
  23457. equals(other?: Property): boolean;
  23458. }
  23459. export interface PropertyBag extends Record<string, any> {
  23460. }
  23461. /**
  23462. * A {@link Property} whose value is a key-value mapping of property names to the computed value of other properties.
  23463. * @param [value] - An object, containing key-value mapping of property names to properties.
  23464. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  23465. */
  23466. export class PropertyBag implements Record<string, any> {
  23467. constructor(value?: any, createPropertyCallback?: (...params: any[]) => any);
  23468. /**
  23469. * Gets the names of all properties registered on this instance.
  23470. */
  23471. propertyNames: any[];
  23472. /**
  23473. * Gets a value indicating if this property is constant. This property
  23474. * is considered constant if all property items in this object are constant.
  23475. */
  23476. readonly isConstant: boolean;
  23477. /**
  23478. * Gets the event that is raised whenever the set of properties contained in this
  23479. * object changes, or one of the properties itself changes.
  23480. */
  23481. readonly definitionChanged: Event;
  23482. /**
  23483. * Determines if this object has defined a property with the given name.
  23484. * @param propertyName - The name of the property to check for.
  23485. * @returns True if this object has defined a property with the given name, false otherwise.
  23486. */
  23487. hasProperty(propertyName: string): boolean;
  23488. /**
  23489. * Adds a property to this object.
  23490. * @param propertyName - The name of the property to add.
  23491. * @param [value] - The value of the new property, if provided.
  23492. * @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.
  23493. */
  23494. addProperty(propertyName: string, value?: any, createPropertyCallback?: (...params: any[]) => any): void;
  23495. /**
  23496. * Removed a property previously added with addProperty.
  23497. * @param propertyName - The name of the property to remove.
  23498. */
  23499. removeProperty(propertyName: string): void;
  23500. /**
  23501. * Gets the value of this property. Each contained property will be evaluated at the given time, and the overall
  23502. * result will be an object, mapping property names to those values.
  23503. * @param time - The time for which to retrieve the value.
  23504. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23505. * Note that any properties in result which are not part of this PropertyBag will be left as-is.
  23506. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23507. */
  23508. getValue(time: JulianDate, result?: any): any;
  23509. /**
  23510. * Assigns each unassigned property on this object to the value
  23511. * of the same property on the provided source object.
  23512. * @param source - The object to be merged into this object.
  23513. * @param [createPropertyCallback] - A function that will be called when the value of any of the properties in value are not a Property.
  23514. */
  23515. merge(source: any, createPropertyCallback?: (...params: any[]) => any): void;
  23516. /**
  23517. * Compares this property to the provided property and returns
  23518. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23519. * @param [other] - The other property.
  23520. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23521. */
  23522. equals(other?: Property): boolean;
  23523. }
  23524. /**
  23525. * A {@link GeometryUpdater} for rectangles.
  23526. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  23527. * @param entity - The entity containing the geometry to be visualized.
  23528. * @param scene - The scene where visualization is taking place.
  23529. */
  23530. export class RectangleGeometryUpdater {
  23531. constructor(entity: Entity, scene: Scene);
  23532. /**
  23533. * Creates the geometry instance which represents the fill of the geometry.
  23534. * @param time - The time to use when retrieving initial attribute values.
  23535. * @returns The geometry instance representing the filled portion of the geometry.
  23536. */
  23537. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  23538. /**
  23539. * Creates the geometry instance which represents the outline of the geometry.
  23540. * @param time - The time to use when retrieving initial attribute values.
  23541. * @returns The geometry instance representing the outline portion of the geometry.
  23542. */
  23543. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  23544. }
  23545. export namespace RectangleGraphics {
  23546. /**
  23547. * Initialization options for the RectangleGraphics constructor
  23548. * @property [show = true] - A boolean Property specifying the visibility of the rectangle.
  23549. * @property [coordinates] - The Property specifying the {@link Rectangle}.
  23550. * @property [height = 0] - A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface.
  23551. * @property [heightReference = HeightReference.NONE] - A Property specifying what the height is relative to.
  23552. * @property [extrudedHeight] - A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface.
  23553. * @property [extrudedHeightReference = HeightReference.NONE] - A Property specifying what the extrudedHeight is relative to.
  23554. * @property [rotation = 0.0] - A numeric property specifying the rotation of the rectangle clockwise from north.
  23555. * @property [stRotation = 0.0] - A numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  23556. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between points on the rectangle.
  23557. * @property [fill = true] - A boolean Property specifying whether the rectangle is filled with the provided material.
  23558. * @property [material = Color.WHITE] - A Property specifying the material used to fill the rectangle.
  23559. * @property [outline = false] - A boolean Property specifying whether the rectangle is outlined.
  23560. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  23561. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  23562. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the rectangle casts or receives shadows from light sources.
  23563. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this rectangle will be displayed.
  23564. * @property [classificationType = ClassificationType.BOTH] - An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  23565. * @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.
  23566. */
  23567. type ConstructorOptions = {
  23568. show?: Property | boolean;
  23569. coordinates?: Property | Rectangle;
  23570. height?: Property | number;
  23571. heightReference?: Property | HeightReference;
  23572. extrudedHeight?: Property | number;
  23573. extrudedHeightReference?: Property | HeightReference;
  23574. rotation?: Property | number;
  23575. stRotation?: Property | number;
  23576. granularity?: Property | number;
  23577. fill?: Property | boolean;
  23578. material?: MaterialProperty | Color;
  23579. outline?: Property | boolean;
  23580. outlineColor?: Property | Color;
  23581. outlineWidth?: Property | number;
  23582. shadows?: Property | ShadowMode;
  23583. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  23584. classificationType?: Property | ClassificationType;
  23585. zIndex?: Property | number;
  23586. };
  23587. }
  23588. /**
  23589. * Describes graphics for a {@link Rectangle}.
  23590. * The rectangle conforms to the curvature of the globe and can be placed on the surface or
  23591. * at altitude and can optionally be extruded into a volume.
  23592. * @param [options] - Object describing initialization options
  23593. */
  23594. export class RectangleGraphics {
  23595. constructor(options?: RectangleGraphics.ConstructorOptions);
  23596. /**
  23597. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  23598. */
  23599. readonly definitionChanged: Event;
  23600. /**
  23601. * Gets or sets the boolean Property specifying the visibility of the rectangle.
  23602. */
  23603. show: Property | undefined;
  23604. /**
  23605. * Gets or sets the Property specifying the {@link Rectangle}.
  23606. */
  23607. coordinates: Property | undefined;
  23608. /**
  23609. * Gets or sets the numeric Property specifying the altitude of the rectangle.
  23610. */
  23611. height: Property | undefined;
  23612. /**
  23613. * Gets or sets the Property specifying the {@link HeightReference}.
  23614. */
  23615. heightReference: Property | undefined;
  23616. /**
  23617. * Gets or sets the numeric Property specifying the altitude of the rectangle extrusion.
  23618. * Setting this property creates volume starting at height and ending at this altitude.
  23619. */
  23620. extrudedHeight: Property | undefined;
  23621. /**
  23622. * Gets or sets the Property specifying the extruded {@link HeightReference}.
  23623. */
  23624. extrudedHeightReference: Property | undefined;
  23625. /**
  23626. * Gets or sets the numeric property specifying the rotation of the rectangle clockwise from north.
  23627. */
  23628. rotation: Property | undefined;
  23629. /**
  23630. * Gets or sets the numeric property specifying the rotation of the rectangle texture counter-clockwise from north.
  23631. */
  23632. stRotation: Property | undefined;
  23633. /**
  23634. * Gets or sets the numeric Property specifying the angular distance between points on the rectangle.
  23635. */
  23636. granularity: Property | undefined;
  23637. /**
  23638. * Gets or sets the boolean Property specifying whether the rectangle is filled with the provided material.
  23639. */
  23640. fill: Property | undefined;
  23641. /**
  23642. * Gets or sets the Property specifying the material used to fill the rectangle.
  23643. */
  23644. material: MaterialProperty;
  23645. /**
  23646. * Gets or sets the Property specifying whether the rectangle is outlined.
  23647. */
  23648. outline: Property | undefined;
  23649. /**
  23650. * Gets or sets the Property specifying the {@link Color} of the outline.
  23651. */
  23652. outlineColor: Property | undefined;
  23653. /**
  23654. * Gets or sets the numeric Property specifying the width of the outline.
  23655. * <p>
  23656. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  23657. * </p>
  23658. */
  23659. outlineWidth: Property | undefined;
  23660. /**
  23661. * Get or sets the enum Property specifying whether the rectangle
  23662. * casts or receives shadows from light sources.
  23663. */
  23664. shadows: Property | undefined;
  23665. /**
  23666. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangle will be displayed.
  23667. */
  23668. distanceDisplayCondition: Property | undefined;
  23669. /**
  23670. * Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
  23671. */
  23672. classificationType: Property | undefined;
  23673. /**
  23674. * 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.
  23675. */
  23676. zIndex: ConstantProperty | undefined;
  23677. /**
  23678. * Duplicates this instance.
  23679. * @param [result] - The object onto which to store the result.
  23680. * @returns The modified result parameter or a new instance if one was not provided.
  23681. */
  23682. clone(result?: RectangleGraphics): RectangleGraphics;
  23683. /**
  23684. * Assigns each unassigned property on this object to the value
  23685. * of the same property on the provided source object.
  23686. * @param source - The object to be merged into this object.
  23687. */
  23688. merge(source: RectangleGraphics): void;
  23689. }
  23690. /**
  23691. * A {@link Property} which transparently links to another property on a provided object.
  23692. * @example
  23693. * const collection = new Cesium.EntityCollection();
  23694. *
  23695. * //Create a new entity and assign a billboard scale.
  23696. * const object1 = new Cesium.Entity({id:'object1'});
  23697. * object1.billboard = new Cesium.BillboardGraphics();
  23698. * object1.billboard.scale = new Cesium.ConstantProperty(2.0);
  23699. * collection.add(object1);
  23700. *
  23701. * //Create a second entity and reference the scale from the first one.
  23702. * const object2 = new Cesium.Entity({id:'object2'});
  23703. * object2.model = new Cesium.ModelGraphics();
  23704. * object2.model.scale = new Cesium.ReferenceProperty(collection, 'object1', ['billboard', 'scale']);
  23705. * collection.add(object2);
  23706. *
  23707. * //Create a third object, but use the fromString helper function.
  23708. * const object3 = new Cesium.Entity({id:'object3'});
  23709. * object3.billboard = new Cesium.BillboardGraphics();
  23710. * object3.billboard.scale = Cesium.ReferenceProperty.fromString(collection, 'object1#billboard.scale');
  23711. * collection.add(object3);
  23712. *
  23713. * //You can refer to an entity with a # or . in id and property names by escaping them.
  23714. * const object4 = new Cesium.Entity({id:'#object.4'});
  23715. * object4.billboard = new Cesium.BillboardGraphics();
  23716. * object4.billboard.scale = new Cesium.ConstantProperty(2.0);
  23717. * collection.add(object4);
  23718. *
  23719. * const object5 = new Cesium.Entity({id:'object5'});
  23720. * object5.billboard = new Cesium.BillboardGraphics();
  23721. * object5.billboard.scale = Cesium.ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale');
  23722. * collection.add(object5);
  23723. * @param targetCollection - The entity collection which will be used to resolve the reference.
  23724. * @param targetId - The id of the entity which is being referenced.
  23725. * @param targetPropertyNames - The names of the property on the target entity which we will use.
  23726. */
  23727. export class ReferenceProperty {
  23728. constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string[]);
  23729. /**
  23730. * Gets a value indicating if this property is constant.
  23731. */
  23732. readonly isConstant: boolean;
  23733. /**
  23734. * Gets the event that is raised whenever the definition of this property changes.
  23735. * The definition is changed whenever the referenced property's definition is changed.
  23736. */
  23737. readonly definitionChanged: Event;
  23738. /**
  23739. * Gets the reference frame that the position is defined in.
  23740. * This property is only valid if the referenced property is a {@link PositionProperty}.
  23741. */
  23742. readonly referenceFrame: ReferenceFrame;
  23743. /**
  23744. * Gets the id of the entity being referenced.
  23745. */
  23746. readonly targetId: string;
  23747. /**
  23748. * Gets the collection containing the entity being referenced.
  23749. */
  23750. readonly targetCollection: EntityCollection;
  23751. /**
  23752. * Gets the array of property names used to retrieve the referenced property.
  23753. */
  23754. readonly targetPropertyNames: string[];
  23755. /**
  23756. * Gets the resolved instance of the underlying referenced property.
  23757. */
  23758. readonly resolvedProperty: Property | undefined;
  23759. /**
  23760. * Creates a new instance given the entity collection that will
  23761. * be used to resolve it and a string indicating the target entity id and property.
  23762. * The format of the string is "objectId#foo.bar", where # separates the id from
  23763. * property path and . separates sub-properties. If the reference identifier or
  23764. * or any sub-properties contains a # . or \ they must be escaped.
  23765. * @returns A new instance of ReferenceProperty.
  23766. */
  23767. static fromString(targetCollection: EntityCollection, referenceString: string): ReferenceProperty;
  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. * Gets the value of the property at the provided time and in the provided reference frame.
  23777. * This method is only valid if the property being referenced is a {@link PositionProperty}.
  23778. * @param time - The time for which to retrieve the value.
  23779. * @param referenceFrame - The desired referenceFrame of the result.
  23780. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23781. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23782. */
  23783. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3;
  23784. /**
  23785. * Gets the {@link Material} type at the provided time.
  23786. * This method is only valid if the property being referenced is a {@link MaterialProperty}.
  23787. * @param time - The time for which to retrieve the type.
  23788. * @returns The type of material.
  23789. */
  23790. getType(time: JulianDate): string;
  23791. /**
  23792. * Compares this property to the provided property and returns
  23793. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23794. * @param [other] - The other property.
  23795. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23796. */
  23797. equals(other?: Property): boolean;
  23798. }
  23799. export namespace Rotation {
  23800. /**
  23801. * The number of elements used to pack the object into an array.
  23802. */
  23803. var packedLength: number;
  23804. /**
  23805. * Stores the provided instance into the provided array.
  23806. * @param value - The value to pack.
  23807. * @param array - The array to pack into.
  23808. * @param [startingIndex = 0] - The index into the array at which to start packing the elements.
  23809. * @returns The array that was packed into
  23810. */
  23811. function pack(value: Rotation, array: number[], startingIndex?: number): number[];
  23812. /**
  23813. * Retrieves an instance from a packed array.
  23814. * @param array - The packed array.
  23815. * @param [startingIndex = 0] - The starting index of the element to be unpacked.
  23816. * @param [result] - The object into which to store the result.
  23817. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23818. */
  23819. function unpack(array: number[], startingIndex?: number, result?: Rotation): Rotation;
  23820. /**
  23821. * Converts a packed array into a form suitable for interpolation.
  23822. * @param packedArray - The packed array.
  23823. * @param [startingIndex = 0] - The index of the first element to be converted.
  23824. * @param [lastIndex = packedArray.length] - The index of the last element to be converted.
  23825. * @param [result] - The object into which to store the result.
  23826. */
  23827. function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void;
  23828. /**
  23829. * Retrieves an instance from a packed array converted with {@link Rotation.convertPackedArrayForInterpolation}.
  23830. * @param array - The array previously packed for interpolation.
  23831. * @param sourceArray - The original packed array.
  23832. * @param [firstIndex = 0] - The firstIndex used to convert the array.
  23833. * @param [lastIndex = packedArray.length] - The lastIndex used to convert the array.
  23834. * @param [result] - The object into which to store the result.
  23835. * @returns The modified result parameter or a new Rotation instance if one was not provided.
  23836. */
  23837. function unpackInterpolationResult(array: number[], sourceArray: number[], firstIndex?: number, lastIndex?: number, result?: Rotation): Rotation;
  23838. }
  23839. /**
  23840. * Represents a {@link Packable} number that always interpolates values
  23841. * towards the shortest angle of rotation. This object is never used directly
  23842. * but is instead passed to the constructor of {@link SampledProperty}
  23843. * in order to represent a two-dimensional angle of rotation.
  23844. * @example
  23845. * const time1 = Cesium.JulianDate.fromIso8601('2010-05-07T00:00:00');
  23846. * const time2 = Cesium.JulianDate.fromIso8601('2010-05-07T00:01:00');
  23847. * const time3 = Cesium.JulianDate.fromIso8601('2010-05-07T00:02:00');
  23848. *
  23849. * const property = new Cesium.SampledProperty(Cesium.Rotation);
  23850. * property.addSample(time1, 0);
  23851. * property.addSample(time3, Cesium.Math.toRadians(350));
  23852. *
  23853. * //Getting the value at time2 will equal 355 degrees instead
  23854. * //of 175 degrees (which is what you get if you construct
  23855. * //a SampledProperty(Number) instead. Note, the actual
  23856. * //return value is in radians, not degrees.
  23857. * property.getValue(time2);
  23858. */
  23859. export interface Rotation {
  23860. }
  23861. /**
  23862. * A {@link SampledProperty} which is also a {@link PositionProperty}.
  23863. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  23864. * @param [numberOfDerivatives = 0] - The number of derivatives that accompany each position; i.e. velocity, acceleration, etc...
  23865. */
  23866. export class SampledPositionProperty {
  23867. constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number);
  23868. /**
  23869. * Gets a value indicating if this property is constant. A property is considered
  23870. * constant if getValue always returns the same result for the current definition.
  23871. */
  23872. readonly isConstant: boolean;
  23873. /**
  23874. * Gets the event that is raised whenever the definition of this property changes.
  23875. * The definition is considered to have changed if a call to getValue would return
  23876. * a different result for the same time.
  23877. */
  23878. readonly definitionChanged: Event;
  23879. /**
  23880. * Gets the reference frame in which the position is defined.
  23881. */
  23882. referenceFrame: ReferenceFrame;
  23883. /**
  23884. * Gets the degree of interpolation to perform when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23885. */
  23886. readonly interpolationDegree: number;
  23887. /**
  23888. * Gets the interpolation algorithm to use when retrieving a value. Call <code>setInterpolationOptions</code> to set this.
  23889. */
  23890. readonly interpolationAlgorithm: InterpolationAlgorithm;
  23891. /**
  23892. * The number of derivatives contained by this property; i.e. 0 for just position, 1 for velocity, etc.
  23893. */
  23894. numberOfDerivatives: number;
  23895. /**
  23896. * Gets or sets the type of extrapolation to perform when a value
  23897. * is requested at a time after any available samples.
  23898. */
  23899. forwardExtrapolationType: ExtrapolationType;
  23900. /**
  23901. * Gets or sets the amount of time to extrapolate forward before
  23902. * the property becomes undefined. A value of 0 will extrapolate forever.
  23903. */
  23904. forwardExtrapolationDuration: number;
  23905. /**
  23906. * Gets or sets the type of extrapolation to perform when a value
  23907. * is requested at a time before any available samples.
  23908. */
  23909. backwardExtrapolationType: ExtrapolationType;
  23910. /**
  23911. * Gets or sets the amount of time to extrapolate backward
  23912. * before the property becomes undefined. A value of 0 will extrapolate forever.
  23913. */
  23914. backwardExtrapolationDuration: number;
  23915. /**
  23916. * Gets the position at the provided time.
  23917. * @param time - The time for which to retrieve the value.
  23918. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23919. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23920. */
  23921. getValue(time: JulianDate, result?: Cartesian3): Cartesian3 | undefined;
  23922. /**
  23923. * Gets the position at the provided time and in the provided reference frame.
  23924. * @param time - The time for which to retrieve the value.
  23925. * @param referenceFrame - The desired referenceFrame of the result.
  23926. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  23927. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  23928. */
  23929. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  23930. /**
  23931. * Sets the algorithm and degree to use when interpolating a position.
  23932. * @param [options] - Object with the following properties:
  23933. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  23934. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  23935. */
  23936. setInterpolationOptions(options?: {
  23937. interpolationAlgorithm?: InterpolationAlgorithm;
  23938. interpolationDegree?: number;
  23939. }): void;
  23940. /**
  23941. * Adds a new sample.
  23942. * @param time - The sample time.
  23943. * @param position - The position at the provided time.
  23944. * @param [derivatives] - The array of derivative values at the provided time.
  23945. */
  23946. addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void;
  23947. /**
  23948. * Adds multiple samples via parallel arrays.
  23949. * @param times - An array of JulianDate instances where each index is a sample time.
  23950. * @param positions - An array of Cartesian3 position instances, where each value corresponds to the provided time index.
  23951. * @param [derivatives] - An array where each value is another array containing derivatives for the corresponding time index.
  23952. */
  23953. addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void;
  23954. /**
  23955. * Adds samples as a single packed array where each new sample is represented as a date,
  23956. * followed by the packed representation of the corresponding value and derivatives.
  23957. * @param packedSamples - The array of packed samples.
  23958. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  23959. */
  23960. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  23961. /**
  23962. * Removes a sample at the given time, if present.
  23963. * @param time - The sample time.
  23964. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  23965. */
  23966. removeSample(time: JulianDate): boolean;
  23967. /**
  23968. * Removes all samples for the given time interval.
  23969. * @param time - The time interval for which to remove all samples.
  23970. */
  23971. removeSamples(time: TimeInterval): void;
  23972. /**
  23973. * Compares this property to the provided property and returns
  23974. * <code>true</code> if they are equal, <code>false</code> otherwise.
  23975. * @param [other] - The other property.
  23976. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  23977. */
  23978. equals(other?: Property): boolean;
  23979. }
  23980. /**
  23981. * A {@link Property} whose value is interpolated for a given time from the
  23982. * provided set of samples and specified interpolation algorithm and degree.
  23983. * @example
  23984. * //Create a linearly interpolated Cartesian2
  23985. * const property = new Cesium.SampledProperty(Cesium.Cartesian2);
  23986. *
  23987. * //Populate it with data
  23988. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));
  23989. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));
  23990. *
  23991. * //Retrieve an interpolated value
  23992. * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));
  23993. * @example
  23994. * //Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
  23995. * const property = new Cesium.SampledProperty(Number);
  23996. * property.setInterpolationOptions({
  23997. * interpolationDegree : 3,
  23998. * interpolationAlgorithm : Cesium.HermitePolynomialApproximation
  23999. * });
  24000. *
  24001. * //Populate it with data
  24002. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);
  24003. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);
  24004. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);
  24005. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);
  24006. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);
  24007. *
  24008. * //Samples can be added in any order.
  24009. * property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);
  24010. *
  24011. * //Retrieve an interpolated value
  24012. * const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));
  24013. * @param type - The type of property.
  24014. * @param [derivativeTypes] - When supplied, indicates that samples will contain derivative information of the specified types.
  24015. */
  24016. export class SampledProperty {
  24017. constructor(type: number | Packable, derivativeTypes?: Packable[]);
  24018. /**
  24019. * Gets a value indicating if this property is constant. A property is considered
  24020. * constant if getValue always returns the same result for the current definition.
  24021. */
  24022. readonly isConstant: boolean;
  24023. /**
  24024. * Gets the event that is raised whenever the definition of this property changes.
  24025. * The definition is considered to have changed if a call to getValue would return
  24026. * a different result for the same time.
  24027. */
  24028. readonly definitionChanged: Event;
  24029. /**
  24030. * Gets the type of property.
  24031. */
  24032. type: any;
  24033. /**
  24034. * Gets the derivative types used by this property.
  24035. */
  24036. derivativeTypes: Packable[];
  24037. /**
  24038. * Gets the degree of interpolation to perform when retrieving a value.
  24039. */
  24040. interpolationDegree: number;
  24041. /**
  24042. * Gets the interpolation algorithm to use when retrieving a value.
  24043. */
  24044. interpolationAlgorithm: InterpolationAlgorithm;
  24045. /**
  24046. * Gets or sets the type of extrapolation to perform when a value
  24047. * is requested at a time after any available samples.
  24048. */
  24049. forwardExtrapolationType: ExtrapolationType;
  24050. /**
  24051. * Gets or sets the amount of time to extrapolate forward before
  24052. * the property becomes undefined. A value of 0 will extrapolate forever.
  24053. */
  24054. forwardExtrapolationDuration: number;
  24055. /**
  24056. * Gets or sets the type of extrapolation to perform when a value
  24057. * is requested at a time before any available samples.
  24058. */
  24059. backwardExtrapolationType: ExtrapolationType;
  24060. /**
  24061. * Gets or sets the amount of time to extrapolate backward
  24062. * before the property becomes undefined. A value of 0 will extrapolate forever.
  24063. */
  24064. backwardExtrapolationDuration: number;
  24065. /**
  24066. * Gets the value of the property at the provided time.
  24067. * @param time - The time for which to retrieve the value.
  24068. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24069. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24070. */
  24071. getValue(time: JulianDate, result?: any): any;
  24072. /**
  24073. * Sets the algorithm and degree to use when interpolating a value.
  24074. * @param [options] - Object with the following properties:
  24075. * @param [options.interpolationAlgorithm] - The new interpolation algorithm. If undefined, the existing property will be unchanged.
  24076. * @param [options.interpolationDegree] - The new interpolation degree. If undefined, the existing property will be unchanged.
  24077. */
  24078. setInterpolationOptions(options?: {
  24079. interpolationAlgorithm?: InterpolationAlgorithm;
  24080. interpolationDegree?: number;
  24081. }): void;
  24082. /**
  24083. * Adds a new sample.
  24084. * @param time - The sample time.
  24085. * @param value - The value at the provided time.
  24086. * @param [derivatives] - The array of derivatives at the provided time.
  24087. */
  24088. addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void;
  24089. /**
  24090. * Adds an array of samples.
  24091. * @param times - An array of JulianDate instances where each index is a sample time.
  24092. * @param values - The array of values, where each value corresponds to the provided times index.
  24093. * @param [derivativeValues] - An array where each item is the array of derivatives at the equivalent time index.
  24094. */
  24095. addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void;
  24096. /**
  24097. * Adds samples as a single packed array where each new sample is represented as a date,
  24098. * followed by the packed representation of the corresponding value and derivatives.
  24099. * @param packedSamples - The array of packed samples.
  24100. * @param [epoch] - If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds.
  24101. */
  24102. addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void;
  24103. /**
  24104. * Removes a sample at the given time, if present.
  24105. * @param time - The sample time.
  24106. * @returns <code>true</code> if a sample at time was removed, <code>false</code> otherwise.
  24107. */
  24108. removeSample(time: JulianDate): boolean;
  24109. /**
  24110. * Removes all samples for the given time interval.
  24111. * @param time - The time interval for which to remove all samples.
  24112. */
  24113. removeSamples(time: TimeInterval): void;
  24114. /**
  24115. * Compares this property to the provided property and returns
  24116. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24117. * @param [other] - The other property.
  24118. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24119. */
  24120. equals(other?: Property): boolean;
  24121. }
  24122. /**
  24123. * A {@link MaterialProperty} that maps to stripe {@link Material} uniforms.
  24124. * @param [options] - Object with the following properties:
  24125. * @param [options.orientation = StripeOrientation.HORIZONTAL] - A Property specifying the {@link StripeOrientation}.
  24126. * @param [options.evenColor = Color.WHITE] - A Property specifying the first {@link Color}.
  24127. * @param [options.oddColor = Color.BLACK] - A Property specifying the second {@link Color}.
  24128. * @param [options.offset = 0] - A numeric Property specifying how far into the pattern to start the material.
  24129. * @param [options.repeat = 1] - A numeric Property specifying how many times the stripes repeat.
  24130. */
  24131. export class StripeMaterialProperty {
  24132. constructor(options?: {
  24133. orientation?: Property | StripeOrientation;
  24134. evenColor?: Property | Color;
  24135. oddColor?: Property | Color;
  24136. offset?: Property | number;
  24137. repeat?: Property | number;
  24138. });
  24139. /**
  24140. * Gets a value indicating if this property is constant. A property is considered
  24141. * constant if getValue always returns the same result for the current definition.
  24142. */
  24143. readonly isConstant: boolean;
  24144. /**
  24145. * Gets the event that is raised whenever the definition of this property changes.
  24146. * The definition is considered to have changed if a call to getValue would return
  24147. * a different result for the same time.
  24148. */
  24149. readonly definitionChanged: Event;
  24150. /**
  24151. * Gets or sets the Property specifying the {@link StripeOrientation}/
  24152. */
  24153. orientation: Property | undefined;
  24154. /**
  24155. * Gets or sets the Property specifying the first {@link Color}.
  24156. */
  24157. evenColor: Property | undefined;
  24158. /**
  24159. * Gets or sets the Property specifying the second {@link Color}.
  24160. */
  24161. oddColor: Property | undefined;
  24162. /**
  24163. * Gets or sets the numeric Property specifying the point into the pattern
  24164. * to begin drawing; with 0.0 being the beginning of the even color, 1.0 the beginning
  24165. * of the odd color, 2.0 being the even color again, and any multiple or fractional values
  24166. * being in between.
  24167. */
  24168. offset: Property | undefined;
  24169. /**
  24170. * Gets or sets the numeric Property specifying how many times the stripes repeat.
  24171. */
  24172. repeat: Property | undefined;
  24173. /**
  24174. * Gets the {@link Material} type at the provided time.
  24175. * @param time - The time for which to retrieve the type.
  24176. * @returns The type of material.
  24177. */
  24178. getType(time: JulianDate): string;
  24179. /**
  24180. * Gets the value of the property at the provided time.
  24181. * @param time - The time for which to retrieve the value.
  24182. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24183. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24184. */
  24185. getValue(time: JulianDate, result?: any): any;
  24186. /**
  24187. * Compares this property to the provided property and returns
  24188. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24189. * @param [other] - The other property.
  24190. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24191. */
  24192. equals(other?: Property): boolean;
  24193. }
  24194. /**
  24195. * Defined the orientation of stripes in {@link StripeMaterialProperty}.
  24196. */
  24197. export enum StripeOrientation {
  24198. /**
  24199. * Horizontal orientation.
  24200. */
  24201. HORIZONTAL = 0,
  24202. /**
  24203. * Vertical orientation.
  24204. */
  24205. VERTICAL = 1
  24206. }
  24207. /**
  24208. * A {@link TimeIntervalCollectionProperty} which is also a {@link PositionProperty}.
  24209. * @param [referenceFrame = ReferenceFrame.FIXED] - The reference frame in which the position is defined.
  24210. */
  24211. export class TimeIntervalCollectionPositionProperty {
  24212. constructor(referenceFrame?: ReferenceFrame);
  24213. /**
  24214. * Gets a value indicating if this property is constant. A property is considered
  24215. * constant if getValue always returns the same result for the current definition.
  24216. */
  24217. readonly isConstant: boolean;
  24218. /**
  24219. * Gets the event that is raised whenever the definition of this property changes.
  24220. * The definition is considered to have changed if a call to getValue would return
  24221. * a different result for the same time.
  24222. */
  24223. readonly definitionChanged: Event;
  24224. /**
  24225. * Gets the interval collection.
  24226. */
  24227. readonly intervals: TimeIntervalCollection;
  24228. /**
  24229. * Gets the reference frame in which the position is defined.
  24230. */
  24231. readonly referenceFrame: ReferenceFrame;
  24232. /**
  24233. * Gets the value of the property at the provided time in the fixed frame.
  24234. * @param time - The time for which to retrieve the value.
  24235. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24236. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24237. */
  24238. getValue(time: JulianDate, result?: any): Cartesian3 | undefined;
  24239. /**
  24240. * Gets the value of the property at the provided time and in the provided reference frame.
  24241. * @param time - The time for which to retrieve the value.
  24242. * @param referenceFrame - The desired referenceFrame of the result.
  24243. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24244. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24245. */
  24246. getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3 | undefined;
  24247. /**
  24248. * Compares this property to the provided property and returns
  24249. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24250. * @param [other] - The other property.
  24251. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24252. */
  24253. equals(other?: Property): boolean;
  24254. }
  24255. /**
  24256. * A {@link Property} which is defined by a {@link TimeIntervalCollection}, where the
  24257. * data property of each {@link TimeInterval} represents the value at time.
  24258. * @example
  24259. * //Create a Cartesian2 interval property which contains data on August 1st, 2012
  24260. * //and uses a different value every 6 hours.
  24261. * const composite = new Cesium.TimeIntervalCollectionProperty();
  24262. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24263. * iso8601 : '2012-08-01T00:00:00.00Z/2012-08-01T06:00:00.00Z',
  24264. * isStartIncluded : true,
  24265. * isStopIncluded : false,
  24266. * data : new Cesium.Cartesian2(2.0, 3.4)
  24267. * }));
  24268. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24269. * iso8601 : '2012-08-01T06:00:00.00Z/2012-08-01T12:00:00.00Z',
  24270. * isStartIncluded : true,
  24271. * isStopIncluded : false,
  24272. * data : new Cesium.Cartesian2(12.0, 2.7)
  24273. * }));
  24274. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24275. * iso8601 : '2012-08-01T12:00:00.00Z/2012-08-01T18:00:00.00Z',
  24276. * isStartIncluded : true,
  24277. * isStopIncluded : false,
  24278. * data : new Cesium.Cartesian2(5.0, 12.4)
  24279. * }));
  24280. * composite.intervals.addInterval(Cesium.TimeInterval.fromIso8601({
  24281. * iso8601 : '2012-08-01T18:00:00.00Z/2012-08-02T00:00:00.00Z',
  24282. * isStartIncluded : true,
  24283. * isStopIncluded : true,
  24284. * data : new Cesium.Cartesian2(85.0, 4.1)
  24285. * }));
  24286. */
  24287. export class TimeIntervalCollectionProperty {
  24288. constructor();
  24289. /**
  24290. * Gets a value indicating if this property is constant. A property is considered
  24291. * constant if getValue always returns the same result for the current definition.
  24292. */
  24293. readonly isConstant: boolean;
  24294. /**
  24295. * Gets the event that is raised whenever the definition of this property changes.
  24296. * The definition is changed whenever setValue is called with data different
  24297. * than the current value.
  24298. */
  24299. readonly definitionChanged: Event;
  24300. /**
  24301. * Gets the interval collection.
  24302. */
  24303. readonly intervals: TimeIntervalCollection;
  24304. /**
  24305. * Gets the value of the property at the provided time.
  24306. * @param time - The time for which to retrieve the value.
  24307. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24308. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24309. */
  24310. getValue(time: JulianDate, result?: any): any;
  24311. /**
  24312. * Compares this property to the provided property and returns
  24313. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24314. * @param [other] - The other property.
  24315. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24316. */
  24317. equals(other?: Property): boolean;
  24318. }
  24319. /**
  24320. * A {@link Property} which evaluates to a {@link Quaternion} rotation
  24321. * based on the velocity of the provided {@link PositionProperty}.
  24322. * @example
  24323. * //Create an entity with position and orientation.
  24324. * const position = new Cesium.SampledProperty();
  24325. * position.addSamples(...);
  24326. * const entity = viewer.entities.add({
  24327. * position : position,
  24328. * orientation : new Cesium.VelocityOrientationProperty(position)
  24329. * }));
  24330. * @param [position] - The position property used to compute the orientation.
  24331. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid used to determine which way is up.
  24332. */
  24333. export class VelocityOrientationProperty {
  24334. constructor(position?: PositionProperty, ellipsoid?: Ellipsoid);
  24335. /**
  24336. * Gets a value indicating if this property is constant.
  24337. */
  24338. readonly isConstant: boolean;
  24339. /**
  24340. * Gets the event that is raised whenever the definition of this property changes.
  24341. */
  24342. readonly definitionChanged: Event;
  24343. /**
  24344. * Gets or sets the position property used to compute orientation.
  24345. */
  24346. position: Property | undefined;
  24347. /**
  24348. * Gets or sets the ellipsoid used to determine which way is up.
  24349. */
  24350. ellipsoid: Property | undefined;
  24351. /**
  24352. * Gets the value of the property at the provided time.
  24353. * @param [time] - The time for which to retrieve the value.
  24354. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24355. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24356. */
  24357. getValue(time?: JulianDate, result?: Quaternion): Quaternion;
  24358. /**
  24359. * Compares this property to the provided property and returns
  24360. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24361. * @param [other] - The other property.
  24362. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24363. */
  24364. equals(other?: Property): boolean;
  24365. }
  24366. /**
  24367. * A {@link Property} which evaluates to a {@link Cartesian3} vector
  24368. * based on the velocity of the provided {@link PositionProperty}.
  24369. * @example
  24370. * //Create an entity with a billboard rotated to match its velocity.
  24371. * const position = new Cesium.SampledProperty();
  24372. * position.addSamples(...);
  24373. * const entity = viewer.entities.add({
  24374. * position : position,
  24375. * billboard : {
  24376. * image : 'image.png',
  24377. * alignedAxis : new Cesium.VelocityVectorProperty(position, true) // alignedAxis must be a unit vector
  24378. * }
  24379. * }));
  24380. * @param [position] - The position property used to compute the velocity.
  24381. * @param [normalize = true] - Whether to normalize the computed velocity vector.
  24382. */
  24383. export class VelocityVectorProperty {
  24384. constructor(position?: PositionProperty, normalize?: boolean);
  24385. /**
  24386. * Gets a value indicating if this property is constant.
  24387. */
  24388. readonly isConstant: boolean;
  24389. /**
  24390. * Gets the event that is raised whenever the definition of this property changes.
  24391. */
  24392. readonly definitionChanged: Event;
  24393. /**
  24394. * Gets or sets the position property used to compute the velocity vector.
  24395. */
  24396. position: Property | undefined;
  24397. /**
  24398. * Gets or sets whether the vector produced by this property
  24399. * will be normalized or not.
  24400. */
  24401. normalize: boolean;
  24402. /**
  24403. * Gets the value of the property at the provided time.
  24404. * @param [time] - The time for which to retrieve the value.
  24405. * @param [result] - The object to store the value into, if omitted, a new instance is created and returned.
  24406. * @returns The modified result parameter or a new instance if the result parameter was not supplied.
  24407. */
  24408. getValue(time?: JulianDate, result?: Cartesian3): Cartesian3;
  24409. /**
  24410. * Compares this property to the provided property and returns
  24411. * <code>true</code> if they are equal, <code>false</code> otherwise.
  24412. * @param [other] - The other property.
  24413. * @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
  24414. */
  24415. equals(other?: Property): boolean;
  24416. }
  24417. /**
  24418. * Defines the interface for visualizers. Visualizers are plug-ins to
  24419. * {@link DataSourceDisplay} that render data associated with
  24420. * {@link DataSource} instances.
  24421. * This object is an interface for documentation purposes and is not intended
  24422. * to be instantiated directly.
  24423. */
  24424. export class Visualizer {
  24425. constructor();
  24426. /**
  24427. * Updates the visualization to the provided time.
  24428. * @param time - The time.
  24429. * @returns True if the display was updated to the provided time,
  24430. * false if the visualizer is waiting for an asynchronous operation to
  24431. * complete before data can be updated.
  24432. */
  24433. update(time: JulianDate): boolean;
  24434. /**
  24435. * Returns true if this object was destroyed; otherwise, false.
  24436. * @returns True if this object was destroyed; otherwise, false.
  24437. */
  24438. isDestroyed(): boolean;
  24439. /**
  24440. * Removes all visualization and cleans up any resources associated with this instance.
  24441. */
  24442. destroy(): void;
  24443. }
  24444. /**
  24445. * A {@link GeometryUpdater} for walls.
  24446. * Clients do not normally create this class directly, but instead rely on {@link DataSourceDisplay}.
  24447. * @param entity - The entity containing the geometry to be visualized.
  24448. * @param scene - The scene where visualization is taking place.
  24449. */
  24450. export class WallGeometryUpdater {
  24451. constructor(entity: Entity, scene: Scene);
  24452. /**
  24453. * Creates the geometry instance which represents the fill of the geometry.
  24454. * @param time - The time to use when retrieving initial attribute values.
  24455. * @returns The geometry instance representing the filled portion of the geometry.
  24456. */
  24457. createFillGeometryInstance(time: JulianDate): GeometryInstance;
  24458. /**
  24459. * Creates the geometry instance which represents the outline of the geometry.
  24460. * @param time - The time to use when retrieving initial attribute values.
  24461. * @returns The geometry instance representing the outline portion of the geometry.
  24462. */
  24463. createOutlineGeometryInstance(time: JulianDate): GeometryInstance;
  24464. }
  24465. export namespace WallGraphics {
  24466. /**
  24467. * Initialization options for the WallGraphics constructor
  24468. * @property [show = true] - A boolean Property specifying the visibility of the wall.
  24469. * @property [positions] - A Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  24470. * @property [minimumHeights] - A Property specifying an array of heights to be used for the bottom of the wall instead of the globe surface.
  24471. * @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.
  24472. * @property [granularity = Cesium.Math.RADIANS_PER_DEGREE] - A numeric Property specifying the angular distance between each latitude and longitude point.
  24473. * @property [fill = true] - A boolean Property specifying whether the wall is filled with the provided material.
  24474. * @property [material = Color.WHITE] - A Property specifying the material used to fill the wall.
  24475. * @property [outline = false] - A boolean Property specifying whether the wall is outlined.
  24476. * @property [outlineColor = Color.BLACK] - A Property specifying the {@link Color} of the outline.
  24477. * @property [outlineWidth = 1.0] - A numeric Property specifying the width of the outline.
  24478. * @property [shadows = ShadowMode.DISABLED] - An enum Property specifying whether the wall casts or receives shadows from light sources.
  24479. * @property [distanceDisplayCondition] - A Property specifying at what distance from the camera that this wall will be displayed.
  24480. */
  24481. type ConstructorOptions = {
  24482. show?: Property | boolean;
  24483. positions?: Property | Cartesian3[];
  24484. minimumHeights?: Property | number[];
  24485. maximumHeights?: Property | number[];
  24486. granularity?: Property | number;
  24487. fill?: Property | boolean;
  24488. material?: MaterialProperty | Color;
  24489. outline?: Property | boolean;
  24490. outlineColor?: Property | Color;
  24491. outlineWidth?: Property | number;
  24492. shadows?: Property | ShadowMode;
  24493. distanceDisplayCondition?: Property | DistanceDisplayCondition;
  24494. };
  24495. }
  24496. /**
  24497. * Describes a two dimensional wall defined as a line strip and optional maximum and minimum heights.
  24498. * The wall conforms to the curvature of the globe and can be placed along the surface or at altitude.
  24499. * @param [options] - Object describing initialization options
  24500. */
  24501. export class WallGraphics {
  24502. constructor(options?: WallGraphics.ConstructorOptions);
  24503. /**
  24504. * Gets the event that is raised whenever a property or sub-property is changed or modified.
  24505. */
  24506. readonly definitionChanged: Event;
  24507. /**
  24508. * Gets or sets the boolean Property specifying the visibility of the wall.
  24509. */
  24510. show: Property | undefined;
  24511. /**
  24512. * Gets or sets the Property specifying the array of {@link Cartesian3} positions which define the top of the wall.
  24513. */
  24514. positions: Property | undefined;
  24515. /**
  24516. * 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.
  24517. * If defined, the array must be the same length as {@link Wall#positions}.
  24518. */
  24519. minimumHeights: Property | undefined;
  24520. /**
  24521. * 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.
  24522. * If defined, the array must be the same length as {@link Wall#positions}.
  24523. */
  24524. maximumHeights: Property | undefined;
  24525. /**
  24526. * Gets or sets the numeric Property specifying the angular distance between points on the wall.
  24527. */
  24528. granularity: Property | undefined;
  24529. /**
  24530. * Gets or sets the boolean Property specifying whether the wall is filled with the provided material.
  24531. */
  24532. fill: Property | undefined;
  24533. /**
  24534. * Gets or sets the Property specifying the material used to fill the wall.
  24535. */
  24536. material: MaterialProperty;
  24537. /**
  24538. * Gets or sets the Property specifying whether the wall is outlined.
  24539. */
  24540. outline: Property | undefined;
  24541. /**
  24542. * Gets or sets the Property specifying the {@link Color} of the outline.
  24543. */
  24544. outlineColor: Property | undefined;
  24545. /**
  24546. * Gets or sets the numeric Property specifying the width of the outline.
  24547. * <p>
  24548. * Note: This property will be ignored on all major browsers on Windows platforms. For details, see (@link https://github.com/CesiumGS/cesium/issues/40}.
  24549. * </p>
  24550. */
  24551. outlineWidth: Property | undefined;
  24552. /**
  24553. * Get or sets the enum Property specifying whether the wall
  24554. * casts or receives shadows from light sources.
  24555. */
  24556. shadows: Property | undefined;
  24557. /**
  24558. * Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this wall will be displayed.
  24559. */
  24560. distanceDisplayCondition: Property | undefined;
  24561. /**
  24562. * Duplicates this instance.
  24563. * @param [result] - The object onto which to store the result.
  24564. * @returns The modified result parameter or a new instance if one was not provided.
  24565. */
  24566. clone(result?: WallGraphics): WallGraphics;
  24567. /**
  24568. * Assigns each unassigned property on this object to the value
  24569. * of the same property on the provided source object.
  24570. * @param source - The object to be merged into this object.
  24571. */
  24572. merge(source: WallGraphics): void;
  24573. }
  24574. /**
  24575. * @property kml - The generated KML.
  24576. * @property externalFiles - An object dictionary of external files
  24577. */
  24578. export type exportKmlResultKml = {
  24579. kml: string;
  24580. externalFiles: {
  24581. [key: string]: Blob;
  24582. };
  24583. };
  24584. /**
  24585. * @property kmz - The generated kmz file.
  24586. */
  24587. export type exportKmlResultKmz = {
  24588. kmz: Blob;
  24589. };
  24590. /**
  24591. * Exports an EntityCollection as a KML document. Only Point, Billboard, Model, Path, Polygon, Polyline geometries
  24592. * will be exported. Note that there is not a 1 to 1 mapping of Entity properties to KML Feature properties. For
  24593. * example, entity properties that are time dynamic but cannot be dynamic in KML are exported with their values at
  24594. * options.time or the beginning of the EntityCollection's time interval if not specified. For time-dynamic properties
  24595. * that are supported in KML, we use the samples if it is a {@link SampledProperty} otherwise we sample the value using
  24596. * the options.sampleDuration. Point, Billboard, Model and Path geometries with time-dynamic positions will be exported
  24597. * as gx:Track Features. Not all Materials are representable in KML, so for more advanced Materials just the primary
  24598. * color is used. Canvas objects are exported as PNG images.
  24599. * @example
  24600. * Cesium.exportKml({
  24601. * entities: entityCollection
  24602. * })
  24603. * .then(function(result) {
  24604. * // The XML string is in result.kml
  24605. *
  24606. * const externalFiles = result.externalFiles
  24607. * for(const file in externalFiles) {
  24608. * // file is the name of the file used in the KML document as the href
  24609. * // externalFiles[file] is a blob with the contents of the file
  24610. * }
  24611. * });
  24612. * @param options - An object with the following properties:
  24613. * @param options.entities - The EntityCollection to export as KML.
  24614. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid for the output file.
  24615. * @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.
  24616. * @param [options.time = entities.computeAvailability().start] - The time value to use to get properties that are not time varying in KML.
  24617. * @param [options.defaultAvailability = entities.computeAvailability()] - The interval that will be sampled if an entity doesn't have an availability.
  24618. * @param [options.sampleDuration = 60] - The number of seconds to sample properties that are varying in KML.
  24619. * @param [options.kmz = false] - If true KML and external files will be compressed into a kmz file.
  24620. * @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.
  24621. */
  24622. export function exportKml(options: {
  24623. entities: EntityCollection;
  24624. ellipsoid?: Ellipsoid;
  24625. modelCallback?: exportKmlModelCallback;
  24626. time?: JulianDate;
  24627. defaultAvailability?: TimeInterval;
  24628. sampleDuration?: number;
  24629. kmz?: boolean;
  24630. }): Promise<exportKmlResultKml | exportKmlResultKmz>;
  24631. /**
  24632. * Since KML does not support glTF models, this callback is required to specify what URL to use for the model in the KML document.
  24633. * 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,
  24634. * or otherwise returned with the KML string when exporting.
  24635. * @param model - The ModelGraphics instance for an Entity.
  24636. * @param time - The time that any properties should use to get the value.
  24637. * @param externalFiles - An object that maps a filename to a Blob or a Promise that resolves to a Blob.
  24638. */
  24639. export type exportKmlModelCallback = (model: ModelGraphics, time: JulianDate, externalFiles: any) => string;
  24640. /**
  24641. * The data type of a pixel.
  24642. */
  24643. export enum PixelDatatype {
  24644. UNSIGNED_BYTE = WebGLConstants.UNSIGNED_BYTE,
  24645. UNSIGNED_SHORT = WebGLConstants.UNSIGNED_SHORT,
  24646. UNSIGNED_INT = WebGLConstants.UNSIGNED_INT,
  24647. FLOAT = WebGLConstants.FLOAT,
  24648. HALF_FLOAT = WebGLConstants.HALF_FLOAT_OES,
  24649. UNSIGNED_INT_24_8 = WebGLConstants.UNSIGNED_INT_24_8,
  24650. UNSIGNED_SHORT_4_4_4_4 = WebGLConstants.UNSIGNED_SHORT_4_4_4_4,
  24651. UNSIGNED_SHORT_5_5_5_1 = WebGLConstants.UNSIGNED_SHORT_5_5_5_1,
  24652. UNSIGNED_SHORT_5_6_5 = WebGLConstants.UNSIGNED_SHORT_5_6_5
  24653. }
  24654. /**
  24655. * Enumerates all possible filters used when magnifying WebGL textures.
  24656. */
  24657. export enum TextureMagnificationFilter {
  24658. /**
  24659. * Samples the texture by returning the closest pixel.
  24660. */
  24661. NEAREST = WebGLConstants.NEAREST,
  24662. /**
  24663. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  24664. */
  24665. LINEAR = WebGLConstants.LINEAR
  24666. }
  24667. /**
  24668. * Enumerates all possible filters used when minifying WebGL textures.
  24669. */
  24670. export enum TextureMinificationFilter {
  24671. /**
  24672. * Samples the texture by returning the closest pixel.
  24673. */
  24674. NEAREST = WebGLConstants.NEAREST,
  24675. /**
  24676. * Samples the texture through bi-linear interpolation of the four nearest pixels. This produces smoother results than <code>NEAREST</code> filtering.
  24677. */
  24678. LINEAR = WebGLConstants.LINEAR,
  24679. /**
  24680. * Selects the nearest mip level and applies nearest sampling within that level.
  24681. * <p>
  24682. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24683. * </p>
  24684. */
  24685. NEAREST_MIPMAP_NEAREST = WebGLConstants.NEAREST_MIPMAP_NEAREST,
  24686. /**
  24687. * Selects the nearest mip level and applies linear sampling within that level.
  24688. * <p>
  24689. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24690. * </p>
  24691. */
  24692. LINEAR_MIPMAP_NEAREST = WebGLConstants.LINEAR_MIPMAP_NEAREST,
  24693. /**
  24694. * Read texture values with nearest sampling from two adjacent mip levels and linearly interpolate the results.
  24695. * <p>
  24696. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  24697. * </p>
  24698. * <p>
  24699. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24700. * </p>
  24701. */
  24702. NEAREST_MIPMAP_LINEAR = WebGLConstants.NEAREST_MIPMAP_LINEAR,
  24703. /**
  24704. * Read texture values with linear sampling from two adjacent mip levels and linearly interpolate the results.
  24705. * <p>
  24706. * This option provides a good balance of visual quality and speed when sampling from a mipmapped texture.
  24707. * </p>
  24708. * <p>
  24709. * Requires that the texture has a mipmap. The mip level is chosen by the view angle and screen-space size of the texture.
  24710. * </p>
  24711. */
  24712. LINEAR_MIPMAP_LINEAR = WebGLConstants.LINEAR_MIPMAP_LINEAR
  24713. }
  24714. /**
  24715. * An appearance defines the full GLSL vertex and fragment shaders and the
  24716. * render state used to draw a {@link Primitive}. All appearances implement
  24717. * this base <code>Appearance</code> interface.
  24718. * @param [options] - Object with the following properties:
  24719. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link Appearance#renderState} has alpha blending enabled.
  24720. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link Appearance#renderState} has backface culling enabled.
  24721. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  24722. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  24723. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  24724. * @param [options.renderState] - Optional render state to override the default render state.
  24725. */
  24726. export class Appearance {
  24727. constructor(options?: {
  24728. translucent?: boolean;
  24729. closed?: boolean;
  24730. material?: Material;
  24731. vertexShaderSource?: string;
  24732. fragmentShaderSource?: string;
  24733. renderState?: any;
  24734. });
  24735. /**
  24736. * The material used to determine the fragment color. Unlike other {@link Appearance}
  24737. * properties, this is not read-only, so an appearance's material can change on the fly.
  24738. */
  24739. material: Material;
  24740. /**
  24741. * When <code>true</code>, the geometry is expected to appear translucent.
  24742. */
  24743. translucent: boolean;
  24744. /**
  24745. * The GLSL source code for the vertex shader.
  24746. */
  24747. readonly vertexShaderSource: string;
  24748. /**
  24749. * The GLSL source code for the fragment shader. The full fragment shader
  24750. * source is built procedurally taking into account the {@link Appearance#material}.
  24751. * Use {@link Appearance#getFragmentShaderSource} to get the full source.
  24752. */
  24753. readonly fragmentShaderSource: string;
  24754. /**
  24755. * The WebGL fixed-function state to use when rendering the geometry.
  24756. */
  24757. readonly renderState: any;
  24758. /**
  24759. * When <code>true</code>, the geometry is expected to be closed.
  24760. */
  24761. readonly closed: boolean;
  24762. /**
  24763. * Procedurally creates the full GLSL fragment shader source for this appearance
  24764. * taking into account {@link Appearance#fragmentShaderSource} and {@link Appearance#material}.
  24765. * @returns The full GLSL fragment shader source.
  24766. */
  24767. getFragmentShaderSource(): string;
  24768. /**
  24769. * Determines if the geometry is translucent based on {@link Appearance#translucent} and {@link Material#isTranslucent}.
  24770. * @returns <code>true</code> if the appearance is translucent.
  24771. */
  24772. isTranslucent(): boolean;
  24773. /**
  24774. * Creates a render state. This is not the final render state instance; instead,
  24775. * it can contain a subset of render state properties identical to the render state
  24776. * created in the context.
  24777. * @returns The render state.
  24778. */
  24779. getRenderState(): any;
  24780. }
  24781. export namespace ArcGisMapServerImageryProvider {
  24782. /**
  24783. * Initialization options for the ArcGisMapServerImageryProvider constructor
  24784. * @property url - The URL of the ArcGIS MapServer service.
  24785. * @property [token] - The ArcGIS token used to authenticate with the ArcGIS MapServer service.
  24786. * @property [tileDiscardPolicy] - The policy that determines if a tile
  24787. * is invalid and should be discarded. If this value is not specified, a default
  24788. * {@link DiscardMissingTileImagePolicy} is used for tiled map servers, and a
  24789. * {@link NeverTileDiscardPolicy} is used for non-tiled map servers. In the former case,
  24790. * we request tile 0,0 at the maximum tile level and check pixels (0,0), (200,20), (20,200),
  24791. * (80,110), and (160, 130). If all of these pixels are transparent, the discard check is
  24792. * disabled and no tiles are discarded. If any of them have a non-transparent color, any
  24793. * tile that has the same values in these pixel locations is discarded. The end result of
  24794. * these defaults should be correct tile discarding for a standard ArcGIS Server. To ensure
  24795. * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this
  24796. * parameter.
  24797. * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached
  24798. * tiles are used if they are available. If false, any pre-cached tiles are ignored and the
  24799. * 'export' service is used.
  24800. * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown.
  24801. * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke
  24802. * the Identify service on the MapServer and return the features included in the response. If false,
  24803. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24804. * without communicating with the server. Set this property to false if you don't want this provider's features to
  24805. * be pickable. Can be overridden by setting the {@link ArcGisMapServerImageryProvider#enablePickFeatures} property on the object.
  24806. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer. This parameter is ignored when accessing
  24807. * a tiled layer.
  24808. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  24809. * This parameter is ignored when accessing a tiled server.
  24810. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified and used,
  24811. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  24812. * parameter is specified, the WGS84 ellipsoid is used.
  24813. * @property [credit] - A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.
  24814. * @property [tileWidth = 256] - The width of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24815. * @property [tileHeight = 256] - The height of each tile in pixels. This parameter is ignored when accessing a tiled server.
  24816. * @property [maximumLevel] - The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing
  24817. * a tiled server.
  24818. */
  24819. type ConstructorOptions = {
  24820. url: Resource | string;
  24821. token?: string;
  24822. tileDiscardPolicy?: TileDiscardPolicy;
  24823. usePreCachedTilesIfAvailable?: boolean;
  24824. layers?: string;
  24825. enablePickFeatures?: boolean;
  24826. rectangle?: Rectangle;
  24827. tilingScheme?: TilingScheme;
  24828. ellipsoid?: Ellipsoid;
  24829. credit?: Credit | string;
  24830. tileWidth?: number;
  24831. tileHeight?: number;
  24832. maximumLevel?: number;
  24833. };
  24834. }
  24835. /**
  24836. * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
  24837. * used, if available.
  24838. * @example
  24839. * const esri = new Cesium.ArcGisMapServerImageryProvider({
  24840. * url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
  24841. * });
  24842. * @param options - Object describing initialization options
  24843. */
  24844. export class ArcGisMapServerImageryProvider {
  24845. constructor(options: ArcGisMapServerImageryProvider.ConstructorOptions);
  24846. /**
  24847. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  24848. * 1.0 representing fully opaque.
  24849. */
  24850. defaultAlpha: number | undefined;
  24851. /**
  24852. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  24853. * 1.0 representing fully opaque.
  24854. */
  24855. defaultNightAlpha: number | undefined;
  24856. /**
  24857. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  24858. * 1.0 representing fully opaque.
  24859. */
  24860. defaultDayAlpha: number | undefined;
  24861. /**
  24862. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  24863. * makes the imagery darker while greater than 1.0 makes it brighter.
  24864. */
  24865. defaultBrightness: number | undefined;
  24866. /**
  24867. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  24868. * the contrast while greater than 1.0 increases it.
  24869. */
  24870. defaultContrast: number | undefined;
  24871. /**
  24872. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  24873. */
  24874. defaultHue: number | undefined;
  24875. /**
  24876. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  24877. * saturation while greater than 1.0 increases it.
  24878. */
  24879. defaultSaturation: number | undefined;
  24880. /**
  24881. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  24882. */
  24883. defaultGamma: number | undefined;
  24884. /**
  24885. * The default texture minification filter to apply to this provider.
  24886. */
  24887. defaultMinificationFilter: TextureMinificationFilter;
  24888. /**
  24889. * The default texture magnification filter to apply to this provider.
  24890. */
  24891. defaultMagnificationFilter: TextureMagnificationFilter;
  24892. /**
  24893. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will
  24894. * invoke the "identify" operation on the ArcGIS server and return the features included in the response. If false,
  24895. * {@link ArcGisMapServerImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  24896. * without communicating with the server.
  24897. */
  24898. enablePickFeatures: boolean;
  24899. /**
  24900. * Gets the URL of the ArcGIS MapServer.
  24901. */
  24902. readonly url: string;
  24903. /**
  24904. * Gets the ArcGIS token used to authenticate with the ArcGis MapServer service.
  24905. */
  24906. readonly token: string;
  24907. /**
  24908. * Gets the proxy used by this provider.
  24909. */
  24910. readonly proxy: Proxy;
  24911. /**
  24912. * Gets the width of each tile, in pixels. This function should
  24913. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24914. */
  24915. readonly tileWidth: number;
  24916. /**
  24917. * Gets the height of each tile, in pixels. This function should
  24918. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24919. */
  24920. readonly tileHeight: number;
  24921. /**
  24922. * Gets the maximum level-of-detail that can be requested. This function should
  24923. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24924. */
  24925. readonly maximumLevel: number | undefined;
  24926. /**
  24927. * Gets the minimum level-of-detail that can be requested. This function should
  24928. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24929. */
  24930. readonly minimumLevel: number;
  24931. /**
  24932. * Gets the tiling scheme used by this provider. This function should
  24933. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24934. */
  24935. readonly tilingScheme: TilingScheme;
  24936. /**
  24937. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  24938. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24939. */
  24940. readonly rectangle: Rectangle;
  24941. /**
  24942. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  24943. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  24944. * returns undefined, no tiles are filtered. This function should
  24945. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24946. */
  24947. readonly tileDiscardPolicy: TileDiscardPolicy;
  24948. /**
  24949. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  24950. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  24951. * are passed an instance of {@link TileProviderError}.
  24952. */
  24953. readonly errorEvent: Event;
  24954. /**
  24955. * Gets a value indicating whether or not the provider is ready for use.
  24956. */
  24957. readonly ready: boolean;
  24958. /**
  24959. * Gets a promise that resolves to true when the provider is ready for use.
  24960. */
  24961. readonly readyPromise: Promise<boolean>;
  24962. /**
  24963. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  24964. * the source of the imagery. This function should not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24965. */
  24966. readonly credit: Credit;
  24967. /**
  24968. * Gets a value indicating whether this imagery provider is using pre-cached tiles from the
  24969. * ArcGIS MapServer. If the imagery provider is not yet ready ({@link ArcGisMapServerImageryProvider#ready}), this function
  24970. * will return the value of `options.usePreCachedTilesIfAvailable`, even if the MapServer does
  24971. * not have pre-cached tiles.
  24972. */
  24973. readonly usingPrecachedTiles: boolean;
  24974. /**
  24975. * Gets a value indicating whether or not the images provided by this imagery provider
  24976. * include an alpha channel. If this property is false, an alpha channel, if present, will
  24977. * be ignored. If this property is true, any images without an alpha channel will be treated
  24978. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  24979. * and texture upload time are reduced.
  24980. */
  24981. readonly hasAlphaChannel: boolean;
  24982. /**
  24983. * Gets the comma-separated list of layer IDs to show.
  24984. */
  24985. layers: string;
  24986. /**
  24987. * Gets the credits to be displayed when a given tile is displayed.
  24988. * @param x - The tile X coordinate.
  24989. * @param y - The tile Y coordinate.
  24990. * @param level - The tile level;
  24991. * @returns The credits to be displayed when the tile is displayed.
  24992. */
  24993. getTileCredits(x: number, y: number, level: number): Credit[];
  24994. /**
  24995. * Requests the image for a given tile. This function should
  24996. * not be called before {@link ArcGisMapServerImageryProvider#ready} returns true.
  24997. * @param x - The tile X coordinate.
  24998. * @param y - The tile Y coordinate.
  24999. * @param level - The tile level.
  25000. * @param [request] - The request object. Intended for internal use only.
  25001. * @returns A promise for the image that will resolve when the image is available, or
  25002. * undefined if there are too many active requests to the server, and the request should be retried later.
  25003. */
  25004. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  25005. /**
  25006. * /**
  25007. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  25008. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  25009. * @param x - The tile X coordinate.
  25010. * @param y - The tile Y coordinate.
  25011. * @param level - The tile level.
  25012. * @param longitude - The longitude at which to pick features.
  25013. * @param latitude - The latitude at which to pick features.
  25014. * @returns A promise for the picked features that will resolve when the asynchronous
  25015. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  25016. * instances. The array may be empty if no features are found at the given location.
  25017. */
  25018. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  25019. }
  25020. /**
  25021. * An enum describing the x, y, and z axes and helper conversion functions.
  25022. */
  25023. export enum Axis {
  25024. /**
  25025. * Denotes the x-axis.
  25026. */
  25027. X = 0,
  25028. /**
  25029. * Denotes the y-axis.
  25030. */
  25031. Y = 1,
  25032. /**
  25033. * Denotes the z-axis.
  25034. */
  25035. Z = 2
  25036. }
  25037. /**
  25038. * A viewport-aligned image positioned in the 3D scene, that is created
  25039. * and rendered using a {@link BillboardCollection}. A billboard is created and its initial
  25040. * properties are set by calling {@link BillboardCollection#add}.
  25041. * <br /><br />
  25042. * <div align='center'>
  25043. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  25044. * Example billboards
  25045. * </div>
  25046. */
  25047. export class Billboard {
  25048. constructor();
  25049. /**
  25050. * Determines if this billboard will be shown. Use this to hide or show a billboard, instead
  25051. * of removing it and re-adding it to the collection.
  25052. */
  25053. show: boolean;
  25054. /**
  25055. * Gets or sets the Cartesian position of this billboard.
  25056. */
  25057. position: Cartesian3;
  25058. /**
  25059. * Gets or sets the height reference of this billboard.
  25060. */
  25061. heightReference: HeightReference;
  25062. /**
  25063. * Gets or sets the pixel offset in screen space from the origin of this billboard. This is commonly used
  25064. * to align multiple billboards and labels at the same position, e.g., an image and text. The
  25065. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  25066. * left to right, and <code>y</code> increases from top to bottom.
  25067. * <br /><br />
  25068. * <div align='center'>
  25069. * <table border='0' cellpadding='5'><tr>
  25070. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setPixelOffset.default.png' width='250' height='188' /></td>
  25071. * <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>
  25072. * </tr></table>
  25073. * The billboard's origin is indicated by the yellow point.
  25074. * </div>
  25075. */
  25076. pixelOffset: Cartesian2;
  25077. /**
  25078. * Gets or sets near and far scaling properties of a Billboard based on the billboard's distance from the camera.
  25079. * A billboard's scale will interpolate between the {@link NearFarScalar#nearValue} and
  25080. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25081. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25082. * Outside of these ranges the billboard's scale remains clamped to the nearest bound. If undefined,
  25083. * scaleByDistance will be disabled.
  25084. * @example
  25085. * // Example 1.
  25086. * // Set a billboard's scaleByDistance to scale by 1.5 when the
  25087. * // camera is 1500 meters from the billboard and disappear as
  25088. * // the camera distance approaches 8.0e6 meters.
  25089. * b.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  25090. * @example
  25091. * // Example 2.
  25092. * // disable scaling by distance
  25093. * b.scaleByDistance = undefined;
  25094. */
  25095. scaleByDistance: NearFarScalar;
  25096. /**
  25097. * Gets or sets near and far translucency properties of a Billboard based on the billboard's distance from the camera.
  25098. * A billboard's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  25099. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25100. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25101. * Outside of these ranges the billboard's translucency remains clamped to the nearest bound. If undefined,
  25102. * translucencyByDistance will be disabled.
  25103. * @example
  25104. * // Example 1.
  25105. * // Set a billboard's translucency to 1.0 when the
  25106. * // camera is 1500 meters from the billboard and disappear as
  25107. * // the camera distance approaches 8.0e6 meters.
  25108. * b.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  25109. * @example
  25110. * // Example 2.
  25111. * // disable translucency by distance
  25112. * b.translucencyByDistance = undefined;
  25113. */
  25114. translucencyByDistance: NearFarScalar;
  25115. /**
  25116. * Gets or sets near and far pixel offset scaling properties of a Billboard based on the billboard's distance from the camera.
  25117. * A billboard's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  25118. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  25119. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  25120. * Outside of these ranges the billboard's pixel offset scale remains clamped to the nearest bound. If undefined,
  25121. * pixelOffsetScaleByDistance will be disabled.
  25122. * @example
  25123. * // Example 1.
  25124. * // Set a billboard's pixel offset scale to 0.0 when the
  25125. * // camera is 1500 meters from the billboard and scale pixel offset to 10.0 pixels
  25126. * // in the y direction the camera distance approaches 8.0e6 meters.
  25127. * b.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  25128. * b.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  25129. * @example
  25130. * // Example 2.
  25131. * // disable pixel offset by distance
  25132. * b.pixelOffsetScaleByDistance = undefined;
  25133. */
  25134. pixelOffsetScaleByDistance: NearFarScalar;
  25135. /**
  25136. * Gets or sets the 3D Cartesian offset applied to this billboard in eye coordinates. Eye coordinates is a left-handed
  25137. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  25138. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  25139. * which is typically meters.
  25140. * <br /><br />
  25141. * An eye offset is commonly used to arrange multiple billboards or objects at the same position, e.g., to
  25142. * arrange a billboard above its corresponding 3D model.
  25143. * <br /><br />
  25144. * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always
  25145. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  25146. * <br /><br />
  25147. * <div align='center'>
  25148. * <table border='0' cellpadding='5'><tr>
  25149. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  25150. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  25151. * </tr></table>
  25152. * <code>b.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  25153. * </div>
  25154. */
  25155. eyeOffset: Cartesian3;
  25156. /**
  25157. * Gets or sets the horizontal origin of this billboard, which determines if the billboard is
  25158. * to the left, center, or right of its anchor position.
  25159. * <br /><br />
  25160. * <div align='center'>
  25161. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  25162. * </div>
  25163. * @example
  25164. * // Use a bottom, left origin
  25165. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  25166. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  25167. */
  25168. horizontalOrigin: HorizontalOrigin;
  25169. /**
  25170. * Gets or sets the vertical origin of this billboard, which determines if the billboard is
  25171. * to the above, below, or at the center of its anchor position.
  25172. * <br /><br />
  25173. * <div align='center'>
  25174. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  25175. * </div>
  25176. * @example
  25177. * // Use a bottom, left origin
  25178. * b.horizontalOrigin = Cesium.HorizontalOrigin.LEFT;
  25179. * b.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;
  25180. */
  25181. verticalOrigin: VerticalOrigin;
  25182. /**
  25183. * Gets or sets the uniform scale that is multiplied with the billboard's image size in pixels.
  25184. * A scale of <code>1.0</code> does not change the size of the billboard; a scale greater than
  25185. * <code>1.0</code> enlarges the billboard; a positive scale less than <code>1.0</code> shrinks
  25186. * the billboard.
  25187. * <br /><br />
  25188. * <div align='center'>
  25189. * <img src='Images/Billboard.setScale.png' width='400' height='300' /><br/>
  25190. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  25191. * and <code>2.0</code>.
  25192. * </div>
  25193. */
  25194. scale: number;
  25195. /**
  25196. * Gets or sets the color that is multiplied with the billboard's texture. This has two common use cases. First,
  25197. * the same white texture may be used by many different billboards, each with a different color, to create
  25198. * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below.
  25199. * An alpha of <code>0.0</code> makes the billboard transparent, and <code>1.0</code> makes the billboard opaque.
  25200. * <br /><br />
  25201. * <div align='center'>
  25202. * <table border='0' cellpadding='5'><tr>
  25203. * <td align='center'><code>default</code><br/><img src='Images/Billboard.setColor.Alpha255.png' width='250' height='188' /></td>
  25204. * <td align='center'><code>alpha : 0.5</code><br/><img src='Images/Billboard.setColor.Alpha127.png' width='250' height='188' /></td>
  25205. * </tr></table>
  25206. * </div>
  25207. * <br />
  25208. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  25209. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  25210. * (no intensity) to <code>1.0</code> (full intensity).
  25211. * @example
  25212. * // Example 1. Assign yellow.
  25213. * b.color = Cesium.Color.YELLOW;
  25214. * @example
  25215. * // Example 2. Make a billboard 50% translucent.
  25216. * b.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  25217. */
  25218. color: Color;
  25219. /**
  25220. * Gets or sets the rotation angle in radians.
  25221. */
  25222. rotation: number;
  25223. /**
  25224. * Gets or sets the aligned axis in world space. The aligned axis is the unit vector that the billboard up vector points towards.
  25225. * The default is the zero vector, which means the billboard is aligned to the screen up vector.
  25226. * @example
  25227. * // Example 1.
  25228. * // Have the billboard up vector point north
  25229. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  25230. * @example
  25231. * // Example 2.
  25232. * // Have the billboard point east.
  25233. * billboard.alignedAxis = Cesium.Cartesian3.UNIT_Z;
  25234. * billboard.rotation = -Cesium.Math.PI_OVER_TWO;
  25235. * @example
  25236. * // Example 3.
  25237. * // Reset the aligned axis
  25238. * billboard.alignedAxis = Cesium.Cartesian3.ZERO;
  25239. */
  25240. alignedAxis: Cartesian3;
  25241. /**
  25242. * Gets or sets a width for the billboard. If undefined, the image width will be used.
  25243. */
  25244. width: number;
  25245. /**
  25246. * Gets or sets a height for the billboard. If undefined, the image height will be used.
  25247. */
  25248. height: number;
  25249. /**
  25250. * Gets or sets if the billboard size is in meters or pixels. <code>true</code> to size the billboard in meters;
  25251. * otherwise, the size is in pixels.
  25252. */
  25253. sizeInMeters: boolean;
  25254. /**
  25255. * Gets or sets the condition specifying at what distance from the camera that this billboard will be displayed.
  25256. */
  25257. distanceDisplayCondition: DistanceDisplayCondition;
  25258. /**
  25259. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  25260. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  25261. */
  25262. disableDepthTestDistance: number;
  25263. /**
  25264. * Gets or sets the user-defined object returned when the billboard is picked.
  25265. */
  25266. id: any;
  25267. /**
  25268. * <p>
  25269. * Gets or sets the image to be used for this billboard. If a texture has already been created for the
  25270. * given image, the existing texture is used.
  25271. * </p>
  25272. * <p>
  25273. * This property can be set to a loaded Image, a URL which will be loaded as an Image automatically,
  25274. * a canvas, or another billboard's image property (from the same billboard collection).
  25275. * </p>
  25276. * @example
  25277. * // load an image from a URL
  25278. * b.image = 'some/image/url.png';
  25279. *
  25280. * // assuming b1 and b2 are billboards in the same billboard collection,
  25281. * // use the same image for both billboards.
  25282. * b2.image = b1.image;
  25283. */
  25284. image: string;
  25285. /**
  25286. * When <code>true</code>, this billboard is ready to render, i.e., the image
  25287. * has been downloaded and the WebGL resources are created.
  25288. */
  25289. readonly ready: boolean;
  25290. /**
  25291. * <p>
  25292. * Sets the image to be used for this billboard. If a texture has already been created for the
  25293. * given id, the existing texture is used.
  25294. * </p>
  25295. * <p>
  25296. * This function is useful for dynamically creating textures that are shared across many billboards.
  25297. * Only the first billboard will actually call the function and create the texture, while subsequent
  25298. * billboards created with the same id will simply re-use the existing texture.
  25299. * </p>
  25300. * <p>
  25301. * To load an image from a URL, setting the {@link Billboard#image} property is more convenient.
  25302. * </p>
  25303. * @example
  25304. * // create a billboard image dynamically
  25305. * function drawImage(id) {
  25306. * // create and draw an image using a canvas
  25307. * const canvas = document.createElement('canvas');
  25308. * const context2D = canvas.getContext('2d');
  25309. * // ... draw image
  25310. * return canvas;
  25311. * }
  25312. * // drawImage will be called to create the texture
  25313. * b.setImage('myImage', drawImage);
  25314. *
  25315. * // subsequent billboards created in the same collection using the same id will use the existing
  25316. * // texture, without the need to create the canvas or draw the image
  25317. * b2.setImage('myImage', drawImage);
  25318. * @param id - The id of the image. This can be any string that uniquely identifies the image.
  25319. * @param image - The image to load. This parameter
  25320. * can either be a loaded Image or Canvas, a URL which will be loaded as an Image automatically,
  25321. * or a function which will be called to create the image if it hasn't been loaded already.
  25322. */
  25323. setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Resource | Billboard.CreateImageCallback): void;
  25324. /**
  25325. * Uses a sub-region of the image with the given id as the image for this billboard,
  25326. * measured in pixels from the bottom-left.
  25327. * @param id - The id of the image to use.
  25328. * @param subRegion - The sub-region of the image.
  25329. */
  25330. setImageSubRegion(id: string, subRegion: BoundingRectangle): void;
  25331. /**
  25332. * Computes the screen-space position of the billboard's origin, taking into account eye and pixel offsets.
  25333. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  25334. * left to right, and <code>y</code> increases from top to bottom.
  25335. * @example
  25336. * console.log(b.computeScreenSpacePosition(scene).toString());
  25337. * @param scene - The scene.
  25338. * @param [result] - The object onto which to store the result.
  25339. * @returns The screen-space position of the billboard.
  25340. */
  25341. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  25342. /**
  25343. * Determines if this billboard equals another billboard. Billboards are equal if all their properties
  25344. * are equal. Billboards in different collections can be equal.
  25345. * @param other - The billboard to compare for equality.
  25346. * @returns <code>true</code> if the billboards are equal; otherwise, <code>false</code>.
  25347. */
  25348. equals(other: Billboard): boolean;
  25349. }
  25350. export namespace Billboard {
  25351. /**
  25352. * A function that creates an image.
  25353. * @param id - The identifier of the image to load.
  25354. */
  25355. type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise<HTMLImageElement | HTMLCanvasElement>;
  25356. }
  25357. /**
  25358. * A renderable collection of billboards. Billboards are viewport-aligned
  25359. * images positioned in the 3D scene.
  25360. * <br /><br />
  25361. * <div align='center'>
  25362. * <img src='Images/Billboard.png' width='400' height='300' /><br />
  25363. * Example billboards
  25364. * </div>
  25365. * <br /><br />
  25366. * Billboards are added and removed from the collection using {@link BillboardCollection#add}
  25367. * and {@link BillboardCollection#remove}. Billboards in a collection automatically share textures
  25368. * for images with the same identifier.
  25369. * @example
  25370. * // Create a billboard collection with two billboards
  25371. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  25372. * billboards.add({
  25373. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  25374. * image : 'url/to/image'
  25375. * });
  25376. * billboards.add({
  25377. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  25378. * image : 'url/to/another/image'
  25379. * });
  25380. * @param [options] - Object with the following properties:
  25381. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each billboard from model to world coordinates.
  25382. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  25383. * @param [options.scene] - Must be passed in for billboards that use the height reference property or will be depth tested against the globe.
  25384. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The billboard blending option. The default
  25385. * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent,
  25386. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  25387. * @param [options.show = true] - Determines if the billboards in the collection will be shown.
  25388. */
  25389. export class BillboardCollection {
  25390. constructor(options?: {
  25391. modelMatrix?: Matrix4;
  25392. debugShowBoundingVolume?: boolean;
  25393. scene?: Scene;
  25394. blendOption?: BlendOption;
  25395. show?: boolean;
  25396. });
  25397. /**
  25398. * Determines if billboards in this collection will be shown.
  25399. */
  25400. show: boolean;
  25401. /**
  25402. * The 4x4 transformation matrix that transforms each billboard in this collection from model to world coordinates.
  25403. * When this is the identity matrix, the billboards are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  25404. * Local reference frames can be used by providing a different transformation matrix, like that returned
  25405. * by {@link Transforms.eastNorthUpToFixedFrame}.
  25406. * @example
  25407. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  25408. * billboards.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  25409. * billboards.add({
  25410. * image : 'url/to/image',
  25411. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  25412. * });
  25413. * billboards.add({
  25414. * image : 'url/to/image',
  25415. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  25416. * });
  25417. * billboards.add({
  25418. * image : 'url/to/image',
  25419. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  25420. * });
  25421. * billboards.add({
  25422. * image : 'url/to/image',
  25423. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  25424. * });
  25425. */
  25426. modelMatrix: Matrix4;
  25427. /**
  25428. * This property is for debugging only; it is not for production use nor is it optimized.
  25429. * <p>
  25430. * Draws the bounding sphere for each draw command in the primitive.
  25431. * </p>
  25432. */
  25433. debugShowBoundingVolume: boolean;
  25434. /**
  25435. * This property is for debugging only; it is not for production use nor is it optimized.
  25436. * <p>
  25437. * Draws the texture atlas for this BillboardCollection as a fullscreen quad.
  25438. * </p>
  25439. */
  25440. debugShowTextureAtlas: boolean;
  25441. /**
  25442. * The billboard blending option. The default is used for rendering both opaque and translucent billboards.
  25443. * However, if either all of the billboards are completely opaque or all are completely translucent,
  25444. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  25445. * performance by up to 2x.
  25446. */
  25447. blendOption: BlendOption;
  25448. /**
  25449. * Returns the number of billboards in this collection. This is commonly used with
  25450. * {@link BillboardCollection#get} to iterate over all the billboards
  25451. * in the collection.
  25452. */
  25453. length: number;
  25454. /**
  25455. * Creates and adds a billboard with the specified initial properties to the collection.
  25456. * The added billboard is returned so it can be modified or removed from the collection later.
  25457. * @example
  25458. * // Example 1: Add a billboard, specifying all the default values.
  25459. * const b = billboards.add({
  25460. * show : true,
  25461. * position : Cesium.Cartesian3.ZERO,
  25462. * pixelOffset : Cesium.Cartesian2.ZERO,
  25463. * eyeOffset : Cesium.Cartesian3.ZERO,
  25464. * heightReference : Cesium.HeightReference.NONE,
  25465. * horizontalOrigin : Cesium.HorizontalOrigin.CENTER,
  25466. * verticalOrigin : Cesium.VerticalOrigin.CENTER,
  25467. * scale : 1.0,
  25468. * image : 'url/to/image',
  25469. * imageSubRegion : undefined,
  25470. * color : Cesium.Color.WHITE,
  25471. * id : undefined,
  25472. * rotation : 0.0,
  25473. * alignedAxis : Cesium.Cartesian3.ZERO,
  25474. * width : undefined,
  25475. * height : undefined,
  25476. * scaleByDistance : undefined,
  25477. * translucencyByDistance : undefined,
  25478. * pixelOffsetScaleByDistance : undefined,
  25479. * sizeInMeters : false,
  25480. * distanceDisplayCondition : undefined
  25481. * });
  25482. * @example
  25483. * // Example 2: Specify only the billboard's cartographic position.
  25484. * const b = billboards.add({
  25485. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  25486. * });
  25487. * @param [options] - A template describing the billboard's properties as shown in Example 1.
  25488. * @returns The billboard that was added to the collection.
  25489. */
  25490. add(options?: any): Billboard;
  25491. /**
  25492. * Removes a billboard from the collection.
  25493. * @example
  25494. * const b = billboards.add(...);
  25495. * billboards.remove(b); // Returns true
  25496. * @param billboard - The billboard to remove.
  25497. * @returns <code>true</code> if the billboard was removed; <code>false</code> if the billboard was not found in the collection.
  25498. */
  25499. remove(billboard: Billboard): boolean;
  25500. /**
  25501. * Removes all billboards from the collection.
  25502. * @example
  25503. * billboards.add(...);
  25504. * billboards.add(...);
  25505. * billboards.removeAll();
  25506. */
  25507. removeAll(): void;
  25508. /**
  25509. * Check whether this collection contains a given billboard.
  25510. * @param [billboard] - The billboard to check for.
  25511. * @returns true if this collection contains the billboard, false otherwise.
  25512. */
  25513. contains(billboard?: Billboard): boolean;
  25514. /**
  25515. * Returns the billboard in the collection at the specified index. Indices are zero-based
  25516. * and increase as billboards are added. Removing a billboard shifts all billboards after
  25517. * it to the left, changing their indices. This function is commonly used with
  25518. * {@link BillboardCollection#length} to iterate over all the billboards
  25519. * in the collection.
  25520. * @example
  25521. * // Toggle the show property of every billboard in the collection
  25522. * const len = billboards.length;
  25523. * for (let i = 0; i < len; ++i) {
  25524. * const b = billboards.get(i);
  25525. * b.show = !b.show;
  25526. * }
  25527. * @param index - The zero-based index of the billboard.
  25528. * @returns The billboard at the specified index.
  25529. */
  25530. get(index: number): Billboard;
  25531. /**
  25532. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  25533. * get the draw commands needed to render this primitive.
  25534. * <p>
  25535. * Do not call this function directly. This is documented just to
  25536. * list the exceptions that may be propagated when the scene is rendered:
  25537. * </p>
  25538. */
  25539. update(): void;
  25540. /**
  25541. * Returns true if this object was destroyed; otherwise, false.
  25542. * <br /><br />
  25543. * If this object was destroyed, it should not be used; calling any function other than
  25544. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  25545. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  25546. */
  25547. isDestroyed(): boolean;
  25548. /**
  25549. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  25550. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  25551. * <br /><br />
  25552. * Once an object is destroyed, it should not be used; calling any function other than
  25553. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  25554. * assign the return value (<code>undefined</code>) to the object as done in the example.
  25555. * @example
  25556. * billboards = billboards && billboards.destroy();
  25557. */
  25558. destroy(): void;
  25559. }
  25560. export namespace BingMapsImageryProvider {
  25561. /**
  25562. * Initialization options for the BingMapsImageryProvider constructor
  25563. * @property url - The url of the Bing Maps server hosting the imagery.
  25564. * @property key - The Bing Maps key for your application, which can be
  25565. * created at {@link https://www.bingmapsportal.com/}.
  25566. * @property [tileProtocol] - The protocol to use when loading tiles, e.g. 'http' or 'https'.
  25567. * By default, tiles are loaded using the same protocol as the page.
  25568. * @property [mapStyle = BingMapsStyle.AERIAL] - The type of Bing Maps imagery to load.
  25569. * @property [culture = ''] - The culture to use when requesting Bing Maps imagery. Not
  25570. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  25571. * for information on the supported cultures.
  25572. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  25573. * @property [tileDiscardPolicy] - The policy that determines if a tile
  25574. * is invalid and should be discarded. By default, a {@link DiscardEmptyTileImagePolicy}
  25575. * will be used, with the expectation that the Bing Maps server will send a zero-length response for missing tiles.
  25576. * To ensure that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this parameter.
  25577. */
  25578. type ConstructorOptions = {
  25579. url: Resource | string;
  25580. key: string;
  25581. tileProtocol?: string;
  25582. mapStyle?: BingMapsStyle;
  25583. culture?: string;
  25584. ellipsoid?: Ellipsoid;
  25585. tileDiscardPolicy?: TileDiscardPolicy;
  25586. };
  25587. }
  25588. /**
  25589. * Provides tiled imagery using the Bing Maps Imagery REST API.
  25590. * @example
  25591. * const bing = new Cesium.BingMapsImageryProvider({
  25592. * url : 'https://dev.virtualearth.net',
  25593. * key : 'get-yours-at-https://www.bingmapsportal.com/',
  25594. * mapStyle : Cesium.BingMapsStyle.AERIAL
  25595. * });
  25596. * @param options - Object describing initialization options
  25597. */
  25598. export class BingMapsImageryProvider {
  25599. constructor(options: BingMapsImageryProvider.ConstructorOptions);
  25600. /**
  25601. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  25602. * 1.0 representing fully opaque.
  25603. */
  25604. defaultAlpha: number | undefined;
  25605. /**
  25606. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  25607. * 1.0 representing fully opaque.
  25608. */
  25609. defaultNightAlpha: number | undefined;
  25610. /**
  25611. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  25612. * 1.0 representing fully opaque.
  25613. */
  25614. defaultDayAlpha: number | undefined;
  25615. /**
  25616. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  25617. * makes the imagery darker while greater than 1.0 makes it brighter.
  25618. */
  25619. defaultBrightness: number | undefined;
  25620. /**
  25621. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  25622. * the contrast while greater than 1.0 increases it.
  25623. */
  25624. defaultContrast: number | undefined;
  25625. /**
  25626. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  25627. */
  25628. defaultHue: number | undefined;
  25629. /**
  25630. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  25631. * saturation while greater than 1.0 increases it.
  25632. */
  25633. defaultSaturation: number | undefined;
  25634. /**
  25635. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  25636. */
  25637. defaultGamma: number | undefined;
  25638. /**
  25639. * The default texture minification filter to apply to this provider.
  25640. */
  25641. defaultMinificationFilter: TextureMinificationFilter;
  25642. /**
  25643. * The default texture magnification filter to apply to this provider.
  25644. */
  25645. defaultMagnificationFilter: TextureMagnificationFilter;
  25646. /**
  25647. * Gets the name of the BingMaps server url hosting the imagery.
  25648. */
  25649. readonly url: string;
  25650. /**
  25651. * Gets the proxy used by this provider.
  25652. */
  25653. readonly proxy: Proxy;
  25654. /**
  25655. * Gets the Bing Maps key.
  25656. */
  25657. readonly key: string;
  25658. /**
  25659. * Gets the type of Bing Maps imagery to load.
  25660. */
  25661. readonly mapStyle: BingMapsStyle;
  25662. /**
  25663. * The culture to use when requesting Bing Maps imagery. Not
  25664. * all cultures are supported. See {@link http://msdn.microsoft.com/en-us/library/hh441729.aspx}
  25665. * for information on the supported cultures.
  25666. */
  25667. readonly culture: string;
  25668. /**
  25669. * Gets the width of each tile, in pixels. This function should
  25670. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25671. */
  25672. readonly tileWidth: number;
  25673. /**
  25674. * Gets the height of each tile, in pixels. This function should
  25675. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25676. */
  25677. readonly tileHeight: number;
  25678. /**
  25679. * Gets the maximum level-of-detail that can be requested. This function should
  25680. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25681. */
  25682. readonly maximumLevel: number | undefined;
  25683. /**
  25684. * Gets the minimum level-of-detail that can be requested. This function should
  25685. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25686. */
  25687. readonly minimumLevel: number;
  25688. /**
  25689. * Gets the tiling scheme used by this provider. This function should
  25690. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25691. */
  25692. readonly tilingScheme: TilingScheme;
  25693. /**
  25694. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  25695. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25696. */
  25697. readonly rectangle: Rectangle;
  25698. /**
  25699. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  25700. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  25701. * returns undefined, no tiles are filtered. This function should
  25702. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25703. */
  25704. readonly tileDiscardPolicy: TileDiscardPolicy;
  25705. /**
  25706. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  25707. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  25708. * are passed an instance of {@link TileProviderError}.
  25709. */
  25710. readonly errorEvent: Event;
  25711. /**
  25712. * Gets a value indicating whether or not the provider is ready for use.
  25713. */
  25714. readonly ready: boolean;
  25715. /**
  25716. * Gets a promise that resolves to true when the provider is ready for use.
  25717. */
  25718. readonly readyPromise: Promise<boolean>;
  25719. /**
  25720. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  25721. * the source of the imagery. This function should not be called before {@link BingMapsImageryProvider#ready} returns true.
  25722. */
  25723. readonly credit: Credit;
  25724. /**
  25725. * Gets a value indicating whether or not the images provided by this imagery provider
  25726. * include an alpha channel. If this property is false, an alpha channel, if present, will
  25727. * be ignored. If this property is true, any images without an alpha channel will be treated
  25728. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  25729. * and texture upload time.
  25730. */
  25731. readonly hasAlphaChannel: boolean;
  25732. /**
  25733. * Gets the credits to be displayed when a given tile is displayed.
  25734. * @param x - The tile X coordinate.
  25735. * @param y - The tile Y coordinate.
  25736. * @param level - The tile level;
  25737. * @returns The credits to be displayed when the tile is displayed.
  25738. */
  25739. getTileCredits(x: number, y: number, level: number): Credit[];
  25740. /**
  25741. * Requests the image for a given tile. This function should
  25742. * not be called before {@link BingMapsImageryProvider#ready} returns true.
  25743. * @param x - The tile X coordinate.
  25744. * @param y - The tile Y coordinate.
  25745. * @param level - The tile level.
  25746. * @param [request] - The request object. Intended for internal use only.
  25747. * @returns A promise for the image that will resolve when the image is available, or
  25748. * undefined if there are too many active requests to the server, and the request should be retried later.
  25749. */
  25750. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  25751. /**
  25752. * Picking features is not currently supported by this imagery provider, so this function simply returns
  25753. * undefined.
  25754. * @param x - The tile X coordinate.
  25755. * @param y - The tile Y coordinate.
  25756. * @param level - The tile level.
  25757. * @param longitude - The longitude at which to pick features.
  25758. * @param latitude - The latitude at which to pick features.
  25759. * @returns Undefined since picking is not supported.
  25760. */
  25761. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  25762. /**
  25763. * Converts a tiles (x, y, level) position into a quadkey used to request an image
  25764. * from a Bing Maps server.
  25765. * @param x - The tile's x coordinate.
  25766. * @param y - The tile's y coordinate.
  25767. * @param level - The tile's zoom level.
  25768. */
  25769. static tileXYToQuadKey(x: number, y: number, level: number): void;
  25770. /**
  25771. * Converts a tile's quadkey used to request an image from a Bing Maps server into the
  25772. * (x, y, level) position.
  25773. * @param quadkey - The tile's quad key
  25774. */
  25775. static quadKeyToTileXY(quadkey: string): void;
  25776. /**
  25777. * Gets or sets the URL to the Bing logo for display in the credit.
  25778. */
  25779. static logoUrl: string;
  25780. }
  25781. /**
  25782. * The types of imagery provided by Bing Maps.
  25783. */
  25784. export enum BingMapsStyle {
  25785. /**
  25786. * Aerial imagery.
  25787. */
  25788. AERIAL = "Aerial",
  25789. /**
  25790. * Aerial imagery with a road overlay.
  25791. */
  25792. AERIAL_WITH_LABELS = "AerialWithLabels",
  25793. /**
  25794. * Aerial imagery with a road overlay.
  25795. */
  25796. AERIAL_WITH_LABELS_ON_DEMAND = "AerialWithLabelsOnDemand",
  25797. /**
  25798. * Roads without additional imagery.
  25799. */
  25800. ROAD = "Road",
  25801. /**
  25802. * Roads without additional imagery.
  25803. */
  25804. ROAD_ON_DEMAND = "RoadOnDemand",
  25805. /**
  25806. * A dark version of the road maps.
  25807. */
  25808. CANVAS_DARK = "CanvasDark",
  25809. /**
  25810. * A lighter version of the road maps.
  25811. */
  25812. CANVAS_LIGHT = "CanvasLight",
  25813. /**
  25814. * A grayscale version of the road maps.
  25815. */
  25816. CANVAS_GRAY = "CanvasGray",
  25817. /**
  25818. * Ordnance Survey imagery. This imagery is visible only for the London, UK area.
  25819. */
  25820. ORDNANCE_SURVEY = "OrdnanceSurvey",
  25821. /**
  25822. * Collins Bart imagery.
  25823. */
  25824. COLLINS_BART = "CollinsBart"
  25825. }
  25826. /**
  25827. * Determines how two pixels' values are combined.
  25828. */
  25829. export enum BlendEquation {
  25830. /**
  25831. * Pixel values are added componentwise. This is used in additive blending for translucency.
  25832. */
  25833. ADD = WebGLConstants.FUNC_ADD,
  25834. /**
  25835. * Pixel values are subtracted componentwise (source - destination). This is used in alpha blending for translucency.
  25836. */
  25837. SUBTRACT = WebGLConstants.FUNC_SUBTRACT,
  25838. /**
  25839. * Pixel values are subtracted componentwise (destination - source).
  25840. */
  25841. REVERSE_SUBTRACT = WebGLConstants.FUNC_REVERSE_SUBTRACT,
  25842. /**
  25843. * Pixel values are given to the minimum function (min(source, destination)).
  25844. *
  25845. * This equation operates on each pixel color component.
  25846. */
  25847. MIN = WebGLConstants.MIN,
  25848. /**
  25849. * Pixel values are given to the maximum function (max(source, destination)).
  25850. *
  25851. * This equation operates on each pixel color component.
  25852. */
  25853. MAX = WebGLConstants.MAX
  25854. }
  25855. /**
  25856. * Determines how blending factors are computed.
  25857. */
  25858. export enum BlendFunction {
  25859. /**
  25860. * The blend factor is zero.
  25861. */
  25862. ZERO = WebGLConstants.ZERO,
  25863. /**
  25864. * The blend factor is one.
  25865. */
  25866. ONE = WebGLConstants.ONE,
  25867. /**
  25868. * The blend factor is the source color.
  25869. */
  25870. SOURCE_COLOR = WebGLConstants.SRC_COLOR,
  25871. /**
  25872. * The blend factor is one minus the source color.
  25873. */
  25874. ONE_MINUS_SOURCE_COLOR = WebGLConstants.ONE_MINUS_SRC_COLOR,
  25875. /**
  25876. * The blend factor is the destination color.
  25877. */
  25878. DESTINATION_COLOR = WebGLConstants.DST_COLOR,
  25879. /**
  25880. * The blend factor is one minus the destination color.
  25881. */
  25882. ONE_MINUS_DESTINATION_COLOR = WebGLConstants.ONE_MINUS_DST_COLOR,
  25883. /**
  25884. * The blend factor is the source alpha.
  25885. */
  25886. SOURCE_ALPHA = WebGLConstants.SRC_ALPHA,
  25887. /**
  25888. * The blend factor is one minus the source alpha.
  25889. */
  25890. ONE_MINUS_SOURCE_ALPHA = WebGLConstants.ONE_MINUS_SRC_ALPHA,
  25891. /**
  25892. * The blend factor is the destination alpha.
  25893. */
  25894. DESTINATION_ALPHA = WebGLConstants.DST_ALPHA,
  25895. /**
  25896. * The blend factor is one minus the destination alpha.
  25897. */
  25898. ONE_MINUS_DESTINATION_ALPHA = WebGLConstants.ONE_MINUS_DST_ALPHA,
  25899. /**
  25900. * The blend factor is the constant color.
  25901. */
  25902. CONSTANT_COLOR = WebGLConstants.CONSTANT_COLOR,
  25903. /**
  25904. * The blend factor is one minus the constant color.
  25905. */
  25906. ONE_MINUS_CONSTANT_COLOR = WebGLConstants.ONE_MINUS_CONSTANT_COLOR,
  25907. /**
  25908. * The blend factor is the constant alpha.
  25909. */
  25910. CONSTANT_ALPHA = WebGLConstants.CONSTANT_ALPHA,
  25911. /**
  25912. * The blend factor is one minus the constant alpha.
  25913. */
  25914. ONE_MINUS_CONSTANT_ALPHA = WebGLConstants.ONE_MINUS_CONSTANT_ALPHA,
  25915. /**
  25916. * The blend factor is the saturated source alpha.
  25917. */
  25918. SOURCE_ALPHA_SATURATE = WebGLConstants.SRC_ALPHA_SATURATE
  25919. }
  25920. /**
  25921. * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene.
  25922. */
  25923. export enum BlendOption {
  25924. /**
  25925. * The billboards, points, or labels in the collection are completely opaque.
  25926. */
  25927. OPAQUE = 0,
  25928. /**
  25929. * The billboards, points, or labels in the collection are completely translucent.
  25930. */
  25931. TRANSLUCENT = 1,
  25932. /**
  25933. * The billboards, points, or labels in the collection are both opaque and translucent.
  25934. */
  25935. OPAQUE_AND_TRANSLUCENT = 2
  25936. }
  25937. /**
  25938. * The blending state combines {@link BlendEquation} and {@link BlendFunction} and the
  25939. * <code>enabled</code> flag to define the full blending state for combining source and
  25940. * destination fragments when rendering.
  25941. * <p>
  25942. * This is a helper when using custom render states with {@link Appearance#renderState}.
  25943. * </p>
  25944. */
  25945. export namespace BlendingState {
  25946. /**
  25947. * Blending is disabled.
  25948. */
  25949. const DISABLED: any;
  25950. /**
  25951. * Blending is enabled using alpha blending, <code>source(source.alpha) + destination(1 - source.alpha)</code>.
  25952. */
  25953. const ALPHA_BLEND: any;
  25954. /**
  25955. * Blending is enabled using alpha blending with premultiplied alpha, <code>source + destination(1 - source.alpha)</code>.
  25956. */
  25957. const PRE_MULTIPLIED_ALPHA_BLEND: any;
  25958. /**
  25959. * Blending is enabled using additive blending, <code>source(source.alpha) + destination</code>.
  25960. */
  25961. const ADDITIVE_BLEND: any;
  25962. }
  25963. /**
  25964. * A ParticleEmitter that emits particles within a box.
  25965. * Particles will be positioned randomly within the box and have initial velocities emanating from the center of the box.
  25966. * @param dimensions - The width, height and depth dimensions of the box.
  25967. */
  25968. export class BoxEmitter {
  25969. constructor(dimensions: Cartesian3);
  25970. /**
  25971. * The width, height and depth dimensions of the box in meters.
  25972. */
  25973. dimensions: Cartesian3;
  25974. }
  25975. /**
  25976. * An orientation given by a pair of unit vectors
  25977. * @property direction - The unit "direction" vector
  25978. * @property up - The unit "up" vector
  25979. */
  25980. export type DirectionUp = {
  25981. direction: Cartesian3;
  25982. up: Cartesian3;
  25983. };
  25984. /**
  25985. * An orientation given by numeric heading, pitch, and roll
  25986. * @property [heading = 0.0] - The heading in radians
  25987. * @property [pitch = -Math.PI_OVER_TWO] - The pitch in radians
  25988. * @property [roll = 0.0] - The roll in meters
  25989. */
  25990. export type HeadingPitchRollValues = {
  25991. heading?: number;
  25992. pitch?: number;
  25993. roll?: number;
  25994. };
  25995. /**
  25996. * The camera is defined by a position, orientation, and view frustum.
  25997. * <br /><br />
  25998. * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
  25999. * <br /><br />
  26000. * The viewing frustum is defined by 6 planes.
  26001. * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
  26002. * define the unit vector normal to the plane, and the w component is the distance of the
  26003. * plane from the origin/camera position.
  26004. * @example
  26005. * // Create a camera looking down the negative z-axis, positioned at the origin,
  26006. * // with a field of view of 60 degrees, and 1:1 aspect ratio.
  26007. * const camera = new Cesium.Camera(scene);
  26008. * camera.position = new Cesium.Cartesian3();
  26009. * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
  26010. * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
  26011. * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
  26012. * camera.frustum.near = 1.0;
  26013. * camera.frustum.far = 2.0;
  26014. * @param scene - The scene.
  26015. */
  26016. export class Camera {
  26017. constructor(scene: Scene);
  26018. /**
  26019. * The position of the camera.
  26020. */
  26021. position: Cartesian3;
  26022. /**
  26023. * The view direction of the camera.
  26024. */
  26025. direction: Cartesian3;
  26026. /**
  26027. * The up direction of the camera.
  26028. */
  26029. up: Cartesian3;
  26030. /**
  26031. * The right direction of the camera.
  26032. */
  26033. right: Cartesian3;
  26034. /**
  26035. * The region of space in view.
  26036. */
  26037. frustum: PerspectiveFrustum | PerspectiveOffCenterFrustum | OrthographicFrustum;
  26038. /**
  26039. * The default amount to move the camera when an argument is not
  26040. * provided to the move methods.
  26041. */
  26042. defaultMoveAmount: number;
  26043. /**
  26044. * The default amount to rotate the camera when an argument is not
  26045. * provided to the look methods.
  26046. */
  26047. defaultLookAmount: number;
  26048. /**
  26049. * The default amount to rotate the camera when an argument is not
  26050. * provided to the rotate methods.
  26051. */
  26052. defaultRotateAmount: number;
  26053. /**
  26054. * The default amount to move the camera when an argument is not
  26055. * provided to the zoom methods.
  26056. */
  26057. defaultZoomAmount: number;
  26058. /**
  26059. * If set, the camera will not be able to rotate past this axis in either direction.
  26060. */
  26061. constrainedAxis: Cartesian3;
  26062. /**
  26063. * The factor multiplied by the the map size used to determine where to clamp the camera position
  26064. * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
  26065. */
  26066. maximumZoomFactor: number;
  26067. /**
  26068. * 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.
  26069. */
  26070. percentageChanged: number;
  26071. /**
  26072. * The default rectangle the camera will view on creation.
  26073. */
  26074. static DEFAULT_VIEW_RECTANGLE: Rectangle;
  26075. /**
  26076. * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
  26077. * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
  26078. * will move it further away from the extent, and a value less than zero will move it close to the extent.
  26079. */
  26080. static DEFAULT_VIEW_FACTOR: number;
  26081. /**
  26082. * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
  26083. */
  26084. static DEFAULT_OFFSET: HeadingPitchRange;
  26085. /**
  26086. * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
  26087. */
  26088. readonly transform: Matrix4;
  26089. /**
  26090. * Gets the inverse camera transform.
  26091. */
  26092. readonly inverseTransform: Matrix4;
  26093. /**
  26094. * Gets the view matrix.
  26095. */
  26096. readonly viewMatrix: Matrix4;
  26097. /**
  26098. * Gets the inverse view matrix.
  26099. */
  26100. readonly inverseViewMatrix: Matrix4;
  26101. /**
  26102. * Gets the {@link Cartographic} position of the camera, with longitude and latitude
  26103. * expressed in radians and height in meters. In 2D and Columbus View, it is possible
  26104. * for the returned longitude and latitude to be outside the range of valid longitudes
  26105. * and latitudes when the camera is outside the map.
  26106. */
  26107. readonly positionCartographic: Cartographic;
  26108. /**
  26109. * Gets the position of the camera in world coordinates.
  26110. */
  26111. readonly positionWC: Cartesian3;
  26112. /**
  26113. * Gets the view direction of the camera in world coordinates.
  26114. */
  26115. readonly directionWC: Cartesian3;
  26116. /**
  26117. * Gets the up direction of the camera in world coordinates.
  26118. */
  26119. readonly upWC: Cartesian3;
  26120. /**
  26121. * Gets the right direction of the camera in world coordinates.
  26122. */
  26123. readonly rightWC: Cartesian3;
  26124. /**
  26125. * Gets the camera heading in radians.
  26126. */
  26127. readonly heading: number;
  26128. /**
  26129. * Gets the camera pitch in radians.
  26130. */
  26131. readonly pitch: number;
  26132. /**
  26133. * Gets the camera roll in radians.
  26134. */
  26135. readonly roll: number;
  26136. /**
  26137. * Gets the event that will be raised at when the camera starts to move.
  26138. */
  26139. readonly moveStart: Event;
  26140. /**
  26141. * Gets the event that will be raised when the camera has stopped moving.
  26142. */
  26143. readonly moveEnd: Event;
  26144. /**
  26145. * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
  26146. */
  26147. readonly changed: Event;
  26148. /**
  26149. * Sets the camera position, orientation and transform.
  26150. * @example
  26151. * // 1. Set position with a top-down view
  26152. * viewer.camera.setView({
  26153. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  26154. * });
  26155. *
  26156. * // 2 Set view with heading, pitch and roll
  26157. * viewer.camera.setView({
  26158. * destination : cartesianPosition,
  26159. * orientation: {
  26160. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  26161. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  26162. * roll : 0.0 // default value
  26163. * }
  26164. * });
  26165. *
  26166. * // 3. Change heading, pitch and roll with the camera position remaining the same.
  26167. * viewer.camera.setView({
  26168. * orientation: {
  26169. * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
  26170. * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
  26171. * roll : 0.0 // default value
  26172. * }
  26173. * });
  26174. *
  26175. *
  26176. * // 4. View rectangle with a top-down view
  26177. * viewer.camera.setView({
  26178. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  26179. * });
  26180. *
  26181. * // 5. Set position with an orientation using unit vectors.
  26182. * viewer.camera.setView({
  26183. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  26184. * orientation : {
  26185. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  26186. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  26187. * }
  26188. * });
  26189. * @param options - Object with the following properties:
  26190. * @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.
  26191. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  26192. * 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
  26193. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  26194. * @param [options.endTransform] - Transform matrix representing the reference frame of the camera.
  26195. * @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>.
  26196. */
  26197. setView(options: {
  26198. destination?: Cartesian3 | Rectangle;
  26199. orientation?: HeadingPitchRollValues | DirectionUp;
  26200. endTransform?: Matrix4;
  26201. convert?: boolean;
  26202. }): void;
  26203. /**
  26204. * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
  26205. * the default view for the 3D scene. The home view for 2D and columbus view shows the
  26206. * entire map.
  26207. * @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}
  26208. */
  26209. flyHome(duration?: number): void;
  26210. /**
  26211. * Transform a vector or point from world coordinates to the camera's reference frame.
  26212. * @param cartesian - The vector or point to transform.
  26213. * @param [result] - The object onto which to store the result.
  26214. * @returns The transformed vector or point.
  26215. */
  26216. worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  26217. /**
  26218. * Transform a point from world coordinates to the camera's reference frame.
  26219. * @param cartesian - The point to transform.
  26220. * @param [result] - The object onto which to store the result.
  26221. * @returns The transformed point.
  26222. */
  26223. worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26224. /**
  26225. * Transform a vector from world coordinates to the camera's reference frame.
  26226. * @param cartesian - The vector to transform.
  26227. * @param [result] - The object onto which to store the result.
  26228. * @returns The transformed vector.
  26229. */
  26230. worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26231. /**
  26232. * Transform a vector or point from the camera's reference frame to world coordinates.
  26233. * @param cartesian - The vector or point to transform.
  26234. * @param [result] - The object onto which to store the result.
  26235. * @returns The transformed vector or point.
  26236. */
  26237. cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4;
  26238. /**
  26239. * Transform a point from the camera's reference frame to world coordinates.
  26240. * @param cartesian - The point to transform.
  26241. * @param [result] - The object onto which to store the result.
  26242. * @returns The transformed point.
  26243. */
  26244. cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26245. /**
  26246. * Transform a vector from the camera's reference frame to world coordinates.
  26247. * @param cartesian - The vector to transform.
  26248. * @param [result] - The object onto which to store the result.
  26249. * @returns The transformed vector.
  26250. */
  26251. cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3;
  26252. /**
  26253. * Translates the camera's position by <code>amount</code> along <code>direction</code>.
  26254. * @param direction - The direction to move.
  26255. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26256. */
  26257. move(direction: Cartesian3, amount?: number): void;
  26258. /**
  26259. * Translates the camera's position by <code>amount</code> along the camera's view vector.
  26260. * When in 2D mode, this will zoom in the camera instead of translating the camera's position.
  26261. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26262. */
  26263. moveForward(amount?: number): void;
  26264. /**
  26265. * Translates the camera's position by <code>amount</code> along the opposite direction
  26266. * of the camera's view vector.
  26267. * When in 2D mode, this will zoom out the camera instead of translating the camera's position.
  26268. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26269. */
  26270. moveBackward(amount?: number): void;
  26271. /**
  26272. * Translates the camera's position by <code>amount</code> along the camera's up vector.
  26273. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26274. */
  26275. moveUp(amount?: number): void;
  26276. /**
  26277. * Translates the camera's position by <code>amount</code> along the opposite direction
  26278. * of the camera's up vector.
  26279. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26280. */
  26281. moveDown(amount?: number): void;
  26282. /**
  26283. * Translates the camera's position by <code>amount</code> along the camera's right vector.
  26284. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26285. */
  26286. moveRight(amount?: number): void;
  26287. /**
  26288. * Translates the camera's position by <code>amount</code> along the opposite direction
  26289. * of the camera's right vector.
  26290. * @param [amount] - The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
  26291. */
  26292. moveLeft(amount?: number): void;
  26293. /**
  26294. * Rotates the camera around its up vector by amount, in radians, in the opposite direction
  26295. * of its right vector if not in 2D mode.
  26296. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26297. */
  26298. lookLeft(amount?: number): void;
  26299. /**
  26300. * Rotates the camera around its up vector by amount, in radians, in the direction
  26301. * of its right vector if not in 2D mode.
  26302. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26303. */
  26304. lookRight(amount?: number): void;
  26305. /**
  26306. * Rotates the camera around its right vector by amount, in radians, in the direction
  26307. * of its up vector if not in 2D mode.
  26308. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26309. */
  26310. lookUp(amount?: number): void;
  26311. /**
  26312. * Rotates the camera around its right vector by amount, in radians, in the opposite direction
  26313. * of its up vector if not in 2D mode.
  26314. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26315. */
  26316. lookDown(amount?: number): void;
  26317. /**
  26318. * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
  26319. * @param axis - The axis to rotate around.
  26320. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26321. */
  26322. look(axis: Cartesian3, angle?: number): void;
  26323. /**
  26324. * Rotate the camera counter-clockwise around its direction vector by amount, in radians.
  26325. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26326. */
  26327. twistLeft(amount?: number): void;
  26328. /**
  26329. * Rotate the camera clockwise around its direction vector by amount, in radians.
  26330. * @param [amount] - The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
  26331. */
  26332. twistRight(amount?: number): void;
  26333. /**
  26334. * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
  26335. * of the camera's position to the center of the camera's reference frame remains the same.
  26336. * @param axis - The axis to rotate around given in world coordinates.
  26337. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26338. */
  26339. rotate(axis: Cartesian3, angle?: number): void;
  26340. /**
  26341. * Rotates the camera around the center of the camera's reference frame by angle downwards.
  26342. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26343. */
  26344. rotateDown(angle?: number): void;
  26345. /**
  26346. * Rotates the camera around the center of the camera's reference frame by angle upwards.
  26347. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26348. */
  26349. rotateUp(angle?: number): void;
  26350. /**
  26351. * Rotates the camera around the center of the camera's reference frame by angle to the right.
  26352. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26353. */
  26354. rotateRight(angle?: number): void;
  26355. /**
  26356. * Rotates the camera around the center of the camera's reference frame by angle to the left.
  26357. * @param [angle] - The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
  26358. */
  26359. rotateLeft(angle?: number): void;
  26360. /**
  26361. * Zooms <code>amount</code> along the camera's view vector.
  26362. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  26363. */
  26364. zoomIn(amount?: number): void;
  26365. /**
  26366. * Zooms <code>amount</code> along the opposite direction of
  26367. * the camera's view vector.
  26368. * @param [amount] - The amount to move. Defaults to <code>defaultZoomAmount</code>.
  26369. */
  26370. zoomOut(amount?: number): void;
  26371. /**
  26372. * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
  26373. * Columbus view, this is the distance to the map.
  26374. * @returns The magnitude of the position.
  26375. */
  26376. getMagnitude(): number;
  26377. /**
  26378. * Sets the camera position and orientation using a target and offset. The target must be given in
  26379. * 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.
  26380. * 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
  26381. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  26382. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26383. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  26384. *
  26385. * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  26386. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  26387. * determined from the offset, the heading will be north.
  26388. * @example
  26389. * // 1. Using a cartesian offset
  26390. * const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
  26391. * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  26392. *
  26393. * // 2. Using a HeadingPitchRange offset
  26394. * const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
  26395. * const heading = Cesium.Math.toRadians(50.0);
  26396. * const pitch = Cesium.Math.toRadians(-20.0);
  26397. * const range = 5000.0;
  26398. * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
  26399. * @param target - The target position in world coordinates.
  26400. * @param offset - The offset from the target in the local east-north-up reference frame centered at the target.
  26401. */
  26402. lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void;
  26403. /**
  26404. * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
  26405. * 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
  26406. * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
  26407. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26408. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
  26409. *
  26410. * 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
  26411. * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
  26412. * determined from the offset, the heading will be north.
  26413. * @example
  26414. * // 1. Using a cartesian offset
  26415. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
  26416. * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
  26417. *
  26418. * // 2. Using a HeadingPitchRange offset
  26419. * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
  26420. * const heading = Cesium.Math.toRadians(50.0);
  26421. * const pitch = Cesium.Math.toRadians(-20.0);
  26422. * const range = 5000.0;
  26423. * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
  26424. * @param transform - The transformation matrix defining the reference frame.
  26425. * @param [offset] - The offset from the target in a reference frame centered at the target.
  26426. */
  26427. lookAtTransform(transform: Matrix4, offset?: Cartesian3 | HeadingPitchRange): void;
  26428. /**
  26429. * Get the camera position needed to view a rectangle on an ellipsoid or map
  26430. * @param rectangle - The rectangle to view.
  26431. * @param [result] - The camera position needed to view the rectangle
  26432. * @returns The camera position needed to view the rectangle
  26433. */
  26434. getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3;
  26435. /**
  26436. * Pick an ellipsoid or map.
  26437. * @example
  26438. * const canvas = viewer.scene.canvas;
  26439. * const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
  26440. * const ellipsoid = viewer.scene.globe.ellipsoid;
  26441. * const result = viewer.camera.pickEllipsoid(center, ellipsoid);
  26442. * @param windowPosition - The x and y coordinates of a pixel.
  26443. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid to pick.
  26444. * @param [result] - The object onto which to store the result.
  26445. * @returns If the ellipsoid or map was picked,
  26446. * returns the point on the surface of the ellipsoid or map in world
  26447. * coordinates. If the ellipsoid or map was not picked, returns undefined.
  26448. */
  26449. pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3 | undefined;
  26450. /**
  26451. * Create a ray from the camera position through the pixel at <code>windowPosition</code>
  26452. * in world coordinates.
  26453. * @param windowPosition - The x and y coordinates of a pixel.
  26454. * @param [result] - The object onto which to store the result.
  26455. * @returns Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined.
  26456. */
  26457. getPickRay(windowPosition: Cartesian2, result?: Ray): Ray | undefined;
  26458. /**
  26459. * Return the distance from the camera to the front of the bounding sphere.
  26460. * @param boundingSphere - The bounding sphere in world coordinates.
  26461. * @returns The distance to the bounding sphere.
  26462. */
  26463. distanceToBoundingSphere(boundingSphere: BoundingSphere): number;
  26464. /**
  26465. * Return the pixel size in meters.
  26466. * @param boundingSphere - The bounding sphere in world coordinates.
  26467. * @param drawingBufferWidth - The drawing buffer width.
  26468. * @param drawingBufferHeight - The drawing buffer height.
  26469. * @returns The pixel size in meters.
  26470. */
  26471. getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number;
  26472. /**
  26473. * Cancels the current camera flight and leaves the camera at its current location.
  26474. * If no flight is in progress, this this function does nothing.
  26475. */
  26476. cancelFlight(): void;
  26477. /**
  26478. * Completes the current camera flight and moves the camera immediately to its final destination.
  26479. * If no flight is in progress, this this function does nothing.
  26480. */
  26481. completeFlight(): void;
  26482. /**
  26483. * Flies the camera from its current position to a new position.
  26484. * @example
  26485. * // 1. Fly to a position with a top-down view
  26486. * viewer.camera.flyTo({
  26487. * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
  26488. * });
  26489. *
  26490. * // 2. Fly to a Rectangle with a top-down view
  26491. * viewer.camera.flyTo({
  26492. * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
  26493. * });
  26494. *
  26495. * // 3. Fly to a position with an orientation using unit vectors.
  26496. * viewer.camera.flyTo({
  26497. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  26498. * orientation : {
  26499. * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
  26500. * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
  26501. * }
  26502. * });
  26503. *
  26504. * // 4. Fly to a position with an orientation using heading, pitch and roll.
  26505. * viewer.camera.flyTo({
  26506. * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
  26507. * orientation : {
  26508. * heading : Cesium.Math.toRadians(175.0),
  26509. * pitch : Cesium.Math.toRadians(-35.0),
  26510. * roll : 0.0
  26511. * }
  26512. * });
  26513. * @param options - Object with the following properties:
  26514. * @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.
  26515. * @param [options.orientation] - An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
  26516. * 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
  26517. * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
  26518. * @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.
  26519. * @param [options.complete] - The function to execute when the flight is complete.
  26520. * @param [options.cancel] - The function to execute if the flight is cancelled.
  26521. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  26522. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  26523. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  26524. * @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.
  26525. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  26526. * @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>.
  26527. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  26528. */
  26529. flyTo(options: {
  26530. destination: Cartesian3 | Rectangle;
  26531. orientation?: any;
  26532. duration?: number;
  26533. complete?: Camera.FlightCompleteCallback;
  26534. cancel?: Camera.FlightCancelledCallback;
  26535. endTransform?: Matrix4;
  26536. maximumHeight?: number;
  26537. pitchAdjustHeight?: number;
  26538. flyOverLongitude?: number;
  26539. flyOverLongitudeWeight?: number;
  26540. convert?: boolean;
  26541. easingFunction?: EasingFunction.Callback;
  26542. }): void;
  26543. /**
  26544. * Sets the camera so that the current view contains the provided bounding sphere.
  26545. *
  26546. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  26547. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  26548. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26549. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  26550. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  26551. *
  26552. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  26553. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  26554. * determined from the offset, the heading will be north.</p>
  26555. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  26556. * @param [offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  26557. */
  26558. viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void;
  26559. /**
  26560. * Flies the camera to a location where the current view contains the provided bounding sphere.
  26561. *
  26562. * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  26563. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  26564. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  26565. * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
  26566. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  26567. *
  26568. * <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
  26569. * target will be the range. The heading will be aligned to local north.</p>
  26570. * @param boundingSphere - The bounding sphere to view, in world coordinates.
  26571. * @param [options] - Object with the following properties:
  26572. * @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.
  26573. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  26574. * @param [options.complete] - The function to execute when the flight is complete.
  26575. * @param [options.cancel] - The function to execute if the flight is cancelled.
  26576. * @param [options.endTransform] - Transform matrix representing the reference frame the camera will be in when the flight is completed.
  26577. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  26578. * @param [options.pitchAdjustHeight] - If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
  26579. * @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.
  26580. * @param [options.flyOverLongitudeWeight] - Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
  26581. * @param [options.easingFunction] - Controls how the time is interpolated over the duration of the flight.
  26582. */
  26583. flyToBoundingSphere(boundingSphere: BoundingSphere, options?: {
  26584. duration?: number;
  26585. offset?: HeadingPitchRange;
  26586. complete?: Camera.FlightCompleteCallback;
  26587. cancel?: Camera.FlightCancelledCallback;
  26588. endTransform?: Matrix4;
  26589. maximumHeight?: number;
  26590. pitchAdjustHeight?: number;
  26591. flyOverLongitude?: number;
  26592. flyOverLongitudeWeight?: number;
  26593. easingFunction?: EasingFunction.Callback;
  26594. }): void;
  26595. /**
  26596. * Computes the approximate visible rectangle on the ellipsoid.
  26597. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that you want to know the visible region.
  26598. * @param [result] - The rectangle in which to store the result
  26599. * @returns The visible rectangle or undefined if the ellipsoid isn't visible at all.
  26600. */
  26601. computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined;
  26602. /**
  26603. * Switches the frustum/projection to perspective.
  26604. *
  26605. * This function is a no-op in 2D which must always be orthographic.
  26606. */
  26607. switchToPerspectiveFrustum(): void;
  26608. /**
  26609. * Switches the frustum/projection to orthographic.
  26610. *
  26611. * This function is a no-op in 2D which will always be orthographic.
  26612. */
  26613. switchToOrthographicFrustum(): void;
  26614. }
  26615. export namespace Camera {
  26616. /**
  26617. * A function that will execute when a flight completes.
  26618. */
  26619. type FlightCompleteCallback = () => void;
  26620. /**
  26621. * A function that will execute when a flight is cancelled.
  26622. */
  26623. type FlightCancelledCallback = () => void;
  26624. }
  26625. /**
  26626. * Aggregates input events. For example, suppose the following inputs are received between frames:
  26627. * left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into
  26628. * one event with a start and end position of the mouse.
  26629. * @param [canvas = document] - The element to handle events for.
  26630. */
  26631. export class CameraEventAggregator {
  26632. constructor(canvas?: HTMLCanvasElement);
  26633. /**
  26634. * Gets the current mouse position.
  26635. */
  26636. currentMousePosition: Cartesian2;
  26637. /**
  26638. * Gets whether any mouse button is down, a touch has started, or the wheel has been moved.
  26639. */
  26640. anyButtonDown: boolean;
  26641. /**
  26642. * Gets if a mouse button down or touch has started and has been moved.
  26643. * @param type - The camera event type.
  26644. * @param [modifier] - The keyboard modifier.
  26645. * @returns Returns <code>true</code> if a mouse button down or touch has started and has been moved; otherwise, <code>false</code>
  26646. */
  26647. isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  26648. /**
  26649. * Gets the aggregated start and end position of the current event.
  26650. * @param type - The camera event type.
  26651. * @param [modifier] - The keyboard modifier.
  26652. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code>.
  26653. */
  26654. getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any;
  26655. /**
  26656. * Gets the start and end position of the last move event (not the aggregated event).
  26657. * @param type - The camera event type.
  26658. * @param [modifier] - The keyboard modifier.
  26659. * @returns An object with two {@link Cartesian2} properties: <code>startPosition</code> and <code>endPosition</code> or <code>undefined</code>.
  26660. */
  26661. getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any | undefined;
  26662. /**
  26663. * Gets whether the mouse button is down or a touch has started.
  26664. * @param type - The camera event type.
  26665. * @param [modifier] - The keyboard modifier.
  26666. * @returns Whether the mouse button is down or a touch has started.
  26667. */
  26668. isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean;
  26669. /**
  26670. * Gets the mouse position that started the aggregation.
  26671. * @param type - The camera event type.
  26672. * @param [modifier] - The keyboard modifier.
  26673. * @returns The mouse position.
  26674. */
  26675. getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2;
  26676. /**
  26677. * Gets the time the button was pressed or the touch was started.
  26678. * @param type - The camera event type.
  26679. * @param [modifier] - The keyboard modifier.
  26680. * @returns The time the button was pressed or the touch was started.
  26681. */
  26682. getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  26683. /**
  26684. * Gets the time the button was released or the touch was ended.
  26685. * @param type - The camera event type.
  26686. * @param [modifier] - The keyboard modifier.
  26687. * @returns The time the button was released or the touch was ended.
  26688. */
  26689. getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date;
  26690. /**
  26691. * Signals that all of the events have been handled and the aggregator should be reset to handle new events.
  26692. */
  26693. reset(): void;
  26694. /**
  26695. * Returns true if this object was destroyed; otherwise, false.
  26696. * <br /><br />
  26697. * If this object was destroyed, it should not be used; calling any function other than
  26698. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  26699. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  26700. */
  26701. isDestroyed(): boolean;
  26702. /**
  26703. * Removes mouse listeners held by this object.
  26704. * <br /><br />
  26705. * Once an object is destroyed, it should not be used; calling any function other than
  26706. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  26707. * assign the return value (<code>undefined</code>) to the object as done in the example.
  26708. * @example
  26709. * handler = handler && handler.destroy();
  26710. */
  26711. destroy(): void;
  26712. }
  26713. /**
  26714. * Enumerates the available input for interacting with the camera.
  26715. */
  26716. export enum CameraEventType {
  26717. /**
  26718. * A left mouse button press followed by moving the mouse and releasing the button.
  26719. */
  26720. LEFT_DRAG = 0,
  26721. /**
  26722. * A right mouse button press followed by moving the mouse and releasing the button.
  26723. */
  26724. RIGHT_DRAG = 1,
  26725. /**
  26726. * A middle mouse button press followed by moving the mouse and releasing the button.
  26727. */
  26728. MIDDLE_DRAG = 2,
  26729. /**
  26730. * Scrolling the middle mouse button.
  26731. */
  26732. WHEEL = 3,
  26733. /**
  26734. * A two-finger touch on a touch surface.
  26735. */
  26736. PINCH = 4
  26737. }
  26738. /**
  26739. * A tile in a {@link Cesium3DTileset}. When a tile is first created, its content is not loaded;
  26740. * the content is loaded on-demand when needed based on the view.
  26741. * <p>
  26742. * Do not construct this directly, instead access tiles through {@link Cesium3DTileset#tileVisible}.
  26743. * </p>
  26744. */
  26745. export class Cesium3DTile {
  26746. constructor();
  26747. /**
  26748. * The local transform of this tile.
  26749. */
  26750. transform: Matrix4;
  26751. /**
  26752. * The final computed transform of this tile.
  26753. */
  26754. readonly computedTransform: Matrix4;
  26755. /**
  26756. * The error, in meters, introduced if this tile is rendered and its children are not.
  26757. * This is used to compute screen space error, i.e., the error measured in pixels.
  26758. */
  26759. readonly geometricError: number;
  26760. /**
  26761. * Gets the tile's children.
  26762. */
  26763. readonly children: Cesium3DTile[];
  26764. /**
  26765. * This tile's parent or <code>undefined</code> if this tile is the root.
  26766. * <p>
  26767. * When a tile's content points to an external tileset JSON file, the external tileset's
  26768. * root tile's parent is not <code>undefined</code>; instead, the parent references
  26769. * the tile (with its content pointing to an external tileset JSON file) as if the two tilesets were merged.
  26770. * </p>
  26771. */
  26772. readonly parent: Cesium3DTile;
  26773. /**
  26774. * The time in seconds after the tile's content is ready when the content expires and new content is requested.
  26775. */
  26776. expireDuration: number;
  26777. /**
  26778. * The date when the content expires and new content is requested.
  26779. */
  26780. expireDate: JulianDate;
  26781. /**
  26782. * The tileset containing this tile.
  26783. */
  26784. readonly tileset: Cesium3DTileset;
  26785. /**
  26786. * The tile's content. This represents the actual tile's payload,
  26787. * not the content's metadata in the tileset JSON file.
  26788. */
  26789. readonly content: Cesium3DTileContent;
  26790. /**
  26791. * Get the bounding sphere derived from the tile's bounding volume.
  26792. */
  26793. readonly boundingSphere: BoundingSphere;
  26794. /**
  26795. * Returns the <code>extras</code> property in the tileset JSON for this tile, which contains application specific metadata.
  26796. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  26797. */
  26798. readonly extras: any;
  26799. }
  26800. /**
  26801. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  26802. * the original feature, e.g. glTF material or per-point color in the tile.
  26803. * <p>
  26804. * When <code>REPLACE</code> or <code>MIX</code> are used and the source color is a glTF material, the technique must assign the
  26805. * <code>_3DTILESDIFFUSE</code> semantic to the diffuse color parameter. Otherwise only <code>HIGHLIGHT</code> is supported.
  26806. * </p>
  26807. * <p>
  26808. * A feature whose color evaluates to white (1.0, 1.0, 1.0) is always rendered without color blending, regardless of the
  26809. * tileset's color blend mode.
  26810. * </p>
  26811. * <pre><code>
  26812. * "techniques": {
  26813. * "technique0": {
  26814. * "parameters": {
  26815. * "diffuse": {
  26816. * "semantic": "_3DTILESDIFFUSE",
  26817. * "type": 35666
  26818. * }
  26819. * }
  26820. * }
  26821. * }
  26822. * </code></pre>
  26823. */
  26824. export enum Cesium3DTileColorBlendMode {
  26825. /**
  26826. * Multiplies the source color by the feature color.
  26827. */
  26828. HIGHLIGHT = 0,
  26829. /**
  26830. * Replaces the source color with the feature color.
  26831. */
  26832. REPLACE = 1,
  26833. /**
  26834. * Blends the source color and feature color together.
  26835. */
  26836. MIX = 2
  26837. }
  26838. /**
  26839. * The content of a tile in a {@link Cesium3DTileset}.
  26840. * <p>
  26841. * Derived classes of this interface provide access to individual features in the tile.
  26842. * Access derived objects through {@link Cesium3DTile#content}.
  26843. * </p>
  26844. * <p>
  26845. * This type describes an interface and is not intended to be instantiated directly.
  26846. * </p>
  26847. */
  26848. export class Cesium3DTileContent {
  26849. constructor();
  26850. /**
  26851. * Gets the number of features in the tile.
  26852. */
  26853. readonly featuresLength: number;
  26854. /**
  26855. * Gets the number of points in the tile.
  26856. * <p>
  26857. * Only applicable for tiles with Point Cloud content. This is different than {@link Cesium3DTileContent#featuresLength} which
  26858. * equals the number of groups of points as distinguished by the <code>BATCH_ID</code> feature table semantic.
  26859. * </p>
  26860. */
  26861. readonly pointsLength: number;
  26862. /**
  26863. * Gets the number of triangles in the tile.
  26864. */
  26865. readonly trianglesLength: number;
  26866. /**
  26867. * Gets the tile's geometry memory in bytes.
  26868. */
  26869. readonly geometryByteLength: number;
  26870. /**
  26871. * Gets the tile's texture memory in bytes.
  26872. */
  26873. readonly texturesByteLength: number;
  26874. /**
  26875. * Gets the amount of memory used by the batch table textures, in bytes.
  26876. */
  26877. readonly batchTableByteLength: number;
  26878. /**
  26879. * 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.
  26880. */
  26881. readonly innerContents: any[];
  26882. /**
  26883. * Gets the promise that will be resolved when the tile's content is ready to render.
  26884. */
  26885. readonly readyPromise: Promise<Cesium3DTileContent>;
  26886. /**
  26887. * Gets the tileset for this tile.
  26888. */
  26889. readonly tileset: Cesium3DTileset;
  26890. /**
  26891. * Gets the tile containing this content.
  26892. */
  26893. readonly tile: Cesium3DTile;
  26894. /**
  26895. * Gets the url of the tile's content.
  26896. */
  26897. readonly url: string;
  26898. /**
  26899. * Returns whether the feature has this property.
  26900. * @param batchId - The batchId for the feature.
  26901. * @param name - The case-sensitive name of the property.
  26902. * @returns <code>true</code> if the feature has this property; otherwise, <code>false</code>.
  26903. */
  26904. hasProperty(batchId: number, name: string): boolean;
  26905. /**
  26906. * Returns the {@link Cesium3DTileFeature} object for the feature with the
  26907. * given <code>batchId</code>. This object is used to get and modify the
  26908. * feature's properties.
  26909. * <p>
  26910. * Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
  26911. * </p>
  26912. * @param batchId - The batchId for the feature.
  26913. * @returns The corresponding {@link Cesium3DTileFeature} object.
  26914. */
  26915. getFeature(batchId: number): Cesium3DTileFeature;
  26916. }
  26917. /**
  26918. * A feature of a {@link Cesium3DTileset}.
  26919. * <p>
  26920. * Provides access to a feature's properties stored in the tile's batch table, as well
  26921. * as the ability to show/hide a feature and change its highlight color via
  26922. * {@link Cesium3DTileFeature#show} and {@link Cesium3DTileFeature#color}, respectively.
  26923. * </p>
  26924. * <p>
  26925. * Modifications to a <code>Cesium3DTileFeature</code> object have the lifetime of the tile's
  26926. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  26927. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  26928. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  26929. * </p>
  26930. * <p>
  26931. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  26932. * or picking using {@link Scene#pick}.
  26933. * </p>
  26934. * @example
  26935. * // On mouse over, display all the properties for a feature in the console log.
  26936. * handler.setInputAction(function(movement) {
  26937. * const feature = scene.pick(movement.endPosition);
  26938. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  26939. * const propertyNames = feature.getPropertyNames();
  26940. * const length = propertyNames.length;
  26941. * for (let i = 0; i < length; ++i) {
  26942. * const propertyName = propertyNames[i];
  26943. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  26944. * }
  26945. * }
  26946. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  26947. */
  26948. export class Cesium3DTileFeature {
  26949. constructor();
  26950. /**
  26951. * Gets or sets if the feature will be shown. This is set for all features
  26952. * when a style's show is evaluated.
  26953. */
  26954. show: boolean;
  26955. /**
  26956. * Gets or sets the highlight color multiplied with the feature's color. When
  26957. * this is white, the feature's color is not changed. This is set for all features
  26958. * when a style's color is evaluated.
  26959. */
  26960. color: Color;
  26961. /**
  26962. * Gets a typed array containing the ECEF positions of the polyline.
  26963. * Returns undefined if {@link Cesium3DTileset#vectorKeepDecodedPositions} is false
  26964. * or the feature is not a polyline in a vector tile.
  26965. */
  26966. polylinePositions: Float64Array;
  26967. /**
  26968. * Gets the tileset containing the feature.
  26969. */
  26970. readonly tileset: Cesium3DTileset;
  26971. /**
  26972. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  26973. * the tileset containing the feature.
  26974. */
  26975. readonly primitive: Cesium3DTileset;
  26976. /**
  26977. * Get the feature ID associated with this feature. For 3D Tiles 1.0, the
  26978. * batch ID is returned. For EXT_mesh_features, this is the feature ID from
  26979. * the selected feature ID set.
  26980. */
  26981. readonly featureId: number;
  26982. /**
  26983. * Returns whether the feature contains this property. This includes properties from this feature's
  26984. * class and inherited classes when using a batch table hierarchy.
  26985. * @param name - The case-sensitive name of the property.
  26986. * @returns Whether the feature contains this property.
  26987. */
  26988. hasProperty(name: string): boolean;
  26989. /**
  26990. * Returns an array of property names for the feature. This includes properties from this feature's
  26991. * class and inherited classes when using a batch table hierarchy.
  26992. * @param [results] - An array into which to store the results.
  26993. * @returns The names of the feature's properties.
  26994. */
  26995. getPropertyNames(results?: string[]): string[];
  26996. /**
  26997. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  26998. * class and inherited classes when using a batch table hierarchy.
  26999. * @example
  27000. * // Display all the properties for a feature in the console log.
  27001. * const propertyNames = feature.getPropertyNames();
  27002. * const length = propertyNames.length;
  27003. * for (let i = 0; i < length; ++i) {
  27004. * const propertyName = propertyNames[i];
  27005. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  27006. * }
  27007. * @param name - The case-sensitive name of the property.
  27008. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  27009. */
  27010. getProperty(name: string): any;
  27011. /**
  27012. * Returns a copy of the feature's property with the given name, examining all
  27013. * the metadata from 3D Tiles 1.0 formats, the EXT_structural_metadata and legacy
  27014. * EXT_feature_metadata glTF extensions, and the metadata present either in the
  27015. * tileset JSON (3D Tiles 1.1) or in the 3DTILES_metadata 3D Tiles extension.
  27016. * Metadata is checked against name from most specific to most general and the
  27017. * first match is returned. Metadata is checked in this order:
  27018. *
  27019. * <ol>
  27020. * <li>Batch table (structural metadata) property by semantic</li>
  27021. * <li>Batch table (structural metadata) property by property ID</li>
  27022. * <li>Content metadata property by semantic</li>
  27023. * <li>Content metadata property by property</li>
  27024. * <li>Tile metadata property by semantic</li>
  27025. * <li>Tile metadata property by property ID</li>
  27026. * <li>Subtree metadata property by semantic</li>
  27027. * <li>Subtree metadata property by property ID</li>
  27028. * <li>Group metadata property by semantic</li>
  27029. * <li>Group metadata property by property ID</li>
  27030. * <li>Tileset metadata property by semantic</li>
  27031. * <li>Tileset metadata property by property ID</li>
  27032. * <li>Otherwise, return undefined</li>
  27033. * </ol>
  27034. * <p>
  27035. * For 3D Tiles Next details, see the {@link https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata|3DTILES_metadata Extension}
  27036. * for 3D Tiles, as well as the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension}
  27037. * for glTF. For the legacy glTF extension, see {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension}
  27038. * </p>
  27039. * @param content - The content for accessing the metadata
  27040. * @param batchId - The batch ID (or feature ID) of the feature to get a property for
  27041. * @param name - The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.
  27042. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  27043. */
  27044. static getPropertyInherited(content: Cesium3DTileContent, batchId: number, name: string): any;
  27045. /**
  27046. * Sets the value of the feature's property with the given name.
  27047. * <p>
  27048. * If a property with the given name doesn't exist, it is created.
  27049. * </p>
  27050. * @example
  27051. * const height = feature.getProperty('Height'); // e.g., the height of a building
  27052. * @example
  27053. * const name = 'clicked';
  27054. * if (feature.getProperty(name)) {
  27055. * console.log('already clicked');
  27056. * } else {
  27057. * feature.setProperty(name, true);
  27058. * console.log('first click');
  27059. * }
  27060. * @param name - The case-sensitive name of the property.
  27061. * @param value - The value of the property that will be copied.
  27062. */
  27063. setProperty(name: string, value: any): void;
  27064. }
  27065. /**
  27066. * A point feature of a {@link Cesium3DTileset}.
  27067. * <p>
  27068. * Provides access to a feature's properties stored in the tile's batch table, as well
  27069. * as the ability to show/hide a feature and change its point properties
  27070. * </p>
  27071. * <p>
  27072. * Modifications to a <code>Cesium3DTilePointFeature</code> object have the lifetime of the tile's
  27073. * content. If the tile's content is unloaded, e.g., due to it going out of view and needing
  27074. * to free space in the cache for visible tiles, listen to the {@link Cesium3DTileset#tileUnload} event to save any
  27075. * modifications. Also listen to the {@link Cesium3DTileset#tileVisible} event to reapply any modifications.
  27076. * </p>
  27077. * <p>
  27078. * Do not construct this directly. Access it through {@link Cesium3DTileContent#getFeature}
  27079. * or picking using {@link Scene#pick} and {@link Scene#pickPosition}.
  27080. * </p>
  27081. * @example
  27082. * // On mouse over, display all the properties for a feature in the console log.
  27083. * handler.setInputAction(function(movement) {
  27084. * const feature = scene.pick(movement.endPosition);
  27085. * if (feature instanceof Cesium.Cesium3DTilePointFeature) {
  27086. * const propertyNames = feature.getPropertyNames();
  27087. * const length = propertyNames.length;
  27088. * for (let i = 0; i < length; ++i) {
  27089. * const propertyName = propertyNames[i];
  27090. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  27091. * }
  27092. * }
  27093. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  27094. */
  27095. export class Cesium3DTilePointFeature {
  27096. constructor();
  27097. /**
  27098. * Gets or sets if the feature will be shown. This is set for all features
  27099. * when a style's show is evaluated.
  27100. */
  27101. show: boolean;
  27102. /**
  27103. * Gets or sets the color of the point of this feature.
  27104. * <p>
  27105. * Only applied when <code>image</code> is <code>undefined</code>.
  27106. * </p>
  27107. */
  27108. color: Color;
  27109. /**
  27110. * Gets or sets the point size of this feature.
  27111. * <p>
  27112. * Only applied when <code>image</code> is <code>undefined</code>.
  27113. * </p>
  27114. */
  27115. pointSize: number;
  27116. /**
  27117. * Gets or sets the point outline color of this feature.
  27118. * <p>
  27119. * Only applied when <code>image</code> is <code>undefined</code>.
  27120. * </p>
  27121. */
  27122. pointOutlineColor: Color;
  27123. /**
  27124. * Gets or sets the point outline width in pixels of this feature.
  27125. * <p>
  27126. * Only applied when <code>image</code> is <code>undefined</code>.
  27127. * </p>
  27128. */
  27129. pointOutlineWidth: number;
  27130. /**
  27131. * Gets or sets the label color of this feature.
  27132. * <p>
  27133. * The color will be applied to the label if <code>labelText</code> is defined.
  27134. * </p>
  27135. */
  27136. labelColor: Color;
  27137. /**
  27138. * Gets or sets the label outline color of this feature.
  27139. * <p>
  27140. * The outline color will be applied to the label if <code>labelText</code> is defined.
  27141. * </p>
  27142. */
  27143. labelOutlineColor: Color;
  27144. /**
  27145. * Gets or sets the outline width in pixels of this feature.
  27146. * <p>
  27147. * The outline width will be applied to the point if <code>labelText</code> is defined.
  27148. * </p>
  27149. */
  27150. labelOutlineWidth: number;
  27151. /**
  27152. * Gets or sets the font of this feature.
  27153. * <p>
  27154. * Only applied when the <code>labelText</code> is defined.
  27155. * </p>
  27156. */
  27157. font: string;
  27158. /**
  27159. * Gets or sets the fill and outline style of this feature.
  27160. * <p>
  27161. * Only applied when <code>labelText</code> is defined.
  27162. * </p>
  27163. */
  27164. labelStyle: LabelStyle;
  27165. /**
  27166. * Gets or sets the text for this feature.
  27167. */
  27168. labelText: string;
  27169. /**
  27170. * Gets or sets the background color of the text for this feature.
  27171. * <p>
  27172. * Only applied when <code>labelText</code> is defined.
  27173. * </p>
  27174. */
  27175. backgroundColor: Color;
  27176. /**
  27177. * Gets or sets the background padding of the text for this feature.
  27178. * <p>
  27179. * Only applied when <code>labelText</code> is defined.
  27180. * </p>
  27181. */
  27182. backgroundPadding: Cartesian2;
  27183. /**
  27184. * Gets or sets whether to display the background of the text for this feature.
  27185. * <p>
  27186. * Only applied when <code>labelText</code> is defined.
  27187. * </p>
  27188. */
  27189. backgroundEnabled: boolean;
  27190. /**
  27191. * Gets or sets the near and far scaling properties for this feature.
  27192. */
  27193. scaleByDistance: NearFarScalar;
  27194. /**
  27195. * Gets or sets the near and far translucency properties for this feature.
  27196. */
  27197. translucencyByDistance: NearFarScalar;
  27198. /**
  27199. * Gets or sets the condition specifying at what distance from the camera that this feature will be displayed.
  27200. */
  27201. distanceDisplayCondition: DistanceDisplayCondition;
  27202. /**
  27203. * Gets or sets the height offset in meters of this feature.
  27204. */
  27205. heightOffset: number;
  27206. /**
  27207. * Gets or sets whether the anchor line is displayed.
  27208. * <p>
  27209. * Only applied when <code>heightOffset</code> is defined.
  27210. * </p>
  27211. */
  27212. anchorLineEnabled: boolean;
  27213. /**
  27214. * Gets or sets the color for the anchor line.
  27215. * <p>
  27216. * Only applied when <code>heightOffset</code> is defined.
  27217. * </p>
  27218. */
  27219. anchorLineColor: Color;
  27220. /**
  27221. * Gets or sets the image of this feature.
  27222. */
  27223. image: string;
  27224. /**
  27225. * Gets or sets the distance where depth testing will be disabled.
  27226. */
  27227. disableDepthTestDistance: number;
  27228. /**
  27229. * Gets or sets the horizontal origin of this point, which determines if the point is
  27230. * to the left, center, or right of its anchor position.
  27231. */
  27232. horizontalOrigin: HorizontalOrigin;
  27233. /**
  27234. * Gets or sets the vertical origin of this point, which determines if the point is
  27235. * to the bottom, center, or top of its anchor position.
  27236. */
  27237. verticalOrigin: VerticalOrigin;
  27238. /**
  27239. * Gets or sets the horizontal origin of this point's text, which determines if the point's text is
  27240. * to the left, center, or right of its anchor position.
  27241. */
  27242. labelHorizontalOrigin: HorizontalOrigin;
  27243. /**
  27244. * Get or sets the vertical origin of this point's text, which determines if the point's text is
  27245. * to the bottom, center, top, or baseline of it's anchor point.
  27246. */
  27247. labelVerticalOrigin: VerticalOrigin;
  27248. /**
  27249. * Gets the tileset containing the feature.
  27250. */
  27251. readonly tileset: Cesium3DTileset;
  27252. /**
  27253. * All objects returned by {@link Scene#pick} have a <code>primitive</code> property. This returns
  27254. * the tileset containing the feature.
  27255. */
  27256. readonly primitive: Cesium3DTileset;
  27257. /**
  27258. * Returns whether the feature contains this property. This includes properties from this feature's
  27259. * class and inherited classes when using a batch table hierarchy.
  27260. * @param name - The case-sensitive name of the property.
  27261. * @returns Whether the feature contains this property.
  27262. */
  27263. hasProperty(name: string): boolean;
  27264. /**
  27265. * Returns an array of property names for the feature. This includes properties from this feature's
  27266. * class and inherited classes when using a batch table hierarchy.
  27267. * @param [results] - An array into which to store the results.
  27268. * @returns The names of the feature's properties.
  27269. */
  27270. getPropertyNames(results?: string[]): string[];
  27271. /**
  27272. * Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's
  27273. * class and inherited classes when using a batch table hierarchy.
  27274. * @example
  27275. * // Display all the properties for a feature in the console log.
  27276. * const propertyNames = feature.getPropertyNames();
  27277. * const length = propertyNames.length;
  27278. * for (let i = 0; i < length; ++i) {
  27279. * const propertyName = propertyNames[i];
  27280. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  27281. * }
  27282. * @param name - The case-sensitive name of the property.
  27283. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  27284. */
  27285. getProperty(name: string): any;
  27286. /**
  27287. * Sets the value of the feature's property with the given name.
  27288. * <p>
  27289. * If a property with the given name doesn't exist, it is created.
  27290. * </p>
  27291. * @example
  27292. * const height = feature.getProperty('Height'); // e.g., the height of a building
  27293. * @example
  27294. * const name = 'clicked';
  27295. * if (feature.getProperty(name)) {
  27296. * console.log('already clicked');
  27297. * } else {
  27298. * feature.setProperty(name, true);
  27299. * console.log('first click');
  27300. * }
  27301. * @param name - The case-sensitive name of the property.
  27302. * @param value - The value of the property that will be copied.
  27303. */
  27304. setProperty(name: string, value: any): void;
  27305. }
  27306. /**
  27307. * A style that is applied to a {@link Cesium3DTileset}.
  27308. * <p>
  27309. * Evaluates an expression defined using the
  27310. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  27311. * </p>
  27312. * @example
  27313. * tileset.style = new Cesium.Cesium3DTileStyle({
  27314. * color : {
  27315. * conditions : [
  27316. * ['${Height} >= 100', 'color("purple", 0.5)'],
  27317. * ['${Height} >= 50', 'color("red")'],
  27318. * ['true', 'color("blue")']
  27319. * ]
  27320. * },
  27321. * show : '${Height} > 0',
  27322. * meta : {
  27323. * description : '"Building id ${id} has height ${Height}."'
  27324. * }
  27325. * });
  27326. * @example
  27327. * tileset.style = new Cesium.Cesium3DTileStyle({
  27328. * color : 'vec4(${Temperature})',
  27329. * pointSize : '${Temperature} * 2.0'
  27330. * });
  27331. * @param [style] - An object defining a style.
  27332. */
  27333. export class Cesium3DTileStyle {
  27334. constructor(style?: any);
  27335. /**
  27336. * Gets the object defining the style using the
  27337. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  27338. */
  27339. readonly style: any;
  27340. /**
  27341. * When <code>true</code>, the style is ready and its expressions can be evaluated. When
  27342. * a style is constructed with an object, as opposed to a url, this is <code>true</code> immediately.
  27343. */
  27344. readonly ready: boolean;
  27345. /**
  27346. * Gets the promise that will be resolved when the the style is ready and its expressions can be evaluated.
  27347. */
  27348. readonly readyPromise: Promise<Cesium3DTileStyle>;
  27349. /**
  27350. * 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.
  27351. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27352. * <p>
  27353. * The expression must return or convert to a <code>Boolean</code>.
  27354. * </p>
  27355. * <p>
  27356. * This expression is applicable to all tile formats.
  27357. * </p>
  27358. * @example
  27359. * const style = new Cesium3DTileStyle({
  27360. * show : '(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)'
  27361. * });
  27362. * style.show.evaluate(feature); // returns true or false depending on the feature's properties
  27363. * @example
  27364. * const style = new Cesium.Cesium3DTileStyle();
  27365. * // Override show expression with a custom function
  27366. * style.show = {
  27367. * evaluate : function(feature) {
  27368. * return true;
  27369. * }
  27370. * };
  27371. * @example
  27372. * const style = new Cesium.Cesium3DTileStyle();
  27373. * // Override show expression with a boolean
  27374. * style.show = true;
  27375. * };
  27376. * @example
  27377. * const style = new Cesium.Cesium3DTileStyle();
  27378. * // Override show expression with a string
  27379. * style.show = '${Height} > 0';
  27380. * };
  27381. * @example
  27382. * const style = new Cesium.Cesium3DTileStyle();
  27383. * // Override show expression with a condition
  27384. * style.show = {
  27385. * conditions: [
  27386. * ['${height} > 2', 'false'],
  27387. * ['true', 'true']
  27388. * ];
  27389. * };
  27390. */
  27391. show: StyleExpression;
  27392. /**
  27393. * 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.
  27394. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27395. * <p>
  27396. * The expression must return a <code>Color</code>.
  27397. * </p>
  27398. * <p>
  27399. * This expression is applicable to all tile formats.
  27400. * </p>
  27401. * @example
  27402. * const style = new Cesium3DTileStyle({
  27403. * color : '(${Temperature} > 90) ? color("red") : color("white")'
  27404. * });
  27405. * style.color.evaluateColor(feature, result); // returns a Cesium.Color object
  27406. * @example
  27407. * const style = new Cesium.Cesium3DTileStyle();
  27408. * // Override color expression with a custom function
  27409. * style.color = {
  27410. * evaluateColor : function(feature, result) {
  27411. * return Cesium.Color.clone(Cesium.Color.WHITE, result);
  27412. * }
  27413. * };
  27414. * @example
  27415. * const style = new Cesium.Cesium3DTileStyle();
  27416. * // Override color expression with a string
  27417. * style.color = 'color("blue")';
  27418. * @example
  27419. * const style = new Cesium.Cesium3DTileStyle();
  27420. * // Override color expression with a condition
  27421. * style.color = {
  27422. * conditions : [
  27423. * ['${height} > 2', 'color("cyan")'],
  27424. * ['true', 'color("blue")']
  27425. * ]
  27426. * };
  27427. */
  27428. color: StyleExpression;
  27429. /**
  27430. * 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.
  27431. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27432. * <p>
  27433. * The expression must return a <code>Number</code>.
  27434. * </p>
  27435. * <p>
  27436. * This expression is only applicable to point features in a Vector tile or a Point Cloud tile.
  27437. * </p>
  27438. * @example
  27439. * const style = new Cesium3DTileStyle({
  27440. * pointSize : '(${Temperature} > 90) ? 2.0 : 1.0'
  27441. * });
  27442. * style.pointSize.evaluate(feature); // returns a Number
  27443. * @example
  27444. * const style = new Cesium.Cesium3DTileStyle();
  27445. * // Override pointSize expression with a custom function
  27446. * style.pointSize = {
  27447. * evaluate : function(feature) {
  27448. * return 1.0;
  27449. * }
  27450. * };
  27451. * @example
  27452. * const style = new Cesium.Cesium3DTileStyle();
  27453. * // Override pointSize expression with a number
  27454. * style.pointSize = 1.0;
  27455. * @example
  27456. * const style = new Cesium.Cesium3DTileStyle();
  27457. * // Override pointSize expression with a string
  27458. * style.pointSize = '${height} / 10';
  27459. * @example
  27460. * const style = new Cesium.Cesium3DTileStyle();
  27461. * // Override pointSize expression with a condition
  27462. * style.pointSize = {
  27463. * conditions : [
  27464. * ['${height} > 2', '1.0'],
  27465. * ['true', '2.0']
  27466. * ]
  27467. * };
  27468. */
  27469. pointSize: StyleExpression;
  27470. /**
  27471. * 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.
  27472. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27473. * <p>
  27474. * The expression must return a <code>Color</code>.
  27475. * </p>
  27476. * <p>
  27477. * This expression is only applicable to point features in a Vector tile.
  27478. * </p>
  27479. * @example
  27480. * const style = new Cesium.Cesium3DTileStyle();
  27481. * // Override pointOutlineColor expression with a string
  27482. * style.pointOutlineColor = 'color("blue")';
  27483. * @example
  27484. * const style = new Cesium.Cesium3DTileStyle();
  27485. * // Override pointOutlineColor expression with a condition
  27486. * style.pointOutlineColor = {
  27487. * conditions : [
  27488. * ['${height} > 2', 'color("cyan")'],
  27489. * ['true', 'color("blue")']
  27490. * ]
  27491. * };
  27492. */
  27493. pointOutlineColor: StyleExpression;
  27494. /**
  27495. * 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.
  27496. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27497. * <p>
  27498. * The expression must return a <code>Number</code>.
  27499. * </p>
  27500. * <p>
  27501. * This expression is only applicable to point features in a Vector tile.
  27502. * </p>
  27503. * @example
  27504. * const style = new Cesium.Cesium3DTileStyle();
  27505. * // Override pointOutlineWidth expression with a string
  27506. * style.pointOutlineWidth = '5';
  27507. * @example
  27508. * const style = new Cesium.Cesium3DTileStyle();
  27509. * // Override pointOutlineWidth expression with a condition
  27510. * style.pointOutlineWidth = {
  27511. * conditions : [
  27512. * ['${height} > 2', '5'],
  27513. * ['true', '0']
  27514. * ]
  27515. * };
  27516. */
  27517. pointOutlineWidth: StyleExpression;
  27518. /**
  27519. * 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.
  27520. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27521. * <p>
  27522. * The expression must return a <code>Color</code>.
  27523. * </p>
  27524. * <p>
  27525. * This expression is only applicable to point features in a Vector tile.
  27526. * </p>
  27527. * @example
  27528. * const style = new Cesium.Cesium3DTileStyle();
  27529. * // Override labelColor expression with a string
  27530. * style.labelColor = 'color("blue")';
  27531. * @example
  27532. * const style = new Cesium.Cesium3DTileStyle();
  27533. * // Override labelColor expression with a condition
  27534. * style.labelColor = {
  27535. * conditions : [
  27536. * ['${height} > 2', 'color("cyan")'],
  27537. * ['true', 'color("blue")']
  27538. * ]
  27539. * };
  27540. */
  27541. labelColor: StyleExpression;
  27542. /**
  27543. * 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.
  27544. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27545. * <p>
  27546. * The expression must return a <code>Color</code>.
  27547. * </p>
  27548. * <p>
  27549. * This expression is only applicable to point features in a Vector tile.
  27550. * </p>
  27551. * @example
  27552. * const style = new Cesium.Cesium3DTileStyle();
  27553. * // Override labelOutlineColor expression with a string
  27554. * style.labelOutlineColor = 'color("blue")';
  27555. * @example
  27556. * const style = new Cesium.Cesium3DTileStyle();
  27557. * // Override labelOutlineColor expression with a condition
  27558. * style.labelOutlineColor = {
  27559. * conditions : [
  27560. * ['${height} > 2', 'color("cyan")'],
  27561. * ['true', 'color("blue")']
  27562. * ]
  27563. * };
  27564. */
  27565. labelOutlineColor: StyleExpression;
  27566. /**
  27567. * 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.
  27568. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27569. * <p>
  27570. * The expression must return a <code>Number</code>.
  27571. * </p>
  27572. * <p>
  27573. * This expression is only applicable to point features in a Vector tile.
  27574. * </p>
  27575. * @example
  27576. * const style = new Cesium.Cesium3DTileStyle();
  27577. * // Override labelOutlineWidth expression with a string
  27578. * style.labelOutlineWidth = '5';
  27579. * @example
  27580. * const style = new Cesium.Cesium3DTileStyle();
  27581. * // Override labelOutlineWidth expression with a condition
  27582. * style.labelOutlineWidth = {
  27583. * conditions : [
  27584. * ['${height} > 2', '5'],
  27585. * ['true', '0']
  27586. * ]
  27587. * };
  27588. */
  27589. labelOutlineWidth: StyleExpression;
  27590. /**
  27591. * 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.
  27592. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27593. * <p>
  27594. * The expression must return a <code>String</code>.
  27595. * </p>
  27596. * <p>
  27597. * This expression is only applicable to point features in a Vector tile.
  27598. * </p>
  27599. * @example
  27600. * const style = new Cesium3DTileStyle({
  27601. * font : '(${Temperature} > 90) ? "30px Helvetica" : "24px Helvetica"'
  27602. * });
  27603. * style.font.evaluate(feature); // returns a String
  27604. * @example
  27605. * const style = new Cesium.Cesium3DTileStyle();
  27606. * // Override font expression with a custom function
  27607. * style.font = {
  27608. * evaluate : function(feature) {
  27609. * return '24px Helvetica';
  27610. * }
  27611. * };
  27612. */
  27613. font: StyleExpression;
  27614. /**
  27615. * 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.
  27616. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27617. * <p>
  27618. * The expression must return a <code>LabelStyle</code>.
  27619. * </p>
  27620. * <p>
  27621. * This expression is only applicable to point features in a Vector tile.
  27622. * </p>
  27623. * @example
  27624. * const style = new Cesium3DTileStyle({
  27625. * labelStyle : '(${Temperature} > 90) ? ' + LabelStyle.FILL_AND_OUTLINE + ' : ' + LabelStyle.FILL
  27626. * });
  27627. * style.labelStyle.evaluate(feature); // returns a LabelStyle
  27628. * @example
  27629. * const style = new Cesium.Cesium3DTileStyle();
  27630. * // Override labelStyle expression with a custom function
  27631. * style.labelStyle = {
  27632. * evaluate : function(feature) {
  27633. * return LabelStyle.FILL;
  27634. * }
  27635. * };
  27636. */
  27637. labelStyle: StyleExpression;
  27638. /**
  27639. * 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.
  27640. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27641. * <p>
  27642. * The expression must return a <code>String</code>.
  27643. * </p>
  27644. * <p>
  27645. * This expression is only applicable to point features in a Vector tile.
  27646. * </p>
  27647. * @example
  27648. * const style = new Cesium3DTileStyle({
  27649. * labelText : '(${Temperature} > 90) ? ">90" : "<=90"'
  27650. * });
  27651. * style.labelText.evaluate(feature); // returns a String
  27652. * @example
  27653. * const style = new Cesium.Cesium3DTileStyle();
  27654. * // Override labelText expression with a custom function
  27655. * style.labelText = {
  27656. * evaluate : function(feature) {
  27657. * return 'Example label text';
  27658. * }
  27659. * };
  27660. */
  27661. labelText: StyleExpression;
  27662. /**
  27663. * 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.
  27664. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27665. * <p>
  27666. * The expression must return a <code>Color</code>.
  27667. * </p>
  27668. * <p>
  27669. * This expression is only applicable to point features in a Vector tile.
  27670. * </p>
  27671. * @example
  27672. * const style = new Cesium.Cesium3DTileStyle();
  27673. * // Override backgroundColor expression with a string
  27674. * style.backgroundColor = 'color("blue")';
  27675. * @example
  27676. * const style = new Cesium.Cesium3DTileStyle();
  27677. * // Override backgroundColor expression with a condition
  27678. * style.backgroundColor = {
  27679. * conditions : [
  27680. * ['${height} > 2', 'color("cyan")'],
  27681. * ['true', 'color("blue")']
  27682. * ]
  27683. * };
  27684. */
  27685. backgroundColor: StyleExpression;
  27686. /**
  27687. * 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.
  27688. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27689. * <p>
  27690. * The expression must return a <code>Cartesian2</code>.
  27691. * </p>
  27692. * <p>
  27693. * This expression is only applicable to point features in a Vector tile.
  27694. * </p>
  27695. * @example
  27696. * const style = new Cesium.Cesium3DTileStyle();
  27697. * // Override backgroundPadding expression with a string
  27698. * style.backgroundPadding = 'vec2(5.0, 7.0)';
  27699. * style.backgroundPadding.evaluate(feature); // returns a Cartesian2
  27700. */
  27701. backgroundPadding: StyleExpression;
  27702. /**
  27703. * 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.
  27704. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27705. * <p>
  27706. * The expression must return a <code>Boolean</code>.
  27707. * </p>
  27708. * <p>
  27709. * This expression is only applicable to point features in a Vector tile.
  27710. * </p>
  27711. * @example
  27712. * const style = new Cesium.Cesium3DTileStyle();
  27713. * // Override backgroundEnabled expression with a string
  27714. * style.backgroundEnabled = 'true';
  27715. * @example
  27716. * const style = new Cesium.Cesium3DTileStyle();
  27717. * // Override backgroundEnabled expression with a condition
  27718. * style.backgroundEnabled = {
  27719. * conditions : [
  27720. * ['${height} > 2', 'true'],
  27721. * ['true', 'false']
  27722. * ]
  27723. * };
  27724. */
  27725. backgroundEnabled: StyleExpression;
  27726. /**
  27727. * 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.
  27728. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27729. * <p>
  27730. * The expression must return a <code>Cartesian4</code>.
  27731. * </p>
  27732. * <p>
  27733. * This expression is only applicable to point features in a Vector tile.
  27734. * </p>
  27735. * @example
  27736. * const style = new Cesium.Cesium3DTileStyle();
  27737. * // Override scaleByDistance expression with a string
  27738. * style.scaleByDistance = 'vec4(1.5e2, 2.0, 1.5e7, 0.5)';
  27739. * style.scaleByDistance.evaluate(feature); // returns a Cartesian4
  27740. */
  27741. scaleByDistance: StyleExpression;
  27742. /**
  27743. * 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.
  27744. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27745. * <p>
  27746. * The expression must return a <code>Cartesian4</code>.
  27747. * </p>
  27748. * <p>
  27749. * This expression is only applicable to point features in a Vector tile.
  27750. * </p>
  27751. * @example
  27752. * const style = new Cesium.Cesium3DTileStyle();
  27753. * // Override translucencyByDistance expression with a string
  27754. * style.translucencyByDistance = 'vec4(1.5e2, 1.0, 1.5e7, 0.2)';
  27755. * style.translucencyByDistance.evaluate(feature); // returns a Cartesian4
  27756. */
  27757. translucencyByDistance: StyleExpression;
  27758. /**
  27759. * 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.
  27760. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27761. * <p>
  27762. * The expression must return a <code>Cartesian2</code>.
  27763. * </p>
  27764. * <p>
  27765. * This expression is only applicable to point features in a Vector tile.
  27766. * </p>
  27767. * @example
  27768. * const style = new Cesium.Cesium3DTileStyle();
  27769. * // Override distanceDisplayCondition expression with a string
  27770. * style.distanceDisplayCondition = 'vec2(0.0, 5.5e6)';
  27771. * style.distanceDisplayCondition.evaluate(feature); // returns a Cartesian2
  27772. */
  27773. distanceDisplayCondition: StyleExpression;
  27774. /**
  27775. * 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.
  27776. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27777. * <p>
  27778. * The expression must return a <code>Number</code>.
  27779. * </p>
  27780. * <p>
  27781. * This expression is only applicable to point features in a Vector tile.
  27782. * </p>
  27783. * @example
  27784. * const style = new Cesium.Cesium3DTileStyle();
  27785. * // Override heightOffset expression with a string
  27786. * style.heightOffset = '2.0';
  27787. * @example
  27788. * const style = new Cesium.Cesium3DTileStyle();
  27789. * // Override heightOffset expression with a condition
  27790. * style.heightOffset = {
  27791. * conditions : [
  27792. * ['${height} > 2', '4.0'],
  27793. * ['true', '2.0']
  27794. * ]
  27795. * };
  27796. */
  27797. heightOffset: StyleExpression;
  27798. /**
  27799. * 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.
  27800. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27801. * <p>
  27802. * The expression must return a <code>Boolean</code>.
  27803. * </p>
  27804. * <p>
  27805. * This expression is only applicable to point features in a Vector tile.
  27806. * </p>
  27807. * @example
  27808. * const style = new Cesium.Cesium3DTileStyle();
  27809. * // Override anchorLineEnabled expression with a string
  27810. * style.anchorLineEnabled = 'true';
  27811. * @example
  27812. * const style = new Cesium.Cesium3DTileStyle();
  27813. * // Override anchorLineEnabled expression with a condition
  27814. * style.anchorLineEnabled = {
  27815. * conditions : [
  27816. * ['${height} > 2', 'true'],
  27817. * ['true', 'false']
  27818. * ]
  27819. * };
  27820. */
  27821. anchorLineEnabled: StyleExpression;
  27822. /**
  27823. * 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.
  27824. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27825. * <p>
  27826. * The expression must return a <code>Color</code>.
  27827. * </p>
  27828. * <p>
  27829. * This expression is only applicable to point features in a Vector tile.
  27830. * </p>
  27831. * @example
  27832. * const style = new Cesium.Cesium3DTileStyle();
  27833. * // Override anchorLineColor expression with a string
  27834. * style.anchorLineColor = 'color("blue")';
  27835. * @example
  27836. * const style = new Cesium.Cesium3DTileStyle();
  27837. * // Override anchorLineColor expression with a condition
  27838. * style.anchorLineColor = {
  27839. * conditions : [
  27840. * ['${height} > 2', 'color("cyan")'],
  27841. * ['true', 'color("blue")']
  27842. * ]
  27843. * };
  27844. */
  27845. anchorLineColor: StyleExpression;
  27846. /**
  27847. * 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.
  27848. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27849. * <p>
  27850. * The expression must return a <code>String</code>.
  27851. * </p>
  27852. * <p>
  27853. * This expression is only applicable to point features in a Vector tile.
  27854. * </p>
  27855. * @example
  27856. * const style = new Cesium3DTileStyle({
  27857. * image : '(${Temperature} > 90) ? "/url/to/image1" : "/url/to/image2"'
  27858. * });
  27859. * style.image.evaluate(feature); // returns a String
  27860. * @example
  27861. * const style = new Cesium.Cesium3DTileStyle();
  27862. * // Override image expression with a custom function
  27863. * style.image = {
  27864. * evaluate : function(feature) {
  27865. * return '/url/to/image';
  27866. * }
  27867. * };
  27868. */
  27869. image: StyleExpression;
  27870. /**
  27871. * 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.
  27872. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27873. * <p>
  27874. * The expression must return a <code>Number</code>.
  27875. * </p>
  27876. * <p>
  27877. * This expression is only applicable to point features in a Vector tile.
  27878. * </p>
  27879. * @example
  27880. * const style = new Cesium.Cesium3DTileStyle();
  27881. * // Override disableDepthTestDistance expression with a string
  27882. * style.disableDepthTestDistance = '1000.0';
  27883. * style.disableDepthTestDistance.evaluate(feature); // returns a Number
  27884. */
  27885. disableDepthTestDistance: StyleExpression;
  27886. /**
  27887. * 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.
  27888. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27889. * <p>
  27890. * The expression must return a <code>HorizontalOrigin</code>.
  27891. * </p>
  27892. * <p>
  27893. * This expression is only applicable to point features in a Vector tile.
  27894. * </p>
  27895. * @example
  27896. * const style = new Cesium3DTileStyle({
  27897. * horizontalOrigin : HorizontalOrigin.LEFT
  27898. * });
  27899. * style.horizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27900. * @example
  27901. * const style = new Cesium.Cesium3DTileStyle();
  27902. * // Override horizontalOrigin expression with a custom function
  27903. * style.horizontalOrigin = {
  27904. * evaluate : function(feature) {
  27905. * return HorizontalOrigin.CENTER;
  27906. * }
  27907. * };
  27908. */
  27909. horizontalOrigin: StyleExpression;
  27910. /**
  27911. * 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.
  27912. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27913. * <p>
  27914. * The expression must return a <code>VerticalOrigin</code>.
  27915. * </p>
  27916. * <p>
  27917. * This expression is only applicable to point features in a Vector tile.
  27918. * </p>
  27919. * @example
  27920. * const style = new Cesium3DTileStyle({
  27921. * verticalOrigin : VerticalOrigin.TOP
  27922. * });
  27923. * style.verticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27924. * @example
  27925. * const style = new Cesium.Cesium3DTileStyle();
  27926. * // Override verticalOrigin expression with a custom function
  27927. * style.verticalOrigin = {
  27928. * evaluate : function(feature) {
  27929. * return VerticalOrigin.CENTER;
  27930. * }
  27931. * };
  27932. */
  27933. verticalOrigin: StyleExpression;
  27934. /**
  27935. * 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.
  27936. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27937. * <p>
  27938. * The expression must return a <code>HorizontalOrigin</code>.
  27939. * </p>
  27940. * <p>
  27941. * This expression is only applicable to point features in a Vector tile.
  27942. * </p>
  27943. * @example
  27944. * const style = new Cesium3DTileStyle({
  27945. * labelHorizontalOrigin : HorizontalOrigin.LEFT
  27946. * });
  27947. * style.labelHorizontalOrigin.evaluate(feature); // returns a HorizontalOrigin
  27948. * @example
  27949. * const style = new Cesium.Cesium3DTileStyle();
  27950. * // Override labelHorizontalOrigin expression with a custom function
  27951. * style.labelHorizontalOrigin = {
  27952. * evaluate : function(feature) {
  27953. * return HorizontalOrigin.CENTER;
  27954. * }
  27955. * };
  27956. */
  27957. labelHorizontalOrigin: StyleExpression;
  27958. /**
  27959. * 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.
  27960. * The getter will return the internal {@link Expression} or {@link ConditionsExpression}, which may differ from the value provided to the setter.
  27961. * <p>
  27962. * The expression must return a <code>VerticalOrigin</code>.
  27963. * </p>
  27964. * <p>
  27965. * This expression is only applicable to point features in a Vector tile.
  27966. * </p>
  27967. * @example
  27968. * const style = new Cesium3DTileStyle({
  27969. * labelVerticalOrigin : VerticalOrigin.TOP
  27970. * });
  27971. * style.labelVerticalOrigin.evaluate(feature); // returns a VerticalOrigin
  27972. * @example
  27973. * const style = new Cesium.Cesium3DTileStyle();
  27974. * // Override labelVerticalOrigin expression with a custom function
  27975. * style.labelVerticalOrigin = {
  27976. * evaluate : function(feature) {
  27977. * return VerticalOrigin.CENTER;
  27978. * }
  27979. * };
  27980. */
  27981. labelVerticalOrigin: StyleExpression;
  27982. /**
  27983. * Gets or sets the object containing application-specific expression that can be explicitly
  27984. * evaluated, e.g., for display in a UI.
  27985. * @example
  27986. * const style = new Cesium3DTileStyle({
  27987. * meta : {
  27988. * description : '"Building id ${id} has height ${Height}."'
  27989. * }
  27990. * });
  27991. * style.meta.description.evaluate(feature); // returns a String with the substituted variables
  27992. */
  27993. meta: StyleExpression;
  27994. }
  27995. /**
  27996. * A {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification|3D Tiles tileset},
  27997. * used for streaming massive heterogeneous 3D geospatial datasets.
  27998. * @example
  27999. * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  28000. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  28001. * }));
  28002. * @example
  28003. * // Common setting for the skipLevelOfDetail optimization
  28004. * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  28005. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  28006. * skipLevelOfDetail : true,
  28007. * baseScreenSpaceError : 1024,
  28008. * skipScreenSpaceErrorFactor : 16,
  28009. * skipLevels : 1,
  28010. * immediatelyLoadDesiredLevelOfDetail : false,
  28011. * loadSiblings : false,
  28012. * cullWithChildrenBounds : true
  28013. * }));
  28014. * @example
  28015. * // Common settings for the dynamicScreenSpaceError optimization
  28016. * const tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
  28017. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
  28018. * dynamicScreenSpaceError : true,
  28019. * dynamicScreenSpaceErrorDensity : 0.00278,
  28020. * dynamicScreenSpaceErrorFactor : 4.0,
  28021. * dynamicScreenSpaceErrorHeightFalloff : 0.25
  28022. * }));
  28023. * @param options - Object with the following properties:
  28024. * @param options.url - The url to a tileset JSON file.
  28025. * @param [options.show = true] - Determines if the tileset will be shown.
  28026. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the tileset's root tile.
  28027. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the tileset casts or receives shadows from light sources.
  28028. * @param [options.maximumScreenSpaceError = 16] - The maximum screen space error used to drive level of detail refinement.
  28029. * @param [options.maximumMemoryUsage = 512] - The maximum amount of memory in MB that can be used by the tileset.
  28030. * @param [options.cullWithChildrenBounds = true] - Optimization option. Whether to cull tiles using the union of their children bounding volumes.
  28031. * @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.
  28032. * @param [options.cullRequestsWhileMovingMultiplier = 60.0] - Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  28033. * @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.
  28034. * @param [options.preloadFlightDestinations = true] - Optimization option. Preload tiles at the camera's flight destination while the camera is in flight.
  28035. * @param [options.preferLeaves = false] - Optimization option. Prefer loading of leaves first.
  28036. * @param [options.dynamicScreenSpaceError = false] - Optimization option. Reduce the screen space error for tiles that are further away from the camera.
  28037. * @param [options.dynamicScreenSpaceErrorDensity = 0.00278] - Density used to adjust the dynamic screen space error, similar to fog density.
  28038. * @param [options.dynamicScreenSpaceErrorFactor = 4.0] - A factor used to increase the computed dynamic screen space error.
  28039. * @param [options.dynamicScreenSpaceErrorHeightFalloff = 0.25] - A ratio of the tileset's height at which the density starts to falloff.
  28040. * @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.
  28041. * @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.
  28042. * @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.
  28043. * @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}.
  28044. * @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}
  28045. * @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.
  28046. * @param [options.skipLevelOfDetail = false] - Optimization option. Determines if level of detail skipping should be applied during the traversal.
  28047. * @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.
  28048. * @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.
  28049. * @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.
  28050. * @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.
  28051. * @param [options.loadSiblings = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
  28052. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  28053. * @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.
  28054. * @param [options.ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe.
  28055. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
  28056. * @param [options.lightColor] - The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  28057. * @param [options.imageBasedLighting] - The properties for managing image-based lighting for this tileset.
  28058. * @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.
  28059. * @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.
  28060. * @param [options.vectorClassificationOnly = false] - Indicates that only the tileset's vector tiles should be used for classification.
  28061. * @param [options.vectorKeepDecodedPositions = false] - Whether vector tiles should keep decoded positions in memory. This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
  28062. * @param [options.featureIdLabel = "featureId_0"] - Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
  28063. * @param [options.instanceFeatureIdLabel = "instanceFeatureId_0"] - Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
  28064. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this tileset on screen.
  28065. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this tileset.
  28066. * @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.
  28067. * @param [options.debugFreezeFrame = false] - For debugging only. Determines if only the tiles from last frame should be used for rendering.
  28068. * @param [options.debugColorizeTiles = false] - For debugging only. When true, assigns a random color to each tile.
  28069. * @param [options.enableDebugWireframe] - For debugging only. This must be true for debugWireframe to work for ModelExperimental in WebGL1. This cannot be set after the tileset has loaded.
  28070. * @param [options.debugWireframe = false] - For debugging only. When true, render's each tile's content as a wireframe.
  28071. * @param [options.debugShowBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile.
  28072. * @param [options.debugShowContentBoundingVolume = false] - For debugging only. When true, renders the bounding volume for each tile's content.
  28073. * @param [options.debugShowViewerRequestVolume = false] - For debugging only. When true, renders the viewer request volume for each tile.
  28074. * @param [options.debugShowGeometricError = false] - For debugging only. When true, draws labels to indicate the geometric error of each tile.
  28075. * @param [options.debugShowRenderingStatistics = false] - For debugging only. When true, draws labels to indicate the number of commands, points, triangles and features for each tile.
  28076. * @param [options.debugShowMemoryUsage = false] - For debugging only. When true, draws labels to indicate the texture and geometry memory in megabytes used by each tile.
  28077. * @param [options.debugShowUrl = false] - For debugging only. When true, draws labels to indicate the url of each tile.
  28078. */
  28079. export class Cesium3DTileset {
  28080. constructor(options: {
  28081. url: Resource | string | Promise<Resource> | Promise<string>;
  28082. show?: boolean;
  28083. modelMatrix?: Matrix4;
  28084. shadows?: ShadowMode;
  28085. maximumScreenSpaceError?: number;
  28086. maximumMemoryUsage?: number;
  28087. cullWithChildrenBounds?: boolean;
  28088. cullRequestsWhileMoving?: boolean;
  28089. cullRequestsWhileMovingMultiplier?: number;
  28090. preloadWhenHidden?: boolean;
  28091. preloadFlightDestinations?: boolean;
  28092. preferLeaves?: boolean;
  28093. dynamicScreenSpaceError?: boolean;
  28094. dynamicScreenSpaceErrorDensity?: number;
  28095. dynamicScreenSpaceErrorFactor?: number;
  28096. dynamicScreenSpaceErrorHeightFalloff?: number;
  28097. progressiveResolutionHeightFraction?: number;
  28098. foveatedScreenSpaceError?: boolean;
  28099. foveatedConeSize?: number;
  28100. foveatedMinimumScreenSpaceErrorRelaxation?: number;
  28101. foveatedInterpolationCallback?: Cesium3DTileset.foveatedInterpolationCallback;
  28102. foveatedTimeDelay?: number;
  28103. skipLevelOfDetail?: boolean;
  28104. baseScreenSpaceError?: number;
  28105. skipScreenSpaceErrorFactor?: number;
  28106. skipLevels?: number;
  28107. immediatelyLoadDesiredLevelOfDetail?: boolean;
  28108. loadSiblings?: boolean;
  28109. clippingPlanes?: ClippingPlaneCollection;
  28110. classificationType?: ClassificationType;
  28111. ellipsoid?: Ellipsoid;
  28112. pointCloudShading?: any;
  28113. lightColor?: Cartesian3;
  28114. imageBasedLighting?: ImageBasedLighting;
  28115. backFaceCulling?: boolean;
  28116. showOutline?: boolean;
  28117. vectorClassificationOnly?: boolean;
  28118. vectorKeepDecodedPositions?: boolean;
  28119. featureIdLabel?: string | number;
  28120. instanceFeatureIdLabel?: string | number;
  28121. showCreditsOnScreen?: boolean;
  28122. splitDirection?: SplitDirection;
  28123. debugHeatmapTilePropertyName?: string;
  28124. debugFreezeFrame?: boolean;
  28125. debugColorizeTiles?: boolean;
  28126. enableDebugWireframe?: boolean;
  28127. debugWireframe?: boolean;
  28128. debugShowBoundingVolume?: boolean;
  28129. debugShowContentBoundingVolume?: boolean;
  28130. debugShowViewerRequestVolume?: boolean;
  28131. debugShowGeometricError?: boolean;
  28132. debugShowRenderingStatistics?: boolean;
  28133. debugShowMemoryUsage?: boolean;
  28134. debugShowUrl?: boolean;
  28135. });
  28136. /**
  28137. * 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.
  28138. */
  28139. cullRequestsWhileMoving: boolean;
  28140. /**
  28141. * Optimization option. Multiplier used in culling requests while moving. Larger is more aggressive culling, smaller less aggressive culling.
  28142. */
  28143. cullRequestsWhileMovingMultiplier: number;
  28144. /**
  28145. * 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.
  28146. */
  28147. progressiveResolutionHeightFraction: number;
  28148. /**
  28149. * Optimization option. Prefer loading of leaves first.
  28150. */
  28151. preferLeaves: boolean;
  28152. /**
  28153. * Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
  28154. */
  28155. preloadWhenHidden: boolean;
  28156. /**
  28157. * Optimization option. Fetch tiles at the camera's flight destination while the camera is in flight.
  28158. */
  28159. preloadFlightDestinations: boolean;
  28160. /**
  28161. * Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further
  28162. * away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer
  28163. * tiles and making less requests, but may result in a slight drop in visual quality for tiles in the distance.
  28164. * The algorithm is biased towards "street views" where the camera is close to the ground plane of the tileset and looking
  28165. * at the horizon. In addition results are more accurate for tightly fitting bounding volumes like box and region.
  28166. */
  28167. dynamicScreenSpaceError: boolean;
  28168. /**
  28169. * Optimization option. Prioritize loading tiles in the center of the screen by temporarily raising the
  28170. * screen space error for tiles around the edge of the screen. Screen space error returns to normal once all
  28171. * the tiles in the center of the screen as determined by the {@link Cesium3DTileset#foveatedConeSize} are loaded.
  28172. */
  28173. foveatedScreenSpaceError: boolean;
  28174. /**
  28175. * Gets or sets a callback to control how much to raise the screen space error for tiles outside the foveated cone,
  28176. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  28177. */
  28178. foveatedInterpolationCallback: Cesium3DTileset.foveatedInterpolationCallback;
  28179. /**
  28180. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control
  28181. * how long in seconds to wait after the camera stops moving before deferred tiles start loading in.
  28182. * This time delay prevents requesting tiles around the edges of the screen when the camera is moving.
  28183. * Setting this to 0.0 will immediately request all tiles in any given view.
  28184. */
  28185. foveatedTimeDelay: number;
  28186. /**
  28187. * A scalar that determines the density used to adjust the dynamic screen space error, similar to {@link Fog}. Increasing this
  28188. * value has the effect of increasing the maximum screen space error for all tiles, but in a non-linear fashion.
  28189. * The error starts at 0.0 and increases exponentially until a midpoint is reached, and then approaches 1.0 asymptotically.
  28190. * This has the effect of keeping high detail in the closer tiles and lower detail in the further tiles, with all tiles
  28191. * beyond a certain distance all roughly having an error of 1.0.
  28192. * <p>
  28193. * The dynamic error is in the range [0.0, 1.0) and is multiplied by <code>dynamicScreenSpaceErrorFactor</code> to produce the
  28194. * final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.
  28195. * </p>
  28196. * <p>
  28197. * Increasing <code>dynamicScreenSpaceErrorDensity</code> has the effect of moving the error midpoint closer to the camera.
  28198. * It is analogous to moving fog closer to the camera.
  28199. * </p>
  28200. */
  28201. dynamicScreenSpaceErrorDensity: number;
  28202. /**
  28203. * A factor used to increase the screen space error of tiles for dynamic screen space error. As this value increases less tiles
  28204. * are requested for rendering and tiles in the distance will have lower detail. If set to zero, the feature will be disabled.
  28205. */
  28206. dynamicScreenSpaceErrorFactor: number;
  28207. /**
  28208. * A ratio of the tileset's height at which the density starts to falloff. If the camera is below this height the
  28209. * full computed density is applied, otherwise the density falls off. This has the effect of higher density at
  28210. * street level views.
  28211. * <p>
  28212. * Valid values are between 0.0 and 1.0.
  28213. * </p>
  28214. */
  28215. dynamicScreenSpaceErrorHeightFalloff: number;
  28216. /**
  28217. * Determines whether the tileset casts or receives shadows from light sources.
  28218. * <p>
  28219. * 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.
  28220. * </p>
  28221. * <p>
  28222. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  28223. * </p>
  28224. */
  28225. shadows: ShadowMode;
  28226. /**
  28227. * Determines if the tileset will be shown.
  28228. */
  28229. show: boolean;
  28230. /**
  28231. * Defines how per-feature colors set from the Cesium API or declarative styling blend with the source colors from
  28232. * the original feature, e.g. glTF material or per-point color in the tile.
  28233. */
  28234. colorBlendMode: Cesium3DTileColorBlendMode;
  28235. /**
  28236. * Defines the value used to linearly interpolate between the source color and feature color when the {@link Cesium3DTileset#colorBlendMode} is <code>MIX</code>.
  28237. * 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
  28238. * resulting in a mix of the source color and feature color.
  28239. */
  28240. colorBlendAmount: number;
  28241. /**
  28242. * The event fired to indicate progress of loading new tiles. This event is fired when a new tile
  28243. * is requested, when a requested tile is finished downloading, and when a downloaded tile has been
  28244. * processed and is ready to render.
  28245. * <p>
  28246. * The number of pending tile requests, <code>numberOfPendingRequests</code>, and number of tiles
  28247. * processing, <code>numberOfTilesProcessing</code> are passed to the event listener.
  28248. * </p>
  28249. * <p>
  28250. * This event is fired at the end of the frame after the scene is rendered.
  28251. * </p>
  28252. * @example
  28253. * tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
  28254. * if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
  28255. * console.log('Stopped loading');
  28256. * return;
  28257. * }
  28258. *
  28259. * console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing);
  28260. * });
  28261. */
  28262. loadProgress: Event;
  28263. /**
  28264. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The tileset
  28265. * is completely loaded for this view.
  28266. * <p>
  28267. * This event is fired at the end of the frame after the scene is rendered.
  28268. * </p>
  28269. * @example
  28270. * tileset.allTilesLoaded.addEventListener(function() {
  28271. * console.log('All tiles are loaded');
  28272. * });
  28273. */
  28274. allTilesLoaded: Event;
  28275. /**
  28276. * The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
  28277. * is fired once when all tiles in the initial view are loaded.
  28278. * <p>
  28279. * This event is fired at the end of the frame after the scene is rendered.
  28280. * </p>
  28281. * @example
  28282. * tileset.initialTilesLoaded.addEventListener(function() {
  28283. * console.log('Initial tiles are loaded');
  28284. * });
  28285. */
  28286. initialTilesLoaded: Event;
  28287. /**
  28288. * The event fired to indicate that a tile's content was loaded.
  28289. * <p>
  28290. * The loaded {@link Cesium3DTile} is passed to the event listener.
  28291. * </p>
  28292. * <p>
  28293. * This event is fired during the tileset traversal while the frame is being rendered
  28294. * so that updates to the tile take effect in the same frame. Do not create or modify
  28295. * Cesium entities or primitives during the event listener.
  28296. * </p>
  28297. * @example
  28298. * tileset.tileLoad.addEventListener(function(tile) {
  28299. * console.log('A tile was loaded.');
  28300. * });
  28301. */
  28302. tileLoad: Event;
  28303. /**
  28304. * The event fired to indicate that a tile's content was unloaded.
  28305. * <p>
  28306. * The unloaded {@link Cesium3DTile} is passed to the event listener.
  28307. * </p>
  28308. * <p>
  28309. * This event is fired immediately before the tile's content is unloaded while the frame is being
  28310. * rendered so that the event listener has access to the tile's content. Do not create
  28311. * or modify Cesium entities or primitives during the event listener.
  28312. * </p>
  28313. * @example
  28314. * tileset.tileUnload.addEventListener(function(tile) {
  28315. * console.log('A tile was unloaded from the cache.');
  28316. * });
  28317. */
  28318. tileUnload: Event;
  28319. /**
  28320. * The event fired to indicate that a tile's content failed to load.
  28321. * <p>
  28322. * If there are no event listeners, error messages will be logged to the console.
  28323. * </p>
  28324. * <p>
  28325. * The error object passed to the listener contains two properties:
  28326. * <ul>
  28327. * <li><code>url</code>: the url of the failed tile.</li>
  28328. * <li><code>message</code>: the error message.</li>
  28329. * </ul>
  28330. * <p>
  28331. * If multiple contents are present, this event is raised once per inner content with errors.
  28332. * </p>
  28333. * @example
  28334. * tileset.tileFailed.addEventListener(function(error) {
  28335. * console.log('An error occurred loading tile: ' + error.url);
  28336. * console.log('Error: ' + error.message);
  28337. * });
  28338. */
  28339. tileFailed: Event;
  28340. /**
  28341. * This event fires once for each visible tile in a frame. This can be used to manually
  28342. * style a tileset.
  28343. * <p>
  28344. * The visible {@link Cesium3DTile} is passed to the event listener.
  28345. * </p>
  28346. * <p>
  28347. * This event is fired during the tileset traversal while the frame is being rendered
  28348. * so that updates to the tile take effect in the same frame. Do not create or modify
  28349. * Cesium entities or primitives during the event listener.
  28350. * </p>
  28351. * @example
  28352. * tileset.tileVisible.addEventListener(function(tile) {
  28353. * if (tile.content instanceof Cesium.Batched3DModel3DTileContent) {
  28354. * console.log('A Batched 3D Model tile is visible.');
  28355. * }
  28356. * });
  28357. * @example
  28358. * // Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
  28359. * tileset.style = new Cesium.Cesium3DTileStyle({
  28360. * color : 'color("red")'
  28361. * });
  28362. * tileset.tileVisible.addEventListener(function(tile) {
  28363. * const content = tile.content;
  28364. * const featuresLength = content.featuresLength;
  28365. * for (let i = 0; i < featuresLength; i+=2) {
  28366. * content.getFeature(i).color = Cesium.Color.fromRandom();
  28367. * }
  28368. * });
  28369. */
  28370. tileVisible: Event;
  28371. /**
  28372. * Optimization option. Determines if level of detail skipping should be applied during the traversal.
  28373. * <p>
  28374. * The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require
  28375. * all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped
  28376. * entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when
  28377. * using this optimization.
  28378. * </p>
  28379. */
  28380. skipLevelOfDetail: boolean;
  28381. /**
  28382. * The screen space error that must be reached before skipping levels of detail.
  28383. * <p>
  28384. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28385. * </p>
  28386. */
  28387. baseScreenSpaceError: number;
  28388. /**
  28389. * Multiplier defining the minimum screen space error to skip.
  28390. * For example, if a tile has screen space error of 100, no tiles will be loaded unless they
  28391. * are leaves or have a screen space error <code><= 100 / skipScreenSpaceErrorFactor</code>.
  28392. * <p>
  28393. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28394. * </p>
  28395. */
  28396. skipScreenSpaceErrorFactor: number;
  28397. /**
  28398. * Constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped.
  28399. * For example, if a tile is level 1, no tiles will be loaded unless they are at level greater than 2.
  28400. * <p>
  28401. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28402. * </p>
  28403. */
  28404. skipLevels: number;
  28405. /**
  28406. * When true, only tiles that meet the maximum screen space error will ever be downloaded.
  28407. * Skipping factors are ignored and just the desired tiles are loaded.
  28408. * <p>
  28409. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28410. * </p>
  28411. */
  28412. immediatelyLoadDesiredLevelOfDetail: boolean;
  28413. /**
  28414. * Determines whether siblings of visible tiles are always downloaded during traversal.
  28415. * This may be useful for ensuring that tiles are already available when the viewer turns left/right.
  28416. * <p>
  28417. * Only used when {@link Cesium3DTileset#skipLevelOfDetail} is <code>true</code>.
  28418. * </p>
  28419. */
  28420. loadSiblings: boolean;
  28421. /**
  28422. * The light color when shading models. When <code>undefined</code> the scene's light color is used instead.
  28423. * <p>
  28424. * For example, disabling additional light sources by setting
  28425. * <code>tileset.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code>
  28426. * will make the tileset much darker. Here, increasing the intensity of the light source will make the tileset brighter.
  28427. * </p>
  28428. */
  28429. lightColor: Cartesian3;
  28430. /**
  28431. * Whether to cull back-facing geometry. When true, back face culling is determined
  28432. * by the glTF material's doubleSided property; when false, back face culling is disabled.
  28433. */
  28434. backFaceCulling: boolean;
  28435. /**
  28436. * Whether to display the outline for models using the
  28437. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.
  28438. * When true, outlines are displayed. When false, outlines are not displayed.
  28439. */
  28440. readonly showOutline: boolean;
  28441. /**
  28442. * The {@link SplitDirection} to apply to this tileset.
  28443. */
  28444. splitDirection: SplitDirection;
  28445. /**
  28446. * This property is for debugging only; it is not optimized for production use.
  28447. * <p>
  28448. * Determines if only the tiles from last frame should be used for rendering. This
  28449. * effectively "freezes" the tileset to the previous frame so it is possible to zoom
  28450. * out and see what was rendered.
  28451. * </p>
  28452. */
  28453. debugFreezeFrame: boolean;
  28454. /**
  28455. * This property is for debugging only; it is not optimized for production use.
  28456. * <p>
  28457. * When true, assigns a random color to each tile. This is useful for visualizing
  28458. * what features belong to what tiles, especially with additive refinement where features
  28459. * from parent tiles may be interleaved with features from child tiles.
  28460. * </p>
  28461. */
  28462. debugColorizeTiles: boolean;
  28463. /**
  28464. * This property is for debugging only; it is not optimized for production use.
  28465. * <p>
  28466. * When true, renders each tile's content as a wireframe.
  28467. * </p>
  28468. */
  28469. debugWireframe: boolean;
  28470. /**
  28471. * This property is for debugging only; it is not optimized for production use.
  28472. * <p>
  28473. * When true, renders the bounding volume for each visible tile. The bounding volume is
  28474. * white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the
  28475. * screen space error and are still refining to their descendants are yellow.
  28476. * </p>
  28477. */
  28478. debugShowBoundingVolume: boolean;
  28479. /**
  28480. * This property is for debugging only; it is not optimized for production use.
  28481. * <p>
  28482. * When true, renders the bounding volume for each visible tile's content. The bounding volume is
  28483. * blue if the tile has a content bounding volume; otherwise it is red.
  28484. * </p>
  28485. */
  28486. debugShowContentBoundingVolume: boolean;
  28487. /**
  28488. * This property is for debugging only; it is not optimized for production use.
  28489. * <p>
  28490. * When true, renders the viewer request volume for each tile.
  28491. * </p>
  28492. */
  28493. debugShowViewerRequestVolume: boolean;
  28494. /**
  28495. * This property is for debugging only; it is not optimized for production use.
  28496. * <p>
  28497. * When true, draws labels to indicate the geometric error of each tile.
  28498. * </p>
  28499. */
  28500. debugShowGeometricError: boolean;
  28501. /**
  28502. * This property is for debugging only; it is not optimized for production use.
  28503. * <p>
  28504. * When true, draws labels to indicate the number of commands, points, triangles and features of each tile.
  28505. * </p>
  28506. */
  28507. debugShowRenderingStatistics: boolean;
  28508. /**
  28509. * This property is for debugging only; it is not optimized for production use.
  28510. * <p>
  28511. * When true, draws labels to indicate the geometry and texture memory usage of each tile.
  28512. * </p>
  28513. */
  28514. debugShowMemoryUsage: boolean;
  28515. /**
  28516. * This property is for debugging only; it is not optimized for production use.
  28517. * <p>
  28518. * When true, draws labels to indicate the url of each tile.
  28519. * </p>
  28520. */
  28521. debugShowUrl: boolean;
  28522. /**
  28523. * Function for examining vector lines as they are being streamed.
  28524. */
  28525. examineVectorLinesFunction: (...params: any[]) => any;
  28526. /**
  28527. * Gets the tileset's asset object property, which contains metadata about the tileset.
  28528. * <p>
  28529. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-asset|asset schema reference}
  28530. * in the 3D Tiles spec for the full set of properties.
  28531. * </p>
  28532. */
  28533. readonly asset: any;
  28534. /**
  28535. * Gets the tileset's extensions object property.
  28536. */
  28537. readonly extensions: any;
  28538. /**
  28539. * The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
  28540. */
  28541. clippingPlanes: ClippingPlaneCollection;
  28542. /**
  28543. * Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
  28544. * <p>
  28545. * See the {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#reference-properties|properties schema reference}
  28546. * in the 3D Tiles spec for the full set of properties.
  28547. * </p>
  28548. * @example
  28549. * console.log('Maximum building height: ' + tileset.properties.height.maximum);
  28550. * console.log('Minimum building height: ' + tileset.properties.height.minimum);
  28551. */
  28552. readonly properties: any;
  28553. /**
  28554. * When <code>true</code>, the tileset's root tile is loaded and the tileset is ready to render.
  28555. * This is set to <code>true</code> right before {@link Cesium3DTileset#readyPromise} is resolved.
  28556. */
  28557. readonly ready: boolean;
  28558. /**
  28559. * Gets the promise that will be resolved when the tileset's root tile is loaded and the tileset is ready to render.
  28560. * <p>
  28561. * This promise is resolved at the end of the frame before the first frame the tileset is rendered in.
  28562. * </p>
  28563. * @example
  28564. * tileset.readyPromise.then(function(tileset) {
  28565. * // tile.properties is not defined until readyPromise resolves.
  28566. * const properties = tileset.properties;
  28567. * if (Cesium.defined(properties)) {
  28568. * for (const name in properties) {
  28569. * console.log(properties[name]);
  28570. * }
  28571. * }
  28572. * });
  28573. */
  28574. readonly readyPromise: Promise<Cesium3DTileset>;
  28575. /**
  28576. * When <code>true</code>, all tiles that meet the screen space error this frame are loaded. The tileset is
  28577. * completely loaded for this view.
  28578. */
  28579. readonly tilesLoaded: boolean;
  28580. /**
  28581. * The resource used to fetch the tileset JSON file
  28582. */
  28583. readonly resource: Resource;
  28584. /**
  28585. * The base path that non-absolute paths in tileset JSON file are relative to.
  28586. */
  28587. readonly basePath: string;
  28588. /**
  28589. * The style, defined using the
  28590. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},
  28591. * applied to each feature in the tileset.
  28592. * <p>
  28593. * Assign <code>undefined</code> to remove the style, which will restore the visual
  28594. * appearance of the tileset to its default when no style was applied.
  28595. * </p>
  28596. * <p>
  28597. * The style is applied to a tile before the {@link Cesium3DTileset#tileVisible}
  28598. * event is raised, so code in <code>tileVisible</code> can manually set a feature's
  28599. * properties (e.g. color and show) after the style is applied. When
  28600. * a new style is assigned any manually set properties are overwritten.
  28601. * </p>
  28602. * <p>
  28603. * Use an always "true" condition to specify the Color for all objects that are not
  28604. * overridden by pre-existing conditions. Otherwise, the default color Cesium.Color.White
  28605. * will be used. Similarly, use an always "true" condition to specify the show property
  28606. * for all objects that are not overridden by pre-existing conditions. Otherwise, the
  28607. * default show value true will be used.
  28608. * </p>
  28609. * @example
  28610. * tileset.style = new Cesium.Cesium3DTileStyle({
  28611. * color : {
  28612. * conditions : [
  28613. * ['${Height} >= 100', 'color("purple", 0.5)'],
  28614. * ['${Height} >= 50', 'color("red")'],
  28615. * ['true', 'color("blue")']
  28616. * ]
  28617. * },
  28618. * show : '${Height} > 0',
  28619. * meta : {
  28620. * description : '"Building id ${id} has height ${Height}."'
  28621. * }
  28622. * });
  28623. */
  28624. style: Cesium3DTileStyle | undefined;
  28625. /**
  28626. * A custom shader to apply to all tiles in the tileset. Only used for
  28627. * contents that use {@link ModelExperimental}. Using custom shaders with a
  28628. * {@link Cesium3DTileStyle} may lead to undefined behavior.
  28629. * <p>
  28630. * To enable {@link ModelExperimental}, set {@link ExperimentalFeatures.enableModelExperimental} or tileset.enableModelExperimental to <code>true</code>.
  28631. * </p>
  28632. */
  28633. customShader: CustomShader | undefined;
  28634. /**
  28635. * The maximum screen space error used to drive level of detail refinement. This value helps determine when a tile
  28636. * refines to its descendants, and therefore plays a major role in balancing performance with visual quality.
  28637. * <p>
  28638. * A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a
  28639. * radius equal to the tile's <b>geometric error</b> were rendered at the tile's position. If this value exceeds
  28640. * <code>maximumScreenSpaceError</code> the tile refines to its descendants.
  28641. * </p>
  28642. * <p>
  28643. * Depending on the tileset, <code>maximumScreenSpaceError</code> may need to be tweaked to achieve the right balance.
  28644. * Higher values provide better performance but lower visual quality.
  28645. * </p>
  28646. */
  28647. maximumScreenSpaceError: number;
  28648. /**
  28649. * The maximum amount of GPU memory (in MB) that may be used to cache tiles. This value is estimated from
  28650. * geometry, textures, and batch table textures of loaded tiles. For point clouds, this value also
  28651. * includes per-point metadata.
  28652. * <p>
  28653. * Tiles not in view are unloaded to enforce this.
  28654. * </p>
  28655. * <p>
  28656. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  28657. * </p>
  28658. * <p>
  28659. * If tiles sized more than <code>maximumMemoryUsage</code> are needed
  28660. * to meet the desired screen space error, determined by {@link Cesium3DTileset#maximumScreenSpaceError},
  28661. * for the current view, then the memory usage of the tiles loaded will exceed
  28662. * <code>maximumMemoryUsage</code>. For example, if the maximum is 256 MB, but
  28663. * 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When
  28664. * these tiles go out of view, they will be unloaded.
  28665. * </p>
  28666. */
  28667. maximumMemoryUsage: number;
  28668. /**
  28669. * Options for controlling point size based on geometric error and eye dome lighting.
  28670. */
  28671. pointCloudShading: PointCloudShading;
  28672. /**
  28673. * The root tile.
  28674. */
  28675. readonly root: Cesium3DTile;
  28676. /**
  28677. * The tileset's bounding sphere.
  28678. * @example
  28679. * const tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
  28680. * url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
  28681. * }));
  28682. *
  28683. * tileset.readyPromise.then(function(tileset) {
  28684. * // Set the camera to view the newly added tileset
  28685. * viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
  28686. * });
  28687. */
  28688. readonly boundingSphere: BoundingSphere;
  28689. /**
  28690. * A 4x4 transformation matrix that transforms the entire tileset.
  28691. * @example
  28692. * // Adjust a tileset's height from the globe's surface.
  28693. * const heightOffset = 20.0;
  28694. * const boundingSphere = tileset.boundingSphere;
  28695. * const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  28696. * const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
  28697. * const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
  28698. * const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  28699. * tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  28700. */
  28701. modelMatrix: Matrix4;
  28702. /**
  28703. * Returns the time, in milliseconds, since the tileset was loaded and first updated.
  28704. */
  28705. readonly timeSinceLoad: number;
  28706. /**
  28707. * The total amount of GPU memory in bytes used by the tileset. This value is estimated from
  28708. * geometry, texture, and batch table textures of loaded tiles. For point clouds, this value also
  28709. * includes per-point metadata.
  28710. */
  28711. readonly totalMemoryUsageInBytes: number;
  28712. /**
  28713. * Determines whether terrain, 3D Tiles or both will be classified by this tileset.
  28714. * <p>
  28715. * This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data
  28716. * must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets.
  28717. * </p>
  28718. * <p>
  28719. * When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF:
  28720. * <ul>
  28721. * <li>POSITION and _BATCHID semantics are required.</li>
  28722. * <li>All indices with the same batch id must occupy contiguous sections of the index buffer.</li>
  28723. * <li>All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.</li>
  28724. * <li>The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.</li>
  28725. * <li>Only one node is supported.</li>
  28726. * <li>Only one mesh per node is supported.</li>
  28727. * <li>Only one primitive per mesh is supported.</li>
  28728. * </ul>
  28729. * </p>
  28730. */
  28731. readonly classificationType: ClassificationType;
  28732. /**
  28733. * Gets an ellipsoid describing the shape of the globe.
  28734. */
  28735. readonly ellipsoid: Ellipsoid;
  28736. /**
  28737. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the cone size that determines which tiles are deferred.
  28738. * 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}.
  28739. * 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.
  28740. */
  28741. foveatedConeSize: number;
  28742. /**
  28743. * Optimization option. Used when {@link Cesium3DTileset#foveatedScreenSpaceError} is true to control the starting screen space error relaxation for tiles outside the foveated cone.
  28744. * The screen space error will be raised starting with this value up to {@link Cesium3DTileset#maximumScreenSpaceError} based on the provided {@link Cesium3DTileset#foveatedInterpolationCallback}.
  28745. */
  28746. foveatedMinimumScreenSpaceErrorRelaxation: number;
  28747. /**
  28748. * Returns the <code>extras</code> property at the top-level of the tileset JSON, which contains application specific metadata.
  28749. * Returns <code>undefined</code> if <code>extras</code> does not exist.
  28750. */
  28751. readonly extras: any;
  28752. /**
  28753. * The properties for managing image-based lighting on this tileset.
  28754. */
  28755. imageBasedLighting: ImageBasedLighting;
  28756. /**
  28757. * Indicates that only the tileset's vector tiles should be used for classification.
  28758. */
  28759. vectorClassificationOnly: boolean;
  28760. /**
  28761. * Whether vector tiles should keep decoded positions in memory.
  28762. * This is used with {@link Cesium3DTileFeature.getPolylinePositions}.
  28763. */
  28764. vectorKeepDecodedPositions: boolean;
  28765. /**
  28766. * Determines whether the credits of the tileset will be displayed on the screen
  28767. */
  28768. showCreditsOnScreen: boolean;
  28769. /**
  28770. * Label of the feature ID set to use for picking and styling.
  28771. * <p>
  28772. * For EXT_mesh_features, this is the feature ID's label property, or
  28773. * "featureId_N" (where N is the index in the featureIds array) when not
  28774. * specified. EXT_feature_metadata did not have a label field, so such
  28775. * feature ID sets are always labeled "featureId_N" where N is the index in
  28776. * the list of all feature Ids, where feature ID attributes are listed before
  28777. * feature ID textures.
  28778. * </p>
  28779. * <p>
  28780. * If featureIdLabel is set to an integer N, it is converted to
  28781. * the string "featureId_N" automatically. If both per-primitive and
  28782. * per-instance feature IDs are present, the instance feature IDs take
  28783. * priority.
  28784. * </p>
  28785. */
  28786. featureIdLabel: string;
  28787. /**
  28788. * Label of the instance feature ID set used for picking and styling.
  28789. * <p>
  28790. * If instanceFeatureIdLabel is set to an integer N, it is converted to
  28791. * the string "instanceFeatureId_N" automatically.
  28792. * If both per-primitive and per-instance feature IDs are present, the
  28793. * instance feature IDs take priority.
  28794. * </p>
  28795. */
  28796. instanceFeatureIdLabel: string;
  28797. /**
  28798. * Provides a hook to override the method used to request the tileset json
  28799. * useful when fetching tilesets from remote servers
  28800. * @param tilesetUrl - The url of the json file to be fetched
  28801. * @returns A promise that resolves with the fetched json data
  28802. */
  28803. static loadJson(tilesetUrl: Resource | string): Promise<object>;
  28804. /**
  28805. * Marks the tileset's {@link Cesium3DTileset#style} as dirty, which forces all
  28806. * features to re-evaluate the style in the next frame each is visible.
  28807. */
  28808. makeStyleDirty(): void;
  28809. /**
  28810. * Unloads all tiles that weren't selected the previous frame. This can be used to
  28811. * explicitly manage the tile cache and reduce the total number of tiles loaded below
  28812. * {@link Cesium3DTileset#maximumMemoryUsage}.
  28813. * <p>
  28814. * Tile unloads occur at the next frame to keep all the WebGL delete calls
  28815. * within the render loop.
  28816. * </p>
  28817. */
  28818. trimLoadedTiles(): void;
  28819. /**
  28820. * <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  28821. * @param extensionName - The name of the extension to check.
  28822. * @returns <code>true</code> if the tileset JSON file lists the extension in extensionsUsed; otherwise, <code>false</code>.
  28823. */
  28824. hasExtension(extensionName: string): boolean;
  28825. /**
  28826. * Returns true if this object was destroyed; otherwise, false.
  28827. * <br /><br />
  28828. * If this object was destroyed, it should not be used; calling any function other than
  28829. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  28830. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  28831. */
  28832. isDestroyed(): boolean;
  28833. /**
  28834. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  28835. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  28836. * <br /><br />
  28837. * Once an object is destroyed, it should not be used; calling any function other than
  28838. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  28839. * assign the return value (<code>undefined</code>) to the object as done in the example.
  28840. * @example
  28841. * tileset = tileset && tileset.destroy();
  28842. */
  28843. destroy(): void;
  28844. }
  28845. export namespace Cesium3DTileset {
  28846. /**
  28847. * 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,
  28848. * interpolating between {@link Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation} and {@link Cesium3DTileset#maximumScreenSpaceError}.
  28849. * @param p - The start value to interpolate.
  28850. * @param q - The end value to interpolate.
  28851. * @param time - The time of interpolation generally in the range <code>[0.0, 1.0]</code>.
  28852. */
  28853. type foveatedInterpolationCallback = (p: number, q: number, time: number) => number;
  28854. }
  28855. /**
  28856. * A ParticleEmitter that emits particles from a circle.
  28857. * Particles will be positioned within a circle and have initial velocities going along the z vector.
  28858. * @param [radius = 1.0] - The radius of the circle in meters.
  28859. */
  28860. export class CircleEmitter {
  28861. constructor(radius?: number);
  28862. /**
  28863. * The radius of the circle in meters.
  28864. */
  28865. radius: number;
  28866. /**
  28867. * The angle of the cone in radians.
  28868. */
  28869. angle: number;
  28870. }
  28871. /**
  28872. * A classification primitive represents a volume enclosing geometry in the {@link Scene} to be highlighted.
  28873. * <p>
  28874. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  28875. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  28876. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  28877. * and match most of them and add a new geometry or appearance independently of each other.
  28878. * Only {@link PerInstanceColorAppearance} with the same color across all instances is supported at this time when using
  28879. * ClassificationPrimitive directly.
  28880. * For full {@link Appearance} support when classifying terrain or 3D Tiles use {@link GroundPrimitive} instead.
  28881. * </p>
  28882. * <p>
  28883. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  28884. * will be rendering artifacts for some viewing angles.
  28885. * </p>
  28886. * <p>
  28887. * Valid geometries are {@link BoxGeometry}, {@link CylinderGeometry}, {@link EllipsoidGeometry}, {@link PolylineVolumeGeometry}, and {@link SphereGeometry}.
  28888. * </p>
  28889. * <p>
  28890. * Geometries that follow the surface of the ellipsoid, such as {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry},
  28891. * are also valid if they are extruded volumes; otherwise, they will not be rendered.
  28892. * </p>
  28893. * @param [options] - Object with the following properties:
  28894. * @param [options.geometryInstances] - The geometry instances to render. This can either be a single instance or an array of length one.
  28895. * @param [options.appearance] - The appearance used to render the primitive. Defaults to PerInstanceColorAppearance when GeometryInstances have a color attribute.
  28896. * @param [options.show = true] - Determines if this primitive will be shown.
  28897. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28898. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  28899. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  28900. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28901. * @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.
  28902. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  28903. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  28904. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  28905. * @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
  28906. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  28907. */
  28908. export class ClassificationPrimitive {
  28909. constructor(options?: {
  28910. geometryInstances?: any[] | GeometryInstance;
  28911. appearance?: Appearance;
  28912. show?: boolean;
  28913. vertexCacheOptimize?: boolean;
  28914. interleave?: boolean;
  28915. compressVertices?: boolean;
  28916. releaseGeometryInstances?: boolean;
  28917. allowPicking?: boolean;
  28918. asynchronous?: boolean;
  28919. classificationType?: ClassificationType;
  28920. debugShowBoundingVolume?: boolean;
  28921. debugShowShadowVolume?: boolean;
  28922. });
  28923. /**
  28924. * The geometry instance rendered with this primitive. This may
  28925. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  28926. * is <code>true</code> when the primitive is constructed.
  28927. * <p>
  28928. * Changing this property after the primitive is rendered has no effect.
  28929. * </p>
  28930. * <p>
  28931. * Because of the rendering technique used, all geometry instances must be the same color.
  28932. * If there is an instance with a differing color, a <code>DeveloperError</code> will be thrown
  28933. * on the first attempt to render.
  28934. * </p>
  28935. */
  28936. readonly geometryInstances: any[] | GeometryInstance;
  28937. /**
  28938. * Determines if the primitive will be shown. This affects all geometry
  28939. * instances in the primitive.
  28940. */
  28941. show: boolean;
  28942. /**
  28943. * Determines whether terrain, 3D Tiles or both will be classified.
  28944. */
  28945. classificationType: ClassificationType;
  28946. /**
  28947. * This property is for debugging only; it is not for production use nor is it optimized.
  28948. * <p>
  28949. * Draws the bounding sphere for each draw command in the primitive.
  28950. * </p>
  28951. */
  28952. debugShowBoundingVolume: boolean;
  28953. /**
  28954. * This property is for debugging only; it is not for production use nor is it optimized.
  28955. * <p>
  28956. * Draws the shadow volume for each geometry in the primitive.
  28957. * </p>
  28958. */
  28959. debugShowShadowVolume: boolean;
  28960. /**
  28961. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  28962. */
  28963. readonly vertexCacheOptimize: boolean;
  28964. /**
  28965. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  28966. */
  28967. readonly interleave: boolean;
  28968. /**
  28969. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  28970. */
  28971. readonly releaseGeometryInstances: boolean;
  28972. /**
  28973. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  28974. */
  28975. readonly allowPicking: boolean;
  28976. /**
  28977. * Determines if the geometry instances will be created and batched on a web worker.
  28978. */
  28979. readonly asynchronous: boolean;
  28980. /**
  28981. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  28982. */
  28983. readonly compressVertices: boolean;
  28984. /**
  28985. * Determines if the primitive is complete and ready to render. If this property is
  28986. * true, the primitive will be rendered the next time that {@link ClassificationPrimitive#update}
  28987. * is called.
  28988. */
  28989. readonly ready: boolean;
  28990. /**
  28991. * Gets a promise that resolves when the primitive is ready to render.
  28992. */
  28993. readonly readyPromise: Promise<ClassificationPrimitive>;
  28994. /**
  28995. * Determines if ClassificationPrimitive rendering is supported.
  28996. * @param scene - The scene.
  28997. * @returns <code>true</code> if ClassificationPrimitives are supported; otherwise, returns <code>false</code>
  28998. */
  28999. static isSupported(scene: Scene): boolean;
  29000. /**
  29001. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  29002. * get the draw commands needed to render this primitive.
  29003. * <p>
  29004. * Do not call this function directly. This is documented just to
  29005. * list the exceptions that may be propagated when the scene is rendered:
  29006. * </p>
  29007. */
  29008. update(): void;
  29009. /**
  29010. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  29011. * @example
  29012. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  29013. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  29014. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  29015. * @param id - The id of the {@link GeometryInstance}.
  29016. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  29017. */
  29018. getGeometryInstanceAttributes(id: any): any;
  29019. /**
  29020. * Returns true if this object was destroyed; otherwise, false.
  29021. * <p>
  29022. * If this object was destroyed, it should not be used; calling any function other than
  29023. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29024. * </p>
  29025. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29026. */
  29027. isDestroyed(): boolean;
  29028. /**
  29029. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29030. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29031. * <p>
  29032. * Once an object is destroyed, it should not be used; calling any function other than
  29033. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29034. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29035. * </p>
  29036. * @example
  29037. * e = e && e.destroy();
  29038. */
  29039. destroy(): void;
  29040. }
  29041. /**
  29042. * Whether a classification affects terrain, 3D Tiles or both.
  29043. */
  29044. export enum ClassificationType {
  29045. /**
  29046. * Only terrain will be classified.
  29047. */
  29048. TERRAIN = 0,
  29049. /**
  29050. * Only 3D Tiles will be classified.
  29051. */
  29052. CESIUM_3D_TILE = 1,
  29053. /**
  29054. * Both terrain and 3D Tiles will be classified.
  29055. */
  29056. BOTH = 2
  29057. }
  29058. /**
  29059. * A Plane in Hessian Normal form to be used with {@link ClippingPlaneCollection}.
  29060. * Compatible with mathematics functions in {@link Plane}
  29061. * @param normal - The plane's normal (normalized).
  29062. * @param distance - The shortest distance from the origin to the plane. The sign of
  29063. * <code>distance</code> determines which side of the plane the origin
  29064. * is on. If <code>distance</code> is positive, the origin is in the half-space
  29065. * in the direction of the normal; if negative, the origin is in the half-space
  29066. * opposite to the normal; if zero, the plane passes through the origin.
  29067. */
  29068. export class ClippingPlane {
  29069. constructor(normal: Cartesian3, distance: number);
  29070. /**
  29071. * The shortest distance from the origin to the plane. The sign of
  29072. * <code>distance</code> determines which side of the plane the origin
  29073. * is on. If <code>distance</code> is positive, the origin is in the half-space
  29074. * in the direction of the normal; if negative, the origin is in the half-space
  29075. * opposite to the normal; if zero, the plane passes through the origin.
  29076. */
  29077. distance: number;
  29078. /**
  29079. * The plane's normal.
  29080. */
  29081. normal: Cartesian3;
  29082. /**
  29083. * Create a ClippingPlane from a Plane object.
  29084. * @param plane - The plane containing parameters to copy
  29085. * @param [result] - The object on which to store the result
  29086. * @returns The ClippingPlane generated from the plane's parameters.
  29087. */
  29088. static fromPlane(plane: Plane, result?: ClippingPlane): ClippingPlane;
  29089. /**
  29090. * Clones the ClippingPlane without setting its ownership.
  29091. * @param clippingPlane - The ClippingPlane to be cloned
  29092. * @param [result] - The object on which to store the cloned parameters.
  29093. * @returns a clone of the input ClippingPlane
  29094. */
  29095. static clone(clippingPlane: ClippingPlane, result?: ClippingPlane): ClippingPlane;
  29096. }
  29097. /**
  29098. * Specifies a set of clipping planes. Clipping planes selectively disable rendering in a region on the
  29099. * outside of the specified list of {@link ClippingPlane} objects for a single gltf model, 3D Tileset, or the globe.
  29100. * <p>
  29101. * 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
  29102. * through the center of the object.
  29103. * </p>
  29104. * <p>
  29105. * 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.
  29106. * </p>
  29107. * @example
  29108. * // This clipping plane's distance is positive, which means its normal
  29109. * // is facing the origin. This will clip everything that is behind
  29110. * // the plane, which is anything with y coordinate < -5.
  29111. * const clippingPlanes = new Cesium.ClippingPlaneCollection({
  29112. * planes : [
  29113. * new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 5.0)
  29114. * ],
  29115. * });
  29116. * // Create an entity and attach the ClippingPlaneCollection to the model.
  29117. * const entity = viewer.entities.add({
  29118. * position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 10000),
  29119. * model : {
  29120. * uri : 'model.gltf',
  29121. * minimumPixelSize : 128,
  29122. * maximumScale : 20000,
  29123. * clippingPlanes : clippingPlanes
  29124. * }
  29125. * });
  29126. * viewer.zoomTo(entity);
  29127. * @param [options] - Object with the following properties:
  29128. * @param [options.planes = []] - An array of {@link ClippingPlane} objects used to selectively disable rendering on the outside of each plane.
  29129. * @param [options.enabled = true] - Determines whether the clipping planes are active.
  29130. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix specifying an additional transform relative to the clipping planes original coordinate system.
  29131. * @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.
  29132. * @param [options.edgeColor = Color.WHITE] - The color applied to highlight the edge along which an object is clipped.
  29133. * @param [options.edgeWidth = 0.0] - The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  29134. */
  29135. export class ClippingPlaneCollection {
  29136. constructor(options?: {
  29137. planes?: ClippingPlane[];
  29138. enabled?: boolean;
  29139. modelMatrix?: Matrix4;
  29140. unionClippingRegions?: boolean;
  29141. edgeColor?: Color;
  29142. edgeWidth?: number;
  29143. });
  29144. /**
  29145. * The 4x4 transformation matrix specifying an additional transform relative to the clipping planes
  29146. * original coordinate system.
  29147. */
  29148. modelMatrix: Matrix4;
  29149. /**
  29150. * The color applied to highlight the edge along which an object is clipped.
  29151. */
  29152. edgeColor: Color;
  29153. /**
  29154. * The width, in pixels, of the highlight applied to the edge along which an object is clipped.
  29155. */
  29156. edgeWidth: number;
  29157. /**
  29158. * An event triggered when a new clipping plane is added to the collection. Event handlers
  29159. * are passed the new plane and the index at which it was added.
  29160. */
  29161. planeAdded: Event;
  29162. /**
  29163. * An event triggered when a new clipping plane is removed from the collection. Event handlers
  29164. * are passed the new plane and the index from which it was removed.
  29165. */
  29166. planeRemoved: Event;
  29167. /**
  29168. * Returns the number of planes in this collection. This is commonly used with
  29169. * {@link ClippingPlaneCollection#get} to iterate over all the planes
  29170. * in the collection.
  29171. */
  29172. readonly length: number;
  29173. /**
  29174. * If true, a region will be clipped if it is on the outside of any plane in the
  29175. * collection. Otherwise, a region will only be clipped if it is on the
  29176. * outside of every plane.
  29177. */
  29178. unionClippingRegions: boolean;
  29179. /**
  29180. * If true, clipping will be enabled.
  29181. */
  29182. enabled: boolean;
  29183. /**
  29184. * Adds the specified {@link ClippingPlane} to the collection to be used to selectively disable rendering
  29185. * on the outside of each plane. Use {@link ClippingPlaneCollection#unionClippingRegions} to modify
  29186. * how modify the clipping behavior of multiple planes.
  29187. * @param plane - The ClippingPlane to add to the collection.
  29188. */
  29189. add(plane: ClippingPlane): void;
  29190. /**
  29191. * Returns the plane in the collection at the specified index. Indices are zero-based
  29192. * and increase as planes are added. Removing a plane shifts all planes after
  29193. * it to the left, changing their indices. This function is commonly used with
  29194. * {@link ClippingPlaneCollection#length} to iterate over all the planes
  29195. * in the collection.
  29196. * @param index - The zero-based index of the plane.
  29197. * @returns The ClippingPlane at the specified index.
  29198. */
  29199. get(index: number): ClippingPlane;
  29200. /**
  29201. * Checks whether this collection contains a ClippingPlane equal to the given ClippingPlane.
  29202. * @param [clippingPlane] - The ClippingPlane to check for.
  29203. * @returns true if this collection contains the ClippingPlane, false otherwise.
  29204. */
  29205. contains(clippingPlane?: ClippingPlane): boolean;
  29206. /**
  29207. * Removes the first occurrence of the given ClippingPlane from the collection.
  29208. * @returns <code>true</code> if the plane was removed; <code>false</code> if the plane was not found in the collection.
  29209. */
  29210. remove(clippingPlane: ClippingPlane): boolean;
  29211. /**
  29212. * Removes all planes from the collection.
  29213. */
  29214. removeAll(): void;
  29215. /**
  29216. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  29217. * build the resources for clipping planes.
  29218. * <p>
  29219. * Do not call this function directly.
  29220. * </p>
  29221. */
  29222. update(): void;
  29223. /**
  29224. * Returns true if this object was destroyed; otherwise, false.
  29225. * <br /><br />
  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. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29229. */
  29230. isDestroyed(): boolean;
  29231. /**
  29232. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29233. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29234. * <br /><br />
  29235. * Once an object is destroyed, it should not be used; calling any function other than
  29236. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29237. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29238. * @example
  29239. * clippingPlanes = clippingPlanes && clippingPlanes.destroy();
  29240. */
  29241. destroy(): void;
  29242. }
  29243. /**
  29244. * A renderable collection of clouds in the 3D scene.
  29245. * <br /><br />
  29246. * <div align='center'>
  29247. * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />
  29248. * Example cumulus clouds
  29249. * </div>
  29250. * <br /><br />
  29251. * Clouds are added and removed from the collection using {@link CloudCollection#add}
  29252. * and {@link CloudCollection#remove}.
  29253. * @example
  29254. * // Create a cloud collection with two cumulus clouds
  29255. * const clouds = scene.primitives.add(new Cesium.CloudCollection());
  29256. * clouds.add({
  29257. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  29258. * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 8.0)
  29259. * });
  29260. * clouds.add({
  29261. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  29262. * maximumSize: new Cesium.Cartesian3(15.0, 9.0, 9.0),
  29263. * slice: 0.5
  29264. * });
  29265. * @param [options] - Object with the following properties:
  29266. * @param [options.show = true] - Whether to display the clouds.
  29267. * @param [options.noiseDetail = 16.0] - Desired amount of detail in the noise texture.
  29268. * @param [options.noiseOffset = Cartesian3.ZERO] - Desired translation of data in noise texture.
  29269. * @param [options.debugBillboards = false] - For debugging only. Determines if the billboards are rendered with an opaque color.
  29270. * @param [options.debugEllipsoids = false] - For debugging only. Determines if the clouds will be rendered as opaque ellipsoids.
  29271. */
  29272. export class CloudCollection {
  29273. constructor(options?: {
  29274. show?: boolean;
  29275. noiseDetail?: number;
  29276. noiseOffset?: number;
  29277. debugBillboards?: boolean;
  29278. debugEllipsoids?: boolean;
  29279. });
  29280. /**
  29281. * <p>
  29282. * Controls the amount of detail captured in the precomputed noise texture
  29283. * used to render the cumulus clouds. In order for the texture to be tileable,
  29284. * this must be a power of two. For best results, set this to be a power of two
  29285. * between <code>8.0</code> and <code>32.0</code> (inclusive).
  29286. * </p>
  29287. *
  29288. * <div align='center'>
  29289. * <table border='0' cellpadding='5'><tr>
  29290. * <td align='center'>
  29291. * <code>clouds.noiseDetail = 8.0;</code><br/>
  29292. * <img src='Images/CloudCollection.noiseDetail8.png' width='250' height='158' />
  29293. * </td>
  29294. * <td align='center'>
  29295. * <code>clouds.noiseDetail = 32.0;</code><br/>
  29296. * <img src='Images/CloudCollection.noiseDetail32.png' width='250' height='158' />
  29297. * </td>
  29298. * </tr></table>
  29299. * </div>
  29300. */
  29301. noiseDetail: number;
  29302. /**
  29303. * <p>
  29304. * Applies a translation to noise texture coordinates to generate different data.
  29305. * This can be modified if the default noise does not generate good-looking clouds.
  29306. * </p>
  29307. *
  29308. * <div align='center'>
  29309. * <table border='0' cellpadding='5'><tr>
  29310. * <td align='center'>
  29311. * <code>default</code><br/>
  29312. * <img src='Images/CloudCollection.noiseOffsetdefault.png' width='250' height='158' />
  29313. * </td>
  29314. * <td align='center'>
  29315. * <code>clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);</code><br/>
  29316. * <img src='Images/CloudCollection.noiseOffsetx10y20z10.png' width='250' height='158' />
  29317. * </td>
  29318. * </tr></table>
  29319. * </div>
  29320. */
  29321. noiseOffset: Cartesian3;
  29322. /**
  29323. * Determines if billboards in this collection will be shown.
  29324. */
  29325. show: boolean;
  29326. /**
  29327. * This property is for debugging only; it is not for production use nor is it optimized.
  29328. * <p>
  29329. * Renders the billboards with one opaque color for the sake of debugging.
  29330. * </p>
  29331. */
  29332. debugBillboards: boolean;
  29333. /**
  29334. * This property is for debugging only; it is not for production use nor is it optimized.
  29335. * <p>
  29336. * Draws the clouds as opaque, monochrome ellipsoids for the sake of debugging.
  29337. * If <code>debugBillboards</code> is also true, then the ellipsoids will draw on top of the billboards.
  29338. * </p>
  29339. */
  29340. debugEllipsoids: boolean;
  29341. /**
  29342. * Returns the number of clouds in this collection.
  29343. */
  29344. length: number;
  29345. /**
  29346. * Creates and adds a cloud with the specified initial properties to the collection.
  29347. * The added cloud is returned so it can be modified or removed from the collection later.
  29348. * @example
  29349. * // Example 1: Add a cumulus cloud, specifying all the default values.
  29350. * const c = clouds.add({
  29351. * show : true,
  29352. * position : Cesium.Cartesian3.ZERO,
  29353. * scale : new Cesium.Cartesian2(20.0, 12.0),
  29354. * maximumSize: new Cesium.Cartesian3(20.0, 12.0, 12.0),
  29355. * slice: -1.0,
  29356. * cloudType : CloudType.CUMULUS
  29357. * });
  29358. * @example
  29359. * // Example 2: Specify only the cloud's cartographic position.
  29360. * const c = clouds.add({
  29361. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  29362. * });
  29363. * @param [options] - A template describing the cloud's properties as shown in Example 1.
  29364. * @returns The cloud that was added to the collection.
  29365. */
  29366. add(options?: any): CumulusCloud;
  29367. /**
  29368. * Removes a cloud from the collection.
  29369. * @example
  29370. * const c = clouds.add(...);
  29371. * clouds.remove(c); // Returns true
  29372. * @param cloud - The cloud to remove.
  29373. * @returns <code>true</code> if the cloud was removed; <code>false</code> if the cloud was not found in the collection.
  29374. */
  29375. remove(cloud: CumulusCloud): boolean;
  29376. /**
  29377. * Removes all clouds from the collection.
  29378. * @example
  29379. * clouds.add(...);
  29380. * clouds.add(...);
  29381. * clouds.removeAll();
  29382. */
  29383. removeAll(): void;
  29384. /**
  29385. * Check whether this collection contains a given cloud.
  29386. * @param [cloud] - The cloud to check for.
  29387. * @returns true if this collection contains the cloud, false otherwise.
  29388. */
  29389. contains(cloud?: CumulusCloud): boolean;
  29390. /**
  29391. * Returns the cloud in the collection at the specified index. Indices are zero-based
  29392. * and increase as clouds are added. Removing a cloud shifts all clouds after
  29393. * it to the left, changing their indices. This function is commonly used with
  29394. * {@link CloudCollection#length} to iterate over all the clouds in the collection.
  29395. * @example
  29396. * // Toggle the show property of every cloud in the collection
  29397. * const len = clouds.length;
  29398. * for (let i = 0; i < len; ++i) {
  29399. * const c = clouds.get(i);
  29400. * c.show = !c.show;
  29401. * }
  29402. * @param index - The zero-based index of the cloud.
  29403. * @returns The cloud at the specified index.
  29404. */
  29405. get(index: number): CumulusCloud;
  29406. /**
  29407. * Returns true if this object was destroyed; otherwise, false.
  29408. * <br /><br />
  29409. * If this object was destroyed, it should not be used; calling any function other than
  29410. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29411. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29412. */
  29413. isDestroyed(): boolean;
  29414. /**
  29415. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29416. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29417. * <br /><br />
  29418. * Once an object is destroyed, it should not be used; calling any function other than
  29419. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29420. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29421. * @example
  29422. * clouds = clouds && clouds.destroy();
  29423. */
  29424. destroy(): void;
  29425. }
  29426. /**
  29427. * Specifies the type of the cloud that is added to a {@link CloudCollection} in {@link CloudCollection#add}.
  29428. */
  29429. export enum CloudType {
  29430. /**
  29431. * Cumulus cloud.
  29432. */
  29433. CUMULUS = 0
  29434. }
  29435. /**
  29436. * Defines different modes for blending between a target color and a primitive's source color.
  29437. *
  29438. * HIGHLIGHT multiplies the source color by the target color
  29439. * REPLACE replaces the source color with the target color
  29440. * MIX blends the source color and target color together
  29441. */
  29442. export enum ColorBlendMode {
  29443. HIGHLIGHT = 0,
  29444. REPLACE = 1,
  29445. MIX = 2
  29446. }
  29447. /**
  29448. * An expression for a style applied to a {@link Cesium3DTileset}.
  29449. * <p>
  29450. * Evaluates a conditions expression defined using the
  29451. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  29452. * </p>
  29453. * <p>
  29454. * Implements the {@link StyleExpression} interface.
  29455. * </p>
  29456. * @example
  29457. * const expression = new Cesium.ConditionsExpression({
  29458. * conditions : [
  29459. * ['${Area} > 10, 'color("#FF0000")'],
  29460. * ['${id} !== "1"', 'color("#00FF00")'],
  29461. * ['true', 'color("#FFFFFF")']
  29462. * ]
  29463. * });
  29464. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  29465. * @param [conditionsExpression] - The conditions expression defined using the 3D Tiles Styling language.
  29466. * @param [defines] - Defines in the style.
  29467. */
  29468. export class ConditionsExpression {
  29469. constructor(conditionsExpression?: any, defines?: any);
  29470. /**
  29471. * Gets the conditions expression defined in the 3D Tiles Styling language.
  29472. */
  29473. readonly conditionsExpression: any;
  29474. /**
  29475. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  29476. * the expression in the
  29477. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  29478. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  29479. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  29480. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  29481. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  29482. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  29483. * @param feature - The feature whose properties may be used as variables in the expression.
  29484. * @param [result] - The object onto which to store the result.
  29485. * @returns The result of evaluating the expression.
  29486. */
  29487. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  29488. /**
  29489. * Evaluates the result of a Color expression, using the values defined by a feature.
  29490. * <p>
  29491. * This is equivalent to {@link ConditionsExpression#evaluate} but always returns a {@link Color} object.
  29492. * </p>
  29493. * @param feature - The feature whose properties may be used as variables in the expression.
  29494. * @param [result] - The object in which to store the result
  29495. * @returns The modified result parameter or a new Color instance if one was not provided.
  29496. */
  29497. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  29498. }
  29499. /**
  29500. * A ParticleEmitter that emits particles within a cone.
  29501. * Particles will be positioned at the tip of the cone and have initial velocities going towards the base.
  29502. * @param [angle = Cesium.Math.toRadians(30.0)] - The angle of the cone in radians.
  29503. */
  29504. export class ConeEmitter {
  29505. constructor(angle?: number);
  29506. }
  29507. /**
  29508. * The credit display is responsible for displaying credits on screen.
  29509. * @example
  29510. * const creditDisplay = new Cesium.CreditDisplay(creditContainer);
  29511. * @param container - The HTML element where credits will be displayed
  29512. * @param [delimiter = ' • '] - The string to separate text credits
  29513. * @param [viewport = document.body] - The HTML element that will contain the credits popup
  29514. */
  29515. export class CreditDisplay {
  29516. constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement);
  29517. /**
  29518. * The HTML element where credits will be displayed.
  29519. */
  29520. container: HTMLElement;
  29521. /**
  29522. * Adds a credit to the list of current credits to be displayed in the credit container
  29523. * @param credit - The credit to display
  29524. */
  29525. addCredit(credit: Credit): void;
  29526. /**
  29527. * Adds credits that will persist until they are removed
  29528. * @param credit - The credit to added to defaults
  29529. */
  29530. addDefaultCredit(credit: Credit): void;
  29531. /**
  29532. * Removes a default credit
  29533. * @param credit - The credit to be removed from defaults
  29534. */
  29535. removeDefaultCredit(credit: Credit): void;
  29536. /**
  29537. * Updates the credit display before a new frame is rendered.
  29538. */
  29539. update(): void;
  29540. /**
  29541. * Resets the credit display to a beginning of frame state, clearing out current credits.
  29542. */
  29543. beginFrame(): void;
  29544. /**
  29545. * Sets the credit display to the end of frame state, displaying credits from the last frame in the credit container.
  29546. */
  29547. endFrame(): void;
  29548. /**
  29549. * Destroys the resources held by this object. Destroying an object allows for deterministic
  29550. * release of resources, instead of relying on the garbage collector to destroy this object.
  29551. * <br /><br />
  29552. * Once an object is destroyed, it should not be used; calling any function other than
  29553. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29554. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29555. */
  29556. destroy(): void;
  29557. /**
  29558. * Returns true if this object was destroyed; otherwise, false.
  29559. * <br /><br />
  29560. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29561. */
  29562. isDestroyed(): boolean;
  29563. /**
  29564. * Gets or sets the Cesium logo credit.
  29565. */
  29566. static cesiumCredit: Credit;
  29567. }
  29568. /**
  29569. * Determines which triangles, if any, are culled.
  29570. */
  29571. export enum CullFace {
  29572. /**
  29573. * Front-facing triangles are culled.
  29574. */
  29575. FRONT = WebGLConstants.FRONT,
  29576. /**
  29577. * Back-facing triangles are culled.
  29578. */
  29579. BACK = WebGLConstants.BACK,
  29580. /**
  29581. * Both front-facing and back-facing triangles are culled.
  29582. */
  29583. FRONT_AND_BACK = WebGLConstants.FRONT_AND_BACK
  29584. }
  29585. /**
  29586. * A cumulus cloud billboard positioned in the 3D scene, that is created and rendered using a {@link CloudCollection}.
  29587. * A cloud is created and its initial properties are set by calling {@link CloudCollection#add}.
  29588. * and {@link CloudCollection#remove}.
  29589. * <br /><br />
  29590. * <div align='center'>
  29591. * <img src='Images/CumulusCloud.png' width='400' height='300' /><br />
  29592. * Example cumulus clouds
  29593. * </div>
  29594. */
  29595. export class CumulusCloud {
  29596. constructor();
  29597. /**
  29598. * Determines if this cumulus cloud will be shown. Use this to hide or show a cloud, instead
  29599. * of removing it and re-adding it to the collection.
  29600. */
  29601. show: boolean;
  29602. /**
  29603. * Gets or sets the Cartesian position of this cumulus cloud.
  29604. */
  29605. position: Cartesian3;
  29606. /**
  29607. * <p>Gets or sets the scale of the cumulus cloud billboard in meters.
  29608. * The <code>scale</code> property will affect the size of the billboard,
  29609. * but not the cloud's actual appearance.</p>
  29610. * <div align='center'>
  29611. * <table border='0' cellpadding='5'><tr>
  29612. * <td align='center'>
  29613. * <code>cloud.scale = new Cesium.Cartesian2(12, 8);</code><br/>
  29614. * <img src='Images/CumulusCloud.scalex12y8.png' width='250' height='158' />
  29615. * </td>
  29616. * <td align='center'>
  29617. * <code>cloud.scale = new Cesium.Cartesian2(24, 10);</code><br/>
  29618. * <img src='Images/CumulusCloud.scalex24y10.png' width='250' height='158' />
  29619. * </td>
  29620. * </tr></table>
  29621. * </div>
  29622. *
  29623. * <p>To modify the cloud's appearance, modify its <code>maximumSize</code>
  29624. * and <code>slice</code> properties.</p>
  29625. */
  29626. scale: Cartesian2;
  29627. /**
  29628. * <p>Gets or sets the maximum size of the cumulus cloud rendered on the billboard.
  29629. * This defines a maximum ellipsoid volume that the cloud can appear in.
  29630. * Rather than guaranteeing a specific size, this specifies a boundary for the
  29631. * cloud to appear in, and changing it can affect the shape of the cloud.</p>
  29632. * <p>Changing the z-value of <code>maximumSize</code> has the most dramatic effect
  29633. * on the cloud's appearance because it changes the depth of the cloud, and thus the
  29634. * positions at which the cloud-shaping texture is sampled.</p>
  29635. * <div align='center'>
  29636. * <table border='0' cellpadding='5'>
  29637. * <tr>
  29638. * <td align='center'>
  29639. * <code>cloud.maximumSize = new Cesium.Cartesian3(14, 9, 10);</code><br/>
  29640. * <img src='Images/CumulusCloud.maximumSizex14y9z10.png' width='250' height='158' />
  29641. * </td>
  29642. * <td align='center'>
  29643. * <code>cloud.maximumSize.x = 25;</code><br/>
  29644. * <img src='Images/CumulusCloud.maximumSizex25.png' width='250' height='158' />
  29645. * </td>
  29646. * </tr>
  29647. * <tr>
  29648. * <td align='center'>
  29649. * <code>cloud.maximumSize.y = 5;</code><br/>
  29650. * <img src='Images/CumulusCloud.maximumSizey5.png' width='250' height='158' />
  29651. * </td>
  29652. * <td align='center'>
  29653. * <code>cloud.maximumSize.z = 17;</code><br/>
  29654. * <img src='Images/CumulusCloud.maximumSizez17.png' width='250' height='158' />
  29655. * </td>
  29656. * </tr>
  29657. * </table>
  29658. * </div>
  29659. *
  29660. * <p>To modify the billboard's actual size, modify the cloud's <code>scale</code> property.</p>
  29661. */
  29662. maximumSize: Cartesian3;
  29663. /**
  29664. * Sets the color of the cloud
  29665. */
  29666. color: Color;
  29667. /**
  29668. * <p>Gets or sets the "slice" of the cloud that is rendered on the billboard, i.e.
  29669. * the specific cross-section of the cloud chosen for the billboard's appearance.
  29670. * Given a value between 0 and 1, the slice specifies how deeply into the cloud
  29671. * to intersect based on its maximum size in the z-direction.</p>
  29672. * <div align='center'>
  29673. * <table border='0' cellpadding='5'><tr>
  29674. * <td align='center'><code>cloud.slice = 0.32;</code><br/><img src='Images/CumulusCloud.slice0.32.png' width='250' height='158' /></td>
  29675. * <td align='center'><code>cloud.slice = 0.5;</code><br/><img src='Images/CumulusCloud.slice0.5.png' width='250' height='158' /></td>
  29676. * <td align='center'><code>cloud.slice = 0.6;</code><br/><img src='Images/CumulusCloud.slice0.6.png' width='250' height='158' /></td>
  29677. * </tr></table>
  29678. * </div>
  29679. *
  29680. * <br />
  29681. * <p>Due to the nature in which this slice is calculated,
  29682. * values below <code>0.2</code> may result in cross-sections that are too small,
  29683. * and the edge of the ellipsoid will be visible. Similarly, values above <code>0.7</code>
  29684. * will cause the cloud to appear smaller. Values outside the range <code>[0.1, 0.9]</code>
  29685. * should be avoided entirely because they do not produce desirable results.</p>
  29686. *
  29687. * <div align='center'>
  29688. * <table border='0' cellpadding='5'><tr>
  29689. * <td align='center'><code>cloud.slice = 0.08;</code><br/><img src='Images/CumulusCloud.slice0.08.png' width='250' height='158' /></td>
  29690. * <td align='center'><code>cloud.slice = 0.8;</code><br/><img src='Images/CumulusCloud.slice0.8.png' width='250' height='158' /></td>
  29691. * </tr></table>
  29692. * </div>
  29693. *
  29694. * <p>If <code>slice</code> is set to a negative number, the cloud will not render a cross-section.
  29695. * Instead, it will render the outside of the ellipsoid that is visible. For clouds with
  29696. * small values of `maximumSize.z`, this can produce good-looking results, but for larger
  29697. * clouds, this can result in a cloud that is undesirably warped to the ellipsoid volume.</p>
  29698. *
  29699. * <div align='center'>
  29700. * <table border='0' cellpadding='5'><tr>
  29701. * <td align='center'>
  29702. * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 18;</code><br/>
  29703. * <img src='Images/CumulusCloud.slice-1z18.png' width='250' height='158' />
  29704. * </td>
  29705. * <td align='center'>
  29706. * <code>cloud.slice = -1.0;<br/>cloud.maximumSize.z = 30;</code><br/>
  29707. * <img src='Images/CumulusCloud.slice-1z30.png' width='250' height='158' /></td>
  29708. * </tr></table>
  29709. * </div>
  29710. */
  29711. slice: number;
  29712. /**
  29713. * Gets or sets the brightness of the cloud. This can be used to give clouds
  29714. * a darker, grayer appearance.
  29715. * <br /><br />
  29716. * <div align='center'>
  29717. * <table border='0' cellpadding='5'><tr>
  29718. * <td align='center'><code>cloud.brightness = 1.0;</code><br/><img src='Images/CumulusCloud.brightness1.png' width='250' height='158' /></td>
  29719. * <td align='center'><code>cloud.brightness = 0.6;</code><br/><img src='Images/CumulusCloud.brightness0.6.png' width='250' height='158' /></td>
  29720. * <td align='center'><code>cloud.brightness = 0.0;</code><br/><img src='Images/CumulusCloud.brightness0.png' width='250' height='158' /></td>
  29721. * </tr></table>
  29722. * </div>
  29723. */
  29724. brightness: number;
  29725. }
  29726. /**
  29727. * Visualizes a vertex attribute by displaying it as a color for debugging.
  29728. * <p>
  29729. * Components for well-known unit-length vectors, i.e., <code>normal</code>,
  29730. * <code>tangent</code>, and <code>bitangent</code>, are scaled and biased
  29731. * from [-1.0, 1.0] to (-1.0, 1.0).
  29732. * </p>
  29733. * @example
  29734. * const primitive = new Cesium.Primitive({
  29735. * geometryInstances : // ...
  29736. * appearance : new Cesium.DebugAppearance({
  29737. * attributeName : 'normal'
  29738. * })
  29739. * });
  29740. * @param options - Object with the following properties:
  29741. * @param options.attributeName - The name of the attribute to visualize.
  29742. * @param [options.perInstanceAttribute = false] - Boolean that determines whether this attribute is a per-instance geometry attribute.
  29743. * @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>.
  29744. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  29745. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  29746. * @param [options.renderState] - Optional render state to override the default render state.
  29747. */
  29748. export class DebugAppearance {
  29749. constructor(options: {
  29750. attributeName: string;
  29751. perInstanceAttribute?: boolean;
  29752. glslDatatype?: string;
  29753. vertexShaderSource?: string;
  29754. fragmentShaderSource?: string;
  29755. renderState?: any;
  29756. });
  29757. /**
  29758. * This property is part of the {@link Appearance} interface, but is not
  29759. * used by {@link DebugAppearance} since a fully custom fragment shader is used.
  29760. */
  29761. material: Material;
  29762. /**
  29763. * When <code>true</code>, the geometry is expected to appear translucent.
  29764. */
  29765. translucent: boolean;
  29766. /**
  29767. * The GLSL source code for the vertex shader.
  29768. */
  29769. readonly vertexShaderSource: string;
  29770. /**
  29771. * The GLSL source code for the fragment shader. The full fragment shader
  29772. * source is built procedurally taking into account the {@link DebugAppearance#material}.
  29773. * Use {@link DebugAppearance#getFragmentShaderSource} to get the full source.
  29774. */
  29775. readonly fragmentShaderSource: string;
  29776. /**
  29777. * The WebGL fixed-function state to use when rendering the geometry.
  29778. */
  29779. readonly renderState: any;
  29780. /**
  29781. * When <code>true</code>, the geometry is expected to be closed.
  29782. */
  29783. readonly closed: boolean;
  29784. /**
  29785. * The name of the attribute being visualized.
  29786. */
  29787. readonly attributeName: string;
  29788. /**
  29789. * The GLSL datatype of the attribute being visualized.
  29790. */
  29791. readonly glslDatatype: string;
  29792. /**
  29793. * Returns the full GLSL fragment shader source, which for {@link DebugAppearance} is just
  29794. * {@link DebugAppearance#fragmentShaderSource}.
  29795. * @returns The full GLSL fragment shader source.
  29796. */
  29797. getFragmentShaderSource(): string;
  29798. /**
  29799. * Determines if the geometry is translucent based on {@link DebugAppearance#translucent}.
  29800. * @returns <code>true</code> if the appearance is translucent.
  29801. */
  29802. isTranslucent(): boolean;
  29803. /**
  29804. * Creates a render state. This is not the final render state instance; instead,
  29805. * it can contain a subset of render state properties identical to the render state
  29806. * created in the context.
  29807. * @returns The render state.
  29808. */
  29809. getRenderState(): any;
  29810. }
  29811. /**
  29812. * Draws the outline of the camera's view frustum.
  29813. * @example
  29814. * primitives.add(new Cesium.DebugCameraPrimitive({
  29815. * camera : camera,
  29816. * color : Cesium.Color.YELLOW
  29817. * }));
  29818. * @param options - Object with the following properties:
  29819. * @param options.camera - The camera.
  29820. * @param [options.frustumSplits] - Distances to the near and far planes of the camera frustums. This overrides the camera's frustum near and far values.
  29821. * @param [options.color = Color.CYAN] - The color of the debug outline.
  29822. * @param [options.updateOnChange = true] - Whether the primitive updates when the underlying camera changes.
  29823. * @param [options.show = true] - Determines if this primitive will be shown.
  29824. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}.
  29825. */
  29826. export class DebugCameraPrimitive {
  29827. constructor(options: {
  29828. camera: Camera;
  29829. frustumSplits?: number[];
  29830. color?: Color;
  29831. updateOnChange?: boolean;
  29832. show?: boolean;
  29833. id?: any;
  29834. });
  29835. /**
  29836. * Determines if this primitive will be shown.
  29837. */
  29838. show: boolean;
  29839. /**
  29840. * User-defined value returned when the primitive is picked.
  29841. */
  29842. id: any;
  29843. /**
  29844. * Returns true if this object was destroyed; otherwise, false.
  29845. * <p>
  29846. * If this object was destroyed, it should not be used; calling any function other than
  29847. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29848. * </p>
  29849. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29850. */
  29851. isDestroyed(): boolean;
  29852. /**
  29853. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29854. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29855. * <p>
  29856. * Once an object is destroyed, it should not be used; calling any function other than
  29857. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29858. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29859. * </p>
  29860. * @example
  29861. * p = p && p.destroy();
  29862. */
  29863. destroy(): void;
  29864. }
  29865. /**
  29866. * Draws the axes of a reference frame defined by a matrix that transforms to world
  29867. * coordinates, i.e., Earth's WGS84 coordinates. The most prominent example is
  29868. * a primitives <code>modelMatrix</code>.
  29869. * <p>
  29870. * The X axis is red; Y is green; and Z is blue.
  29871. * </p>
  29872. * <p>
  29873. * This is for debugging only; it is not optimized for production use.
  29874. * </p>
  29875. * @example
  29876. * primitives.add(new Cesium.DebugModelMatrixPrimitive({
  29877. * modelMatrix : primitive.modelMatrix, // primitive to debug
  29878. * length : 100000.0,
  29879. * width : 10.0
  29880. * }));
  29881. * @param [options] - Object with the following properties:
  29882. * @param [options.length = 10000000.0] - The length of the axes in meters.
  29883. * @param [options.width = 2.0] - The width of the axes in pixels.
  29884. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  29885. * @param [options.show = true] - Determines if this primitive will be shown.
  29886. * @param [options.id] - A user-defined object to return when the instance is picked with {@link Scene#pick}
  29887. */
  29888. export class DebugModelMatrixPrimitive {
  29889. constructor(options?: {
  29890. length?: number;
  29891. width?: number;
  29892. modelMatrix?: Matrix4;
  29893. show?: boolean;
  29894. id?: any;
  29895. });
  29896. /**
  29897. * The length of the axes in meters.
  29898. */
  29899. length: number;
  29900. /**
  29901. * The width of the axes in pixels.
  29902. */
  29903. width: number;
  29904. /**
  29905. * Determines if this primitive will be shown.
  29906. */
  29907. show: boolean;
  29908. /**
  29909. * The 4x4 matrix that defines the reference frame, i.e., origin plus axes, to visualize.
  29910. */
  29911. modelMatrix: Matrix4;
  29912. /**
  29913. * User-defined value returned when the primitive is picked.
  29914. */
  29915. id: any;
  29916. /**
  29917. * Returns true if this object was destroyed; otherwise, false.
  29918. * <p>
  29919. * If this object was destroyed, it should not be used; calling any function other than
  29920. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  29921. * </p>
  29922. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  29923. */
  29924. isDestroyed(): boolean;
  29925. /**
  29926. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  29927. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  29928. * <p>
  29929. * Once an object is destroyed, it should not be used; calling any function other than
  29930. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  29931. * assign the return value (<code>undefined</code>) to the object as done in the example.
  29932. * </p>
  29933. * @example
  29934. * p = p && p.destroy();
  29935. */
  29936. destroy(): void;
  29937. }
  29938. /**
  29939. * Determines the function used to compare two depths for the depth test.
  29940. */
  29941. export enum DepthFunction {
  29942. /**
  29943. * The depth test never passes.
  29944. */
  29945. NEVER = WebGLConstants.NEVER,
  29946. /**
  29947. * The depth test passes if the incoming depth is less than the stored depth.
  29948. */
  29949. LESS = WebGLConstants.LESS,
  29950. /**
  29951. * The depth test passes if the incoming depth is equal to the stored depth.
  29952. */
  29953. EQUAL = WebGLConstants.EQUAL,
  29954. /**
  29955. * The depth test passes if the incoming depth is less than or equal to the stored depth.
  29956. */
  29957. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  29958. /**
  29959. * The depth test passes if the incoming depth is greater than the stored depth.
  29960. */
  29961. GREATER = WebGLConstants.GREATER,
  29962. /**
  29963. * The depth test passes if the incoming depth is not equal to the stored depth.
  29964. */
  29965. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  29966. /**
  29967. * The depth test passes if the incoming depth is greater than or equal to the stored depth.
  29968. */
  29969. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  29970. /**
  29971. * The depth test always passes.
  29972. */
  29973. ALWAYS = WebGLConstants.ALWAYS
  29974. }
  29975. /**
  29976. * A light that gets emitted in a single direction from infinitely far away.
  29977. * @param options - Object with the following properties:
  29978. * @param options.direction - The direction in which light gets emitted.
  29979. * @param [options.color = Color.WHITE] - The color of the light.
  29980. * @param [options.intensity = 1.0] - The intensity of the light.
  29981. */
  29982. export class DirectionalLight {
  29983. constructor(options: {
  29984. direction: Cartesian3;
  29985. color?: Color;
  29986. intensity?: number;
  29987. });
  29988. /**
  29989. * The direction in which light gets emitted.
  29990. */
  29991. direction: Cartesian3;
  29992. /**
  29993. * The color of the light.
  29994. */
  29995. color: Color;
  29996. /**
  29997. * The intensity of the light.
  29998. */
  29999. intensity: number;
  30000. }
  30001. /**
  30002. * A policy for discarding tile images that contain no data (and so aren't actually images).
  30003. * This policy discards {@link DiscardEmptyTileImagePolicy.EMPTY_IMAGE}, which is
  30004. * expected to be used in place of any empty tile images by the image loading code.
  30005. */
  30006. export class DiscardEmptyTileImagePolicy {
  30007. constructor();
  30008. /**
  30009. * Determines if the discard policy is ready to process images.
  30010. * @returns True if the discard policy is ready to process images; otherwise, false.
  30011. */
  30012. isReady(): boolean;
  30013. /**
  30014. * Given a tile image, decide whether to discard that image.
  30015. * @param image - An image to test.
  30016. * @returns True if the image should be discarded; otherwise, false.
  30017. */
  30018. shouldDiscardImage(image: HTMLImageElement): boolean;
  30019. /**
  30020. * Default value for representing an empty image.
  30021. */
  30022. static readonly EMPTY_IMAGE: HTMLImageElement;
  30023. }
  30024. /**
  30025. * A policy for discarding tile images that match a known image containing a
  30026. * "missing" image.
  30027. * @param options - Object with the following properties:
  30028. * @param options.missingImageUrl - The URL of the known missing image.
  30029. * @param options.pixelsToCheck - An array of {@link Cartesian2} pixel positions to
  30030. * compare against the missing image.
  30031. * @param [options.disableCheckIfAllPixelsAreTransparent = false] - If true, the discard check will be disabled
  30032. * if all of the pixelsToCheck in the missingImageUrl have an alpha value of 0. If false, the
  30033. * discard check will proceed no matter the values of the pixelsToCheck.
  30034. */
  30035. export class DiscardMissingTileImagePolicy {
  30036. constructor(options: {
  30037. missingImageUrl: Resource | string;
  30038. pixelsToCheck: Cartesian2[];
  30039. disableCheckIfAllPixelsAreTransparent?: boolean;
  30040. });
  30041. /**
  30042. * Determines if the discard policy is ready to process images.
  30043. * @returns True if the discard policy is ready to process images; otherwise, false.
  30044. */
  30045. isReady(): boolean;
  30046. /**
  30047. * Given a tile image, decide whether to discard that image.
  30048. * @param image - An image to test.
  30049. * @returns True if the image should be discarded; otherwise, false.
  30050. */
  30051. shouldDiscardImage(image: HTMLImageElement): boolean;
  30052. }
  30053. /**
  30054. * An appearance for geometry on the surface of the ellipsoid like {@link PolygonGeometry}
  30055. * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance}
  30056. * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires
  30057. * fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>,
  30058. * <code>tangent</code>, and <code>bitangent</code>.
  30059. * @example
  30060. * const primitive = new Cesium.Primitive({
  30061. * geometryInstances : new Cesium.GeometryInstance({
  30062. * geometry : new Cesium.PolygonGeometry({
  30063. * vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
  30064. * // ...
  30065. * })
  30066. * }),
  30067. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  30068. * material : Cesium.Material.fromType('Stripe')
  30069. * })
  30070. * });
  30071. * @param [options] - Object with the following properties:
  30072. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  30073. * @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}.
  30074. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link EllipsoidSurfaceAppearance#renderState} has alpha blending enabled.
  30075. * @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.
  30076. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  30077. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  30078. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  30079. * @param [options.renderState] - Optional render state to override the default render state.
  30080. */
  30081. export class EllipsoidSurfaceAppearance {
  30082. constructor(options?: {
  30083. flat?: boolean;
  30084. faceForward?: boolean;
  30085. translucent?: boolean;
  30086. aboveGround?: boolean;
  30087. material?: Material;
  30088. vertexShaderSource?: string;
  30089. fragmentShaderSource?: string;
  30090. renderState?: any;
  30091. });
  30092. /**
  30093. * The material used to determine the fragment color. Unlike other {@link EllipsoidSurfaceAppearance}
  30094. * properties, this is not read-only, so an appearance's material can change on the fly.
  30095. */
  30096. material: Material;
  30097. /**
  30098. * When <code>true</code>, the geometry is expected to appear translucent.
  30099. */
  30100. translucent: boolean;
  30101. /**
  30102. * The GLSL source code for the vertex shader.
  30103. */
  30104. readonly vertexShaderSource: string;
  30105. /**
  30106. * The GLSL source code for the fragment shader. The full fragment shader
  30107. * source is built procedurally taking into account {@link EllipsoidSurfaceAppearance#material},
  30108. * {@link EllipsoidSurfaceAppearance#flat}, and {@link EllipsoidSurfaceAppearance#faceForward}.
  30109. * Use {@link EllipsoidSurfaceAppearance#getFragmentShaderSource} to get the full source.
  30110. */
  30111. readonly fragmentShaderSource: string;
  30112. /**
  30113. * The WebGL fixed-function state to use when rendering the geometry.
  30114. * <p>
  30115. * The render state can be explicitly defined when constructing a {@link EllipsoidSurfaceAppearance}
  30116. * instance, or it is set implicitly via {@link EllipsoidSurfaceAppearance#translucent}
  30117. * and {@link EllipsoidSurfaceAppearance#aboveGround}.
  30118. * </p>
  30119. */
  30120. readonly renderState: any;
  30121. /**
  30122. * When <code>true</code>, the geometry is expected to be closed so
  30123. * {@link EllipsoidSurfaceAppearance#renderState} has backface culling enabled.
  30124. * If the viewer enters the geometry, it will not be visible.
  30125. */
  30126. readonly closed: boolean;
  30127. /**
  30128. * The {@link VertexFormat} that this appearance instance is compatible with.
  30129. * A geometry can have more vertex attributes and still be compatible - at a
  30130. * potential performance cost - but it can't have less.
  30131. */
  30132. readonly vertexFormat: VertexFormat;
  30133. /**
  30134. * When <code>true</code>, flat shading is used in the fragment shader,
  30135. * which means lighting is not taking into account.
  30136. */
  30137. readonly flat: boolean;
  30138. /**
  30139. * When <code>true</code>, the fragment shader flips the surface normal
  30140. * as needed to ensure that the normal faces the viewer to avoid
  30141. * dark spots. This is useful when both sides of a geometry should be
  30142. * shaded like {@link WallGeometry}.
  30143. */
  30144. readonly faceForward: boolean;
  30145. /**
  30146. * When <code>true</code>, the geometry is expected to be on the ellipsoid's
  30147. * surface - not at a constant height above it - so {@link EllipsoidSurfaceAppearance#renderState}
  30148. * has backface culling enabled.
  30149. */
  30150. readonly aboveGround: boolean;
  30151. /**
  30152. * The {@link VertexFormat} that all {@link EllipsoidSurfaceAppearance} instances
  30153. * are compatible with, which requires only <code>position</code> and <code>st</code>
  30154. * attributes. Other attributes are procedurally computed in the fragment shader.
  30155. */
  30156. static readonly VERTEX_FORMAT: VertexFormat;
  30157. /**
  30158. * Procedurally creates the full GLSL fragment shader source. For {@link EllipsoidSurfaceAppearance},
  30159. * this is derived from {@link EllipsoidSurfaceAppearance#fragmentShaderSource}, {@link EllipsoidSurfaceAppearance#flat},
  30160. * and {@link EllipsoidSurfaceAppearance#faceForward}.
  30161. * @returns The full GLSL fragment shader source.
  30162. */
  30163. getFragmentShaderSource(): string;
  30164. /**
  30165. * Determines if the geometry is translucent based on {@link EllipsoidSurfaceAppearance#translucent} and {@link Material#isTranslucent}.
  30166. * @returns <code>true</code> if the appearance is translucent.
  30167. */
  30168. isTranslucent(): boolean;
  30169. /**
  30170. * Creates a render state. This is not the final render state instance; instead,
  30171. * it can contain a subset of render state properties identical to the render state
  30172. * created in the context.
  30173. * @returns The render state.
  30174. */
  30175. getRenderState(): any;
  30176. }
  30177. /**
  30178. * An expression for a style applied to a {@link Cesium3DTileset}.
  30179. * <p>
  30180. * Evaluates an expression defined using the
  30181. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  30182. * </p>
  30183. * <p>
  30184. * Implements the {@link StyleExpression} interface.
  30185. * </p>
  30186. * @example
  30187. * const expression = new Cesium.Expression('(regExp("^Chest").test(${County})) && (${YearBuilt} >= 1970)');
  30188. * expression.evaluate(feature); // returns true or false depending on the feature's properties
  30189. * @example
  30190. * const expression = new Cesium.Expression('(${Temperature} > 90) ? color("red") : color("white")');
  30191. * expression.evaluateColor(feature, result); // returns a Cesium.Color object
  30192. * @param [expression] - The expression defined using the 3D Tiles Styling language.
  30193. * @param [defines] - Defines in the style.
  30194. */
  30195. export class Expression {
  30196. constructor(expression?: string, defines?: any);
  30197. /**
  30198. * Gets the expression defined in the 3D Tiles Styling language.
  30199. */
  30200. readonly expression: string;
  30201. /**
  30202. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  30203. * the expression in the
  30204. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  30205. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  30206. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  30207. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  30208. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  30209. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  30210. * @param feature - The feature whose properties may be used as variables in the expression.
  30211. * @param [result] - The object onto which to store the result.
  30212. * @returns The result of evaluating the expression.
  30213. */
  30214. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  30215. /**
  30216. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  30217. * <p>
  30218. * This is equivalent to {@link Expression#evaluate} but always returns a {@link Color} object.
  30219. * </p>
  30220. * @param feature - The feature whose properties may be used as variables in the expression.
  30221. * @param [result] - The object in which to store the result
  30222. * @returns The modified result parameter or a new Color instance if one was not provided.
  30223. */
  30224. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  30225. }
  30226. /**
  30227. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  30228. * performance improvements by rendering less geometry and dispatching less terrain requests.
  30229. */
  30230. export class Fog {
  30231. constructor();
  30232. /**
  30233. * <code>true</code> if fog is enabled, <code>false</code> otherwise.
  30234. */
  30235. enabled: boolean;
  30236. /**
  30237. * <code>true</code> if fog is renderable in shaders, <code>false</code> otherwise.
  30238. * This allows to benefits from optimized tile loading strategy based on fog density without the actual visual rendering.
  30239. */
  30240. renderable: boolean;
  30241. /**
  30242. * A scalar that determines the density of the fog. Terrain that is in full fog are culled.
  30243. * The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero.
  30244. * The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of
  30245. * 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled.
  30246. * Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.
  30247. */
  30248. density: number;
  30249. /**
  30250. * A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce
  30251. * the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased
  30252. * for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably
  30253. * lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.
  30254. */
  30255. screenSpaceErrorFactor: number;
  30256. /**
  30257. * 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
  30258. * the brightness at all.
  30259. */
  30260. minimumBrightness: number;
  30261. }
  30262. /**
  30263. * Monitors the frame rate (frames per second) in a {@link Scene} and raises an event if the frame rate is
  30264. * lower than a threshold. Later, if the frame rate returns to the required level, a separate event is raised.
  30265. * To avoid creating multiple FrameRateMonitors for a single {@link Scene}, use {@link FrameRateMonitor.fromScene}
  30266. * instead of constructing an instance explicitly.
  30267. * @param [options] - Object with the following properties:
  30268. * @param options.scene - The Scene instance for which to monitor performance.
  30269. * @param [options.samplingWindow = 5.0] - The length of the sliding window over which to compute the average frame rate, in seconds.
  30270. * @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
  30271. * switches back to the tab) before starting to measure performance, in seconds.
  30272. * @param [options.warmupPeriod = 5.0] - The length of the warmup period, in seconds. During the warmup period, a separate
  30273. * (usually lower) frame rate is required.
  30274. * @param [options.minimumFrameRateDuringWarmup = 4] - The minimum frames-per-second that are required for acceptable performance during
  30275. * the warmup period. If the frame rate averages less than this during any samplingWindow during the warmupPeriod, the
  30276. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  30277. * @param [options.minimumFrameRateAfterWarmup = 8] - The minimum frames-per-second that are required for acceptable performance after
  30278. * the end of the warmup period. If the frame rate averages less than this during any samplingWindow after the warmupPeriod, the
  30279. * lowFrameRate event will be raised and the page will redirect to the redirectOnLowFrameRateUrl, if any.
  30280. */
  30281. export class FrameRateMonitor {
  30282. constructor(options?: {
  30283. scene: Scene;
  30284. samplingWindow?: number;
  30285. quietPeriod?: number;
  30286. warmupPeriod?: number;
  30287. minimumFrameRateDuringWarmup?: number;
  30288. minimumFrameRateAfterWarmup?: number;
  30289. });
  30290. /**
  30291. * Gets or sets the length of the sliding window over which to compute the average frame rate, in seconds.
  30292. */
  30293. samplingWindow: number;
  30294. /**
  30295. * Gets or sets the length of time to wait at startup and each time the page becomes visible (i.e. when the user
  30296. * switches back to the tab) before starting to measure performance, in seconds.
  30297. */
  30298. quietPeriod: number;
  30299. /**
  30300. * Gets or sets the length of the warmup period, in seconds. During the warmup period, a separate
  30301. * (usually lower) frame rate is required.
  30302. */
  30303. warmupPeriod: number;
  30304. /**
  30305. * Gets or sets the minimum frames-per-second that are required for acceptable performance during
  30306. * the warmup period. If the frame rate averages less than this during any <code>samplingWindow</code> during the <code>warmupPeriod</code>, the
  30307. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  30308. */
  30309. minimumFrameRateDuringWarmup: number;
  30310. /**
  30311. * Gets or sets the minimum frames-per-second that are required for acceptable performance after
  30312. * 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
  30313. * <code>lowFrameRate</code> event will be raised and the page will redirect to the <code>redirectOnLowFrameRateUrl</code>, if any.
  30314. */
  30315. minimumFrameRateAfterWarmup: number;
  30316. /**
  30317. * The default frame rate monitoring settings. These settings are used when {@link FrameRateMonitor.fromScene}
  30318. * needs to create a new frame rate monitor, and for any settings that are not passed to the
  30319. * {@link FrameRateMonitor} constructor.
  30320. */
  30321. static defaultSettings: any;
  30322. /**
  30323. * Gets the {@link FrameRateMonitor} for a given scene. If the scene does not yet have
  30324. * a {@link FrameRateMonitor}, one is created with the {@link FrameRateMonitor.defaultSettings}.
  30325. * @param scene - The scene for which to get the {@link FrameRateMonitor}.
  30326. * @returns The scene's {@link FrameRateMonitor}.
  30327. */
  30328. static fromScene(scene: Scene): FrameRateMonitor;
  30329. /**
  30330. * Gets the {@link Scene} instance for which to monitor performance.
  30331. */
  30332. scene: Scene;
  30333. /**
  30334. * Gets the event that is raised when a low frame rate is detected. The function will be passed
  30335. * the {@link Scene} instance as its first parameter and the average number of frames per second
  30336. * over the sampling window as its second parameter.
  30337. */
  30338. lowFrameRate: Event;
  30339. /**
  30340. * Gets the event that is raised when the frame rate returns to a normal level after having been low.
  30341. * The function will be passed the {@link Scene} instance as its first parameter and the average
  30342. * number of frames per second over the sampling window as its second parameter.
  30343. */
  30344. nominalFrameRate: Event;
  30345. /**
  30346. * Gets the most recently computed average frames-per-second over the last <code>samplingWindow</code>.
  30347. * This property may be undefined if the frame rate has not been computed.
  30348. */
  30349. lastFramesPerSecond: number;
  30350. /**
  30351. * Pauses monitoring of the frame rate. To resume monitoring, {@link FrameRateMonitor#unpause}
  30352. * must be called once for each time this function is called.
  30353. */
  30354. pause(): void;
  30355. /**
  30356. * Resumes monitoring of the frame rate. If {@link FrameRateMonitor#pause} was called
  30357. * multiple times, this function must be called the same number of times in order to
  30358. * actually resume monitoring.
  30359. */
  30360. unpause(): void;
  30361. /**
  30362. * Returns true if this object was destroyed; otherwise, false.
  30363. * <br /><br />
  30364. * If this object was destroyed, it should not be used; calling any function other than
  30365. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30366. * @returns True if this object was destroyed; otherwise, false.
  30367. */
  30368. isDestroyed(): boolean;
  30369. /**
  30370. * Unsubscribes this instance from all events it is listening to.
  30371. * Once an object is destroyed, it should not be used; calling any function other than
  30372. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30373. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30374. */
  30375. destroy(): void;
  30376. }
  30377. /**
  30378. * Describes the format in which to request GetFeatureInfo from a Web Map Service (WMS) server.
  30379. * @param type - The type of response to expect from a GetFeatureInfo request. Valid
  30380. * values are 'json', 'xml', 'html', or 'text'.
  30381. * @param [format] - The info format to request from the WMS server. This is usually a
  30382. * MIME type such as 'application/json' or text/xml'. If this parameter is not specified, the provider will request 'json'
  30383. * using 'application/json', 'xml' using 'text/xml', 'html' using 'text/html', and 'text' using 'text/plain'.
  30384. * @param [callback] - A function to invoke with the GetFeatureInfo response from the WMS server
  30385. * in order to produce an array of picked {@link ImageryLayerFeatureInfo} instances. If this parameter is not specified,
  30386. * a default function for the type of response is used.
  30387. */
  30388. export class GetFeatureInfoFormat {
  30389. constructor(type: string, format?: string, callback?: (...params: any[]) => any);
  30390. }
  30391. /**
  30392. * The globe rendered in the scene, including its terrain ({@link Globe#terrainProvider})
  30393. * and imagery layers ({@link Globe#imageryLayers}). Access the globe using {@link Scene#globe}.
  30394. * @param [ellipsoid = Ellipsoid.WGS84] - Determines the size and shape of the
  30395. * globe.
  30396. */
  30397. export class Globe {
  30398. constructor(ellipsoid?: Ellipsoid);
  30399. /**
  30400. * Determines if the globe will be shown.
  30401. */
  30402. show: boolean;
  30403. /**
  30404. * The maximum screen-space error used to drive level-of-detail refinement. Higher
  30405. * values will provide better performance but lower visual quality.
  30406. */
  30407. maximumScreenSpaceError: number;
  30408. /**
  30409. * The size of the terrain tile cache, expressed as a number of tiles. Any additional
  30410. * tiles beyond this number will be freed, as long as they aren't needed for rendering
  30411. * this frame. A larger number will consume more memory but will show detail faster
  30412. * when, for example, zooming out and then back in.
  30413. */
  30414. tileCacheSize: number;
  30415. /**
  30416. * Gets or sets the number of loading descendant tiles that is considered "too many".
  30417. * If a tile has too many loading descendants, that tile will be loaded and rendered before any of
  30418. * its descendants are loaded and rendered. This means more feedback for the user that something
  30419. * is happening at the cost of a longer overall load time. Setting this to 0 will cause each
  30420. * tile level to be loaded successively, significantly increasing load time. Setting it to a large
  30421. * number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make
  30422. * detail appear all at once after a long wait.
  30423. */
  30424. loadingDescendantLimit: number;
  30425. /**
  30426. * Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded.
  30427. * Setting this to true optimizes the zoom-out experience and provides more detail in
  30428. * newly-exposed areas when panning. The down side is that it requires loading more tiles.
  30429. */
  30430. preloadAncestors: boolean;
  30431. /**
  30432. * Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded.
  30433. * Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even
  30434. * if they are culled. Setting this to true may provide a better panning experience at the
  30435. * cost of loading more tiles.
  30436. */
  30437. preloadSiblings: boolean;
  30438. /**
  30439. * The color to use to highlight terrain fill tiles. If undefined, fill tiles are not
  30440. * highlighted at all. The alpha value is used to alpha blend with the tile's
  30441. * actual color. Because terrain fill tiles do not represent the actual terrain surface,
  30442. * it may be useful in some applications to indicate visually that they are not to be trusted.
  30443. */
  30444. fillHighlightColor: Color;
  30445. /**
  30446. * Enable lighting the globe with the scene's light source.
  30447. */
  30448. enableLighting: boolean;
  30449. /**
  30450. * A multiplier to adjust terrain lambert lighting.
  30451. * This number is multiplied by the result of <code>czm_getLambertDiffuse</code> in GlobeFS.glsl.
  30452. * This only takes effect when <code>enableLighting</code> is <code>true</code>.
  30453. */
  30454. lambertDiffuseMultiplier: number;
  30455. /**
  30456. * Enable dynamic lighting effects on atmosphere and fog. This only takes effect
  30457. * when <code>enableLighting</code> is <code>true</code>.
  30458. */
  30459. dynamicAtmosphereLighting: boolean;
  30460. /**
  30461. * Whether dynamic atmosphere lighting uses the sun direction instead of the scene's
  30462. * light direction. This only takes effect when <code>enableLighting</code> and
  30463. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  30464. */
  30465. dynamicAtmosphereLightingFromSun: boolean;
  30466. /**
  30467. * Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
  30468. */
  30469. showGroundAtmosphere: boolean;
  30470. /**
  30471. * The intensity of the light that is used for computing the ground atmosphere color.
  30472. */
  30473. atmosphereLightIntensity: number;
  30474. /**
  30475. * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
  30476. */
  30477. atmosphereRayleighCoefficient: Cartesian3;
  30478. /**
  30479. * The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
  30480. */
  30481. atmosphereMieCoefficient: Cartesian3;
  30482. /**
  30483. * The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
  30484. */
  30485. atmosphereRayleighScaleHeight: number;
  30486. /**
  30487. * The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
  30488. */
  30489. atmosphereMieScaleHeight: number;
  30490. /**
  30491. * The anisotropy of the medium to consider for Mie scattering.
  30492. * <p>
  30493. * Valid values are between -1.0 and 1.0.
  30494. * </p>
  30495. */
  30496. atmosphereMieAnisotropy: number;
  30497. /**
  30498. * The distance where everything becomes lit. This only takes effect
  30499. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  30500. */
  30501. lightingFadeOutDistance: number;
  30502. /**
  30503. * The distance where lighting resumes. This only takes effect
  30504. * when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
  30505. */
  30506. lightingFadeInDistance: number;
  30507. /**
  30508. * The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere.
  30509. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  30510. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  30511. */
  30512. nightFadeOutDistance: number;
  30513. /**
  30514. * The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere.
  30515. * This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and
  30516. * <code>dynamicAtmosphereLighting</code> are <code>true</code>.
  30517. */
  30518. nightFadeInDistance: number;
  30519. /**
  30520. * True if an animated wave effect should be shown in areas of the globe
  30521. * covered by water; otherwise, false. This property is ignored if the
  30522. * <code>terrainProvider</code> does not provide a water mask.
  30523. */
  30524. showWaterEffect: boolean;
  30525. /**
  30526. * True if primitives such as billboards, polylines, labels, etc. should be depth-tested
  30527. * against the terrain surface, or false if such primitives should always be drawn on top
  30528. * of terrain unless they're on the opposite side of the globe. The disadvantage of depth
  30529. * testing primitives against terrain is that slight numerical noise or terrain level-of-detail
  30530. * switched can sometimes make a primitive that should be on the surface disappear underneath it.
  30531. */
  30532. depthTestAgainstTerrain: boolean;
  30533. /**
  30534. * Determines whether the globe casts or receives shadows from light sources. Setting the globe
  30535. * to cast shadows may impact performance since the terrain is rendered again from the light's perspective.
  30536. * Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
  30537. */
  30538. shadows: ShadowMode;
  30539. /**
  30540. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  30541. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  30542. */
  30543. atmosphereHueShift: number;
  30544. /**
  30545. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  30546. * A saturation shift of -1.0 is monochrome.
  30547. */
  30548. atmosphereSaturationShift: number;
  30549. /**
  30550. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  30551. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  30552. */
  30553. atmosphereBrightnessShift: number;
  30554. /**
  30555. * A scalar used to exaggerate the terrain. Defaults to <code>1.0</code> (no exaggeration).
  30556. * A value of <code>2.0</code> scales the terrain by 2x.
  30557. * A value of <code>0.0</code> makes the terrain completely flat.
  30558. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  30559. */
  30560. terrainExaggeration: number;
  30561. /**
  30562. * The height from which terrain is exaggerated. Defaults to <code>0.0</code> (scaled relative to ellipsoid surface).
  30563. * Terrain that is above this height will scale upwards and terrain that is below this height will scale downwards.
  30564. * Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.
  30565. * If {@link Globe#terrainExaggeration} is <code>1.0</code> this value will have no effect.
  30566. */
  30567. terrainExaggerationRelativeHeight: number;
  30568. /**
  30569. * Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles.
  30570. * Skirts are always hidden when the camera is underground or translucency is enabled.
  30571. */
  30572. showSkirts: boolean;
  30573. /**
  30574. * Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
  30575. */
  30576. backFaceCulling: boolean;
  30577. /**
  30578. * Gets an ellipsoid describing the shape of this globe.
  30579. */
  30580. ellipsoid: Ellipsoid;
  30581. /**
  30582. * Gets the collection of image layers that will be rendered on this globe.
  30583. */
  30584. imageryLayers: ImageryLayerCollection;
  30585. /**
  30586. * Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.
  30587. */
  30588. readonly imageryLayersUpdatedEvent: Event;
  30589. /**
  30590. * Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty,
  30591. * all terrain and imagery for the current view have been loaded.
  30592. */
  30593. readonly tilesLoaded: boolean;
  30594. /**
  30595. * Gets or sets the color of the globe when no imagery is available.
  30596. */
  30597. baseColor: Color;
  30598. /**
  30599. * A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
  30600. */
  30601. clippingPlanes: ClippingPlaneCollection;
  30602. /**
  30603. * A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
  30604. * Defaults to the maximum extent of cartographic coordinates.
  30605. */
  30606. cartographicLimitRectangle: Rectangle;
  30607. /**
  30608. * The normal map to use for rendering waves in the ocean. Setting this property will
  30609. * only have an effect if the configured terrain provider includes a water mask.
  30610. */
  30611. oceanNormalMapUrl: string;
  30612. /**
  30613. * The terrain provider providing surface geometry for this globe.
  30614. */
  30615. terrainProvider: TerrainProvider;
  30616. /**
  30617. * Gets an event that's raised when the terrain provider is changed
  30618. */
  30619. readonly terrainProviderChanged: Event;
  30620. /**
  30621. * 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,
  30622. * all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
  30623. */
  30624. tileLoadProgressEvent: Event;
  30625. /**
  30626. * 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
  30627. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  30628. */
  30629. material: Material | undefined;
  30630. /**
  30631. * The color to render the back side of the globe when the camera is underground or the globe is translucent,
  30632. * blended with the globe color based on the camera's distance.
  30633. * <br /><br />
  30634. * To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.
  30635. */
  30636. undergroundColor: Color;
  30637. /**
  30638. * Gets or sets the near and far distance for blending {@link Globe#undergroundColor} with the globe color.
  30639. * The alpha will interpolate between the {@link NearFarScalar#nearValue} and
  30640. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30641. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30642. * Outside of these ranges the alpha remains clamped to the nearest bound. If undefined,
  30643. * the underground color will not be blended with the globe color.
  30644. * <br /> <br />
  30645. * When the camera is above the ellipsoid the distance is computed from the nearest
  30646. * point on the ellipsoid instead of the camera's position.
  30647. */
  30648. undergroundColorAlphaByDistance: NearFarScalar;
  30649. /**
  30650. * Properties for controlling globe translucency.
  30651. */
  30652. translucency: GlobeTranslucency;
  30653. /**
  30654. * Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
  30655. * @example
  30656. * // find intersection of ray through a pixel and the globe
  30657. * const ray = viewer.camera.getPickRay(windowCoordinates);
  30658. * const intersection = globe.pick(ray, scene);
  30659. * @param ray - The ray to test for intersection.
  30660. * @param scene - The scene.
  30661. * @param [result] - The object onto which to store the result.
  30662. * @returns The intersection or <code>undefined</code> if none was found.
  30663. */
  30664. pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3 | undefined;
  30665. /**
  30666. * Get the height of the surface at a given cartographic.
  30667. * @param cartographic - The cartographic for which to find the height.
  30668. * @returns The height of the cartographic or undefined if it could not be found.
  30669. */
  30670. getHeight(cartographic: Cartographic): number | undefined;
  30671. /**
  30672. * Returns true if this object was destroyed; otherwise, false.
  30673. * <br /><br />
  30674. * If this object was destroyed, it should not be used; calling any function other than
  30675. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  30676. * @returns True if this object was destroyed; otherwise, false.
  30677. */
  30678. isDestroyed(): boolean;
  30679. /**
  30680. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  30681. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  30682. * <br /><br />
  30683. * Once an object is destroyed, it should not be used; calling any function other than
  30684. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  30685. * assign the return value (<code>undefined</code>) to the object as done in the example.
  30686. * @example
  30687. * globe = globe && globe.destroy();
  30688. */
  30689. destroy(): void;
  30690. }
  30691. /**
  30692. * Properties for controlling globe translucency.
  30693. */
  30694. export class GlobeTranslucency {
  30695. constructor();
  30696. /**
  30697. * When true, the globe is rendered as a translucent surface.
  30698. * <br /><br />
  30699. * The alpha is computed by blending {@link Globe#material}, {@link Globe#imageryLayers},
  30700. * and {@link Globe#baseColor}, all of which may contain translucency, and then multiplying by
  30701. * {@link GlobeTranslucency#frontFaceAlpha} and {@link GlobeTranslucency#frontFaceAlphaByDistance} for front faces and
  30702. * {@link GlobeTranslucency#backFaceAlpha} and {@link GlobeTranslucency#backFaceAlphaByDistance} for back faces.
  30703. * When the camera is underground back faces and front faces are swapped, i.e. back-facing geometry
  30704. * is considered front facing.
  30705. * <br /><br />
  30706. * Translucency is disabled by default.
  30707. */
  30708. enabled: boolean;
  30709. /**
  30710. * A constant translucency to apply to front faces of the globe.
  30711. * <br /><br />
  30712. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30713. * @example
  30714. * // Set front face translucency to 0.5.
  30715. * globe.translucency.frontFaceAlpha = 0.5;
  30716. * globe.translucency.enabled = true;
  30717. */
  30718. frontFaceAlpha: number;
  30719. /**
  30720. * Gets or sets near and far translucency properties of front faces of the globe based on the distance to the camera.
  30721. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  30722. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30723. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30724. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  30725. * frontFaceAlphaByDistance will be disabled.
  30726. * <br /><br />
  30727. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30728. * @example
  30729. * // Example 1.
  30730. * // Set front face translucency to 0.5 when the
  30731. * // camera is 1500 meters from the surface and 1.0
  30732. * // as the camera distance approaches 8.0e6 meters.
  30733. * globe.translucency.frontFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  30734. * globe.translucency.enabled = true;
  30735. * @example
  30736. * // Example 2.
  30737. * // Disable front face translucency by distance
  30738. * globe.translucency.frontFaceAlphaByDistance = undefined;
  30739. */
  30740. frontFaceAlphaByDistance: NearFarScalar;
  30741. /**
  30742. * A constant translucency to apply to back faces of the globe.
  30743. * <br /><br />
  30744. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30745. * @example
  30746. * // Set back face translucency to 0.5.
  30747. * globe.translucency.backFaceAlpha = 0.5;
  30748. * globe.translucency.enabled = true;
  30749. */
  30750. backFaceAlpha: number;
  30751. /**
  30752. * Gets or sets near and far translucency properties of back faces of the globe based on the distance to the camera.
  30753. * The translucency will interpolate between the {@link NearFarScalar#nearValue} and
  30754. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  30755. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  30756. * Outside of these ranges the translucency remains clamped to the nearest bound. If undefined,
  30757. * backFaceAlphaByDistance will be disabled.
  30758. * <br /><br />
  30759. * {@link GlobeTranslucency#enabled} must be set to true for this option to take effect.
  30760. * @example
  30761. * // Example 1.
  30762. * // Set back face translucency to 0.5 when the
  30763. * // camera is 1500 meters from the surface and 1.0
  30764. * // as the camera distance approaches 8.0e6 meters.
  30765. * globe.translucency.backFaceAlphaByDistance = new Cesium.NearFarScalar(1.5e2, 0.5, 8.0e6, 1.0);
  30766. * globe.translucency.enabled = true;
  30767. * @example
  30768. * // Example 2.
  30769. * // Disable back face translucency by distance
  30770. * globe.translucency.backFaceAlphaByDistance = undefined;
  30771. */
  30772. backFaceAlphaByDistance: NearFarScalar;
  30773. /**
  30774. * A property specifying a {@link Rectangle} used to limit translucency to a cartographic area.
  30775. * Defaults to the maximum extent of cartographic coordinates.
  30776. */
  30777. rectangle: Rectangle;
  30778. }
  30779. export namespace GoogleEarthEnterpriseImageryProvider {
  30780. /**
  30781. * Initialization options for the GoogleEarthEnterpriseImageryProvider constructor
  30782. * @property url - The url of the Google Earth Enterprise server hosting the imagery.
  30783. * @property metadata - A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseTerrainProvider.
  30784. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  30785. * @property [tileDiscardPolicy] - The policy that determines if a tile
  30786. * is invalid and should be discarded. If this value is not specified, a default
  30787. * is to discard tiles that fail to download.
  30788. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  30789. */
  30790. type ConstructorOptions = {
  30791. url: Resource | string;
  30792. metadata: GoogleEarthEnterpriseMetadata;
  30793. ellipsoid?: Ellipsoid;
  30794. tileDiscardPolicy?: TileDiscardPolicy;
  30795. credit?: Credit | string;
  30796. };
  30797. }
  30798. /**
  30799. * Provides tiled imagery using the Google Earth Enterprise REST API.
  30800. *
  30801. * Notes: This provider is for use with the 3D Earth API of Google Earth Enterprise,
  30802. * {@link GoogleEarthEnterpriseMapsProvider} should be used with 2D Maps API.
  30803. * @example
  30804. * const geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
  30805. * const gee = new Cesium.GoogleEarthEnterpriseImageryProvider({
  30806. * metadata : geeMetadata
  30807. * });
  30808. * @param options - Object describing initialization options
  30809. */
  30810. export class GoogleEarthEnterpriseImageryProvider {
  30811. constructor(options: GoogleEarthEnterpriseImageryProvider.ConstructorOptions);
  30812. /**
  30813. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  30814. * 1.0 representing fully opaque.
  30815. */
  30816. defaultAlpha: number | undefined;
  30817. /**
  30818. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  30819. * 1.0 representing fully opaque.
  30820. */
  30821. defaultNightAlpha: number | undefined;
  30822. /**
  30823. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  30824. * 1.0 representing fully opaque.
  30825. */
  30826. defaultDayAlpha: number | undefined;
  30827. /**
  30828. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  30829. * makes the imagery darker while greater than 1.0 makes it brighter.
  30830. */
  30831. defaultBrightness: number | undefined;
  30832. /**
  30833. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  30834. * the contrast while greater than 1.0 increases it.
  30835. */
  30836. defaultContrast: number | undefined;
  30837. /**
  30838. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  30839. */
  30840. defaultHue: number | undefined;
  30841. /**
  30842. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  30843. * saturation while greater than 1.0 increases it.
  30844. */
  30845. defaultSaturation: number | undefined;
  30846. /**
  30847. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  30848. */
  30849. defaultGamma: number | undefined;
  30850. /**
  30851. * The default texture minification filter to apply to this provider.
  30852. */
  30853. defaultMinificationFilter: TextureMinificationFilter;
  30854. /**
  30855. * The default texture magnification filter to apply to this provider.
  30856. */
  30857. defaultMagnificationFilter: TextureMagnificationFilter;
  30858. /**
  30859. * Gets the name of the Google Earth Enterprise server url hosting the imagery.
  30860. */
  30861. readonly url: string;
  30862. /**
  30863. * Gets the proxy used by this provider.
  30864. */
  30865. readonly proxy: Proxy;
  30866. /**
  30867. * Gets the width of each tile, in pixels. This function should
  30868. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30869. */
  30870. readonly tileWidth: number;
  30871. /**
  30872. * Gets the height of each tile, in pixels. This function should
  30873. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30874. */
  30875. readonly tileHeight: number;
  30876. /**
  30877. * Gets the maximum level-of-detail that can be requested. This function should
  30878. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30879. */
  30880. readonly maximumLevel: number | undefined;
  30881. /**
  30882. * Gets the minimum level-of-detail that can be requested. This function should
  30883. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30884. */
  30885. readonly minimumLevel: number;
  30886. /**
  30887. * Gets the tiling scheme used by this provider. This function should
  30888. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30889. */
  30890. readonly tilingScheme: TilingScheme;
  30891. /**
  30892. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  30893. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30894. */
  30895. readonly rectangle: Rectangle;
  30896. /**
  30897. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  30898. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  30899. * returns undefined, no tiles are filtered. This function should
  30900. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30901. */
  30902. readonly tileDiscardPolicy: TileDiscardPolicy;
  30903. /**
  30904. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  30905. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  30906. * are passed an instance of {@link TileProviderError}.
  30907. */
  30908. readonly errorEvent: Event;
  30909. /**
  30910. * Gets a value indicating whether or not the provider is ready for use.
  30911. */
  30912. readonly ready: boolean;
  30913. /**
  30914. * Gets a promise that resolves to true when the provider is ready for use.
  30915. */
  30916. readonly readyPromise: Promise<boolean>;
  30917. /**
  30918. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  30919. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30920. */
  30921. readonly credit: Credit;
  30922. /**
  30923. * Gets a value indicating whether or not the images provided by this imagery provider
  30924. * include an alpha channel. If this property is false, an alpha channel, if present, will
  30925. * be ignored. If this property is true, any images without an alpha channel will be treated
  30926. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  30927. * and texture upload time.
  30928. */
  30929. readonly hasAlphaChannel: boolean;
  30930. /**
  30931. * Gets the credits to be displayed when a given tile is displayed.
  30932. * @param x - The tile X coordinate.
  30933. * @param y - The tile Y coordinate.
  30934. * @param level - The tile level;
  30935. * @returns The credits to be displayed when the tile is displayed.
  30936. */
  30937. getTileCredits(x: number, y: number, level: number): Credit[];
  30938. /**
  30939. * Requests the image for a given tile. This function should
  30940. * not be called before {@link GoogleEarthEnterpriseImageryProvider#ready} returns true.
  30941. * @param x - The tile X coordinate.
  30942. * @param y - The tile Y coordinate.
  30943. * @param level - The tile level.
  30944. * @param [request] - The request object. Intended for internal use only.
  30945. * @returns A promise for the image that will resolve when the image is available, or
  30946. * undefined if there are too many active requests to the server, and the request should be retried later.
  30947. */
  30948. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  30949. /**
  30950. * Picking features is not currently supported by this imagery provider, so this function simply returns
  30951. * undefined.
  30952. * @param x - The tile X coordinate.
  30953. * @param y - The tile Y coordinate.
  30954. * @param level - The tile level.
  30955. * @param longitude - The longitude at which to pick features.
  30956. * @param latitude - The latitude at which to pick features.
  30957. * @returns Undefined since picking is not supported.
  30958. */
  30959. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  30960. }
  30961. export namespace GoogleEarthEnterpriseMapsProvider {
  30962. /**
  30963. * Initialization options for the GoogleEarthEnterpriseMapsProvider constructor
  30964. * @property url - The url of the Google Earth server hosting the imagery.
  30965. * @property channel - The channel (id) to be used when requesting data from the server.
  30966. * The channel number can be found by looking at the json file located at:
  30967. * earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may
  30968. * differ depending on your Google Earth Enterprise server configuration. Look for the "id" that
  30969. * is associated with a "ImageryMaps" requestType. There may be more than one id available.
  30970. * Example:
  30971. * {
  30972. * layers: [
  30973. * {
  30974. * id: 1002,
  30975. * requestType: "ImageryMaps"
  30976. * },
  30977. * {
  30978. * id: 1007,
  30979. * requestType: "VectorMapsRaster"
  30980. * }
  30981. * ]
  30982. * }
  30983. * @property [path = "/default_map"] - The path of the Google Earth server hosting the imagery.
  30984. * @property [maximumLevel] - The maximum level-of-detail supported by the Google Earth
  30985. * Enterprise server, or undefined if there is no limit.
  30986. * @property [tileDiscardPolicy] - The policy that determines if a tile
  30987. * is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
  30988. * a {@link NeverTileDiscardPolicy} for this parameter.
  30989. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  30990. */
  30991. type ConstructorOptions = {
  30992. url: Resource | string;
  30993. channel: number;
  30994. path?: string;
  30995. maximumLevel?: number;
  30996. tileDiscardPolicy?: TileDiscardPolicy;
  30997. ellipsoid?: Ellipsoid;
  30998. };
  30999. }
  31000. /**
  31001. * Provides tiled imagery using the Google Earth Imagery API.
  31002. *
  31003. * Notes: This imagery provider does not work with the public Google Earth servers. It works with the
  31004. * Google Earth Enterprise Server.
  31005. *
  31006. * By default the Google Earth Enterprise server does not set the
  31007. * {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} headers. You can either
  31008. * use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf
  31009. * and add the 'Header set Access-Control-Allow-Origin "*"' option to the '&lt;Directory /&gt;' and
  31010. * '&lt;Directory "/opt/google/gehttpd/htdocs"&gt;' directives.
  31011. *
  31012. * This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it
  31013. * is necessary to use {@link GoogleEarthEnterpriseImageryProvider}
  31014. * @example
  31015. * const google = new Cesium.GoogleEarthEnterpriseMapsProvider({
  31016. * url : 'https://earth.localdomain',
  31017. * channel : 1008
  31018. * });
  31019. * @param options - Object describing initialization options
  31020. */
  31021. export class GoogleEarthEnterpriseMapsProvider {
  31022. constructor(options: GoogleEarthEnterpriseMapsProvider.ConstructorOptions);
  31023. /**
  31024. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31025. * 1.0 representing fully opaque.
  31026. */
  31027. defaultAlpha: number | undefined;
  31028. /**
  31029. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31030. * 1.0 representing fully opaque.
  31031. */
  31032. defaultNightAlpha: number | undefined;
  31033. /**
  31034. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31035. * 1.0 representing fully opaque.
  31036. */
  31037. defaultDayAlpha: number | undefined;
  31038. /**
  31039. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31040. * makes the imagery darker while greater than 1.0 makes it brighter.
  31041. */
  31042. defaultBrightness: number | undefined;
  31043. /**
  31044. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31045. * the contrast while greater than 1.0 increases it.
  31046. */
  31047. defaultContrast: number | undefined;
  31048. /**
  31049. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31050. */
  31051. defaultHue: number | undefined;
  31052. /**
  31053. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31054. * saturation while greater than 1.0 increases it.
  31055. */
  31056. defaultSaturation: number | undefined;
  31057. /**
  31058. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31059. */
  31060. defaultGamma: number | undefined;
  31061. /**
  31062. * The default texture minification filter to apply to this provider.
  31063. */
  31064. defaultMinificationFilter: TextureMinificationFilter;
  31065. /**
  31066. * The default texture magnification filter to apply to this provider.
  31067. */
  31068. defaultMagnificationFilter: TextureMagnificationFilter;
  31069. /**
  31070. * Gets the URL of the Google Earth MapServer.
  31071. */
  31072. readonly url: string;
  31073. /**
  31074. * Gets the url path of the data on the Google Earth server.
  31075. */
  31076. readonly path: string;
  31077. /**
  31078. * Gets the proxy used by this provider.
  31079. */
  31080. readonly proxy: Proxy;
  31081. /**
  31082. * Gets the imagery channel (id) currently being used.
  31083. */
  31084. readonly channel: number;
  31085. /**
  31086. * Gets the width of each tile, in pixels. This function should
  31087. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31088. */
  31089. readonly tileWidth: number;
  31090. /**
  31091. * Gets the height of each tile, in pixels. This function should
  31092. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31093. */
  31094. readonly tileHeight: number;
  31095. /**
  31096. * Gets the maximum level-of-detail that can be requested. This function should
  31097. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31098. */
  31099. readonly maximumLevel: number | undefined;
  31100. /**
  31101. * Gets the minimum level-of-detail that can be requested. This function should
  31102. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31103. */
  31104. readonly minimumLevel: number;
  31105. /**
  31106. * Gets the tiling scheme used by this provider. This function should
  31107. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31108. */
  31109. readonly tilingScheme: TilingScheme;
  31110. /**
  31111. * Gets the version of the data used by this provider. This function should
  31112. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31113. */
  31114. readonly version: number;
  31115. /**
  31116. * Gets the type of data that is being requested from the provider. This function should
  31117. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31118. */
  31119. readonly requestType: string;
  31120. /**
  31121. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  31122. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31123. */
  31124. readonly rectangle: Rectangle;
  31125. /**
  31126. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31127. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31128. * returns undefined, no tiles are filtered. This function should
  31129. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31130. */
  31131. readonly tileDiscardPolicy: TileDiscardPolicy;
  31132. /**
  31133. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  31134. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31135. * are passed an instance of {@link TileProviderError}.
  31136. */
  31137. readonly errorEvent: Event;
  31138. /**
  31139. * Gets a value indicating whether or not the provider is ready for use.
  31140. */
  31141. readonly ready: boolean;
  31142. /**
  31143. * Gets a promise that resolves to true when the provider is ready for use.
  31144. */
  31145. readonly readyPromise: Promise<boolean>;
  31146. /**
  31147. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31148. * the source of the imagery. This function should not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31149. */
  31150. readonly credit: Credit;
  31151. /**
  31152. * Gets a value indicating whether or not the images provided by this imagery provider
  31153. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31154. * be ignored. If this property is true, any images without an alpha channel will be treated
  31155. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31156. * and texture upload time are reduced.
  31157. */
  31158. readonly hasAlphaChannel: boolean;
  31159. /**
  31160. * Gets the credits to be displayed when a given tile is displayed.
  31161. * @param x - The tile X coordinate.
  31162. * @param y - The tile Y coordinate.
  31163. * @param level - The tile level;
  31164. * @returns The credits to be displayed when the tile is displayed.
  31165. */
  31166. getTileCredits(x: number, y: number, level: number): Credit[];
  31167. /**
  31168. * Requests the image for a given tile. This function should
  31169. * not be called before {@link GoogleEarthEnterpriseMapsProvider#ready} returns true.
  31170. * @param x - The tile X coordinate.
  31171. * @param y - The tile Y coordinate.
  31172. * @param level - The tile level.
  31173. * @param [request] - The request object. Intended for internal use only.
  31174. * @returns A promise for the image that will resolve when the image is available, or
  31175. * undefined if there are too many active requests to the server, and the request should be retried later.
  31176. */
  31177. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  31178. /**
  31179. * Picking features is not currently supported by this imagery provider, so this function simply returns
  31180. * undefined.
  31181. * @param x - The tile X coordinate.
  31182. * @param y - The tile Y coordinate.
  31183. * @param level - The tile level.
  31184. * @param longitude - The longitude at which to pick features.
  31185. * @param latitude - The latitude at which to pick features.
  31186. * @returns Undefined since picking is not supported.
  31187. */
  31188. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  31189. /**
  31190. * Gets or sets the URL to the Google Earth logo for display in the credit.
  31191. */
  31192. static logoUrl: string;
  31193. }
  31194. export namespace GridImageryProvider {
  31195. /**
  31196. * Initialization options for the GridImageryProvider constructor
  31197. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  31198. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  31199. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  31200. * parameter is specified, the WGS84 ellipsoid is used.
  31201. * @property [cells = 8] - The number of grids cells.
  31202. * @property [color = Color(1.0, 1.0, 1.0, 0.4)] - The color to draw grid lines.
  31203. * @property [glowColor = Color(0.0, 1.0, 0.0, 0.05)] - The color to draw glow for grid lines.
  31204. * @property [glowWidth = 6] - The width of lines used for rendering the line glow effect.
  31205. * @property [backgroundColor = Color(0.0, 0.5, 0.0, 0.2)] - Background fill color.
  31206. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  31207. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  31208. * @property [canvasSize = 256] - The size of the canvas used for rendering.
  31209. */
  31210. type ConstructorOptions = {
  31211. tilingScheme?: TilingScheme;
  31212. ellipsoid?: Ellipsoid;
  31213. cells?: number;
  31214. color?: Color;
  31215. glowColor?: Color;
  31216. glowWidth?: number;
  31217. backgroundColor?: Color;
  31218. tileWidth?: number;
  31219. tileHeight?: number;
  31220. canvasSize?: number;
  31221. };
  31222. }
  31223. /**
  31224. * An {@link ImageryProvider} that draws a wireframe grid on every tile with controllable background and glow.
  31225. * May be useful for custom rendering effects or debugging terrain.
  31226. * @param options - Object describing initialization options
  31227. */
  31228. export class GridImageryProvider {
  31229. constructor(options: GridImageryProvider.ConstructorOptions);
  31230. /**
  31231. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  31232. * 1.0 representing fully opaque.
  31233. */
  31234. defaultAlpha: number | undefined;
  31235. /**
  31236. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  31237. * 1.0 representing fully opaque.
  31238. */
  31239. defaultNightAlpha: number | undefined;
  31240. /**
  31241. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  31242. * 1.0 representing fully opaque.
  31243. */
  31244. defaultDayAlpha: number | undefined;
  31245. /**
  31246. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  31247. * makes the imagery darker while greater than 1.0 makes it brighter.
  31248. */
  31249. defaultBrightness: number | undefined;
  31250. /**
  31251. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  31252. * the contrast while greater than 1.0 increases it.
  31253. */
  31254. defaultContrast: number | undefined;
  31255. /**
  31256. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  31257. */
  31258. defaultHue: number | undefined;
  31259. /**
  31260. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  31261. * saturation while greater than 1.0 increases it.
  31262. */
  31263. defaultSaturation: number | undefined;
  31264. /**
  31265. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  31266. */
  31267. defaultGamma: number | undefined;
  31268. /**
  31269. * The default texture minification filter to apply to this provider.
  31270. */
  31271. defaultMinificationFilter: TextureMinificationFilter;
  31272. /**
  31273. * The default texture magnification filter to apply to this provider.
  31274. */
  31275. defaultMagnificationFilter: TextureMagnificationFilter;
  31276. /**
  31277. * Gets the proxy used by this provider.
  31278. */
  31279. readonly proxy: Proxy;
  31280. /**
  31281. * Gets the width of each tile, in pixels. This function should
  31282. * not be called before {@link GridImageryProvider#ready} returns true.
  31283. */
  31284. readonly tileWidth: number;
  31285. /**
  31286. * Gets the height of each tile, in pixels. This function should
  31287. * not be called before {@link GridImageryProvider#ready} returns true.
  31288. */
  31289. readonly tileHeight: number;
  31290. /**
  31291. * Gets the maximum level-of-detail that can be requested. This function should
  31292. * not be called before {@link GridImageryProvider#ready} returns true.
  31293. */
  31294. readonly maximumLevel: number | undefined;
  31295. /**
  31296. * Gets the minimum level-of-detail that can be requested. This function should
  31297. * not be called before {@link GridImageryProvider#ready} returns true.
  31298. */
  31299. readonly minimumLevel: number;
  31300. /**
  31301. * Gets the tiling scheme used by this provider. This function should
  31302. * not be called before {@link GridImageryProvider#ready} returns true.
  31303. */
  31304. readonly tilingScheme: TilingScheme;
  31305. /**
  31306. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  31307. * not be called before {@link GridImageryProvider#ready} returns true.
  31308. */
  31309. readonly rectangle: Rectangle;
  31310. /**
  31311. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  31312. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  31313. * returns undefined, no tiles are filtered. This function should
  31314. * not be called before {@link GridImageryProvider#ready} returns true.
  31315. */
  31316. readonly tileDiscardPolicy: TileDiscardPolicy;
  31317. /**
  31318. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  31319. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  31320. * are passed an instance of {@link TileProviderError}.
  31321. */
  31322. readonly errorEvent: Event;
  31323. /**
  31324. * Gets a value indicating whether or not the provider is ready for use.
  31325. */
  31326. readonly ready: boolean;
  31327. /**
  31328. * Gets a promise that resolves to true when the provider is ready for use.
  31329. */
  31330. readonly readyPromise: Promise<boolean>;
  31331. /**
  31332. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  31333. * the source of the imagery. This function should not be called before {@link GridImageryProvider#ready} returns true.
  31334. */
  31335. readonly credit: Credit;
  31336. /**
  31337. * Gets a value indicating whether or not the images provided by this imagery provider
  31338. * include an alpha channel. If this property is false, an alpha channel, if present, will
  31339. * be ignored. If this property is true, any images without an alpha channel will be treated
  31340. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  31341. * and texture upload time are reduced.
  31342. */
  31343. readonly hasAlphaChannel: boolean;
  31344. /**
  31345. * Draws a grid of lines into a canvas.
  31346. */
  31347. _drawGrid(): void;
  31348. /**
  31349. * Render a grid into a canvas with background and glow
  31350. */
  31351. _createGridCanvas(): void;
  31352. /**
  31353. * Gets the credits to be displayed when a given tile is displayed.
  31354. * @param x - The tile X coordinate.
  31355. * @param y - The tile Y coordinate.
  31356. * @param level - The tile level;
  31357. * @returns The credits to be displayed when the tile is displayed.
  31358. */
  31359. getTileCredits(x: number, y: number, level: number): Credit[];
  31360. /**
  31361. * Requests the image for a given tile. This function should
  31362. * not be called before {@link GridImageryProvider#ready} returns true.
  31363. * @param x - The tile X coordinate.
  31364. * @param y - The tile Y coordinate.
  31365. * @param level - The tile level.
  31366. * @param [request] - The request object. Intended for internal use only.
  31367. * @returns The resolved image as a Canvas DOM object.
  31368. */
  31369. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLCanvasElement>;
  31370. /**
  31371. * Picking features is not currently supported by this imagery provider, so this function simply returns
  31372. * undefined.
  31373. * @param x - The tile X coordinate.
  31374. * @param y - The tile Y coordinate.
  31375. * @param level - The tile level.
  31376. * @param longitude - The longitude at which to pick features.
  31377. * @param latitude - The latitude at which to pick features.
  31378. * @returns Undefined since picking is not supported.
  31379. */
  31380. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  31381. }
  31382. /**
  31383. * A GroundPolylinePrimitive represents a polyline draped over the terrain or 3D Tiles in the {@link Scene}.
  31384. * <p>
  31385. * Only to be used with GeometryInstances containing {@link GroundPolylineGeometry}.
  31386. * </p>
  31387. * @example
  31388. * // 1. Draw a polyline on terrain with a basic color material
  31389. *
  31390. * const instance = new Cesium.GeometryInstance({
  31391. * geometry : new Cesium.GroundPolylineGeometry({
  31392. * positions : Cesium.Cartesian3.fromDegreesArray([
  31393. * -112.1340164450331, 36.05494287836128,
  31394. * -112.08821010582645, 36.097804071380715
  31395. * ]),
  31396. * width : 4.0
  31397. * }),
  31398. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  31399. * });
  31400. *
  31401. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  31402. * geometryInstances : instance,
  31403. * appearance : new Cesium.PolylineMaterialAppearance()
  31404. * }));
  31405. *
  31406. * // 2. Draw a looped polyline on terrain with per-instance color and a distance display condition.
  31407. * // Distance display conditions for polylines on terrain are based on an approximate terrain height
  31408. * // instead of true terrain height.
  31409. *
  31410. * const instance2 = new Cesium.GeometryInstance({
  31411. * geometry : new Cesium.GroundPolylineGeometry({
  31412. * positions : Cesium.Cartesian3.fromDegreesArray([
  31413. * -112.1340164450331, 36.05494287836128,
  31414. * -112.08821010582645, 36.097804071380715,
  31415. * -112.13296079730024, 36.168769146801104
  31416. * ]),
  31417. * loop : true,
  31418. * width : 4.0
  31419. * }),
  31420. * attributes : {
  31421. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('green').withAlpha(0.7)),
  31422. * distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(1000, 30000)
  31423. * },
  31424. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  31425. * });
  31426. *
  31427. * scene.groundPrimitives.add(new Cesium.GroundPolylinePrimitive({
  31428. * geometryInstances : instance2,
  31429. * appearance : new Cesium.PolylineColorAppearance()
  31430. * }));
  31431. * @param [options] - Object with the following properties:
  31432. * @param [options.geometryInstances] - GeometryInstances containing GroundPolylineGeometry
  31433. * @param [options.appearance] - The Appearance used to render the polyline. Defaults to a white color {@link Material} on a {@link PolylineMaterialAppearance}.
  31434. * @param [options.show = true] - Determines if this primitive will be shown.
  31435. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  31436. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31437. * @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.
  31438. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  31439. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  31440. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  31441. * @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.
  31442. */
  31443. export class GroundPolylinePrimitive {
  31444. constructor(options?: {
  31445. geometryInstances?: any[] | GeometryInstance;
  31446. appearance?: Appearance;
  31447. show?: boolean;
  31448. interleave?: boolean;
  31449. releaseGeometryInstances?: boolean;
  31450. allowPicking?: boolean;
  31451. asynchronous?: boolean;
  31452. classificationType?: ClassificationType;
  31453. debugShowBoundingVolume?: boolean;
  31454. debugShowShadowVolume?: boolean;
  31455. });
  31456. /**
  31457. * The geometry instances rendered with this primitive. This may
  31458. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  31459. * is <code>true</code> when the primitive is constructed.
  31460. * <p>
  31461. * Changing this property after the primitive is rendered has no effect.
  31462. * </p>
  31463. */
  31464. readonly geometryInstances: any[] | GeometryInstance;
  31465. /**
  31466. * The {@link Appearance} used to shade this primitive. Each geometry
  31467. * instance is shaded with the same appearance. Some appearances, like
  31468. * {@link PolylineColorAppearance} allow giving each instance unique
  31469. * properties.
  31470. */
  31471. appearance: Appearance;
  31472. /**
  31473. * Determines if the primitive will be shown. This affects all geometry
  31474. * instances in the primitive.
  31475. */
  31476. show: boolean;
  31477. /**
  31478. * Determines whether terrain, 3D Tiles or both will be classified.
  31479. */
  31480. classificationType: ClassificationType;
  31481. /**
  31482. * This property is for debugging only; it is not for production use nor is it optimized.
  31483. * <p>
  31484. * Draws the bounding sphere for each draw command in the primitive.
  31485. * </p>
  31486. */
  31487. debugShowBoundingVolume: boolean;
  31488. /**
  31489. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  31490. */
  31491. readonly interleave: boolean;
  31492. /**
  31493. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31494. */
  31495. readonly releaseGeometryInstances: boolean;
  31496. /**
  31497. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  31498. */
  31499. readonly allowPicking: boolean;
  31500. /**
  31501. * Determines if the geometry instances will be created and batched on a web worker.
  31502. */
  31503. readonly asynchronous: boolean;
  31504. /**
  31505. * Determines if the primitive is complete and ready to render. If this property is
  31506. * true, the primitive will be rendered the next time that {@link GroundPolylinePrimitive#update}
  31507. * is called.
  31508. */
  31509. readonly ready: boolean;
  31510. /**
  31511. * Gets a promise that resolves when the primitive is ready to render.
  31512. */
  31513. readonly readyPromise: Promise<GroundPolylinePrimitive>;
  31514. /**
  31515. * This property is for debugging only; it is not for production use nor is it optimized.
  31516. * <p>
  31517. * If true, draws the shadow volume for each geometry in the primitive.
  31518. * </p>
  31519. */
  31520. readonly debugShowShadowVolume: boolean;
  31521. /**
  31522. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  31523. * GroundPolylinePrimitive synchronously.
  31524. * @returns A promise that will resolve once the terrain heights have been loaded.
  31525. */
  31526. static initializeTerrainHeights(): Promise<void>;
  31527. /**
  31528. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  31529. * get the draw commands needed to render this primitive.
  31530. * <p>
  31531. * Do not call this function directly. This is documented just to
  31532. * list the exceptions that may be propagated when the scene is rendered:
  31533. * </p>
  31534. */
  31535. update(): void;
  31536. /**
  31537. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  31538. * @example
  31539. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  31540. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  31541. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  31542. * @param id - The id of the {@link GeometryInstance}.
  31543. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  31544. */
  31545. getGeometryInstanceAttributes(id: any): any;
  31546. /**
  31547. * Checks if the given Scene supports GroundPolylinePrimitives.
  31548. * GroundPolylinePrimitives require support for the WEBGL_depth_texture extension.
  31549. * @param scene - The current scene.
  31550. * @returns Whether or not the current scene supports GroundPolylinePrimitives.
  31551. */
  31552. static isSupported(scene: Scene): boolean;
  31553. /**
  31554. * Returns true if this object was destroyed; otherwise, false.
  31555. * <p>
  31556. * If this object was destroyed, it should not be used; calling any function other than
  31557. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31558. * </p>
  31559. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  31560. */
  31561. isDestroyed(): boolean;
  31562. /**
  31563. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31564. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31565. * <p>
  31566. * Once an object is destroyed, it should not be used; calling any function other than
  31567. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31568. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31569. * </p>
  31570. * @example
  31571. * e = e && e.destroy();
  31572. */
  31573. destroy(): void;
  31574. }
  31575. /**
  31576. * A ground primitive represents geometry draped over terrain or 3D Tiles in the {@link Scene}.
  31577. * <p>
  31578. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  31579. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  31580. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  31581. * and match most of them and add a new geometry or appearance independently of each other.
  31582. * </p>
  31583. * <p>
  31584. * Support for the WEBGL_depth_texture extension is required to use GeometryInstances with different PerInstanceColors
  31585. * or materials besides PerInstanceColorAppearance.
  31586. * </p>
  31587. * <p>
  31588. * Textured GroundPrimitives were designed for notional patterns and are not meant for precisely mapping
  31589. * textures to terrain - for that use case, use {@link SingleTileImageryProvider}.
  31590. * </p>
  31591. * <p>
  31592. * For correct rendering, this feature requires the EXT_frag_depth WebGL extension. For hardware that do not support this extension, there
  31593. * will be rendering artifacts for some viewing angles.
  31594. * </p>
  31595. * <p>
  31596. * Valid geometries are {@link CircleGeometry}, {@link CorridorGeometry}, {@link EllipseGeometry}, {@link PolygonGeometry}, and {@link RectangleGeometry}.
  31597. * </p>
  31598. * @example
  31599. * // Example 1: Create primitive with a single instance
  31600. * const rectangleInstance = new Cesium.GeometryInstance({
  31601. * geometry : new Cesium.RectangleGeometry({
  31602. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  31603. * }),
  31604. * id : 'rectangle',
  31605. * attributes : {
  31606. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  31607. * }
  31608. * });
  31609. * scene.primitives.add(new Cesium.GroundPrimitive({
  31610. * geometryInstances : rectangleInstance
  31611. * }));
  31612. *
  31613. * // Example 2: Batch instances
  31614. * const color = new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5); // Both instances must have the same color.
  31615. * const rectangleInstance = new Cesium.GeometryInstance({
  31616. * geometry : new Cesium.RectangleGeometry({
  31617. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
  31618. * }),
  31619. * id : 'rectangle',
  31620. * attributes : {
  31621. * color : color
  31622. * }
  31623. * });
  31624. * const ellipseInstance = new Cesium.GeometryInstance({
  31625. * geometry : new Cesium.EllipseGeometry({
  31626. * center : Cesium.Cartesian3.fromDegrees(-105.0, 40.0),
  31627. * semiMinorAxis : 300000.0,
  31628. * semiMajorAxis : 400000.0
  31629. * }),
  31630. * id : 'ellipse',
  31631. * attributes : {
  31632. * color : color
  31633. * }
  31634. * });
  31635. * scene.primitives.add(new Cesium.GroundPrimitive({
  31636. * geometryInstances : [rectangleInstance, ellipseInstance]
  31637. * }));
  31638. * @param [options] - Object with the following properties:
  31639. * @param [options.geometryInstances] - The geometry instances to render.
  31640. * @param [options.appearance] - The appearance used to render the primitive. Defaults to a flat PerInstanceColorAppearance when GeometryInstances have a color attribute.
  31641. * @param [options.show = true] - Determines if this primitive will be shown.
  31642. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  31643. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  31644. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  31645. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31646. * @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.
  31647. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
  31648. * @param [options.classificationType = ClassificationType.BOTH] - Determines whether terrain, 3D Tiles or both will be classified.
  31649. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  31650. * @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
  31651. * creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
  31652. */
  31653. export class GroundPrimitive {
  31654. constructor(options?: {
  31655. geometryInstances?: any[] | GeometryInstance;
  31656. appearance?: Appearance;
  31657. show?: boolean;
  31658. vertexCacheOptimize?: boolean;
  31659. interleave?: boolean;
  31660. compressVertices?: boolean;
  31661. releaseGeometryInstances?: boolean;
  31662. allowPicking?: boolean;
  31663. asynchronous?: boolean;
  31664. classificationType?: ClassificationType;
  31665. debugShowBoundingVolume?: boolean;
  31666. debugShowShadowVolume?: boolean;
  31667. });
  31668. /**
  31669. * The {@link Appearance} used to shade this primitive. Each geometry
  31670. * instance is shaded with the same appearance. Some appearances, like
  31671. * {@link PerInstanceColorAppearance} allow giving each instance unique
  31672. * properties.
  31673. */
  31674. appearance: Appearance;
  31675. /**
  31676. * The geometry instances rendered with this primitive. This may
  31677. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  31678. * is <code>true</code> when the primitive is constructed.
  31679. * <p>
  31680. * Changing this property after the primitive is rendered has no effect.
  31681. * </p>
  31682. */
  31683. readonly geometryInstances: any[] | GeometryInstance;
  31684. /**
  31685. * Determines if the primitive will be shown. This affects all geometry
  31686. * instances in the primitive.
  31687. */
  31688. show: boolean;
  31689. /**
  31690. * Determines whether terrain, 3D Tiles or both will be classified.
  31691. */
  31692. classificationType: ClassificationType;
  31693. /**
  31694. * This property is for debugging only; it is not for production use nor is it optimized.
  31695. * <p>
  31696. * Draws the bounding sphere for each draw command in the primitive.
  31697. * </p>
  31698. */
  31699. debugShowBoundingVolume: boolean;
  31700. /**
  31701. * This property is for debugging only; it is not for production use nor is it optimized.
  31702. * <p>
  31703. * Draws the shadow volume for each geometry in the primitive.
  31704. * </p>
  31705. */
  31706. debugShowShadowVolume: boolean;
  31707. /**
  31708. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  31709. */
  31710. readonly vertexCacheOptimize: boolean;
  31711. /**
  31712. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  31713. */
  31714. readonly interleave: boolean;
  31715. /**
  31716. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  31717. */
  31718. readonly releaseGeometryInstances: boolean;
  31719. /**
  31720. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  31721. */
  31722. readonly allowPicking: boolean;
  31723. /**
  31724. * Determines if the geometry instances will be created and batched on a web worker.
  31725. */
  31726. readonly asynchronous: boolean;
  31727. /**
  31728. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  31729. */
  31730. readonly compressVertices: boolean;
  31731. /**
  31732. * Determines if the primitive is complete and ready to render. If this property is
  31733. * true, the primitive will be rendered the next time that {@link GroundPrimitive#update}
  31734. * is called.
  31735. */
  31736. readonly ready: boolean;
  31737. /**
  31738. * Gets a promise that resolves when the primitive is ready to render.
  31739. */
  31740. readonly readyPromise: Promise<GroundPrimitive>;
  31741. /**
  31742. * Determines if GroundPrimitive rendering is supported.
  31743. * @param scene - The scene.
  31744. * @returns <code>true</code> if GroundPrimitives are supported; otherwise, returns <code>false</code>
  31745. */
  31746. static isSupported(scene: Scene): boolean;
  31747. /**
  31748. * Initializes the minimum and maximum terrain heights. This only needs to be called if you are creating the
  31749. * GroundPrimitive synchronously.
  31750. * @returns A promise that will resolve once the terrain heights have been loaded.
  31751. */
  31752. static initializeTerrainHeights(): Promise<void>;
  31753. /**
  31754. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  31755. * get the draw commands needed to render this primitive.
  31756. * <p>
  31757. * Do not call this function directly. This is documented just to
  31758. * list the exceptions that may be propagated when the scene is rendered:
  31759. * </p>
  31760. */
  31761. update(): void;
  31762. /**
  31763. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  31764. * @example
  31765. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  31766. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  31767. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  31768. * @param id - The id of the {@link GeometryInstance}.
  31769. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  31770. */
  31771. getGeometryInstanceAttributes(id: any): any;
  31772. /**
  31773. * Returns true if this object was destroyed; otherwise, false.
  31774. * <p>
  31775. * If this object was destroyed, it should not be used; calling any function other than
  31776. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  31777. * </p>
  31778. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  31779. */
  31780. isDestroyed(): boolean;
  31781. /**
  31782. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  31783. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  31784. * <p>
  31785. * Once an object is destroyed, it should not be used; calling any function other than
  31786. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  31787. * assign the return value (<code>undefined</code>) to the object as done in the example.
  31788. * </p>
  31789. * @example
  31790. * e = e && e.destroy();
  31791. */
  31792. destroy(): void;
  31793. /**
  31794. * Checks if the given Scene supports materials on GroundPrimitives.
  31795. * Materials on GroundPrimitives require support for the WEBGL_depth_texture extension.
  31796. * @param scene - The current scene.
  31797. * @returns Whether or not the current scene supports materials on GroundPrimitives.
  31798. */
  31799. static supportsMaterials(scene: Scene): boolean;
  31800. }
  31801. /**
  31802. * Represents the position relative to the terrain.
  31803. */
  31804. export enum HeightReference {
  31805. /**
  31806. * The position is absolute.
  31807. */
  31808. NONE = 0,
  31809. /**
  31810. * The position is clamped to the terrain.
  31811. */
  31812. CLAMP_TO_GROUND = 1,
  31813. /**
  31814. * The position height is the height above the terrain.
  31815. */
  31816. RELATIVE_TO_GROUND = 2
  31817. }
  31818. /**
  31819. * The horizontal location of an origin relative to an object, e.g., a {@link Billboard}
  31820. * or {@link Label}. For example, setting the horizontal origin to <code>LEFT</code>
  31821. * or <code>RIGHT</code> will display a billboard to the left or right (in screen space)
  31822. * of the anchor position.
  31823. * <br /><br />
  31824. * <div align='center'>
  31825. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  31826. * </div>
  31827. */
  31828. export enum HorizontalOrigin {
  31829. /**
  31830. * The origin is at the horizontal center of the object.
  31831. */
  31832. CENTER = 0,
  31833. /**
  31834. * The origin is on the left side of the object.
  31835. */
  31836. LEFT = 1,
  31837. /**
  31838. * The origin is on the right side of the object.
  31839. */
  31840. RIGHT = -1
  31841. }
  31842. /**
  31843. * Properties for managing image-based lighting on tilesets and models.
  31844. * Also manages the necessary resources and textures.
  31845. * <p>
  31846. * If specular environment maps are used, {@link ImageBasedLighting#destroy} must be called
  31847. * when the image-based lighting is no longer needed to clean up GPU resources properly.
  31848. * If a model or tileset creates an instance of ImageBasedLighting, it will handle this.
  31849. * Otherwise, the application is responsible for calling destroy().
  31850. * </p>
  31851. * @param [options.imageBasedLightingFactor = Cartesian2(1.0, 1.0)] - Scales diffuse and specular image-based lighting from the earth, sky, atmosphere and star skybox.
  31852. * @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.
  31853. * @param [options.sphericalHarmonicCoefficients] - The third order spherical harmonic coefficients used for the diffuse color of image-based lighting.
  31854. * @param [options.specularEnvironmentMaps] - A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  31855. */
  31856. export class ImageBasedLighting {
  31857. constructor();
  31858. /**
  31859. * Cesium adds lighting from the earth, sky, atmosphere, and star skybox.
  31860. * This cartesian is used to scale the final diffuse and specular lighting
  31861. * contribution from those sources to the final color. A value of 0.0 will
  31862. * disable those light sources.
  31863. */
  31864. imageBasedLightingFactor: Cartesian2;
  31865. /**
  31866. * The sun's luminance at the zenith in kilo candela per meter squared
  31867. * to use for this model's procedural environment map. This is used when
  31868. * {@link ImageBasedLighting#specularEnvironmentMaps} and {@link ImageBasedLighting#sphericalHarmonicCoefficients}
  31869. * are not defined.
  31870. */
  31871. luminanceAtZenith: number;
  31872. /**
  31873. * The third order spherical harmonic coefficients used for the diffuse color of image-based lighting. When <code>undefined</code>, a diffuse irradiance
  31874. * computed from the atmosphere color is used.
  31875. * <p>
  31876. * There are nine <code>Cartesian3</code> coefficients.
  31877. * The order of the coefficients is: L<sub>0,0</sub>, L<sub>1,-1</sub>, L<sub>1,0</sub>, L<sub>1,1</sub>, L<sub>2,-2</sub>, L<sub>2,-1</sub>, L<sub>2,0</sub>, L<sub>2,1</sub>, L<sub>2,2</sub>
  31878. * </p>
  31879. *
  31880. * These values can be obtained by preprocessing the environment map using the <code>cmgen</code> tool of
  31881. * {@link https://github.com/google/filament/releases|Google's Filament project}. This will also generate a KTX file that can be
  31882. * supplied to {@link Model#specularEnvironmentMaps}.
  31883. */
  31884. sphericalHarmonicCoefficients: Cartesian3[];
  31885. /**
  31886. * A URL to a KTX2 file that contains a cube map of the specular lighting and the convoluted specular mipmaps.
  31887. */
  31888. specularEnvironmentMaps: string;
  31889. }
  31890. /**
  31891. * An imagery layer that displays tiled image data from a single imagery provider
  31892. * on a {@link Globe}.
  31893. * @param imageryProvider - The imagery provider to use.
  31894. * @param [options] - Object with the following properties:
  31895. * @param [options.rectangle = imageryProvider.rectangle] - The rectangle of the layer. This rectangle
  31896. * can limit the visible portion of the imagery provider.
  31897. * @param [options.alpha = 1.0] - The alpha blending value of this layer, from 0.0 to 1.0.
  31898. * This can either be a simple number or a function with the signature
  31899. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31900. * current frame state, this layer, and the x, y, and level coordinates of the
  31901. * imagery tile for which the alpha is required, and it is expected to return
  31902. * the alpha value to use for the tile.
  31903. * @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.
  31904. * This can either be a simple number or a function with the signature
  31905. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31906. * current frame state, this layer, and the x, y, and level coordinates of the
  31907. * imagery tile for which the alpha is required, and it is expected to return
  31908. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  31909. * @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.
  31910. * This can either be a simple number or a function with the signature
  31911. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31912. * current frame state, this layer, and the x, y, and level coordinates of the
  31913. * imagery tile for which the alpha is required, and it is expected to return
  31914. * the alpha value to use for the tile. This only takes effect when <code>enableLighting</code> is <code>true</code>.
  31915. * @param [options.brightness = 1.0] - The brightness of this layer. 1.0 uses the unmodified imagery
  31916. * color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.
  31917. * This can either be a simple number or a function with the signature
  31918. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31919. * current frame state, this layer, and the x, y, and level coordinates of the
  31920. * imagery tile for which the brightness is required, and it is expected to return
  31921. * the brightness value to use for the tile. The function is executed for every
  31922. * frame and for every tile, so it must be fast.
  31923. * @param [options.contrast = 1.0] - The contrast of this layer. 1.0 uses the unmodified imagery color.
  31924. * Less than 1.0 reduces the contrast while greater than 1.0 increases it.
  31925. * This can either be a simple number or a function with the signature
  31926. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31927. * current frame state, this layer, and the x, y, and level coordinates of the
  31928. * imagery tile for which the contrast is required, and it is expected to return
  31929. * the contrast value to use for the tile. The function is executed for every
  31930. * frame and for every tile, so it must be fast.
  31931. * @param [options.hue = 0.0] - The hue of this layer. 0.0 uses the unmodified imagery color.
  31932. * This can either be a simple number or a function with the signature
  31933. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31934. * current frame state, this layer, and the x, y, and level coordinates
  31935. * of the imagery tile for which the hue is required, and it is expected to return
  31936. * the contrast value to use for the tile. The function is executed for every
  31937. * frame and for every tile, so it must be fast.
  31938. * @param [options.saturation = 1.0] - The saturation of this layer. 1.0 uses the unmodified imagery color.
  31939. * Less than 1.0 reduces the saturation while greater than 1.0 increases it.
  31940. * This can either be a simple number or a function with the signature
  31941. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31942. * current frame state, this layer, and the x, y, and level coordinates
  31943. * of the imagery tile for which the saturation is required, and it is expected to return
  31944. * the contrast value to use for the tile. The function is executed for every
  31945. * frame and for every tile, so it must be fast.
  31946. * @param [options.gamma = 1.0] - The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  31947. * This can either be a simple number or a function with the signature
  31948. * <code>function(frameState, layer, x, y, level)</code>. The function is passed the
  31949. * current frame state, this layer, and the x, y, and level coordinates of the
  31950. * imagery tile for which the gamma is required, and it is expected to return
  31951. * the gamma value to use for the tile. The function is executed for every
  31952. * frame and for every tile, so it must be fast.
  31953. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this layer.
  31954. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The
  31955. * texture minification filter to apply to this layer. Possible values
  31956. * are <code>TextureMinificationFilter.LINEAR</code> and
  31957. * <code>TextureMinificationFilter.NEAREST</code>.
  31958. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The
  31959. * texture minification filter to apply to this layer. Possible values
  31960. * are <code>TextureMagnificationFilter.LINEAR</code> and
  31961. * <code>TextureMagnificationFilter.NEAREST</code>.
  31962. * @param [options.show = true] - True if the layer is shown; otherwise, false.
  31963. * @param [options.maximumAnisotropy = maximum supported] - The maximum anisotropy level to use
  31964. * for texture filtering. If this parameter is not specified, the maximum anisotropy supported
  31965. * by the WebGL stack will be used. Larger values make the imagery look better in horizon
  31966. * views.
  31967. * @param [options.minimumTerrainLevel] - The minimum terrain level-of-detail at which to show this imagery layer,
  31968. * or undefined to show it at all levels. Level zero is the least-detailed level.
  31969. * @param [options.maximumTerrainLevel] - The maximum terrain level-of-detail at which to show this imagery layer,
  31970. * or undefined to show it at all levels. Level zero is the least-detailed level.
  31971. * @param [options.cutoutRectangle] - Cartographic rectangle for cutting out a portion of this ImageryLayer.
  31972. * @param [options.colorToAlpha] - Color to be used as alpha.
  31973. * @param [options.colorToAlphaThreshold = 0.004] - Threshold for color-to-alpha.
  31974. */
  31975. export class ImageryLayer {
  31976. constructor(imageryProvider: ImageryProvider, options?: {
  31977. rectangle?: Rectangle;
  31978. alpha?: number | ((...params: any[]) => any);
  31979. nightAlpha?: number | ((...params: any[]) => any);
  31980. dayAlpha?: number | ((...params: any[]) => any);
  31981. brightness?: number | ((...params: any[]) => any);
  31982. contrast?: number | ((...params: any[]) => any);
  31983. hue?: number | ((...params: any[]) => any);
  31984. saturation?: number | ((...params: any[]) => any);
  31985. gamma?: number | ((...params: any[]) => any);
  31986. splitDirection?: SplitDirection | ((...params: any[]) => any);
  31987. minificationFilter?: TextureMinificationFilter;
  31988. magnificationFilter?: TextureMagnificationFilter;
  31989. show?: boolean;
  31990. maximumAnisotropy?: number;
  31991. minimumTerrainLevel?: number;
  31992. maximumTerrainLevel?: number;
  31993. cutoutRectangle?: Rectangle;
  31994. colorToAlpha?: Color;
  31995. colorToAlphaThreshold?: number;
  31996. });
  31997. /**
  31998. * The alpha blending value of this layer, with 0.0 representing fully transparent and
  31999. * 1.0 representing fully opaque.
  32000. */
  32001. alpha: number;
  32002. /**
  32003. * The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and
  32004. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  32005. */
  32006. nightAlpha: number;
  32007. /**
  32008. * The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and
  32009. * 1.0 representing fully opaque. This only takes effect when {@link Globe#enableLighting} is <code>true</code>.
  32010. */
  32011. dayAlpha: number;
  32012. /**
  32013. * The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0
  32014. * makes the imagery darker while greater than 1.0 makes it brighter.
  32015. */
  32016. brightness: number;
  32017. /**
  32018. * The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32019. * the contrast while greater than 1.0 increases it.
  32020. */
  32021. contrast: number;
  32022. /**
  32023. * The hue of this layer in radians. 0.0 uses the unmodified imagery color.
  32024. */
  32025. hue: number;
  32026. /**
  32027. * The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32028. * saturation while greater than 1.0 increases it.
  32029. */
  32030. saturation: number;
  32031. /**
  32032. * The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.
  32033. */
  32034. gamma: number;
  32035. /**
  32036. * The {@link SplitDirection} to apply to this layer.
  32037. */
  32038. splitDirection: SplitDirection;
  32039. /**
  32040. * The {@link TextureMinificationFilter} to apply to this layer.
  32041. * Possible values are {@link TextureMinificationFilter.LINEAR} (the default)
  32042. * and {@link TextureMinificationFilter.NEAREST}.
  32043. *
  32044. * To take effect, this property must be set immediately after adding the imagery layer.
  32045. * Once a texture is loaded it won't be possible to change the texture filter used.
  32046. */
  32047. minificationFilter: TextureMinificationFilter;
  32048. /**
  32049. * The {@link TextureMagnificationFilter} to apply to this layer.
  32050. * Possible values are {@link TextureMagnificationFilter.LINEAR} (the default)
  32051. * and {@link TextureMagnificationFilter.NEAREST}.
  32052. *
  32053. * To take effect, this property must be set immediately after adding the imagery layer.
  32054. * Once a texture is loaded it won't be possible to change the texture filter used.
  32055. */
  32056. magnificationFilter: TextureMagnificationFilter;
  32057. /**
  32058. * Determines if this layer is shown.
  32059. */
  32060. show: boolean;
  32061. /**
  32062. * Rectangle cutout in this layer of imagery.
  32063. */
  32064. cutoutRectangle: Rectangle;
  32065. /**
  32066. * Color value that should be set to transparent.
  32067. */
  32068. colorToAlpha: Color;
  32069. /**
  32070. * Normalized (0-1) threshold for color-to-alpha.
  32071. */
  32072. colorToAlphaThreshold: number;
  32073. /**
  32074. * Gets the imagery provider for this layer.
  32075. */
  32076. readonly imageryProvider: ImageryProvider;
  32077. /**
  32078. * Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the
  32079. * {@link ImageryProvider}, only a portion of the imagery provider is shown.
  32080. */
  32081. readonly rectangle: Rectangle;
  32082. /**
  32083. * This value is used as the default brightness for the imagery layer if one is not provided during construction
  32084. * or by the imagery provider. This value does not modify the brightness of the imagery.
  32085. */
  32086. static DEFAULT_BRIGHTNESS: number;
  32087. /**
  32088. * This value is used as the default contrast for the imagery layer if one is not provided during construction
  32089. * or by the imagery provider. This value does not modify the contrast of the imagery.
  32090. */
  32091. static DEFAULT_CONTRAST: number;
  32092. /**
  32093. * This value is used as the default hue for the imagery layer if one is not provided during construction
  32094. * or by the imagery provider. This value does not modify the hue of the imagery.
  32095. */
  32096. static DEFAULT_HUE: number;
  32097. /**
  32098. * This value is used as the default saturation for the imagery layer if one is not provided during construction
  32099. * or by the imagery provider. This value does not modify the saturation of the imagery.
  32100. */
  32101. static DEFAULT_SATURATION: number;
  32102. /**
  32103. * This value is used as the default gamma for the imagery layer if one is not provided during construction
  32104. * or by the imagery provider. This value does not modify the gamma of the imagery.
  32105. */
  32106. static DEFAULT_GAMMA: number;
  32107. /**
  32108. * This value is used as the default split for the imagery layer if one is not provided during construction
  32109. * or by the imagery provider.
  32110. */
  32111. static DEFAULT_SPLIT: SplitDirection;
  32112. /**
  32113. * This value is used as the default texture minification filter for the imagery layer if one is not provided
  32114. * during construction or by the imagery provider.
  32115. */
  32116. static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter;
  32117. /**
  32118. * This value is used as the default texture magnification filter for the imagery layer if one is not provided
  32119. * during construction or by the imagery provider.
  32120. */
  32121. static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter;
  32122. /**
  32123. * This value is used as the default threshold for color-to-alpha if one is not provided
  32124. * during construction or by the imagery provider.
  32125. */
  32126. static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number;
  32127. /**
  32128. * Gets a value indicating whether this layer is the base layer in the
  32129. * {@link ImageryLayerCollection}. The base layer is the one that underlies all
  32130. * others. It is special in that it is treated as if it has global rectangle, even if
  32131. * it actually does not, by stretching the texels at the edges over the entire
  32132. * globe.
  32133. * @returns true if this is the base layer; otherwise, false.
  32134. */
  32135. isBaseLayer(): boolean;
  32136. /**
  32137. * Returns true if this object was destroyed; otherwise, false.
  32138. * <br /><br />
  32139. * If this object was destroyed, it should not be used; calling any function other than
  32140. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32141. * @returns True if this object was destroyed; otherwise, false.
  32142. */
  32143. isDestroyed(): boolean;
  32144. /**
  32145. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  32146. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  32147. * <br /><br />
  32148. * Once an object is destroyed, it should not be used; calling any function other than
  32149. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  32150. * assign the return value (<code>undefined</code>) to the object as done in the example.
  32151. * @example
  32152. * imageryLayer = imageryLayer && imageryLayer.destroy();
  32153. */
  32154. destroy(): void;
  32155. /**
  32156. * Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
  32157. * producing the overall bounds of imagery that can be produced by this layer.
  32158. * @example
  32159. * // Zoom to an imagery layer.
  32160. * imageryLayer.getViewableRectangle().then(function (rectangle) {
  32161. * return camera.flyTo({
  32162. * destination: rectangle
  32163. * });
  32164. * });
  32165. * @returns A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.
  32166. */
  32167. getViewableRectangle(): Promise<Rectangle>;
  32168. }
  32169. /**
  32170. * An ordered collection of imagery layers.
  32171. */
  32172. export class ImageryLayerCollection {
  32173. constructor();
  32174. /**
  32175. * An event that is raised when a layer is added to the collection. Event handlers are passed the layer that
  32176. * was added and the index at which it was added.
  32177. */
  32178. layerAdded: Event;
  32179. /**
  32180. * An event that is raised when a layer is removed from the collection. Event handlers are passed the layer that
  32181. * was removed and the index from which it was removed.
  32182. */
  32183. layerRemoved: Event;
  32184. /**
  32185. * An event that is raised when a layer changes position in the collection. Event handlers are passed the layer that
  32186. * was moved, its new index after the move, and its old index prior to the move.
  32187. */
  32188. layerMoved: Event;
  32189. /**
  32190. * An event that is raised when a layer is shown or hidden by setting the
  32191. * {@link ImageryLayer#show} property. Event handlers are passed a reference to this layer,
  32192. * the index of the layer in the collection, and a flag that is true if the layer is now
  32193. * shown or false if it is now hidden.
  32194. */
  32195. layerShownOrHidden: Event;
  32196. /**
  32197. * Gets the number of layers in this collection.
  32198. */
  32199. length: number;
  32200. /**
  32201. * Adds a layer to the collection.
  32202. * @param layer - the layer to add.
  32203. * @param [index] - the index to add the layer at. If omitted, the layer will
  32204. * be added on top of all existing layers.
  32205. */
  32206. add(layer: ImageryLayer, index?: number): void;
  32207. /**
  32208. * Creates a new layer using the given ImageryProvider and adds it to the collection.
  32209. * @param imageryProvider - the imagery provider to create a new layer for.
  32210. * @param [index] - the index to add the layer at. If omitted, the layer will
  32211. * added on top of all existing layers.
  32212. * @returns The newly created layer.
  32213. */
  32214. addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer;
  32215. /**
  32216. * Removes a layer from this collection, if present.
  32217. * @param layer - The layer to remove.
  32218. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  32219. * @returns true if the layer was in the collection and was removed,
  32220. * false if the layer was not in the collection.
  32221. */
  32222. remove(layer: ImageryLayer, destroy?: boolean): boolean;
  32223. /**
  32224. * Removes all layers from this collection.
  32225. * @param [destroy = true] - whether to destroy the layers in addition to removing them.
  32226. */
  32227. removeAll(destroy?: boolean): void;
  32228. /**
  32229. * Checks to see if the collection contains a given layer.
  32230. * @param layer - the layer to check for.
  32231. * @returns true if the collection contains the layer, false otherwise.
  32232. */
  32233. contains(layer: ImageryLayer): boolean;
  32234. /**
  32235. * Determines the index of a given layer in the collection.
  32236. * @param layer - The layer to find the index of.
  32237. * @returns The index of the layer in the collection, or -1 if the layer does not exist in the collection.
  32238. */
  32239. indexOf(layer: ImageryLayer): number;
  32240. /**
  32241. * Gets a layer by index from the collection.
  32242. * @param index - the index to retrieve.
  32243. * @returns The imagery layer at the given index.
  32244. */
  32245. get(index: number): ImageryLayer;
  32246. /**
  32247. * Raises a layer up one position in the collection.
  32248. * @param layer - the layer to move.
  32249. */
  32250. raise(layer: ImageryLayer): void;
  32251. /**
  32252. * Lowers a layer down one position in the collection.
  32253. * @param layer - the layer to move.
  32254. */
  32255. lower(layer: ImageryLayer): void;
  32256. /**
  32257. * Raises a layer to the top of the collection.
  32258. * @param layer - the layer to move.
  32259. */
  32260. raiseToTop(layer: ImageryLayer): void;
  32261. /**
  32262. * Lowers a layer to the bottom of the collection.
  32263. * @param layer - the layer to move.
  32264. */
  32265. lowerToBottom(layer: ImageryLayer): void;
  32266. /**
  32267. * Determines the imagery layers that are intersected by a pick ray. To compute a pick ray from a
  32268. * location on the screen, use {@link Camera.getPickRay}.
  32269. * @param ray - The ray to test for intersection.
  32270. * @param scene - The scene.
  32271. * @returns An array that includes all of
  32272. * the layers that are intersected by a given pick ray. Undefined if
  32273. * no layers are selected.
  32274. */
  32275. pickImageryLayers(ray: Ray, scene: Scene): ImageryLayer[] | undefined;
  32276. /**
  32277. * Asynchronously determines the imagery layer features that are intersected by a pick ray. The intersected imagery
  32278. * layer features are found by invoking {@link ImageryProvider#pickFeatures} for each imagery layer tile intersected
  32279. * by the pick ray. To compute a pick ray from a location on the screen, use {@link Camera.getPickRay}.
  32280. * @example
  32281. * const pickRay = viewer.camera.getPickRay(windowPosition);
  32282. * const featuresPromise = viewer.imageryLayers.pickImageryLayerFeatures(pickRay, viewer.scene);
  32283. * if (!Cesium.defined(featuresPromise)) {
  32284. * console.log('No features picked.');
  32285. * } else {
  32286. * Promise.resolve(featuresPromise).then(function(features) {
  32287. * // This function is called asynchronously when the list if picked features is available.
  32288. * console.log('Number of features: ' + features.length);
  32289. * if (features.length > 0) {
  32290. * console.log('First feature name: ' + features[0].name);
  32291. * }
  32292. * });
  32293. * }
  32294. * @param ray - The ray to test for intersection.
  32295. * @param scene - The scene.
  32296. * @returns A promise that resolves to an array of features intersected by the pick ray.
  32297. * If it can be quickly determined that no features are intersected (for example,
  32298. * because no active imagery providers support {@link ImageryProvider#pickFeatures}
  32299. * or because the pick ray does not intersect the surface), this function will
  32300. * return undefined.
  32301. */
  32302. pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32303. /**
  32304. * Returns true if this object was destroyed; otherwise, false.
  32305. * <br /><br />
  32306. * If this object was destroyed, it should not be used; calling any function other than
  32307. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32308. * @returns true if this object was destroyed; otherwise, false.
  32309. */
  32310. isDestroyed(): boolean;
  32311. /**
  32312. * Destroys the WebGL resources held by all layers in this collection. Explicitly destroying this
  32313. * object allows for deterministic release of WebGL resources, instead of relying on the garbage
  32314. * collector.
  32315. * <br /><br />
  32316. * Once this object is destroyed, it should not be used; calling any function other than
  32317. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  32318. * assign the return value (<code>undefined</code>) to the object as done in the example.
  32319. * @example
  32320. * layerCollection = layerCollection && layerCollection.destroy();
  32321. */
  32322. destroy(): void;
  32323. }
  32324. /**
  32325. * Describes a rasterized feature, such as a point, polygon, polyline, etc., in an imagery layer.
  32326. */
  32327. export class ImageryLayerFeatureInfo {
  32328. constructor();
  32329. /**
  32330. * Gets or sets the name of the feature.
  32331. */
  32332. name: string | undefined;
  32333. /**
  32334. * Gets or sets an HTML description of the feature. The HTML is not trusted and should
  32335. * be sanitized before display to the user.
  32336. */
  32337. description: string | undefined;
  32338. /**
  32339. * Gets or sets the position of the feature, or undefined if the position is not known.
  32340. */
  32341. position: Cartographic | undefined;
  32342. /**
  32343. * Gets or sets the raw data describing the feature. The raw data may be in any
  32344. * number of formats, such as GeoJSON, KML, etc.
  32345. */
  32346. data: any | undefined;
  32347. /**
  32348. * Gets or sets the image layer of the feature.
  32349. */
  32350. imageryLayer: any | undefined;
  32351. /**
  32352. * Configures the name of this feature by selecting an appropriate property. The name will be obtained from
  32353. * one of the following sources, in this order: 1) the property with the name 'name', 2) the property with the name 'title',
  32354. * 3) the first property containing the word 'name', 4) the first property containing the word 'title'. If
  32355. * the name cannot be obtained from any of these sources, the existing name will be left unchanged.
  32356. * @param properties - An object literal containing the properties of the feature.
  32357. */
  32358. configureNameFromProperties(properties: any): void;
  32359. /**
  32360. * Configures the description of this feature by creating an HTML table of properties and their values.
  32361. * @param properties - An object literal containing the properties of the feature.
  32362. */
  32363. configureDescriptionFromProperties(properties: any): void;
  32364. }
  32365. /**
  32366. * The format in which {@link ImageryProvider} methods return an image may
  32367. * vary by provider, configuration, or server settings. Most common are
  32368. * <code>HTMLImageElement</code>, <code>HTMLCanvasElement</code>, or on supported
  32369. * browsers, <code>ImageBitmap</code>.
  32370. *
  32371. * See the documentation for each ImageryProvider class for more information about how they return images.
  32372. */
  32373. export type ImageryTypes = HTMLImageElement | HTMLCanvasElement | ImageBitmap;
  32374. /**
  32375. * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an
  32376. * interface and is not intended to be instantiated directly.
  32377. */
  32378. export class ImageryProvider {
  32379. constructor();
  32380. /**
  32381. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32382. * 1.0 representing fully opaque.
  32383. */
  32384. defaultAlpha: number | undefined;
  32385. /**
  32386. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32387. * 1.0 representing fully opaque.
  32388. */
  32389. defaultNightAlpha: number | undefined;
  32390. /**
  32391. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32392. * 1.0 representing fully opaque.
  32393. */
  32394. defaultDayAlpha: number | undefined;
  32395. /**
  32396. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32397. * makes the imagery darker while greater than 1.0 makes it brighter.
  32398. */
  32399. defaultBrightness: number | undefined;
  32400. /**
  32401. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32402. * the contrast while greater than 1.0 increases it.
  32403. */
  32404. defaultContrast: number | undefined;
  32405. /**
  32406. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32407. */
  32408. defaultHue: number | undefined;
  32409. /**
  32410. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32411. * saturation while greater than 1.0 increases it.
  32412. */
  32413. defaultSaturation: number | undefined;
  32414. /**
  32415. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32416. */
  32417. defaultGamma: number | undefined;
  32418. /**
  32419. * The default texture minification filter to apply to this provider.
  32420. */
  32421. defaultMinificationFilter: TextureMinificationFilter;
  32422. /**
  32423. * The default texture magnification filter to apply to this provider.
  32424. */
  32425. defaultMagnificationFilter: TextureMagnificationFilter;
  32426. /**
  32427. * Gets a value indicating whether or not the provider is ready for use.
  32428. */
  32429. readonly ready: boolean;
  32430. /**
  32431. * Gets a promise that resolves to true when the provider is ready for use.
  32432. */
  32433. readonly readyPromise: Promise<boolean>;
  32434. /**
  32435. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32436. * not be called before {@link ImageryProvider#ready} returns true.
  32437. */
  32438. readonly rectangle: Rectangle;
  32439. /**
  32440. * Gets the width of each tile, in pixels. This function should
  32441. * not be called before {@link ImageryProvider#ready} returns true.
  32442. */
  32443. readonly tileWidth: number;
  32444. /**
  32445. * Gets the height of each tile, in pixels. This function should
  32446. * not be called before {@link ImageryProvider#ready} returns true.
  32447. */
  32448. readonly tileHeight: number;
  32449. /**
  32450. * Gets the maximum level-of-detail that can be requested. This function should
  32451. * not be called before {@link ImageryProvider#ready} returns true.
  32452. */
  32453. readonly maximumLevel: number | undefined;
  32454. /**
  32455. * Gets the minimum level-of-detail that can be requested. This function should
  32456. * not be called before {@link ImageryProvider#ready} returns true. Generally,
  32457. * a minimum level should only be used when the rectangle of the imagery is small
  32458. * enough that the number of tiles at the minimum level is small. An imagery
  32459. * provider with more than a few tiles at the minimum level will lead to
  32460. * rendering problems.
  32461. */
  32462. readonly minimumLevel: number;
  32463. /**
  32464. * Gets the tiling scheme used by the provider. This function should
  32465. * not be called before {@link ImageryProvider#ready} returns true.
  32466. */
  32467. readonly tilingScheme: TilingScheme;
  32468. /**
  32469. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32470. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32471. * returns undefined, no tiles are filtered. This function should
  32472. * not be called before {@link ImageryProvider#ready} returns true.
  32473. */
  32474. readonly tileDiscardPolicy: TileDiscardPolicy;
  32475. /**
  32476. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  32477. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32478. * are passed an instance of {@link TileProviderError}.
  32479. */
  32480. readonly errorEvent: Event;
  32481. /**
  32482. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32483. * the source of the imagery. This function should
  32484. * not be called before {@link ImageryProvider#ready} returns true.
  32485. */
  32486. readonly credit: Credit;
  32487. /**
  32488. * Gets the proxy used by this provider.
  32489. */
  32490. readonly proxy: Proxy;
  32491. /**
  32492. * Gets a value indicating whether or not the images provided by this imagery provider
  32493. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32494. * be ignored. If this property is true, any images without an alpha channel will be treated
  32495. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32496. * and texture upload time are reduced.
  32497. */
  32498. readonly hasAlphaChannel: boolean;
  32499. /**
  32500. * Gets the credits to be displayed when a given tile is displayed.
  32501. * @param x - The tile X coordinate.
  32502. * @param y - The tile Y coordinate.
  32503. * @param level - The tile level;
  32504. * @returns The credits to be displayed when the tile is displayed.
  32505. */
  32506. getTileCredits(x: number, y: number, level: number): Credit[];
  32507. /**
  32508. * Requests the image for a given tile. This function should
  32509. * not be called before {@link ImageryProvider#ready} returns true.
  32510. * @param x - The tile X coordinate.
  32511. * @param y - The tile Y coordinate.
  32512. * @param level - The tile level.
  32513. * @param [request] - The request object. Intended for internal use only.
  32514. * @returns Returns a promise for the image that will resolve when the image is available, or
  32515. * undefined if there are too many active requests to the server, and the request should be retried later.
  32516. */
  32517. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  32518. /**
  32519. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32520. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  32521. * This function is optional, so it may not exist on all ImageryProviders.
  32522. * @param x - The tile X coordinate.
  32523. * @param y - The tile Y coordinate.
  32524. * @param level - The tile level.
  32525. * @param longitude - The longitude at which to pick features.
  32526. * @param latitude - The latitude at which to pick features.
  32527. * @returns A promise for the picked features that will resolve when the asynchronous
  32528. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32529. * instances. The array may be empty if no features are found at the given location.
  32530. * It may also be undefined if picking is not supported.
  32531. */
  32532. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32533. /**
  32534. * Loads an image from a given URL. If the server referenced by the URL already has
  32535. * too many requests pending, this function will instead return undefined, indicating
  32536. * that the request should be retried later.
  32537. * @param imageryProvider - The imagery provider for the URL.
  32538. * @param url - The URL of the image.
  32539. * @returns A promise for the image that will resolve when the image is available, or
  32540. * undefined if there are too many active requests to the server, and the request should be retried later.
  32541. */
  32542. static loadImage(imageryProvider: ImageryProvider, url: Resource | string): Promise<ImageryTypes | CompressedTextureBuffer> | undefined;
  32543. }
  32544. export namespace IonImageryProvider {
  32545. /**
  32546. * Initialization options for the TileMapServiceImageryProvider constructor
  32547. * @property assetId - An ion imagery asset ID
  32548. * @property [accessToken = Ion.defaultAccessToken] - The access token to use.
  32549. * @property [server = Ion.defaultServer] - The resource to the Cesium ion API server.
  32550. */
  32551. type ConstructorOptions = {
  32552. assetId: number;
  32553. accessToken?: string;
  32554. server?: string | Resource;
  32555. };
  32556. }
  32557. /**
  32558. * Provides tiled imagery using the Cesium ion REST API.
  32559. * @example
  32560. * viewer.imageryLayers.addImageryProvider(new Cesium.IonImageryProvider({ assetId : 23489024 }));
  32561. * @param options - Object describing initialization options
  32562. */
  32563. export class IonImageryProvider {
  32564. constructor(options: IonImageryProvider.ConstructorOptions);
  32565. /**
  32566. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  32567. * 1.0 representing fully opaque.
  32568. */
  32569. defaultAlpha: number | undefined;
  32570. /**
  32571. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  32572. * 1.0 representing fully opaque.
  32573. */
  32574. defaultNightAlpha: number | undefined;
  32575. /**
  32576. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  32577. * 1.0 representing fully opaque.
  32578. */
  32579. defaultDayAlpha: number | undefined;
  32580. /**
  32581. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  32582. * makes the imagery darker while greater than 1.0 makes it brighter.
  32583. */
  32584. defaultBrightness: number | undefined;
  32585. /**
  32586. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  32587. * the contrast while greater than 1.0 increases it.
  32588. */
  32589. defaultContrast: number | undefined;
  32590. /**
  32591. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  32592. */
  32593. defaultHue: number | undefined;
  32594. /**
  32595. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  32596. * saturation while greater than 1.0 increases it.
  32597. */
  32598. defaultSaturation: number | undefined;
  32599. /**
  32600. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  32601. */
  32602. defaultGamma: number | undefined;
  32603. /**
  32604. * The default texture minification filter to apply to this provider.
  32605. */
  32606. defaultMinificationFilter: TextureMinificationFilter;
  32607. /**
  32608. * The default texture magnification filter to apply to this provider.
  32609. */
  32610. defaultMagnificationFilter: TextureMagnificationFilter;
  32611. /**
  32612. * Gets a value indicating whether or not the provider is ready for use.
  32613. */
  32614. readonly ready: boolean;
  32615. /**
  32616. * Gets a promise that resolves to true when the provider is ready for use.
  32617. */
  32618. readonly readyPromise: Promise<boolean>;
  32619. /**
  32620. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  32621. * not be called before {@link IonImageryProvider#ready} returns true.
  32622. */
  32623. readonly rectangle: Rectangle;
  32624. /**
  32625. * Gets the width of each tile, in pixels. This function should
  32626. * not be called before {@link IonImageryProvider#ready} returns true.
  32627. */
  32628. readonly tileWidth: number;
  32629. /**
  32630. * Gets the height of each tile, in pixels. This function should
  32631. * not be called before {@link IonImageryProvider#ready} returns true.
  32632. */
  32633. readonly tileHeight: number;
  32634. /**
  32635. * Gets the maximum level-of-detail that can be requested. This function should
  32636. * not be called before {@link IonImageryProvider#ready} returns true.
  32637. */
  32638. readonly maximumLevel: number | undefined;
  32639. /**
  32640. * Gets the minimum level-of-detail that can be requested. This function should
  32641. * not be called before {@link IonImageryProvider#ready} returns true. Generally,
  32642. * a minimum level should only be used when the rectangle of the imagery is small
  32643. * enough that the number of tiles at the minimum level is small. An imagery
  32644. * provider with more than a few tiles at the minimum level will lead to
  32645. * rendering problems.
  32646. */
  32647. readonly minimumLevel: number;
  32648. /**
  32649. * Gets the tiling scheme used by the provider. This function should
  32650. * not be called before {@link IonImageryProvider#ready} returns true.
  32651. */
  32652. readonly tilingScheme: TilingScheme;
  32653. /**
  32654. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  32655. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  32656. * returns undefined, no tiles are filtered. This function should
  32657. * not be called before {@link IonImageryProvider#ready} returns true.
  32658. */
  32659. readonly tileDiscardPolicy: TileDiscardPolicy;
  32660. /**
  32661. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  32662. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  32663. * are passed an instance of {@link TileProviderError}.
  32664. */
  32665. readonly errorEvent: Event;
  32666. /**
  32667. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  32668. * the source of the imagery. This function should
  32669. * not be called before {@link IonImageryProvider#ready} returns true.
  32670. */
  32671. readonly credit: Credit;
  32672. /**
  32673. * Gets a value indicating whether or not the images provided by this imagery provider
  32674. * include an alpha channel. If this property is false, an alpha channel, if present, will
  32675. * be ignored. If this property is true, any images without an alpha channel will be treated
  32676. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  32677. * and texture upload time are reduced.
  32678. */
  32679. readonly hasAlphaChannel: boolean;
  32680. /**
  32681. * Gets the proxy used by this provider.
  32682. */
  32683. readonly proxy: Proxy;
  32684. /**
  32685. * Gets the credits to be displayed when a given tile is displayed.
  32686. * @param x - The tile X coordinate.
  32687. * @param y - The tile Y coordinate.
  32688. * @param level - The tile level;
  32689. * @returns The credits to be displayed when the tile is displayed.
  32690. */
  32691. getTileCredits(x: number, y: number, level: number): Credit[];
  32692. /**
  32693. * Requests the image for a given tile. This function should
  32694. * not be called before {@link IonImageryProvider#ready} returns true.
  32695. * @param x - The tile X coordinate.
  32696. * @param y - The tile Y coordinate.
  32697. * @param level - The tile level.
  32698. * @param [request] - The request object. Intended for internal use only.
  32699. * @returns A promise for the image that will resolve when the image is available, or
  32700. * undefined if there are too many active requests to the server, and the request should be retried later.
  32701. */
  32702. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  32703. /**
  32704. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  32705. * a tile. This function should not be called before {@link IonImageryProvider#ready} returns true.
  32706. * This function is optional, so it may not exist on all ImageryProviders.
  32707. * @param x - The tile X coordinate.
  32708. * @param y - The tile Y coordinate.
  32709. * @param level - The tile level.
  32710. * @param longitude - The longitude at which to pick features.
  32711. * @param latitude - The latitude at which to pick features.
  32712. * @returns A promise for the picked features that will resolve when the asynchronous
  32713. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  32714. * instances. The array may be empty if no features are found at the given location.
  32715. * It may also be undefined if picking is not supported.
  32716. */
  32717. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  32718. }
  32719. /**
  32720. * The types of imagery provided by {@link createWorldImagery}.
  32721. */
  32722. export enum IonWorldImageryStyle {
  32723. /**
  32724. * Aerial imagery.
  32725. */
  32726. AERIAL = 2,
  32727. /**
  32728. * Aerial imagery with a road overlay.
  32729. */
  32730. AERIAL_WITH_LABELS = 3,
  32731. /**
  32732. * Roads without additional imagery.
  32733. */
  32734. ROAD = 4
  32735. }
  32736. /**
  32737. * A Label draws viewport-aligned text positioned in the 3D scene. This constructor
  32738. * should not be used directly, instead create labels by calling {@link LabelCollection#add}.
  32739. */
  32740. export class Label {
  32741. constructor();
  32742. /**
  32743. * Determines if this label will be shown. Use this to hide or show a label, instead
  32744. * of removing it and re-adding it to the collection.
  32745. */
  32746. show: boolean;
  32747. /**
  32748. * Gets or sets the Cartesian position of this label.
  32749. */
  32750. position: Cartesian3;
  32751. /**
  32752. * Gets or sets the height reference of this billboard.
  32753. */
  32754. heightReference: HeightReference;
  32755. /**
  32756. * Gets or sets the text of this label.
  32757. */
  32758. text: string;
  32759. /**
  32760. * Gets or sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
  32761. */
  32762. font: string;
  32763. /**
  32764. * Gets or sets the fill color of this label.
  32765. */
  32766. fillColor: Color;
  32767. /**
  32768. * Gets or sets the outline color of this label.
  32769. */
  32770. outlineColor: Color;
  32771. /**
  32772. * Gets or sets the outline width of this label.
  32773. */
  32774. outlineWidth: number;
  32775. /**
  32776. * Determines if a background behind this label will be shown.
  32777. */
  32778. showBackground: boolean;
  32779. /**
  32780. * Gets or sets the background color of this label.
  32781. */
  32782. backgroundColor: Color;
  32783. /**
  32784. * Gets or sets the background padding, in pixels, of this label. The <code>x</code> value
  32785. * controls horizontal padding, and the <code>y</code> value controls vertical padding.
  32786. */
  32787. backgroundPadding: Cartesian2;
  32788. /**
  32789. * Gets or sets the style of this label.
  32790. */
  32791. style: LabelStyle;
  32792. /**
  32793. * Gets or sets the pixel offset in screen space from the origin of this label. This is commonly used
  32794. * to align multiple labels and billboards at the same position, e.g., an image and text. The
  32795. * screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  32796. * left to right, and <code>y</code> increases from top to bottom.
  32797. * <br /><br />
  32798. * <div align='center'>
  32799. * <table border='0' cellpadding='5'><tr>
  32800. * <td align='center'><code>default</code><br/><img src='Images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
  32801. * <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>
  32802. * </tr></table>
  32803. * The label's origin is indicated by the yellow point.
  32804. * </div>
  32805. */
  32806. pixelOffset: Cartesian2;
  32807. /**
  32808. * Gets or sets near and far translucency properties of a Label based on the Label's distance from the camera.
  32809. * A label's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  32810. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32811. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32812. * Outside of these ranges the label's translucency remains clamped to the nearest bound. If undefined,
  32813. * translucencyByDistance will be disabled.
  32814. * @example
  32815. * // Example 1.
  32816. * // Set a label's translucencyByDistance to 1.0 when the
  32817. * // camera is 1500 meters from the label and disappear as
  32818. * // the camera distance approaches 8.0e6 meters.
  32819. * text.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  32820. * @example
  32821. * // Example 2.
  32822. * // disable translucency by distance
  32823. * text.translucencyByDistance = undefined;
  32824. */
  32825. translucencyByDistance: NearFarScalar;
  32826. /**
  32827. * Gets or sets near and far pixel offset scaling properties of a Label based on the Label's distance from the camera.
  32828. * A label's pixel offset will be scaled between the {@link NearFarScalar#nearValue} and
  32829. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32830. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32831. * Outside of these ranges the label's pixel offset scaling remains clamped to the nearest bound. If undefined,
  32832. * pixelOffsetScaleByDistance will be disabled.
  32833. * @example
  32834. * // Example 1.
  32835. * // Set a label's pixel offset scale to 0.0 when the
  32836. * // camera is 1500 meters from the label and scale pixel offset to 10.0 pixels
  32837. * // in the y direction the camera distance approaches 8.0e6 meters.
  32838. * text.pixelOffset = new Cesium.Cartesian2(0.0, 1.0);
  32839. * text.pixelOffsetScaleByDistance = new Cesium.NearFarScalar(1.5e2, 0.0, 8.0e6, 10.0);
  32840. * @example
  32841. * // Example 2.
  32842. * // disable pixel offset by distance
  32843. * text.pixelOffsetScaleByDistance = undefined;
  32844. */
  32845. pixelOffsetScaleByDistance: NearFarScalar;
  32846. /**
  32847. * Gets or sets near and far scaling properties of a Label based on the label's distance from the camera.
  32848. * A label's scale will interpolate between the {@link NearFarScalar#nearValue} and
  32849. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  32850. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  32851. * Outside of these ranges the label's scale remains clamped to the nearest bound. If undefined,
  32852. * scaleByDistance will be disabled.
  32853. * @example
  32854. * // Example 1.
  32855. * // Set a label's scaleByDistance to scale by 1.5 when the
  32856. * // camera is 1500 meters from the label and disappear as
  32857. * // the camera distance approaches 8.0e6 meters.
  32858. * label.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 1.5, 8.0e6, 0.0);
  32859. * @example
  32860. * // Example 2.
  32861. * // disable scaling by distance
  32862. * label.scaleByDistance = undefined;
  32863. */
  32864. scaleByDistance: NearFarScalar;
  32865. /**
  32866. * Gets and sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed
  32867. * coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
  32868. * <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
  32869. * which is typically meters.
  32870. * <br /><br />
  32871. * An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to
  32872. * arrange a label above its corresponding 3D model.
  32873. * <br /><br />
  32874. * Below, the label is positioned at the center of the Earth but an eye offset makes it always
  32875. * appear on top of the Earth regardless of the viewer's or Earth's orientation.
  32876. * <br /><br />
  32877. * <div align='center'>
  32878. * <table border='0' cellpadding='5'><tr>
  32879. * <td align='center'><img src='Images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
  32880. * <td align='center'><img src='Images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
  32881. * </tr></table>
  32882. * <code>l.eyeOffset = new Cartesian3(0.0, 8000000.0, 0.0);</code><br /><br />
  32883. * </div>
  32884. */
  32885. eyeOffset: Cartesian3;
  32886. /**
  32887. * Gets or sets the horizontal origin of this label, which determines if the label is drawn
  32888. * to the left, center, or right of its anchor position.
  32889. * <br /><br />
  32890. * <div align='center'>
  32891. * <img src='Images/Billboard.setHorizontalOrigin.png' width='648' height='196' /><br />
  32892. * </div>
  32893. * @example
  32894. * // Use a top, right origin
  32895. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  32896. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  32897. */
  32898. horizontalOrigin: HorizontalOrigin;
  32899. /**
  32900. * Gets or sets the vertical origin of this label, which determines if the label is
  32901. * to the above, below, or at the center of its anchor position.
  32902. * <br /><br />
  32903. * <div align='center'>
  32904. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  32905. * </div>
  32906. * @example
  32907. * // Use a top, right origin
  32908. * l.horizontalOrigin = Cesium.HorizontalOrigin.RIGHT;
  32909. * l.verticalOrigin = Cesium.VerticalOrigin.TOP;
  32910. */
  32911. verticalOrigin: VerticalOrigin;
  32912. /**
  32913. * Gets or sets the uniform scale that is multiplied with the label's size in pixels.
  32914. * A scale of <code>1.0</code> does not change the size of the label; a scale greater than
  32915. * <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks
  32916. * the label.
  32917. * <br /><br />
  32918. * Applying a large scale value may pixelate the label. To make text larger without pixelation,
  32919. * use a larger font size when calling {@link Label#font} instead.
  32920. * <br /><br />
  32921. * <div align='center'>
  32922. * <img src='Images/Label.setScale.png' width='400' height='300' /><br/>
  32923. * From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
  32924. * and <code>2.0</code>.
  32925. * </div>
  32926. */
  32927. scale: number;
  32928. /**
  32929. * Gets the total scale of the label, which is the label's scale multiplied by the computed relative size
  32930. * of the desired font compared to the generated glyph size.
  32931. */
  32932. totalScale: number;
  32933. /**
  32934. * Gets or sets the condition specifying at what distance from the camera that this label will be displayed.
  32935. */
  32936. distanceDisplayCondition: DistanceDisplayCondition;
  32937. /**
  32938. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  32939. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  32940. */
  32941. disableDepthTestDistance: number;
  32942. /**
  32943. * Gets or sets the user-defined value returned when the label is picked.
  32944. */
  32945. id: any;
  32946. /**
  32947. * Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
  32948. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  32949. * left to right, and <code>y</code> increases from top to bottom.
  32950. * @example
  32951. * console.log(l.computeScreenSpacePosition(scene).toString());
  32952. * @param scene - The scene the label is in.
  32953. * @param [result] - The object onto which to store the result.
  32954. * @returns The screen-space position of the label.
  32955. */
  32956. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  32957. /**
  32958. * Determines if this label equals another label. Labels are equal if all their properties
  32959. * are equal. Labels in different collections can be equal.
  32960. * @param other - The label to compare for equality.
  32961. * @returns <code>true</code> if the labels are equal; otherwise, <code>false</code>.
  32962. */
  32963. equals(other: Label): boolean;
  32964. /**
  32965. * Returns true if this object was destroyed; otherwise, false.
  32966. * <br /><br />
  32967. * If this object was destroyed, it should not be used; calling any function other than
  32968. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  32969. * @returns True if this object was destroyed; otherwise, false.
  32970. */
  32971. isDestroyed(): boolean;
  32972. /**
  32973. * Determines whether or not run the algorithm, that match the text of the label to right-to-left languages
  32974. * @example
  32975. * // Example 1.
  32976. * // Set a label's rightToLeft before init
  32977. * Cesium.Label.enableRightToLeftDetection = true;
  32978. * const myLabelEntity = viewer.entities.add({
  32979. * label: {
  32980. * id: 'my label',
  32981. * text: 'זה טקסט בעברית \n ועכשיו יורדים שורה',
  32982. * }
  32983. * });
  32984. * @example
  32985. * // Example 2.
  32986. * const myLabelEntity = viewer.entities.add({
  32987. * label: {
  32988. * id: 'my label',
  32989. * text: 'English text'
  32990. * }
  32991. * });
  32992. * // Set a label's rightToLeft after init
  32993. * Cesium.Label.enableRightToLeftDetection = true;
  32994. * myLabelEntity.text = 'טקסט חדש';
  32995. */
  32996. static enableRightToLeftDetection: boolean;
  32997. }
  32998. /**
  32999. * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene.
  33000. * Each label can have a different font, color, scale, etc.
  33001. * <br /><br />
  33002. * <div align='center'>
  33003. * <img src='Images/Label.png' width='400' height='300' /><br />
  33004. * Example labels
  33005. * </div>
  33006. * <br /><br />
  33007. * Labels are added and removed from the collection using {@link LabelCollection#add}
  33008. * and {@link LabelCollection#remove}.
  33009. * @example
  33010. * // Create a label collection with two labels
  33011. * const labels = scene.primitives.add(new Cesium.LabelCollection());
  33012. * labels.add({
  33013. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  33014. * text : 'A label'
  33015. * });
  33016. * labels.add({
  33017. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  33018. * text : 'Another label'
  33019. * });
  33020. * @param [options] - Object with the following properties:
  33021. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each label from model to world coordinates.
  33022. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  33023. * @param [options.scene] - Must be passed in for labels that use the height reference property or will be depth tested against the globe.
  33024. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The label blending option. The default
  33025. * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent,
  33026. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  33027. * @param [options.show = true] - Determines if the labels in the collection will be shown.
  33028. */
  33029. export class LabelCollection {
  33030. constructor(options?: {
  33031. modelMatrix?: Matrix4;
  33032. debugShowBoundingVolume?: boolean;
  33033. scene?: Scene;
  33034. blendOption?: BlendOption;
  33035. show?: boolean;
  33036. });
  33037. /**
  33038. * Determines if labels in this collection will be shown.
  33039. */
  33040. show: boolean;
  33041. /**
  33042. * The 4x4 transformation matrix that transforms each label in this collection from model to world coordinates.
  33043. * When this is the identity matrix, the labels are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  33044. * Local reference frames can be used by providing a different transformation matrix, like that returned
  33045. * by {@link Transforms.eastNorthUpToFixedFrame}.
  33046. * @example
  33047. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  33048. * labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  33049. * labels.add({
  33050. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0),
  33051. * text : 'Center'
  33052. * });
  33053. * labels.add({
  33054. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0),
  33055. * text : 'East'
  33056. * });
  33057. * labels.add({
  33058. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0),
  33059. * text : 'North'
  33060. * });
  33061. * labels.add({
  33062. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0),
  33063. * text : 'Up'
  33064. * });
  33065. */
  33066. modelMatrix: Matrix4;
  33067. /**
  33068. * This property is for debugging only; it is not for production use nor is it optimized.
  33069. * <p>
  33070. * Draws the bounding sphere for each draw command in the primitive.
  33071. * </p>
  33072. */
  33073. debugShowBoundingVolume: boolean;
  33074. /**
  33075. * The label blending option. The default is used for rendering both opaque and translucent labels.
  33076. * However, if either all of the labels are completely opaque or all are completely translucent,
  33077. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  33078. * performance by up to 2x.
  33079. */
  33080. blendOption: BlendOption;
  33081. /**
  33082. * Returns the number of labels in this collection. This is commonly used with
  33083. * {@link LabelCollection#get} to iterate over all the labels
  33084. * in the collection.
  33085. */
  33086. length: number;
  33087. /**
  33088. * Creates and adds a label with the specified initial properties to the collection.
  33089. * The added label is returned so it can be modified or removed from the collection later.
  33090. * @example
  33091. * // Example 1: Add a label, specifying all the default values.
  33092. * const l = labels.add({
  33093. * show : true,
  33094. * position : Cesium.Cartesian3.ZERO,
  33095. * text : '',
  33096. * font : '30px sans-serif',
  33097. * fillColor : Cesium.Color.WHITE,
  33098. * outlineColor : Cesium.Color.BLACK,
  33099. * outlineWidth : 1.0,
  33100. * showBackground : false,
  33101. * backgroundColor : new Cesium.Color(0.165, 0.165, 0.165, 0.8),
  33102. * backgroundPadding : new Cesium.Cartesian2(7, 5),
  33103. * style : Cesium.LabelStyle.FILL,
  33104. * pixelOffset : Cesium.Cartesian2.ZERO,
  33105. * eyeOffset : Cesium.Cartesian3.ZERO,
  33106. * horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
  33107. * verticalOrigin : Cesium.VerticalOrigin.BASELINE,
  33108. * scale : 1.0,
  33109. * translucencyByDistance : undefined,
  33110. * pixelOffsetScaleByDistance : undefined,
  33111. * heightReference : HeightReference.NONE,
  33112. * distanceDisplayCondition : undefined
  33113. * });
  33114. * @example
  33115. * // Example 2: Specify only the label's cartographic position,
  33116. * // text, and font.
  33117. * const l = labels.add({
  33118. * position : Cesium.Cartesian3.fromRadians(longitude, latitude, height),
  33119. * text : 'Hello World',
  33120. * font : '24px Helvetica',
  33121. * });
  33122. * @param [options] - A template describing the label's properties as shown in Example 1.
  33123. * @returns The label that was added to the collection.
  33124. */
  33125. add(options?: any): Label;
  33126. /**
  33127. * Removes a label from the collection. Once removed, a label is no longer usable.
  33128. * @example
  33129. * const l = labels.add(...);
  33130. * labels.remove(l); // Returns true
  33131. * @param label - The label to remove.
  33132. * @returns <code>true</code> if the label was removed; <code>false</code> if the label was not found in the collection.
  33133. */
  33134. remove(label: Label): boolean;
  33135. /**
  33136. * Removes all labels from the collection.
  33137. * @example
  33138. * labels.add(...);
  33139. * labels.add(...);
  33140. * labels.removeAll();
  33141. */
  33142. removeAll(): void;
  33143. /**
  33144. * Check whether this collection contains a given label.
  33145. * @param label - The label to check for.
  33146. * @returns true if this collection contains the label, false otherwise.
  33147. */
  33148. contains(label: Label): boolean;
  33149. /**
  33150. * Returns the label in the collection at the specified index. Indices are zero-based
  33151. * and increase as labels are added. Removing a label shifts all labels after
  33152. * it to the left, changing their indices. This function is commonly used with
  33153. * {@link LabelCollection#length} to iterate over all the labels
  33154. * in the collection.
  33155. * @example
  33156. * // Toggle the show property of every label in the collection
  33157. * const len = labels.length;
  33158. * for (let i = 0; i < len; ++i) {
  33159. * const l = billboards.get(i);
  33160. * l.show = !l.show;
  33161. * }
  33162. * @param index - The zero-based index of the billboard.
  33163. * @returns The label at the specified index.
  33164. */
  33165. get(index: number): Label;
  33166. /**
  33167. * Returns true if this object was destroyed; otherwise, false.
  33168. * <br /><br />
  33169. * If this object was destroyed, it should not be used; calling any function other than
  33170. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33171. * @returns True if this object was destroyed; otherwise, false.
  33172. */
  33173. isDestroyed(): boolean;
  33174. /**
  33175. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33176. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33177. * <br /><br />
  33178. * Once an object is destroyed, it should not be used; calling any function other than
  33179. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33180. * assign the return value (<code>undefined</code>) to the object as done in the example.
  33181. * @example
  33182. * labels = labels && labels.destroy();
  33183. */
  33184. destroy(): void;
  33185. }
  33186. /**
  33187. * Describes how to draw a label.
  33188. */
  33189. export enum LabelStyle {
  33190. /**
  33191. * Fill the text of the label, but do not outline.
  33192. */
  33193. FILL = 0,
  33194. /**
  33195. * Outline the text of the label, but do not fill.
  33196. */
  33197. OUTLINE = 1,
  33198. /**
  33199. * Fill and outline the text of the label.
  33200. */
  33201. FILL_AND_OUTLINE = 2
  33202. }
  33203. /**
  33204. * 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.
  33205. */
  33206. export class Light {
  33207. constructor();
  33208. /**
  33209. * The color of the light.
  33210. */
  33211. color: Color;
  33212. /**
  33213. * The intensity controls the strength of the light. <code>intensity</code> has a minimum value of 0.0 and no maximum value.
  33214. */
  33215. intensity: number;
  33216. }
  33217. /**
  33218. * Describes how the map will operate in 2D.
  33219. */
  33220. export enum MapMode2D {
  33221. /**
  33222. * The 2D map can be rotated about the z axis.
  33223. */
  33224. ROTATE = 0,
  33225. /**
  33226. * The 2D map can be scrolled infinitely in the horizontal direction.
  33227. */
  33228. INFINITE_SCROLL = 1
  33229. }
  33230. export namespace MapboxImageryProvider {
  33231. /**
  33232. * Initialization options for the MapboxImageryProvider constructor
  33233. * @property [url = 'https://api.mapbox.com/v4/'] - The Mapbox server url.
  33234. * @property mapId - The Mapbox Map ID.
  33235. * @property accessToken - The public access token for the imagery.
  33236. * @property [format = 'png'] - The format of the image request.
  33237. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  33238. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  33239. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  33240. * to result in rendering problems.
  33241. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  33242. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  33243. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  33244. */
  33245. type ConstructorOptions = {
  33246. url?: string;
  33247. mapId: string;
  33248. accessToken: string;
  33249. format?: string;
  33250. ellipsoid?: Ellipsoid;
  33251. minimumLevel?: number;
  33252. maximumLevel?: number;
  33253. rectangle?: Rectangle;
  33254. credit?: Credit | string;
  33255. };
  33256. }
  33257. /**
  33258. * Provides tiled imagery hosted by Mapbox.
  33259. * @example
  33260. * // Mapbox tile provider
  33261. * const mapbox = new Cesium.MapboxImageryProvider({
  33262. * mapId: 'mapbox.streets',
  33263. * accessToken: 'thisIsMyAccessToken'
  33264. * });
  33265. * @param options - Object describing initialization options
  33266. */
  33267. export class MapboxImageryProvider {
  33268. constructor(options: MapboxImageryProvider.ConstructorOptions);
  33269. /**
  33270. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  33271. * 1.0 representing fully opaque.
  33272. */
  33273. defaultAlpha: number | undefined;
  33274. /**
  33275. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  33276. * 1.0 representing fully opaque.
  33277. */
  33278. defaultNightAlpha: number | undefined;
  33279. /**
  33280. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  33281. * 1.0 representing fully opaque.
  33282. */
  33283. defaultDayAlpha: number | undefined;
  33284. /**
  33285. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  33286. * makes the imagery darker while greater than 1.0 makes it brighter.
  33287. */
  33288. defaultBrightness: number | undefined;
  33289. /**
  33290. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  33291. * the contrast while greater than 1.0 increases it.
  33292. */
  33293. defaultContrast: number | undefined;
  33294. /**
  33295. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  33296. */
  33297. defaultHue: number | undefined;
  33298. /**
  33299. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  33300. * saturation while greater than 1.0 increases it.
  33301. */
  33302. defaultSaturation: number | undefined;
  33303. /**
  33304. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  33305. */
  33306. defaultGamma: number | undefined;
  33307. /**
  33308. * The default texture minification filter to apply to this provider.
  33309. */
  33310. defaultMinificationFilter: TextureMinificationFilter;
  33311. /**
  33312. * The default texture magnification filter to apply to this provider.
  33313. */
  33314. defaultMagnificationFilter: TextureMagnificationFilter;
  33315. /**
  33316. * Gets the URL of the Mapbox server.
  33317. */
  33318. readonly url: string;
  33319. /**
  33320. * Gets a value indicating whether or not the provider is ready for use.
  33321. */
  33322. readonly ready: boolean;
  33323. /**
  33324. * Gets a promise that resolves to true when the provider is ready for use.
  33325. */
  33326. readonly readyPromise: Promise<boolean>;
  33327. /**
  33328. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  33329. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33330. */
  33331. readonly rectangle: Rectangle;
  33332. /**
  33333. * Gets the width of each tile, in pixels. This function should
  33334. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33335. */
  33336. readonly tileWidth: number;
  33337. /**
  33338. * Gets the height of each tile, in pixels. This function should
  33339. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33340. */
  33341. readonly tileHeight: number;
  33342. /**
  33343. * Gets the maximum level-of-detail that can be requested. This function should
  33344. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33345. */
  33346. readonly maximumLevel: number | undefined;
  33347. /**
  33348. * Gets the minimum level-of-detail that can be requested. This function should
  33349. * not be called before {@link MapboxImageryProvider#ready} returns true. Generally,
  33350. * a minimum level should only be used when the rectangle of the imagery is small
  33351. * enough that the number of tiles at the minimum level is small. An imagery
  33352. * provider with more than a few tiles at the minimum level will lead to
  33353. * rendering problems.
  33354. */
  33355. readonly minimumLevel: number;
  33356. /**
  33357. * Gets the tiling scheme used by the provider. This function should
  33358. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33359. */
  33360. readonly tilingScheme: TilingScheme;
  33361. /**
  33362. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  33363. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  33364. * returns undefined, no tiles are filtered. This function should
  33365. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33366. */
  33367. readonly tileDiscardPolicy: TileDiscardPolicy;
  33368. /**
  33369. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  33370. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  33371. * are passed an instance of {@link TileProviderError}.
  33372. */
  33373. readonly errorEvent: Event;
  33374. /**
  33375. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  33376. * the source of the imagery. This function should
  33377. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33378. */
  33379. readonly credit: Credit;
  33380. /**
  33381. * Gets the proxy used by this provider.
  33382. */
  33383. readonly proxy: Proxy;
  33384. /**
  33385. * Gets a value indicating whether or not the images provided by this imagery provider
  33386. * include an alpha channel. If this property is false, an alpha channel, if present, will
  33387. * be ignored. If this property is true, any images without an alpha channel will be treated
  33388. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  33389. * and texture upload time are reduced.
  33390. */
  33391. readonly hasAlphaChannel: boolean;
  33392. /**
  33393. * Gets the credits to be displayed when a given tile is displayed.
  33394. * @param x - The tile X coordinate.
  33395. * @param y - The tile Y coordinate.
  33396. * @param level - The tile level;
  33397. * @returns The credits to be displayed when the tile is displayed.
  33398. */
  33399. getTileCredits(x: number, y: number, level: number): Credit[];
  33400. /**
  33401. * Requests the image for a given tile. This function should
  33402. * not be called before {@link MapboxImageryProvider#ready} returns true.
  33403. * @param x - The tile X coordinate.
  33404. * @param y - The tile Y coordinate.
  33405. * @param level - The tile level.
  33406. * @param [request] - The request object. Intended for internal use only.
  33407. * @returns A promise for the image that will resolve when the image is available, or
  33408. * undefined if there are too many active requests to the server, and the request should be retried later.
  33409. */
  33410. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  33411. /**
  33412. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  33413. * a tile. This function should not be called before {@link MapboxImageryProvider#ready} returns true.
  33414. * This function is optional, so it may not exist on all ImageryProviders.
  33415. * @param x - The tile X coordinate.
  33416. * @param y - The tile Y coordinate.
  33417. * @param level - The tile level.
  33418. * @param longitude - The longitude at which to pick features.
  33419. * @param latitude - The latitude at which to pick features.
  33420. * @returns A promise for the picked features that will resolve when the asynchronous
  33421. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  33422. * instances. The array may be empty if no features are found at the given location.
  33423. * It may also be undefined if picking is not supported.
  33424. */
  33425. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  33426. }
  33427. export namespace MapboxStyleImageryProvider {
  33428. /**
  33429. * Initialization options for the MapboxStyleImageryProvider constructor
  33430. * @property [url = 'https://api.mapbox.com/styles/v1/'] - The Mapbox server url.
  33431. * @property [username = 'mapbox'] - The username of the map account.
  33432. * @property styleId - The Mapbox Style ID.
  33433. * @property accessToken - The public access token for the imagery.
  33434. * @property [tilesize = 512] - The size of the image tiles.
  33435. * @property [scaleFactor] - Determines if tiles are rendered at a @2x scale factor.
  33436. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  33437. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  33438. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  33439. * to result in rendering problems.
  33440. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  33441. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  33442. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  33443. */
  33444. type ConstructorOptions = {
  33445. url?: Resource | string;
  33446. username?: string;
  33447. styleId: string;
  33448. accessToken: string;
  33449. tilesize?: number;
  33450. scaleFactor?: boolean;
  33451. ellipsoid?: Ellipsoid;
  33452. minimumLevel?: number;
  33453. maximumLevel?: number;
  33454. rectangle?: Rectangle;
  33455. credit?: Credit | string;
  33456. };
  33457. }
  33458. /**
  33459. * Provides tiled imagery hosted by Mapbox.
  33460. * @example
  33461. * // Mapbox style provider
  33462. * const mapbox = new Cesium.MapboxStyleImageryProvider({
  33463. * styleId: 'streets-v11',
  33464. * accessToken: 'thisIsMyAccessToken'
  33465. * });
  33466. * @param options - Object describing initialization options
  33467. */
  33468. export class MapboxStyleImageryProvider {
  33469. constructor(options: MapboxStyleImageryProvider.ConstructorOptions);
  33470. /**
  33471. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  33472. * 1.0 representing fully opaque.
  33473. */
  33474. defaultAlpha: number | undefined;
  33475. /**
  33476. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  33477. * 1.0 representing fully opaque.
  33478. */
  33479. defaultNightAlpha: number | undefined;
  33480. /**
  33481. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  33482. * 1.0 representing fully opaque.
  33483. */
  33484. defaultDayAlpha: number | undefined;
  33485. /**
  33486. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  33487. * makes the imagery darker while greater than 1.0 makes it brighter.
  33488. */
  33489. defaultBrightness: number | undefined;
  33490. /**
  33491. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  33492. * the contrast while greater than 1.0 increases it.
  33493. */
  33494. defaultContrast: number | undefined;
  33495. /**
  33496. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  33497. */
  33498. defaultHue: number | undefined;
  33499. /**
  33500. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  33501. * saturation while greater than 1.0 increases it.
  33502. */
  33503. defaultSaturation: number | undefined;
  33504. /**
  33505. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  33506. */
  33507. defaultGamma: number | undefined;
  33508. /**
  33509. * The default texture minification filter to apply to this provider.
  33510. */
  33511. defaultMinificationFilter: TextureMinificationFilter;
  33512. /**
  33513. * The default texture magnification filter to apply to this provider.
  33514. */
  33515. defaultMagnificationFilter: TextureMagnificationFilter;
  33516. /**
  33517. * Gets the URL of the Mapbox server.
  33518. */
  33519. readonly url: string;
  33520. /**
  33521. * Gets a value indicating whether or not the provider is ready for use.
  33522. */
  33523. readonly ready: boolean;
  33524. /**
  33525. * Gets a promise that resolves to true when the provider is ready for use.
  33526. */
  33527. readonly readyPromise: Promise<boolean>;
  33528. /**
  33529. * Gets the rectangle, in radians, of the imagery provided by the instance. This function should
  33530. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33531. */
  33532. readonly rectangle: Rectangle;
  33533. /**
  33534. * Gets the width of each tile, in pixels. This function should
  33535. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33536. */
  33537. readonly tileWidth: number;
  33538. /**
  33539. * Gets the height of each tile, in pixels. This function should
  33540. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33541. */
  33542. readonly tileHeight: number;
  33543. /**
  33544. * Gets the maximum level-of-detail that can be requested. This function should
  33545. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33546. */
  33547. readonly maximumLevel: number | undefined;
  33548. /**
  33549. * Gets the minimum level-of-detail that can be requested. This function should
  33550. * not be called before {@link MapboxStyleImageryProvider#ready} returns true. Generally,
  33551. * a minimum level should only be used when the rectangle of the imagery is small
  33552. * enough that the number of tiles at the minimum level is small. An imagery
  33553. * provider with more than a few tiles at the minimum level will lead to
  33554. * rendering problems.
  33555. */
  33556. readonly minimumLevel: number;
  33557. /**
  33558. * Gets the tiling scheme used by the provider. This function should
  33559. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33560. */
  33561. readonly tilingScheme: TilingScheme;
  33562. /**
  33563. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  33564. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  33565. * returns undefined, no tiles are filtered. This function should
  33566. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33567. */
  33568. readonly tileDiscardPolicy: TileDiscardPolicy;
  33569. /**
  33570. * Gets an event that is raised when the imagery provider encounters an asynchronous error.. By subscribing
  33571. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  33572. * are passed an instance of {@link TileProviderError}.
  33573. */
  33574. readonly errorEvent: Event;
  33575. /**
  33576. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  33577. * the source of the imagery. This function should
  33578. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33579. */
  33580. readonly credit: Credit;
  33581. /**
  33582. * Gets the proxy used by this provider.
  33583. */
  33584. readonly proxy: Proxy;
  33585. /**
  33586. * Gets a value indicating whether or not the images provided by this imagery provider
  33587. * include an alpha channel. If this property is false, an alpha channel, if present, will
  33588. * be ignored. If this property is true, any images without an alpha channel will be treated
  33589. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  33590. * and texture upload time are reduced.
  33591. */
  33592. readonly hasAlphaChannel: boolean;
  33593. /**
  33594. * Gets the credits to be displayed when a given tile is displayed.
  33595. * @param x - The tile X coordinate.
  33596. * @param y - The tile Y coordinate.
  33597. * @param level - The tile level;
  33598. * @returns The credits to be displayed when the tile is displayed.
  33599. */
  33600. getTileCredits(x: number, y: number, level: number): Credit[];
  33601. /**
  33602. * Requests the image for a given tile. This function should
  33603. * not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33604. * @param x - The tile X coordinate.
  33605. * @param y - The tile Y coordinate.
  33606. * @param level - The tile level.
  33607. * @param [request] - The request object. Intended for internal use only.
  33608. * @returns A promise for the image that will resolve when the image is available, or
  33609. * undefined if there are too many active requests to the server, and the request should be retried later.
  33610. */
  33611. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  33612. /**
  33613. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  33614. * a tile. This function should not be called before {@link MapboxStyleImageryProvider#ready} returns true.
  33615. * This function is optional, so it may not exist on all ImageryProviders.
  33616. * @param x - The tile X coordinate.
  33617. * @param y - The tile Y coordinate.
  33618. * @param level - The tile level.
  33619. * @param longitude - The longitude at which to pick features.
  33620. * @param latitude - The latitude at which to pick features.
  33621. * @returns A promise for the picked features that will resolve when the asynchronous
  33622. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  33623. * instances. The array may be empty if no features are found at the given location.
  33624. * It may also be undefined if picking is not supported.
  33625. */
  33626. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  33627. }
  33628. /**
  33629. * A Material defines surface appearance through a combination of diffuse, specular,
  33630. * normal, emission, and alpha components. These values are specified using a
  33631. * JSON schema called Fabric which gets parsed and assembled into glsl shader code
  33632. * behind-the-scenes. Check out the {@link https://github.com/CesiumGS/cesium/wiki/Fabric|wiki page}
  33633. * for more details on Fabric.
  33634. * <br /><br />
  33635. * <style type="text/css">
  33636. * #materialDescriptions code {
  33637. * font-weight: normal;
  33638. * font-family: Consolas, 'Lucida Console', Monaco, monospace;
  33639. * color: #A35A00;
  33640. * }
  33641. * #materialDescriptions ul, #materialDescriptions ul ul {
  33642. * list-style-type: none;
  33643. * }
  33644. * #materialDescriptions ul ul {
  33645. * margin-bottom: 10px;
  33646. * }
  33647. * #materialDescriptions ul ul li {
  33648. * font-weight: normal;
  33649. * color: #000000;
  33650. * text-indent: -2em;
  33651. * margin-left: 2em;
  33652. * }
  33653. * #materialDescriptions ul li {
  33654. * font-weight: bold;
  33655. * color: #0053CF;
  33656. * }
  33657. * </style>
  33658. *
  33659. * Base material types and their uniforms:
  33660. * <div id='materialDescriptions'>
  33661. * <ul>
  33662. * <li>Color</li>
  33663. * <ul>
  33664. * <li><code>color</code>: rgba color object.</li>
  33665. * </ul>
  33666. * <li>Image</li>
  33667. * <ul>
  33668. * <li><code>image</code>: path to image.</li>
  33669. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33670. * </ul>
  33671. * <li>DiffuseMap</li>
  33672. * <ul>
  33673. * <li><code>image</code>: path to image.</li>
  33674. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li>
  33675. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33676. * </ul>
  33677. * <li>AlphaMap</li>
  33678. * <ul>
  33679. * <li><code>image</code>: path to image.</li>
  33680. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33681. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33682. * </ul>
  33683. * <li>SpecularMap</li>
  33684. * <ul>
  33685. * <li><code>image</code>: path to image.</li>
  33686. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33687. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33688. * </ul>
  33689. * <li>EmissionMap</li>
  33690. * <ul>
  33691. * <li><code>image</code>: path to image.</li>
  33692. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  33693. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33694. * </ul>
  33695. * <li>BumpMap</li>
  33696. * <ul>
  33697. * <li><code>image</code>: path to image.</li>
  33698. * <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li>
  33699. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33700. * <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>
  33701. * </ul>
  33702. * <li>NormalMap</li>
  33703. * <ul>
  33704. * <li><code>image</code>: path to image.</li>
  33705. * <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li>
  33706. * <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li>
  33707. * <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>
  33708. * </ul>
  33709. * <li>Grid</li>
  33710. * <ul>
  33711. * <li><code>color</code>: rgba color object for the whole material.</li>
  33712. * <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li>
  33713. * <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  33714. * <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li>
  33715. * <li><code>lineOffset</code>: Object with x and y values specifying the offset of grid lines (range is 0 to 1).</li>
  33716. * </ul>
  33717. * <li>Stripe</li>
  33718. * <ul>
  33719. * <li><code>horizontal</code>: Boolean that determines if the stripes are horizontal or vertical.</li>
  33720. * <li><code>evenColor</code>: rgba color object for the stripe's first color.</li>
  33721. * <li><code>oddColor</code>: rgba color object for the stripe's second color.</li>
  33722. * <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>
  33723. * <li><code>repeat</code>: Number that controls the total number of stripes, half light and half dark.</li>
  33724. * </ul>
  33725. * <li>Checkerboard</li>
  33726. * <ul>
  33727. * <li><code>lightColor</code>: rgba color object for the checkerboard's light alternating color.</li>
  33728. * <li><code>darkColor</code>: rgba color object for the checkerboard's dark alternating color.</li>
  33729. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows respectively.</li>
  33730. * </ul>
  33731. * <li>Dot</li>
  33732. * <ul>
  33733. * <li><code>lightColor</code>: rgba color object for the dot color.</li>
  33734. * <li><code>darkColor</code>: rgba color object for the background color.</li>
  33735. * <li><code>repeat</code>: Object with x and y values specifying the number of columns and rows of dots respectively.</li>
  33736. * </ul>
  33737. * <li>Water</li>
  33738. * <ul>
  33739. * <li><code>baseWaterColor</code>: rgba color object base color of the water.</li>
  33740. * <li><code>blendColor</code>: rgba color object used when blending from water to non-water areas.</li>
  33741. * <li><code>specularMap</code>: Single channel texture used to indicate areas of water.</li>
  33742. * <li><code>normalMap</code>: Normal map for water normal perturbation.</li>
  33743. * <li><code>frequency</code>: Number that controls the number of waves.</li>
  33744. * <li><code>animationSpeed</code>: Number that controls the animations speed of the water.</li>
  33745. * <li><code>amplitude</code>: Number that controls the amplitude of water waves.</li>
  33746. * <li><code>specularIntensity</code>: Number that controls the intensity of specular reflections.</li>
  33747. * </ul>
  33748. * <li>RimLighting</li>
  33749. * <ul>
  33750. * <li><code>color</code>: diffuse color and alpha.</li>
  33751. * <li><code>rimColor</code>: diffuse color and alpha of the rim.</li>
  33752. * <li><code>width</code>: Number that determines the rim's width.</li>
  33753. * </ul>
  33754. * <li>Fade</li>
  33755. * <ul>
  33756. * <li><code>fadeInColor</code>: diffuse color and alpha at <code>time</code></li>
  33757. * <li><code>fadeOutColor</code>: diffuse color and alpha at <code>maximumDistance</code> from <code>time</code></li>
  33758. * <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>
  33759. * <li><code>repeat</code>: true if the fade should wrap around the texture coodinates.</li>
  33760. * <li><code>fadeDirection</code>: Object with x and y values specifying if the fade should be in the x and y directions.</li>
  33761. * <li><code>time</code>: Object with x and y values between 0.0 and 1.0 of the <code>fadeInColor</code> position</li>
  33762. * </ul>
  33763. * <li>PolylineArrow</li>
  33764. * <ul>
  33765. * <li><code>color</code>: diffuse color and alpha.</li>
  33766. * </ul>
  33767. * <li>PolylineDash</li>
  33768. * <ul>
  33769. * <li><code>color</code>: color for the line.</li>
  33770. * <li><code>gapColor</code>: color for the gaps in the line.</li>
  33771. * <li><code>dashLength</code>: Dash length in pixels.</li>
  33772. * <li><code>dashPattern</code>: The 16 bit stipple pattern for the line..</li>
  33773. * </ul>
  33774. * <li>PolylineGlow</li>
  33775. * <ul>
  33776. * <li><code>color</code>: color and maximum alpha for the glow on the line.</li>
  33777. * <li><code>glowPower</code>: strength of the glow, as a percentage of the total line width (less than 1.0).</li>
  33778. * <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>
  33779. * </ul>
  33780. * <li>PolylineOutline</li>
  33781. * <ul>
  33782. * <li><code>color</code>: diffuse color and alpha for the interior of the line.</li>
  33783. * <li><code>outlineColor</code>: diffuse color and alpha for the outline.</li>
  33784. * <li><code>outlineWidth</code>: width of the outline in pixels.</li>
  33785. * </ul>
  33786. * <li>ElevationContour</li>
  33787. * <ul>
  33788. * <li><code>color</code>: color and alpha for the contour line.</li>
  33789. * <li><code>spacing</code>: spacing for contour lines in meters.</li>
  33790. * <li><code>width</code>: Number specifying the width of the grid lines in pixels.</li>
  33791. * </ul>
  33792. * <li>ElevationRamp</li>
  33793. * <ul>
  33794. * <li><code>image</code>: color ramp image to use for coloring the terrain.</li>
  33795. * <li><code>minimumHeight</code>: minimum height for the ramp.</li>
  33796. * <li><code>maximumHeight</code>: maximum height for the ramp.</li>
  33797. * </ul>
  33798. * <li>SlopeRamp</li>
  33799. * <ul>
  33800. * <li><code>image</code>: color ramp image to use for coloring the terrain by slope.</li>
  33801. * </ul>
  33802. * <li>AspectRamp</li>
  33803. * <ul>
  33804. * <li><code>image</code>: color ramp image to use for color the terrain by aspect.</li>
  33805. * </ul>
  33806. * <li>ElevationBand</li>
  33807. * <ul>
  33808. * <li><code>heights</code>: image of heights sorted from lowest to highest.</li>
  33809. * <li><code>colors</code>: image of colors at the corresponding heights.</li>
  33810. * </ul>
  33811. * </ul>
  33812. * </ul>
  33813. * </div>
  33814. * @example
  33815. * // Create a color material with fromType:
  33816. * polygon.material = Cesium.Material.fromType('Color');
  33817. * polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  33818. *
  33819. * // Create the default material:
  33820. * polygon.material = new Cesium.Material();
  33821. *
  33822. * // Create a color material with full Fabric notation:
  33823. * polygon.material = new Cesium.Material({
  33824. * fabric : {
  33825. * type : 'Color',
  33826. * uniforms : {
  33827. * color : new Cesium.Color(1.0, 1.0, 0.0, 1.0)
  33828. * }
  33829. * }
  33830. * });
  33831. * @param [options] - Object with the following properties:
  33832. * @param [options.strict = false] - Throws errors for issues that would normally be ignored, including unused uniforms or materials.
  33833. * @param [options.translucent = true] - When <code>true</code> or a function that returns <code>true</code>, the geometry
  33834. * with this material is expected to appear translucent.
  33835. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The {@link TextureMinificationFilter} to apply to this material's textures.
  33836. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The {@link TextureMagnificationFilter} to apply to this material's textures.
  33837. * @param options.fabric - The fabric JSON used to generate the material.
  33838. */
  33839. export class Material {
  33840. constructor(options?: {
  33841. strict?: boolean;
  33842. translucent?: boolean | ((...params: any[]) => any);
  33843. minificationFilter?: TextureMinificationFilter;
  33844. magnificationFilter?: TextureMagnificationFilter;
  33845. fabric: any;
  33846. });
  33847. /**
  33848. * The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
  33849. */
  33850. type: string;
  33851. /**
  33852. * The glsl shader source for this material.
  33853. */
  33854. shaderSource: string;
  33855. /**
  33856. * Maps sub-material names to Material objects.
  33857. */
  33858. materials: any;
  33859. /**
  33860. * Maps uniform names to their values.
  33861. */
  33862. uniforms: any;
  33863. /**
  33864. * When <code>true</code> or a function that returns <code>true</code>,
  33865. * the geometry is expected to appear translucent.
  33866. */
  33867. translucent: boolean | ((...params: any[]) => any);
  33868. /**
  33869. * Creates a new material using an existing material type.
  33870. * <br /><br />
  33871. * Shorthand for: new Material({fabric : {type : type}});
  33872. * @example
  33873. * const material = Cesium.Material.fromType('Color', {
  33874. * color : new Cesium.Color(1.0, 0.0, 0.0, 1.0)
  33875. * });
  33876. * @param type - The base material type.
  33877. * @param [uniforms] - Overrides for the default uniforms.
  33878. * @returns New material object.
  33879. */
  33880. static fromType(type: string, uniforms?: any): Material;
  33881. /**
  33882. * Gets whether or not this material is translucent.
  33883. * @returns <code>true</code> if this material is translucent, <code>false</code> otherwise.
  33884. */
  33885. isTranslucent(): boolean;
  33886. /**
  33887. * Returns true if this object was destroyed; otherwise, false.
  33888. * <br /><br />
  33889. * If this object was destroyed, it should not be used; calling any function other than
  33890. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  33891. * @returns True if this object was destroyed; otherwise, false.
  33892. */
  33893. isDestroyed(): boolean;
  33894. /**
  33895. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  33896. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  33897. * <br /><br />
  33898. * Once an object is destroyed, it should not be used; calling any function other than
  33899. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  33900. * assign the return value (<code>undefined</code>) to the object as done in the example.
  33901. * @example
  33902. * material = material && material.destroy();
  33903. */
  33904. destroy(): void;
  33905. /**
  33906. * Gets or sets the default texture uniform value.
  33907. */
  33908. static DefaultImageId: string;
  33909. /**
  33910. * Gets or sets the default cube map texture uniform value.
  33911. */
  33912. static DefaultCubeMapId: string;
  33913. /**
  33914. * Gets the name of the color material.
  33915. */
  33916. static readonly ColorType: string;
  33917. /**
  33918. * Gets the name of the image material.
  33919. */
  33920. static readonly ImageType: string;
  33921. /**
  33922. * Gets the name of the diffuce map material.
  33923. */
  33924. static readonly DiffuseMapType: string;
  33925. /**
  33926. * Gets the name of the alpha map material.
  33927. */
  33928. static readonly AlphaMapType: string;
  33929. /**
  33930. * Gets the name of the specular map material.
  33931. */
  33932. static readonly SpecularMapType: string;
  33933. /**
  33934. * Gets the name of the emmision map material.
  33935. */
  33936. static readonly EmissionMapType: string;
  33937. /**
  33938. * Gets the name of the bump map material.
  33939. */
  33940. static readonly BumpMapType: string;
  33941. /**
  33942. * Gets the name of the normal map material.
  33943. */
  33944. static readonly NormalMapType: string;
  33945. /**
  33946. * Gets the name of the grid material.
  33947. */
  33948. static readonly GridType: string;
  33949. /**
  33950. * Gets the name of the stripe material.
  33951. */
  33952. static readonly StripeType: string;
  33953. /**
  33954. * Gets the name of the checkerboard material.
  33955. */
  33956. static readonly CheckerboardType: string;
  33957. /**
  33958. * Gets the name of the dot material.
  33959. */
  33960. static readonly DotType: string;
  33961. /**
  33962. * Gets the name of the water material.
  33963. */
  33964. static readonly WaterType: string;
  33965. /**
  33966. * Gets the name of the rim lighting material.
  33967. */
  33968. static readonly RimLightingType: string;
  33969. /**
  33970. * Gets the name of the fade material.
  33971. */
  33972. static readonly FadeType: string;
  33973. /**
  33974. * Gets the name of the polyline arrow material.
  33975. */
  33976. static readonly PolylineArrowType: string;
  33977. /**
  33978. * Gets the name of the polyline glow material.
  33979. */
  33980. static readonly PolylineDashType: string;
  33981. /**
  33982. * Gets the name of the polyline glow material.
  33983. */
  33984. static readonly PolylineGlowType: string;
  33985. /**
  33986. * Gets the name of the polyline outline material.
  33987. */
  33988. static readonly PolylineOutlineType: string;
  33989. /**
  33990. * Gets the name of the elevation contour material.
  33991. */
  33992. static readonly ElevationContourType: string;
  33993. /**
  33994. * Gets the name of the elevation contour material.
  33995. */
  33996. static readonly ElevationRampType: string;
  33997. /**
  33998. * Gets the name of the slope ramp material.
  33999. */
  34000. static readonly SlopeRampMaterialType: string;
  34001. /**
  34002. * Gets the name of the aspect ramp material.
  34003. */
  34004. static readonly AspectRampMaterialType: string;
  34005. /**
  34006. * Gets the name of the elevation band material.
  34007. */
  34008. static readonly ElevationBandType: string;
  34009. }
  34010. /**
  34011. * An appearance for arbitrary geometry (as opposed to {@link EllipsoidSurfaceAppearance}, for example)
  34012. * that supports shading with materials.
  34013. * @example
  34014. * const primitive = new Cesium.Primitive({
  34015. * geometryInstances : new Cesium.GeometryInstance({
  34016. * geometry : new Cesium.WallGeometry({
  34017. * materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,
  34018. * // ...
  34019. * })
  34020. * }),
  34021. * appearance : new Cesium.MaterialAppearance({
  34022. * material : Cesium.Material.fromType('Color'),
  34023. * faceForward : true
  34024. * })
  34025. *
  34026. * });
  34027. * @param [options] - Object with the following properties:
  34028. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  34029. * @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}.
  34030. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link MaterialAppearance#renderState} has alpha blending enabled.
  34031. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link MaterialAppearance#renderState} has backface culling enabled.
  34032. * @param [options.materialSupport = MaterialAppearance.MaterialSupport.TEXTURED] - The type of materials that will be supported.
  34033. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  34034. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  34035. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  34036. * @param [options.renderState] - Optional render state to override the default render state.
  34037. */
  34038. export class MaterialAppearance {
  34039. constructor(options?: {
  34040. flat?: boolean;
  34041. faceForward?: boolean;
  34042. translucent?: boolean;
  34043. closed?: boolean;
  34044. materialSupport?: MaterialAppearance.MaterialSupportType;
  34045. material?: Material;
  34046. vertexShaderSource?: string;
  34047. fragmentShaderSource?: string;
  34048. renderState?: any;
  34049. });
  34050. /**
  34051. * The material used to determine the fragment color. Unlike other {@link MaterialAppearance}
  34052. * properties, this is not read-only, so an appearance's material can change on the fly.
  34053. */
  34054. material: Material;
  34055. /**
  34056. * When <code>true</code>, the geometry is expected to appear translucent.
  34057. */
  34058. translucent: boolean;
  34059. /**
  34060. * The GLSL source code for the vertex shader.
  34061. */
  34062. readonly vertexShaderSource: string;
  34063. /**
  34064. * The GLSL source code for the fragment shader. The full fragment shader
  34065. * source is built procedurally taking into account {@link MaterialAppearance#material},
  34066. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  34067. * Use {@link MaterialAppearance#getFragmentShaderSource} to get the full source.
  34068. */
  34069. readonly fragmentShaderSource: string;
  34070. /**
  34071. * The WebGL fixed-function state to use when rendering the geometry.
  34072. * <p>
  34073. * The render state can be explicitly defined when constructing a {@link MaterialAppearance}
  34074. * instance, or it is set implicitly via {@link MaterialAppearance#translucent}
  34075. * and {@link MaterialAppearance#closed}.
  34076. * </p>
  34077. */
  34078. readonly renderState: any;
  34079. /**
  34080. * When <code>true</code>, the geometry is expected to be closed so
  34081. * {@link MaterialAppearance#renderState} has backface culling enabled.
  34082. * If the viewer enters the geometry, it will not be visible.
  34083. */
  34084. readonly closed: boolean;
  34085. /**
  34086. * The type of materials supported by this instance. This impacts the required
  34087. * {@link VertexFormat} and the complexity of the vertex and fragment shaders.
  34088. */
  34089. readonly materialSupport: MaterialAppearance.MaterialSupportType;
  34090. /**
  34091. * The {@link VertexFormat} that this appearance instance is compatible with.
  34092. * A geometry can have more vertex attributes and still be compatible - at a
  34093. * potential performance cost - but it can't have less.
  34094. */
  34095. readonly vertexFormat: VertexFormat;
  34096. /**
  34097. * When <code>true</code>, flat shading is used in the fragment shader,
  34098. * which means lighting is not taking into account.
  34099. */
  34100. readonly flat: boolean;
  34101. /**
  34102. * When <code>true</code>, the fragment shader flips the surface normal
  34103. * as needed to ensure that the normal faces the viewer to avoid
  34104. * dark spots. This is useful when both sides of a geometry should be
  34105. * shaded like {@link WallGeometry}.
  34106. */
  34107. readonly faceForward: boolean;
  34108. /**
  34109. * Procedurally creates the full GLSL fragment shader source. For {@link MaterialAppearance},
  34110. * this is derived from {@link MaterialAppearance#fragmentShaderSource}, {@link MaterialAppearance#material},
  34111. * {@link MaterialAppearance#flat}, and {@link MaterialAppearance#faceForward}.
  34112. * @returns The full GLSL fragment shader source.
  34113. */
  34114. getFragmentShaderSource(): string;
  34115. /**
  34116. * Determines if the geometry is translucent based on {@link MaterialAppearance#translucent} and {@link Material#isTranslucent}.
  34117. * @returns <code>true</code> if the appearance is translucent.
  34118. */
  34119. isTranslucent(): boolean;
  34120. /**
  34121. * Creates a render state. This is not the final render state instance; instead,
  34122. * it can contain a subset of render state properties identical to the render state
  34123. * created in the context.
  34124. * @returns The render state.
  34125. */
  34126. getRenderState(): any;
  34127. }
  34128. export namespace MaterialAppearance {
  34129. type MaterialSupportType = {
  34130. vertexFormat: VertexFormat;
  34131. vertexShaderSource: string;
  34132. fragmentShaderSource: string;
  34133. };
  34134. /**
  34135. * Determines the type of {@link Material} that is supported by a
  34136. * {@link MaterialAppearance} instance. This is a trade-off between
  34137. * flexibility (a wide array of materials) and memory/performance
  34138. * (required vertex format and GLSL shader complexity.
  34139. */
  34140. namespace MaterialSupport {
  34141. /**
  34142. * Only basic materials, which require just <code>position</code> and
  34143. * <code>normal</code> vertex attributes, are supported.
  34144. */
  34145. const BASIC: MaterialAppearance.MaterialSupportType;
  34146. /**
  34147. * Materials with textures, which require <code>position</code>,
  34148. * <code>normal</code>, and <code>st</code> vertex attributes,
  34149. * are supported. The vast majority of materials fall into this category.
  34150. */
  34151. const TEXTURED: MaterialAppearance.MaterialSupportType;
  34152. /**
  34153. * All materials, including those that work in tangent space, are supported.
  34154. * This requires <code>position</code>, <code>normal</code>, <code>st</code>,
  34155. * <code>tangent</code>, and <code>bitangent</code> vertex attributes.
  34156. */
  34157. const ALL: MaterialAppearance.MaterialSupportType;
  34158. }
  34159. }
  34160. /**
  34161. * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
  34162. * <p>
  34163. * Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
  34164. * In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable
  34165. * with {@link Model#getNode}. glTF cameras and lights are not currently supported.
  34166. * </p>
  34167. * <p>
  34168. * An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be
  34169. * created at runtime and passed to this constructor function. In either case, the
  34170. * {@link Model#readyPromise} is resolved when the model is ready to render, i.e.,
  34171. * when the external binary, image, and shader files are downloaded and the WebGL
  34172. * resources are created.
  34173. * </p>
  34174. * <p>
  34175. * Cesium supports glTF assets with the following extensions:
  34176. * <ul>
  34177. * <li>
  34178. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  34179. * </li><li>
  34180. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  34181. * </li><li>
  34182. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  34183. * </li><li>
  34184. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  34185. * </li><li>
  34186. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  34187. * </li><li>
  34188. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  34189. * </li><li>
  34190. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  34191. * </li><li>
  34192. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  34193. * </li><li>
  34194. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  34195. * </li><li>
  34196. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  34197. * </li><li>
  34198. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu|KHR_texture_basisu}
  34199. * </li>
  34200. * </ul>
  34201. * </p>
  34202. * <p>
  34203. * Note: for models with compressed textures using the KHR_texture_basisu extension, we recommend power of 2 textures in both dimensions
  34204. * 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})
  34205. * 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}).
  34206. * </p>
  34207. * <p>
  34208. * 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
  34209. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  34210. * relative to a local origin.
  34211. * </p>
  34212. * @param [options] - Object with the following properties:
  34213. * @param [options.gltf] - A glTF JSON object, or a binary glTF buffer.
  34214. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
  34215. * @param [options.show = true] - Determines if the model primitive will be shown.
  34216. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  34217. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  34218. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  34219. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  34220. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  34221. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  34222. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  34223. * @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.
  34224. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  34225. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  34226. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  34227. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  34228. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  34229. * @param [options.scene] - Must be passed in for models that use the height reference property.
  34230. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  34231. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  34232. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  34233. * @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.
  34234. * @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.
  34235. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  34236. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  34237. * @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. Deprecated in CesiumJS 1.94, will be removed in CesiumJS 1.95.
  34238. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  34239. * @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model.
  34240. * @param [options.credit] - A credit for the data source, which is displayed on the canvas.
  34241. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  34242. * @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.
  34243. * @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.
  34244. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this model.
  34245. */
  34246. export class Model {
  34247. constructor(options?: {
  34248. gltf?: any | ArrayBuffer | Uint8Array;
  34249. basePath?: Resource | string;
  34250. show?: boolean;
  34251. modelMatrix?: Matrix4;
  34252. scale?: number;
  34253. minimumPixelSize?: number;
  34254. maximumScale?: number;
  34255. id?: any;
  34256. allowPicking?: boolean;
  34257. incrementallyLoadTextures?: boolean;
  34258. asynchronous?: boolean;
  34259. clampAnimations?: boolean;
  34260. shadows?: ShadowMode;
  34261. debugShowBoundingVolume?: boolean;
  34262. debugWireframe?: boolean;
  34263. heightReference?: HeightReference;
  34264. scene?: Scene;
  34265. distanceDisplayCondition?: DistanceDisplayCondition;
  34266. color?: Color;
  34267. colorBlendMode?: ColorBlendMode;
  34268. colorBlendAmount?: number;
  34269. silhouetteColor?: Color;
  34270. silhouetteSize?: number;
  34271. clippingPlanes?: ClippingPlaneCollection;
  34272. dequantizeInShader?: boolean;
  34273. lightColor?: Cartesian3;
  34274. imageBasedLighting?: ImageBasedLighting;
  34275. credit?: Credit | string;
  34276. showCreditsOnScreen?: boolean;
  34277. backFaceCulling?: boolean;
  34278. showOutline?: boolean;
  34279. splitDirection?: SplitDirection;
  34280. });
  34281. /**
  34282. * Determines if the model primitive will be shown.
  34283. */
  34284. show: boolean;
  34285. /**
  34286. * The silhouette color.
  34287. */
  34288. silhouetteColor: Color;
  34289. /**
  34290. * The size of the silhouette in pixels.
  34291. */
  34292. silhouetteSize: number;
  34293. /**
  34294. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  34295. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  34296. * Local reference frames can be used by providing a different transformation matrix, like that returned
  34297. * by {@link Transforms.eastNorthUpToFixedFrame}.
  34298. * @example
  34299. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  34300. * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  34301. */
  34302. modelMatrix: Matrix4;
  34303. /**
  34304. * A uniform scale applied to this model before the {@link Model#modelMatrix}.
  34305. * Values greater than <code>1.0</code> increase the size of the model; values
  34306. * less than <code>1.0</code> decrease.
  34307. */
  34308. scale: number;
  34309. /**
  34310. * The approximate minimum pixel size of the model regardless of zoom.
  34311. * This can be used to ensure that a model is visible even when the viewer
  34312. * zooms out. When <code>0.0</code>, no minimum size is enforced.
  34313. */
  34314. minimumPixelSize: number;
  34315. /**
  34316. * The maximum scale size for a model. This can be used to give
  34317. * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
  34318. * is never an unreasonable scale.
  34319. */
  34320. maximumScale: number;
  34321. /**
  34322. * User-defined object returned when the model is picked.
  34323. */
  34324. id: any;
  34325. /**
  34326. * Returns the height reference of the model
  34327. */
  34328. heightReference: HeightReference;
  34329. /**
  34330. * The currently playing glTF animations.
  34331. */
  34332. activeAnimations: ModelAnimationCollection;
  34333. /**
  34334. * Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  34335. */
  34336. clampAnimations: boolean;
  34337. /**
  34338. * Determines whether the model casts or receives shadows from light sources.
  34339. */
  34340. shadows: ShadowMode;
  34341. /**
  34342. * A color that blends with the model's rendered color.
  34343. */
  34344. color: Color;
  34345. /**
  34346. * Defines how the color blends with the model.
  34347. */
  34348. colorBlendMode: ColorBlendMode;
  34349. /**
  34350. * Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>.
  34351. * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
  34352. * any value in-between resulting in a mix of the two.
  34353. */
  34354. colorBlendAmount: number;
  34355. /**
  34356. * Whether to cull back-facing geometry. When true, back face culling is
  34357. * determined by the material's doubleSided property; when false, back face
  34358. * culling is disabled. Back faces are not culled if {@link Model#color} is
  34359. * translucent or {@link Model#silhouetteSize} is greater than 0.0.
  34360. */
  34361. backFaceCulling: boolean;
  34362. /**
  34363. * Whether to display the outline for models using the
  34364. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension.
  34365. * When true, outlines are displayed. When false, outlines are not displayed.
  34366. */
  34367. readonly showOutline: boolean;
  34368. /**
  34369. * The {@link SplitDirection} to apply to this model.
  34370. */
  34371. splitDirection: SplitDirection;
  34372. /**
  34373. * This property is for debugging only; it is not for production use nor is it optimized.
  34374. * <p>
  34375. * Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds
  34376. * to one draw command. A glTF mesh has an array of primitives, often of length one.
  34377. * </p>
  34378. */
  34379. debugShowBoundingVolume: boolean;
  34380. /**
  34381. * This property is for debugging only; it is not for production use nor is it optimized.
  34382. * <p>
  34383. * Draws the model in wireframe.
  34384. * </p>
  34385. */
  34386. debugWireframe: boolean;
  34387. /**
  34388. * The object for the glTF JSON, including properties with default values omitted
  34389. * from the JSON provided to this model.
  34390. */
  34391. readonly gltf: any;
  34392. /**
  34393. * The base path that paths in the glTF JSON are relative to. The base
  34394. * path is the same path as the path containing the .gltf file
  34395. * minus the .gltf file, when binary, image, and shader files are
  34396. * in the same directory as the .gltf. When this is <code>''</code>,
  34397. * the app's base path is used.
  34398. */
  34399. readonly basePath: string;
  34400. /**
  34401. * The model's bounding sphere in its local coordinate system. This does not take into
  34402. * account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}.
  34403. * @example
  34404. * // Center in WGS84 coordinates
  34405. * const center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
  34406. */
  34407. readonly boundingSphere: BoundingSphere;
  34408. /**
  34409. * When <code>true</code>, this model is ready to render, i.e., the external binary, image,
  34410. * and shader files were downloaded and the WebGL resources were created. This is set to
  34411. * <code>true</code> right before {@link Model#readyPromise} is resolved.
  34412. */
  34413. readonly ready: boolean;
  34414. /**
  34415. * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image,
  34416. * and shader files were downloaded and the WebGL resources were created.
  34417. * <p>
  34418. * This promise is resolved at the end of the frame before the first frame the model is rendered in.
  34419. * </p>
  34420. * @example
  34421. * // Play all animations at half-speed when the model is ready to render
  34422. * Promise.resolve(model.readyPromise).then(function(model) {
  34423. * model.activeAnimations.addAll({
  34424. * multiplier : 0.5
  34425. * });
  34426. * }).catch(function(error){
  34427. * window.alert(error);
  34428. * });
  34429. */
  34430. readonly readyPromise: Promise<Model>;
  34431. /**
  34432. * Determines if model WebGL resource creation will be spread out over several frames or
  34433. * block until completion once all glTF files are loaded.
  34434. */
  34435. readonly asynchronous: boolean;
  34436. /**
  34437. * When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
  34438. */
  34439. readonly allowPicking: boolean;
  34440. /**
  34441. * Determine if textures may continue to stream in after the model is loaded.
  34442. */
  34443. readonly incrementallyLoadTextures: boolean;
  34444. /**
  34445. * Return the number of pending texture loads.
  34446. */
  34447. readonly pendingTextureLoads: number;
  34448. /**
  34449. * Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
  34450. */
  34451. distanceDisplayCondition: DistanceDisplayCondition;
  34452. /**
  34453. * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  34454. */
  34455. clippingPlanes: ClippingPlaneCollection;
  34456. /**
  34457. * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  34458. * <p>
  34459. * For example, disabling additional light sources by setting
  34460. * <code>model.imageBasedLighting.imageBasedLightingFactor = new Cesium.Cartesian2(0.0, 0.0)</code>
  34461. * will make the model much darker. Here, increasing the intensity of the light source will make the model brighter.
  34462. * </p>
  34463. */
  34464. lightColor: Cartesian3;
  34465. /**
  34466. * The properties for managing image-based lighting on this model.
  34467. */
  34468. imageBasedLighting: ImageBasedLighting;
  34469. /**
  34470. * Gets the credit that will be displayed for the model
  34471. */
  34472. credit: Credit;
  34473. /**
  34474. * Gets or sets whether the credits of the model will be displayed on the screen
  34475. */
  34476. showCreditsOnScreen: boolean;
  34477. /**
  34478. * Determines if silhouettes are supported.
  34479. * @param scene - The scene.
  34480. * @returns <code>true</code> if silhouettes are supported; otherwise, returns <code>false</code>
  34481. */
  34482. static silhouetteSupported(scene: Scene): boolean;
  34483. /**
  34484. * <p>
  34485. * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
  34486. * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
  34487. * </p>
  34488. * <p>
  34489. * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
  34490. * </p>
  34491. * <p>
  34492. * Cesium supports glTF assets with the following extensions:
  34493. * <ul>
  34494. * <li>
  34495. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_binary_glTF/README.md|KHR_binary_glTF (glTF 1.0)}
  34496. * </li><li>
  34497. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Khronos/KHR_materials_common/README.md|KHR_materials_common (glTF 1.0)}
  34498. * </li><li>
  34499. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/1.0/Vendor/WEB3D_quantized_attributes/README.md|WEB3D_quantized_attributes (glTF 1.0)}
  34500. * </li><li>
  34501. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations/README.md|AGI_articulations}
  34502. * </li><li>
  34503. * {@link https://github.com/KhronosGroup/glTF/pull/1302|KHR_blend (draft)}
  34504. * </li><li>
  34505. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md|KHR_draco_mesh_compression}
  34506. * </li><li>
  34507. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/README.md|KHR_materials_pbrSpecularGlossiness}
  34508. * </li><li>
  34509. * {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit/README.md|KHR_materials_unlit}
  34510. * </li><li>
  34511. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_techniques_webgl/README.md|KHR_techniques_webgl}
  34512. * </li><li>
  34513. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md|KHR_texture_transform}
  34514. * </li><li>
  34515. * {@link https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_basisu/README.md|KHR_texture_basisu}
  34516. * </li>
  34517. * </ul>
  34518. * </p>
  34519. * <p>
  34520. * 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
  34521. * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
  34522. * relative to a local origin.
  34523. * </p>
  34524. * @example
  34525. * // Example 1. Create a model from a glTF asset
  34526. * const model = scene.primitives.add(Cesium.Model.fromGltf({
  34527. * url : './duck/duck.gltf'
  34528. * }));
  34529. * @example
  34530. * // Example 2. Create model and provide all properties and events
  34531. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  34532. * const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  34533. *
  34534. * const model = scene.primitives.add(Cesium.Model.fromGltf({
  34535. * url : './duck/duck.gltf',
  34536. * show : true, // default
  34537. * modelMatrix : modelMatrix,
  34538. * scale : 2.0, // double size
  34539. * minimumPixelSize : 128, // never smaller than 128 pixels
  34540. * maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
  34541. * allowPicking : false, // not pickable
  34542. * debugShowBoundingVolume : false, // default
  34543. * debugWireframe : false
  34544. * }));
  34545. *
  34546. * model.readyPromise.then(function(model) {
  34547. * // Play all animations when the model is ready to render
  34548. * model.activeAnimations.addAll();
  34549. * });
  34550. * @param options - Object with the following properties:
  34551. * @param options.url - The url to the .gltf file.
  34552. * @param [options.basePath] - The base path that paths in the glTF JSON are relative to.
  34553. * @param [options.show = true] - Determines if the model primitive will be shown.
  34554. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  34555. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  34556. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  34557. * @param [options.maximumScale] - The maximum scale for the model.
  34558. * @param [options.id] - A user-defined object to return when the model is picked with {@link Scene#pick}.
  34559. * @param [options.allowPicking = true] - When <code>true</code>, each glTF mesh and primitive is pickable with {@link Scene#pick}.
  34560. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  34561. * @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.
  34562. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  34563. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  34564. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  34565. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe.
  34566. * @param [options.heightReference = HeightReference.NONE] - Determines how the model is drawn relative to terrain.
  34567. * @param [options.scene] - Must be passed in for models that use the height reference property.
  34568. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this model will be displayed.
  34569. * @param [options.color = Color.WHITE] - A color that blends with the model's rendered color.
  34570. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  34571. * @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.
  34572. * @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.
  34573. * @param [options.silhouetteSize = 0.0] - The size of the silhouette in pixels.
  34574. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  34575. * @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. Deprecated in CesiumJS 1.94, will be removed in CesiumJS 1.95.
  34576. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  34577. * @param [options.imageBasedLighting] - The properties for managing image-based lighting for this tileset.
  34578. * @param [options.credit] - A credit for the model, which is displayed on the canvas.
  34579. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  34580. * @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.
  34581. * @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.
  34582. * @returns The newly created model.
  34583. */
  34584. static fromGltf(options: {
  34585. url: Resource | string;
  34586. basePath?: Resource | string;
  34587. show?: boolean;
  34588. modelMatrix?: Matrix4;
  34589. scale?: number;
  34590. minimumPixelSize?: number;
  34591. maximumScale?: number;
  34592. id?: any;
  34593. allowPicking?: boolean;
  34594. incrementallyLoadTextures?: boolean;
  34595. asynchronous?: boolean;
  34596. clampAnimations?: boolean;
  34597. shadows?: ShadowMode;
  34598. debugShowBoundingVolume?: boolean;
  34599. debugWireframe?: boolean;
  34600. heightReference?: HeightReference;
  34601. scene?: Scene;
  34602. distanceDisplayCondition?: DistanceDisplayCondition;
  34603. color?: Color;
  34604. colorBlendMode?: ColorBlendMode;
  34605. colorBlendAmount?: number;
  34606. silhouetteColor?: Color;
  34607. silhouetteSize?: number;
  34608. clippingPlanes?: ClippingPlaneCollection;
  34609. dequantizeInShader?: boolean;
  34610. lightColor?: Cartesian3;
  34611. imageBasedLighting?: ImageBasedLighting;
  34612. credit?: Credit | string;
  34613. showCreditsOnScreen?: boolean;
  34614. backFaceCulling?: boolean;
  34615. showOutline?: boolean;
  34616. }): Model;
  34617. /**
  34618. * Returns the glTF node with the given <code>name</code> property. This is used to
  34619. * modify a node's transform for animation outside of glTF animations.
  34620. * @example
  34621. * // Apply non-uniform scale to node LOD3sp
  34622. * const node = model.getNode('LOD3sp');
  34623. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  34624. * @param name - The glTF name of the node.
  34625. * @returns The node or <code>undefined</code> if no node with <code>name</code> exists.
  34626. */
  34627. getNode(name: string): ModelNode;
  34628. /**
  34629. * Returns the glTF mesh with the given <code>name</code> property.
  34630. * @param name - The glTF name of the mesh.
  34631. * @returns The mesh or <code>undefined</code> if no mesh with <code>name</code> exists.
  34632. */
  34633. getMesh(name: string): ModelMesh;
  34634. /**
  34635. * Returns the glTF material with the given <code>name</code> property.
  34636. * @param name - The glTF name of the material.
  34637. * @returns The material or <code>undefined</code> if no material with <code>name</code> exists.
  34638. */
  34639. getMaterial(name: string): ModelMaterial;
  34640. /**
  34641. * Sets the current value of an articulation stage. After setting one or multiple stage values, call
  34642. * Model.applyArticulations() to cause the node matrices to be recalculated.
  34643. * @param articulationStageKey - The name of the articulation, a space, and the name of the stage.
  34644. * @param value - The numeric value of this stage of the articulation.
  34645. */
  34646. setArticulationStage(articulationStageKey: string, value: number): void;
  34647. /**
  34648. * Applies any modified articulation stages to the matrix of each node that participates
  34649. * in any articulation. Note that this will overwrite any nodeTransformations on participating nodes.
  34650. */
  34651. applyArticulations(): void;
  34652. /**
  34653. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  34654. * get the draw commands needed to render this primitive.
  34655. * <p>
  34656. * Do not call this function directly. This is documented just to
  34657. * list the exceptions that may be propagated when the scene is rendered:
  34658. * </p>
  34659. */
  34660. update(): void;
  34661. /**
  34662. * Returns true if this object was destroyed; otherwise, false.
  34663. * <br /><br />
  34664. * If this object was destroyed, it should not be used; calling any function other than
  34665. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  34666. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  34667. */
  34668. isDestroyed(): boolean;
  34669. /**
  34670. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  34671. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  34672. * <br /><br />
  34673. * Once an object is destroyed, it should not be used; calling any function other than
  34674. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  34675. * assign the return value (<code>undefined</code>) to the object as done in the example.
  34676. * @example
  34677. * model = model && model.destroy();
  34678. */
  34679. destroy(): void;
  34680. }
  34681. /**
  34682. * An active glTF animation. A glTF asset can contain animations. An active animation
  34683. * is an animation that is currently playing or scheduled to be played because it was
  34684. * added to a model's {@link ModelAnimationCollection}. An active animation is an
  34685. * instance of an animation; for example, there can be multiple active animations
  34686. * for the same glTF animation, each with a different start time.
  34687. * <p>
  34688. * Create this by calling {@link ModelAnimationCollection#add}.
  34689. * </p>
  34690. */
  34691. export class ModelAnimation {
  34692. constructor();
  34693. /**
  34694. * When <code>true</code>, the animation is removed after it stops playing.
  34695. * This is slightly more efficient that not removing it, but if, for example,
  34696. * time is reversed, the animation is not played again.
  34697. */
  34698. removeOnStop: boolean;
  34699. /**
  34700. * The event fired when this animation is started. This can be used, for
  34701. * example, to play a sound or start a particle system, when the animation starts.
  34702. * <p>
  34703. * This event is fired at the end of the frame after the scene is rendered.
  34704. * </p>
  34705. * @example
  34706. * animation.start.addEventListener(function(model, animation) {
  34707. * console.log('Animation started: ' + animation.name);
  34708. * });
  34709. */
  34710. start: Event;
  34711. /**
  34712. * The event fired when on each frame when this animation is updated. The
  34713. * current time of the animation, relative to the glTF animation time span, is
  34714. * passed to the event, which allows, for example, starting new animations at a
  34715. * specific time relative to a playing animation.
  34716. * <p>
  34717. * This event is fired at the end of the frame after the scene is rendered.
  34718. * </p>
  34719. * @example
  34720. * animation.update.addEventListener(function(model, animation, time) {
  34721. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  34722. * });
  34723. */
  34724. update: Event;
  34725. /**
  34726. * The event fired when this animation is stopped. This can be used, for
  34727. * example, to play a sound or start a particle system, when the animation stops.
  34728. * <p>
  34729. * This event is fired at the end of the frame after the scene is rendered.
  34730. * </p>
  34731. * @example
  34732. * animation.stop.addEventListener(function(model, animation) {
  34733. * console.log('Animation stopped: ' + animation.name);
  34734. * });
  34735. */
  34736. stop: Event;
  34737. /**
  34738. * The glTF animation name that identifies this animation.
  34739. */
  34740. readonly name: string;
  34741. /**
  34742. * The scene time to start playing this animation. When this is <code>undefined</code>,
  34743. * the animation starts at the next frame.
  34744. */
  34745. readonly startTime: JulianDate;
  34746. /**
  34747. * The delay, in seconds, from {@link ModelAnimation#startTime} to start playing.
  34748. */
  34749. readonly delay: number;
  34750. /**
  34751. * The scene time to stop playing this animation. When this is <code>undefined</code>,
  34752. * the animation is played for its full duration and perhaps repeated depending on
  34753. * {@link ModelAnimation#loop}.
  34754. */
  34755. readonly stopTime: JulianDate;
  34756. /**
  34757. * Values greater than <code>1.0</code> increase the speed that the animation is played relative
  34758. * to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of
  34759. * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene
  34760. * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation
  34761. * will play in one second even if <code>multiplier</code> is <code>1.0</code>.
  34762. */
  34763. readonly multiplier: number;
  34764. /**
  34765. * When <code>true</code>, the animation is played in reverse.
  34766. */
  34767. readonly reverse: boolean;
  34768. /**
  34769. * Determines if and how the animation is looped.
  34770. */
  34771. readonly loop: ModelAnimationLoop;
  34772. /**
  34773. * If this is defined, it will be used to compute the local animation time
  34774. * instead of the scene's time.
  34775. */
  34776. animationTime: ModelAnimation.AnimationTimeCallback;
  34777. }
  34778. export namespace ModelAnimation {
  34779. /**
  34780. * A function used to compute the local animation time for a ModelAnimation.
  34781. * @example
  34782. * // Use real time for model animation (assuming animateWhilePaused was set to true)
  34783. * function animationTime(duration) {
  34784. * return Date.now() / 1000 / duration;
  34785. * }
  34786. * @example
  34787. * // Offset the phase of the animation, so it starts halfway through its cycle.
  34788. * function animationTime(duration, seconds) {
  34789. * return seconds / duration + 0.5;
  34790. * }
  34791. * @param duration - The animation's original duration in seconds.
  34792. * @param seconds - The seconds since the animation started, in scene time.
  34793. */
  34794. type AnimationTimeCallback = (duration: number, seconds: number) => number;
  34795. }
  34796. /**
  34797. * A collection of active model animations. Access this using {@link Model#activeAnimations}.
  34798. */
  34799. export class ModelAnimationCollection {
  34800. constructor();
  34801. /**
  34802. * The event fired when an animation is added to the collection. This can be used, for
  34803. * example, to keep a UI in sync.
  34804. * @example
  34805. * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  34806. * console.log('Animation added: ' + animation.name);
  34807. * });
  34808. */
  34809. animationAdded: Event;
  34810. /**
  34811. * The event fired when an animation is removed from the collection. This can be used, for
  34812. * example, to keep a UI in sync.
  34813. * @example
  34814. * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  34815. * console.log('Animation removed: ' + animation.name);
  34816. * });
  34817. */
  34818. animationRemoved: Event;
  34819. /**
  34820. * When true, the animation will play even when the scene time is paused. However,
  34821. * whether animation takes place will depend on the animationTime functions assigned
  34822. * to the model's animations. By default, this is based on scene time, so models using
  34823. * the default will not animate regardless of this setting.
  34824. */
  34825. animateWhilePaused: boolean;
  34826. /**
  34827. * The number of animations in the collection.
  34828. */
  34829. readonly length: number;
  34830. /**
  34831. * Creates and adds an animation with the specified initial properties to the collection.
  34832. * <p>
  34833. * This raises the {@link ModelAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.
  34834. * </p>
  34835. * @example
  34836. * // Example 1. Add an animation by name
  34837. * model.activeAnimations.add({
  34838. * name : 'animation name'
  34839. * });
  34840. *
  34841. * // Example 2. Add an animation by index
  34842. * model.activeAnimations.add({
  34843. * index : 0
  34844. * });
  34845. * @example
  34846. * // Example 3. Add an animation and provide all properties and events
  34847. * const startTime = Cesium.JulianDate.now();
  34848. *
  34849. * const animation = model.activeAnimations.add({
  34850. * name : 'another animation name',
  34851. * startTime : startTime,
  34852. * delay : 0.0, // Play at startTime (default)
  34853. * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),
  34854. * removeOnStop : false, // Do not remove when animation stops (default)
  34855. * multiplier : 2.0, // Play at double speed
  34856. * reverse : true, // Play in reverse
  34857. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation
  34858. * });
  34859. *
  34860. * animation.start.addEventListener(function(model, animation) {
  34861. * console.log('Animation started: ' + animation.name);
  34862. * });
  34863. * animation.update.addEventListener(function(model, animation, time) {
  34864. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  34865. * });
  34866. * animation.stop.addEventListener(function(model, animation) {
  34867. * console.log('Animation stopped: ' + animation.name);
  34868. * });
  34869. * @param options - Object with the following properties:
  34870. * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.
  34871. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.
  34872. * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.
  34873. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  34874. * @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.
  34875. * @param [options.removeOnStop = false] - When <code>true</code>, the animation is removed after it stops playing.
  34876. * @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.
  34877. * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse.
  34878. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped.
  34879. * @param [options.animationTime] - If defined, computes the local animation time for this animation.
  34880. * @returns The animation that was added to the collection.
  34881. */
  34882. add(options: {
  34883. name?: string;
  34884. index?: number;
  34885. startTime?: JulianDate;
  34886. delay?: number;
  34887. stopTime?: JulianDate;
  34888. removeOnStop?: boolean;
  34889. multiplier?: number;
  34890. reverse?: boolean;
  34891. loop?: ModelAnimationLoop;
  34892. animationTime?: ModelAnimation.AnimationTimeCallback;
  34893. }): ModelAnimation;
  34894. /**
  34895. * Creates and adds an animation with the specified initial properties to the collection
  34896. * for each animation in the model.
  34897. * <p>
  34898. * This raises the {@link ModelAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.
  34899. * </p>
  34900. * @example
  34901. * model.activeAnimations.addAll({
  34902. * multiplier : 0.5, // Play at half-speed
  34903. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations
  34904. * });
  34905. * @param [options] - Object with the following properties:
  34906. * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.
  34907. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing.
  34908. * @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.
  34909. * @param [options.removeOnStop = false] - When <code>true</code>, the animations are removed after they stop playing.
  34910. * @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.
  34911. * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse.
  34912. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped.
  34913. * @param [options.animationTime] - If defined, computes the local animation time for all of the animations.
  34914. * @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.
  34915. */
  34916. addAll(options?: {
  34917. startTime?: JulianDate;
  34918. delay?: number;
  34919. stopTime?: JulianDate;
  34920. removeOnStop?: boolean;
  34921. multiplier?: number;
  34922. reverse?: boolean;
  34923. loop?: ModelAnimationLoop;
  34924. animationTime?: ModelAnimation.AnimationTimeCallback;
  34925. }): ModelAnimation[];
  34926. /**
  34927. * Removes an animation from the collection.
  34928. * <p>
  34929. * This raises the {@link ModelAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.
  34930. * </p>
  34931. * <p>
  34932. * An animation can also be implicitly removed from the collection by setting {@link ModelAnimation#removeOnStop} to
  34933. * <code>true</code>. The {@link ModelAnimationCollection#animationRemoved} event is still fired when the animation is removed.
  34934. * </p>
  34935. * @example
  34936. * const a = model.activeAnimations.add({
  34937. * name : 'animation name'
  34938. * });
  34939. * model.activeAnimations.remove(a); // Returns true
  34940. * @param animation - The animation to remove.
  34941. * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.
  34942. */
  34943. remove(animation: ModelAnimation): boolean;
  34944. /**
  34945. * Removes all animations from the collection.
  34946. * <p>
  34947. * This raises the {@link ModelAnimationCollection#animationRemoved} event for each
  34948. * animation so, for example, a UI can stay in sync.
  34949. * </p>
  34950. */
  34951. removeAll(): void;
  34952. /**
  34953. * Determines whether this collection contains a given animation.
  34954. * @param animation - The animation to check for.
  34955. * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise.
  34956. */
  34957. contains(animation: ModelAnimation): boolean;
  34958. /**
  34959. * Returns the animation in the collection at the specified index. Indices are zero-based
  34960. * and increase as animations are added. Removing an animation shifts all animations after
  34961. * it to the left, changing their indices. This function is commonly used to iterate over
  34962. * all the animations in the collection.
  34963. * @example
  34964. * // Output the names of all the animations in the collection.
  34965. * const animations = model.activeAnimations;
  34966. * const length = animations.length;
  34967. * for (let i = 0; i < length; ++i) {
  34968. * console.log(animations.get(i).name);
  34969. * }
  34970. * @param index - The zero-based index of the animation.
  34971. * @returns The animation at the specified index.
  34972. */
  34973. get(index: number): ModelAnimation;
  34974. }
  34975. /**
  34976. * Determines if and how a glTF animation is looped.
  34977. */
  34978. export enum ModelAnimationLoop {
  34979. /**
  34980. * Play the animation once; do not loop it.
  34981. */
  34982. NONE = 0,
  34983. /**
  34984. * Loop the animation playing it from the start immediately after it stops.
  34985. */
  34986. REPEAT = 1,
  34987. /**
  34988. * Loop the animation. First, playing it forward, then in reverse, then forward, and so on.
  34989. */
  34990. MIRRORED_REPEAT = 2
  34991. }
  34992. /**
  34993. * An object describing a uniform, its type, and an initial value
  34994. * @property type - The Glsl type of the uniform.
  34995. * @property value - The initial value of the uniform
  34996. */
  34997. export type UniformSpecifier = {
  34998. type: UniformType;
  34999. value: boolean | number | Cartesian2 | Cartesian3 | Cartesian4 | Matrix2 | Matrix3 | Matrix4 | TextureUniform;
  35000. };
  35001. /**
  35002. * A user defined GLSL shader used with {@link ModelExperimental} as well
  35003. * as {@link Cesium3DTileset}.
  35004. * <p>
  35005. * If texture uniforms are used, additional resource management must be done:
  35006. * </p>
  35007. * <ul>
  35008. * <li>
  35009. * The <code>update</code> function must be called each frame. When a
  35010. * custom shader is passed to a {@link ModelExperimental} or a
  35011. * {@link Cesium3DTileset}, this step is handled automaticaly
  35012. * </li>
  35013. * <li>
  35014. * {@link CustomShader#destroy} must be called when the custom shader is
  35015. * no longer needed to clean up GPU resources properly. The application
  35016. * is responsible for calling this method.
  35017. * </li>
  35018. * </ul>
  35019. * <p>
  35020. * To enable the use of {@link ModelExperimental} in {@link Cesium3DTileset}, set {@link ExperimentalFeatures.enableModelExperimental} to <code>true</code> or tileset.enableModelExperimental to <code>true</code>.
  35021. * </p>
  35022. * <p>
  35023. * See the {@link https://github.com/CesiumGS/cesium/tree/main/Documentation/CustomShaderGuide|Custom Shader Guide} for more detailed documentation.
  35024. * </p>
  35025. * @example
  35026. * const customShader = new CustomShader({
  35027. * uniforms: {
  35028. * u_colorIndex: {
  35029. * type: Cesium.UniformType.FLOAT,
  35030. * value: 1.0
  35031. * },
  35032. * u_normalMap: {
  35033. * type: Cesium.UniformType.SAMPLER_2D,
  35034. * value: new Cesium.TextureUniform({
  35035. * url: "http://example.com/normal.png"
  35036. * })
  35037. * }
  35038. * },
  35039. * varyings: {
  35040. * v_selectedColor: Cesium.VaryingType.VEC3
  35041. * },
  35042. * vertexShaderText: `
  35043. * void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
  35044. * v_selectedColor = mix(vsInput.attributes.color_0, vsInput.attributes.color_1, u_colorIndex);
  35045. * vsOutput.positionMC += 0.1 * vsInput.attributes.normal;
  35046. * }
  35047. * `,
  35048. * fragmentShaderText: `
  35049. * void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
  35050. * material.normal = texture2D(u_normalMap, fsInput.attributes.texCoord_0);
  35051. * material.diffuse = v_selectedColor;
  35052. * }
  35053. * `
  35054. * });
  35055. * @param options - An object with the following options
  35056. * @param [options.mode = CustomShaderMode.MODIFY_MATERIAL] - The custom shader mode, which determines how the custom shader code is inserted into the fragment shader.
  35057. * @param [options.lightingModel] - The lighting model (e.g. PBR or unlit). If present, this overrides the default lighting for the model.
  35058. * @param [options.isTranslucent = false] - If set, the model will be rendered as translucent. This overrides the default settings for the model.
  35059. * @param [options.uniforms] - A dictionary for user-defined uniforms. The key is the uniform name that will appear in the GLSL code. The value is an object that describes the uniform type and initial value
  35060. * @param [options.varyings] - A dictionary for declaring additional GLSL varyings used in the shader. The key is the varying name that will appear in the GLSL code. The value is the data type of the varying. For each varying, the declaration will be added to the top of the shader automatically. The caller is responsible for assigning a value in the vertex shader and using the value in the fragment shader.
  35061. * @param [options.vertexShaderText] - The custom vertex shader as a string of GLSL code. It must include a GLSL function called vertexMain. See the example for the expected signature. If not specified, the custom vertex shader step will be skipped in the computed vertex shader.
  35062. * @param [options.fragmentShaderText] - The custom fragment shader as a string of GLSL code. It must include a GLSL function called fragmentMain. See the example for the expected signature. If not specified, the custom fragment shader step will be skipped in the computed fragment shader.
  35063. */
  35064. export class CustomShader {
  35065. constructor(options: {
  35066. mode?: CustomShaderMode;
  35067. lightingModel?: LightingModel;
  35068. isTranslucent?: boolean;
  35069. uniforms?: {
  35070. [key: string]: UniformSpecifier;
  35071. };
  35072. varyings?: {
  35073. [key: string]: VaryingType;
  35074. };
  35075. vertexShaderText?: string;
  35076. fragmentShaderText?: string;
  35077. });
  35078. /**
  35079. * Update the value of a uniform declared in the shader
  35080. * @param uniformName - The GLSL name of the uniform. This must match one of the uniforms declared in the constructor
  35081. * @param value - The new value of the uniform.
  35082. */
  35083. setUniform(uniformName: string, value: boolean | number | Cartesian2 | Cartesian3 | Cartesian4 | Matrix2 | Matrix3 | Matrix4 | string | Resource): void;
  35084. }
  35085. /**
  35086. * A value determining how the custom shader interacts with the overall
  35087. * fragment shader. This is used by {@link CustomShaderPipelineStage}
  35088. */
  35089. export const mode: CustomShaderMode;
  35090. /**
  35091. * The lighting model to use when using the custom shader.
  35092. * This is used by {@link CustomShaderPipelineStage}
  35093. */
  35094. export const lightingModel: LightingModel;
  35095. /**
  35096. * Additional uniforms as declared by the user.
  35097. */
  35098. export const uniforms: {
  35099. [key: string]: UniformSpecifier;
  35100. };
  35101. /**
  35102. * Additional varyings as declared by the user.
  35103. * This is used by {@link CustomShaderPipelineStage}
  35104. */
  35105. export const varyings: {
  35106. [key: string]: VaryingType;
  35107. };
  35108. /**
  35109. * The user-defined GLSL code for the vertex shader
  35110. */
  35111. export const vertexShaderText: string;
  35112. /**
  35113. * The user-defined GLSL code for the fragment shader
  35114. */
  35115. export const fragmentShaderText: string;
  35116. /**
  35117. * Whether the shader should be rendered as translucent
  35118. */
  35119. export const isTranslucent: boolean;
  35120. /**
  35121. * An enum describing how the {@link CustomShader} will be added to the
  35122. * fragment shader. This determines how the shader interacts with the material.
  35123. */
  35124. export enum CustomShaderMode {
  35125. /**
  35126. * The custom shader will be used to modify the results of the material stage
  35127. * before lighting is applied.
  35128. */
  35129. MODIFY_MATERIAL = "MODIFY_MATERIAL",
  35130. /**
  35131. * The custom shader will be used instead of the material stage. This is a hint
  35132. * to optimize out the material processing code.
  35133. */
  35134. REPLACE_MATERIAL = "REPLACE_MATERIAL"
  35135. }
  35136. /**
  35137. * The lighting model to use for lighting a {@link ModelExperimental}.
  35138. */
  35139. export enum LightingModel {
  35140. /**
  35141. * Use unlit shading, i.e. skip lighting calculations. The model's
  35142. * diffuse color (assumed to be linear RGB, not sRGB) is used directly
  35143. * when computing <code>gl_FragColor</code>. The alpha mode is still
  35144. * applied.
  35145. */
  35146. UNLIT = 0,
  35147. /**
  35148. * Use physically-based rendering lighting calculations. This includes
  35149. * both PBR metallic roughness and PBR specular glossiness. Image-based
  35150. * lighting is also applied when possible.
  35151. */
  35152. PBR = 1
  35153. }
  35154. /**
  35155. * A 3D model. This is a new architecture that is more decoupled than the older {@link Model}. This class is still experimental.
  35156. * <p>
  35157. * Do not call this function directly, instead use the `from` functions to create
  35158. * the Model from your source data type.
  35159. * </p>
  35160. * @param options - Object with the following properties:
  35161. * @param options.resource - The Resource to the 3D model.
  35162. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  35163. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  35164. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  35165. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  35166. * @param [options.clampAnimations = true] - Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  35167. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  35168. * @param [options.enableDebugWireframe = false] - For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded.
  35169. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true.
  35170. * @param [options.cull = true] - Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used.
  35171. * @param [options.opaquePass = Pass.OPAQUE] - The pass to use in the {@link DrawCommand} for the opaque portions of the model.
  35172. * @param [options.allowPicking = true] - When <code>true</code>, each primitive is pickable with {@link Scene#pick}.
  35173. * @param [options.customShader] - A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior.
  35174. * @param [options.content] - The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset.
  35175. * @param [options.show = true] - Whether or not to render the model.
  35176. * @param [options.color] - A color that blends with the model's rendered color.
  35177. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  35178. * @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.
  35179. * @param [options.featureIdLabel = "featureId_0"] - Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
  35180. * @param [options.instanceFeatureIdLabel = "instanceFeatureId_0"] - Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
  35181. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
  35182. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  35183. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  35184. * @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model.
  35185. * @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 the model's color is translucent.
  35186. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  35187. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  35188. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this model.
  35189. * @param [options.projectTo2D = false] - Whether to accurately project the model's positions in 2D. If a model is part of a 3D Tiles tileset, this will always be true. If this is false, the model will show up in 2D / CV mode but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to its model matrix. This also cannot be set after the model has loaded.
  35190. */
  35191. export class ModelExperimental {
  35192. constructor(options: {
  35193. resource: Resource;
  35194. modelMatrix?: Matrix4;
  35195. scale?: number;
  35196. minimumPixelSize?: number;
  35197. maximumScale?: number;
  35198. clampAnimations?: boolean;
  35199. debugShowBoundingVolume?: boolean;
  35200. enableDebugWireframe?: boolean;
  35201. debugWireframe?: boolean;
  35202. cull?: boolean;
  35203. opaquePass?: boolean;
  35204. allowPicking?: boolean;
  35205. customShader?: CustomShader;
  35206. content?: Cesium3DTileContent;
  35207. show?: boolean;
  35208. color?: Color;
  35209. colorBlendMode?: ColorBlendMode;
  35210. colorBlendAmount?: number;
  35211. featureIdLabel?: string | number;
  35212. instanceFeatureIdLabel?: string | number;
  35213. pointCloudShading?: any;
  35214. clippingPlanes?: ClippingPlaneCollection;
  35215. lightColor?: Cartesian3;
  35216. imageBasedLighting?: ImageBasedLighting;
  35217. backFaceCulling?: boolean;
  35218. shadows?: ShadowMode;
  35219. showCreditsOnScreen?: boolean;
  35220. splitDirection?: SplitDirection;
  35221. projectTo2D?: boolean;
  35222. });
  35223. /**
  35224. * When <code>true</code>, this model is ready to render, i.e., the external binary, image,
  35225. * and shader files were downloaded and the WebGL resources were created. This is set to
  35226. * <code>true</code> right before {@link ModelExperimental#readyPromise} is resolved.
  35227. */
  35228. readonly ready: boolean;
  35229. /**
  35230. * Gets the promise that will be resolved when this model is ready to render, i.e. when the external resources
  35231. * have been downloaded and the WebGL resources are created.
  35232. * <p>
  35233. * This promise is resolved at the end of the frame before the first frame the model is rendered in.
  35234. * </p>
  35235. */
  35236. readonly readyPromise: Promise<ModelExperimental>;
  35237. /**
  35238. * The currently playing glTF animations.
  35239. */
  35240. readonly activeAnimations: ModelExperimentalAnimationCollection;
  35241. /**
  35242. * Determines if the model's animations should hold a pose over frames where no keyframes are specified.
  35243. */
  35244. clampAnimations: boolean;
  35245. /**
  35246. * Point cloud shading settings for controlling point cloud attenuation
  35247. * and lighting. For 3D Tiles, this is inherited from the
  35248. * {@link Cesium3DTileset}.
  35249. */
  35250. pointCloudShading: PointCloudShading;
  35251. /**
  35252. * The model's custom shader, if it exists. Using custom shaders with a {@link Cesium3DTileStyle}
  35253. * may lead to undefined behavior.
  35254. */
  35255. customShader: CustomShader;
  35256. /**
  35257. * The color to blend with the model's rendered color.
  35258. */
  35259. color: Color;
  35260. /**
  35261. * Defines how the color blends with the model.
  35262. */
  35263. colorBlendMode: Cesium3DTileColorBlendMode | ColorBlendMode;
  35264. /**
  35265. * 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.
  35266. */
  35267. colorBlendAmount: number;
  35268. /**
  35269. * Gets the model's bounding sphere in world space. This does not take into account
  35270. * glTF animations, skins, or morph targets. It also does not account for
  35271. * {@link ModelExperimental#minimumPixelSize}.
  35272. */
  35273. readonly boundingSphere: BoundingSphere;
  35274. /**
  35275. * This property is for debugging only; it is not for production use nor is it optimized.
  35276. * <p>
  35277. * Draws the bounding sphere for each draw command in the model.
  35278. * </p>
  35279. */
  35280. debugShowBoundingVolume: boolean;
  35281. /**
  35282. * This property is for debugging only; it is not for production use nor is it optimized.
  35283. * <p>
  35284. * Draws the model in wireframe.
  35285. * </p>
  35286. */
  35287. debugWireframe: boolean;
  35288. /**
  35289. * Whether or not to render the model.
  35290. */
  35291. show: boolean;
  35292. /**
  35293. * Label of the feature ID set to use for picking and styling.
  35294. * <p>
  35295. * For EXT_mesh_features, this is the feature ID's label property, or
  35296. * "featureId_N" (where N is the index in the featureIds array) when not
  35297. * specified. EXT_feature_metadata did not have a label field, so such
  35298. * feature ID sets are always labeled "featureId_N" where N is the index in
  35299. * the list of all feature Ids, where feature ID attributes are listed before
  35300. * feature ID textures.
  35301. * </p>
  35302. * <p>
  35303. * If featureIdLabel is set to an integer N, it is converted to
  35304. * the string "featureId_N" automatically. If both per-primitive and
  35305. * per-instance feature IDs are present, the instance feature IDs take
  35306. * priority.
  35307. * </p>
  35308. */
  35309. featureIdLabel: string;
  35310. /**
  35311. * Label of the instance feature ID set used for picking and styling.
  35312. * <p>
  35313. * If instanceFeatureIdLabel is set to an integer N, it is converted to
  35314. * the string "instanceFeatureId_N" automatically.
  35315. * If both per-primitive and per-instance feature IDs are present, the
  35316. * instance feature IDs take priority.
  35317. * </p>
  35318. */
  35319. instanceFeatureIdLabel: string;
  35320. /**
  35321. * The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  35322. */
  35323. clippingPlanes: ClippingPlaneCollection;
  35324. /**
  35325. * The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  35326. * <p>
  35327. * Disabling additional light sources by setting
  35328. * <code>model.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)</code>
  35329. * will make the model much darker. Here, increasing the intensity of the light source will make the model brighter.
  35330. * </p>
  35331. */
  35332. lightColor: Cartesian3;
  35333. /**
  35334. * The properties for managing image-based lighting on this model.
  35335. */
  35336. imageBasedLighting: ImageBasedLighting;
  35337. /**
  35338. * Whether to cull back-facing geometry. When true, back face culling is
  35339. * determined by the material's doubleSided property; when false, back face
  35340. * culling is disabled. Back faces are not culled if the model's color is
  35341. * translucent.
  35342. */
  35343. backFaceCulling: boolean;
  35344. /**
  35345. * A uniform scale applied to this model before the {@link Model#modelMatrix}.
  35346. * Values greater than <code>1.0</code> increase the size of the model; values
  35347. * less than <code>1.0</code> decrease.
  35348. */
  35349. scale: number;
  35350. /**
  35351. * The approximate minimum pixel size of the model regardless of zoom.
  35352. * This can be used to ensure that a model is visible even when the viewer
  35353. * zooms out. When <code>0.0</code>, no minimum size is enforced.
  35354. */
  35355. minimumPixelSize: number;
  35356. /**
  35357. * The maximum scale size for a model. This can be used to give
  35358. * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
  35359. * is never an unreasonable scale.
  35360. */
  35361. maximumScale: number;
  35362. /**
  35363. * Determines whether the model casts or receives shadows from light sources.
  35364. */
  35365. shadows: ShadowMode;
  35366. /**
  35367. * Gets or sets whether the credits of the model will be displayed on the screen
  35368. */
  35369. showCreditsOnScreen: boolean;
  35370. /**
  35371. * The {@link SplitDirection} to apply to this model.
  35372. */
  35373. splitDirection: SplitDirection;
  35374. /**
  35375. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  35376. * get the draw commands needed to render this primitive.
  35377. * <p>
  35378. * Do not call this function directly. This is documented just to
  35379. * list the exceptions that may be propagated when the scene is rendered:
  35380. * </p>
  35381. */
  35382. update(): void;
  35383. /**
  35384. * Returns true if this object was destroyed; otherwise, false.
  35385. * <br /><br />
  35386. * If this object was destroyed, it should not be used; calling any function other than
  35387. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  35388. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  35389. */
  35390. isDestroyed(): boolean;
  35391. /**
  35392. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  35393. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  35394. * <br /><br />
  35395. * Once an object is destroyed, it should not be used; calling any function other than
  35396. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  35397. * assign the return value (<code>undefined</code>) to the object as done in the example.
  35398. * @example
  35399. * model = model && model.destroy();
  35400. */
  35401. destroy(): void;
  35402. /**
  35403. * <p>
  35404. * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
  35405. * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
  35406. * </p>
  35407. * <p>
  35408. * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
  35409. * @param options - Object with the following properties:
  35410. * @param options.url - The url to the .gltf or .glb file.
  35411. * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
  35412. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the model from model to world coordinates.
  35413. * @param [options.scale = 1.0] - A uniform scale applied to this model.
  35414. * @param [options.minimumPixelSize = 0.0] - The approximate minimum pixel size of the model regardless of zoom.
  35415. * @param [options.maximumScale] - The maximum scale size of a model. An upper limit for minimumPixelSize.
  35416. * @param [options.incrementallyLoadTextures = true] - Determine if textures may continue to stream in after the model is loaded.
  35417. * @param [options.releaseGltfJson = false] - When true, the glTF JSON is released once the glTF is loaded. This is is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.
  35418. * @param [options.debugShowBoundingVolume = false] - For debugging only. Draws the bounding sphere for each draw command in the model.
  35419. * @param [options.enableDebugWireframe = false] - For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded.
  35420. * @param [options.debugWireframe = false] - For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true.
  35421. * @param [options.cull = true] - Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used.
  35422. * @param [options.opaquePass = Pass.OPAQUE] - The pass to use in the {@link DrawCommand} for the opaque portions of the model.
  35423. * @param [options.upAxis = Axis.Y] - The up-axis of the glTF model.
  35424. * @param [options.forwardAxis = Axis.Z] - The forward-axis of the glTF model.
  35425. * @param [options.allowPicking = true] - When <code>true</code>, each primitive is pickable with {@link Scene#pick}.
  35426. * @param [options.customShader] - A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior.
  35427. * @param [options.content] - The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset.
  35428. * @param [options.show = true] - Whether or not to render the model.
  35429. * @param [options.color] - A color that blends with the model's rendered color.
  35430. * @param [options.colorBlendMode = ColorBlendMode.HIGHLIGHT] - Defines how the color blends with the model.
  35431. * @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.
  35432. * @param [options.featureIdLabel = "featureId_0"] - Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
  35433. * @param [options.instanceFeatureIdLabel = "instanceFeatureId_0"] - Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
  35434. * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and lighting.
  35435. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
  35436. * @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
  35437. * @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model.
  35438. * @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 the model's color is translucent.
  35439. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the model casts or receives shadows from light sources.
  35440. * @param [options.showCreditsOnScreen = false] - Whether to display the credits of this model on screen.
  35441. * @param [options.splitDirection = SplitDirection.NONE] - The {@link SplitDirection} split to apply to this model.
  35442. * @param [options.projectTo2D = false] - Whether to accurately project the model's positions in 2D. If a model is part of a 3D Tiles tileset, this will always be true. If this is false, the model will show up in 2D / CV mode but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to its model matrix. This also cannot be set after the model has loaded.
  35443. * @returns The newly created model.
  35444. */
  35445. static fromGltf(options: {
  35446. url: string | Resource;
  35447. basePath?: string | Resource;
  35448. modelMatrix?: Matrix4;
  35449. scale?: number;
  35450. minimumPixelSize?: number;
  35451. maximumScale?: number;
  35452. incrementallyLoadTextures?: boolean;
  35453. releaseGltfJson?: boolean;
  35454. debugShowBoundingVolume?: boolean;
  35455. enableDebugWireframe?: boolean;
  35456. debugWireframe?: boolean;
  35457. cull?: boolean;
  35458. opaquePass?: boolean;
  35459. upAxis?: Axis;
  35460. forwardAxis?: Axis;
  35461. allowPicking?: boolean;
  35462. customShader?: CustomShader;
  35463. content?: Cesium3DTileContent;
  35464. show?: boolean;
  35465. color?: Color;
  35466. colorBlendMode?: ColorBlendMode;
  35467. colorBlendAmount?: number;
  35468. featureIdLabel?: string | number;
  35469. instanceFeatureIdLabel?: string | number;
  35470. pointCloudShading?: any;
  35471. clippingPlanes?: ClippingPlaneCollection;
  35472. lightColor?: Cartesian3;
  35473. imageBasedLighting?: ImageBasedLighting;
  35474. backFaceCulling?: boolean;
  35475. shadows?: ShadowMode;
  35476. showCreditsOnScreen?: boolean;
  35477. splitDirection?: SplitDirection;
  35478. projectTo2D?: boolean;
  35479. }): ModelExperimental;
  35480. }
  35481. /**
  35482. * The 4x4 transformation matrix that transforms the model from model to world coordinates.
  35483. * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's Cartesian WGS84 coordinates.
  35484. * Local reference frames can be used by providing a different transformation matrix, like that returned
  35485. * by {@link Transforms.eastNorthUpToFixedFrame}.
  35486. * @example
  35487. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  35488. * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  35489. */
  35490. export var modelMatrix: Matrix4;
  35491. /**
  35492. * The style to apply the to the features in the model. Cannot be applied if a {@link CustomShader} is also applied.
  35493. */
  35494. export var style: Cesium3DTileStyle;
  35495. /**
  35496. * An active animation derived from a glTF asset. An active animation is an
  35497. * animation that is either currently playing or scheduled to be played due to
  35498. * being added to a model's {@link ModelExperimentalAnimationCollection}. An active animation
  35499. * is an instance of an animation; for example, there can be multiple active
  35500. * animations for the same glTF animation, each with a different start time.
  35501. * <p>
  35502. * Create this by calling {@link ModelExperimentalAnimationCollection#add}.
  35503. * </p>
  35504. */
  35505. export class ModelExperimentalAnimation {
  35506. constructor();
  35507. /**
  35508. * When <code>true</code>, the animation is removed after it stops playing.
  35509. * This is slightly more efficient that not removing it, but if, for example,
  35510. * time is reversed, the animation is not played again.
  35511. */
  35512. removeOnStop: boolean;
  35513. /**
  35514. * The event fired when this animation is started. This can be used, for
  35515. * example, to play a sound or start a particle system, when the animation starts.
  35516. * <p>
  35517. * This event is fired at the end of the frame after the scene is rendered.
  35518. * </p>
  35519. * @example
  35520. * animation.start.addEventListener(function(model, animation) {
  35521. * console.log('Animation started: ' + animation.name);
  35522. * });
  35523. */
  35524. start: Event;
  35525. /**
  35526. * The event fired when on each frame when this animation is updated. The
  35527. * current time of the animation, relative to the glTF animation time span, is
  35528. * passed to the event, which allows, for example, starting new animations at a
  35529. * specific time relative to a playing animation.
  35530. * <p>
  35531. * This event is fired at the end of the frame after the scene is rendered.
  35532. * </p>
  35533. * @example
  35534. * animation.update.addEventListener(function(model, animation, time) {
  35535. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  35536. * });
  35537. */
  35538. update: Event;
  35539. /**
  35540. * The event fired when this animation is stopped. This can be used, for
  35541. * example, to play a sound or start a particle system, when the animation stops.
  35542. * <p>
  35543. * This event is fired at the end of the frame after the scene is rendered.
  35544. * </p>
  35545. * @example
  35546. * animation.stop.addEventListener(function(model, animation) {
  35547. * console.log('Animation stopped: ' + animation.name);
  35548. * });
  35549. */
  35550. stop: Event;
  35551. /**
  35552. * The name that identifies this animation in the model, if it exists.
  35553. */
  35554. readonly name: string;
  35555. /**
  35556. * The scene time to start playing this animation. When this is <code>undefined</code>,
  35557. * the animation starts at the next frame.
  35558. */
  35559. readonly startTime: JulianDate;
  35560. /**
  35561. * The delay, in seconds, from {@link ModelExperimentalAnimation#startTime} to start playing.
  35562. */
  35563. readonly delay: number;
  35564. /**
  35565. * The scene time to stop playing this animation. When this is <code>undefined</code>,
  35566. * the animation is played for its full duration and perhaps repeated depending on
  35567. * {@link ModelExperimentalAnimation#loop}.
  35568. */
  35569. readonly stopTime: JulianDate;
  35570. /**
  35571. * Values greater than <code>1.0</code> increase the speed that the animation is played relative
  35572. * to the scene clock speed; values less than <code>1.0</code> decrease the speed. A value of
  35573. * <code>1.0</code> plays the animation at the speed in the glTF animation mapped to the scene
  35574. * clock speed. For example, if the scene is played at 2x real-time, a two-second glTF animation
  35575. * will play in one second even if <code>multiplier</code> is <code>1.0</code>.
  35576. */
  35577. readonly multiplier: number;
  35578. /**
  35579. * When <code>true</code>, the animation is played in reverse.
  35580. */
  35581. readonly reverse: boolean;
  35582. /**
  35583. * Determines if and how the animation is looped.
  35584. */
  35585. readonly loop: ModelAnimationLoop;
  35586. /**
  35587. * If this is defined, it will be used to compute the local animation time
  35588. * instead of the scene's time.
  35589. */
  35590. animationTime: ModelExperimentalAnimation.AnimationTimeCallback;
  35591. }
  35592. export namespace ModelExperimentalAnimation {
  35593. /**
  35594. * A function used to compute the local animation time for a ModelExperimentalAnimation.
  35595. * @example
  35596. * // Use real time for model animation (assuming animateWhilePaused was set to true)
  35597. * function animationTime(duration) {
  35598. * return Date.now() / 1000 / duration;
  35599. * }
  35600. * @example
  35601. * // Offset the phase of the animation, so it starts halfway through its cycle.
  35602. * function animationTime(duration, seconds) {
  35603. * return seconds / duration + 0.5;
  35604. * }
  35605. * @param duration - The animation's original duration in seconds.
  35606. * @param seconds - The seconds since the animation started, in scene time.
  35607. */
  35608. type AnimationTimeCallback = (duration: number, seconds: number) => number;
  35609. }
  35610. /**
  35611. * A collection of active model animations. Access this using {@link ModelExperimental#activeAnimations}.
  35612. */
  35613. export class ModelExperimentalAnimationCollection {
  35614. constructor();
  35615. /**
  35616. * The event fired when an animation is added to the collection. This can be used, for
  35617. * example, to keep a UI in sync.
  35618. * @example
  35619. * model.activeAnimations.animationAdded.addEventListener(function(model, animation) {
  35620. * console.log('Animation added: ' + animation.name);
  35621. * });
  35622. */
  35623. animationAdded: Event;
  35624. /**
  35625. * The event fired when an animation is removed from the collection. This can be used, for
  35626. * example, to keep a UI in sync.
  35627. * @example
  35628. * model.activeAnimations.animationRemoved.addEventListener(function(model, animation) {
  35629. * console.log('Animation removed: ' + animation.name);
  35630. * });
  35631. */
  35632. animationRemoved: Event;
  35633. /**
  35634. * When true, the animation will play even when the scene time is paused. However,
  35635. * whether animation takes place will depend on the animationTime functions assigned
  35636. * to the model's animations. By default, this is based on scene time, so models using
  35637. * the default will not animate regardless of this setting.
  35638. */
  35639. animateWhilePaused: boolean;
  35640. /**
  35641. * The number of animations in the collection.
  35642. */
  35643. readonly length: number;
  35644. /**
  35645. * The model that owns this animation collection.
  35646. */
  35647. readonly model: ModelExperimental;
  35648. /**
  35649. * Creates and adds an animation with the specified initial properties to the collection.
  35650. * <p>
  35651. * This raises the {@link ModelExperimentalAnimationCollection#animationAdded} event so, for example, a UI can stay in sync.
  35652. * </p>
  35653. * @example
  35654. * // Example 1. Add an animation by name
  35655. * model.activeAnimations.add({
  35656. * name : 'animation name'
  35657. * });
  35658. * @example
  35659. * // Example 2. Add an animation by index
  35660. * model.activeAnimations.add({
  35661. * index : 0
  35662. * });
  35663. * @example
  35664. * // Example 3. Add an animation and provide all properties and events
  35665. * const startTime = Cesium.JulianDate.now();
  35666. *
  35667. * const animation = model.activeAnimations.add({
  35668. * name : 'another animation name',
  35669. * startTime : startTime,
  35670. * delay : 0.0, // Play at startTime (default)
  35671. * stopTime : Cesium.JulianDate.addSeconds(startTime, 4.0, new Cesium.JulianDate()),
  35672. * removeOnStop : false, // Do not remove when animation stops (default)
  35673. * multiplier : 2.0, // Play at double speed
  35674. * reverse : true, // Play in reverse
  35675. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animation
  35676. * });
  35677. *
  35678. * animation.start.addEventListener(function(model, animation) {
  35679. * console.log('Animation started: ' + animation.name);
  35680. * });
  35681. * animation.update.addEventListener(function(model, animation, time) {
  35682. * console.log('Animation updated: ' + animation.name + '. glTF animation time: ' + time);
  35683. * });
  35684. * animation.stop.addEventListener(function(model, animation) {
  35685. * console.log('Animation stopped: ' + animation.name);
  35686. * });
  35687. * @param options - Object with the following properties:
  35688. * @param [options.name] - The glTF animation name that identifies the animation. Must be defined if <code>options.index</code> is <code>undefined</code>.
  35689. * @param [options.index] - The glTF animation index that identifies the animation. Must be defined if <code>options.name</code> is <code>undefined</code>.
  35690. * @param [options.startTime] - The scene time to start playing the animation. When this is <code>undefined</code>, the animation starts at the next frame.
  35691. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.
  35692. * @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.
  35693. * @param [options.removeOnStop = false] - When <code>true</code>, the animation is removed after it stops playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.
  35694. * @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.
  35695. * @param [options.reverse = false] - When <code>true</code>, the animation is played in reverse.
  35696. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animation is looped.
  35697. * @param [options.animationTime] - If defined, computes the local animation time for this animation.
  35698. * @returns The animation that was added to the collection.
  35699. */
  35700. add(options: {
  35701. name?: string;
  35702. index?: number;
  35703. startTime?: JulianDate;
  35704. delay?: number;
  35705. stopTime?: JulianDate;
  35706. removeOnStop?: boolean;
  35707. multiplier?: number;
  35708. reverse?: boolean;
  35709. loop?: ModelAnimationLoop;
  35710. animationTime?: ModelExperimentalAnimation.AnimationTimeCallback;
  35711. }): ModelExperimentalAnimation;
  35712. /**
  35713. * Creates and adds animations with the specified initial properties to the collection
  35714. * for all animations in the model.
  35715. * <p>
  35716. * This raises the {@link ModelExperimentalAnimationCollection#animationAdded} event for each model so, for example, a UI can stay in sync.
  35717. * </p>
  35718. * @example
  35719. * model.activeAnimations.addAll({
  35720. * multiplier : 0.5, // Play at half-speed
  35721. * loop : Cesium.ModelAnimationLoop.REPEAT // Loop the animations
  35722. * });
  35723. * @param [options] - Object with the following properties:
  35724. * @param [options.startTime] - The scene time to start playing the animations. When this is <code>undefined</code>, the animations starts at the next frame.
  35725. * @param [options.delay = 0.0] - The delay, in seconds, from <code>startTime</code> to start playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.
  35726. * @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.
  35727. * @param [options.removeOnStop = false] - When <code>true</code>, the animations are removed after they stop playing. This will only affect the animation if <code>options.loop</code> is ModelAnimationLoop.NONE.
  35728. * @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.
  35729. * @param [options.reverse = false] - When <code>true</code>, the animations are played in reverse.
  35730. * @param [options.loop = ModelAnimationLoop.NONE] - Determines if and how the animations are looped.
  35731. * @param [options.animationTime] - If defined, computes the local animation time for all of the animations.
  35732. * @returns An array of {@link ModelExperimentalAnimation} objects, one for each animation added to the collection. If there are no glTF animations, the array is empty.
  35733. */
  35734. addAll(options?: {
  35735. startTime?: JulianDate;
  35736. delay?: number;
  35737. stopTime?: JulianDate;
  35738. removeOnStop?: boolean;
  35739. multiplier?: number;
  35740. reverse?: boolean;
  35741. loop?: ModelAnimationLoop;
  35742. animationTime?: ModelExperimentalAnimation.AnimationTimeCallback;
  35743. }): ModelExperimentalAnimation[];
  35744. /**
  35745. * Removes an animation from the collection.
  35746. * <p>
  35747. * This raises the {@link ModelExperimentalAnimationCollection#animationRemoved} event so, for example, a UI can stay in sync.
  35748. * </p>
  35749. * <p>
  35750. * An animation can also be implicitly removed from the collection by setting {@link ModelExperimentalAnimationCollection#removeOnStop} to
  35751. * <code>true</code>. The {@link ModelExperimentalAnimationCollection#animationRemoved} event is still fired when the animation is removed.
  35752. * </p>
  35753. * @example
  35754. * const a = model.activeAnimations.add({
  35755. * name : 'animation name'
  35756. * });
  35757. * model.activeAnimations.remove(a); // Returns true
  35758. * @param runtimeAnimation - The runtime animation to remove.
  35759. * @returns <code>true</code> if the animation was removed; <code>false</code> if the animation was not found in the collection.
  35760. */
  35761. remove(runtimeAnimation: ModelExperimentalAnimation): boolean;
  35762. /**
  35763. * Removes all animations from the collection.
  35764. * <p>
  35765. * This raises the {@link ModelExperimentalAnimationCollection#animationRemoved} event for each
  35766. * animation so, for example, a UI can stay in sync.
  35767. * </p>
  35768. */
  35769. removeAll(): void;
  35770. /**
  35771. * Determines whether this collection contains a given animation.
  35772. * @param runtimeAnimation - The runtime animation to check for.
  35773. * @returns <code>true</code> if this collection contains the animation, <code>false</code> otherwise.
  35774. */
  35775. contains(runtimeAnimation: ModelExperimentalAnimation): boolean;
  35776. /**
  35777. * Returns the animation in the collection at the specified index. Indices are zero-based
  35778. * and increase as animations are added. Removing an animation shifts all animations after
  35779. * it to the left, changing their indices. This function is commonly used to iterate over
  35780. * all the animations in the collection.
  35781. * @example
  35782. * // Output the names of all the animations in the collection.
  35783. * const animations = model.activeAnimations;
  35784. * const length = animations.length;
  35785. * for (let i = 0; i < length; ++i) {
  35786. * console.log(animations.get(i).name);
  35787. * }
  35788. * @param index - The zero-based index of the animation.
  35789. * @returns The runtime animation at the specified index.
  35790. */
  35791. get(index: number): ModelExperimentalAnimation;
  35792. }
  35793. /**
  35794. * The indices of the children of this node in the scene graph.
  35795. */
  35796. export const children: number[];
  35797. /**
  35798. * A feature of a {@link ModelExperimental}.
  35799. * <p>
  35800. * Provides access to a feature's properties stored in the model's feature table.
  35801. * </p>
  35802. * <p>
  35803. * Modifications to a <code>ModelFeature</code> object have the lifetime of the model.
  35804. * </p>
  35805. * <p>
  35806. * Do not construct this directly. Access it through picking using {@link Scene#pick}.
  35807. * </p>
  35808. * @example
  35809. * // On mouse over, display all the properties for a feature in the console log.
  35810. * handler.setInputAction(function(movement) {
  35811. * const feature = scene.pick(movement.endPosition);
  35812. * if (feature instanceof Cesium.ModelFeature) {
  35813. * console.log(feature);
  35814. * }
  35815. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  35816. * @param options - Object with the following properties:
  35817. * @param options.model - The model the feature belongs to.
  35818. * @param options.featureId - The unique integral identifier for this feature.
  35819. */
  35820. export class ModelFeature {
  35821. constructor(options: {
  35822. model: ModelExperimental;
  35823. featureId: number;
  35824. });
  35825. /**
  35826. * Gets or sets if the feature will be shown. This is set for all features
  35827. * when a style's show is evaluated.
  35828. */
  35829. show: boolean;
  35830. /**
  35831. * Gets or sets the highlight color multiplied with the feature's color. When
  35832. * this is white, the feature's color is not changed. This is set for all features
  35833. * when a style's color is evaluated.
  35834. */
  35835. color: Color;
  35836. /**
  35837. * Get the feature ID associated with this feature. For 3D Tiles 1.0, the
  35838. * batch ID is returned. For EXT_mesh_features, this is the feature ID from
  35839. * the selected feature ID set.
  35840. */
  35841. readonly featureId: number;
  35842. /**
  35843. * Returns whether the feature contains this property.
  35844. * @param name - The case-sensitive name of the property.
  35845. * @returns Whether the feature contains this property.
  35846. */
  35847. hasProperty(name: string): boolean;
  35848. /**
  35849. * Returns a copy of the value of the feature's property with the given name.
  35850. * @example
  35851. * // Display all the properties for a feature in the console log.
  35852. * const propertyNames = feature.getPropertyNames();
  35853. * const length = propertyNames.length;
  35854. * for (let i = 0; i < length; ++i) {
  35855. * const propertyName = propertyNames[i];
  35856. * console.log(propertyName + ': ' + feature.getProperty(propertyName));
  35857. * }
  35858. * @param name - The case-sensitive name of the property.
  35859. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  35860. */
  35861. getProperty(name: string): any;
  35862. /**
  35863. * Returns a copy of the feature's property with the given name, examining all
  35864. * the metadata from the EXT_structural_metadata and legacy EXT_feature_metadata glTF
  35865. * extensions. Metadata is checked against name from most specific to most
  35866. * general and the first match is returned. Metadata is checked in this order:
  35867. * <ol>
  35868. * <li>structural metadata property by semantic</li>
  35869. * <li>structural metadata property by property ID</li>
  35870. * </ol>
  35871. * <p>
  35872. * See the {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata|EXT_structural_metadata Extension} as well as the
  35873. * previous {@link https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata|EXT_feature_metadata Extension} for glTF.
  35874. * </p>
  35875. * @param name - The semantic or property ID of the feature. Semantics are checked before property IDs in each granularity of metadata.
  35876. * @returns The value of the property or <code>undefined</code> if the feature does not have this property.
  35877. */
  35878. getPropertyInherited(name: string): any;
  35879. /**
  35880. * Returns an array of property names for the feature.
  35881. * @param [results] - An array into which to store the results.
  35882. * @returns The names of the feature's properties.
  35883. */
  35884. getPropertyNames(results?: string[]): string[];
  35885. /**
  35886. * Sets the value of the feature's property with the given name.
  35887. * @example
  35888. * const height = feature.getProperty('Height'); // e.g., the height of a building
  35889. * @example
  35890. * const name = 'clicked';
  35891. * if (feature.getProperty(name)) {
  35892. * console.log('already clicked');
  35893. * } else {
  35894. * feature.setProperty(name, true);
  35895. * console.log('first click');
  35896. * }
  35897. * @param name - The case-sensitive name of the property.
  35898. * @param value - The value of the property that will be copied.
  35899. * @returns <code>true</code> if the property was set, <code>false</code> otherwise.
  35900. */
  35901. setProperty(name: string, value: any): boolean;
  35902. }
  35903. /**
  35904. * A simple struct that serves as a value of a <code>sampler2D</code>-valued
  35905. * uniform. This is used with {@link CustomShader} and {@link TextureManager}
  35906. * @param options - An object with the following properties:
  35907. * @param [options.typedArray] - A typed array storing the contents of a texture. Values are stored in row-major order. Since WebGL uses a y-up convention for textures, rows are listed from bottom to top.
  35908. * @param [options.width] - The width of the image. Required when options.typedArray is present
  35909. * @param [options.height] - The height of the image. Required when options.typedArray is present.
  35910. * @param [options.url] - A URL string or resource pointing to a texture image.
  35911. * @param [options.repeat = true] - When defined, the texture sampler will be set to wrap in both directions
  35912. * @param [options.pixelFormat = PixelFormat.RGBA] - When options.typedArray is defined, this is used to determine the pixel format of the texture
  35913. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - When options.typedArray is defined, this is the data type of pixel values in the typed array.
  35914. * @param [options.minificationFilter = TextureMinificationFilter.LINEAR] - The minification filter of the texture sampler.
  35915. * @param [options.magnificationFilter = TextureMagnificationFilter.LINEAR] - The magnification filter of the texture sampler.
  35916. * @param [options.maximumAnisotropy = 1.0] - The maximum anisotropy of the texture sampler
  35917. */
  35918. export class TextureUniform {
  35919. constructor(options: {
  35920. typedArray?: Uint8Array;
  35921. width?: number;
  35922. height?: number;
  35923. url?: string | Resource;
  35924. repeat?: boolean;
  35925. pixelFormat?: PixelFormat;
  35926. pixelDatatype?: PixelDatatype;
  35927. minificationFilter?: TextureMinificationFilter;
  35928. magnificationFilter?: TextureMagnificationFilter;
  35929. maximumAnisotropy?: number;
  35930. });
  35931. }
  35932. /**
  35933. * An enum of the basic GLSL uniform types. These can be used with
  35934. * {@link CustomShader} to declare user-defined uniforms.
  35935. */
  35936. export enum UniformType {
  35937. /**
  35938. * A single floating point value.
  35939. */
  35940. FLOAT = "float",
  35941. /**
  35942. * A vector of 2 floating point values.
  35943. */
  35944. VEC2 = "vec2",
  35945. /**
  35946. * A vector of 3 floating point values.
  35947. */
  35948. VEC3 = "vec3",
  35949. /**
  35950. * A vector of 4 floating point values.
  35951. */
  35952. VEC4 = "vec4",
  35953. /**
  35954. * A single integer value
  35955. */
  35956. INT = "int",
  35957. /**
  35958. * A vector of 2 integer values.
  35959. */
  35960. INT_VEC2 = "ivec2",
  35961. /**
  35962. * A vector of 3 integer values.
  35963. */
  35964. INT_VEC3 = "ivec3",
  35965. /**
  35966. * A vector of 4 integer values.
  35967. */
  35968. INT_VEC4 = "ivec4",
  35969. /**
  35970. * A single boolean value.
  35971. */
  35972. BOOL = "bool",
  35973. /**
  35974. * A vector of 2 boolean values.
  35975. */
  35976. BOOL_VEC2 = "bvec2",
  35977. /**
  35978. * A vector of 3 boolean values.
  35979. */
  35980. BOOL_VEC3 = "bvec3",
  35981. /**
  35982. * A vector of 4 boolean values.
  35983. */
  35984. BOOL_VEC4 = "bvec4",
  35985. /**
  35986. * A 2x2 matrix of floating point values.
  35987. */
  35988. MAT2 = "mat2",
  35989. /**
  35990. * A 3x3 matrix of floating point values.
  35991. */
  35992. MAT3 = "mat2",
  35993. /**
  35994. * A 3x3 matrix of floating point values.
  35995. */
  35996. MAT4 = "mat4",
  35997. /**
  35998. * A 2D sampled texture.
  35999. */
  36000. SAMPLER_2D = "sampler2D",
  36001. SAMPLER_CUBE = "samplerCube"
  36002. }
  36003. /**
  36004. * An enum for the GLSL varying types. These can be used for declaring varyings
  36005. * in {@link CustomShader}
  36006. */
  36007. export enum VaryingType {
  36008. /**
  36009. * A single floating point value.
  36010. */
  36011. FLOAT = "float",
  36012. /**
  36013. * A vector of 2 floating point values.
  36014. */
  36015. VEC2 = "vec2",
  36016. /**
  36017. * A vector of 3 floating point values.
  36018. */
  36019. VEC3 = "vec3",
  36020. /**
  36021. * A vector of 4 floating point values.
  36022. */
  36023. VEC4 = "vec4",
  36024. /**
  36025. * A 2x2 matrix of floating point values.
  36026. */
  36027. MAT2 = "mat2",
  36028. /**
  36029. * A 3x3 matrix of floating point values.
  36030. */
  36031. MAT3 = "mat2",
  36032. /**
  36033. * A 3x3 matrix of floating point values.
  36034. */
  36035. MAT4 = "mat4"
  36036. }
  36037. /**
  36038. * A model's material with modifiable parameters. A glTF material
  36039. * contains parameters defined by the material's technique with values
  36040. * defined by the technique and potentially overridden by the material.
  36041. * This class allows changing these values at runtime.
  36042. * <p>
  36043. * Use {@link Model#getMaterial} to create an instance.
  36044. * </p>
  36045. */
  36046. export class ModelMaterial {
  36047. constructor();
  36048. /**
  36049. * The value of the <code>name</code> property of this material.
  36050. */
  36051. readonly name: string;
  36052. /**
  36053. * The index of the material.
  36054. */
  36055. readonly id: string;
  36056. /**
  36057. * Assigns a value to a material parameter. The type for <code>value</code>
  36058. * depends on the glTF type of the parameter. It will be a floating-point
  36059. * number, Cartesian, or matrix.
  36060. * @example
  36061. * material.setValue('diffuse', new Cesium.Cartesian4(1.0, 0.0, 0.0, 1.0)); // vec4
  36062. * material.setValue('shininess', 256.0); // scalar
  36063. * @param name - The name of the parameter.
  36064. * @param [value] - The value to assign to the parameter.
  36065. */
  36066. setValue(name: string, value?: any): void;
  36067. /**
  36068. * Returns the value of the parameter with the given <code>name</code>. The type of the
  36069. * returned object depends on the glTF type of the parameter. It will be a floating-point
  36070. * number, Cartesian, or matrix.
  36071. * @param name - The name of the parameter.
  36072. * @returns The value of the parameter or <code>undefined</code> if the parameter does not exist.
  36073. */
  36074. getValue(name: string): any;
  36075. }
  36076. /**
  36077. * A model's mesh and its materials.
  36078. * <p>
  36079. * Use {@link Model#getMesh} to create an instance.
  36080. * </p>
  36081. */
  36082. export class ModelMesh {
  36083. constructor();
  36084. /**
  36085. * The value of the <code>name</code> property of this mesh.
  36086. */
  36087. readonly name: string;
  36088. /**
  36089. * The index of the mesh.
  36090. */
  36091. readonly id: string;
  36092. /**
  36093. * An array of {@link ModelMaterial} instances indexed by the mesh's
  36094. * primitive indices.
  36095. */
  36096. readonly materials: ModelMaterial[];
  36097. }
  36098. /**
  36099. * A model node with a transform for user-defined animations. A glTF asset can
  36100. * contain animations that target a node's transform. This class allows
  36101. * changing a node's transform externally so animation can be driven by another
  36102. * source, not just an animation in the glTF asset.
  36103. * <p>
  36104. * Use {@link Model#getNode} to create an instance.
  36105. * </p>
  36106. * @example
  36107. * const node = model.getNode('LOD3sp');
  36108. * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
  36109. */
  36110. export class ModelNode {
  36111. constructor();
  36112. /**
  36113. * The value of the <code>name</code> property of this node.
  36114. */
  36115. readonly name: string;
  36116. /**
  36117. * The index of the node.
  36118. */
  36119. readonly id: string;
  36120. /**
  36121. * Determines if this node and its children will be shown.
  36122. */
  36123. show: boolean;
  36124. /**
  36125. * The node's 4x4 matrix transform from its local coordinates to
  36126. * its parent's.
  36127. * <p>
  36128. * For changes to take effect, this property must be assigned to;
  36129. * setting individual elements of the matrix will not work.
  36130. * </p>
  36131. */
  36132. matrix: Matrix4;
  36133. /**
  36134. * Gets the node's original 4x4 matrix transform from its local coordinates to
  36135. * its parent's, without any node transformations or articulations applied.
  36136. */
  36137. originalMatrix: Matrix4;
  36138. }
  36139. /**
  36140. * Draws the Moon in 3D.
  36141. * @example
  36142. * scene.moon = new Cesium.Moon();
  36143. * @param [options] - Object with the following properties:
  36144. * @param [options.show = true] - Determines whether the moon will be rendered.
  36145. * @param [options.textureUrl = buildModuleUrl('Assets/Textures/moonSmall.jpg')] - The moon texture.
  36146. * @param [options.ellipsoid = Ellipsoid.MOON] - The moon ellipsoid.
  36147. * @param [options.onlySunLighting = true] - Use the sun as the only light source.
  36148. */
  36149. export class Moon {
  36150. constructor(options?: {
  36151. show?: boolean;
  36152. textureUrl?: string;
  36153. ellipsoid?: Ellipsoid;
  36154. onlySunLighting?: boolean;
  36155. });
  36156. /**
  36157. * Determines if the moon will be shown.
  36158. */
  36159. show: boolean;
  36160. /**
  36161. * The moon texture.
  36162. */
  36163. textureUrl: string;
  36164. /**
  36165. * Use the sun as the only light source.
  36166. */
  36167. onlySunLighting: boolean;
  36168. /**
  36169. * Get the ellipsoid that defines the shape of the moon.
  36170. */
  36171. readonly ellipsoid: Ellipsoid;
  36172. /**
  36173. * Returns true if this object was destroyed; otherwise, false.
  36174. * <br /><br />
  36175. * If this object was destroyed, it should not be used; calling any function other than
  36176. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36177. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36178. */
  36179. isDestroyed(): boolean;
  36180. /**
  36181. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36182. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36183. * <br /><br />
  36184. * Once an object is destroyed, it should not be used; calling any function other than
  36185. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36186. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36187. * @example
  36188. * moon = moon && moon.destroy();
  36189. */
  36190. destroy(): void;
  36191. }
  36192. /**
  36193. * A {@link TileDiscardPolicy} specifying that tile images should never be discard.
  36194. */
  36195. export class NeverTileDiscardPolicy {
  36196. constructor();
  36197. /**
  36198. * Determines if the discard policy is ready to process images.
  36199. * @returns True if the discard policy is ready to process images; otherwise, false.
  36200. */
  36201. isReady(): boolean;
  36202. /**
  36203. * Given a tile image, decide whether to discard that image.
  36204. * @param image - An image to test.
  36205. * @returns True if the image should be discarded; otherwise, false.
  36206. */
  36207. shouldDiscardImage(image: HTMLImageElement): boolean;
  36208. }
  36209. export namespace OpenStreetMapImageryProvider {
  36210. /**
  36211. * Initialization options for the OpenStreetMapImageryProvider constructor
  36212. * @property [url = 'https://a.tile.openstreetmap.org'] - The OpenStreetMap server url.
  36213. * @property [fileExtension = 'png'] - The file extension for images on the server.
  36214. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  36215. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  36216. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  36217. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  36218. * @property [credit = 'MapQuest, Open Street Map and contributors, CC-BY-SA'] - A credit for the data source, which is displayed on the canvas.
  36219. */
  36220. type ConstructorOptions = {
  36221. url?: string;
  36222. fileExtension?: string;
  36223. rectangle?: Rectangle;
  36224. minimumLevel?: number;
  36225. maximumLevel?: number;
  36226. ellipsoid?: Ellipsoid;
  36227. credit?: Credit | string;
  36228. };
  36229. }
  36230. /**
  36231. * An imagery provider that provides tiled imagery hosted by OpenStreetMap
  36232. * or another provider of Slippy tiles. The default url connects to OpenStreetMap's volunteer-run
  36233. * servers, so you must conform to their
  36234. * {@link http://wiki.openstreetmap.org/wiki/Tile_usage_policy|Tile Usage Policy}.
  36235. * @example
  36236. * const osm = new Cesium.OpenStreetMapImageryProvider({
  36237. * url : 'https://a.tile.openstreetmap.org/'
  36238. * });
  36239. * @param options - Object describing initialization options
  36240. */
  36241. export class OpenStreetMapImageryProvider extends UrlTemplateImageryProvider {
  36242. constructor(options: OpenStreetMapImageryProvider.ConstructorOptions);
  36243. }
  36244. /**
  36245. * A particle emitted by a {@link ParticleSystem}.
  36246. * @param options - An object with the following properties:
  36247. * @param [options.mass = 1.0] - The mass of the particle in kilograms.
  36248. * @param [options.position = Cartesian3.ZERO] - The initial position of the particle in world coordinates.
  36249. * @param [options.velocity = Cartesian3.ZERO] - The velocity vector of the particle in world coordinates.
  36250. * @param [options.life = Number.MAX_VALUE] - The life of the particle in seconds.
  36251. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  36252. * @param [options.startColor = Color.WHITE] - The color of a particle when it is born.
  36253. * @param [options.endColor = Color.WHITE] - The color of a particle when it dies.
  36254. * @param [options.startScale = 1.0] - The scale of the particle when it is born.
  36255. * @param [options.endScale = 1.0] - The scale of the particle when it dies.
  36256. * @param [options.imageSize = new Cartesian2(1.0, 1.0)] - The dimensions, width by height, to scale the particle image in pixels.
  36257. */
  36258. export class Particle {
  36259. constructor(options: {
  36260. mass?: number;
  36261. position?: Cartesian3;
  36262. velocity?: Cartesian3;
  36263. life?: number;
  36264. image?: any;
  36265. startColor?: Color;
  36266. endColor?: Color;
  36267. startScale?: number;
  36268. endScale?: number;
  36269. imageSize?: Cartesian2;
  36270. });
  36271. /**
  36272. * The mass of the particle in kilograms.
  36273. */
  36274. mass: number;
  36275. /**
  36276. * The positon of the particle in world coordinates.
  36277. */
  36278. position: Cartesian3;
  36279. /**
  36280. * The velocity of the particle in world coordinates.
  36281. */
  36282. velocity: Cartesian3;
  36283. /**
  36284. * The life of the particle in seconds.
  36285. */
  36286. life: number;
  36287. /**
  36288. * The image to use for the particle.
  36289. */
  36290. image: any;
  36291. /**
  36292. * The color of the particle when it is born.
  36293. */
  36294. startColor: Color;
  36295. /**
  36296. * The color of the particle when it dies.
  36297. */
  36298. endColor: Color;
  36299. /**
  36300. * the scale of the particle when it is born.
  36301. */
  36302. startScale: number;
  36303. /**
  36304. * The scale of the particle when it dies.
  36305. */
  36306. endScale: number;
  36307. /**
  36308. * The dimensions, width by height, to scale the particle image in pixels.
  36309. */
  36310. imageSize: Cartesian2;
  36311. /**
  36312. * Gets the age of the particle in seconds.
  36313. */
  36314. age: number;
  36315. /**
  36316. * Gets the age normalized to a value in the range [0.0, 1.0].
  36317. */
  36318. normalizedAge: number;
  36319. }
  36320. /**
  36321. * Represents a burst of {@link Particle}s from a {@link ParticleSystem} at a given time in the systems lifetime.
  36322. * @param [options] - An object with the following properties:
  36323. * @param [options.time = 0.0] - The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  36324. * @param [options.minimum = 0.0] - The minimum number of particles emmitted in the burst.
  36325. * @param [options.maximum = 50.0] - The maximum number of particles emitted in the burst.
  36326. */
  36327. export class ParticleBurst {
  36328. constructor(options?: {
  36329. time?: number;
  36330. minimum?: number;
  36331. maximum?: number;
  36332. });
  36333. /**
  36334. * The time in seconds after the beginning of the particle system's lifetime that the burst will occur.
  36335. */
  36336. time: number;
  36337. /**
  36338. * The minimum number of particles emitted.
  36339. */
  36340. minimum: number;
  36341. /**
  36342. * The maximum number of particles emitted.
  36343. */
  36344. maximum: number;
  36345. /**
  36346. * <code>true</code> if the burst has been completed; <code>false</code> otherwise.
  36347. */
  36348. complete: boolean;
  36349. }
  36350. /**
  36351. * <p>
  36352. * An object that initializes a {@link Particle} from a {@link ParticleSystem}.
  36353. * </p>
  36354. * <p>
  36355. * This type describes an interface and is not intended to be instantiated directly.
  36356. * </p>
  36357. */
  36358. export class ParticleEmitter {
  36359. constructor();
  36360. }
  36361. /**
  36362. * A ParticleSystem manages the updating and display of a collection of particles.
  36363. * @param [options] - Object with the following properties:
  36364. * @param [options.show = true] - Whether to display the particle system.
  36365. * @param [options.updateCallback] - The callback function to be called each frame to update a particle.
  36366. * @param [options.emitter = new CircleEmitter(0.5)] - The particle emitter for this system.
  36367. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  36368. * @param [options.emitterModelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  36369. * @param [options.emissionRate = 5] - The number of particles to emit per second.
  36370. * @param [options.bursts] - An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  36371. * @param [options.loop = true] - Whether the particle system should loop its bursts when it is complete.
  36372. * @param [options.scale = 1.0] - Sets the scale to apply to the image of the particle for the duration of its particleLife.
  36373. * @param [options.startScale] - The initial scale to apply to the image of the particle at the beginning of its life.
  36374. * @param [options.endScale] - The final scale to apply to the image of the particle at the end of its life.
  36375. * @param [options.color = Color.WHITE] - Sets the color of a particle for the duration of its particleLife.
  36376. * @param [options.startColor] - The color of the particle at the beginning of its life.
  36377. * @param [options.endColor] - The color of the particle at the end of its life.
  36378. * @param [options.image] - The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  36379. * @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.
  36380. * @param [options.minimumImageSize] - Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  36381. * @param [options.maximumImageSize] - Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  36382. * @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.
  36383. * @param [options.speed = 1.0] - If set, overrides the minimumSpeed and maximumSpeed inputs with this value.
  36384. * @param [options.minimumSpeed] - Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  36385. * @param [options.maximumSpeed] - Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  36386. * @param [options.lifetime = Number.MAX_VALUE] - How long the particle system will emit particles, in seconds.
  36387. * @param [options.particleLife = 5.0] - If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.
  36388. * @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.
  36389. * @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.
  36390. * @param [options.mass = 1.0] - Sets the minimum and maximum mass of particles in kilograms.
  36391. * @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.
  36392. * @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.
  36393. */
  36394. export class ParticleSystem {
  36395. constructor(options?: {
  36396. show?: boolean;
  36397. updateCallback?: ParticleSystem.updateCallback;
  36398. emitter?: ParticleEmitter;
  36399. modelMatrix?: Matrix4;
  36400. emitterModelMatrix?: Matrix4;
  36401. emissionRate?: number;
  36402. bursts?: ParticleBurst[];
  36403. loop?: boolean;
  36404. scale?: number;
  36405. startScale?: number;
  36406. endScale?: number;
  36407. color?: Color;
  36408. startColor?: Color;
  36409. endColor?: Color;
  36410. image?: any;
  36411. imageSize?: Cartesian2;
  36412. minimumImageSize?: Cartesian2;
  36413. maximumImageSize?: Cartesian2;
  36414. sizeInMeters?: boolean;
  36415. speed?: number;
  36416. minimumSpeed?: number;
  36417. maximumSpeed?: number;
  36418. lifetime?: number;
  36419. particleLife?: number;
  36420. minimumParticleLife?: number;
  36421. maximumParticleLife?: number;
  36422. mass?: number;
  36423. minimumMass?: number;
  36424. maximumMass?: number;
  36425. });
  36426. /**
  36427. * Whether to display the particle system.
  36428. */
  36429. show: boolean;
  36430. /**
  36431. * An array of force callbacks. The callback is passed a {@link Particle} and the difference from the last time
  36432. */
  36433. updateCallback: ParticleSystem.updateCallback;
  36434. /**
  36435. * Whether the particle system should loop it's bursts when it is complete.
  36436. */
  36437. loop: boolean;
  36438. /**
  36439. * The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.
  36440. */
  36441. image: any;
  36442. /**
  36443. * The particle emitter for this
  36444. */
  36445. emitter: ParticleEmitter;
  36446. /**
  36447. * An array of {@link ParticleBurst}, emitting bursts of particles at periodic times.
  36448. */
  36449. bursts: ParticleBurst[];
  36450. /**
  36451. * The 4x4 transformation matrix that transforms the particle system from model to world coordinates.
  36452. */
  36453. modelMatrix: Matrix4;
  36454. /**
  36455. * The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.
  36456. */
  36457. emitterModelMatrix: Matrix4;
  36458. /**
  36459. * The color of the particle at the beginning of its life.
  36460. */
  36461. startColor: Color;
  36462. /**
  36463. * The color of the particle at the end of its life.
  36464. */
  36465. endColor: Color;
  36466. /**
  36467. * The initial scale to apply to the image of the particle at the beginning of its life.
  36468. */
  36469. startScale: number;
  36470. /**
  36471. * The final scale to apply to the image of the particle at the end of its life.
  36472. */
  36473. endScale: number;
  36474. /**
  36475. * The number of particles to emit per second.
  36476. */
  36477. emissionRate: number;
  36478. /**
  36479. * Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.
  36480. */
  36481. minimumSpeed: number;
  36482. /**
  36483. * Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.
  36484. */
  36485. maximumSpeed: number;
  36486. /**
  36487. * 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.
  36488. */
  36489. minimumParticleLife: number;
  36490. /**
  36491. * 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.
  36492. */
  36493. maximumParticleLife: number;
  36494. /**
  36495. * Sets the minimum mass of particles in kilograms.
  36496. */
  36497. minimumMass: number;
  36498. /**
  36499. * Sets the maximum mass of particles in kilograms.
  36500. */
  36501. maximumMass: number;
  36502. /**
  36503. * Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.
  36504. */
  36505. minimumImageSize: Cartesian2;
  36506. /**
  36507. * Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.
  36508. */
  36509. maximumImageSize: Cartesian2;
  36510. /**
  36511. * 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.
  36512. */
  36513. sizeInMeters: boolean;
  36514. /**
  36515. * How long the particle system will emit particles, in seconds.
  36516. */
  36517. lifetime: number;
  36518. /**
  36519. * Fires an event when the particle system has reached the end of its lifetime.
  36520. */
  36521. complete: Event;
  36522. /**
  36523. * When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.
  36524. */
  36525. isComplete: boolean;
  36526. /**
  36527. * Returns true if this object was destroyed; otherwise, false.
  36528. * <br /><br />
  36529. * If this object was destroyed, it should not be used; calling any function other than
  36530. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  36531. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  36532. */
  36533. isDestroyed(): boolean;
  36534. /**
  36535. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  36536. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  36537. * <br /><br />
  36538. * Once an object is destroyed, it should not be used; calling any function other than
  36539. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  36540. * assign the return value (<code>undefined</code>) to the object as done in the example.
  36541. */
  36542. destroy(): void;
  36543. }
  36544. export namespace ParticleSystem {
  36545. /**
  36546. * A function used to modify attributes of the particle at each time step. This can include force modifications,
  36547. * color, sizing, etc.
  36548. * @example
  36549. * function applyGravity(particle, dt) {
  36550. * const position = particle.position;
  36551. * const gravityVector = Cesium.Cartesian3.normalize(position, new Cesium.Cartesian3());
  36552. * Cesium.Cartesian3.multiplyByScalar(gravityVector, GRAVITATIONAL_CONSTANT * dt, gravityVector);
  36553. * particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);
  36554. * }
  36555. * @param particle - The particle being updated.
  36556. * @param dt - The time in seconds since the last update.
  36557. */
  36558. type updateCallback = (particle: Particle, dt: number) => void;
  36559. }
  36560. /**
  36561. * An appearance for {@link GeometryInstance} instances with color attributes.
  36562. * This allows several geometry instances, each with a different color, to
  36563. * be drawn with the same {@link Primitive} as shown in the second example below.
  36564. * @example
  36565. * // A solid white line segment
  36566. * const primitive = new Cesium.Primitive({
  36567. * geometryInstances : new Cesium.GeometryInstance({
  36568. * geometry : new Cesium.SimplePolylineGeometry({
  36569. * positions : Cesium.Cartesian3.fromDegreesArray([
  36570. * 0.0, 0.0,
  36571. * 5.0, 0.0
  36572. * ])
  36573. * }),
  36574. * attributes : {
  36575. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  36576. * }
  36577. * }),
  36578. * appearance : new Cesium.PerInstanceColorAppearance({
  36579. * flat : true,
  36580. * translucent : false
  36581. * })
  36582. * });
  36583. *
  36584. * // Two rectangles in a primitive, each with a different color
  36585. * const instance = new Cesium.GeometryInstance({
  36586. * geometry : new Cesium.RectangleGeometry({
  36587. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0)
  36588. * }),
  36589. * attributes : {
  36590. * color : new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 0.0, 0.5)
  36591. * }
  36592. * });
  36593. *
  36594. * const anotherInstance = new Cesium.GeometryInstance({
  36595. * geometry : new Cesium.RectangleGeometry({
  36596. * rectangle : Cesium.Rectangle.fromDegrees(0.0, 40.0, 10.0, 50.0)
  36597. * }),
  36598. * attributes : {
  36599. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 0.5)
  36600. * }
  36601. * });
  36602. *
  36603. * const rectanglePrimitive = new Cesium.Primitive({
  36604. * geometryInstances : [instance, anotherInstance],
  36605. * appearance : new Cesium.PerInstanceColorAppearance()
  36606. * });
  36607. * @param [options] - Object with the following properties:
  36608. * @param [options.flat = false] - When <code>true</code>, flat shading is used in the fragment shader, which means lighting is not taking into account.
  36609. * @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}.
  36610. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  36611. * @param [options.closed = false] - When <code>true</code>, the geometry is expected to be closed so {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  36612. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  36613. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  36614. * @param [options.renderState] - Optional render state to override the default render state.
  36615. */
  36616. export class PerInstanceColorAppearance {
  36617. constructor(options?: {
  36618. flat?: boolean;
  36619. faceForward?: boolean;
  36620. translucent?: boolean;
  36621. closed?: boolean;
  36622. vertexShaderSource?: string;
  36623. fragmentShaderSource?: string;
  36624. renderState?: any;
  36625. });
  36626. /**
  36627. * This property is part of the {@link Appearance} interface, but is not
  36628. * used by {@link PerInstanceColorAppearance} since a fully custom fragment shader is used.
  36629. */
  36630. material: Material;
  36631. /**
  36632. * When <code>true</code>, the geometry is expected to appear translucent so
  36633. * {@link PerInstanceColorAppearance#renderState} has alpha blending enabled.
  36634. */
  36635. translucent: boolean;
  36636. /**
  36637. * The GLSL source code for the vertex shader.
  36638. */
  36639. readonly vertexShaderSource: string;
  36640. /**
  36641. * The GLSL source code for the fragment shader.
  36642. */
  36643. readonly fragmentShaderSource: string;
  36644. /**
  36645. * The WebGL fixed-function state to use when rendering the geometry.
  36646. * <p>
  36647. * The render state can be explicitly defined when constructing a {@link PerInstanceColorAppearance}
  36648. * instance, or it is set implicitly via {@link PerInstanceColorAppearance#translucent}
  36649. * and {@link PerInstanceColorAppearance#closed}.
  36650. * </p>
  36651. */
  36652. readonly renderState: any;
  36653. /**
  36654. * When <code>true</code>, the geometry is expected to be closed so
  36655. * {@link PerInstanceColorAppearance#renderState} has backface culling enabled.
  36656. * If the viewer enters the geometry, it will not be visible.
  36657. */
  36658. readonly closed: boolean;
  36659. /**
  36660. * The {@link VertexFormat} that this appearance instance is compatible with.
  36661. * A geometry can have more vertex attributes and still be compatible - at a
  36662. * potential performance cost - but it can't have less.
  36663. */
  36664. readonly vertexFormat: VertexFormat;
  36665. /**
  36666. * When <code>true</code>, flat shading is used in the fragment shader,
  36667. * which means lighting is not taking into account.
  36668. */
  36669. readonly flat: boolean;
  36670. /**
  36671. * When <code>true</code>, the fragment shader flips the surface normal
  36672. * as needed to ensure that the normal faces the viewer to avoid
  36673. * dark spots. This is useful when both sides of a geometry should be
  36674. * shaded like {@link WallGeometry}.
  36675. */
  36676. readonly faceForward: boolean;
  36677. /**
  36678. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  36679. * are compatible with. This requires only <code>position</code> and <code>normal</code>
  36680. * attributes.
  36681. */
  36682. static readonly VERTEX_FORMAT: VertexFormat;
  36683. /**
  36684. * The {@link VertexFormat} that all {@link PerInstanceColorAppearance} instances
  36685. * are compatible with when {@link PerInstanceColorAppearance#flat} is <code>true</code>.
  36686. * This requires only a <code>position</code> attribute.
  36687. */
  36688. static readonly FLAT_VERTEX_FORMAT: VertexFormat;
  36689. /**
  36690. * Procedurally creates the full GLSL fragment shader source. For {@link PerInstanceColorAppearance},
  36691. * this is derived from {@link PerInstanceColorAppearance#fragmentShaderSource}, {@link PerInstanceColorAppearance#flat},
  36692. * and {@link PerInstanceColorAppearance#faceForward}.
  36693. * @returns The full GLSL fragment shader source.
  36694. */
  36695. getFragmentShaderSource(): string;
  36696. /**
  36697. * Determines if the geometry is translucent based on {@link PerInstanceColorAppearance#translucent}.
  36698. * @returns <code>true</code> if the appearance is translucent.
  36699. */
  36700. isTranslucent(): boolean;
  36701. /**
  36702. * Creates a render state. This is not the final render state instance; instead,
  36703. * it can contain a subset of render state properties identical to the render state
  36704. * created in the context.
  36705. * @returns The render state.
  36706. */
  36707. getRenderState(): any;
  36708. }
  36709. /**
  36710. * Options for performing point attenuation based on geometric error when rendering
  36711. * point clouds using 3D Tiles.
  36712. * @param [options] - Object with the following properties:
  36713. * @param [options.attenuation = false] - Perform point attenuation based on geometric error.
  36714. * @param [options.geometricErrorScale = 1.0] - Scale to be applied to each tile's geometric error.
  36715. * @param [options.maximumAttenuation] - Maximum attenuation in pixels. Defaults to the Cesium3DTileset's maximumScreenSpaceError.
  36716. * @param [options.baseResolution] - Average base resolution for the dataset in meters. Substitute for Geometric Error when not available.
  36717. * @param [options.eyeDomeLighting = true] - When true, use eye dome lighting when drawing with point attenuation.
  36718. * @param [options.eyeDomeLightingStrength = 1.0] - Increasing this value increases contrast on slopes and edges.
  36719. * @param [options.eyeDomeLightingRadius = 1.0] - Increase the thickness of contours from eye dome lighting.
  36720. * @param [options.backFaceCulling = false] - Determines whether back-facing points are hidden. This option works only if data has normals included.
  36721. * @param [options.normalShading = true] - Determines whether a point cloud that contains normals is shaded by the scene's light source.
  36722. */
  36723. export class PointCloudShading {
  36724. constructor(options?: {
  36725. attenuation?: boolean;
  36726. geometricErrorScale?: number;
  36727. maximumAttenuation?: number;
  36728. baseResolution?: number;
  36729. eyeDomeLighting?: boolean;
  36730. eyeDomeLightingStrength?: number;
  36731. eyeDomeLightingRadius?: number;
  36732. backFaceCulling?: boolean;
  36733. normalShading?: boolean;
  36734. });
  36735. /**
  36736. * Perform point attenuation based on geometric error.
  36737. */
  36738. attenuation: boolean;
  36739. /**
  36740. * Scale to be applied to the geometric error before computing attenuation.
  36741. */
  36742. geometricErrorScale: number;
  36743. /**
  36744. * Maximum point attenuation in pixels. If undefined, the Cesium3DTileset's maximumScreenSpaceError will be used.
  36745. */
  36746. maximumAttenuation: number;
  36747. /**
  36748. * Average base resolution for the dataset in meters.
  36749. * Used in place of geometric error when geometric error is 0.
  36750. * If undefined, an approximation will be computed for each tile that has geometric error of 0.
  36751. */
  36752. baseResolution: number;
  36753. /**
  36754. * Use eye dome lighting when drawing with point attenuation
  36755. * Requires support for EXT_frag_depth, OES_texture_float, and WEBGL_draw_buffers extensions in WebGL 1.0,
  36756. * otherwise eye dome lighting is ignored.
  36757. */
  36758. eyeDomeLighting: boolean;
  36759. /**
  36760. * Eye dome lighting strength (apparent contrast)
  36761. */
  36762. eyeDomeLightingStrength: number;
  36763. /**
  36764. * Thickness of contours from eye dome lighting
  36765. */
  36766. eyeDomeLightingRadius: number;
  36767. /**
  36768. * Determines whether back-facing points are hidden.
  36769. * This option works only if data has normals included.
  36770. */
  36771. backFaceCulling: boolean;
  36772. /**
  36773. * Determines whether a point cloud that contains normals is shaded by the scene's light source.
  36774. */
  36775. normalShading: boolean;
  36776. /**
  36777. * Determines if point cloud shading is supported.
  36778. * @param scene - The scene.
  36779. * @returns <code>true</code> if point cloud shading is supported; otherwise, returns <code>false</code>
  36780. */
  36781. static isSupported(scene: Scene): boolean;
  36782. }
  36783. /**
  36784. * A graphical point positioned in the 3D scene, that is created
  36785. * and rendered using a {@link PointPrimitiveCollection}. A point is created and its initial
  36786. * properties are set by calling {@link PointPrimitiveCollection#add}.
  36787. */
  36788. export class PointPrimitive {
  36789. constructor();
  36790. /**
  36791. * Determines if this point will be shown. Use this to hide or show a point, instead
  36792. * of removing it and re-adding it to the collection.
  36793. */
  36794. show: boolean;
  36795. /**
  36796. * Gets or sets the Cartesian position of this point.
  36797. */
  36798. position: Cartesian3;
  36799. /**
  36800. * Gets or sets near and far scaling properties of a point based on the point's distance from the camera.
  36801. * A point's scale will interpolate between the {@link NearFarScalar#nearValue} and
  36802. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  36803. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  36804. * Outside of these ranges the point's scale remains clamped to the nearest bound. This scale
  36805. * multiplies the pixelSize and outlineWidth to affect the total size of the point. If undefined,
  36806. * scaleByDistance will be disabled.
  36807. * @example
  36808. * // Example 1.
  36809. * // Set a pointPrimitive's scaleByDistance to scale to 15 when the
  36810. * // camera is 1500 meters from the pointPrimitive and disappear as
  36811. * // the camera distance approaches 8.0e6 meters.
  36812. * p.scaleByDistance = new Cesium.NearFarScalar(1.5e2, 15, 8.0e6, 0.0);
  36813. * @example
  36814. * // Example 2.
  36815. * // disable scaling by distance
  36816. * p.scaleByDistance = undefined;
  36817. */
  36818. scaleByDistance: NearFarScalar;
  36819. /**
  36820. * Gets or sets near and far translucency properties of a point based on the point's distance from the camera.
  36821. * A point's translucency will interpolate between the {@link NearFarScalar#nearValue} and
  36822. * {@link NearFarScalar#farValue} while the camera distance falls within the lower and upper bounds
  36823. * of the specified {@link NearFarScalar#near} and {@link NearFarScalar#far}.
  36824. * Outside of these ranges the point's translucency remains clamped to the nearest bound. If undefined,
  36825. * translucencyByDistance will be disabled.
  36826. * @example
  36827. * // Example 1.
  36828. * // Set a point's translucency to 1.0 when the
  36829. * // camera is 1500 meters from the point and disappear as
  36830. * // the camera distance approaches 8.0e6 meters.
  36831. * p.translucencyByDistance = new Cesium.NearFarScalar(1.5e2, 1.0, 8.0e6, 0.0);
  36832. * @example
  36833. * // Example 2.
  36834. * // disable translucency by distance
  36835. * p.translucencyByDistance = undefined;
  36836. */
  36837. translucencyByDistance: NearFarScalar;
  36838. /**
  36839. * Gets or sets the inner size of the point in pixels.
  36840. */
  36841. pixelSize: number;
  36842. /**
  36843. * Gets or sets the inner color of the point.
  36844. * The red, green, blue, and alpha values are indicated by <code>value</code>'s <code>red</code>, <code>green</code>,
  36845. * <code>blue</code>, and <code>alpha</code> properties as shown in Example 1. These components range from <code>0.0</code>
  36846. * (no intensity) to <code>1.0</code> (full intensity).
  36847. * @example
  36848. * // Example 1. Assign yellow.
  36849. * p.color = Cesium.Color.YELLOW;
  36850. * @example
  36851. * // Example 2. Make a pointPrimitive 50% translucent.
  36852. * p.color = new Cesium.Color(1.0, 1.0, 1.0, 0.5);
  36853. */
  36854. color: Color;
  36855. /**
  36856. * Gets or sets the outline color of the point.
  36857. */
  36858. outlineColor: Color;
  36859. /**
  36860. * Gets or sets the outline width in pixels. This width adds to pixelSize,
  36861. * increasing the total size of the point.
  36862. */
  36863. outlineWidth: number;
  36864. /**
  36865. * Gets or sets the condition specifying at what distance from the camera that this point will be displayed.
  36866. */
  36867. distanceDisplayCondition: DistanceDisplayCondition;
  36868. /**
  36869. * Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain.
  36870. * When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.
  36871. */
  36872. disableDepthTestDistance: number;
  36873. /**
  36874. * Gets or sets the user-defined value returned when the point is picked.
  36875. */
  36876. id: any;
  36877. /**
  36878. * Computes the screen-space position of the point's origin.
  36879. * The screen space origin is the top, left corner of the canvas; <code>x</code> increases from
  36880. * left to right, and <code>y</code> increases from top to bottom.
  36881. * @example
  36882. * console.log(p.computeScreenSpacePosition(scene).toString());
  36883. * @param scene - The scene.
  36884. * @param [result] - The object onto which to store the result.
  36885. * @returns The screen-space position of the point.
  36886. */
  36887. computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2;
  36888. /**
  36889. * Determines if this point equals another point. Points are equal if all their properties
  36890. * are equal. Points in different collections can be equal.
  36891. * @param other - The point to compare for equality.
  36892. * @returns <code>true</code> if the points are equal; otherwise, <code>false</code>.
  36893. */
  36894. equals(other: PointPrimitive): boolean;
  36895. }
  36896. /**
  36897. * A renderable collection of points.
  36898. * <br /><br />
  36899. * Points are added and removed from the collection using {@link PointPrimitiveCollection#add}
  36900. * and {@link PointPrimitiveCollection#remove}.
  36901. * @example
  36902. * // Create a pointPrimitive collection with two points
  36903. * const points = scene.primitives.add(new Cesium.PointPrimitiveCollection());
  36904. * points.add({
  36905. * position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  36906. * color : Cesium.Color.YELLOW
  36907. * });
  36908. * points.add({
  36909. * position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  36910. * color : Cesium.Color.CYAN
  36911. * });
  36912. * @param [options] - Object with the following properties:
  36913. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each point from model to world coordinates.
  36914. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  36915. * @param [options.blendOption = BlendOption.OPAQUE_AND_TRANSLUCENT] - The point blending option. The default
  36916. * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent,
  36917. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve performance by up to 2x.
  36918. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  36919. */
  36920. export class PointPrimitiveCollection {
  36921. constructor(options?: {
  36922. modelMatrix?: Matrix4;
  36923. debugShowBoundingVolume?: boolean;
  36924. blendOption?: BlendOption;
  36925. show?: boolean;
  36926. });
  36927. /**
  36928. * Determines if primitives in this collection will be shown.
  36929. */
  36930. show: boolean;
  36931. /**
  36932. * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates.
  36933. * When this is the identity matrix, the pointPrimitives are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  36934. * Local reference frames can be used by providing a different transformation matrix, like that returned
  36935. * by {@link Transforms.eastNorthUpToFixedFrame}.
  36936. * @example
  36937. * const center = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
  36938. * pointPrimitives.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
  36939. * pointPrimitives.add({
  36940. * color : Cesium.Color.ORANGE,
  36941. * position : new Cesium.Cartesian3(0.0, 0.0, 0.0) // center
  36942. * });
  36943. * pointPrimitives.add({
  36944. * color : Cesium.Color.YELLOW,
  36945. * position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0) // east
  36946. * });
  36947. * pointPrimitives.add({
  36948. * color : Cesium.Color.GREEN,
  36949. * position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0) // north
  36950. * });
  36951. * pointPrimitives.add({
  36952. * color : Cesium.Color.CYAN,
  36953. * position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) // up
  36954. * });
  36955. */
  36956. modelMatrix: Matrix4;
  36957. /**
  36958. * This property is for debugging only; it is not for production use nor is it optimized.
  36959. * <p>
  36960. * Draws the bounding sphere for each draw command in the primitive.
  36961. * </p>
  36962. */
  36963. debugShowBoundingVolume: boolean;
  36964. /**
  36965. * The point blending option. The default is used for rendering both opaque and translucent points.
  36966. * However, if either all of the points are completely opaque or all are completely translucent,
  36967. * setting the technique to BlendOption.OPAQUE or BlendOption.TRANSLUCENT can improve
  36968. * performance by up to 2x.
  36969. */
  36970. blendOption: BlendOption;
  36971. /**
  36972. * Returns the number of points in this collection. This is commonly used with
  36973. * {@link PointPrimitiveCollection#get} to iterate over all the points
  36974. * in the collection.
  36975. */
  36976. length: number;
  36977. /**
  36978. * Creates and adds a point with the specified initial properties to the collection.
  36979. * The added point is returned so it can be modified or removed from the collection later.
  36980. * @example
  36981. * // Example 1: Add a point, specifying all the default values.
  36982. * const p = pointPrimitives.add({
  36983. * show : true,
  36984. * position : Cesium.Cartesian3.ZERO,
  36985. * pixelSize : 10.0,
  36986. * color : Cesium.Color.WHITE,
  36987. * outlineColor : Cesium.Color.TRANSPARENT,
  36988. * outlineWidth : 0.0,
  36989. * id : undefined
  36990. * });
  36991. * @example
  36992. * // Example 2: Specify only the point's cartographic position.
  36993. * const p = pointPrimitives.add({
  36994. * position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
  36995. * });
  36996. * @param [options] - A template describing the point's properties as shown in Example 1.
  36997. * @returns The point that was added to the collection.
  36998. */
  36999. add(options?: any): PointPrimitive;
  37000. /**
  37001. * Removes a point from the collection.
  37002. * @example
  37003. * const p = pointPrimitives.add(...);
  37004. * pointPrimitives.remove(p); // Returns true
  37005. * @param pointPrimitive - The point to remove.
  37006. * @returns <code>true</code> if the point was removed; <code>false</code> if the point was not found in the collection.
  37007. */
  37008. remove(pointPrimitive: PointPrimitive): boolean;
  37009. /**
  37010. * Removes all points from the collection.
  37011. * @example
  37012. * pointPrimitives.add(...);
  37013. * pointPrimitives.add(...);
  37014. * pointPrimitives.removeAll();
  37015. */
  37016. removeAll(): void;
  37017. /**
  37018. * Check whether this collection contains a given point.
  37019. * @param [pointPrimitive] - The point to check for.
  37020. * @returns true if this collection contains the point, false otherwise.
  37021. */
  37022. contains(pointPrimitive?: PointPrimitive): boolean;
  37023. /**
  37024. * Returns the point in the collection at the specified index. Indices are zero-based
  37025. * and increase as points are added. Removing a point shifts all points after
  37026. * it to the left, changing their indices. This function is commonly used with
  37027. * {@link PointPrimitiveCollection#length} to iterate over all the points
  37028. * in the collection.
  37029. * @example
  37030. * // Toggle the show property of every point in the collection
  37031. * const len = pointPrimitives.length;
  37032. * for (let i = 0; i < len; ++i) {
  37033. * const p = pointPrimitives.get(i);
  37034. * p.show = !p.show;
  37035. * }
  37036. * @param index - The zero-based index of the point.
  37037. * @returns The point at the specified index.
  37038. */
  37039. get(index: number): PointPrimitive;
  37040. /**
  37041. * Returns true if this object was destroyed; otherwise, false.
  37042. * <br /><br />
  37043. * If this object was destroyed, it should not be used; calling any function other than
  37044. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37045. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37046. */
  37047. isDestroyed(): boolean;
  37048. /**
  37049. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37050. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37051. * <br /><br />
  37052. * Once an object is destroyed, it should not be used; calling any function other than
  37053. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37054. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37055. * @example
  37056. * pointPrimitives = pointPrimitives && pointPrimitives.destroy();
  37057. */
  37058. destroy(): void;
  37059. }
  37060. /**
  37061. * A renderable polyline. Create this by calling {@link PolylineCollection#add}
  37062. * @param options - Object with the following properties:
  37063. * @param [options.show = true] - <code>true</code> if this polyline will be shown; otherwise, <code>false</code>.
  37064. * @param [options.width = 1.0] - The width of the polyline in pixels.
  37065. * @param [options.loop = false] - Whether a line segment will be added between the last and first line positions to make this line a loop.
  37066. * @param [options.material = Material.ColorType] - The material.
  37067. * @param [options.positions] - The positions.
  37068. * @param [options.id] - The user-defined object to be returned when this polyline is picked.
  37069. * @param [options.distanceDisplayCondition] - The condition specifying at what distance from the camera that this polyline will be displayed.
  37070. * @param polylineCollection - The renderable polyline collection.
  37071. */
  37072. export class Polyline {
  37073. constructor(options: {
  37074. show?: boolean;
  37075. width?: number;
  37076. loop?: boolean;
  37077. material?: Material;
  37078. positions?: Cartesian3[];
  37079. id?: any;
  37080. distanceDisplayCondition?: DistanceDisplayCondition;
  37081. }, polylineCollection: PolylineCollection);
  37082. /**
  37083. * Determines if this polyline will be shown. Use this to hide or show a polyline, instead
  37084. * of removing it and re-adding it to the collection.
  37085. */
  37086. show: boolean;
  37087. /**
  37088. * Gets or sets the positions of the polyline.
  37089. * @example
  37090. * polyline.positions = Cesium.Cartesian3.fromDegreesArray([
  37091. * 0.0, 0.0,
  37092. * 10.0, 0.0,
  37093. * 0.0, 20.0
  37094. * ]);
  37095. */
  37096. positions: Cartesian3[];
  37097. /**
  37098. * 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
  37099. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  37100. */
  37101. material: Material;
  37102. /**
  37103. * Gets or sets the width of the polyline.
  37104. */
  37105. width: number;
  37106. /**
  37107. * Gets or sets whether a line segment will be added between the first and last polyline positions.
  37108. */
  37109. loop: boolean;
  37110. /**
  37111. * Gets or sets the user-defined value returned when the polyline is picked.
  37112. */
  37113. id: any;
  37114. /**
  37115. * Gets or sets the condition specifying at what distance from the camera that this polyline will be displayed.
  37116. */
  37117. distanceDisplayCondition: DistanceDisplayCondition;
  37118. }
  37119. /**
  37120. * A renderable collection of polylines.
  37121. * <br /><br />
  37122. * <div align="center">
  37123. * <img src="Images/Polyline.png" width="400" height="300" /><br />
  37124. * Example polylines
  37125. * </div>
  37126. * <br /><br />
  37127. * Polylines are added and removed from the collection using {@link PolylineCollection#add}
  37128. * and {@link PolylineCollection#remove}.
  37129. * @example
  37130. * // Create a polyline collection with two polylines
  37131. * const polylines = new Cesium.PolylineCollection();
  37132. * polylines.add({
  37133. * positions : Cesium.Cartesian3.fromDegreesArray([
  37134. * -75.10, 39.57,
  37135. * -77.02, 38.53,
  37136. * -80.50, 35.14,
  37137. * -80.12, 25.46]),
  37138. * width : 2
  37139. * });
  37140. *
  37141. * polylines.add({
  37142. * positions : Cesium.Cartesian3.fromDegreesArray([
  37143. * -73.10, 37.57,
  37144. * -75.02, 36.53,
  37145. * -78.50, 33.14,
  37146. * -78.12, 23.46]),
  37147. * width : 4
  37148. * });
  37149. * @param [options] - Object with the following properties:
  37150. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms each polyline from model to world coordinates.
  37151. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  37152. * @param [options.show = true] - Determines if the polylines in the collection will be shown.
  37153. */
  37154. export class PolylineCollection {
  37155. constructor(options?: {
  37156. modelMatrix?: Matrix4;
  37157. debugShowBoundingVolume?: boolean;
  37158. show?: boolean;
  37159. });
  37160. /**
  37161. * Determines if polylines in this collection will be shown.
  37162. */
  37163. show: boolean;
  37164. /**
  37165. * The 4x4 transformation matrix that transforms each polyline in this collection from model to world coordinates.
  37166. * When this is the identity matrix, the polylines are drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  37167. * Local reference frames can be used by providing a different transformation matrix, like that returned
  37168. * by {@link Transforms.eastNorthUpToFixedFrame}.
  37169. */
  37170. modelMatrix: Matrix4;
  37171. /**
  37172. * This property is for debugging only; it is not for production use nor is it optimized.
  37173. * <p>
  37174. * Draws the bounding sphere for each draw command in the primitive.
  37175. * </p>
  37176. */
  37177. debugShowBoundingVolume: boolean;
  37178. /**
  37179. * Returns the number of polylines in this collection. This is commonly used with
  37180. * {@link PolylineCollection#get} to iterate over all the polylines
  37181. * in the collection.
  37182. */
  37183. length: number;
  37184. /**
  37185. * Creates and adds a polyline with the specified initial properties to the collection.
  37186. * The added polyline is returned so it can be modified or removed from the collection later.
  37187. * @example
  37188. * // Example 1: Add a polyline, specifying all the default values.
  37189. * const p = polylines.add({
  37190. * show : true,
  37191. * positions : ellipsoid.cartographicArrayToCartesianArray([
  37192. * Cesium.Cartographic.fromDegrees(-75.10, 39.57),
  37193. * Cesium.Cartographic.fromDegrees(-77.02, 38.53)]),
  37194. * width : 1
  37195. * });
  37196. * @param [options] - A template describing the polyline's properties as shown in Example 1.
  37197. * @returns The polyline that was added to the collection.
  37198. */
  37199. add(options?: any): Polyline;
  37200. /**
  37201. * Removes a polyline from the collection.
  37202. * @example
  37203. * const p = polylines.add(...);
  37204. * polylines.remove(p); // Returns true
  37205. * @param polyline - The polyline to remove.
  37206. * @returns <code>true</code> if the polyline was removed; <code>false</code> if the polyline was not found in the collection.
  37207. */
  37208. remove(polyline: Polyline): boolean;
  37209. /**
  37210. * Removes all polylines from the collection.
  37211. * @example
  37212. * polylines.add(...);
  37213. * polylines.add(...);
  37214. * polylines.removeAll();
  37215. */
  37216. removeAll(): void;
  37217. /**
  37218. * Determines if this collection contains the specified polyline.
  37219. * @param polyline - The polyline to check for.
  37220. * @returns true if this collection contains the polyline, false otherwise.
  37221. */
  37222. contains(polyline: Polyline): boolean;
  37223. /**
  37224. * Returns the polyline in the collection at the specified index. Indices are zero-based
  37225. * and increase as polylines are added. Removing a polyline shifts all polylines after
  37226. * it to the left, changing their indices. This function is commonly used with
  37227. * {@link PolylineCollection#length} to iterate over all the polylines
  37228. * in the collection.
  37229. * @example
  37230. * // Toggle the show property of every polyline in the collection
  37231. * const len = polylines.length;
  37232. * for (let i = 0; i < len; ++i) {
  37233. * const p = polylines.get(i);
  37234. * p.show = !p.show;
  37235. * }
  37236. * @param index - The zero-based index of the polyline.
  37237. * @returns The polyline at the specified index.
  37238. */
  37239. get(index: number): Polyline;
  37240. /**
  37241. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  37242. * get the draw commands needed to render this primitive.
  37243. * <p>
  37244. * Do not call this function directly. This is documented just to
  37245. * list the exceptions that may be propagated when the scene is rendered:
  37246. * </p>
  37247. */
  37248. update(): void;
  37249. /**
  37250. * Returns true if this object was destroyed; otherwise, false.
  37251. * <br /><br />
  37252. * If this object was destroyed, it should not be used; calling any function other than
  37253. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37254. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37255. */
  37256. isDestroyed(): boolean;
  37257. /**
  37258. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37259. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37260. * <br /><br />
  37261. * Once an object is destroyed, it should not be used; calling any function other than
  37262. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37263. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37264. * @example
  37265. * polylines = polylines && polylines.destroy();
  37266. */
  37267. destroy(): void;
  37268. }
  37269. /**
  37270. * An appearance for {@link GeometryInstance} instances with color attributes and
  37271. * {@link PolylineGeometry} or {@link GroundPolylineGeometry}.
  37272. * This allows several geometry instances, each with a different color, to
  37273. * be drawn with the same {@link Primitive}.
  37274. * @example
  37275. * // A solid white line segment
  37276. * const primitive = new Cesium.Primitive({
  37277. * geometryInstances : new Cesium.GeometryInstance({
  37278. * geometry : new Cesium.PolylineGeometry({
  37279. * positions : Cesium.Cartesian3.fromDegreesArray([
  37280. * 0.0, 0.0,
  37281. * 5.0, 0.0
  37282. * ]),
  37283. * width : 10.0,
  37284. * vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT
  37285. * }),
  37286. * attributes : {
  37287. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 1.0, 1.0, 1.0))
  37288. * }
  37289. * }),
  37290. * appearance : new Cesium.PolylineColorAppearance({
  37291. * translucent : false
  37292. * })
  37293. * });
  37294. * @param [options] - Object with the following properties:
  37295. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  37296. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  37297. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  37298. * @param [options.renderState] - Optional render state to override the default render state.
  37299. */
  37300. export class PolylineColorAppearance {
  37301. constructor(options?: {
  37302. translucent?: boolean;
  37303. vertexShaderSource?: string;
  37304. fragmentShaderSource?: string;
  37305. renderState?: any;
  37306. });
  37307. /**
  37308. * This property is part of the {@link Appearance} interface, but is not
  37309. * used by {@link PolylineColorAppearance} since a fully custom fragment shader is used.
  37310. */
  37311. material: Material;
  37312. /**
  37313. * When <code>true</code>, the geometry is expected to appear translucent so
  37314. * {@link PolylineColorAppearance#renderState} has alpha blending enabled.
  37315. */
  37316. translucent: boolean;
  37317. /**
  37318. * The GLSL source code for the vertex shader.
  37319. */
  37320. readonly vertexShaderSource: string;
  37321. /**
  37322. * The GLSL source code for the fragment shader.
  37323. */
  37324. readonly fragmentShaderSource: string;
  37325. /**
  37326. * The WebGL fixed-function state to use when rendering the geometry.
  37327. * <p>
  37328. * The render state can be explicitly defined when constructing a {@link PolylineColorAppearance}
  37329. * instance, or it is set implicitly via {@link PolylineColorAppearance#translucent}.
  37330. * </p>
  37331. */
  37332. readonly renderState: any;
  37333. /**
  37334. * When <code>true</code>, the geometry is expected to be closed so
  37335. * {@link PolylineColorAppearance#renderState} has backface culling enabled.
  37336. * This is always <code>false</code> for <code>PolylineColorAppearance</code>.
  37337. */
  37338. readonly closed: boolean;
  37339. /**
  37340. * The {@link VertexFormat} that this appearance instance is compatible with.
  37341. * A geometry can have more vertex attributes and still be compatible - at a
  37342. * potential performance cost - but it can't have less.
  37343. */
  37344. readonly vertexFormat: VertexFormat;
  37345. /**
  37346. * The {@link VertexFormat} that all {@link PolylineColorAppearance} instances
  37347. * are compatible with. This requires only a <code>position</code> attribute.
  37348. */
  37349. static readonly VERTEX_FORMAT: VertexFormat;
  37350. /**
  37351. * Procedurally creates the full GLSL fragment shader source.
  37352. * @returns The full GLSL fragment shader source.
  37353. */
  37354. getFragmentShaderSource(): string;
  37355. /**
  37356. * Determines if the geometry is translucent based on {@link PolylineColorAppearance#translucent}.
  37357. * @returns <code>true</code> if the appearance is translucent.
  37358. */
  37359. isTranslucent(): boolean;
  37360. /**
  37361. * Creates a render state. This is not the final render state instance; instead,
  37362. * it can contain a subset of render state properties identical to the render state
  37363. * created in the context.
  37364. * @returns The render state.
  37365. */
  37366. getRenderState(): any;
  37367. }
  37368. /**
  37369. * An appearance for {@link PolylineGeometry} that supports shading with materials.
  37370. * @example
  37371. * const primitive = new Cesium.Primitive({
  37372. * geometryInstances : new Cesium.GeometryInstance({
  37373. * geometry : new Cesium.PolylineGeometry({
  37374. * positions : Cesium.Cartesian3.fromDegreesArray([
  37375. * 0.0, 0.0,
  37376. * 5.0, 0.0
  37377. * ]),
  37378. * width : 10.0,
  37379. * vertexFormat : Cesium.PolylineMaterialAppearance.VERTEX_FORMAT
  37380. * })
  37381. * }),
  37382. * appearance : new Cesium.PolylineMaterialAppearance({
  37383. * material : Cesium.Material.fromType('Color')
  37384. * })
  37385. * });
  37386. * @param [options] - Object with the following properties:
  37387. * @param [options.translucent = true] - When <code>true</code>, the geometry is expected to appear translucent so {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  37388. * @param [options.material = Material.ColorType] - The material used to determine the fragment color.
  37389. * @param [options.vertexShaderSource] - Optional GLSL vertex shader source to override the default vertex shader.
  37390. * @param [options.fragmentShaderSource] - Optional GLSL fragment shader source to override the default fragment shader.
  37391. * @param [options.renderState] - Optional render state to override the default render state.
  37392. */
  37393. export class PolylineMaterialAppearance {
  37394. constructor(options?: {
  37395. translucent?: boolean;
  37396. material?: Material;
  37397. vertexShaderSource?: string;
  37398. fragmentShaderSource?: string;
  37399. renderState?: any;
  37400. });
  37401. /**
  37402. * The material used to determine the fragment color. Unlike other {@link PolylineMaterialAppearance}
  37403. * properties, this is not read-only, so an appearance's material can change on the fly.
  37404. */
  37405. material: Material;
  37406. /**
  37407. * When <code>true</code>, the geometry is expected to appear translucent so
  37408. * {@link PolylineMaterialAppearance#renderState} has alpha blending enabled.
  37409. */
  37410. translucent: boolean;
  37411. /**
  37412. * The GLSL source code for the vertex shader.
  37413. */
  37414. readonly vertexShaderSource: string;
  37415. /**
  37416. * The GLSL source code for the fragment shader.
  37417. */
  37418. readonly fragmentShaderSource: string;
  37419. /**
  37420. * The WebGL fixed-function state to use when rendering the geometry.
  37421. * <p>
  37422. * The render state can be explicitly defined when constructing a {@link PolylineMaterialAppearance}
  37423. * instance, or it is set implicitly via {@link PolylineMaterialAppearance#translucent}
  37424. * and {@link PolylineMaterialAppearance#closed}.
  37425. * </p>
  37426. */
  37427. readonly renderState: any;
  37428. /**
  37429. * When <code>true</code>, the geometry is expected to be closed so
  37430. * {@link PolylineMaterialAppearance#renderState} has backface culling enabled.
  37431. * This is always <code>false</code> for <code>PolylineMaterialAppearance</code>.
  37432. */
  37433. readonly closed: boolean;
  37434. /**
  37435. * The {@link VertexFormat} that this appearance instance is compatible with.
  37436. * A geometry can have more vertex attributes and still be compatible - at a
  37437. * potential performance cost - but it can't have less.
  37438. */
  37439. readonly vertexFormat: VertexFormat;
  37440. /**
  37441. * The {@link VertexFormat} that all {@link PolylineMaterialAppearance} instances
  37442. * are compatible with. This requires <code>position</code> and <code>st</code> attributes.
  37443. */
  37444. static readonly VERTEX_FORMAT: VertexFormat;
  37445. /**
  37446. * Procedurally creates the full GLSL fragment shader source. For {@link PolylineMaterialAppearance},
  37447. * this is derived from {@link PolylineMaterialAppearance#fragmentShaderSource} and {@link PolylineMaterialAppearance#material}.
  37448. * @returns The full GLSL fragment shader source.
  37449. */
  37450. getFragmentShaderSource(): string;
  37451. /**
  37452. * Determines if the geometry is translucent based on {@link PolylineMaterialAppearance#translucent} and {@link Material#isTranslucent}.
  37453. * @returns <code>true</code> if the appearance is translucent.
  37454. */
  37455. isTranslucent(): boolean;
  37456. /**
  37457. * Creates a render state. This is not the final render state instance; instead,
  37458. * it can contain a subset of render state properties identical to the render state
  37459. * created in the context.
  37460. * @returns The render state.
  37461. */
  37462. getRenderState(): any;
  37463. }
  37464. /**
  37465. * Runs a post-process stage on either the texture rendered by the scene or the output of a previous post-process stage.
  37466. * @example
  37467. * // Simple stage to change the color
  37468. * const fs =
  37469. * 'uniform sampler2D colorTexture;\n' +
  37470. * 'varying vec2 v_textureCoordinates;\n' +
  37471. * 'uniform float scale;\n' +
  37472. * 'uniform vec3 offset;\n' +
  37473. * 'void main() {\n' +
  37474. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  37475. * ' gl_FragColor = vec4(color.rgb * scale + offset, 1.0);\n' +
  37476. * '}\n';
  37477. * scene.postProcessStages.add(new Cesium.PostProcessStage({
  37478. * fragmentShader : fs,
  37479. * uniforms : {
  37480. * scale : 1.1,
  37481. * offset : function() {
  37482. * return new Cesium.Cartesian3(0.1, 0.2, 0.3);
  37483. * }
  37484. * }
  37485. * }));
  37486. * @example
  37487. * // Simple stage to change the color of what is selected.
  37488. * // If czm_selected returns true, the current fragment belongs to geometry in the selected array.
  37489. * const fs =
  37490. * 'uniform sampler2D colorTexture;\n' +
  37491. * 'varying vec2 v_textureCoordinates;\n' +
  37492. * 'uniform vec4 highlight;\n' +
  37493. * 'void main() {\n' +
  37494. * ' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
  37495. * ' if (czm_selected()) {\n' +
  37496. * ' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' +
  37497. * ' gl_FragColor = vec4(highlighted, 1.0);\n' +
  37498. * ' } else { \n' +
  37499. * ' gl_FragColor = color;\n' +
  37500. * ' }\n' +
  37501. * '}\n';
  37502. * const stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
  37503. * fragmentShader : fs,
  37504. * uniforms : {
  37505. * highlight : function() {
  37506. * return new Cesium.Color(1.0, 0.0, 0.0, 0.5);
  37507. * }
  37508. * }
  37509. * }));
  37510. * stage.selected = [cesium3DTileFeature];
  37511. * @param options - An object with the following properties:
  37512. * @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.
  37513. * @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.
  37514. * @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.
  37515. * @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.
  37516. * @param [options.sampleMode = PostProcessStageSampleMode.NEAREST] - How to sample the input color texture.
  37517. * @param [options.pixelFormat = PixelFormat.RGBA] - The color pixel format of the output texture.
  37518. * @param [options.pixelDatatype = PixelDatatype.UNSIGNED_BYTE] - The pixel data type of the output texture.
  37519. * @param [options.clearColor = Color.BLACK] - The color to clear the output texture to.
  37520. * @param [options.scissorRectangle] - The rectangle to use for the scissor test.
  37521. * @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.
  37522. */
  37523. export class PostProcessStage {
  37524. constructor(options: {
  37525. fragmentShader: string;
  37526. uniforms?: any;
  37527. textureScale?: number;
  37528. forcePowerOfTwo?: boolean;
  37529. sampleMode?: PostProcessStageSampleMode;
  37530. pixelFormat?: PixelFormat;
  37531. pixelDatatype?: PixelDatatype;
  37532. clearColor?: Color;
  37533. scissorRectangle?: BoundingRectangle;
  37534. name?: string;
  37535. });
  37536. /**
  37537. * Whether or not to execute this post-process stage when ready.
  37538. */
  37539. enabled: boolean;
  37540. /**
  37541. * Determines if this post-process stage is ready to be executed. A stage is only executed when both <code>ready</code>
  37542. * and {@link PostProcessStage#enabled} are <code>true</code>. A stage will not be ready while it is waiting on textures
  37543. * to load.
  37544. */
  37545. readonly ready: boolean;
  37546. /**
  37547. * The unique name of this post-process stage for reference by other stages in a {@link PostProcessStageComposite}.
  37548. */
  37549. readonly name: string;
  37550. /**
  37551. * The fragment shader to use when execute this post-process stage.
  37552. * <p>
  37553. * The shader must contain a sampler uniform declaration for <code>colorTexture</code>, <code>depthTexture</code>,
  37554. * or both.
  37555. * </p>
  37556. * <p>
  37557. * The shader must contain a <code>vec2</code> varying declaration for <code>v_textureCoordinates</code> for sampling
  37558. * the texture uniforms.
  37559. * </p>
  37560. */
  37561. readonly fragmentShader: string;
  37562. /**
  37563. * An object whose properties are used to set the uniforms of the fragment shader.
  37564. * <p>
  37565. * The object property values can be either a constant or a function. The function will be called
  37566. * each frame before the post-process stage is executed.
  37567. * </p>
  37568. * <p>
  37569. * 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.
  37570. * </p>
  37571. * <p>
  37572. * If this post-process stage is part of a {@link PostProcessStageComposite} that does not execute in series, the constant value can also be
  37573. * the name of another stage in a composite. This will set the uniform to the output texture the stage with that name.
  37574. * </p>
  37575. */
  37576. readonly uniforms: any;
  37577. /**
  37578. * 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.
  37579. */
  37580. readonly textureScale: number;
  37581. /**
  37582. * 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.
  37583. */
  37584. readonly forcePowerOfTwo: number;
  37585. /**
  37586. * How to sample the input color texture.
  37587. */
  37588. readonly sampleMode: PostProcessStageSampleMode;
  37589. /**
  37590. * The color pixel format of the output texture.
  37591. */
  37592. readonly pixelFormat: PixelFormat;
  37593. /**
  37594. * The pixel data type of the output texture.
  37595. */
  37596. readonly pixelDatatype: PixelDatatype;
  37597. /**
  37598. * The color to clear the output texture to.
  37599. */
  37600. readonly clearColor: Color;
  37601. /**
  37602. * The {@link BoundingRectangle} to use for the scissor test. A default bounding rectangle will disable the scissor test.
  37603. */
  37604. readonly scissorRectangle: BoundingRectangle;
  37605. /**
  37606. * The features selected for applying the post-process.
  37607. * <p>
  37608. * In the fragment shader, use <code>czm_selected</code> to determine whether or not to apply the post-process
  37609. * stage to that fragment. For example:
  37610. * <code>
  37611. * if (czm_selected(v_textureCoordinates)) {
  37612. * // apply post-process stage
  37613. * } else {
  37614. * gl_FragColor = texture2D(colorTexture, v_textureCordinates);
  37615. * }
  37616. * </code>
  37617. * </p>
  37618. */
  37619. selected: any[];
  37620. /**
  37621. * Returns true if this object was destroyed; otherwise, false.
  37622. * <p>
  37623. * If this object was destroyed, it should not be used; calling any function other than
  37624. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37625. * </p>
  37626. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37627. */
  37628. isDestroyed(): boolean;
  37629. /**
  37630. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37631. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37632. * <p>
  37633. * Once an object is destroyed, it should not be used; calling any function other than
  37634. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37635. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37636. * </p>
  37637. */
  37638. destroy(): void;
  37639. }
  37640. /**
  37641. * A collection of {@link PostProcessStage}s and/or {@link PostProcessStageComposite}s.
  37642. * <p>
  37643. * The input texture for each post-process stage is the texture rendered to by the scene or the texture rendered
  37644. * to by the previous stage in the collection.
  37645. * </p>
  37646. * <p>
  37647. * If the ambient occlusion or bloom stages are enabled, they will execute before all other stages.
  37648. * </p>
  37649. * <p>
  37650. * If the FXAA stage is enabled, it will execute after all other stages.
  37651. * </p>
  37652. */
  37653. export class PostProcessStageCollection {
  37654. constructor();
  37655. /**
  37656. * Determines if all of the post-process stages in the collection are ready to be executed.
  37657. */
  37658. readonly ready: boolean;
  37659. /**
  37660. * A post-process stage for Fast Approximate Anti-aliasing.
  37661. * <p>
  37662. * When enabled, this stage will execute after all others.
  37663. * </p>
  37664. */
  37665. readonly fxaa: PostProcessStage;
  37666. /**
  37667. * A post-process stage that applies Horizon-based Ambient Occlusion (HBAO) to the input texture.
  37668. * <p>
  37669. * Ambient occlusion simulates shadows from ambient light. These shadows would always be present when the
  37670. * surface receives light and regardless of the light's position.
  37671. * </p>
  37672. * <p>
  37673. * The uniforms have the following properties: <code>intensity</code>, <code>bias</code>, <code>lengthCap</code>,
  37674. * <code>stepSize</code>, <code>frustumLength</code>, <code>ambientOcclusionOnly</code>,
  37675. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code>.
  37676. * </p>
  37677. * <ul>
  37678. * <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>
  37679. *
  37680. * <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,
  37681. * 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>
  37682. *
  37683. * <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,
  37684. * sampling stops in the current direction. The default value is <code>0.26</code>.</li>
  37685. *
  37686. * <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>
  37687. *
  37688. * <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.
  37689. * The default value is <code>1000.0</code>.</li>
  37690. *
  37691. * <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
  37692. * 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>
  37693. * </ul>
  37694. * <p>
  37695. * <code>delta</code>, <code>sigma</code>, and <code>blurStepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  37696. * The blur is applied to the shadows generated from the image to make them smoother.
  37697. * </p>
  37698. * <p>
  37699. * When enabled, this stage will execute before all others.
  37700. * </p>
  37701. */
  37702. readonly ambientOcclusion: PostProcessStageComposite;
  37703. /**
  37704. * A post-process stage for a bloom effect.
  37705. * <p>
  37706. * A bloom effect adds glow effect, makes bright areas brighter, and dark areas darker.
  37707. * </p>
  37708. * <p>
  37709. * This stage has the following uniforms: <code>contrast</code>, <code>brightness</code>, <code>glowOnly</code>,
  37710. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  37711. * </p>
  37712. * <ul>
  37713. * <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>
  37714. *
  37715. * <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
  37716. * added to the brightness. The default value is <code>-0.3</code>.</li>
  37717. *
  37718. * <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.
  37719. * The default value is <code>false</code>. This is a debug option for viewing the effects when changing the other uniform values.</li>
  37720. * </ul>
  37721. * <p>
  37722. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  37723. * The blur is applied to the shadows generated from the image to make them smoother.
  37724. * </p>
  37725. * <p>
  37726. * When enabled, this stage will execute before all others.
  37727. * </p>
  37728. */
  37729. readonly bloom: PostProcessStageComposite;
  37730. /**
  37731. * The number of post-process stages in this collection.
  37732. */
  37733. readonly length: number;
  37734. /**
  37735. * Adds the post-process stage to the collection.
  37736. * @param stage - The post-process stage to add to the collection.
  37737. * @returns The post-process stage that was added to the collection.
  37738. */
  37739. add(stage: PostProcessStage | PostProcessStageComposite): PostProcessStage | PostProcessStageComposite;
  37740. /**
  37741. * Removes a post-process stage from the collection and destroys it.
  37742. * @param stage - The post-process stage to remove from the collection.
  37743. * @returns Whether the post-process stage was removed.
  37744. */
  37745. remove(stage: PostProcessStage | PostProcessStageComposite): boolean;
  37746. /**
  37747. * Returns whether the collection contains a post-process stage.
  37748. * @param stage - The post-process stage.
  37749. * @returns Whether the collection contains the post-process stage.
  37750. */
  37751. contains(stage: PostProcessStage | PostProcessStageComposite): boolean;
  37752. /**
  37753. * Gets the post-process stage at <code>index</code>.
  37754. * @param index - The index of the post-process stage.
  37755. * @returns The post-process stage at index.
  37756. */
  37757. get(index: number): PostProcessStage | PostProcessStageComposite;
  37758. /**
  37759. * Removes all post-process stages from the collection and destroys them.
  37760. */
  37761. removeAll(): void;
  37762. /**
  37763. * Returns true if this object was destroyed; otherwise, false.
  37764. * <p>
  37765. * If this object was destroyed, it should not be used; calling any function other than
  37766. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37767. * </p>
  37768. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37769. */
  37770. isDestroyed(): boolean;
  37771. /**
  37772. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37773. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37774. * <p>
  37775. * Once an object is destroyed, it should not be used; calling any function other than
  37776. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37777. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37778. * </p>
  37779. */
  37780. destroy(): void;
  37781. }
  37782. /**
  37783. * A collection of {@link PostProcessStage}s or other post-process composite stages that execute together logically.
  37784. * <p>
  37785. * All stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  37786. * 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.
  37787. * 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
  37788. * or the output texture of the previous stage.
  37789. * </p>
  37790. * @example
  37791. * // Example 1: separable blur filter
  37792. * // The input to blurXDirection is the texture rendered to by the scene or the output of the previous stage.
  37793. * // The input to blurYDirection is the texture rendered to by blurXDirection.
  37794. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  37795. * stages : [blurXDirection, blurYDirection]
  37796. * }));
  37797. * @example
  37798. * // Example 2: referencing the output of another post-process stage
  37799. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  37800. * inputPreviousStageTexture : false,
  37801. * stages : [
  37802. * // The same as Example 1.
  37803. * new Cesium.PostProcessStageComposite({
  37804. * inputPreviousStageTexture : true
  37805. * stages : [blurXDirection, blurYDirection],
  37806. * name : 'blur'
  37807. * }),
  37808. * // The input texture for this stage is the same input texture to blurXDirection since inputPreviousStageTexture is false
  37809. * new Cesium.PostProcessStage({
  37810. * fragmentShader : compositeShader,
  37811. * uniforms : {
  37812. * blurTexture : 'blur' // The output of the composite with name 'blur' (the texture that blurYDirection rendered to).
  37813. * }
  37814. * })
  37815. * ]
  37816. * });
  37817. * @example
  37818. * // Example 3: create a uniform alias
  37819. * const uniforms = {};
  37820. * Cesium.defineProperties(uniforms, {
  37821. * filterSize : {
  37822. * get : function() {
  37823. * return blurXDirection.uniforms.filterSize;
  37824. * },
  37825. * set : function(value) {
  37826. * blurXDirection.uniforms.filterSize = blurYDirection.uniforms.filterSize = value;
  37827. * }
  37828. * }
  37829. * });
  37830. * scene.postProcessStages.add(new Cesium.PostProcessStageComposite({
  37831. * stages : [blurXDirection, blurYDirection],
  37832. * uniforms : uniforms
  37833. * }));
  37834. * @param options - An object with the following properties:
  37835. * @param options.stages - An array of {@link PostProcessStage}s or composites to be executed in order.
  37836. * @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.
  37837. * @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.
  37838. * @param [options.uniforms] - An alias to the uniforms of post-process stages.
  37839. */
  37840. export class PostProcessStageComposite {
  37841. constructor(options: {
  37842. stages: any[];
  37843. inputPreviousStageTexture?: boolean;
  37844. name?: string;
  37845. uniforms?: any;
  37846. });
  37847. /**
  37848. * Determines if this post-process stage is ready to be executed.
  37849. */
  37850. readonly ready: boolean;
  37851. /**
  37852. * The unique name of this post-process stage for reference by other stages in a PostProcessStageComposite.
  37853. */
  37854. readonly name: string;
  37855. /**
  37856. * Whether or not to execute this post-process stage when ready.
  37857. */
  37858. enabled: boolean;
  37859. /**
  37860. * 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.
  37861. */
  37862. uniforms: any;
  37863. /**
  37864. * All post-process stages are executed in the order of the array. The input texture changes based on the value of <code>inputPreviousStageTexture</code>.
  37865. * 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.
  37866. * 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
  37867. * or the output texture of the previous stage.
  37868. */
  37869. readonly inputPreviousStageTexture: boolean;
  37870. /**
  37871. * The number of post-process stages in this composite.
  37872. */
  37873. readonly length: number;
  37874. /**
  37875. * The features selected for applying the post-process.
  37876. */
  37877. selected: any[];
  37878. /**
  37879. * Gets the post-process stage at <code>index</code>
  37880. * @param index - The index of the post-process stage or composite.
  37881. * @returns The post-process stage or composite at index.
  37882. */
  37883. get(index: number): PostProcessStage | PostProcessStageComposite;
  37884. /**
  37885. * Returns true if this object was destroyed; otherwise, false.
  37886. * <p>
  37887. * If this object was destroyed, it should not be used; calling any function other than
  37888. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  37889. * </p>
  37890. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  37891. */
  37892. isDestroyed(): boolean;
  37893. /**
  37894. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  37895. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  37896. * <p>
  37897. * Once an object is destroyed, it should not be used; calling any function other than
  37898. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  37899. * assign the return value (<code>undefined</code>) to the object as done in the example.
  37900. * </p>
  37901. */
  37902. destroy(): void;
  37903. }
  37904. /**
  37905. * Contains functions for creating common post-process stages.
  37906. */
  37907. export namespace PostProcessStageLibrary {
  37908. /**
  37909. * Creates a post-process stage that applies a Gaussian blur to the input texture. This stage is usually applied in conjunction with another stage.
  37910. * <p>
  37911. * This stage has the following uniforms: <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  37912. * </p>
  37913. * <p>
  37914. * <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>.
  37915. * The default value for <code>delta</code> is <code>1.0</code>. The default value for <code>sigma</code> is <code>2.0</code>.
  37916. * <code>stepSize</code> is the distance to the next texel. The default is <code>1.0</code>.
  37917. * </p>
  37918. * @returns A post-process stage that applies a Gaussian blur to the input texture.
  37919. */
  37920. function createBlurStage(): PostProcessStageComposite;
  37921. /**
  37922. * Creates a post-process stage that applies a depth of field effect.
  37923. * <p>
  37924. * Depth of field simulates camera focus. Objects in the scene that are in focus
  37925. * will be clear whereas objects not in focus will be blurred.
  37926. * </p>
  37927. * <p>
  37928. * This stage has the following uniforms: <code>focalDistance</code>, <code>delta</code>, <code>sigma</code>, and <code>stepSize</code>.
  37929. * </p>
  37930. * <p>
  37931. * <code>focalDistance</code> is the distance in meters from the camera to set the camera focus.
  37932. * </p>
  37933. * <p>
  37934. * <code>delta</code>, <code>sigma</code>, and <code>stepSize</code> are the same properties as {@link PostProcessStageLibrary#createBlurStage}.
  37935. * The blur is applied to the areas out of focus.
  37936. * </p>
  37937. * @returns A post-process stage that applies a depth of field effect.
  37938. */
  37939. function createDepthOfFieldStage(): PostProcessStageComposite;
  37940. /**
  37941. * Whether or not a depth of field stage is supported.
  37942. * <p>
  37943. * This stage requires the WEBGL_depth_texture extension.
  37944. * </p>
  37945. * @param scene - The scene.
  37946. * @returns Whether this post process stage is supported.
  37947. */
  37948. function isDepthOfFieldSupported(scene: Scene): boolean;
  37949. /**
  37950. * Creates a post-process stage that detects edges.
  37951. * <p>
  37952. * Writes the color to the output texture with alpha set to 1.0 when it is on an edge.
  37953. * </p>
  37954. * <p>
  37955. * This stage has the following uniforms: <code>color</code> and <code>length</code>
  37956. * </p>
  37957. * <ul>
  37958. * <li><code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.</li>
  37959. * <li><code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.</li>
  37960. * </ul>
  37961. * <p>
  37962. * This stage is not supported in 2D.
  37963. * </p>
  37964. * @example
  37965. * // multiple silhouette effects
  37966. * const yellowEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  37967. * yellowEdge.uniforms.color = Cesium.Color.YELLOW;
  37968. * yellowEdge.selected = [feature0];
  37969. *
  37970. * const greenEdge = Cesium.PostProcessLibrary.createEdgeDetectionStage();
  37971. * greenEdge.uniforms.color = Cesium.Color.LIME;
  37972. * greenEdge.selected = [feature1];
  37973. *
  37974. * // draw edges around feature0 and feature1
  37975. * postProcessStages.add(Cesium.PostProcessLibrary.createSilhouetteStage([yellowEdge, greenEdge]);
  37976. * @returns A post-process stage that applies an edge detection effect.
  37977. */
  37978. function createEdgeDetectionStage(): PostProcessStage;
  37979. /**
  37980. * Whether or not an edge detection stage is supported.
  37981. * <p>
  37982. * This stage requires the WEBGL_depth_texture extension.
  37983. * </p>
  37984. * @param scene - The scene.
  37985. * @returns Whether this post process stage is supported.
  37986. */
  37987. function isEdgeDetectionSupported(scene: Scene): boolean;
  37988. /**
  37989. * Creates a post-process stage that applies a silhouette effect.
  37990. * <p>
  37991. * A silhouette effect composites the color from the edge detection pass with input color texture.
  37992. * </p>
  37993. * <p>
  37994. * This stage has the following uniforms when <code>edgeDetectionStages</code> is <code>undefined</code>: <code>color</code> and <code>length</code>
  37995. * </p>
  37996. * <p>
  37997. * <code>color</code> is the color of the highlighted edge. The default is {@link Color#BLACK}.
  37998. * <code>length</code> is the length of the edges in pixels. The default is <code>0.5</code>.
  37999. * </p>
  38000. * @param [edgeDetectionStages] - An array of edge detection post process stages.
  38001. * @returns A post-process stage that applies a silhouette effect.
  38002. */
  38003. function createSilhouetteStage(edgeDetectionStages?: PostProcessStage[]): PostProcessStageComposite;
  38004. /**
  38005. * Whether or not a silhouette stage is supported.
  38006. * <p>
  38007. * This stage requires the WEBGL_depth_texture extension.
  38008. * </p>
  38009. * @param scene - The scene.
  38010. * @returns Whether this post process stage is supported.
  38011. */
  38012. function isSilhouetteSupported(scene: Scene): boolean;
  38013. /**
  38014. * Whether or not an ambient occlusion stage is supported.
  38015. * <p>
  38016. * This stage requires the WEBGL_depth_texture extension.
  38017. * </p>
  38018. * @param scene - The scene.
  38019. * @returns Whether this post process stage is supported.
  38020. */
  38021. function isAmbientOcclusionSupported(scene: Scene): boolean;
  38022. /**
  38023. * Creates a post-process stage that renders the input texture with black and white gradations.
  38024. * <p>
  38025. * This stage has one uniform value, <code>gradations</code>, which scales the luminance of each pixel.
  38026. * </p>
  38027. * @returns A post-process stage that renders the input texture with black and white gradations.
  38028. */
  38029. function createBlackAndWhiteStage(): PostProcessStage;
  38030. /**
  38031. * Creates a post-process stage that saturates the input texture.
  38032. * <p>
  38033. * This stage has one uniform value, <code>brightness</code>, which scales the saturation of each pixel.
  38034. * </p>
  38035. * @returns A post-process stage that saturates the input texture.
  38036. */
  38037. function createBrightnessStage(): PostProcessStage;
  38038. /**
  38039. * Creates a post-process stage that adds a night vision effect to the input texture.
  38040. * @returns A post-process stage that adds a night vision effect to the input texture.
  38041. */
  38042. function createNightVisionStage(): PostProcessStage;
  38043. /**
  38044. * Creates a post-process stage that applies an effect simulating light flaring a camera lens.
  38045. * <p>
  38046. * This stage has the following uniforms: <code>dirtTexture</code>, <code>starTexture</code>, <code>intensity</code>, <code>distortion</code>, <code>ghostDispersal</code>,
  38047. * <code>haloWidth</code>, <code>dirtAmount</code>, and <code>earthRadius</code>.
  38048. * <ul>
  38049. * <li><code>dirtTexture</code> is a texture sampled to simulate dirt on the lens.</li>
  38050. * <li><code>starTexture</code> is the texture sampled for the star pattern of the flare.</li>
  38051. * <li><code>intensity</code> is a scalar multiplied by the result of the lens flare. The default value is <code>2.0</code>.</li>
  38052. * <li><code>distortion</code> is a scalar value that affects the chromatic effect distortion. The default value is <code>10.0</code>.</li>
  38053. * <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>
  38054. * <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>
  38055. * <li><code>dirtAmount</code> is a scalar representing the amount of dirt on the lens. The default value is <code>0.4</code>.</li>
  38056. * <li><code>earthRadius</code> is the maximum radius of the earth. The default value is <code>Ellipsoid.WGS84.maximumRadius</code>.</li>
  38057. * </ul>
  38058. * </p>
  38059. * @returns A post-process stage for applying a lens flare effect.
  38060. */
  38061. function createLensFlareStage(): PostProcessStage;
  38062. }
  38063. /**
  38064. * Determines how input texture to a {@link PostProcessStage} is sampled.
  38065. */
  38066. export enum PostProcessStageSampleMode {
  38067. /**
  38068. * Samples the texture by returning the closest texel.
  38069. */
  38070. NEAREST = 0,
  38071. /**
  38072. * Samples the texture through bi-linear interpolation of the four nearest texels.
  38073. */
  38074. LINEAR = 1
  38075. }
  38076. /**
  38077. * A primitive represents geometry in the {@link Scene}. The geometry can be from a single {@link GeometryInstance}
  38078. * as shown in example 1 below, or from an array of instances, even if the geometry is from different
  38079. * geometry types, e.g., an {@link RectangleGeometry} and an {@link EllipsoidGeometry} as shown in Code Example 2.
  38080. * <p>
  38081. * A primitive combines geometry instances with an {@link Appearance} that describes the full shading, including
  38082. * {@link Material} and {@link RenderState}. Roughly, the geometry instance defines the structure and placement,
  38083. * and the appearance defines the visual characteristics. Decoupling geometry and appearance allows us to mix
  38084. * and match most of them and add a new geometry or appearance independently of each other.
  38085. * </p>
  38086. * <p>
  38087. * Combining multiple instances into one primitive is called batching, and significantly improves performance for static data.
  38088. * Instances can be individually picked; {@link Scene#pick} returns their {@link GeometryInstance#id}. Using
  38089. * per-instance appearances like {@link PerInstanceColorAppearance}, each instance can also have a unique color.
  38090. * </p>
  38091. * <p>
  38092. * {@link Geometry} can either be created and batched on a web worker or the main thread. The first two examples
  38093. * show geometry that will be created on a web worker by using the descriptions of the geometry. The third example
  38094. * shows how to create the geometry on the main thread by explicitly calling the <code>createGeometry</code> method.
  38095. * </p>
  38096. * @example
  38097. * // 1. Draw a translucent ellipse on the surface with a checkerboard pattern
  38098. * const instance = new Cesium.GeometryInstance({
  38099. * geometry : new Cesium.EllipseGeometry({
  38100. * center : Cesium.Cartesian3.fromDegrees(-100.0, 20.0),
  38101. * semiMinorAxis : 500000.0,
  38102. * semiMajorAxis : 1000000.0,
  38103. * rotation : Cesium.Math.PI_OVER_FOUR,
  38104. * vertexFormat : Cesium.VertexFormat.POSITION_AND_ST
  38105. * }),
  38106. * id : 'object returned when this instance is picked and to get/set per-instance attributes'
  38107. * });
  38108. * scene.primitives.add(new Cesium.Primitive({
  38109. * geometryInstances : instance,
  38110. * appearance : new Cesium.EllipsoidSurfaceAppearance({
  38111. * material : Cesium.Material.fromType('Checkerboard')
  38112. * })
  38113. * }));
  38114. * @example
  38115. * // 2. Draw different instances each with a unique color
  38116. * const rectangleInstance = new Cesium.GeometryInstance({
  38117. * geometry : new Cesium.RectangleGeometry({
  38118. * rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0),
  38119. * vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
  38120. * }),
  38121. * id : 'rectangle',
  38122. * attributes : {
  38123. * color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  38124. * }
  38125. * });
  38126. * const ellipsoidInstance = new Cesium.GeometryInstance({
  38127. * geometry : new Cesium.EllipsoidGeometry({
  38128. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  38129. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  38130. * }),
  38131. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  38132. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  38133. * id : 'ellipsoid',
  38134. * attributes : {
  38135. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  38136. * }
  38137. * });
  38138. * scene.primitives.add(new Cesium.Primitive({
  38139. * geometryInstances : [rectangleInstance, ellipsoidInstance],
  38140. * appearance : new Cesium.PerInstanceColorAppearance()
  38141. * }));
  38142. * @example
  38143. * // 3. Create the geometry on the main thread.
  38144. * scene.primitives.add(new Cesium.Primitive({
  38145. * geometryInstances : new Cesium.GeometryInstance({
  38146. * geometry : Cesium.EllipsoidGeometry.createGeometry(new Cesium.EllipsoidGeometry({
  38147. * radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
  38148. * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL
  38149. * })),
  38150. * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
  38151. * Cesium.Cartesian3.fromDegrees(-95.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 500000.0), new Cesium.Matrix4()),
  38152. * id : 'ellipsoid',
  38153. * attributes : {
  38154. * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
  38155. * }
  38156. * }),
  38157. * appearance : new Cesium.PerInstanceColorAppearance(),
  38158. * asynchronous : false
  38159. * }));
  38160. * @param [options] - Object with the following properties:
  38161. * @param [options.geometryInstances] - The geometry instances - or a single geometry instance - to render.
  38162. * @param [options.appearance] - The appearance used to render the primitive.
  38163. * @param [options.depthFailAppearance] - The appearance used to shade this primitive when it fails the depth test.
  38164. * @param [options.show = true] - Determines if this primitive will be shown.
  38165. * @param [options.modelMatrix = Matrix4.IDENTITY] - The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  38166. * @param [options.vertexCacheOptimize = false] - When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  38167. * @param [options.interleave = false] - When <code>true</code>, geometry vertex attributes are interleaved, which can slightly improve rendering performance but increases load time.
  38168. * @param [options.compressVertices = true] - When <code>true</code>, the geometry vertices are compressed, which will save memory.
  38169. * @param [options.releaseGeometryInstances = true] - When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  38170. * @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.
  38171. * @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.
  38172. * @param [options.asynchronous = true] - Determines if the primitive will be created asynchronously or block until ready.
  38173. * @param [options.debugShowBoundingVolume = false] - For debugging only. Determines if this primitive's commands' bounding spheres are shown.
  38174. * @param [options.shadows = ShadowMode.DISABLED] - Determines whether this primitive casts or receives shadows from light sources.
  38175. */
  38176. export class Primitive {
  38177. constructor(options?: {
  38178. geometryInstances?: GeometryInstance[] | GeometryInstance;
  38179. appearance?: Appearance;
  38180. depthFailAppearance?: Appearance;
  38181. show?: boolean;
  38182. modelMatrix?: Matrix4;
  38183. vertexCacheOptimize?: boolean;
  38184. interleave?: boolean;
  38185. compressVertices?: boolean;
  38186. releaseGeometryInstances?: boolean;
  38187. allowPicking?: boolean;
  38188. cull?: boolean;
  38189. asynchronous?: boolean;
  38190. debugShowBoundingVolume?: boolean;
  38191. shadows?: ShadowMode;
  38192. });
  38193. /**
  38194. * The geometry instances rendered with this primitive. This may
  38195. * be <code>undefined</code> if <code>options.releaseGeometryInstances</code>
  38196. * is <code>true</code> when the primitive is constructed.
  38197. * <p>
  38198. * Changing this property after the primitive is rendered has no effect.
  38199. * </p>
  38200. */
  38201. readonly geometryInstances: GeometryInstance[] | GeometryInstance;
  38202. /**
  38203. * The {@link Appearance} used to shade this primitive. Each geometry
  38204. * instance is shaded with the same appearance. Some appearances, like
  38205. * {@link PerInstanceColorAppearance} allow giving each instance unique
  38206. * properties.
  38207. */
  38208. appearance: Appearance;
  38209. /**
  38210. * The {@link Appearance} used to shade this primitive when it fails the depth test. Each geometry
  38211. * instance is shaded with the same appearance. Some appearances, like
  38212. * {@link PerInstanceColorAppearance} allow giving each instance unique
  38213. * properties.
  38214. *
  38215. * <p>
  38216. * When using an appearance that requires a color attribute, like PerInstanceColorAppearance,
  38217. * add a depthFailColor per-instance attribute instead.
  38218. * </p>
  38219. *
  38220. * <p>
  38221. * Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported,
  38222. * there may be artifacts.
  38223. * </p>
  38224. */
  38225. depthFailAppearance: Appearance;
  38226. /**
  38227. * The 4x4 transformation matrix that transforms the primitive (all geometry instances) from model to world coordinates.
  38228. * When this is the identity matrix, the primitive is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
  38229. * Local reference frames can be used by providing a different transformation matrix, like that returned
  38230. * by {@link Transforms.eastNorthUpToFixedFrame}.
  38231. *
  38232. * <p>
  38233. * This property is only supported in 3D mode.
  38234. * </p>
  38235. * @example
  38236. * const origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
  38237. * p.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
  38238. */
  38239. modelMatrix: Matrix4;
  38240. /**
  38241. * Determines if the primitive will be shown. This affects all geometry
  38242. * instances in the primitive.
  38243. */
  38244. show: boolean;
  38245. /**
  38246. * When <code>true</code>, the renderer frustum culls and horizon culls the primitive's commands
  38247. * based on their bounding volume. Set this to <code>false</code> for a small performance gain
  38248. * if you are manually culling the primitive.
  38249. */
  38250. cull: boolean;
  38251. /**
  38252. * This property is for debugging only; it is not for production use nor is it optimized.
  38253. * <p>
  38254. * Draws the bounding sphere for each draw command in the primitive.
  38255. * </p>
  38256. */
  38257. debugShowBoundingVolume: boolean;
  38258. /**
  38259. * Determines whether this primitive casts or receives shadows from light sources.
  38260. */
  38261. shadows: ShadowMode;
  38262. /**
  38263. * When <code>true</code>, geometry vertices are optimized for the pre and post-vertex-shader caches.
  38264. */
  38265. readonly vertexCacheOptimize: boolean;
  38266. /**
  38267. * Determines if geometry vertex attributes are interleaved, which can slightly improve rendering performance.
  38268. */
  38269. readonly interleave: boolean;
  38270. /**
  38271. * When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
  38272. */
  38273. readonly releaseGeometryInstances: boolean;
  38274. /**
  38275. * When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved. *
  38276. */
  38277. readonly allowPicking: boolean;
  38278. /**
  38279. * Determines if the geometry instances will be created and batched on a web worker.
  38280. */
  38281. readonly asynchronous: boolean;
  38282. /**
  38283. * When <code>true</code>, geometry vertices are compressed, which will save memory.
  38284. */
  38285. readonly compressVertices: boolean;
  38286. /**
  38287. * Determines if the primitive is complete and ready to render. If this property is
  38288. * true, the primitive will be rendered the next time that {@link Primitive#update}
  38289. * is called.
  38290. */
  38291. readonly ready: boolean;
  38292. /**
  38293. * Gets a promise that resolves when the primitive is ready to render.
  38294. */
  38295. readonly readyPromise: Promise<Primitive>;
  38296. /**
  38297. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  38298. * get the draw commands needed to render this primitive.
  38299. * <p>
  38300. * Do not call this function directly. This is documented just to
  38301. * list the exceptions that may be propagated when the scene is rendered:
  38302. * </p>
  38303. */
  38304. update(): void;
  38305. /**
  38306. * Returns the modifiable per-instance attributes for a {@link GeometryInstance}.
  38307. * @example
  38308. * const attributes = primitive.getGeometryInstanceAttributes('an id');
  38309. * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA);
  38310. * attributes.show = Cesium.ShowGeometryInstanceAttribute.toValue(true);
  38311. * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(100.0, 10000.0);
  38312. * attributes.offset = Cesium.OffsetGeometryInstanceAttribute.toValue(Cartesian3.IDENTITY);
  38313. * @param id - The id of the {@link GeometryInstance}.
  38314. * @returns The typed array in the attribute's format or undefined if the is no instance with id.
  38315. */
  38316. getGeometryInstanceAttributes(id: any): any;
  38317. /**
  38318. * Returns true if this object was destroyed; otherwise, false.
  38319. * <p>
  38320. * If this object was destroyed, it should not be used; calling any function other than
  38321. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38322. * </p>
  38323. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  38324. */
  38325. isDestroyed(): boolean;
  38326. /**
  38327. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  38328. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  38329. * <p>
  38330. * Once an object is destroyed, it should not be used; calling any function other than
  38331. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38332. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38333. * </p>
  38334. * @example
  38335. * e = e && e.destroy();
  38336. */
  38337. destroy(): void;
  38338. }
  38339. /**
  38340. * A collection of primitives. This is most often used with {@link Scene#primitives},
  38341. * but <code>PrimitiveCollection</code> is also a primitive itself so collections can
  38342. * be added to collections forming a hierarchy.
  38343. * @example
  38344. * const billboards = new Cesium.BillboardCollection();
  38345. * const labels = new Cesium.LabelCollection();
  38346. *
  38347. * const collection = new Cesium.PrimitiveCollection();
  38348. * collection.add(billboards);
  38349. *
  38350. * scene.primitives.add(collection); // Add collection
  38351. * scene.primitives.add(labels); // Add regular primitive
  38352. * @param [options] - Object with the following properties:
  38353. * @param [options.show = true] - Determines if the primitives in the collection will be shown.
  38354. * @param [options.destroyPrimitives = true] - Determines if primitives in the collection are destroyed when they are removed.
  38355. */
  38356. export class PrimitiveCollection {
  38357. constructor(options?: {
  38358. show?: boolean;
  38359. destroyPrimitives?: boolean;
  38360. });
  38361. /**
  38362. * Determines if primitives in this collection will be shown.
  38363. */
  38364. show: boolean;
  38365. /**
  38366. * Determines if primitives in the collection are destroyed when they are removed by
  38367. * {@link PrimitiveCollection#destroy} or {@link PrimitiveCollection#remove} or implicitly
  38368. * by {@link PrimitiveCollection#removeAll}.
  38369. * @example
  38370. * // Example 1. Primitives are destroyed by default.
  38371. * const primitives = new Cesium.PrimitiveCollection();
  38372. * const labels = primitives.add(new Cesium.LabelCollection());
  38373. * primitives = primitives.destroy();
  38374. * const b = labels.isDestroyed(); // true
  38375. * @example
  38376. * // Example 2. Do not destroy primitives in a collection.
  38377. * const primitives = new Cesium.PrimitiveCollection();
  38378. * primitives.destroyPrimitives = false;
  38379. * const labels = primitives.add(new Cesium.LabelCollection());
  38380. * primitives = primitives.destroy();
  38381. * const b = labels.isDestroyed(); // false
  38382. * labels = labels.destroy(); // explicitly destroy
  38383. */
  38384. destroyPrimitives: boolean;
  38385. /**
  38386. * Gets the number of primitives in the collection.
  38387. */
  38388. readonly length: number;
  38389. /**
  38390. * Adds a primitive to the collection.
  38391. * @example
  38392. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  38393. * @param primitive - The primitive to add.
  38394. * @param [index] - The index to add the layer at. If omitted, the primitive will be added at the bottom of all existing primitives.
  38395. * @returns The primitive added to the collection.
  38396. */
  38397. add(primitive: any, index?: number): any;
  38398. /**
  38399. * Removes a primitive from the collection.
  38400. * @example
  38401. * const billboards = scene.primitives.add(new Cesium.BillboardCollection());
  38402. * scene.primitives.remove(billboards); // Returns true
  38403. * @param [primitive] - The primitive to remove.
  38404. * @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.
  38405. */
  38406. remove(primitive?: any): boolean;
  38407. /**
  38408. * Removes all primitives in the collection.
  38409. */
  38410. removeAll(): void;
  38411. /**
  38412. * Determines if this collection contains a primitive.
  38413. * @param [primitive] - The primitive to check for.
  38414. * @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.
  38415. */
  38416. contains(primitive?: any): boolean;
  38417. /**
  38418. * Raises a primitive "up one" in the collection. If all primitives in the collection are drawn
  38419. * on the globe surface, this visually moves the primitive up one.
  38420. * @param [primitive] - The primitive to raise.
  38421. */
  38422. raise(primitive?: any): void;
  38423. /**
  38424. * Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn
  38425. * on the globe surface, this visually moves the primitive to the top.
  38426. * @param [primitive] - The primitive to raise the top.
  38427. */
  38428. raiseToTop(primitive?: any): void;
  38429. /**
  38430. * Lowers a primitive "down one" in the collection. If all primitives in the collection are drawn
  38431. * on the globe surface, this visually moves the primitive down one.
  38432. * @param [primitive] - The primitive to lower.
  38433. */
  38434. lower(primitive?: any): void;
  38435. /**
  38436. * Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn
  38437. * on the globe surface, this visually moves the primitive to the bottom.
  38438. * @param [primitive] - The primitive to lower to the bottom.
  38439. */
  38440. lowerToBottom(primitive?: any): void;
  38441. /**
  38442. * Returns the primitive in the collection at the specified index.
  38443. * @example
  38444. * // Toggle the show property of every primitive in the collection.
  38445. * const primitives = scene.primitives;
  38446. * const length = primitives.length;
  38447. * for (let i = 0; i < length; ++i) {
  38448. * const p = primitives.get(i);
  38449. * p.show = !p.show;
  38450. * }
  38451. * @param index - The zero-based index of the primitive to return.
  38452. * @returns The primitive at the <code>index</code>.
  38453. */
  38454. get(index: number): any;
  38455. /**
  38456. * Returns true if this object was destroyed; otherwise, false.
  38457. * <br /><br />
  38458. * If this object was destroyed, it should not be used; calling any function other than
  38459. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  38460. * @returns True if this object was destroyed; otherwise, false.
  38461. */
  38462. isDestroyed(): boolean;
  38463. /**
  38464. * Destroys the WebGL resources held by each primitive in this collection. Explicitly destroying this
  38465. * collection allows for deterministic release of WebGL resources, instead of relying on the garbage
  38466. * collector to destroy this collection.
  38467. * <br /><br />
  38468. * Since destroying a collection destroys all the contained primitives, only destroy a collection
  38469. * when you are sure no other code is still using any of the contained primitives.
  38470. * <br /><br />
  38471. * Once this collection is destroyed, it should not be used; calling any function other than
  38472. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  38473. * assign the return value (<code>undefined</code>) to the object as done in the example.
  38474. * @example
  38475. * primitives = primitives && primitives.destroy();
  38476. */
  38477. destroy(): void;
  38478. }
  38479. /**
  38480. * The container for all 3D graphical objects and state in a Cesium virtual scene. Generally,
  38481. * a scene is not created directly; instead, it is implicitly created by {@link CesiumWidget}.
  38482. * <p>
  38483. * <em><code>contextOptions</code> parameter details:</em>
  38484. * </p>
  38485. * <p>
  38486. * The default values are:
  38487. * <code>
  38488. * {
  38489. * webgl : {
  38490. * alpha : false,
  38491. * depth : true,
  38492. * stencil : false,
  38493. * antialias : true,
  38494. * powerPreference: 'high-performance',
  38495. * premultipliedAlpha : true,
  38496. * preserveDrawingBuffer : false,
  38497. * failIfMajorPerformanceCaveat : false
  38498. * },
  38499. * allowTextureFilterAnisotropic : true
  38500. * }
  38501. * </code>
  38502. * </p>
  38503. * <p>
  38504. * The <code>webgl</code> property corresponds to the {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}
  38505. * object used to create the WebGL context.
  38506. * </p>
  38507. * <p>
  38508. * <code>webgl.alpha</code> defaults to false, which can improve performance compared to the standard WebGL default
  38509. * of true. If an application needs to composite Cesium above other HTML elements using alpha-blending, set
  38510. * <code>webgl.alpha</code> to true.
  38511. * </p>
  38512. * <p>
  38513. * The other <code>webgl</code> properties match the WebGL defaults for {@link http://www.khronos.org/registry/webgl/specs/latest/#5.2|WebGLContextAttributes}.
  38514. * </p>
  38515. * <p>
  38516. * <code>allowTextureFilterAnisotropic</code> defaults to true, which enables anisotropic texture filtering when the
  38517. * WebGL extension is supported. Setting this to false will improve performance, but hurt visual quality, especially for horizon views.
  38518. * </p>
  38519. * @example
  38520. * // Create scene without anisotropic texture filtering
  38521. * const scene = new Cesium.Scene({
  38522. * canvas : canvas,
  38523. * contextOptions : {
  38524. * allowTextureFilterAnisotropic : false
  38525. * }
  38526. * });
  38527. * @param options - Object with the following properties:
  38528. * @param options.canvas - The HTML canvas element to create the scene for.
  38529. * @param [options.contextOptions] - Context and WebGL creation properties. See details above.
  38530. * @param [options.creditContainer] - The HTML element in which the credits will be displayed.
  38531. * @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.
  38532. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  38533. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  38534. * @param [options.scene3DOnly = false] - If true, optimizes memory use and performance for 3D mode but disables the ability to use 2D or Columbus View.
  38535. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  38536. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  38537. * @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}.
  38538. * @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}.
  38539. * @param [depthPlaneEllipsoidOffset = 0.0] - Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
  38540. * @param [options.msaaSamples = 1] - If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
  38541. */
  38542. export class Scene {
  38543. constructor(options: {
  38544. canvas: HTMLCanvasElement;
  38545. contextOptions?: any;
  38546. creditContainer?: Element;
  38547. creditViewport?: Element;
  38548. mapProjection?: MapProjection;
  38549. orderIndependentTranslucency?: boolean;
  38550. scene3DOnly?: boolean;
  38551. shadows?: boolean;
  38552. mapMode2D?: MapMode2D;
  38553. requestRenderMode?: boolean;
  38554. maximumRenderTimeChange?: number;
  38555. msaaSamples?: number;
  38556. }, depthPlaneEllipsoidOffset?: number);
  38557. /**
  38558. * Exceptions occurring in <code>render</code> are always caught in order to raise the
  38559. * <code>renderError</code> event. If this property is true, the error is rethrown
  38560. * after the event is raised. If this property is false, the <code>render</code> function
  38561. * returns normally after raising the event.
  38562. */
  38563. rethrowRenderErrors: boolean;
  38564. /**
  38565. * Determines whether or not to instantly complete the
  38566. * scene transition animation on user input.
  38567. */
  38568. completeMorphOnUserInput: boolean;
  38569. /**
  38570. * The event fired at the beginning of a scene transition.
  38571. */
  38572. morphStart: Event;
  38573. /**
  38574. * The event fired at the completion of a scene transition.
  38575. */
  38576. morphComplete: Event;
  38577. /**
  38578. * The {@link SkyBox} used to draw the stars.
  38579. */
  38580. skyBox: SkyBox;
  38581. /**
  38582. * The sky atmosphere drawn around the globe.
  38583. */
  38584. skyAtmosphere: SkyAtmosphere;
  38585. /**
  38586. * The {@link Sun}.
  38587. */
  38588. sun: Sun;
  38589. /**
  38590. * Uses a bloom filter on the sun when enabled.
  38591. */
  38592. sunBloom: boolean;
  38593. /**
  38594. * The {@link Moon}
  38595. */
  38596. moon: Moon;
  38597. /**
  38598. * The background color, which is only visible if there is no sky box, i.e., {@link Scene#skyBox} is undefined.
  38599. */
  38600. backgroundColor: Color;
  38601. /**
  38602. * The current morph transition time between 2D/Columbus View and 3D,
  38603. * with 0.0 being 2D or Columbus View and 1.0 being 3D.
  38604. */
  38605. morphTime: number;
  38606. /**
  38607. * The far-to-near ratio of the multi-frustum when using a normal depth buffer.
  38608. * <p>
  38609. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  38610. * when {@link Scene#logarithmicDepthBuffer} is <code>false</code>. When <code>logarithmicDepthBuffer</code> is
  38611. * <code>true</code>, use {@link Scene#logarithmicDepthFarToNearRatio}.
  38612. * </p>
  38613. */
  38614. farToNearRatio: number;
  38615. /**
  38616. * The far-to-near ratio of the multi-frustum when using a logarithmic depth buffer.
  38617. * <p>
  38618. * This value is used to create the near and far values for each frustum of the multi-frustum. It is only used
  38619. * when {@link Scene#logarithmicDepthBuffer} is <code>true</code>. When <code>logarithmicDepthBuffer</code> is
  38620. * <code>false</code>, use {@link Scene#farToNearRatio}.
  38621. * </p>
  38622. */
  38623. logarithmicDepthFarToNearRatio: number;
  38624. /**
  38625. * Determines the uniform depth size in meters of each frustum of the multifrustum in 2D. If a primitive or model close
  38626. * to the surface shows z-fighting, decreasing this will eliminate the artifact, but decrease performance. On the
  38627. * other hand, increasing this will increase performance but may cause z-fighting among primitives close to the surface.
  38628. */
  38629. nearToFarDistance2D: number;
  38630. /**
  38631. * This property is for debugging only; it is not for production use.
  38632. * <p>
  38633. * A function that determines what commands are executed. As shown in the examples below,
  38634. * the function receives the command's <code>owner</code> as an argument, and returns a boolean indicating if the
  38635. * command should be executed.
  38636. * </p>
  38637. * <p>
  38638. * The default is <code>undefined</code>, indicating that all commands are executed.
  38639. * </p>
  38640. * @example
  38641. * // Do not execute any commands.
  38642. * scene.debugCommandFilter = function(command) {
  38643. * return false;
  38644. * };
  38645. *
  38646. * // Execute only the billboard's commands. That is, only draw the billboard.
  38647. * const billboards = new Cesium.BillboardCollection();
  38648. * scene.debugCommandFilter = function(command) {
  38649. * return command.owner === billboards;
  38650. * };
  38651. */
  38652. debugCommandFilter: (...params: any[]) => any;
  38653. /**
  38654. * This property is for debugging only; it is not for production use.
  38655. * <p>
  38656. * When <code>true</code>, commands are randomly shaded. This is useful
  38657. * for performance analysis to see what parts of a scene or model are
  38658. * command-dense and could benefit from batching.
  38659. * </p>
  38660. */
  38661. debugShowCommands: boolean;
  38662. /**
  38663. * This property is for debugging only; it is not for production use.
  38664. * <p>
  38665. * When <code>true</code>, commands are shaded based on the frustums they
  38666. * overlap. Commands in the closest frustum are tinted red, commands in
  38667. * the next closest are green, and commands in the farthest frustum are
  38668. * blue. If a command overlaps more than one frustum, the color components
  38669. * are combined, e.g., a command overlapping the first two frustums is tinted
  38670. * yellow.
  38671. * </p>
  38672. */
  38673. debugShowFrustums: boolean;
  38674. /**
  38675. * This property is for debugging only; it is not for production use.
  38676. * <p>
  38677. * Displays frames per second and time between frames.
  38678. * </p>
  38679. */
  38680. debugShowFramesPerSecond: boolean;
  38681. /**
  38682. * This property is for debugging only; it is not for production use.
  38683. * <p>
  38684. * Indicates which frustum will have depth information displayed.
  38685. * </p>
  38686. */
  38687. debugShowDepthFrustum: number;
  38688. /**
  38689. * This property is for debugging only; it is not for production use.
  38690. * <p>
  38691. * When <code>true</code>, draws outlines to show the boundaries of the camera frustums
  38692. * </p>
  38693. */
  38694. debugShowFrustumPlanes: boolean;
  38695. /**
  38696. * When <code>true</code>, enables picking using the depth buffer.
  38697. */
  38698. useDepthPicking: boolean;
  38699. /**
  38700. * 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.
  38701. *
  38702. * <p>
  38703. * There is a decrease in performance when enabled. There are extra draw calls to write depth for
  38704. * translucent geometry.
  38705. * </p>
  38706. * @example
  38707. * // picking the position of a translucent primitive
  38708. * viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
  38709. * const pickedFeature = viewer.scene.pick(movement.position);
  38710. * if (!Cesium.defined(pickedFeature)) {
  38711. * // nothing picked
  38712. * return;
  38713. * }
  38714. * const worldPosition = viewer.scene.pickPosition(movement.position);
  38715. * }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38716. */
  38717. pickTranslucentDepth: boolean;
  38718. /**
  38719. * Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional
  38720. * performance improvements by rendering less geometry and dispatching less terrain requests.
  38721. */
  38722. fog: Fog;
  38723. /**
  38724. * The shadow map for the scene's light source. When enabled, models, primitives, and the globe may cast and receive shadows.
  38725. */
  38726. shadowMap: ShadowMap;
  38727. /**
  38728. * When <code>false</code>, 3D Tiles will render normally. When <code>true</code>, classified 3D Tile geometry will render normally and
  38729. * unclassified 3D Tile geometry will render with the color multiplied by {@link Scene#invertClassificationColor}.
  38730. */
  38731. invertClassification: boolean;
  38732. /**
  38733. * The highlight color of unclassified 3D Tile geometry when {@link Scene#invertClassification} is <code>true</code>.
  38734. * <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>
  38735. * <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>
  38736. */
  38737. invertClassificationColor: Color;
  38738. /**
  38739. * The focal length for use when with cardboard or WebVR.
  38740. */
  38741. focalLength: number;
  38742. /**
  38743. * The eye separation distance in meters for use with cardboard or WebVR.
  38744. */
  38745. eyeSeparation: number;
  38746. /**
  38747. * Post processing effects applied to the final render.
  38748. */
  38749. postProcessStages: PostProcessStageCollection;
  38750. /**
  38751. * When <code>true</code>, rendering a frame will only occur when needed as determined by changes within the scene.
  38752. * Enabling improves performance of the application, but requires using {@link Scene#requestRender}
  38753. * to render a new frame explicitly in this mode. This will be necessary in many cases after making changes
  38754. * to the scene in other parts of the API.
  38755. */
  38756. requestRenderMode: boolean;
  38757. /**
  38758. * If {@link Scene#requestRenderMode} is <code>true</code>, this value defines the maximum change in
  38759. * simulation time allowed before a render is requested. Lower values increase the number of frames rendered
  38760. * and higher values decrease the number of frames rendered. If <code>undefined</code>, changes to
  38761. * the simulation time will never request a render.
  38762. * This value impacts the rate of rendering for changes in the scene like lighting, entity property updates,
  38763. * and animations.
  38764. */
  38765. maximumRenderTimeChange: number;
  38766. /**
  38767. * The spherical harmonic coefficients for image-based lighting of PBR models.
  38768. */
  38769. sphericalHarmonicCoefficients: Cartesian3[];
  38770. /**
  38771. * The url to the KTX2 file containing the specular environment map and convoluted mipmaps for image-based lighting of PBR models.
  38772. */
  38773. specularEnvironmentMaps: string;
  38774. /**
  38775. * The light source for shading. Defaults to a directional light from the Sun.
  38776. */
  38777. light: Light;
  38778. /**
  38779. * Gets the canvas element to which this scene is bound.
  38780. */
  38781. readonly canvas: HTMLCanvasElement;
  38782. /**
  38783. * The drawingBufferHeight of the underlying GL context.
  38784. */
  38785. readonly drawingBufferHeight: number;
  38786. /**
  38787. * The drawingBufferHeight of the underlying GL context.
  38788. */
  38789. readonly drawingBufferWidth: number;
  38790. /**
  38791. * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
  38792. */
  38793. readonly maximumAliasedLineWidth: number;
  38794. /**
  38795. * The maximum length in pixels of one edge of a cube map, supported by this WebGL implementation. It will be at least 16.
  38796. */
  38797. readonly maximumCubeMapSize: number;
  38798. /**
  38799. * Returns <code>true</code> if the {@link Scene#pickPosition} function is supported.
  38800. */
  38801. readonly pickPositionSupported: boolean;
  38802. /**
  38803. * Returns <code>true</code> if the {@link Scene#sampleHeight} and {@link Scene#sampleHeightMostDetailed} functions are supported.
  38804. */
  38805. readonly sampleHeightSupported: boolean;
  38806. /**
  38807. * Returns <code>true</code> if the {@link Scene#clampToHeight} and {@link Scene#clampToHeightMostDetailed} functions are supported.
  38808. */
  38809. readonly clampToHeightSupported: boolean;
  38810. /**
  38811. * Returns <code>true</code> if the {@link Scene#invertClassification} is supported.
  38812. */
  38813. readonly invertClassificationSupported: boolean;
  38814. /**
  38815. * Returns <code>true</code> if specular environment maps are supported.
  38816. */
  38817. readonly specularEnvironmentMapsSupported: boolean;
  38818. /**
  38819. * Gets or sets the depth-test ellipsoid.
  38820. */
  38821. globe: Globe;
  38822. /**
  38823. * Gets the collection of primitives.
  38824. */
  38825. readonly primitives: PrimitiveCollection;
  38826. /**
  38827. * Gets the collection of ground primitives.
  38828. */
  38829. readonly groundPrimitives: PrimitiveCollection;
  38830. /**
  38831. * Gets or sets the camera.
  38832. */
  38833. readonly camera: Camera;
  38834. /**
  38835. * Gets the controller for camera input handling.
  38836. */
  38837. readonly screenSpaceCameraController: ScreenSpaceCameraController;
  38838. /**
  38839. * Get the map projection to use in 2D and Columbus View modes.
  38840. */
  38841. readonly mapProjection: MapProjection;
  38842. /**
  38843. * Gets the collection of image layers that will be rendered on the globe.
  38844. */
  38845. readonly imageryLayers: ImageryLayerCollection;
  38846. /**
  38847. * The terrain provider providing surface geometry for the globe.
  38848. */
  38849. terrainProvider: TerrainProvider;
  38850. /**
  38851. * Gets an event that's raised when the terrain provider is changed
  38852. */
  38853. readonly terrainProviderChanged: Event;
  38854. /**
  38855. * Gets the event that will be raised before the scene is updated or rendered. Subscribers to the event
  38856. * receive the Scene instance as the first parameter and the current time as the second parameter.
  38857. */
  38858. readonly preUpdate: Event;
  38859. /**
  38860. * Gets the event that will be raised immediately after the scene is updated and before the scene is rendered.
  38861. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  38862. * parameter.
  38863. */
  38864. readonly postUpdate: Event;
  38865. /**
  38866. * Gets the event that will be raised when an error is thrown inside the <code>render</code> function.
  38867. * The Scene instance and the thrown error are the only two parameters passed to the event handler.
  38868. * By default, errors are not rethrown after this event is raised, but that can be changed by setting
  38869. * the <code>rethrowRenderErrors</code> property.
  38870. */
  38871. readonly renderError: Event;
  38872. /**
  38873. * Gets the event that will be raised after the scene is updated and immediately before the scene is rendered.
  38874. * Subscribers to the event receive the Scene instance as the first parameter and the current time as the second
  38875. * parameter.
  38876. */
  38877. readonly preRender: Event;
  38878. /**
  38879. * Gets the event that will be raised immediately after the scene is rendered. Subscribers to the event
  38880. * receive the Scene instance as the first parameter and the current time as the second parameter.
  38881. */
  38882. readonly postRender: Event;
  38883. /**
  38884. * Gets the simulation time when the scene was last rendered. Returns undefined if the scene has not yet been
  38885. * rendered.
  38886. */
  38887. readonly lastRenderTime: JulianDate;
  38888. /**
  38889. * This property is for debugging only; it is not for production use.
  38890. * <p>
  38891. * When {@link Scene.debugShowFrustums} is <code>true</code>, this contains
  38892. * properties with statistics about the number of command execute per frustum.
  38893. * <code>totalCommands</code> is the total number of commands executed, ignoring
  38894. * overlap. <code>commandsInFrustums</code> is an array with the number of times
  38895. * commands are executed redundantly, e.g., how many commands overlap two or
  38896. * three frustums.
  38897. * </p>
  38898. */
  38899. readonly debugFrustumStatistics: any;
  38900. /**
  38901. * Gets whether or not the scene is optimized for 3D only viewing.
  38902. */
  38903. readonly scene3DOnly: boolean;
  38904. /**
  38905. * Gets whether or not the scene has order independent translucency enabled.
  38906. * Note that this only reflects the original construction option, and there are
  38907. * other factors that could prevent OIT from functioning on a given system configuration.
  38908. */
  38909. readonly orderIndependentTranslucency: boolean;
  38910. /**
  38911. * Gets the unique identifier for this scene.
  38912. */
  38913. readonly id: string;
  38914. /**
  38915. * Gets or sets the current mode of the scene.
  38916. */
  38917. mode: SceneMode;
  38918. /**
  38919. * When <code>true</code>, splits the scene into two viewports with steroscopic views for the left and right eyes.
  38920. * Used for cardboard and WebVR.
  38921. */
  38922. useWebVR: boolean;
  38923. /**
  38924. * Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  38925. */
  38926. readonly mapMode2D: MapMode2D;
  38927. /**
  38928. * Gets or sets the position of the splitter within the viewport. Valid values are between 0.0 and 1.0.
  38929. */
  38930. splitPosition: number;
  38931. /**
  38932. * The distance from the camera at which to disable the depth test of billboards, labels and points
  38933. * to, for example, prevent clipping against terrain. When set to zero, the depth test should always
  38934. * be applied. When less than zero, the depth test should never be applied. Setting the disableDepthTestDistance
  38935. * property of a billboard, label or point will override this value.
  38936. */
  38937. minimumDisableDepthTestDistance: number;
  38938. /**
  38939. * Whether or not to use a logarithmic depth buffer. Enabling this option will allow for less frustums in the multi-frustum,
  38940. * increasing performance. This property relies on fragmentDepth being supported.
  38941. */
  38942. logarithmicDepthBuffer: boolean;
  38943. /**
  38944. * The value used for gamma correction. This is only used when rendering with high dynamic range.
  38945. */
  38946. gamma: number;
  38947. /**
  38948. * Whether or not to use high dynamic range rendering.
  38949. */
  38950. highDynamicRange: boolean;
  38951. /**
  38952. * Whether or not high dynamic range rendering is supported.
  38953. */
  38954. readonly highDynamicRangeSupported: boolean;
  38955. /**
  38956. * Whether or not the camera is underneath the globe.
  38957. */
  38958. readonly cameraUnderground: boolean;
  38959. /**
  38960. * The sample rate of multisample antialiasing (values greater than 1 enable MSAA).
  38961. */
  38962. msaaSamples: number;
  38963. /**
  38964. * Returns <code>true</code> if the Scene's context supports MSAA.
  38965. */
  38966. readonly msaaSupported: boolean;
  38967. /**
  38968. * Determines if a compressed texture format is supported.
  38969. * @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.
  38970. * @returns Whether or not the format is supported.
  38971. */
  38972. getCompressedTextureFormatSupported(format: string): boolean;
  38973. /**
  38974. * Update and render the scene. It is usually not necessary to call this function
  38975. * directly because {@link CesiumWidget} or {@link Viewer} do it automatically.
  38976. * @param [time] - The simulation time at which to render.
  38977. */
  38978. render(time?: JulianDate): void;
  38979. /**
  38980. * Requests a new rendered frame when {@link Scene#requestRenderMode} is set to <code>true</code>.
  38981. * The render rate will not exceed the {@link CesiumWidget#targetFrameRate}.
  38982. */
  38983. requestRender(): void;
  38984. /**
  38985. * Returns an object with a `primitive` property that contains the first (top) primitive in the scene
  38986. * at a particular window coordinate or undefined if nothing is at the location. Other properties may
  38987. * potentially be set depending on the type of primitive and may be used to further identify the picked object.
  38988. * <p>
  38989. * When a feature of a 3D Tiles tileset is picked, <code>pick</code> returns a {@link Cesium3DTileFeature} object.
  38990. * </p>
  38991. * @example
  38992. * // On mouse over, color the feature yellow.
  38993. * handler.setInputAction(function(movement) {
  38994. * const feature = scene.pick(movement.endPosition);
  38995. * if (feature instanceof Cesium.Cesium3DTileFeature) {
  38996. * feature.color = Cesium.Color.YELLOW;
  38997. * }
  38998. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38999. * @param windowPosition - Window coordinates to perform picking on.
  39000. * @param [width = 3] - Width of the pick rectangle.
  39001. * @param [height = 3] - Height of the pick rectangle.
  39002. * @returns Object containing the picked primitive.
  39003. */
  39004. pick(windowPosition: Cartesian2, width?: number, height?: number): any;
  39005. /**
  39006. * Returns the cartesian position reconstructed from the depth buffer and window position.
  39007. * <p>
  39008. * The position reconstructed from the depth buffer in 2D may be slightly different from those
  39009. * reconstructed in 3D and Columbus view. This is caused by the difference in the distribution
  39010. * of depth values of perspective and orthographic projection.
  39011. * </p>
  39012. * <p>
  39013. * Set {@link Scene#pickTranslucentDepth} to <code>true</code> to include the depth of
  39014. * translucent primitives; otherwise, this essentially picks through translucent primitives.
  39015. * </p>
  39016. * @param windowPosition - Window coordinates to perform picking on.
  39017. * @param [result] - The object on which to restore the result.
  39018. * @returns The cartesian position.
  39019. */
  39020. pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3;
  39021. /**
  39022. * Returns a list of objects, each containing a `primitive` property, for all primitives at
  39023. * a particular window coordinate position. Other properties may also be set depending on the
  39024. * type of primitive and may be used to further identify the picked object. The primitives in
  39025. * the list are ordered by their visual order in the scene (front to back).
  39026. * @example
  39027. * const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
  39028. * @param windowPosition - Window coordinates to perform picking on.
  39029. * @param [limit] - If supplied, stop drilling after collecting this many picks.
  39030. * @param [width = 3] - Width of the pick rectangle.
  39031. * @param [height = 3] - Height of the pick rectangle.
  39032. * @returns Array of objects, each containing 1 picked primitives.
  39033. */
  39034. drillPick(windowPosition: Cartesian2, limit?: number, width?: number, height?: number): any[];
  39035. /**
  39036. * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
  39037. * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to
  39038. * the globe, 3D Tiles, or primitives in the scene.
  39039. * <p>
  39040. * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples height
  39041. * from all other primitives regardless of their visibility.
  39042. * </p>
  39043. * @example
  39044. * const position = new Cesium.Cartographic(-1.31968, 0.698874);
  39045. * const height = viewer.scene.sampleHeight(position);
  39046. * console.log(height);
  39047. * @param position - The cartographic position to sample height from.
  39048. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  39049. * @param [width = 0.1] - Width of the intersection volume in meters.
  39050. * @returns The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.
  39051. */
  39052. sampleHeight(position: Cartographic, objectsToExclude?: object[], width?: number): number;
  39053. /**
  39054. * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns the
  39055. * clamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp
  39056. * objects to the globe, 3D Tiles, or primitives in the scene.
  39057. * <p>
  39058. * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to
  39059. * all other primitives regardless of their visibility.
  39060. * </p>
  39061. * @example
  39062. * // Clamp an entity to the underlying scene geometry
  39063. * const position = entity.position.getValue(Cesium.JulianDate.now());
  39064. * entity.position = viewer.scene.clampToHeight(position);
  39065. * @param cartesian - The cartesian position.
  39066. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  39067. * @param [width = 0.1] - Width of the intersection volume in meters.
  39068. * @param [result] - An optional object to return the clamped position.
  39069. * @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.
  39070. */
  39071. clampToHeight(cartesian: Cartesian3, objectsToExclude?: object[], width?: number, result?: Cartesian3): Cartesian3;
  39072. /**
  39073. * Initiates an asynchronous {@link Scene#sampleHeight} query for an array of {@link Cartographic} positions
  39074. * using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.
  39075. * Returns a promise that is resolved when the query completes. Each point height is modified in place.
  39076. * If a height cannot be determined because no geometry can be sampled at that location, or another error occurs,
  39077. * the height is set to undefined.
  39078. * @example
  39079. * const positions = [
  39080. * new Cesium.Cartographic(-1.31968, 0.69887),
  39081. * new Cesium.Cartographic(-1.10489, 0.83923)
  39082. * ];
  39083. * const promise = viewer.scene.sampleHeightMostDetailed(positions);
  39084. * promise.then(function(updatedPosition) {
  39085. * // positions[0].height and positions[1].height have been updated.
  39086. * // updatedPositions is just a reference to positions.
  39087. * }
  39088. * @param positions - The cartographic positions to update with sampled heights.
  39089. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not sample height from.
  39090. * @param [width = 0.1] - Width of the intersection volume in meters.
  39091. * @returns A promise that resolves to the provided list of positions when the query has completed.
  39092. */
  39093. sampleHeightMostDetailed(positions: Cartographic[], objectsToExclude?: object[], width?: number): Promise<Cartographic[]>;
  39094. /**
  39095. * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions
  39096. * using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved when
  39097. * the query completes. Each position is modified in place. If a position cannot be clamped because no geometry
  39098. * can be sampled at that location, or another error occurs, the element in the array is set to undefined.
  39099. * @example
  39100. * const cartesians = [
  39101. * entities[0].position.getValue(Cesium.JulianDate.now()),
  39102. * entities[1].position.getValue(Cesium.JulianDate.now())
  39103. * ];
  39104. * const promise = viewer.scene.clampToHeightMostDetailed(cartesians);
  39105. * promise.then(function(updatedCartesians) {
  39106. * entities[0].position = updatedCartesians[0];
  39107. * entities[1].position = updatedCartesians[1];
  39108. * }
  39109. * @param cartesians - The cartesian positions to update with clamped positions.
  39110. * @param [objectsToExclude] - A list of primitives, entities, or 3D Tiles features to not clamp to.
  39111. * @param [width = 0.1] - Width of the intersection volume in meters.
  39112. * @returns A promise that resolves to the provided list of positions when the query has completed.
  39113. */
  39114. clampToHeightMostDetailed(cartesians: Cartesian3[], objectsToExclude?: object[], width?: number): Promise<Cartesian3[]>;
  39115. /**
  39116. * Transforms a position in cartesian coordinates to canvas coordinates. This is commonly used to place an
  39117. * HTML element at the same screen position as an object in the scene.
  39118. * @example
  39119. * // Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
  39120. * const scene = widget.scene;
  39121. * const ellipsoid = scene.globe.ellipsoid;
  39122. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  39123. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  39124. * handler.setInputAction(function(movement) {
  39125. * console.log(scene.cartesianToCanvasCoordinates(position));
  39126. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39127. * @param position - The position in cartesian coordinates.
  39128. * @param [result] - An optional object to return the input position transformed to canvas coordinates.
  39129. * @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.
  39130. */
  39131. cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2;
  39132. /**
  39133. * Instantly completes an active transition.
  39134. */
  39135. completeMorph(): void;
  39136. /**
  39137. * Asynchronously transitions the scene to 2D.
  39138. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  39139. */
  39140. morphTo2D(duration?: number): void;
  39141. /**
  39142. * Asynchronously transitions the scene to Columbus View.
  39143. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  39144. */
  39145. morphToColumbusView(duration?: number): void;
  39146. /**
  39147. * Asynchronously transitions the scene to 3D.
  39148. * @param [duration = 2.0] - The amount of time, in seconds, for transition animations to complete.
  39149. */
  39150. morphTo3D(duration?: number): void;
  39151. /**
  39152. * Returns true if this object was destroyed; otherwise, false.
  39153. * <br /><br />
  39154. * If this object was destroyed, it should not be used; calling any function other than
  39155. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39156. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39157. */
  39158. isDestroyed(): boolean;
  39159. /**
  39160. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39161. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39162. * <br /><br />
  39163. * Once an object is destroyed, it should not be used; calling any function other than
  39164. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39165. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39166. * @example
  39167. * scene = scene && scene.destroy();
  39168. */
  39169. destroy(): void;
  39170. }
  39171. /**
  39172. * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view.
  39173. */
  39174. export enum SceneMode {
  39175. /**
  39176. * Morphing between mode, e.g., 3D to 2D.
  39177. */
  39178. MORPHING = 0,
  39179. /**
  39180. * Columbus View mode. A 2.5D perspective view where the map is laid out
  39181. * flat and objects with non-zero height are drawn above it.
  39182. */
  39183. COLUMBUS_VIEW = 1,
  39184. /**
  39185. * 2D mode. The map is viewed top-down with an orthographic projection.
  39186. */
  39187. SCENE2D = 2,
  39188. /**
  39189. * 3D mode. A traditional 3D perspective view of the globe.
  39190. */
  39191. SCENE3D = 3
  39192. }
  39193. /**
  39194. * Functions that do scene-dependent transforms between rendering-related coordinate systems.
  39195. */
  39196. export namespace SceneTransforms {
  39197. /**
  39198. * Transforms a position in WGS84 coordinates to window coordinates. This is commonly used to place an
  39199. * HTML element at the same screen position as an object in the scene.
  39200. * @example
  39201. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  39202. * const scene = widget.scene;
  39203. * const ellipsoid = scene.globe.ellipsoid;
  39204. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  39205. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  39206. * handler.setInputAction(function(movement) {
  39207. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  39208. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39209. * @param scene - The scene.
  39210. * @param position - The position in WGS84 (world) coordinates.
  39211. * @param [result] - An optional object to return the input position transformed to window coordinates.
  39212. * @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.
  39213. */
  39214. function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  39215. /**
  39216. * Transforms a position in WGS84 coordinates to drawing buffer coordinates. This may produce different
  39217. * results from SceneTransforms.wgs84ToWindowCoordinates when the browser zoom is not 100%, or on high-DPI displays.
  39218. * @example
  39219. * // Output the window position of longitude/latitude (0, 0) every time the mouse moves.
  39220. * const scene = widget.scene;
  39221. * const ellipsoid = scene.globe.ellipsoid;
  39222. * const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
  39223. * const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
  39224. * handler.setInputAction(function(movement) {
  39225. * console.log(Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position));
  39226. * }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39227. * @param scene - The scene.
  39228. * @param position - The position in WGS84 (world) coordinates.
  39229. * @param [result] - An optional object to return the input position transformed to window coordinates.
  39230. * @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.
  39231. */
  39232. function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2;
  39233. }
  39234. /**
  39235. * Modifies the camera position and orientation based on mouse input to a canvas.
  39236. * @param scene - The scene.
  39237. */
  39238. export class ScreenSpaceCameraController {
  39239. constructor(scene: Scene);
  39240. /**
  39241. * If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom,
  39242. * enableRotate, enableTilt, and enableLook. If false, all inputs are disabled.
  39243. *
  39244. * NOTE: This setting is for temporary use cases, such as camera flights and
  39245. * drag-selection of regions (see Picking demo). It is typically set to false at the
  39246. * start of such events, and set true on completion. To keep inputs disabled
  39247. * past the end of camera flights, you must use the other booleans (enableTranslate,
  39248. * enableZoom, enableRotate, enableTilt, and enableLook).
  39249. */
  39250. enableInputs: boolean;
  39251. /**
  39252. * If true, allows the user to pan around the map. If false, the camera stays locked at the current position.
  39253. * This flag only applies in 2D and Columbus view modes.
  39254. */
  39255. enableTranslate: boolean;
  39256. /**
  39257. * If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.
  39258. */
  39259. enableZoom: boolean;
  39260. /**
  39261. * If true, allows the user to rotate the world which translates the user's position.
  39262. * This flag only applies in 2D and 3D.
  39263. */
  39264. enableRotate: boolean;
  39265. /**
  39266. * If true, allows the user to tilt the camera. If false, the camera is locked to the current heading.
  39267. * This flag only applies in 3D and Columbus view.
  39268. */
  39269. enableTilt: boolean;
  39270. /**
  39271. * If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating
  39272. * or rotating. This flag only applies in 3D and Columbus view modes.
  39273. */
  39274. enableLook: boolean;
  39275. /**
  39276. * A parameter in the range <code>[0, 1)</code> used to determine how long
  39277. * the camera will continue to spin because of inertia.
  39278. * With value of zero, the camera will have no inertia.
  39279. */
  39280. inertiaSpin: number;
  39281. /**
  39282. * A parameter in the range <code>[0, 1)</code> used to determine how long
  39283. * the camera will continue to translate because of inertia.
  39284. * With value of zero, the camera will have no inertia.
  39285. */
  39286. inertiaTranslate: number;
  39287. /**
  39288. * A parameter in the range <code>[0, 1)</code> used to determine how long
  39289. * the camera will continue to zoom because of inertia.
  39290. * With value of zero, the camera will have no inertia.
  39291. */
  39292. inertiaZoom: number;
  39293. /**
  39294. * A parameter in the range <code>[0, 1)</code> used to limit the range
  39295. * of various user inputs to a percentage of the window width/height per animation frame.
  39296. * This helps keep the camera under control in low-frame-rate situations.
  39297. */
  39298. maximumMovementRatio: number;
  39299. /**
  39300. * Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.
  39301. */
  39302. bounceAnimationTime: number;
  39303. /**
  39304. * The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.
  39305. */
  39306. minimumZoomDistance: number;
  39307. /**
  39308. * The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.
  39309. */
  39310. maximumZoomDistance: number;
  39311. /**
  39312. * The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.
  39313. * <p>
  39314. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39315. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39316. * or an array of any of the preceding.
  39317. * </p>
  39318. */
  39319. translateEventTypes: CameraEventType | any[] | undefined;
  39320. /**
  39321. * The input that allows the user to zoom in/out.
  39322. * <p>
  39323. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39324. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39325. * or an array of any of the preceding.
  39326. * </p>
  39327. */
  39328. zoomEventTypes: CameraEventType | any[] | undefined;
  39329. /**
  39330. * The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.
  39331. * <p>
  39332. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39333. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39334. * or an array of any of the preceding.
  39335. * </p>
  39336. */
  39337. rotateEventTypes: CameraEventType | any[] | undefined;
  39338. /**
  39339. * The input that allows the user to tilt in 3D and Columbus view or twist in 2D.
  39340. * <p>
  39341. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39342. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39343. * or an array of any of the preceding.
  39344. * </p>
  39345. */
  39346. tiltEventTypes: CameraEventType | any[] | undefined;
  39347. /**
  39348. * The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.
  39349. * <p>
  39350. * The type came be a {@link CameraEventType}, <code>undefined</code>, an object with <code>eventType</code>
  39351. * and <code>modifier</code> properties with types <code>CameraEventType</code> and {@link KeyboardEventModifier},
  39352. * or an array of any of the preceding.
  39353. * </p>
  39354. */
  39355. lookEventTypes: CameraEventType | any[] | undefined;
  39356. /**
  39357. * The minimum height the camera must be before picking the terrain instead of the ellipsoid.
  39358. */
  39359. minimumPickingTerrainHeight: number;
  39360. /**
  39361. * The minimum height the camera must be before testing for collision with terrain.
  39362. */
  39363. minimumCollisionTerrainHeight: number;
  39364. /**
  39365. * The minimum height the camera must be before switching from rotating a track ball to
  39366. * free look when clicks originate on the sky or in space.
  39367. */
  39368. minimumTrackBallHeight: number;
  39369. /**
  39370. * Enables or disables camera collision detection with terrain.
  39371. */
  39372. enableCollisionDetection: boolean;
  39373. /**
  39374. * Returns true if this object was destroyed; otherwise, false.
  39375. * <br /><br />
  39376. * If this object was destroyed, it should not be used; calling any function other than
  39377. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39378. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39379. */
  39380. isDestroyed(): boolean;
  39381. /**
  39382. * Removes mouse listeners held by this object.
  39383. * <br /><br />
  39384. * Once an object is destroyed, it should not be used; calling any function other than
  39385. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39386. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39387. * @example
  39388. * controller = controller && controller.destroy();
  39389. */
  39390. destroy(): void;
  39391. }
  39392. /**
  39393. * Use {@link Viewer#shadowMap} to get the scene's shadow map. Do not construct this directly.
  39394. *
  39395. * <p>
  39396. * The normalOffset bias pushes the shadows forward slightly, and may be disabled
  39397. * for applications that require ultra precise shadows.
  39398. * </p>
  39399. * @param options - An object containing the following properties:
  39400. * @param options.lightCamera - A camera representing the light source.
  39401. * @param [options.enabled = true] - Whether the shadow map is enabled.
  39402. * @param [options.isPointLight = false] - Whether the light source is a point light. Point light shadows do not use cascades.
  39403. * @param [options.pointLightRadius = 100.0] - Radius of the point light.
  39404. * @param [options.cascadesEnabled = true] - Use multiple shadow maps to cover different partitions of the view frustum.
  39405. * @param [options.numberOfCascades = 4] - The number of cascades to use for the shadow map. Supported values are one and four.
  39406. * @param [options.maximumDistance = 5000.0] - The maximum distance used for generating cascaded shadows. Lower values improve shadow quality.
  39407. * @param [options.size = 2048] - The width and height, in pixels, of each shadow map.
  39408. * @param [options.softShadows = false] - Whether percentage-closer-filtering is enabled for producing softer shadows.
  39409. * @param [options.darkness = 0.3] - The shadow darkness.
  39410. * @param [options.normalOffset = true] - Whether a normal bias is applied to shadows.
  39411. * @param [options.fadingEnabled = true] - Whether shadows start to fade out once the light gets closer to the horizon.
  39412. */
  39413. export class ShadowMap {
  39414. constructor(options: {
  39415. lightCamera: Camera;
  39416. enabled?: boolean;
  39417. isPointLight?: boolean;
  39418. pointLightRadius?: number;
  39419. cascadesEnabled?: boolean;
  39420. numberOfCascades?: number;
  39421. maximumDistance?: number;
  39422. size?: number;
  39423. softShadows?: boolean;
  39424. darkness?: number;
  39425. normalOffset?: boolean;
  39426. fadingEnabled?: boolean;
  39427. });
  39428. /**
  39429. * Determines the darkness of the shadows.
  39430. */
  39431. darkness: number;
  39432. /**
  39433. * Determines whether shadows start to fade out once the light gets closer to the horizon.
  39434. */
  39435. fadingEnabled: boolean;
  39436. /**
  39437. * Determines the maximum distance of the shadow map. Only applicable for cascaded shadows. Larger distances may result in lower quality shadows.
  39438. */
  39439. maximumDistance: number;
  39440. /**
  39441. * Determines if the shadow map will be shown.
  39442. */
  39443. enabled: boolean;
  39444. /**
  39445. * Determines if a normal bias will be applied to shadows.
  39446. */
  39447. normalOffset: boolean;
  39448. /**
  39449. * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance.
  39450. */
  39451. softShadows: boolean;
  39452. /**
  39453. * The width and height, in pixels, of each shadow map.
  39454. */
  39455. size: number;
  39456. }
  39457. /**
  39458. * Specifies whether the object casts or receives shadows from light sources when
  39459. * shadows are enabled.
  39460. */
  39461. export enum ShadowMode {
  39462. /**
  39463. * The object does not cast or receive shadows.
  39464. */
  39465. DISABLED = 0,
  39466. /**
  39467. * The object casts and receives shadows.
  39468. */
  39469. ENABLED = 1,
  39470. /**
  39471. * The object casts shadows only.
  39472. */
  39473. CAST_ONLY = 2,
  39474. /**
  39475. * The object receives shadows only.
  39476. */
  39477. RECEIVE_ONLY = 3
  39478. }
  39479. export namespace SingleTileImageryProvider {
  39480. /**
  39481. * Initialization options for the SingleTileImageryProvider constructor
  39482. * @property url - The url for the tile.
  39483. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  39484. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  39485. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  39486. */
  39487. type ConstructorOptions = {
  39488. url: Resource | string;
  39489. rectangle?: Rectangle;
  39490. credit?: Credit | string;
  39491. ellipsoid?: Ellipsoid;
  39492. };
  39493. }
  39494. /**
  39495. * Provides a single, top-level imagery tile. The single image is assumed to use a
  39496. * {@link GeographicTilingScheme}.
  39497. * @param options - Object describing initialization options
  39498. */
  39499. export class SingleTileImageryProvider {
  39500. constructor(options: SingleTileImageryProvider.ConstructorOptions);
  39501. /**
  39502. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  39503. * 1.0 representing fully opaque.
  39504. */
  39505. defaultAlpha: number | undefined;
  39506. /**
  39507. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  39508. * 1.0 representing fully opaque.
  39509. */
  39510. defaultNightAlpha: number | undefined;
  39511. /**
  39512. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  39513. * 1.0 representing fully opaque.
  39514. */
  39515. defaultDayAlpha: number | undefined;
  39516. /**
  39517. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  39518. * makes the imagery darker while greater than 1.0 makes it brighter.
  39519. */
  39520. defaultBrightness: number | undefined;
  39521. /**
  39522. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  39523. * the contrast while greater than 1.0 increases it.
  39524. */
  39525. defaultContrast: number | undefined;
  39526. /**
  39527. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  39528. */
  39529. defaultHue: number | undefined;
  39530. /**
  39531. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  39532. * saturation while greater than 1.0 increases it.
  39533. */
  39534. defaultSaturation: number | undefined;
  39535. /**
  39536. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  39537. */
  39538. defaultGamma: number | undefined;
  39539. /**
  39540. * The default texture minification filter to apply to this provider.
  39541. */
  39542. defaultMinificationFilter: TextureMinificationFilter;
  39543. /**
  39544. * The default texture magnification filter to apply to this provider.
  39545. */
  39546. defaultMagnificationFilter: TextureMagnificationFilter;
  39547. /**
  39548. * Gets the URL of the single, top-level imagery tile.
  39549. */
  39550. readonly url: string;
  39551. /**
  39552. * Gets the proxy used by this provider.
  39553. */
  39554. readonly proxy: Proxy;
  39555. /**
  39556. * Gets the width of each tile, in pixels. This function should
  39557. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39558. */
  39559. readonly tileWidth: number;
  39560. /**
  39561. * Gets the height of each tile, in pixels. This function should
  39562. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39563. */
  39564. readonly tileHeight: number;
  39565. /**
  39566. * Gets the maximum level-of-detail that can be requested. This function should
  39567. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39568. */
  39569. readonly maximumLevel: number | undefined;
  39570. /**
  39571. * Gets the minimum level-of-detail that can be requested. This function should
  39572. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39573. */
  39574. readonly minimumLevel: number;
  39575. /**
  39576. * Gets the tiling scheme used by this provider. This function should
  39577. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39578. */
  39579. readonly tilingScheme: TilingScheme;
  39580. /**
  39581. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  39582. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39583. */
  39584. readonly rectangle: Rectangle;
  39585. /**
  39586. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  39587. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  39588. * returns undefined, no tiles are filtered. This function should
  39589. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39590. */
  39591. readonly tileDiscardPolicy: TileDiscardPolicy;
  39592. /**
  39593. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  39594. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  39595. * are passed an instance of {@link TileProviderError}.
  39596. */
  39597. readonly errorEvent: Event;
  39598. /**
  39599. * Gets a value indicating whether or not the provider is ready for use.
  39600. */
  39601. readonly ready: boolean;
  39602. /**
  39603. * Gets a promise that resolves to true when the provider is ready for use.
  39604. */
  39605. readonly readyPromise: Promise<boolean>;
  39606. /**
  39607. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  39608. * the source of the imagery. This function should not be called before {@link SingleTileImageryProvider#ready} returns true.
  39609. */
  39610. readonly credit: Credit;
  39611. /**
  39612. * Gets a value indicating whether or not the images provided by this imagery provider
  39613. * include an alpha channel. If this property is false, an alpha channel, if present, will
  39614. * be ignored. If this property is true, any images without an alpha channel will be treated
  39615. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  39616. * and texture upload time are reduced.
  39617. */
  39618. readonly hasAlphaChannel: boolean;
  39619. /**
  39620. * Gets the credits to be displayed when a given tile is displayed.
  39621. * @param x - The tile X coordinate.
  39622. * @param y - The tile Y coordinate.
  39623. * @param level - The tile level;
  39624. * @returns The credits to be displayed when the tile is displayed.
  39625. */
  39626. getTileCredits(x: number, y: number, level: number): Credit[];
  39627. /**
  39628. * Requests the image for a given tile. This function should
  39629. * not be called before {@link SingleTileImageryProvider#ready} returns true.
  39630. * @param x - The tile X coordinate.
  39631. * @param y - The tile Y coordinate.
  39632. * @param level - The tile level.
  39633. * @param [request] - The request object. Intended for internal use only.
  39634. * @returns The resolved image
  39635. */
  39636. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  39637. /**
  39638. * Picking features is not currently supported by this imagery provider, so this function simply returns
  39639. * undefined.
  39640. * @param x - The tile X coordinate.
  39641. * @param y - The tile Y coordinate.
  39642. * @param level - The tile level.
  39643. * @param longitude - The longitude at which to pick features.
  39644. * @param latitude - The latitude at which to pick features.
  39645. * @returns Undefined since picking is not supported.
  39646. */
  39647. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  39648. }
  39649. /**
  39650. * An atmosphere drawn around the limb of the provided ellipsoid. Based on
  39651. * {@link http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf|Display of The Earth Taking Into Account Atmospheric Scattering}.
  39652. * <p>
  39653. * This is only supported in 3D. Atmosphere is faded out when morphing to 2D or Columbus view.
  39654. * </p>
  39655. * @example
  39656. * scene.skyAtmosphere = new Cesium.SkyAtmosphere();
  39657. * @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid that the atmosphere is drawn around.
  39658. */
  39659. export class SkyAtmosphere {
  39660. constructor(ellipsoid?: Ellipsoid);
  39661. /**
  39662. * Determines if the atmosphere is shown.
  39663. */
  39664. show: boolean;
  39665. /**
  39666. * Compute atmosphere per-fragment instead of per-vertex.
  39667. * This produces better looking atmosphere with a slight performance penalty.
  39668. */
  39669. perFragmentAtmosphere: boolean;
  39670. /**
  39671. * The intensity of the light that is used for computing the sky atmosphere color.
  39672. */
  39673. atmosphereLightIntensity: number;
  39674. /**
  39675. * The Rayleigh scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
  39676. */
  39677. atmosphereRayleighCoefficient: Cartesian3;
  39678. /**
  39679. * The Mie scattering coefficient used in the atmospheric scattering equations for the sky atmosphere.
  39680. */
  39681. atmosphereMieCoefficient: Cartesian3;
  39682. /**
  39683. * The Rayleigh scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
  39684. */
  39685. atmosphereRayleighScaleHeight: number;
  39686. /**
  39687. * The Mie scale height used in the atmospheric scattering equations for the sky atmosphere, in meters.
  39688. */
  39689. atmosphereMieScaleHeight: number;
  39690. /**
  39691. * The anisotropy of the medium to consider for Mie scattering.
  39692. * <p>
  39693. * Valid values are between -1.0 and 1.0.
  39694. * </p>
  39695. */
  39696. atmosphereMieAnisotropy: number;
  39697. /**
  39698. * The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  39699. * A hue shift of 1.0 indicates a complete rotation of the hues available.
  39700. */
  39701. hueShift: number;
  39702. /**
  39703. * The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  39704. * A saturation shift of -1.0 is monochrome.
  39705. */
  39706. saturationShift: number;
  39707. /**
  39708. * The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift).
  39709. * A brightness shift of -1.0 is complete darkness, which will let space show through.
  39710. */
  39711. brightnessShift: number;
  39712. /**
  39713. * Gets the ellipsoid the atmosphere is drawn around.
  39714. */
  39715. readonly ellipsoid: Ellipsoid;
  39716. /**
  39717. * Returns true if this object was destroyed; otherwise, false.
  39718. * <br /><br />
  39719. * If this object was destroyed, it should not be used; calling any function other than
  39720. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39721. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39722. */
  39723. isDestroyed(): boolean;
  39724. /**
  39725. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39726. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39727. * <br /><br />
  39728. * Once an object is destroyed, it should not be used; calling any function other than
  39729. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39730. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39731. * @example
  39732. * skyAtmosphere = skyAtmosphere && skyAtmosphere.destroy();
  39733. */
  39734. destroy(): void;
  39735. }
  39736. /**
  39737. * A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.
  39738. * <p>
  39739. * This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of
  39740. * the sky box must not exceed {@link Scene#maximumCubeMapSize}.
  39741. * </p>
  39742. * @example
  39743. * scene.skyBox = new Cesium.SkyBox({
  39744. * sources : {
  39745. * positiveX : 'skybox_px.png',
  39746. * negativeX : 'skybox_nx.png',
  39747. * positiveY : 'skybox_py.png',
  39748. * negativeY : 'skybox_ny.png',
  39749. * positiveZ : 'skybox_pz.png',
  39750. * negativeZ : 'skybox_nz.png'
  39751. * }
  39752. * });
  39753. * @param options - Object with the following properties:
  39754. * @param [options.sources] - The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.
  39755. * @param [options.show = true] - Determines if this primitive will be shown.
  39756. */
  39757. export class SkyBox {
  39758. constructor(options: {
  39759. sources?: any;
  39760. show?: boolean;
  39761. });
  39762. /**
  39763. * The sources used to create the cube map faces: an object
  39764. * with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,
  39765. * <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.
  39766. * These can be either URLs or <code>Image</code> objects.
  39767. */
  39768. sources: any;
  39769. /**
  39770. * Determines if the sky box will be shown.
  39771. */
  39772. show: boolean;
  39773. /**
  39774. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  39775. * get the draw commands needed to render this primitive.
  39776. * <p>
  39777. * Do not call this function directly. This is documented just to
  39778. * list the exceptions that may be propagated when the scene is rendered:
  39779. * </p>
  39780. */
  39781. update(): void;
  39782. /**
  39783. * Returns true if this object was destroyed; otherwise, false.
  39784. * <br /><br />
  39785. * If this object was destroyed, it should not be used; calling any function other than
  39786. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39787. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39788. */
  39789. isDestroyed(): boolean;
  39790. /**
  39791. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39792. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39793. * <br /><br />
  39794. * Once an object is destroyed, it should not be used; calling any function other than
  39795. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39796. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39797. * @example
  39798. * skyBox = skyBox && skyBox.destroy();
  39799. */
  39800. destroy(): void;
  39801. }
  39802. /**
  39803. * A ParticleEmitter that emits particles within a sphere.
  39804. * Particles will be positioned randomly within the sphere and have initial velocities emanating from the center of the sphere.
  39805. * @param [radius = 1.0] - The radius of the sphere in meters.
  39806. */
  39807. export class SphereEmitter {
  39808. constructor(radius?: number);
  39809. /**
  39810. * The radius of the sphere in meters.
  39811. */
  39812. radius: number;
  39813. }
  39814. /**
  39815. * The direction to display a primitive or ImageryLayer relative to the {@link Scene#splitPosition}.
  39816. */
  39817. export enum SplitDirection {
  39818. /**
  39819. * Display the primitive or ImageryLayer to the left of the {@link Scene#splitPosition}.
  39820. */
  39821. LEFT = -1,
  39822. /**
  39823. * Always display the primitive or ImageryLayer.
  39824. */
  39825. NONE = 0,
  39826. /**
  39827. * Display the primitive or ImageryLayer to the right of the {@link Scene#splitPosition}.
  39828. */
  39829. RIGHT = 1
  39830. }
  39831. /**
  39832. * Determines the function used to compare stencil values for the stencil test.
  39833. */
  39834. export enum StencilFunction {
  39835. /**
  39836. * The stencil test never passes.
  39837. */
  39838. NEVER = WebGLConstants.NEVER,
  39839. /**
  39840. * The stencil test passes when the masked reference value is less than the masked stencil value.
  39841. */
  39842. LESS = WebGLConstants.LESS,
  39843. /**
  39844. * The stencil test passes when the masked reference value is equal to the masked stencil value.
  39845. */
  39846. EQUAL = WebGLConstants.EQUAL,
  39847. /**
  39848. * The stencil test passes when the masked reference value is less than or equal to the masked stencil value.
  39849. */
  39850. LESS_OR_EQUAL = WebGLConstants.LEQUAL,
  39851. /**
  39852. * The stencil test passes when the masked reference value is greater than the masked stencil value.
  39853. */
  39854. GREATER = WebGLConstants.GREATER,
  39855. /**
  39856. * The stencil test passes when the masked reference value is not equal to the masked stencil value.
  39857. */
  39858. NOT_EQUAL = WebGLConstants.NOTEQUAL,
  39859. /**
  39860. * The stencil test passes when the masked reference value is greater than or equal to the masked stencil value.
  39861. */
  39862. GREATER_OR_EQUAL = WebGLConstants.GEQUAL,
  39863. /**
  39864. * The stencil test always passes.
  39865. */
  39866. ALWAYS = WebGLConstants.ALWAYS
  39867. }
  39868. /**
  39869. * Determines the action taken based on the result of the stencil test.
  39870. */
  39871. export enum StencilOperation {
  39872. /**
  39873. * Sets the stencil buffer value to zero.
  39874. */
  39875. ZERO = WebGLConstants.ZERO,
  39876. /**
  39877. * Does not change the stencil buffer.
  39878. */
  39879. KEEP = WebGLConstants.KEEP,
  39880. /**
  39881. * Replaces the stencil buffer value with the reference value.
  39882. */
  39883. REPLACE = WebGLConstants.REPLACE,
  39884. /**
  39885. * Increments the stencil buffer value, clamping to unsigned byte.
  39886. */
  39887. INCREMENT = WebGLConstants.INCR,
  39888. /**
  39889. * Decrements the stencil buffer value, clamping to zero.
  39890. */
  39891. DECREMENT = WebGLConstants.DECR,
  39892. /**
  39893. * Bitwise inverts the existing stencil buffer value.
  39894. */
  39895. INVERT = WebGLConstants.INVERT,
  39896. /**
  39897. * Increments the stencil buffer value, wrapping to zero when exceeding the unsigned byte range.
  39898. */
  39899. INCREMENT_WRAP = WebGLConstants.INCR_WRAP,
  39900. /**
  39901. * Decrements the stencil buffer value, wrapping to the maximum unsigned byte instead of going below zero.
  39902. */
  39903. DECREMENT_WRAP = WebGLConstants.DECR_WRAP
  39904. }
  39905. /**
  39906. * An expression for a style applied to a {@link Cesium3DTileset}.
  39907. * <p>
  39908. * Derived classes of this interface evaluate expressions in the
  39909. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}.
  39910. * </p>
  39911. * <p>
  39912. * This type describes an interface and is not intended to be instantiated directly.
  39913. * </p>
  39914. */
  39915. export class StyleExpression {
  39916. constructor();
  39917. /**
  39918. * Evaluates the result of an expression, optionally using the provided feature's properties. If the result of
  39919. * the expression in the
  39920. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language}
  39921. * is of type <code>Boolean</code>, <code>Number</code>, or <code>String</code>, the corresponding JavaScript
  39922. * primitive type will be returned. If the result is a <code>RegExp</code>, a Javascript <code>RegExp</code>
  39923. * object will be returned. If the result is a <code>Cartesian2</code>, <code>Cartesian3</code>, or <code>Cartesian4</code>,
  39924. * a {@link Cartesian2}, {@link Cartesian3}, or {@link Cartesian4} object will be returned. If the <code>result</code> argument is
  39925. * a {@link Color}, the {@link Cartesian4} value is converted to a {@link Color} and then returned.
  39926. * @param feature - The feature whose properties may be used as variables in the expression.
  39927. * @param [result] - The object onto which to store the result.
  39928. * @returns The result of evaluating the expression.
  39929. */
  39930. evaluate(feature: Cesium3DTileFeature, result?: any): boolean | number | string | RegExp | Cartesian2 | Cartesian3 | Cartesian4 | Color;
  39931. /**
  39932. * Evaluates the result of a Color expression, optionally using the provided feature's properties.
  39933. * <p>
  39934. * This is equivalent to {@link StyleExpression#evaluate} but always returns a {@link Color} object.
  39935. * </p>
  39936. * @param feature - The feature whose properties may be used as variables in the expression.
  39937. * @param [result] - The object in which to store the result.
  39938. * @returns The modified result parameter or a new Color instance if one was not provided.
  39939. */
  39940. evaluateColor(feature: Cesium3DTileFeature, result?: Color): Color;
  39941. }
  39942. /**
  39943. * Draws a sun billboard.
  39944. * <p>This is only supported in 3D and Columbus view.</p>
  39945. * @example
  39946. * scene.sun = new Cesium.Sun();
  39947. */
  39948. export class Sun {
  39949. constructor();
  39950. /**
  39951. * Determines if the sun will be shown.
  39952. */
  39953. show: boolean;
  39954. /**
  39955. * Gets or sets a number that controls how "bright" the Sun's lens flare appears
  39956. * to be. Zero shows just the Sun's disc without any flare.
  39957. * Use larger values for a more pronounced flare around the Sun.
  39958. */
  39959. glowFactor: number;
  39960. /**
  39961. * Returns true if this object was destroyed; otherwise, false.
  39962. * <br /><br />
  39963. * If this object was destroyed, it should not be used; calling any function other than
  39964. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  39965. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  39966. */
  39967. isDestroyed(): boolean;
  39968. /**
  39969. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  39970. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  39971. * <br /><br />
  39972. * Once an object is destroyed, it should not be used; calling any function other than
  39973. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  39974. * assign the return value (<code>undefined</code>) to the object as done in the example.
  39975. * @example
  39976. * sun = sun && sun.destroy();
  39977. *
  39978. *
  39979. */
  39980. destroy(): void;
  39981. }
  39982. /**
  39983. * A directional light source that originates from the Sun.
  39984. * @param [options] - Object with the following properties:
  39985. * @param [options.color = Color.WHITE] - The light's color.
  39986. * @param [options.intensity = 2.0] - The light's intensity.
  39987. */
  39988. export class SunLight {
  39989. constructor(options?: {
  39990. color?: Color;
  39991. intensity?: number;
  39992. });
  39993. /**
  39994. * The color of the light.
  39995. */
  39996. color: Color;
  39997. /**
  39998. * The intensity of the light.
  39999. */
  40000. intensity: number;
  40001. }
  40002. export namespace TileCoordinatesImageryProvider {
  40003. /**
  40004. * Initialization options for the TileCoordinatesImageryProvider constructor
  40005. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme for which to draw tiles.
  40006. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40007. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40008. * parameter is specified, the WGS84 ellipsoid is used.
  40009. * @property [color = Color.YELLOW] - The color to draw the tile box and label.
  40010. * @property [tileWidth = 256] - The width of the tile for level-of-detail selection purposes.
  40011. * @property [tileHeight = 256] - The height of the tile for level-of-detail selection purposes.
  40012. */
  40013. type ConstructorOptions = {
  40014. tilingScheme?: TilingScheme;
  40015. ellipsoid?: Ellipsoid;
  40016. color?: Color;
  40017. tileWidth?: number;
  40018. tileHeight?: number;
  40019. };
  40020. }
  40021. /**
  40022. * An {@link ImageryProvider} that draws a box around every rendered tile in the tiling scheme, and draws
  40023. * a label inside it indicating the X, Y, Level coordinates of the tile. This is mostly useful for
  40024. * debugging terrain and imagery rendering problems.
  40025. * @param [options] - Object describing initialization options
  40026. */
  40027. export class TileCoordinatesImageryProvider {
  40028. constructor(options?: TileCoordinatesImageryProvider.ConstructorOptions);
  40029. /**
  40030. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  40031. * 1.0 representing fully opaque.
  40032. */
  40033. defaultAlpha: number | undefined;
  40034. /**
  40035. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  40036. * 1.0 representing fully opaque.
  40037. */
  40038. defaultNightAlpha: number | undefined;
  40039. /**
  40040. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  40041. * 1.0 representing fully opaque.
  40042. */
  40043. defaultDayAlpha: number | undefined;
  40044. /**
  40045. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  40046. * makes the imagery darker while greater than 1.0 makes it brighter.
  40047. */
  40048. defaultBrightness: number | undefined;
  40049. /**
  40050. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  40051. * the contrast while greater than 1.0 increases it.
  40052. */
  40053. defaultContrast: number | undefined;
  40054. /**
  40055. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  40056. */
  40057. defaultHue: number | undefined;
  40058. /**
  40059. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  40060. * saturation while greater than 1.0 increases it.
  40061. */
  40062. defaultSaturation: number | undefined;
  40063. /**
  40064. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  40065. */
  40066. defaultGamma: number | undefined;
  40067. /**
  40068. * The default texture minification filter to apply to this provider.
  40069. */
  40070. defaultMinificationFilter: TextureMinificationFilter;
  40071. /**
  40072. * The default texture magnification filter to apply to this provider.
  40073. */
  40074. defaultMagnificationFilter: TextureMagnificationFilter;
  40075. /**
  40076. * Gets the proxy used by this provider.
  40077. */
  40078. readonly proxy: Proxy;
  40079. /**
  40080. * Gets the width of each tile, in pixels. This function should
  40081. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40082. */
  40083. readonly tileWidth: number;
  40084. /**
  40085. * Gets the height of each tile, in pixels. This function should
  40086. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40087. */
  40088. readonly tileHeight: number;
  40089. /**
  40090. * Gets the maximum level-of-detail that can be requested. This function should
  40091. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40092. */
  40093. readonly maximumLevel: number | undefined;
  40094. /**
  40095. * Gets the minimum level-of-detail that can be requested. This function should
  40096. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40097. */
  40098. readonly minimumLevel: number;
  40099. /**
  40100. * Gets the tiling scheme used by this provider. This function should
  40101. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40102. */
  40103. readonly tilingScheme: TilingScheme;
  40104. /**
  40105. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  40106. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40107. */
  40108. readonly rectangle: Rectangle;
  40109. /**
  40110. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  40111. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  40112. * returns undefined, no tiles are filtered. This function should
  40113. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40114. */
  40115. readonly tileDiscardPolicy: TileDiscardPolicy;
  40116. /**
  40117. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  40118. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  40119. * are passed an instance of {@link TileProviderError}.
  40120. */
  40121. readonly errorEvent: Event;
  40122. /**
  40123. * Gets a value indicating whether or not the provider is ready for use.
  40124. */
  40125. readonly ready: boolean;
  40126. /**
  40127. * Gets a promise that resolves to true when the provider is ready for use.
  40128. */
  40129. readonly readyPromise: Promise<boolean>;
  40130. /**
  40131. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  40132. * the source of the imagery. This function should not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40133. */
  40134. readonly credit: Credit;
  40135. /**
  40136. * Gets a value indicating whether or not the images provided by this imagery provider
  40137. * include an alpha channel. If this property is false, an alpha channel, if present, will
  40138. * be ignored. If this property is true, any images without an alpha channel will be treated
  40139. * as if their alpha is 1.0 everywhere. Setting this property to false reduces memory usage
  40140. * and texture upload time.
  40141. */
  40142. readonly hasAlphaChannel: boolean;
  40143. /**
  40144. * Gets the credits to be displayed when a given tile is displayed.
  40145. * @param x - The tile X coordinate.
  40146. * @param y - The tile Y coordinate.
  40147. * @param level - The tile level;
  40148. * @returns The credits to be displayed when the tile is displayed.
  40149. */
  40150. getTileCredits(x: number, y: number, level: number): Credit[];
  40151. /**
  40152. * Requests the image for a given tile. This function should
  40153. * not be called before {@link TileCoordinatesImageryProvider#ready} returns true.
  40154. * @param x - The tile X coordinate.
  40155. * @param y - The tile Y coordinate.
  40156. * @param level - The tile level.
  40157. * @param [request] - The request object. Intended for internal use only.
  40158. * @returns The resolved image as a Canvas DOM object.
  40159. */
  40160. requestImage(x: number, y: number, level: number, request?: Request): Promise<HTMLCanvasElement>;
  40161. /**
  40162. * Picking features is not currently supported by this imagery provider, so this function simply returns
  40163. * undefined.
  40164. * @param x - The tile X coordinate.
  40165. * @param y - The tile Y coordinate.
  40166. * @param level - The tile level.
  40167. * @param longitude - The longitude at which to pick features.
  40168. * @param latitude - The latitude at which to pick features.
  40169. * @returns Undefined since picking is not supported.
  40170. */
  40171. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  40172. }
  40173. /**
  40174. * A policy for discarding tile images according to some criteria. This type describes an
  40175. * interface and is not intended to be instantiated directly.
  40176. */
  40177. export class TileDiscardPolicy {
  40178. constructor();
  40179. /**
  40180. * Determines if the discard policy is ready to process images.
  40181. * @returns True if the discard policy is ready to process images; otherwise, false.
  40182. */
  40183. isReady(): boolean;
  40184. /**
  40185. * Given a tile image, decide whether to discard that image.
  40186. * @param image - An image to test.
  40187. * @returns True if the image should be discarded; otherwise, false.
  40188. */
  40189. shouldDiscardImage(image: HTMLImageElement): boolean;
  40190. }
  40191. export namespace TileMapServiceImageryProvider {
  40192. /**
  40193. * Initialization options for the TileMapServiceImageryProvider constructor
  40194. * @property [url = '.'] - Path to image tiles on server.
  40195. * @property [fileExtension = 'png'] - The file extension for images on the server.
  40196. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  40197. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  40198. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  40199. * to result in rendering problems.
  40200. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  40201. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  40202. * @property [tilingScheme] - The tiling scheme specifying how the ellipsoidal
  40203. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  40204. * is used.
  40205. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40206. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40207. * parameter is specified, the WGS84 ellipsoid is used.
  40208. * @property [tileWidth = 256] - Pixel width of image tiles.
  40209. * @property [tileHeight = 256] - Pixel height of image tiles.
  40210. * @property [flipXY] - Older versions of gdal2tiles.py flipped X and Y values in tilemapresource.xml.
  40211. * Specifying this option will do the same, allowing for loading of these incorrect tilesets.
  40212. */
  40213. type ConstructorOptions = {
  40214. url?: Resource | string | Promise<Resource> | Promise<string>;
  40215. fileExtension?: string;
  40216. credit?: Credit | string;
  40217. minimumLevel?: number;
  40218. maximumLevel?: number;
  40219. rectangle?: Rectangle;
  40220. tilingScheme?: TilingScheme;
  40221. ellipsoid?: Ellipsoid;
  40222. tileWidth?: number;
  40223. tileHeight?: number;
  40224. flipXY?: boolean;
  40225. };
  40226. }
  40227. /**
  40228. * An imagery provider that provides tiled imagery as generated by
  40229. * {@link http://www.maptiler.org/|MapTiler}, {@link http://www.klokan.cz/projects/gdal2tiles/|GDAL2Tiles}, etc.
  40230. * @example
  40231. * const tms = new Cesium.TileMapServiceImageryProvider({
  40232. * url : '../images/cesium_maptiler/Cesium_Logo_Color',
  40233. * fileExtension: 'png',
  40234. * maximumLevel: 4,
  40235. * rectangle: new Cesium.Rectangle(
  40236. * Cesium.Math.toRadians(-120.0),
  40237. * Cesium.Math.toRadians(20.0),
  40238. * Cesium.Math.toRadians(-60.0),
  40239. * Cesium.Math.toRadians(40.0))
  40240. * });
  40241. * @param options - Object describing initialization options
  40242. */
  40243. export class TileMapServiceImageryProvider extends UrlTemplateImageryProvider {
  40244. constructor(options: TileMapServiceImageryProvider.ConstructorOptions);
  40245. }
  40246. /**
  40247. * Provides functionality for ImageryProviders that have time dynamic imagery
  40248. * @param options - Object with the following properties:
  40249. * @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.
  40250. * @param options.times - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  40251. * @param options.requestImageFunction - A function that will request imagery tiles.
  40252. * @param options.reloadFunction - A function that will be called when all imagery tiles need to be reloaded.
  40253. */
  40254. export class TimeDynamicImagery {
  40255. constructor(options: {
  40256. clock: Clock;
  40257. times: TimeIntervalCollection;
  40258. requestImageFunction: (...params: any[]) => any;
  40259. reloadFunction: (...params: any[]) => any;
  40260. });
  40261. /**
  40262. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  40263. */
  40264. clock: Clock;
  40265. /**
  40266. * Gets or sets a time interval collection.
  40267. */
  40268. times: TimeIntervalCollection;
  40269. /**
  40270. * Gets the current interval.
  40271. */
  40272. currentInterval: TimeInterval;
  40273. /**
  40274. * Gets the tile from the cache if its available.
  40275. * @param x - The tile X coordinate.
  40276. * @param y - The tile Y coordinate.
  40277. * @param level - The tile level.
  40278. * @param [request] - The request object. Intended for internal use only.
  40279. * @returns A promise for the image that will resolve when the image is available, or
  40280. * undefined if the tile is not in the cache.
  40281. */
  40282. getFromCache(x: number, y: number, level: number, request?: Request): Promise<HTMLImageElement> | undefined;
  40283. /**
  40284. * Checks if the next interval is approaching and will start preload the tile if necessary. Otherwise it will
  40285. * just add the tile to a list to preload when we approach the next interval.
  40286. * @param x - The tile X coordinate.
  40287. * @param y - The tile Y coordinate.
  40288. * @param level - The tile level.
  40289. * @param [request] - The request object. Intended for internal use only.
  40290. */
  40291. checkApproachingInterval(x: number, y: number, level: number, request?: Request): void;
  40292. }
  40293. /**
  40294. * Provides playback of time-dynamic point cloud data.
  40295. * <p>
  40296. * Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed.
  40297. * If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently
  40298. * small or the clock is sufficiently slow then no frames will be skipped.
  40299. * </p>
  40300. * @param options - Object with the following properties:
  40301. * @param options.clock - A {@link Clock} instance that is used when determining the value for the time dimension.
  40302. * @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>.
  40303. * @param [options.show = true] - Determines if the point cloud will be shown.
  40304. * @param [options.modelMatrix = Matrix4.IDENTITY] - A 4x4 transformation matrix that transforms the point cloud.
  40305. * @param [options.shadows = ShadowMode.ENABLED] - Determines whether the point cloud casts or receives shadows from light sources.
  40306. * @param [options.maximumMemoryUsage = 256] - The maximum amount of memory in MB that can be used by the point cloud.
  40307. * @param [options.shading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and eye dome lighting.
  40308. * @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.
  40309. * @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  40310. */
  40311. export class TimeDynamicPointCloud {
  40312. constructor(options: {
  40313. clock: Clock;
  40314. intervals: TimeIntervalCollection;
  40315. show?: boolean;
  40316. modelMatrix?: Matrix4;
  40317. shadows?: ShadowMode;
  40318. maximumMemoryUsage?: number;
  40319. shading?: any;
  40320. style?: Cesium3DTileStyle;
  40321. clippingPlanes?: ClippingPlaneCollection;
  40322. });
  40323. /**
  40324. * Determines if the point cloud will be shown.
  40325. */
  40326. show: boolean;
  40327. /**
  40328. * A 4x4 transformation matrix that transforms the point cloud.
  40329. */
  40330. modelMatrix: Matrix4;
  40331. /**
  40332. * Determines whether the point cloud casts or receives shadows from light sources.
  40333. * <p>
  40334. * 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.
  40335. * </p>
  40336. * <p>
  40337. * Shadows are rendered only when {@link Viewer#shadows} is <code>true</code>.
  40338. * </p>
  40339. */
  40340. shadows: ShadowMode;
  40341. /**
  40342. * The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.
  40343. * <p>
  40344. * Frames that are not being loaded or rendered are unloaded to enforce this.
  40345. * </p>
  40346. * <p>
  40347. * If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.
  40348. * </p>
  40349. */
  40350. maximumMemoryUsage: number;
  40351. /**
  40352. * Options for controlling point size based on geometric error and eye dome lighting.
  40353. */
  40354. shading: PointCloudShading;
  40355. /**
  40356. * The style, defined using the
  40357. * {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling|3D Tiles Styling language},
  40358. * applied to each point in the point cloud.
  40359. * <p>
  40360. * Assign <code>undefined</code> to remove the style, which will restore the visual
  40361. * appearance of the point cloud to its default when no style was applied.
  40362. * </p>
  40363. * @example
  40364. * pointCloud.style = new Cesium.Cesium3DTileStyle({
  40365. * color : {
  40366. * conditions : [
  40367. * ['${Classification} === 0', 'color("purple", 0.5)'],
  40368. * ['${Classification} === 1', 'color("red")'],
  40369. * ['true', '${COLOR}']
  40370. * ]
  40371. * },
  40372. * show : '${Classification} !== 2'
  40373. * });
  40374. */
  40375. style: Cesium3DTileStyle;
  40376. /**
  40377. * The event fired to indicate that a frame failed to load. A frame may fail to load if the
  40378. * request for its uri fails or processing fails due to invalid content.
  40379. * <p>
  40380. * If there are no event listeners, error messages will be logged to the console.
  40381. * </p>
  40382. * <p>
  40383. * The error object passed to the listener contains two properties:
  40384. * <ul>
  40385. * <li><code>uri</code>: the uri of the failed frame.</li>
  40386. * <li><code>message</code>: the error message.</li>
  40387. * </ul>
  40388. * @example
  40389. * pointCloud.frameFailed.addEventListener(function(error) {
  40390. * console.log('An error occurred loading frame: ' + error.uri);
  40391. * console.log('Error: ' + error.message);
  40392. * });
  40393. */
  40394. frameFailed: Event;
  40395. /**
  40396. * The event fired to indicate that a new frame was rendered.
  40397. * <p>
  40398. * The time dynamic point cloud {@link TimeDynamicPointCloud} is passed to the event listener.
  40399. * </p>
  40400. * @example
  40401. * pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {
  40402. * viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);
  40403. * });
  40404. */
  40405. frameChanged: Event;
  40406. /**
  40407. * The {@link ClippingPlaneCollection} used to selectively disable rendering the point cloud.
  40408. */
  40409. clippingPlanes: ClippingPlaneCollection;
  40410. /**
  40411. * The total amount of GPU memory in bytes used by the point cloud.
  40412. */
  40413. readonly totalMemoryUsageInBytes: number;
  40414. /**
  40415. * The bounding sphere of the frame being rendered. Returns <code>undefined</code> if no frame is being rendered.
  40416. */
  40417. readonly boundingSphere: BoundingSphere;
  40418. /**
  40419. * Gets the promise that will be resolved when the point cloud renders a frame for the first time.
  40420. */
  40421. readonly readyPromise: Promise<TimeDynamicPointCloud>;
  40422. /**
  40423. * Marks the point cloud's {@link TimeDynamicPointCloud#style} as dirty, which forces all
  40424. * points to re-evaluate the style in the next frame.
  40425. */
  40426. makeStyleDirty(): void;
  40427. /**
  40428. * Returns true if this object was destroyed; otherwise, false.
  40429. * <br /><br />
  40430. * If this object was destroyed, it should not be used; calling any function other than
  40431. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  40432. * @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
  40433. */
  40434. isDestroyed(): boolean;
  40435. /**
  40436. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  40437. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  40438. * <br /><br />
  40439. * Once an object is destroyed, it should not be used; calling any function other than
  40440. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  40441. * assign the return value (<code>undefined</code>) to the object as done in the example.
  40442. * @example
  40443. * pointCloud = pointCloud && pointCloud.destroy();
  40444. */
  40445. destroy(): void;
  40446. }
  40447. export namespace UrlTemplateImageryProvider {
  40448. /**
  40449. * Initialization options for the UrlTemplateImageryProvider constructor
  40450. * @property [options] - Object with the following properties:
  40451. * @property url - The URL template to use to request tiles. It has the following keywords:
  40452. * <ul>
  40453. * <li><code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  40454. * <li><code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  40455. * <li><code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  40456. * <li><code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  40457. * <li><code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  40458. * <li><code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  40459. * <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>
  40460. * <li><code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  40461. * <li><code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  40462. * <li><code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  40463. * <li><code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  40464. * <li><code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  40465. * <li><code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  40466. * <li><code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  40467. * <li><code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  40468. * <li><code>{width}</code>: The width of each tile in pixels.</li>
  40469. * <li><code>{height}</code>: The height of each tile in pixels.</li>
  40470. * </ul>
  40471. * @property [pickFeaturesUrl] - The URL template to use to pick features. If this property is not specified,
  40472. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately returned undefined, indicating no
  40473. * features picked. The URL template supports all of the keywords supported by the <code>url</code>
  40474. * parameter, plus the following:
  40475. * <ul>
  40476. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  40477. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  40478. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  40479. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  40480. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  40481. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  40482. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40483. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40484. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  40485. * </ul>
  40486. * @property [urlSchemeZeroPadding] - Gets the URL scheme zero padding for each tile coordinate. The format is '000' where
  40487. * each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  40488. * urlSchemeZeroPadding : { '{x}' : '0000'}
  40489. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  40490. * It the passed object has the following keywords:
  40491. * <ul>
  40492. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  40493. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  40494. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  40495. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  40496. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  40497. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  40498. * </ul>
  40499. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  40500. * If this parameter is a single string, each character in the string is a subdomain. If it is
  40501. * an array, each element in the array is a subdomain.
  40502. * @property [credit = ''] - A credit for the data source, which is displayed on the canvas.
  40503. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when specifying
  40504. * this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
  40505. * to result in rendering problems.
  40506. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  40507. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle, in radians, covered by the image.
  40508. * @property [tilingScheme = WebMercatorTilingScheme] - The tiling scheme specifying how the ellipsoidal
  40509. * surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
  40510. * is used.
  40511. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40512. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40513. * parameter is specified, the WGS84 ellipsoid is used.
  40514. * @property [tileWidth = 256] - Pixel width of image tiles.
  40515. * @property [tileHeight = 256] - Pixel height of image tiles.
  40516. * @property [hasAlphaChannel = true] - true if the images provided by this imagery provider
  40517. * include an alpha channel; otherwise, false. If this property is false, an alpha channel, if
  40518. * present, will be ignored. If this property is true, any images without an alpha channel will
  40519. * be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage
  40520. * and texture upload time are potentially reduced.
  40521. * @property [getFeatureInfoFormats] - The formats in which to get feature information at a
  40522. * specific location when {@link UrlTemplateImageryProvider#pickFeatures} is invoked. If this
  40523. * parameter is not specified, feature picking is disabled.
  40524. * @property [enablePickFeatures = true] - If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  40525. * request the <code>pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  40526. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  40527. * features) without communicating with the server. Set this property to false if you know your data
  40528. * source does not support picking features or if you don't want this provider's features to be pickable. Note
  40529. * that this can be dynamically overridden by modifying the {@link UriTemplateImageryProvider#enablePickFeatures}
  40530. * property.
  40531. * @property [customTags] - Allow to replace custom keywords in the URL template. The object must have strings as keys and functions as values.
  40532. */
  40533. type ConstructorOptions = {
  40534. options?: Promise<object> | any;
  40535. url: Resource | string;
  40536. pickFeaturesUrl?: Resource | string;
  40537. urlSchemeZeroPadding?: any;
  40538. subdomains?: string | string[];
  40539. credit?: Credit | string;
  40540. minimumLevel?: number;
  40541. maximumLevel?: number;
  40542. rectangle?: Rectangle;
  40543. tilingScheme?: TilingScheme;
  40544. ellipsoid?: Ellipsoid;
  40545. tileWidth?: number;
  40546. tileHeight?: number;
  40547. hasAlphaChannel?: boolean;
  40548. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  40549. enablePickFeatures?: boolean;
  40550. customTags?: any;
  40551. };
  40552. }
  40553. /**
  40554. * Provides imagery by requesting tiles using a specified URL template.
  40555. * @example
  40556. * // Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project
  40557. * const tms = new Cesium.UrlTemplateImageryProvider({
  40558. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',
  40559. * credit : '© Analytical Graphics, Inc.',
  40560. * tilingScheme : new Cesium.GeographicTilingScheme(),
  40561. * maximumLevel : 5
  40562. * });
  40563. * // Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.
  40564. * const positron = new Cesium.UrlTemplateImageryProvider({
  40565. * url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
  40566. * credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
  40567. * });
  40568. * // Access a Web Map Service (WMS) server.
  40569. * const wms = new Cesium.UrlTemplateImageryProvider({
  40570. * url : 'https://programs.communications.gov.au/geoserver/ows?tiled=true&' +
  40571. * 'transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
  40572. * 'styles=&service=WMS&version=1.1.1&request=GetMap&' +
  40573. * 'layers=public%3AMyBroadband_Availability&srs=EPSG%3A3857&' +
  40574. * 'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +
  40575. * 'width=256&height=256',
  40576. * rectangle : Cesium.Rectangle.fromDegrees(96.799393, -43.598214999057824, 153.63925700000001, -9.2159219997013)
  40577. * });
  40578. * // Using custom tags in your template url.
  40579. * const custom = new Cesium.UrlTemplateImageryProvider({
  40580. * url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',
  40581. * customTags : {
  40582. * Time: function(imageryProvider, x, y, level) {
  40583. * return '20171231'
  40584. * }
  40585. * }
  40586. * });
  40587. * @param options - Object describing initialization options
  40588. */
  40589. export class UrlTemplateImageryProvider {
  40590. constructor(options: UrlTemplateImageryProvider.ConstructorOptions);
  40591. /**
  40592. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  40593. * 1.0 representing fully opaque.
  40594. */
  40595. defaultAlpha: number | undefined;
  40596. /**
  40597. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  40598. * 1.0 representing fully opaque.
  40599. */
  40600. defaultNightAlpha: number | undefined;
  40601. /**
  40602. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  40603. * 1.0 representing fully opaque.
  40604. */
  40605. defaultDayAlpha: number | undefined;
  40606. /**
  40607. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  40608. * makes the imagery darker while greater than 1.0 makes it brighter.
  40609. */
  40610. defaultBrightness: number | undefined;
  40611. /**
  40612. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  40613. * the contrast while greater than 1.0 increases it.
  40614. */
  40615. defaultContrast: number | undefined;
  40616. /**
  40617. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  40618. */
  40619. defaultHue: number | undefined;
  40620. /**
  40621. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  40622. * saturation while greater than 1.0 increases it.
  40623. */
  40624. defaultSaturation: number | undefined;
  40625. /**
  40626. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  40627. */
  40628. defaultGamma: number | undefined;
  40629. /**
  40630. * The default texture minification filter to apply to this provider.
  40631. */
  40632. defaultMinificationFilter: TextureMinificationFilter;
  40633. /**
  40634. * The default texture magnification filter to apply to this provider.
  40635. */
  40636. defaultMagnificationFilter: TextureMagnificationFilter;
  40637. /**
  40638. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link UrlTemplateImageryProvider#pickFeatures} will
  40639. * request the <code>options.pickFeaturesUrl</code> and attempt to interpret the features included in the response. If false,
  40640. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  40641. * features) without communicating with the server. Set this property to false if you know your data
  40642. * source does not support picking features or if you don't want this provider's features to be pickable.
  40643. */
  40644. enablePickFeatures: boolean;
  40645. /**
  40646. * Gets the URL template to use to request tiles. It has the following keywords:
  40647. * <ul>
  40648. * <li> <code>{z}</code>: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.</li>
  40649. * <li> <code>{x}</code>: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.</li>
  40650. * <li> <code>{y}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.</li>
  40651. * <li> <code>{s}</code>: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.</li>
  40652. * <li> <code>{reverseX}</code>: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.</li>
  40653. * <li> <code>{reverseY}</code>: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.</li>
  40654. * <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>
  40655. * <li> <code>{westDegrees}</code>: The Western edge of the tile in geodetic degrees.</li>
  40656. * <li> <code>{southDegrees}</code>: The Southern edge of the tile in geodetic degrees.</li>
  40657. * <li> <code>{eastDegrees}</code>: The Eastern edge of the tile in geodetic degrees.</li>
  40658. * <li> <code>{northDegrees}</code>: The Northern edge of the tile in geodetic degrees.</li>
  40659. * <li> <code>{westProjected}</code>: The Western edge of the tile in projected coordinates of the tiling scheme.</li>
  40660. * <li> <code>{southProjected}</code>: The Southern edge of the tile in projected coordinates of the tiling scheme.</li>
  40661. * <li> <code>{eastProjected}</code>: The Eastern edge of the tile in projected coordinates of the tiling scheme.</li>
  40662. * <li> <code>{northProjected}</code>: The Northern edge of the tile in projected coordinates of the tiling scheme.</li>
  40663. * <li> <code>{width}</code>: The width of each tile in pixels.</li>
  40664. * <li> <code>{height}</code>: The height of each tile in pixels.</li>
  40665. * </ul>
  40666. */
  40667. readonly url: string;
  40668. /**
  40669. * Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on
  40670. * the left with zeros to match the width of the passed string of zeros. e.g. Setting:
  40671. * urlSchemeZeroPadding : { '{x}' : '0000'}
  40672. * will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
  40673. * It has the following keywords:
  40674. * <ul>
  40675. * <li> <code>{z}</code>: The zero padding for the level of the tile in the tiling scheme.</li>
  40676. * <li> <code>{x}</code>: The zero padding for the tile X coordinate in the tiling scheme.</li>
  40677. * <li> <code>{y}</code>: The zero padding for the the tile Y coordinate in the tiling scheme.</li>
  40678. * <li> <code>{reverseX}</code>: The zero padding for the tile reverseX coordinate in the tiling scheme.</li>
  40679. * <li> <code>{reverseY}</code>: The zero padding for the tile reverseY coordinate in the tiling scheme.</li>
  40680. * <li> <code>{reverseZ}</code>: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.</li>
  40681. * </ul>
  40682. */
  40683. readonly urlSchemeZeroPadding: any;
  40684. /**
  40685. * Gets the URL template to use to use to pick features. If this property is not specified,
  40686. * {@link UrlTemplateImageryProvider#pickFeatures} will immediately return undefined, indicating no
  40687. * features picked. The URL template supports all of the keywords supported by the
  40688. * {@link UrlTemplateImageryProvider#url} property, plus the following:
  40689. * <ul>
  40690. * <li><code>{i}</code>: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.</li>
  40691. * <li><code>{j}</code>: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.</li>
  40692. * <li><code>{reverseI}</code>: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.</li>
  40693. * <li><code>{reverseJ}</code>: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.</li>
  40694. * <li><code>{longitudeDegrees}</code>: The longitude of the picked position in degrees.</li>
  40695. * <li><code>{latitudeDegrees}</code>: The latitude of the picked position in degrees.</li>
  40696. * <li><code>{longitudeProjected}</code>: The longitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40697. * <li><code>{latitudeProjected}</code>: The latitude of the picked position in the projected coordinates of the tiling scheme.</li>
  40698. * <li><code>{format}</code>: The format in which to get feature information, as specified in the {@link GetFeatureInfoFormat}.</li>
  40699. * </ul>
  40700. */
  40701. readonly pickFeaturesUrl: string;
  40702. /**
  40703. * Gets the proxy used by this provider.
  40704. */
  40705. readonly proxy: Proxy;
  40706. /**
  40707. * Gets the width of each tile, in pixels. This function should
  40708. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40709. */
  40710. readonly tileWidth: number;
  40711. /**
  40712. * Gets the height of each tile, in pixels. This function should
  40713. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40714. */
  40715. readonly tileHeight: number;
  40716. /**
  40717. * Gets the maximum level-of-detail that can be requested, or undefined if there is no limit.
  40718. * This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40719. */
  40720. readonly maximumLevel: number | undefined;
  40721. /**
  40722. * Gets the minimum level-of-detail that can be requested. This function should
  40723. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40724. */
  40725. readonly minimumLevel: number;
  40726. /**
  40727. * Gets the tiling scheme used by this provider. This function should
  40728. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40729. */
  40730. readonly tilingScheme: TilingScheme;
  40731. /**
  40732. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  40733. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40734. */
  40735. readonly rectangle: Rectangle;
  40736. /**
  40737. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  40738. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  40739. * returns undefined, no tiles are filtered. This function should
  40740. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40741. */
  40742. readonly tileDiscardPolicy: TileDiscardPolicy;
  40743. /**
  40744. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  40745. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  40746. * are passed an instance of {@link TileProviderError}.
  40747. */
  40748. readonly errorEvent: Event;
  40749. /**
  40750. * Gets a value indicating whether or not the provider is ready for use.
  40751. */
  40752. readonly ready: boolean;
  40753. /**
  40754. * Gets a promise that resolves to true when the provider is ready for use.
  40755. */
  40756. readonly readyPromise: Promise<boolean>;
  40757. /**
  40758. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  40759. * the source of the imagery. This function should not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40760. */
  40761. readonly credit: Credit;
  40762. /**
  40763. * Gets a value indicating whether or not the images provided by this imagery provider
  40764. * include an alpha channel. If this property is false, an alpha channel, if present, will
  40765. * be ignored. If this property is true, any images without an alpha channel will be treated
  40766. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  40767. * and texture upload time are reduced. This function should
  40768. * not be called before {@link ImageryProvider#ready} returns true.
  40769. */
  40770. readonly hasAlphaChannel: boolean;
  40771. /**
  40772. * Reinitializes this instance. Reinitializing an instance already in use is supported, but it is not
  40773. * recommended because existing tiles provided by the imagery provider will not be updated.
  40774. * @param options - Any of the options that may be passed to the {@link UrlTemplateImageryProvider} constructor.
  40775. */
  40776. reinitialize(options: Promise<object> | any): void;
  40777. /**
  40778. * Gets the credits to be displayed when a given tile is displayed.
  40779. * @param x - The tile X coordinate.
  40780. * @param y - The tile Y coordinate.
  40781. * @param level - The tile level;
  40782. * @returns The credits to be displayed when the tile is displayed.
  40783. */
  40784. getTileCredits(x: number, y: number, level: number): Credit[];
  40785. /**
  40786. * Requests the image for a given tile. This function should
  40787. * not be called before {@link UrlTemplateImageryProvider#ready} returns true.
  40788. * @param x - The tile X coordinate.
  40789. * @param y - The tile Y coordinate.
  40790. * @param level - The tile level.
  40791. * @param [request] - The request object. Intended for internal use only.
  40792. * @returns A promise for the image that will resolve when the image is available, or
  40793. * undefined if there are too many active requests to the server, and the request should be retried later.
  40794. */
  40795. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  40796. /**
  40797. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  40798. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  40799. * @param x - The tile X coordinate.
  40800. * @param y - The tile Y coordinate.
  40801. * @param level - The tile level.
  40802. * @param longitude - The longitude at which to pick features.
  40803. * @param latitude - The latitude at which to pick features.
  40804. * @returns A promise for the picked features that will resolve when the asynchronous
  40805. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  40806. * instances. The array may be empty if no features are found at the given location.
  40807. * It may also be undefined if picking is not supported.
  40808. */
  40809. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  40810. }
  40811. /**
  40812. * The vertical location of an origin relative to an object, e.g., a {@link Billboard}
  40813. * or {@link Label}. For example, setting the vertical origin to <code>TOP</code>
  40814. * or <code>BOTTOM</code> will display a billboard above or below (in screen space)
  40815. * the anchor position.
  40816. * <br /><br />
  40817. * <div align='center'>
  40818. * <img src='Images/Billboard.setVerticalOrigin.png' width='695' height='175' /><br />
  40819. * </div>
  40820. */
  40821. export enum VerticalOrigin {
  40822. /**
  40823. * The origin is at the vertical center between <code>BASELINE</code> and <code>TOP</code>.
  40824. */
  40825. CENTER = 0,
  40826. /**
  40827. * The origin is at the bottom of the object.
  40828. */
  40829. BOTTOM = 1,
  40830. /**
  40831. * If the object contains text, the origin is at the baseline of the text, else the origin is at the bottom of the object.
  40832. */
  40833. BASELINE = 2,
  40834. /**
  40835. * The origin is at the top of the object.
  40836. */
  40837. TOP = -1
  40838. }
  40839. /**
  40840. * A viewport aligned quad.
  40841. * @example
  40842. * const viewportQuad = new Cesium.ViewportQuad(new Cesium.BoundingRectangle(0, 0, 80, 40));
  40843. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
  40844. * @param [rectangle] - The {@link BoundingRectangle} defining the quad's position within the viewport.
  40845. * @param [material] - The {@link Material} defining the surface appearance of the viewport quad.
  40846. */
  40847. export class ViewportQuad {
  40848. constructor(rectangle?: BoundingRectangle, material?: Material);
  40849. /**
  40850. * Determines if the viewport quad primitive will be shown.
  40851. */
  40852. show: boolean;
  40853. /**
  40854. * The BoundingRectangle defining the quad's position within the viewport.
  40855. * @example
  40856. * viewportQuad.rectangle = new Cesium.BoundingRectangle(0, 0, 80, 40);
  40857. */
  40858. rectangle: BoundingRectangle;
  40859. /**
  40860. * The surface appearance of the viewport quad. This can be one of several built-in {@link Material} objects or a custom material, scripted with
  40861. * {@link https://github.com/CesiumGS/cesium/wiki/Fabric|Fabric}.
  40862. * <p>
  40863. * The default material is <code>Material.ColorType</code>.
  40864. * </p>
  40865. * @example
  40866. * // 1. Change the color of the default material to yellow
  40867. * viewportQuad.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0);
  40868. *
  40869. * // 2. Change material to horizontal stripes
  40870. * viewportQuad.material = Cesium.Material.fromType(Cesium.Material.StripeType);
  40871. */
  40872. material: Material;
  40873. /**
  40874. * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
  40875. * get the draw commands needed to render this primitive.
  40876. * <p>
  40877. * Do not call this function directly. This is documented just to
  40878. * list the exceptions that may be propagated when the scene is rendered:
  40879. * </p>
  40880. */
  40881. update(): void;
  40882. /**
  40883. * Returns true if this object was destroyed; otherwise, false.
  40884. * <br /><br />
  40885. * If this object was destroyed, it should not be used; calling any function other than
  40886. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
  40887. * @returns True if this object was destroyed; otherwise, false.
  40888. */
  40889. isDestroyed(): boolean;
  40890. /**
  40891. * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
  40892. * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
  40893. * <br /><br />
  40894. * Once an object is destroyed, it should not be used; calling any function other than
  40895. * <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
  40896. * assign the return value (<code>undefined</code>) to the object as done in the example.
  40897. * @example
  40898. * quad = quad && quad.destroy();
  40899. */
  40900. destroy(): void;
  40901. }
  40902. /**
  40903. * EPSG codes known to include reverse axis orders, but are not within 4000-5000.
  40904. */
  40905. export const includesReverseAxis: number[];
  40906. /**
  40907. * EPSG codes known to not include reverse axis orders, and are within 4000-5000.
  40908. */
  40909. export const excludesReverseAxis: number[];
  40910. export namespace WebMapServiceImageryProvider {
  40911. /**
  40912. * Initialization options for the WebMapServiceImageryProvider constructor
  40913. * @property url - The URL of the WMS service. The URL supports the same keywords as the {@link UrlTemplateImageryProvider}.
  40914. * @property layers - The layers to include, separated by commas.
  40915. * @property [parameters = WebMapServiceImageryProvider.DefaultParameters] - Additional parameters to pass to the WMS server in the GetMap URL.
  40916. * @property [getFeatureInfoParameters = WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters] - Additional parameters to pass to the WMS server in the GetFeatureInfo URL.
  40917. * @property [enablePickFeatures = true] - If true, {@link WebMapServiceImageryProvider#pickFeatures} will invoke
  40918. * the GetFeatureInfo operation on the WMS server and return the features included in the response. If false,
  40919. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable features)
  40920. * without communicating with the server. Set this property to false if you know your WMS server does not support
  40921. * GetFeatureInfo or if you don't want this provider's features to be pickable. Note that this can be dynamically
  40922. * overridden by modifying the WebMapServiceImageryProvider#enablePickFeatures property.
  40923. * @property [getFeatureInfoFormats = WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats] - The formats
  40924. * in which to try WMS GetFeatureInfo requests.
  40925. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle of the layer.
  40926. * @property [tilingScheme = new GeographicTilingScheme()] - The tiling scheme to use to divide the world into tiles.
  40927. * @property [ellipsoid] - The ellipsoid. If the tilingScheme is specified,
  40928. * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
  40929. * parameter is specified, the WGS84 ellipsoid is used.
  40930. * @property [tileWidth = 256] - The width of each tile in pixels.
  40931. * @property [tileHeight = 256] - The height of each tile in pixels.
  40932. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider. Take care when
  40933. * specifying this that the number of tiles at the minimum level is small, such as four or less. A larger number is
  40934. * likely to result in rendering problems.
  40935. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  40936. * If not specified, there is no limit.
  40937. * @property [crs] - CRS specification, for use with WMS specification >= 1.3.0.
  40938. * @property [srs] - SRS specification, for use with WMS specification 1.1.0 or 1.1.1
  40939. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  40940. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  40941. * If this parameter is a single string, each character in the string is a subdomain. If it is
  40942. * an array, each element in the array is a subdomain.
  40943. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  40944. * @property [times] - TimeIntervalCollection with its data property being an object containing time dynamic dimension and their values.
  40945. * @property [getFeatureInfoUrl] - The getFeatureInfo URL of the WMS service. If the property is not defined then we use the property value of url.
  40946. */
  40947. type ConstructorOptions = {
  40948. url: Resource | string;
  40949. layers: string;
  40950. parameters?: any;
  40951. getFeatureInfoParameters?: any;
  40952. enablePickFeatures?: boolean;
  40953. getFeatureInfoFormats?: GetFeatureInfoFormat[];
  40954. rectangle?: Rectangle;
  40955. tilingScheme?: TilingScheme;
  40956. ellipsoid?: Ellipsoid;
  40957. tileWidth?: number;
  40958. tileHeight?: number;
  40959. minimumLevel?: number;
  40960. maximumLevel?: number;
  40961. crs?: string;
  40962. srs?: string;
  40963. credit?: Credit | string;
  40964. subdomains?: string | string[];
  40965. clock?: Clock;
  40966. times?: TimeIntervalCollection;
  40967. getFeatureInfoUrl?: Resource | string;
  40968. };
  40969. }
  40970. /**
  40971. * Provides tiled imagery hosted by a Web Map Service (WMS) server.
  40972. * @example
  40973. * const provider = new Cesium.WebMapServiceImageryProvider({
  40974. * url : 'https://sampleserver1.arcgisonline.com/ArcGIS/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/WMSServer',
  40975. * layers : '0',
  40976. * proxy: new Cesium.DefaultProxy('/proxy/')
  40977. * });
  40978. *
  40979. * viewer.imageryLayers.addImageryProvider(provider);
  40980. * @param options - Object describing initialization options
  40981. */
  40982. export class WebMapServiceImageryProvider {
  40983. constructor(options: WebMapServiceImageryProvider.ConstructorOptions);
  40984. /**
  40985. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  40986. * 1.0 representing fully opaque.
  40987. */
  40988. defaultAlpha: number | undefined;
  40989. /**
  40990. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  40991. * 1.0 representing fully opaque.
  40992. */
  40993. defaultNightAlpha: number | undefined;
  40994. /**
  40995. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  40996. * 1.0 representing fully opaque.
  40997. */
  40998. defaultDayAlpha: number | undefined;
  40999. /**
  41000. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  41001. * makes the imagery darker while greater than 1.0 makes it brighter.
  41002. */
  41003. defaultBrightness: number | undefined;
  41004. /**
  41005. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  41006. * the contrast while greater than 1.0 increases it.
  41007. */
  41008. defaultContrast: number | undefined;
  41009. /**
  41010. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  41011. */
  41012. defaultHue: number | undefined;
  41013. /**
  41014. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  41015. * saturation while greater than 1.0 increases it.
  41016. */
  41017. defaultSaturation: number | undefined;
  41018. /**
  41019. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  41020. */
  41021. defaultGamma: number | undefined;
  41022. /**
  41023. * The default texture minification filter to apply to this provider.
  41024. */
  41025. defaultMinificationFilter: TextureMinificationFilter;
  41026. /**
  41027. * The default texture magnification filter to apply to this provider.
  41028. */
  41029. defaultMagnificationFilter: TextureMagnificationFilter;
  41030. /**
  41031. * Gets the URL of the WMS server.
  41032. */
  41033. readonly url: string;
  41034. /**
  41035. * Gets the proxy used by this provider.
  41036. */
  41037. readonly proxy: Proxy;
  41038. /**
  41039. * Gets the names of the WMS layers, separated by commas.
  41040. */
  41041. readonly layers: string;
  41042. /**
  41043. * Gets the width of each tile, in pixels. This function should
  41044. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41045. */
  41046. readonly tileWidth: number;
  41047. /**
  41048. * Gets the height of each tile, in pixels. This function should
  41049. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41050. */
  41051. readonly tileHeight: number;
  41052. /**
  41053. * Gets the maximum level-of-detail that can be requested. This function should
  41054. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41055. */
  41056. readonly maximumLevel: number | undefined;
  41057. /**
  41058. * Gets the minimum level-of-detail that can be requested. This function should
  41059. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41060. */
  41061. readonly minimumLevel: number;
  41062. /**
  41063. * Gets the tiling scheme used by this provider. This function should
  41064. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41065. */
  41066. readonly tilingScheme: TilingScheme;
  41067. /**
  41068. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  41069. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41070. */
  41071. readonly rectangle: Rectangle;
  41072. /**
  41073. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  41074. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  41075. * returns undefined, no tiles are filtered. This function should
  41076. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41077. */
  41078. readonly tileDiscardPolicy: TileDiscardPolicy;
  41079. /**
  41080. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  41081. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  41082. * are passed an instance of {@link TileProviderError}.
  41083. */
  41084. readonly errorEvent: Event;
  41085. /**
  41086. * Gets a value indicating whether or not the provider is ready for use.
  41087. */
  41088. readonly ready: boolean;
  41089. /**
  41090. * Gets a promise that resolves to true when the provider is ready for use.
  41091. */
  41092. readonly readyPromise: Promise<boolean>;
  41093. /**
  41094. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  41095. * the source of the imagery. This function should not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41096. */
  41097. readonly credit: Credit;
  41098. /**
  41099. * Gets a value indicating whether or not the images provided by this imagery provider
  41100. * include an alpha channel. If this property is false, an alpha channel, if present, will
  41101. * be ignored. If this property is true, any images without an alpha channel will be treated
  41102. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  41103. * and texture upload time are reduced.
  41104. */
  41105. readonly hasAlphaChannel: boolean;
  41106. /**
  41107. * Gets or sets a value indicating whether feature picking is enabled. If true, {@link WebMapServiceImageryProvider#pickFeatures} will
  41108. * invoke the <code>GetFeatureInfo</code> service on the WMS server and attempt to interpret the features included in the response. If false,
  41109. * {@link WebMapServiceImageryProvider#pickFeatures} will immediately return undefined (indicating no pickable
  41110. * features) without communicating with the server. Set this property to false if you know your data
  41111. * source does not support picking features or if you don't want this provider's features to be pickable.
  41112. */
  41113. enablePickFeatures: boolean;
  41114. /**
  41115. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  41116. */
  41117. clock: Clock;
  41118. /**
  41119. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  41120. * TimeInterval is an object containing the keys and values of the properties that are used during
  41121. * tile requests.
  41122. */
  41123. times: TimeIntervalCollection;
  41124. /**
  41125. * Gets the getFeatureInfo URL of the WMS server.
  41126. */
  41127. readonly getFeatureInfoUrl: Resource | string;
  41128. /**
  41129. * Gets the credits to be displayed when a given tile is displayed.
  41130. * @param x - The tile X coordinate.
  41131. * @param y - The tile Y coordinate.
  41132. * @param level - The tile level;
  41133. * @returns The credits to be displayed when the tile is displayed.
  41134. */
  41135. getTileCredits(x: number, y: number, level: number): Credit[];
  41136. /**
  41137. * Requests the image for a given tile. This function should
  41138. * not be called before {@link WebMapServiceImageryProvider#ready} returns true.
  41139. * @param x - The tile X coordinate.
  41140. * @param y - The tile Y coordinate.
  41141. * @param level - The tile level.
  41142. * @param [request] - The request object. Intended for internal use only.
  41143. * @returns A promise for the image that will resolve when the image is available, or
  41144. * undefined if there are too many active requests to the server, and the request should be retried later.
  41145. */
  41146. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  41147. /**
  41148. * Asynchronously determines what features, if any, are located at a given longitude and latitude within
  41149. * a tile. This function should not be called before {@link ImageryProvider#ready} returns true.
  41150. * @param x - The tile X coordinate.
  41151. * @param y - The tile Y coordinate.
  41152. * @param level - The tile level.
  41153. * @param longitude - The longitude at which to pick features.
  41154. * @param latitude - The latitude at which to pick features.
  41155. * @returns A promise for the picked features that will resolve when the asynchronous
  41156. * picking completes. The resolved value is an array of {@link ImageryLayerFeatureInfo}
  41157. * instances. The array may be empty if no features are found at the given location.
  41158. */
  41159. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
  41160. /**
  41161. * The default parameters to include in the WMS URL to obtain images. The values are as follows:
  41162. * service=WMS
  41163. * version=1.1.1
  41164. * request=GetMap
  41165. * styles=
  41166. * format=image/jpeg
  41167. */
  41168. static readonly DefaultParameters: any;
  41169. /**
  41170. * The default parameters to include in the WMS URL to get feature information. The values are as follows:
  41171. * service=WMS
  41172. * version=1.1.1
  41173. * request=GetFeatureInfo
  41174. */
  41175. static readonly GetFeatureInfoDefaultParameters: any;
  41176. }
  41177. export namespace WebMapTileServiceImageryProvider {
  41178. /**
  41179. * Initialization options for the WebMapTileServiceImageryProvider constructor
  41180. * @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.
  41181. * @property [format = 'image/jpeg'] - The MIME type for images to retrieve from the server.
  41182. * @property layer - The layer name for WMTS requests.
  41183. * @property style - The style name for WMTS requests.
  41184. * @property tileMatrixSetID - The identifier of the TileMatrixSet to use for WMTS requests.
  41185. * @property [tileMatrixLabels] - A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level.
  41186. * @property [clock] - A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified.
  41187. * @property [times] - TimeIntervalCollection with its <code>data</code> property being an object containing time dynamic dimension and their values.
  41188. * @property [dimensions] - A object containing static dimensions and their values.
  41189. * @property [tileWidth = 256] - The tile width in pixels.
  41190. * @property [tileHeight = 256] - The tile height in pixels.
  41191. * @property [tilingScheme] - The tiling scheme corresponding to the organization of the tiles in the TileMatrixSet.
  41192. * @property [rectangle = Rectangle.MAX_VALUE] - The rectangle covered by the layer.
  41193. * @property [minimumLevel = 0] - The minimum level-of-detail supported by the imagery provider.
  41194. * @property [maximumLevel] - The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
  41195. * @property [ellipsoid] - The ellipsoid. If not specified, the WGS84 ellipsoid is used.
  41196. * @property [credit] - A credit for the data source, which is displayed on the canvas.
  41197. * @property [subdomains = 'abc'] - The subdomains to use for the <code>{s}</code> placeholder in the URL template.
  41198. * If this parameter is a single string, each character in the string is a subdomain. If it is
  41199. * an array, each element in the array is a subdomain.
  41200. */
  41201. type ConstructorOptions = {
  41202. url: Resource | string;
  41203. format?: string;
  41204. layer: string;
  41205. style: string;
  41206. tileMatrixSetID: string;
  41207. tileMatrixLabels?: any[];
  41208. clock?: Clock;
  41209. times?: TimeIntervalCollection;
  41210. dimensions?: any;
  41211. tileWidth?: number;
  41212. tileHeight?: number;
  41213. tilingScheme?: TilingScheme;
  41214. rectangle?: Rectangle;
  41215. minimumLevel?: number;
  41216. maximumLevel?: number;
  41217. ellipsoid?: Ellipsoid;
  41218. credit?: Credit | string;
  41219. subdomains?: string | string[];
  41220. };
  41221. }
  41222. /**
  41223. * Provides tiled imagery served by {@link http://www.opengeospatial.org/standards/wmts|WMTS 1.0.0} compliant servers.
  41224. * This provider supports HTTP KVP-encoded and RESTful GetTile requests, but does not yet support the SOAP encoding.
  41225. * @example
  41226. * // Example 1. USGS shaded relief tiles (KVP)
  41227. * const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
  41228. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
  41229. * layer : 'USGSShadedReliefOnly',
  41230. * style : 'default',
  41231. * format : 'image/jpeg',
  41232. * tileMatrixSetID : 'default028mm',
  41233. * // tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
  41234. * maximumLevel: 19,
  41235. * credit : new Cesium.Credit('U. S. Geological Survey')
  41236. * });
  41237. * viewer.imageryLayers.addImageryProvider(shadedRelief1);
  41238. * @example
  41239. * // Example 2. USGS shaded relief tiles (RESTful)
  41240. * const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
  41241. * url : 'http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
  41242. * layer : 'USGSShadedReliefOnly',
  41243. * style : 'default',
  41244. * format : 'image/jpeg',
  41245. * tileMatrixSetID : 'default028mm',
  41246. * maximumLevel: 19,
  41247. * credit : new Cesium.Credit('U. S. Geological Survey')
  41248. * });
  41249. * viewer.imageryLayers.addImageryProvider(shadedRelief2);
  41250. * @example
  41251. * // Example 3. NASA time dynamic weather data (RESTful)
  41252. * const times = Cesium.TimeIntervalCollection.fromIso8601({
  41253. * iso8601: '2015-07-30/2017-06-16/P1D',
  41254. * dataCallback: function dataCallback(interval, index) {
  41255. * return {
  41256. * Time: Cesium.JulianDate.toIso8601(interval.start)
  41257. * };
  41258. * }
  41259. * });
  41260. * const weather = new Cesium.WebMapTileServiceImageryProvider({
  41261. * url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
  41262. * layer : 'AMSR2_Snow_Water_Equivalent',
  41263. * style : 'default',
  41264. * tileMatrixSetID : '2km',
  41265. * maximumLevel : 5,
  41266. * format : 'image/png',
  41267. * clock: clock,
  41268. * times: times,
  41269. * credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
  41270. * });
  41271. * viewer.imageryLayers.addImageryProvider(weather);
  41272. * @param options - Object describing initialization options
  41273. */
  41274. export class WebMapTileServiceImageryProvider {
  41275. constructor(options: WebMapTileServiceImageryProvider.ConstructorOptions);
  41276. /**
  41277. * The default alpha blending value of this provider, with 0.0 representing fully transparent and
  41278. * 1.0 representing fully opaque.
  41279. */
  41280. defaultAlpha: number | undefined;
  41281. /**
  41282. * The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
  41283. * 1.0 representing fully opaque.
  41284. */
  41285. defaultNightAlpha: number | undefined;
  41286. /**
  41287. * The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
  41288. * 1.0 representing fully opaque.
  41289. */
  41290. defaultDayAlpha: number | undefined;
  41291. /**
  41292. * The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
  41293. * makes the imagery darker while greater than 1.0 makes it brighter.
  41294. */
  41295. defaultBrightness: number | undefined;
  41296. /**
  41297. * The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
  41298. * the contrast while greater than 1.0 increases it.
  41299. */
  41300. defaultContrast: number | undefined;
  41301. /**
  41302. * The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
  41303. */
  41304. defaultHue: number | undefined;
  41305. /**
  41306. * The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
  41307. * saturation while greater than 1.0 increases it.
  41308. */
  41309. defaultSaturation: number | undefined;
  41310. /**
  41311. * The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
  41312. */
  41313. defaultGamma: number | undefined;
  41314. /**
  41315. * The default texture minification filter to apply to this provider.
  41316. */
  41317. defaultMinificationFilter: TextureMinificationFilter;
  41318. /**
  41319. * The default texture magnification filter to apply to this provider.
  41320. */
  41321. defaultMagnificationFilter: TextureMagnificationFilter;
  41322. /**
  41323. * Gets the URL of the service hosting the imagery.
  41324. */
  41325. readonly url: string;
  41326. /**
  41327. * Gets the proxy used by this provider.
  41328. */
  41329. readonly proxy: Proxy;
  41330. /**
  41331. * Gets the width of each tile, in pixels. This function should
  41332. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41333. */
  41334. readonly tileWidth: number;
  41335. /**
  41336. * Gets the height of each tile, in pixels. This function should
  41337. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41338. */
  41339. readonly tileHeight: number;
  41340. /**
  41341. * Gets the maximum level-of-detail that can be requested. This function should
  41342. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41343. */
  41344. readonly maximumLevel: number | undefined;
  41345. /**
  41346. * Gets the minimum level-of-detail that can be requested. This function should
  41347. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41348. */
  41349. readonly minimumLevel: number;
  41350. /**
  41351. * Gets the tiling scheme used by this provider. This function should
  41352. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41353. */
  41354. readonly tilingScheme: TilingScheme;
  41355. /**
  41356. * Gets the rectangle, in radians, of the imagery provided by this instance. This function should
  41357. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41358. */
  41359. readonly rectangle: Rectangle;
  41360. /**
  41361. * Gets the tile discard policy. If not undefined, the discard policy is responsible
  41362. * for filtering out "missing" tiles via its shouldDiscardImage function. If this function
  41363. * returns undefined, no tiles are filtered. This function should
  41364. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41365. */
  41366. readonly tileDiscardPolicy: TileDiscardPolicy;
  41367. /**
  41368. * Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing
  41369. * to the event, you will be notified of the error and can potentially recover from it. Event listeners
  41370. * are passed an instance of {@link TileProviderError}.
  41371. */
  41372. readonly errorEvent: Event;
  41373. /**
  41374. * Gets the mime type of images returned by this imagery provider.
  41375. */
  41376. readonly format: string;
  41377. /**
  41378. * Gets a value indicating whether or not the provider is ready for use.
  41379. */
  41380. readonly ready: boolean;
  41381. /**
  41382. * Gets a promise that resolves to true when the provider is ready for use.
  41383. */
  41384. readonly readyPromise: Promise<boolean>;
  41385. /**
  41386. * Gets the credit to display when this imagery provider is active. Typically this is used to credit
  41387. * the source of the imagery. This function should not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41388. */
  41389. readonly credit: Credit;
  41390. /**
  41391. * Gets a value indicating whether or not the images provided by this imagery provider
  41392. * include an alpha channel. If this property is false, an alpha channel, if present, will
  41393. * be ignored. If this property is true, any images without an alpha channel will be treated
  41394. * as if their alpha is 1.0 everywhere. When this property is false, memory usage
  41395. * and texture upload time are reduced.
  41396. */
  41397. readonly hasAlphaChannel: boolean;
  41398. /**
  41399. * Gets or sets a clock that is used to get keep the time used for time dynamic parameters.
  41400. */
  41401. clock: Clock;
  41402. /**
  41403. * Gets or sets a time interval collection that is used to get time dynamic parameters. The data of each
  41404. * TimeInterval is an object containing the keys and values of the properties that are used during
  41405. * tile requests.
  41406. */
  41407. times: TimeIntervalCollection;
  41408. /**
  41409. * Gets or sets an object that contains static dimensions and their values.
  41410. */
  41411. dimensions: any;
  41412. /**
  41413. * Gets the credits to be displayed when a given tile is displayed.
  41414. * @param x - The tile X coordinate.
  41415. * @param y - The tile Y coordinate.
  41416. * @param level - The tile level;
  41417. * @returns The credits to be displayed when the tile is displayed.
  41418. */
  41419. getTileCredits(x: number, y: number, level: number): Credit[];
  41420. /**
  41421. * Requests the image for a given tile. This function should
  41422. * not be called before {@link WebMapTileServiceImageryProvider#ready} returns true.
  41423. * @param x - The tile X coordinate.
  41424. * @param y - The tile Y coordinate.
  41425. * @param level - The tile level.
  41426. * @param [request] - The request object. Intended for internal use only.
  41427. * @returns A promise for the image that will resolve when the image is available, or
  41428. * undefined if there are too many active requests to the server, and the request should be retried later.
  41429. */
  41430. requestImage(x: number, y: number, level: number, request?: Request): Promise<ImageryTypes> | undefined;
  41431. /**
  41432. * Picking features is not currently supported by this imagery provider, so this function simply returns
  41433. * undefined.
  41434. * @param x - The tile X coordinate.
  41435. * @param y - The tile Y coordinate.
  41436. * @param level - The tile level.
  41437. * @param longitude - The longitude at which to pick features.
  41438. * @param latitude - The latitude at which to pick features.
  41439. * @returns Undefined since picking is not supported.
  41440. */
  41441. pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): undefined;
  41442. }
  41443. /**
  41444. * @property height - The height.
  41445. * @property color - The color at this height.
  41446. */
  41447. export type createElevationBandMaterialEntry = {
  41448. height: number;
  41449. color: Color;
  41450. };
  41451. /**
  41452. * @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>.
  41453. * @property [extendDownwards = false] - If <code>true</code>, the band's minimum elevation color will extend infinitely downwards.
  41454. * @property [extendUpwards = false] - If <code>true</code>, the band's maximum elevation color will extend infinitely upwards.
  41455. */
  41456. export type createElevationBandMaterialBand = {
  41457. entries: createElevationBandMaterialEntry[];
  41458. extendDownwards?: boolean;
  41459. extendUpwards?: boolean;
  41460. };
  41461. /**
  41462. * Creates a {@link Material} that combines multiple layers of color/gradient bands and maps them to terrain heights.
  41463. *
  41464. * The shader does a binary search over all the heights to find out which colors are above and below a given height, and
  41465. * interpolates between them for the final color. This material supports hundreds of entries relatively cheaply.
  41466. * @example
  41467. * scene.globe.material = Cesium.createElevationBandMaterial({
  41468. * scene : scene,
  41469. * layers : [{
  41470. * entries : [{
  41471. * height : 4200.0,
  41472. * color : new Cesium.Color(0.0, 0.0, 0.0, 1.0)
  41473. * }, {
  41474. * height : 8848.0,
  41475. * color : new Cesium.Color(1.0, 1.0, 1.0, 1.0)
  41476. * }],
  41477. * extendDownwards : true,
  41478. * extendUpwards : true,
  41479. * }, {
  41480. * entries : [{
  41481. * height : 7000.0,
  41482. * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
  41483. * }, {
  41484. * height : 7100.0,
  41485. * color : new Cesium.Color(1.0, 0.0, 0.0, 0.5)
  41486. * }]
  41487. * }]
  41488. * });
  41489. * @param options - Object with the following properties:
  41490. * @param options.scene - The scene where the visualization is taking place.
  41491. * @param options.layers - A list of bands ordered from lowest to highest precedence.
  41492. * @returns A new {@link Material} instance.
  41493. */
  41494. export function createElevationBandMaterial(options: {
  41495. scene: Scene;
  41496. layers: createElevationBandMaterialBand[];
  41497. }): Material;
  41498. /**
  41499. * Creates a {@link Cesium3DTileset} instance for the
  41500. * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}
  41501. * tileset.
  41502. * @example
  41503. * // Create Cesium OSM Buildings with default styling
  41504. * const viewer = new Cesium.Viewer('cesiumContainer');
  41505. * viewer.scene.primitives.add(Cesium.createOsmBuildings());
  41506. * @example
  41507. * // Create Cesium OSM Buildings with a custom style highlighting
  41508. * // schools and hospitals.
  41509. * viewer.scene.primitives.add(Cesium.createOsmBuildings({
  41510. * style: new Cesium.Cesium3DTileStyle({
  41511. * color: {
  41512. * conditions: [
  41513. * ["${feature['building']} === 'hospital'", "color('#0000FF')"],
  41514. * ["${feature['building']} === 'school'", "color('#00FF00')"],
  41515. * [true, "color('#ffffff')"]
  41516. * ]
  41517. * }
  41518. * })
  41519. * }));
  41520. * @param [options] - Construction options. Any options allowed by the {@link Cesium3DTileset} constructor
  41521. * may be specified here. In addition to those, the following properties are supported:
  41522. * @param [options.defaultColor = Color.WHITE] - The default color to use for buildings
  41523. * that do not have a color. This parameter is ignored if <code>options.style</code> is specified.
  41524. * @param [options.style] - The style to use with the tileset. If not
  41525. * specified, a default style is used which gives each building or building part a
  41526. * color inferred from its OpenStreetMap <code>tags</code>. If no color can be inferred,
  41527. * <code>options.defaultColor</code> is used.
  41528. * @param [options.showOutline = true] - Whether to show outlines around buildings. When true,
  41529. * outlines are displayed. When false, outlines are not displayed.
  41530. */
  41531. export function createOsmBuildings(options?: {
  41532. defaultColor?: Color;
  41533. style?: Cesium3DTileStyle;
  41534. showOutline?: boolean;
  41535. }): Cesium3DTileset;
  41536. /**
  41537. * Creates a {@link Primitive} to visualize well-known vector vertex attributes:
  41538. * <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal
  41539. * is red; tangent is green; and bitangent is blue. If an attribute is not
  41540. * present, it is not drawn.
  41541. * @example
  41542. * scene.primitives.add(Cesium.createTangentSpaceDebugPrimitive({
  41543. * geometry : instance.geometry,
  41544. * length : 100000.0,
  41545. * modelMatrix : instance.modelMatrix
  41546. * }));
  41547. * @param options - Object with the following properties:
  41548. * @param options.geometry - The <code>Geometry</code> instance with the attribute.
  41549. * @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.
  41550. * @param [options.modelMatrix = Matrix4.IDENTITY] - The model matrix that transforms to transform the geometry from model to world coordinates.
  41551. * @returns A new <code>Primitive</code> instance with geometry for the vectors.
  41552. */
  41553. export function createTangentSpaceDebugPrimitive(options: {
  41554. geometry: Geometry;
  41555. length?: number;
  41556. modelMatrix?: Matrix4;
  41557. }): Primitive;
  41558. /**
  41559. * Creates an {@link IonImageryProvider} instance for ion's default global base imagery layer, currently Bing Maps.
  41560. * @example
  41561. * // Create Cesium World Terrain with default settings
  41562. * const viewer = new Cesium.Viewer('cesiumContainer', {
  41563. * imageryProvider : Cesium.createWorldImagery();
  41564. * });
  41565. * @example
  41566. * // Create Cesium World Terrain with water and normals.
  41567. * const viewer = new Cesium.Viewer('cesiumContainer', {
  41568. * imageryProvider : Cesium.createWorldImagery({
  41569. * style: Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
  41570. * })
  41571. * });
  41572. * @param [options] - Object with the following properties:
  41573. * @param [options.style = IonWorldImageryStyle] - The style of base imagery, only AERIAL, AERIAL_WITH_LABELS, and ROAD are currently supported.
  41574. */
  41575. export function createWorldImagery(options?: {
  41576. style?: IonWorldImageryStyle;
  41577. }): IonImageryProvider;
  41578. /**
  41579. * <span style="display: block; text-align: center;">
  41580. * <img src="Images/AnimationWidget.png" width="211" height="142" alt="" />
  41581. * <br />Animation widget
  41582. * </span>
  41583. * <br /><br />
  41584. * The Animation widget provides buttons for play, pause, and reverse, along with the
  41585. * current time and date, surrounded by a "shuttle ring" for controlling the speed of animation.
  41586. * <br /><br />
  41587. * The "shuttle ring" concept is borrowed from video editing, where typically a
  41588. * "jog wheel" can be rotated to move past individual animation frames very slowly, and
  41589. * a surrounding shuttle ring can be twisted to control direction and speed of fast playback.
  41590. * Cesium typically treats time as continuous (not broken into pre-defined animation frames),
  41591. * so this widget offers no jog wheel. Instead, the shuttle ring is capable of both fast and
  41592. * very slow playback. Click and drag the shuttle ring pointer itself (shown above in green),
  41593. * or click in the rest of the ring area to nudge the pointer to the next preset speed in that direction.
  41594. * <br /><br />
  41595. * The Animation widget also provides a "realtime" button (in the upper-left) that keeps
  41596. * animation time in sync with the end user's system clock, typically displaying
  41597. * "today" or "right now." This mode is not available in {@link ClockRange.CLAMPED} or
  41598. * {@link ClockRange.LOOP_STOP} mode if the current time is outside of {@link Clock}'s startTime and endTime.
  41599. * @example
  41600. * // In HTML head, include a link to Animation.css stylesheet,
  41601. * // and in the body, include: <div id="animationContainer"></div>
  41602. *
  41603. * const clock = new Cesium.Clock();
  41604. * const clockViewModel = new Cesium.ClockViewModel(clock);
  41605. * const viewModel = new Cesium.AnimationViewModel(clockViewModel);
  41606. * const widget = new Cesium.Animation('animationContainer', viewModel);
  41607. *
  41608. * function tick() {
  41609. * clock.tick();
  41610. * Cesium.requestAnimationFrame(tick);
  41611. * }
  41612. * Cesium.requestAnimationFrame(tick);
  41613. * @param container - The DOM element or ID that will contain the widget.
  41614. * @param viewModel - The view model used by this widget.
  41615. */
  41616. export class Animation {
  41617. constructor(container: Element | string, viewModel: AnimationViewModel);
  41618. /**
  41619. * Gets the parent container.
  41620. */
  41621. readonly container: Element;
  41622. /**
  41623. * Gets the view model.
  41624. */
  41625. readonly viewModel: AnimationViewModel;
  41626. /**
  41627. * @returns true if the object has been destroyed, false otherwise.
  41628. */
  41629. isDestroyed(): boolean;
  41630. /**
  41631. * Destroys the animation widget. Should be called if permanently
  41632. * removing the widget from layout.
  41633. */
  41634. destroy(): void;
  41635. /**
  41636. * Resizes the widget to match the container size.
  41637. * This function should be called whenever the container size is changed.
  41638. */
  41639. resize(): void;
  41640. /**
  41641. * Updates the widget to reflect any modified CSS rules for theming.
  41642. * @example
  41643. * //Switch to the cesium-lighter theme.
  41644. * document.body.className = 'cesium-lighter';
  41645. * animation.applyThemeChanges();
  41646. */
  41647. applyThemeChanges(): void;
  41648. }
  41649. /**
  41650. * The view model for the {@link Animation} widget.
  41651. * @param clockViewModel - The ClockViewModel instance to use.
  41652. */
  41653. export class AnimationViewModel {
  41654. constructor(clockViewModel: ClockViewModel);
  41655. /**
  41656. * Gets or sets whether the shuttle ring is currently being dragged. This property is observable.
  41657. */
  41658. shuttleRingDragging: boolean;
  41659. /**
  41660. * Gets or sets whether dragging the shuttle ring should cause the multiplier
  41661. * to snap to the defined tick values rather than interpolating between them.
  41662. * This property is observable.
  41663. */
  41664. snapToTicks: boolean;
  41665. /**
  41666. * Gets the string representation of the current time. This property is observable.
  41667. */
  41668. timeLabel: string;
  41669. /**
  41670. * Gets the string representation of the current date. This property is observable.
  41671. */
  41672. dateLabel: string;
  41673. /**
  41674. * Gets the string representation of the current multiplier. This property is observable.
  41675. */
  41676. multiplierLabel: string;
  41677. /**
  41678. * Gets or sets the current shuttle ring angle. This property is observable.
  41679. */
  41680. shuttleRingAngle: number;
  41681. /**
  41682. * Gets or sets the default date formatter used by new instances.
  41683. */
  41684. static defaultDateFormatter: AnimationViewModel.DateFormatter;
  41685. /**
  41686. * Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.
  41687. */
  41688. static defaultTicks: number[];
  41689. /**
  41690. * Gets or sets the default time formatter used by new instances.
  41691. */
  41692. static defaultTimeFormatter: AnimationViewModel.TimeFormatter;
  41693. /**
  41694. * Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.
  41695. * @returns The array of known clock multipliers associated with the shuttle ring.
  41696. */
  41697. getShuttleRingTicks(): number[];
  41698. /**
  41699. * Sets the array of positive known clock multipliers to associate with the shuttle ring.
  41700. * These values will have negative equivalents created for them and sets both the minimum
  41701. * and maximum range of values for the shuttle ring as well as the values that are snapped
  41702. * to when a single click is made. The values need not be in order, as they will be sorted
  41703. * automatically, and duplicate values will be removed.
  41704. * @param positiveTicks - The list of known positive clock multipliers to associate with the shuttle ring.
  41705. */
  41706. setShuttleRingTicks(positiveTicks: number[]): void;
  41707. /**
  41708. * Gets a command that decreases the speed of animation.
  41709. */
  41710. slower: Command;
  41711. /**
  41712. * Gets a command that increases the speed of animation.
  41713. */
  41714. faster: Command;
  41715. /**
  41716. * Gets the clock view model.
  41717. */
  41718. clockViewModel: ClockViewModel;
  41719. /**
  41720. * Gets the pause toggle button view model.
  41721. */
  41722. pauseViewModel: ToggleButtonViewModel;
  41723. /**
  41724. * Gets the reverse toggle button view model.
  41725. */
  41726. playReverseViewModel: ToggleButtonViewModel;
  41727. /**
  41728. * Gets the play toggle button view model.
  41729. */
  41730. playForwardViewModel: ToggleButtonViewModel;
  41731. /**
  41732. * Gets the realtime toggle button view model.
  41733. */
  41734. playRealtimeViewModel: ToggleButtonViewModel;
  41735. /**
  41736. * Gets or sets the function which formats a date for display.
  41737. */
  41738. dateFormatter: AnimationViewModel.DateFormatter;
  41739. /**
  41740. * Gets or sets the function which formats a time for display.
  41741. */
  41742. timeFormatter: AnimationViewModel.TimeFormatter;
  41743. }
  41744. export namespace AnimationViewModel {
  41745. /**
  41746. * A function that formats a date for display.
  41747. * @param date - The date to be formatted
  41748. * @param viewModel - The AnimationViewModel instance requesting formatting.
  41749. */
  41750. type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  41751. /**
  41752. * A function that formats a time for display.
  41753. * @param date - The date to be formatted
  41754. * @param viewModel - The AnimationViewModel instance requesting formatting.
  41755. */
  41756. type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string;
  41757. }
  41758. /**
  41759. * <span style="display: block; text-align: center;">
  41760. * <img src="Images/BaseLayerPicker.png" width="264" height="287" alt="" />
  41761. * <br />BaseLayerPicker with its drop-panel open.
  41762. * </span>
  41763. * <br /><br />
  41764. * The BaseLayerPicker is a single button widget that displays a panel of available imagery and
  41765. * terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted
  41766. * as the base layer of the imagery collection; removing the existing base. When terrain is selected,
  41767. * it replaces the current terrain provider. Each item in the available providers list contains a name,
  41768. * a representative icon, and a tooltip to display more information when hovered. The list is initially
  41769. * empty, and must be configured before use, as illustrated in the below example.
  41770. * @example
  41771. * // In HTML head, include a link to the BaseLayerPicker.css stylesheet,
  41772. * // and in the body, include: <div id="baseLayerPickerContainer"
  41773. * // style="position:absolute;top:24px;right:24px;width:38px;height:38px;"></div>
  41774. *
  41775. * //Create the list of available providers we would like the user to select from.
  41776. * //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image.
  41777. * const imageryViewModels = [];
  41778. * imageryViewModels.push(new Cesium.ProviderViewModel({
  41779. * name : 'Open\u00adStreet\u00adMap',
  41780. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),
  41781. * tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \
  41782. * map of the world.\nhttp://www.openstreetmap.org',
  41783. * creationFunction : function() {
  41784. * return new Cesium.OpenStreetMapImageryProvider({
  41785. * url : 'https://a.tile.openstreetmap.org/'
  41786. * });
  41787. * }
  41788. * }));
  41789. *
  41790. * imageryViewModels.push(new Cesium.ProviderViewModel({
  41791. * name : 'Earth at Night',
  41792. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'),
  41793. * tooltip : 'The lights of cities and villages trace the outlines of civilization \
  41794. * in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.',
  41795. * creationFunction : function() {
  41796. * return new Cesium.IonImageryProvider({ assetId: 3812 });
  41797. * }
  41798. * }));
  41799. *
  41800. * imageryViewModels.push(new Cesium.ProviderViewModel({
  41801. * name : 'Natural Earth\u00a0II',
  41802. * iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),
  41803. * tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/',
  41804. * creationFunction : function() {
  41805. * return new Cesium.TileMapServiceImageryProvider({
  41806. * url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
  41807. * });
  41808. * }
  41809. * }));
  41810. *
  41811. * //Create a CesiumWidget without imagery, if you haven't already done so.
  41812. * const cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false });
  41813. *
  41814. * //Finally, create the baseLayerPicker widget using our view models.
  41815. * const layers = cesiumWidget.imageryLayers;
  41816. * const baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {
  41817. * globe : cesiumWidget.scene.globe,
  41818. * imageryProviderViewModels : imageryViewModels
  41819. * });
  41820. * @param container - The parent HTML container node or ID for this widget.
  41821. * @param options - Object with the following properties:
  41822. * @param options.globe - The Globe to use.
  41823. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  41824. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  41825. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  41826. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  41827. */
  41828. export class BaseLayerPicker {
  41829. constructor(container: Element | string, options: {
  41830. globe: Globe;
  41831. imageryProviderViewModels?: ProviderViewModel[];
  41832. selectedImageryProviderViewModel?: ProviderViewModel;
  41833. terrainProviderViewModels?: ProviderViewModel[];
  41834. selectedTerrainProviderViewModel?: ProviderViewModel;
  41835. });
  41836. /**
  41837. * Gets the parent container.
  41838. */
  41839. container: Element;
  41840. /**
  41841. * Gets the view model.
  41842. */
  41843. viewModel: BaseLayerPickerViewModel;
  41844. /**
  41845. * @returns true if the object has been destroyed, false otherwise.
  41846. */
  41847. isDestroyed(): boolean;
  41848. /**
  41849. * Destroys the widget. Should be called if permanently
  41850. * removing the widget from layout.
  41851. */
  41852. destroy(): void;
  41853. }
  41854. /**
  41855. * The view model for {@link BaseLayerPicker}.
  41856. * @param options - Object with the following properties:
  41857. * @param options.globe - The Globe to use.
  41858. * @param [options.imageryProviderViewModels = []] - The array of ProviderViewModel instances to use for imagery.
  41859. * @param [options.selectedImageryProviderViewModel] - The view model for the current base imagery layer, if not supplied the first available imagery layer is used.
  41860. * @param [options.terrainProviderViewModels = []] - The array of ProviderViewModel instances to use for terrain.
  41861. * @param [options.selectedTerrainProviderViewModel] - The view model for the current base terrain layer, if not supplied the first available terrain layer is used.
  41862. */
  41863. export class BaseLayerPickerViewModel {
  41864. constructor(options: {
  41865. globe: Globe;
  41866. imageryProviderViewModels?: ProviderViewModel[];
  41867. selectedImageryProviderViewModel?: ProviderViewModel;
  41868. terrainProviderViewModels?: ProviderViewModel[];
  41869. selectedTerrainProviderViewModel?: ProviderViewModel;
  41870. });
  41871. /**
  41872. * Gets or sets an array of ProviderViewModel instances available for imagery selection.
  41873. * This property is observable.
  41874. */
  41875. imageryProviderViewModels: ProviderViewModel[];
  41876. /**
  41877. * Gets or sets an array of ProviderViewModel instances available for terrain selection.
  41878. * This property is observable.
  41879. */
  41880. terrainProviderViewModels: ProviderViewModel[];
  41881. /**
  41882. * Gets or sets whether the imagery selection drop-down is currently visible.
  41883. */
  41884. dropDownVisible: boolean;
  41885. /**
  41886. * Gets the button tooltip. This property is observable.
  41887. */
  41888. buttonTooltip: string;
  41889. /**
  41890. * Gets the button background image. This property is observable.
  41891. */
  41892. buttonImageUrl: string;
  41893. /**
  41894. * Gets or sets the currently selected imagery. This property is observable.
  41895. */
  41896. selectedImagery: ProviderViewModel;
  41897. /**
  41898. * Gets or sets the currently selected terrain. This property is observable.
  41899. */
  41900. selectedTerrain: ProviderViewModel;
  41901. /**
  41902. * Gets the command to toggle the visibility of the drop down.
  41903. */
  41904. toggleDropDown: Command;
  41905. /**
  41906. * Gets the globe.
  41907. */
  41908. globe: Globe;
  41909. }
  41910. /**
  41911. * A view model that represents each item in the {@link BaseLayerPicker}.
  41912. * @param options - The object containing all parameters.
  41913. * @param options.name - The name of the layer.
  41914. * @param options.tooltip - The tooltip to show when the item is moused over.
  41915. * @param options.iconUrl - An icon representing the layer.
  41916. * @param [options.category] - A category for the layer.
  41917. * @param options.creationFunction - A function or Command
  41918. * that creates one or more providers which will be added to the globe when this item is selected.
  41919. */
  41920. export class ProviderViewModel {
  41921. constructor(options: {
  41922. name: string;
  41923. tooltip: string;
  41924. iconUrl: string;
  41925. category?: string;
  41926. creationFunction: ProviderViewModel.CreationFunction | Command;
  41927. });
  41928. /**
  41929. * Gets the display name. This property is observable.
  41930. */
  41931. name: string;
  41932. /**
  41933. * Gets the tooltip. This property is observable.
  41934. */
  41935. tooltip: string;
  41936. /**
  41937. * Gets the icon. This property is observable.
  41938. */
  41939. iconUrl: string;
  41940. /**
  41941. * Gets the Command that creates one or more providers which will be added to
  41942. * the globe when this item is selected.
  41943. */
  41944. readonly creationCommand: Command;
  41945. /**
  41946. * Gets the category
  41947. */
  41948. readonly category: string;
  41949. }
  41950. export namespace ProviderViewModel {
  41951. /**
  41952. * A function which creates one or more providers.
  41953. */
  41954. type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[];
  41955. }
  41956. /**
  41957. * Inspector widget to aid in debugging 3D Tiles
  41958. * @param container - The DOM element or ID that will contain the widget.
  41959. * @param scene - the Scene instance to use.
  41960. */
  41961. export class Cesium3DTilesInspector {
  41962. constructor(container: Element | string, scene: Scene);
  41963. /**
  41964. * Gets the parent container.
  41965. */
  41966. container: Element;
  41967. /**
  41968. * Gets the view model.
  41969. */
  41970. viewModel: Cesium3DTilesInspectorViewModel;
  41971. /**
  41972. * @returns true if the object has been destroyed, false otherwise.
  41973. */
  41974. isDestroyed(): boolean;
  41975. /**
  41976. * Destroys the widget. Should be called if permanently
  41977. * removing the widget from layout.
  41978. */
  41979. destroy(): void;
  41980. }
  41981. /**
  41982. * The view model for {@link Cesium3DTilesInspector}.
  41983. * @param scene - The scene instance to use.
  41984. * @param performanceContainer - The container for the performance display
  41985. */
  41986. export class Cesium3DTilesInspectorViewModel {
  41987. constructor(scene: Scene, performanceContainer: HTMLElement);
  41988. /**
  41989. * Gets or sets the flag to enable performance display. This property is observable.
  41990. */
  41991. performance: boolean;
  41992. /**
  41993. * Gets or sets the flag to show statistics. This property is observable.
  41994. */
  41995. showStatistics: boolean;
  41996. /**
  41997. * Gets or sets the flag to show pick statistics. This property is observable.
  41998. */
  41999. showPickStatistics: boolean;
  42000. /**
  42001. * Gets or sets the flag to show the inspector. This property is observable.
  42002. */
  42003. inspectorVisible: boolean;
  42004. /**
  42005. * Gets or sets the flag to show the tileset section. This property is observable.
  42006. */
  42007. tilesetVisible: boolean;
  42008. /**
  42009. * Gets or sets the flag to show the display section. This property is observable.
  42010. */
  42011. displayVisible: boolean;
  42012. /**
  42013. * Gets or sets the flag to show the update section. This property is observable.
  42014. */
  42015. updateVisible: boolean;
  42016. /**
  42017. * Gets or sets the flag to show the logging section. This property is observable.
  42018. */
  42019. loggingVisible: boolean;
  42020. /**
  42021. * Gets or sets the flag to show the style section. This property is observable.
  42022. */
  42023. styleVisible: boolean;
  42024. /**
  42025. * Gets or sets the flag to show the tile info section. This property is observable.
  42026. */
  42027. tileDebugLabelsVisible: boolean;
  42028. /**
  42029. * Gets or sets the flag to show the optimization info section. This property is observable.
  42030. */
  42031. optimizationVisible: boolean;
  42032. /**
  42033. * Gets or sets the JSON for the tileset style. This property is observable.
  42034. */
  42035. styleString: string;
  42036. /**
  42037. * Gets the names of the properties in the tileset. This property is observable.
  42038. */
  42039. readonly properties: string[];
  42040. /**
  42041. * Gets or sets the flag to enable dynamic screen space error. This property is observable.
  42042. */
  42043. dynamicScreenSpaceError: boolean;
  42044. /**
  42045. * Gets or sets the color blend mode. This property is observable.
  42046. */
  42047. colorBlendMode: Cesium3DTileColorBlendMode;
  42048. /**
  42049. * Gets or sets the flag to enable picking. This property is observable.
  42050. */
  42051. picking: boolean;
  42052. /**
  42053. * Gets or sets the flag to colorize tiles. This property is observable.
  42054. */
  42055. colorize: boolean;
  42056. /**
  42057. * Gets or sets the flag to draw with wireframe. This property is observable.
  42058. */
  42059. wireframe: boolean;
  42060. /**
  42061. * Gets or sets the flag to show bounding volumes. This property is observable.
  42062. */
  42063. showBoundingVolumes: boolean;
  42064. /**
  42065. * Gets or sets the flag to show content volumes. This property is observable.
  42066. */
  42067. showContentBoundingVolumes: boolean;
  42068. /**
  42069. * Gets or sets the flag to show request volumes. This property is observable.
  42070. */
  42071. showRequestVolumes: boolean;
  42072. /**
  42073. * Gets or sets the flag to suspend updates. This property is observable.
  42074. */
  42075. freezeFrame: boolean;
  42076. /**
  42077. * Gets or sets the flag to show debug labels only for the currently picked tile. This property is observable.
  42078. */
  42079. showOnlyPickedTileDebugLabel: boolean;
  42080. /**
  42081. * Gets or sets the flag to show tile geometric error. This property is observable.
  42082. */
  42083. showGeometricError: boolean;
  42084. /**
  42085. * Displays the number of commands, points, triangles and features used per tile. This property is observable.
  42086. */
  42087. showRenderingStatistics: boolean;
  42088. /**
  42089. * Displays the memory used per tile. This property is observable.
  42090. */
  42091. showMemoryUsage: boolean;
  42092. /**
  42093. * Gets or sets the flag to show the tile url. This property is observable.
  42094. */
  42095. showUrl: boolean;
  42096. /**
  42097. * Gets or sets the maximum screen space error. This property is observable.
  42098. */
  42099. maximumScreenSpaceError: number;
  42100. /**
  42101. * Gets or sets the dynamic screen space error density. This property is observable.
  42102. */
  42103. dynamicScreenSpaceErrorDensity: number;
  42104. /**
  42105. * Gets or sets the dynamic screen space error density slider value.
  42106. * This allows the slider to be exponential because values tend to be closer to 0 than 1.
  42107. * This property is observable.
  42108. */
  42109. dynamicScreenSpaceErrorDensitySliderValue: number;
  42110. /**
  42111. * Gets or sets the dynamic screen space error factor. This property is observable.
  42112. */
  42113. dynamicScreenSpaceErrorFactor: number;
  42114. /**
  42115. * Gets or sets the flag to enable point cloud shading. This property is observable.
  42116. */
  42117. pointCloudShading: boolean;
  42118. /**
  42119. * Gets or sets the geometric error scale. This property is observable.
  42120. */
  42121. geometricErrorScale: number;
  42122. /**
  42123. * Gets or sets the maximum attenuation. This property is observable.
  42124. */
  42125. maximumAttenuation: number;
  42126. /**
  42127. * Gets or sets the base resolution. This property is observable.
  42128. */
  42129. baseResolution: number;
  42130. /**
  42131. * Gets or sets the flag to enable eye dome lighting. This property is observable.
  42132. */
  42133. eyeDomeLighting: boolean;
  42134. /**
  42135. * Gets or sets the eye dome lighting strength. This property is observable.
  42136. */
  42137. eyeDomeLightingStrength: number;
  42138. /**
  42139. * Gets or sets the eye dome lighting radius. This property is observable.
  42140. */
  42141. eyeDomeLightingRadius: number;
  42142. /**
  42143. * Gets or sets the pick state
  42144. */
  42145. pickActive: boolean;
  42146. /**
  42147. * Gets or sets the flag to determine if level of detail skipping should be applied during the traversal.
  42148. * This property is observable.
  42149. */
  42150. skipLevelOfDetail: boolean;
  42151. /**
  42152. * Gets or sets the multiplier defining the minimum screen space error to skip. This property is observable.
  42153. */
  42154. skipScreenSpaceErrorFactor: number;
  42155. /**
  42156. * Gets or sets the screen space error that must be reached before skipping levels of detail. This property is observable.
  42157. */
  42158. baseScreenSpaceError: number;
  42159. /**
  42160. * Gets or sets the constant defining the minimum number of levels to skip when loading tiles. This property is observable.
  42161. */
  42162. skipLevels: number;
  42163. /**
  42164. * Gets or sets the flag which, when true, only tiles that meet the maximum screen space error will ever be downloaded.
  42165. * This property is observable.
  42166. */
  42167. immediatelyLoadDesiredLevelOfDetail: boolean;
  42168. /**
  42169. * Gets or sets the flag which determines whether siblings of visible tiles are always downloaded during traversal.
  42170. * This property is observable
  42171. */
  42172. loadSiblings: boolean;
  42173. /**
  42174. * Gets the scene
  42175. */
  42176. readonly scene: Scene;
  42177. /**
  42178. * Gets the performance container
  42179. */
  42180. readonly performanceContainer: HTMLElement;
  42181. /**
  42182. * Gets the statistics text. This property is observable.
  42183. */
  42184. readonly statisticsText: string;
  42185. /**
  42186. * Gets the pick statistics text. This property is observable.
  42187. */
  42188. readonly pickStatisticsText: string;
  42189. /**
  42190. * Gets the available blend modes
  42191. */
  42192. readonly colorBlendModes: object[];
  42193. /**
  42194. * Gets the editor error message
  42195. */
  42196. readonly editorError: string;
  42197. /**
  42198. * Gets or sets the tileset of the view model.
  42199. */
  42200. tileset: Cesium3DTileset;
  42201. /**
  42202. * Gets the current feature of the view model.
  42203. */
  42204. feature: Cesium3DTileFeature;
  42205. /**
  42206. * Gets the current tile of the view model
  42207. */
  42208. tile: Cesium3DTile;
  42209. /**
  42210. * Toggles the pick tileset mode
  42211. */
  42212. togglePickTileset(): void;
  42213. /**
  42214. * Toggles the inspector visibility
  42215. */
  42216. toggleInspector(): void;
  42217. /**
  42218. * Toggles the visibility of the tileset section
  42219. */
  42220. toggleTileset(): void;
  42221. /**
  42222. * Toggles the visibility of the display section
  42223. */
  42224. toggleDisplay(): void;
  42225. /**
  42226. * Toggles the visibility of the update section
  42227. */
  42228. toggleUpdate(): void;
  42229. /**
  42230. * Toggles the visibility of the logging section
  42231. */
  42232. toggleLogging(): void;
  42233. /**
  42234. * Toggles the visibility of the style section
  42235. */
  42236. toggleStyle(): void;
  42237. /**
  42238. * Toggles the visibility of the tile Debug Info section
  42239. */
  42240. toggleTileDebugLabels(): void;
  42241. /**
  42242. * Toggles the visibility of the optimization section
  42243. */
  42244. toggleOptimization(): void;
  42245. /**
  42246. * Trims tile cache
  42247. */
  42248. trimTilesCache(): void;
  42249. /**
  42250. * Compiles the style in the style editor.
  42251. */
  42252. compileStyle(): void;
  42253. /**
  42254. * Handles key press events on the style editor.
  42255. */
  42256. styleEditorKeyPress(): void;
  42257. /**
  42258. * @returns true if the object has been destroyed, false otherwise.
  42259. */
  42260. isDestroyed(): boolean;
  42261. /**
  42262. * Destroys the widget. Should be called if permanently
  42263. * removing the widget from layout.
  42264. */
  42265. destroy(): void;
  42266. /**
  42267. * Generates an HTML string of the statistics
  42268. * @param tileset - The tileset
  42269. * @param isPick - Whether this is getting the statistics for the pick pass
  42270. * @returns The formatted statistics
  42271. */
  42272. static getStatistics(tileset: Cesium3DTileset, isPick: boolean): string;
  42273. }
  42274. /**
  42275. * Inspector widget to aid in debugging
  42276. * @param container - The DOM element or ID that will contain the widget.
  42277. * @param scene - The Scene instance to use.
  42278. */
  42279. export class CesiumInspector {
  42280. constructor(container: Element | string, scene: Scene);
  42281. /**
  42282. * Gets the parent container.
  42283. */
  42284. container: Element;
  42285. /**
  42286. * Gets the view model.
  42287. */
  42288. viewModel: CesiumInspectorViewModel;
  42289. /**
  42290. * @returns true if the object has been destroyed, false otherwise.
  42291. */
  42292. isDestroyed(): boolean;
  42293. /**
  42294. * Destroys the widget. Should be called if permanently
  42295. * removing the widget from layout.
  42296. */
  42297. destroy(): void;
  42298. }
  42299. /**
  42300. * The view model for {@link CesiumInspector}.
  42301. * @param scene - The scene instance to use.
  42302. * @param performanceContainer - The instance to use for performance container.
  42303. */
  42304. export class CesiumInspectorViewModel {
  42305. constructor(scene: Scene, performanceContainer: Element);
  42306. /**
  42307. * Gets or sets the show frustums state. This property is observable.
  42308. */
  42309. frustums: boolean;
  42310. /**
  42311. * Gets or sets the show frustum planes state. This property is observable.
  42312. */
  42313. frustumPlanes: boolean;
  42314. /**
  42315. * Gets or sets the show performance display state. This property is observable.
  42316. */
  42317. performance: boolean;
  42318. /**
  42319. * Gets or sets the shader cache text. This property is observable.
  42320. */
  42321. shaderCacheText: string;
  42322. /**
  42323. * Gets or sets the show primitive bounding sphere state. This property is observable.
  42324. */
  42325. primitiveBoundingSphere: boolean;
  42326. /**
  42327. * Gets or sets the show primitive reference frame state. This property is observable.
  42328. */
  42329. primitiveReferenceFrame: boolean;
  42330. /**
  42331. * Gets or sets the filter primitive state. This property is observable.
  42332. */
  42333. filterPrimitive: boolean;
  42334. /**
  42335. * Gets or sets the show tile bounding sphere state. This property is observable.
  42336. */
  42337. tileBoundingSphere: boolean;
  42338. /**
  42339. * Gets or sets the filter tile state. This property is observable.
  42340. */
  42341. filterTile: boolean;
  42342. /**
  42343. * Gets or sets the show wireframe state. This property is observable.
  42344. */
  42345. wireframe: boolean;
  42346. /**
  42347. * Gets or sets the index of the depth frustum to display. This property is observable.
  42348. */
  42349. depthFrustum: number;
  42350. /**
  42351. * Gets or sets the suspend updates state. This property is observable.
  42352. */
  42353. suspendUpdates: boolean;
  42354. /**
  42355. * Gets or sets the show tile coordinates state. This property is observable.
  42356. */
  42357. tileCoordinates: boolean;
  42358. /**
  42359. * Gets or sets the frustum statistic text. This property is observable.
  42360. */
  42361. frustumStatisticText: string;
  42362. /**
  42363. * Gets or sets the selected tile information text. This property is observable.
  42364. */
  42365. tileText: string;
  42366. /**
  42367. * Gets if a primitive has been selected. This property is observable.
  42368. */
  42369. hasPickedPrimitive: boolean;
  42370. /**
  42371. * Gets if a tile has been selected. This property is observable
  42372. */
  42373. hasPickedTile: boolean;
  42374. /**
  42375. * Gets if the picking primitive command is active. This property is observable.
  42376. */
  42377. pickPrimitiveActive: boolean;
  42378. /**
  42379. * Gets if the picking tile command is active. This property is observable.
  42380. */
  42381. pickTileActive: boolean;
  42382. /**
  42383. * Gets or sets if the cesium inspector drop down is visible. This property is observable.
  42384. */
  42385. dropDownVisible: boolean;
  42386. /**
  42387. * Gets or sets if the general section is visible. This property is observable.
  42388. */
  42389. generalVisible: boolean;
  42390. /**
  42391. * Gets or sets if the primitive section is visible. This property is observable.
  42392. */
  42393. primitivesVisible: boolean;
  42394. /**
  42395. * Gets or sets if the terrain section is visible. This property is observable.
  42396. */
  42397. terrainVisible: boolean;
  42398. /**
  42399. * Gets or sets the index of the depth frustum text. This property is observable.
  42400. */
  42401. depthFrustumText: string;
  42402. /**
  42403. * Gets the scene to control.
  42404. */
  42405. scene: Scene;
  42406. /**
  42407. * Gets the container of the PerformanceDisplay
  42408. */
  42409. performanceContainer: Element;
  42410. /**
  42411. * Gets the command to toggle the visibility of the drop down.
  42412. */
  42413. toggleDropDown: Command;
  42414. /**
  42415. * Gets the command to toggle the visibility of a BoundingSphere for a primitive
  42416. */
  42417. showPrimitiveBoundingSphere: Command;
  42418. /**
  42419. * Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive
  42420. */
  42421. showPrimitiveReferenceFrame: Command;
  42422. /**
  42423. * Gets the command to toggle a filter that renders only a selected primitive
  42424. */
  42425. doFilterPrimitive: Command;
  42426. /**
  42427. * Gets the command to increment the depth frustum index to be shown
  42428. */
  42429. incrementDepthFrustum: Command;
  42430. /**
  42431. * Gets the command to decrement the depth frustum index to be shown
  42432. */
  42433. decrementDepthFrustum: Command;
  42434. /**
  42435. * Gets the command to toggle the visibility of tile coordinates
  42436. */
  42437. showTileCoordinates: Command;
  42438. /**
  42439. * Gets the command to toggle the visibility of a BoundingSphere for a selected tile
  42440. */
  42441. showTileBoundingSphere: Command;
  42442. /**
  42443. * Gets the command to toggle a filter that renders only a selected tile
  42444. */
  42445. doFilterTile: Command;
  42446. /**
  42447. * Gets the command to expand and collapse the general section
  42448. */
  42449. toggleGeneral: Command;
  42450. /**
  42451. * Gets the command to expand and collapse the primitives section
  42452. */
  42453. togglePrimitives: Command;
  42454. /**
  42455. * Gets the command to expand and collapse the terrain section
  42456. */
  42457. toggleTerrain: Command;
  42458. /**
  42459. * Gets the command to pick a primitive
  42460. */
  42461. pickPrimitive: Command;
  42462. /**
  42463. * Gets the command to pick a tile
  42464. */
  42465. pickTile: Command;
  42466. /**
  42467. * Gets the command to pick a tile
  42468. */
  42469. selectParent: Command;
  42470. /**
  42471. * Gets the command to pick a tile
  42472. */
  42473. selectNW: Command;
  42474. /**
  42475. * Gets the command to pick a tile
  42476. */
  42477. selectNE: Command;
  42478. /**
  42479. * Gets the command to pick a tile
  42480. */
  42481. selectSW: Command;
  42482. /**
  42483. * Gets the command to pick a tile
  42484. */
  42485. selectSE: Command;
  42486. /**
  42487. * Gets or sets the current selected primitive
  42488. */
  42489. primitive: Command;
  42490. /**
  42491. * Gets or sets the current selected tile
  42492. */
  42493. tile: Command;
  42494. /**
  42495. * @returns true if the object has been destroyed, false otherwise.
  42496. */
  42497. isDestroyed(): boolean;
  42498. /**
  42499. * Destroys the widget. Should be called if permanently
  42500. * removing the widget from layout.
  42501. */
  42502. destroy(): void;
  42503. }
  42504. /**
  42505. * A widget containing a Cesium scene.
  42506. * @example
  42507. * // For each example, include a link to CesiumWidget.css stylesheet in HTML head,
  42508. * // and in the body, include: <div id="cesiumContainer"></div>
  42509. *
  42510. * //Widget with no terrain and default Bing Maps imagery provider.
  42511. * const widget = new Cesium.CesiumWidget('cesiumContainer');
  42512. *
  42513. * //Widget with ion imagery and Cesium World Terrain.
  42514. * const widget2 = new Cesium.CesiumWidget('cesiumContainer', {
  42515. * imageryProvider : Cesium.createWorldImagery(),
  42516. * terrainProvider : Cesium.createWorldTerrain(),
  42517. * skyBox : new Cesium.SkyBox({
  42518. * sources : {
  42519. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  42520. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  42521. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  42522. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  42523. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  42524. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  42525. * }
  42526. * }),
  42527. * // Show Columbus View map with Web Mercator projection
  42528. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  42529. * mapProjection : new Cesium.WebMercatorProjection()
  42530. * });
  42531. * @param container - The DOM element or ID that will contain the widget.
  42532. * @param [options] - Object with the following properties:
  42533. * @param [options.clock = new Clock()] - The clock to use to control current time.
  42534. * @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.
  42535. * @param [options.terrainProvider = new EllipsoidTerrainProvider] - The terrain provider.
  42536. * @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.
  42537. * @param [options.skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  42538. * @param [options.sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  42539. * @param [options.scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  42540. * @param [options.orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  42541. * @param [options.mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  42542. * @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.
  42543. * @param [options.useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  42544. * @param [options.useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  42545. * @param [options.targetFrameRate] - The target frame rate when using the default render loop.
  42546. * @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.
  42547. * @param [options.contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  42548. * @param [options.creditContainer] - The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added
  42549. * to the bottom of the widget itself.
  42550. * @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.
  42551. * @param [options.shadows = false] - Determines if shadows are cast by light sources.
  42552. * @param [options.terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  42553. * @param [options.mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  42554. * @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}.
  42555. * @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}.
  42556. * @param [options.msaaSamples = 1] - If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
  42557. */
  42558. export class CesiumWidget {
  42559. constructor(container: Element | string, options?: {
  42560. clock?: Clock;
  42561. imageryProvider?: ImageryProvider | false;
  42562. terrainProvider?: TerrainProvider;
  42563. skyBox?: SkyBox | false;
  42564. skyAtmosphere?: SkyAtmosphere | false;
  42565. sceneMode?: SceneMode;
  42566. scene3DOnly?: boolean;
  42567. orderIndependentTranslucency?: boolean;
  42568. mapProjection?: MapProjection;
  42569. globe?: Globe | false;
  42570. useDefaultRenderLoop?: boolean;
  42571. useBrowserRecommendedResolution?: boolean;
  42572. targetFrameRate?: number;
  42573. showRenderLoopErrors?: boolean;
  42574. contextOptions?: any;
  42575. creditContainer?: Element | string;
  42576. creditViewport?: Element | string;
  42577. shadows?: boolean;
  42578. terrainShadows?: ShadowMode;
  42579. mapMode2D?: MapMode2D;
  42580. requestRenderMode?: boolean;
  42581. maximumRenderTimeChange?: number;
  42582. msaaSamples?: number;
  42583. });
  42584. /**
  42585. * Gets the parent container.
  42586. */
  42587. readonly container: Element;
  42588. /**
  42589. * Gets the canvas.
  42590. */
  42591. readonly canvas: HTMLCanvasElement;
  42592. /**
  42593. * Gets the credit container.
  42594. */
  42595. readonly creditContainer: Element;
  42596. /**
  42597. * Gets the credit viewport
  42598. */
  42599. readonly creditViewport: Element;
  42600. /**
  42601. * Gets the scene.
  42602. */
  42603. readonly scene: Scene;
  42604. /**
  42605. * Gets the collection of image layers that will be rendered on the globe.
  42606. */
  42607. readonly imageryLayers: ImageryLayerCollection;
  42608. /**
  42609. * The terrain provider providing surface geometry for the globe.
  42610. */
  42611. terrainProvider: TerrainProvider;
  42612. /**
  42613. * Gets the camera.
  42614. */
  42615. readonly camera: Camera;
  42616. /**
  42617. * Gets the clock.
  42618. */
  42619. readonly clock: Clock;
  42620. /**
  42621. * Gets the screen space event handler.
  42622. */
  42623. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  42624. /**
  42625. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  42626. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  42627. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  42628. * than the underlying requestAnimationFrame implementation will have no effect.
  42629. */
  42630. targetFrameRate: number;
  42631. /**
  42632. * Gets or sets whether or not this widget should control the render loop.
  42633. * If set to true the widget will use {@link requestAnimationFrame} to
  42634. * perform rendering and resizing of the widget, as well as drive the
  42635. * simulation clock. If set to false, you must manually call the
  42636. * <code>resize</code>, <code>render</code> methods as part of a custom
  42637. * render loop. If an error occurs during rendering, {@link Scene}'s
  42638. * <code>renderError</code> event will be raised and this property
  42639. * will be set to false. It must be set back to true to continue rendering
  42640. * after the error.
  42641. */
  42642. useDefaultRenderLoop: boolean;
  42643. /**
  42644. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  42645. * performance on less powerful devices while values greater than 1.0 will render at a higher
  42646. * resolution and then scale down, resulting in improved visual fidelity.
  42647. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  42648. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  42649. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  42650. */
  42651. resolutionScale: number;
  42652. /**
  42653. * Boolean flag indicating if the browser's recommended resolution is used.
  42654. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  42655. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  42656. * performance on less powerful devices that have high pixel density. When false, rendering
  42657. * will be in device pixels. {@link CesiumWidget#resolutionScale} will still take effect whether
  42658. * this flag is true or false.
  42659. */
  42660. useBrowserRecommendedResolution: boolean;
  42661. /**
  42662. * Show an error panel to the user containing a title and a longer error message,
  42663. * which can be dismissed using an OK button. This panel is displayed automatically
  42664. * when a render loop error occurs, if showRenderLoopErrors was not false when the
  42665. * widget was constructed.
  42666. * @param title - The title to be displayed on the error panel. This string is interpreted as text.
  42667. * @param [message] - A helpful, user-facing message to display prior to the detailed error information. This string is interpreted as HTML.
  42668. * @param [error] - The error to be displayed on the error panel. This string is formatted using {@link formatError} and then displayed as text.
  42669. */
  42670. showErrorPanel(title: string, message?: string, error?: string): void;
  42671. /**
  42672. * @returns true if the object has been destroyed, false otherwise.
  42673. */
  42674. isDestroyed(): boolean;
  42675. /**
  42676. * Destroys the widget. Should be called if permanently
  42677. * removing the widget from layout.
  42678. */
  42679. destroy(): void;
  42680. /**
  42681. * Updates the canvas size, camera aspect ratio, and viewport size.
  42682. * This function is called automatically as needed unless
  42683. * <code>useDefaultRenderLoop</code> is set to false.
  42684. */
  42685. resize(): void;
  42686. /**
  42687. * Renders the scene. This function is called automatically
  42688. * unless <code>useDefaultRenderLoop</code> is set to false;
  42689. */
  42690. render(): void;
  42691. }
  42692. /**
  42693. * A view model which exposes a {@link Clock} for user interfaces.
  42694. * @param [clock] - The clock object wrapped by this view model, if undefined a new instance will be created.
  42695. */
  42696. export class ClockViewModel {
  42697. constructor(clock?: Clock);
  42698. /**
  42699. * Gets the current system time.
  42700. * This property is observable.
  42701. */
  42702. systemTime: JulianDate;
  42703. /**
  42704. * Gets or sets the start time of the clock.
  42705. * See {@link Clock#startTime}.
  42706. * This property is observable.
  42707. */
  42708. startTime: JulianDate;
  42709. /**
  42710. * Gets or sets the stop time of the clock.
  42711. * See {@link Clock#stopTime}.
  42712. * This property is observable.
  42713. */
  42714. stopTime: JulianDate;
  42715. /**
  42716. * Gets or sets the current time.
  42717. * See {@link Clock#currentTime}.
  42718. * This property is observable.
  42719. */
  42720. currentTime: JulianDate;
  42721. /**
  42722. * Gets or sets the clock multiplier.
  42723. * See {@link Clock#multiplier}.
  42724. * This property is observable.
  42725. */
  42726. multiplier: number;
  42727. /**
  42728. * Gets or sets the clock step setting.
  42729. * See {@link Clock#clockStep}.
  42730. * This property is observable.
  42731. */
  42732. clockStep: ClockStep;
  42733. /**
  42734. * Gets or sets the clock range setting.
  42735. * See {@link Clock#clockRange}.
  42736. * This property is observable.
  42737. */
  42738. clockRange: ClockRange;
  42739. /**
  42740. * Gets or sets whether the clock can animate.
  42741. * See {@link Clock#canAnimate}.
  42742. * This property is observable.
  42743. */
  42744. canAnimate: boolean;
  42745. /**
  42746. * Gets or sets whether the clock should animate.
  42747. * See {@link Clock#shouldAnimate}.
  42748. * This property is observable.
  42749. */
  42750. shouldAnimate: boolean;
  42751. /**
  42752. * Gets the underlying Clock.
  42753. */
  42754. clock: Clock;
  42755. /**
  42756. * Updates the view model with the contents of the underlying clock.
  42757. * Can be called to force an update of the viewModel if the underlying
  42758. * clock has changed and <code>Clock.tick</code> has not yet been called.
  42759. */
  42760. synchronize(): void;
  42761. /**
  42762. * @returns true if the object has been destroyed, false otherwise.
  42763. */
  42764. isDestroyed(): boolean;
  42765. /**
  42766. * Destroys the view model. Should be called to
  42767. * properly clean up the view model when it is no longer needed.
  42768. */
  42769. destroy(): void;
  42770. }
  42771. /**
  42772. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  42773. * whether the command can be executed. When executed, a Command function will check the
  42774. * value of <code>canExecute</code> and throw if false.
  42775. *
  42776. * This type describes an interface and is not intended to be instantiated directly.
  42777. * See {@link createCommand} to create a command from a function.
  42778. */
  42779. export class Command {
  42780. constructor();
  42781. /**
  42782. * Gets whether this command can currently be executed. This property is observable.
  42783. */
  42784. canExecute: boolean;
  42785. /**
  42786. * Gets an event which is raised before the command executes, the event
  42787. * is raised with an object containing two properties: a <code>cancel</code> property,
  42788. * which if set to false by the listener will prevent the command from being executed, and
  42789. * an <code>args</code> property, which is the array of arguments being passed to the command.
  42790. */
  42791. beforeExecute: Event;
  42792. /**
  42793. * Gets an event which is raised after the command executes, the event
  42794. * is raised with the return value of the command as its only parameter.
  42795. */
  42796. afterExecute: Event;
  42797. }
  42798. /**
  42799. * A single button widget for toggling fullscreen mode.
  42800. * @param container - The DOM element or ID that will contain the widget.
  42801. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  42802. */
  42803. export class FullscreenButton {
  42804. constructor(container: Element | string, fullscreenElement?: Element | string);
  42805. /**
  42806. * Gets the parent container.
  42807. */
  42808. container: Element;
  42809. /**
  42810. * Gets the view model.
  42811. */
  42812. viewModel: FullscreenButtonViewModel;
  42813. /**
  42814. * @returns true if the object has been destroyed, false otherwise.
  42815. */
  42816. isDestroyed(): boolean;
  42817. /**
  42818. * Destroys the widget. Should be called if permanently
  42819. * removing the widget from layout.
  42820. */
  42821. destroy(): void;
  42822. }
  42823. /**
  42824. * The view model for {@link FullscreenButton}.
  42825. * @param [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode.
  42826. * @param [container] - The DOM element or ID that will contain the widget.
  42827. */
  42828. export class FullscreenButtonViewModel {
  42829. constructor(fullscreenElement?: Element | string, container?: Element | string);
  42830. /**
  42831. * Gets whether or not fullscreen mode is active. This property is observable.
  42832. */
  42833. isFullscreen: boolean;
  42834. /**
  42835. * Gets or sets whether or not fullscreen functionality should be enabled. This property is observable.
  42836. */
  42837. isFullscreenEnabled: boolean;
  42838. /**
  42839. * Gets the tooltip. This property is observable.
  42840. */
  42841. tooltip: string;
  42842. /**
  42843. * Gets or sets the HTML element to place into fullscreen mode when the
  42844. * corresponding button is pressed.
  42845. */
  42846. fullscreenElement: Element;
  42847. /**
  42848. * Gets the Command to toggle fullscreen mode.
  42849. */
  42850. command: Command;
  42851. /**
  42852. * @returns true if the object has been destroyed, false otherwise.
  42853. */
  42854. isDestroyed(): boolean;
  42855. /**
  42856. * Destroys the view model. Should be called to
  42857. * properly clean up the view model when it is no longer needed.
  42858. */
  42859. destroy(): void;
  42860. }
  42861. /**
  42862. * A widget for finding addresses and landmarks, and flying the camera to them. Geocoding is
  42863. * performed using {@link https://cesium.com/cesium-ion/|Cesium ion}.
  42864. * @param options - Object with the following properties:
  42865. * @param options.container - The DOM element or ID that will contain the widget.
  42866. * @param options.scene - The Scene instance to use.
  42867. * @param [options.geocoderServices] - The geocoder services to be used
  42868. * @param [options.autoComplete = true] - True if the geocoder should query as the user types to autocomplete
  42869. * @param [options.flightDuration = 1.5] - The duration of the camera flight to an entered location, in seconds.
  42870. * @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.
  42871. */
  42872. export class Geocoder {
  42873. constructor(options: {
  42874. container: Element | string;
  42875. scene: Scene;
  42876. geocoderServices?: GeocoderService[];
  42877. autoComplete?: boolean;
  42878. flightDuration?: number;
  42879. destinationFound?: Geocoder.DestinationFoundFunction;
  42880. });
  42881. /**
  42882. * Gets the parent container.
  42883. */
  42884. container: Element;
  42885. /**
  42886. * Gets the parent container.
  42887. */
  42888. searchSuggestionsContainer: Element;
  42889. /**
  42890. * Gets the view model.
  42891. */
  42892. viewModel: GeocoderViewModel;
  42893. /**
  42894. * @returns true if the object has been destroyed, false otherwise.
  42895. */
  42896. isDestroyed(): boolean;
  42897. /**
  42898. * Destroys the widget. Should be called if permanently
  42899. * removing the widget from layout.
  42900. */
  42901. destroy(): void;
  42902. }
  42903. export namespace Geocoder {
  42904. /**
  42905. * A function that handles the result of a successful geocode.
  42906. * @param viewModel - The view model.
  42907. * @param destination - The destination result of the geocode.
  42908. */
  42909. type DestinationFoundFunction = (viewModel: GeocoderViewModel, destination: Cartesian3 | Rectangle) => void;
  42910. }
  42911. /**
  42912. * The view model for the {@link Geocoder} widget.
  42913. * @param options - Object with the following properties:
  42914. * @param options.scene - The Scene instance to use.
  42915. * @param [options.geocoderServices] - Geocoder services to use for geocoding queries.
  42916. * If more than one are supplied, suggestions will be gathered for the geocoders that support it,
  42917. * and if no suggestion is selected the result from the first geocoder service wil be used.
  42918. * @param [options.flightDuration] - The duration of the camera flight to an entered location, in seconds.
  42919. * @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.
  42920. */
  42921. export class GeocoderViewModel {
  42922. constructor(options: {
  42923. scene: Scene;
  42924. geocoderServices?: GeocoderService[];
  42925. flightDuration?: number;
  42926. destinationFound?: Geocoder.DestinationFoundFunction;
  42927. });
  42928. /**
  42929. * Gets or sets a value indicating if this instance should always show its text input field.
  42930. */
  42931. keepExpanded: boolean;
  42932. /**
  42933. * True if the geocoder should query as the user types to autocomplete
  42934. */
  42935. autoComplete: boolean;
  42936. /**
  42937. * Gets and sets the command called when a geocode destination is found
  42938. */
  42939. destinationFound: Geocoder.DestinationFoundFunction;
  42940. /**
  42941. * Gets a value indicating whether a search is currently in progress. This property is observable.
  42942. */
  42943. isSearchInProgress: boolean;
  42944. /**
  42945. * Gets or sets the text to search for. The text can be an address, or longitude, latitude,
  42946. * and optional height, where longitude and latitude are in degrees and height is in meters.
  42947. */
  42948. searchText: string;
  42949. /**
  42950. * Gets or sets the the duration of the camera flight in seconds.
  42951. * A value of zero causes the camera to instantly switch to the geocoding location.
  42952. * The duration will be computed based on the distance when undefined.
  42953. */
  42954. flightDuration: number | undefined;
  42955. /**
  42956. * Gets the event triggered on flight completion.
  42957. */
  42958. complete: Event;
  42959. /**
  42960. * Gets the scene to control.
  42961. */
  42962. scene: Scene;
  42963. /**
  42964. * Gets the Command that is executed when the button is clicked.
  42965. */
  42966. search: Command;
  42967. /**
  42968. * Gets the currently selected geocoder search suggestion
  42969. */
  42970. selectedSuggestion: any;
  42971. /**
  42972. * Gets the list of geocoder search suggestions
  42973. */
  42974. suggestions: object[];
  42975. /**
  42976. * Destroys the widget. Should be called if permanently
  42977. * removing the widget from layout.
  42978. */
  42979. destroy(): void;
  42980. /**
  42981. * A function to fly to the destination found by a successful geocode.
  42982. */
  42983. static flyToDestination: Geocoder.DestinationFoundFunction;
  42984. }
  42985. /**
  42986. * A single button widget for returning to the default camera view of the current scene.
  42987. * @param container - The DOM element or ID that will contain the widget.
  42988. * @param scene - The Scene instance to use.
  42989. * @param [duration] - The time, in seconds, it takes to complete the camera flight home.
  42990. */
  42991. export class HomeButton {
  42992. constructor(container: Element | string, scene: Scene, duration?: number);
  42993. /**
  42994. * Gets the parent container.
  42995. */
  42996. container: Element;
  42997. /**
  42998. * Gets the view model.
  42999. */
  43000. viewModel: HomeButtonViewModel;
  43001. /**
  43002. * @returns true if the object has been destroyed, false otherwise.
  43003. */
  43004. isDestroyed(): boolean;
  43005. /**
  43006. * Destroys the widget. Should be called if permanently
  43007. * removing the widget from layout.
  43008. */
  43009. destroy(): void;
  43010. }
  43011. /**
  43012. * The view model for {@link HomeButton}.
  43013. * @param scene - The scene instance to use.
  43014. * @param [duration] - The duration of the camera flight in seconds.
  43015. */
  43016. export class HomeButtonViewModel {
  43017. constructor(scene: Scene, duration?: number);
  43018. /**
  43019. * Gets or sets the tooltip. This property is observable.
  43020. */
  43021. tooltip: string;
  43022. /**
  43023. * Gets the scene to control.
  43024. */
  43025. scene: Scene;
  43026. /**
  43027. * Gets the Command that is executed when the button is clicked.
  43028. */
  43029. command: Command;
  43030. /**
  43031. * Gets or sets the the duration of the camera flight in seconds.
  43032. * A value of zero causes the camera to instantly switch to home view.
  43033. * The duration will be computed based on the distance when undefined.
  43034. */
  43035. duration: number | undefined;
  43036. }
  43037. /**
  43038. * A widget for displaying information or a description.
  43039. * @param container - The DOM element or ID that will contain the widget.
  43040. */
  43041. export class InfoBox {
  43042. constructor(container: Element | string);
  43043. /**
  43044. * Gets the parent container.
  43045. */
  43046. container: Element;
  43047. /**
  43048. * Gets the view model.
  43049. */
  43050. viewModel: InfoBoxViewModel;
  43051. /**
  43052. * Gets the iframe used to display the description.
  43053. */
  43054. frame: HTMLIFrameElement;
  43055. /**
  43056. * @returns true if the object has been destroyed, false otherwise.
  43057. */
  43058. isDestroyed(): boolean;
  43059. /**
  43060. * Destroys the widget. Should be called if permanently
  43061. * removing the widget from layout.
  43062. */
  43063. destroy(): void;
  43064. }
  43065. /**
  43066. * The view model for {@link InfoBox}.
  43067. */
  43068. export class InfoBoxViewModel {
  43069. constructor();
  43070. /**
  43071. * Gets or sets the maximum height of the info box in pixels. This property is observable.
  43072. */
  43073. maxHeight: number;
  43074. /**
  43075. * Gets or sets whether the camera tracking icon is enabled.
  43076. */
  43077. enableCamera: boolean;
  43078. /**
  43079. * Gets or sets the status of current camera tracking of the selected object.
  43080. */
  43081. isCameraTracking: boolean;
  43082. /**
  43083. * Gets or sets the visibility of the info box.
  43084. */
  43085. showInfo: boolean;
  43086. /**
  43087. * Gets or sets the title text in the info box.
  43088. */
  43089. titleText: string;
  43090. /**
  43091. * Gets or sets the description HTML for the info box.
  43092. */
  43093. description: string;
  43094. /**
  43095. * Gets the SVG path of the camera icon, which can change to be "crossed out" or not.
  43096. */
  43097. cameraIconPath: string;
  43098. /**
  43099. * Gets the maximum height of sections within the info box, minus an offset, in CSS-ready form.
  43100. * @param offset - The offset in pixels.
  43101. */
  43102. maxHeightOffset(offset: number): string;
  43103. /**
  43104. * Gets an {@link Event} that is fired when the user clicks the camera icon.
  43105. */
  43106. cameraClicked: Event;
  43107. /**
  43108. * Gets an {@link Event} that is fired when the user closes the info box.
  43109. */
  43110. closeClicked: Event;
  43111. }
  43112. /**
  43113. * <p>The NavigationHelpButton is a single button widget for displaying instructions for
  43114. * navigating the globe with the mouse.</p><p style="clear: both;"></p><br/>
  43115. * @example
  43116. * // In HTML head, include a link to the NavigationHelpButton.css stylesheet,
  43117. * // and in the body, include: <div id="navigationHelpButtonContainer"></div>
  43118. *
  43119. * const navigationHelpButton = new Cesium.NavigationHelpButton({
  43120. * container : 'navigationHelpButtonContainer'
  43121. * });
  43122. * @param options - Object with the following properties:
  43123. * @param options.container - The DOM element or ID that will contain the widget.
  43124. * @param [options.instructionsInitiallyVisible = false] - True if the navigation instructions should initially be visible; otherwise, false.
  43125. */
  43126. export class NavigationHelpButton {
  43127. constructor(options: {
  43128. container: Element | string;
  43129. instructionsInitiallyVisible?: boolean;
  43130. });
  43131. /**
  43132. * Gets the parent container.
  43133. */
  43134. container: Element;
  43135. /**
  43136. * Gets the view model.
  43137. */
  43138. viewModel: NavigationHelpButtonViewModel;
  43139. /**
  43140. * @returns true if the object has been destroyed, false otherwise.
  43141. */
  43142. isDestroyed(): boolean;
  43143. /**
  43144. * Destroys the widget. Should be called if permanently
  43145. * removing the widget from layout.
  43146. */
  43147. destroy(): void;
  43148. }
  43149. /**
  43150. * The view model for {@link NavigationHelpButton}.
  43151. */
  43152. export class NavigationHelpButtonViewModel {
  43153. constructor();
  43154. /**
  43155. * Gets or sets whether the instructions are currently shown. This property is observable.
  43156. */
  43157. showInstructions: boolean;
  43158. /**
  43159. * Gets or sets the tooltip. This property is observable.
  43160. */
  43161. tooltip: string;
  43162. /**
  43163. * Gets the Command that is executed when the button is clicked.
  43164. */
  43165. command: Command;
  43166. /**
  43167. * Gets the Command that is executed when the mouse instructions should be shown.
  43168. */
  43169. showClick: Command;
  43170. /**
  43171. * Gets the Command that is executed when the touch instructions should be shown.
  43172. */
  43173. showTouch: Command;
  43174. }
  43175. /**
  43176. * Monitors performance of the application and displays a message if poor performance is detected.
  43177. * @param [options] - Object with the following properties:
  43178. * @param options.container - The DOM element or ID that will contain the widget.
  43179. * @param options.scene - The {@link Scene} for which to monitor performance.
  43180. * @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
  43181. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  43182. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  43183. */
  43184. export class PerformanceWatchdog {
  43185. constructor(options?: {
  43186. container: Element | string;
  43187. scene: Scene;
  43188. lowFrameRateMessage?: string;
  43189. });
  43190. /**
  43191. * Gets the parent container.
  43192. */
  43193. container: Element;
  43194. /**
  43195. * Gets the view model.
  43196. */
  43197. viewModel: PerformanceWatchdogViewModel;
  43198. /**
  43199. * @returns true if the object has been destroyed, false otherwise.
  43200. */
  43201. isDestroyed(): boolean;
  43202. /**
  43203. * Destroys the widget. Should be called if permanently
  43204. * removing the widget from layout.
  43205. */
  43206. destroy(): void;
  43207. }
  43208. /**
  43209. * The view model for {@link PerformanceWatchdog}.
  43210. * @param [options] - Object with the following properties:
  43211. * @param options.scene - The Scene instance for which to monitor performance.
  43212. * @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
  43213. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  43214. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  43215. */
  43216. export class PerformanceWatchdogViewModel {
  43217. constructor(options?: {
  43218. scene: Scene;
  43219. lowFrameRateMessage?: string;
  43220. });
  43221. /**
  43222. * Gets or sets the message to display when a low frame rate is detected. This string will be interpreted as HTML.
  43223. */
  43224. lowFrameRateMessage: string;
  43225. /**
  43226. * Gets or sets a value indicating whether the low frame rate message has previously been dismissed by the user. If it has
  43227. * been dismissed, the message will not be redisplayed, no matter the frame rate.
  43228. */
  43229. lowFrameRateMessageDismissed: boolean;
  43230. /**
  43231. * Gets or sets a value indicating whether the low frame rate message is currently being displayed.
  43232. */
  43233. showingLowFrameRateMessage: boolean;
  43234. /**
  43235. * Gets the {@link Scene} instance for which to monitor performance.
  43236. */
  43237. scene: Scene;
  43238. /**
  43239. * Gets a command that dismisses the low frame rate message. Once it is dismissed, the message
  43240. * will not be redisplayed.
  43241. */
  43242. dismissMessage: Command;
  43243. }
  43244. /**
  43245. * The ProjectionPicker is a single button widget for switching between perspective and orthographic projections.
  43246. * @example
  43247. * // In HTML head, include a link to the ProjectionPicker.css stylesheet,
  43248. * // and in the body, include: <div id="projectionPickerContainer"></div>
  43249. * // Note: This code assumes you already have a Scene instance.
  43250. *
  43251. * const projectionPicker = new Cesium.ProjectionPicker('projectionPickerContainer', scene);
  43252. * @param container - The DOM element or ID that will contain the widget.
  43253. * @param scene - The Scene instance to use.
  43254. */
  43255. export class ProjectionPicker {
  43256. constructor(container: Element | string, scene: Scene);
  43257. /**
  43258. * Gets the parent container.
  43259. */
  43260. container: Element;
  43261. /**
  43262. * Gets the view model.
  43263. */
  43264. viewModel: ProjectionPickerViewModel;
  43265. /**
  43266. * @returns true if the object has been destroyed, false otherwise.
  43267. */
  43268. isDestroyed(): boolean;
  43269. /**
  43270. * Destroys the widget. Should be called if permanently
  43271. * removing the widget from layout.
  43272. */
  43273. destroy(): void;
  43274. }
  43275. /**
  43276. * The view model for {@link ProjectionPicker}.
  43277. * @param scene - The Scene to switch projections.
  43278. */
  43279. export class ProjectionPickerViewModel {
  43280. constructor(scene: Scene);
  43281. /**
  43282. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  43283. */
  43284. dropDownVisible: boolean;
  43285. /**
  43286. * Gets or sets the perspective projection tooltip. This property is observable.
  43287. */
  43288. tooltipPerspective: string;
  43289. /**
  43290. * Gets or sets the orthographic projection tooltip. This property is observable.
  43291. */
  43292. tooltipOrthographic: string;
  43293. /**
  43294. * Gets the currently active tooltip. This property is observable.
  43295. */
  43296. selectedTooltip: string;
  43297. /**
  43298. * Gets or sets the current SceneMode. This property is observable.
  43299. */
  43300. sceneMode: SceneMode;
  43301. /**
  43302. * Gets the scene
  43303. */
  43304. scene: Scene;
  43305. /**
  43306. * Gets the command to toggle the drop down box.
  43307. */
  43308. toggleDropDown: Command;
  43309. /**
  43310. * Gets the command to switch to a perspective projection.
  43311. */
  43312. switchToPerspective: Command;
  43313. /**
  43314. * Gets the command to switch to orthographic projection.
  43315. */
  43316. switchToOrthographic: Command;
  43317. /**
  43318. * Gets whether the scene is currently using an orthographic projection.
  43319. */
  43320. isOrthographicProjection: Command;
  43321. /**
  43322. * @returns true if the object has been destroyed, false otherwise.
  43323. */
  43324. isDestroyed(): boolean;
  43325. /**
  43326. * Destroys the view model.
  43327. */
  43328. destroy(): void;
  43329. }
  43330. /**
  43331. * <img src="Images/sceneModePicker.png" style="float: left; margin-right: 10px;" width="44" height="116" />
  43332. * <p>The SceneModePicker is a single button widget for switching between scene modes;
  43333. * shown to the left in its expanded state. Programatic switching of scene modes will
  43334. * be automatically reflected in the widget as long as the specified Scene
  43335. * is used to perform the change.</p><p style="clear: both;"></p><br/>
  43336. * @example
  43337. * // In HTML head, include a link to the SceneModePicker.css stylesheet,
  43338. * // and in the body, include: <div id="sceneModePickerContainer"></div>
  43339. * // Note: This code assumes you already have a Scene instance.
  43340. *
  43341. * const sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);
  43342. * @param container - The DOM element or ID that will contain the widget.
  43343. * @param scene - The Scene instance to use.
  43344. * @param [duration = 2.0] - The time, in seconds, it takes for the scene to transition.
  43345. */
  43346. export class SceneModePicker {
  43347. constructor(container: Element | string, scene: Scene, duration?: number);
  43348. /**
  43349. * Gets the parent container.
  43350. */
  43351. container: Element;
  43352. /**
  43353. * Gets the view model.
  43354. */
  43355. viewModel: SceneModePickerViewModel;
  43356. /**
  43357. * @returns true if the object has been destroyed, false otherwise.
  43358. */
  43359. isDestroyed(): boolean;
  43360. /**
  43361. * Destroys the widget. Should be called if permanently
  43362. * removing the widget from layout.
  43363. */
  43364. destroy(): void;
  43365. }
  43366. /**
  43367. * The view model for {@link SceneModePicker}.
  43368. * @param scene - The Scene to morph
  43369. * @param [duration = 2.0] - The duration of scene morph animations, in seconds
  43370. */
  43371. export class SceneModePickerViewModel {
  43372. constructor(scene: Scene, duration?: number);
  43373. /**
  43374. * Gets or sets the current SceneMode. This property is observable.
  43375. */
  43376. sceneMode: SceneMode;
  43377. /**
  43378. * Gets or sets whether the button drop-down is currently visible. This property is observable.
  43379. */
  43380. dropDownVisible: boolean;
  43381. /**
  43382. * Gets or sets the 2D tooltip. This property is observable.
  43383. */
  43384. tooltip2D: string;
  43385. /**
  43386. * Gets or sets the 3D tooltip. This property is observable.
  43387. */
  43388. tooltip3D: string;
  43389. /**
  43390. * Gets or sets the Columbus View tooltip. This property is observable.
  43391. */
  43392. tooltipColumbusView: string;
  43393. /**
  43394. * Gets the currently active tooltip. This property is observable.
  43395. */
  43396. selectedTooltip: string;
  43397. /**
  43398. * Gets the scene
  43399. */
  43400. scene: Scene;
  43401. /**
  43402. * Gets or sets the the duration of scene mode transition animations in seconds.
  43403. * A value of zero causes the scene to instantly change modes.
  43404. */
  43405. duration: number;
  43406. /**
  43407. * Gets the command to toggle the drop down box.
  43408. */
  43409. toggleDropDown: Command;
  43410. /**
  43411. * Gets the command to morph to 2D.
  43412. */
  43413. morphTo2D: Command;
  43414. /**
  43415. * Gets the command to morph to 3D.
  43416. */
  43417. morphTo3D: Command;
  43418. /**
  43419. * Gets the command to morph to Columbus View.
  43420. */
  43421. morphToColumbusView: Command;
  43422. /**
  43423. * @returns true if the object has been destroyed, false otherwise.
  43424. */
  43425. isDestroyed(): boolean;
  43426. /**
  43427. * Destroys the view model.
  43428. */
  43429. destroy(): void;
  43430. }
  43431. /**
  43432. * A widget for displaying an indicator on a selected object.
  43433. * @param container - The DOM element or ID that will contain the widget.
  43434. * @param scene - The Scene instance to use.
  43435. */
  43436. export class SelectionIndicator {
  43437. constructor(container: Element | string, scene: Scene);
  43438. /**
  43439. * Gets the parent container.
  43440. */
  43441. container: Element;
  43442. /**
  43443. * Gets the view model.
  43444. */
  43445. viewModel: SelectionIndicatorViewModel;
  43446. /**
  43447. * @returns true if the object has been destroyed, false otherwise.
  43448. */
  43449. isDestroyed(): boolean;
  43450. /**
  43451. * Destroys the widget. Should be called if permanently
  43452. * removing the widget from layout.
  43453. */
  43454. destroy(): void;
  43455. }
  43456. /**
  43457. * The view model for {@link SelectionIndicator}.
  43458. * @param scene - The scene instance to use for screen-space coordinate conversion.
  43459. * @param selectionIndicatorElement - The element containing all elements that make up the selection indicator.
  43460. * @param container - The DOM element that contains the widget.
  43461. */
  43462. export class SelectionIndicatorViewModel {
  43463. constructor(scene: Scene, selectionIndicatorElement: Element, container: Element);
  43464. /**
  43465. * Gets or sets the world position of the object for which to display the selection indicator.
  43466. */
  43467. position: Cartesian3;
  43468. /**
  43469. * Gets or sets the visibility of the selection indicator.
  43470. */
  43471. showSelection: boolean;
  43472. /**
  43473. * Gets the visibility of the position indicator. This can be false even if an
  43474. * object is selected, when the selected object has no position.
  43475. */
  43476. isVisible: boolean;
  43477. /**
  43478. * Gets or sets the function for converting the world position of the object to the screen space position.
  43479. * @example
  43480. * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
  43481. * return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
  43482. * };
  43483. */
  43484. computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition;
  43485. /**
  43486. * Updates the view of the selection indicator to match the position and content properties of the view model.
  43487. * This function should be called as part of the render loop.
  43488. */
  43489. update(): void;
  43490. /**
  43491. * Animate the indicator to draw attention to the selection.
  43492. */
  43493. animateAppear(): void;
  43494. /**
  43495. * Animate the indicator to release the selection.
  43496. */
  43497. animateDepart(): void;
  43498. /**
  43499. * Gets the HTML element containing the selection indicator.
  43500. */
  43501. container: Element;
  43502. /**
  43503. * Gets the HTML element that holds the selection indicator.
  43504. */
  43505. selectionIndicatorElement: Element;
  43506. /**
  43507. * Gets the scene being used.
  43508. */
  43509. scene: Scene;
  43510. }
  43511. export namespace SelectionIndicatorViewModel {
  43512. /**
  43513. * A function that converts the world position of an object to a screen space position.
  43514. * @param position - The position in WGS84 (world) coordinates.
  43515. * @param result - An object to return the input position transformed to window coordinates.
  43516. */
  43517. type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2;
  43518. }
  43519. /**
  43520. * A Knockout binding handler that creates a DOM element for a single SVG path.
  43521. * This binding handler will be registered as cesiumSvgPath.
  43522. *
  43523. * <p>
  43524. * The parameter to this binding is an object with the following properties:
  43525. * </p>
  43526. *
  43527. * <ul>
  43528. * <li>path: The SVG path as a string.</li>
  43529. * <li>width: The width of the SVG path with no transformations applied.</li>
  43530. * <li>height: The height of the SVG path with no transformations applied.</li>
  43531. * <li>css: Optional. A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied.</li>
  43532. * </ul>
  43533. * @example
  43534. * // Create an SVG as a child of a div
  43535. * <div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>
  43536. *
  43537. * // parameters can be observable from the view model
  43538. * <div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>
  43539. *
  43540. * // or the whole object can be observable from the view model
  43541. * <div data-bind="cesiumSvgPath: svgPathOptions"></div>
  43542. */
  43543. export namespace SvgPathBindingHandler {
  43544. function register(): void;
  43545. }
  43546. /**
  43547. * The Timeline is a widget for displaying and controlling the current scene time.
  43548. * @param container - The parent HTML container node for this widget.
  43549. * @param clock - The clock to use.
  43550. */
  43551. export class Timeline {
  43552. constructor(container: Element, clock: Clock);
  43553. /**
  43554. * Gets the parent container.
  43555. */
  43556. container: Element;
  43557. /**
  43558. * @returns true if the object has been destroyed, false otherwise.
  43559. */
  43560. isDestroyed(): boolean;
  43561. /**
  43562. * Destroys the widget. Should be called if permanently
  43563. * removing the widget from layout.
  43564. */
  43565. destroy(): void;
  43566. /**
  43567. * Sets the view to the provided times.
  43568. * @param startTime - The start time.
  43569. * @param stopTime - The stop time.
  43570. */
  43571. zoomTo(startTime: JulianDate, stopTime: JulianDate): void;
  43572. /**
  43573. * Resizes the widget to match the container size.
  43574. */
  43575. resize(): void;
  43576. }
  43577. /**
  43578. * A view model which exposes the properties of a toggle button.
  43579. * @param command - The command which will be executed when the button is toggled.
  43580. * @param [options] - Object with the following properties:
  43581. * @param [options.toggled = false] - A boolean indicating whether the button should be initially toggled.
  43582. * @param [options.tooltip = ''] - A string containing the button's tooltip.
  43583. */
  43584. export class ToggleButtonViewModel {
  43585. constructor(command: Command, options?: {
  43586. toggled?: boolean;
  43587. tooltip?: string;
  43588. });
  43589. /**
  43590. * Gets or sets whether the button is currently toggled. This property is observable.
  43591. */
  43592. toggled: boolean;
  43593. /**
  43594. * Gets or sets the button's tooltip. This property is observable.
  43595. */
  43596. tooltip: string;
  43597. /**
  43598. * Gets the command which will be executed when the button is toggled.
  43599. */
  43600. command: Command;
  43601. }
  43602. /**
  43603. * A single button widget for toggling vr mode.
  43604. * @param container - The DOM element or ID that will contain the widget.
  43605. * @param scene - The scene.
  43606. * @param [vrElement = document.body] - The element or id to be placed into vr mode.
  43607. */
  43608. export class VRButton {
  43609. constructor(container: Element | string, scene: Scene, vrElement?: Element | string);
  43610. /**
  43611. * Gets the parent container.
  43612. */
  43613. container: Element;
  43614. /**
  43615. * Gets the view model.
  43616. */
  43617. viewModel: VRButtonViewModel;
  43618. /**
  43619. * @returns true if the object has been destroyed, false otherwise.
  43620. */
  43621. isDestroyed(): boolean;
  43622. /**
  43623. * Destroys the widget. Should be called if permanently
  43624. * removing the widget from layout.
  43625. */
  43626. destroy(): void;
  43627. }
  43628. /**
  43629. * The view model for {@link VRButton}.
  43630. * @param scene - The scene.
  43631. * @param [vrElement = document.body] - The element or id to be placed into VR mode.
  43632. */
  43633. export class VRButtonViewModel {
  43634. constructor(scene: Scene, vrElement?: Element | string);
  43635. /**
  43636. * Gets whether or not VR mode is active.
  43637. */
  43638. isVRMode: boolean;
  43639. /**
  43640. * Gets or sets whether or not VR functionality should be enabled.
  43641. */
  43642. isVREnabled: boolean;
  43643. /**
  43644. * Gets the tooltip. This property is observable.
  43645. */
  43646. tooltip: string;
  43647. /**
  43648. * Gets or sets the HTML element to place into VR mode when the
  43649. * corresponding button is pressed.
  43650. */
  43651. vrElement: Element;
  43652. /**
  43653. * Gets the Command to toggle VR mode.
  43654. */
  43655. command: Command;
  43656. /**
  43657. * @returns true if the object has been destroyed, false otherwise.
  43658. */
  43659. isDestroyed(): boolean;
  43660. /**
  43661. * Destroys the view model. Should be called to
  43662. * properly clean up the view model when it is no longer needed.
  43663. */
  43664. destroy(): void;
  43665. }
  43666. export namespace Viewer {
  43667. /**
  43668. * Initialization options for the Viewer constructor
  43669. * @property [animation = true] - If set to false, the Animation widget will not be created.
  43670. * @property [baseLayerPicker = true] - If set to false, the BaseLayerPicker widget will not be created.
  43671. * @property [fullscreenButton = true] - If set to false, the FullscreenButton widget will not be created.
  43672. * @property [vrButton = false] - If set to true, the VRButton widget will be created.
  43673. * @property [geocoder = true] - If set to false, the Geocoder widget will not be created.
  43674. * @property [homeButton = true] - If set to false, the HomeButton widget will not be created.
  43675. * @property [infoBox = true] - If set to false, the InfoBox widget will not be created.
  43676. * @property [sceneModePicker = true] - If set to false, the SceneModePicker widget will not be created.
  43677. * @property [selectionIndicator = true] - If set to false, the SelectionIndicator widget will not be created.
  43678. * @property [timeline = true] - If set to false, the Timeline widget will not be created.
  43679. * @property [navigationHelpButton = true] - If set to false, the navigation help button will not be created.
  43680. * @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.
  43681. * @property [scene3DOnly = false] - When <code>true</code>, each geometry instance will only be rendered in 3D to save GPU memory.
  43682. * @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}.
  43683. * @property [clockViewModel = new ClockViewModel(clock)] - The clock view model to use to control current time.
  43684. * @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.
  43685. * @property [imageryProviderViewModels = createDefaultImageryProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  43686. * @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.
  43687. * @property [terrainProviderViewModels = createDefaultTerrainProviderViewModels()] - The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if `baseLayerPicker` is set to true.
  43688. * @property [imageryProvider = createWorldImagery()] - The imagery provider to use. This value is only valid if `baseLayerPicker` is set to false.
  43689. * @property [terrainProvider = new EllipsoidTerrainProvider()] - The terrain provider to use
  43690. * @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.
  43691. * @property [skyAtmosphere] - Blue sky, and the glow around the Earth's limb. Set to <code>false</code> to turn it off.
  43692. * @property [fullscreenElement = document.body] - The element or id to be placed into fullscreen mode when the full screen button is pressed.
  43693. * @property [useDefaultRenderLoop = true] - True if this widget should control the render loop, false otherwise.
  43694. * @property [targetFrameRate] - The target frame rate when using the default render loop.
  43695. * @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.
  43696. * @property [useBrowserRecommendedResolution = true] - If true, render at the browser's recommended resolution and ignore <code>window.devicePixelRatio</code>.
  43697. * @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.
  43698. * @property [contextOptions] - Context and WebGL creation properties corresponding to <code>options</code> passed to {@link Scene}.
  43699. * @property [sceneMode = SceneMode.SCENE3D] - The initial scene mode.
  43700. * @property [mapProjection = new GeographicProjection()] - The map projection to use in 2D and Columbus View modes.
  43701. * @property [globe = new Globe(mapProjection.ellipsoid)] - The globe to use in the scene. If set to <code>false</code>, no globe will be added.
  43702. * @property [orderIndependentTranslucency = true] - If true and the configuration supports it, use order independent translucency.
  43703. * @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.
  43704. * @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.
  43705. * @property [dataSources = new DataSourceCollection()] - The collection of data sources visualized by the widget. If this parameter is provided,
  43706. * the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.
  43707. * @property [shadows = false] - Determines if shadows are cast by light sources.
  43708. * @property [terrainShadows = ShadowMode.RECEIVE_ONLY] - Determines if the terrain casts or receives shadows from light sources.
  43709. * @property [mapMode2D = MapMode2D.INFINITE_SCROLL] - Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.
  43710. * @property [projectionPicker = false] - If set to true, the ProjectionPicker widget will be created.
  43711. * @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}.
  43712. * @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}.
  43713. * @property [depthPlaneEllipsoidOffset = 0.0] - Adjust the DepthPlane to address rendering artefacts below ellipsoid zero elevation.
  43714. * @property [msaaSamples = 1] - If provided, this value controls the rate of multisample antialiasing. Typical multisampling rates are 2, 4, and sometimes 8 samples per pixel. Higher sampling rates of MSAA may impact performance in exchange for improved visual quality. This value only applies to WebGL2 contexts that support multisample render targets.
  43715. */
  43716. type ConstructorOptions = {
  43717. animation?: boolean;
  43718. baseLayerPicker?: boolean;
  43719. fullscreenButton?: boolean;
  43720. vrButton?: boolean;
  43721. geocoder?: boolean | GeocoderService[];
  43722. homeButton?: boolean;
  43723. infoBox?: boolean;
  43724. sceneModePicker?: boolean;
  43725. selectionIndicator?: boolean;
  43726. timeline?: boolean;
  43727. navigationHelpButton?: boolean;
  43728. navigationInstructionsInitiallyVisible?: boolean;
  43729. scene3DOnly?: boolean;
  43730. shouldAnimate?: boolean;
  43731. clockViewModel?: ClockViewModel;
  43732. selectedImageryProviderViewModel?: ProviderViewModel;
  43733. imageryProviderViewModels?: ProviderViewModel[];
  43734. selectedTerrainProviderViewModel?: ProviderViewModel;
  43735. terrainProviderViewModels?: ProviderViewModel[];
  43736. imageryProvider?: ImageryProvider;
  43737. terrainProvider?: TerrainProvider;
  43738. skyBox?: SkyBox | false;
  43739. skyAtmosphere?: SkyAtmosphere | false;
  43740. fullscreenElement?: Element | string;
  43741. useDefaultRenderLoop?: boolean;
  43742. targetFrameRate?: number;
  43743. showRenderLoopErrors?: boolean;
  43744. useBrowserRecommendedResolution?: boolean;
  43745. automaticallyTrackDataSourceClocks?: boolean;
  43746. contextOptions?: any;
  43747. sceneMode?: SceneMode;
  43748. mapProjection?: MapProjection;
  43749. globe?: Globe | false;
  43750. orderIndependentTranslucency?: boolean;
  43751. creditContainer?: Element | string;
  43752. creditViewport?: Element | string;
  43753. dataSources?: DataSourceCollection;
  43754. shadows?: boolean;
  43755. terrainShadows?: ShadowMode;
  43756. mapMode2D?: MapMode2D;
  43757. projectionPicker?: boolean;
  43758. requestRenderMode?: boolean;
  43759. maximumRenderTimeChange?: number;
  43760. depthPlaneEllipsoidOffset?: number;
  43761. msaaSamples?: number;
  43762. };
  43763. /**
  43764. * A function that augments a Viewer instance with additional functionality.
  43765. * @param viewer - The viewer instance.
  43766. * @param options - Options object to be passed to the mixin function.
  43767. */
  43768. type ViewerMixin = (viewer: Viewer, options: any) => void;
  43769. }
  43770. /**
  43771. * A base widget for building applications. It composites all of the standard Cesium widgets into one reusable package.
  43772. * The widget can always be extended by using mixins, which add functionality useful for a variety of applications.
  43773. * @example
  43774. * //Initialize the viewer widget with several custom options and mixins.
  43775. * const viewer = new Cesium.Viewer('cesiumContainer', {
  43776. * //Start in Columbus Viewer
  43777. * sceneMode : Cesium.SceneMode.COLUMBUS_VIEW,
  43778. * //Use Cesium World Terrain
  43779. * terrainProvider : Cesium.createWorldTerrain(),
  43780. * //Hide the base layer picker
  43781. * baseLayerPicker : false,
  43782. * //Use OpenStreetMaps
  43783. * imageryProvider : new Cesium.OpenStreetMapImageryProvider({
  43784. * url : 'https://a.tile.openstreetmap.org/'
  43785. * }),
  43786. * skyBox : new Cesium.SkyBox({
  43787. * sources : {
  43788. * positiveX : 'stars/TychoSkymapII.t3_08192x04096_80_px.jpg',
  43789. * negativeX : 'stars/TychoSkymapII.t3_08192x04096_80_mx.jpg',
  43790. * positiveY : 'stars/TychoSkymapII.t3_08192x04096_80_py.jpg',
  43791. * negativeY : 'stars/TychoSkymapII.t3_08192x04096_80_my.jpg',
  43792. * positiveZ : 'stars/TychoSkymapII.t3_08192x04096_80_pz.jpg',
  43793. * negativeZ : 'stars/TychoSkymapII.t3_08192x04096_80_mz.jpg'
  43794. * }
  43795. * }),
  43796. * // Show Columbus View map with Web Mercator projection
  43797. * mapProjection : new Cesium.WebMercatorProjection()
  43798. * });
  43799. *
  43800. * //Add basic drag and drop functionality
  43801. * viewer.extend(Cesium.viewerDragDropMixin);
  43802. *
  43803. * //Show a pop-up alert if we encounter an error when processing a dropped file
  43804. * viewer.dropError.addEventListener(function(dropHandler, name, error) {
  43805. * console.log(error);
  43806. * window.alert(error);
  43807. * });
  43808. * @param container - The DOM element or ID that will contain the widget.
  43809. * @param [options] - Object describing initialization options
  43810. */
  43811. export class Viewer {
  43812. constructor(container: Element | string, options?: Viewer.ConstructorOptions);
  43813. /**
  43814. * Gets the parent container.
  43815. */
  43816. readonly container: Element;
  43817. /**
  43818. * Gets the DOM element for the area at the bottom of the window containing the
  43819. * {@link CreditDisplay} and potentially other things.
  43820. */
  43821. readonly bottomContainer: Element;
  43822. /**
  43823. * Gets the CesiumWidget.
  43824. */
  43825. readonly cesiumWidget: CesiumWidget;
  43826. /**
  43827. * Gets the selection indicator.
  43828. */
  43829. readonly selectionIndicator: SelectionIndicator;
  43830. /**
  43831. * Gets the info box.
  43832. */
  43833. readonly infoBox: InfoBox;
  43834. /**
  43835. * Gets the Geocoder.
  43836. */
  43837. readonly geocoder: Geocoder;
  43838. /**
  43839. * Gets the HomeButton.
  43840. */
  43841. readonly homeButton: HomeButton;
  43842. /**
  43843. * Gets the SceneModePicker.
  43844. */
  43845. readonly sceneModePicker: SceneModePicker;
  43846. /**
  43847. * Gets the ProjectionPicker.
  43848. */
  43849. readonly projectionPicker: ProjectionPicker;
  43850. /**
  43851. * Gets the BaseLayerPicker.
  43852. */
  43853. readonly baseLayerPicker: BaseLayerPicker;
  43854. /**
  43855. * Gets the NavigationHelpButton.
  43856. */
  43857. readonly navigationHelpButton: NavigationHelpButton;
  43858. /**
  43859. * Gets the Animation widget.
  43860. */
  43861. readonly animation: Animation;
  43862. /**
  43863. * Gets the Timeline widget.
  43864. */
  43865. readonly timeline: Timeline;
  43866. /**
  43867. * Gets the FullscreenButton.
  43868. */
  43869. readonly fullscreenButton: FullscreenButton;
  43870. /**
  43871. * Gets the VRButton.
  43872. */
  43873. readonly vrButton: VRButton;
  43874. /**
  43875. * Gets the display used for {@link DataSource} visualization.
  43876. */
  43877. readonly dataSourceDisplay: DataSourceDisplay;
  43878. /**
  43879. * Gets the collection of entities not tied to a particular data source.
  43880. * This is a shortcut to [dataSourceDisplay.defaultDataSource.entities]{@link Viewer#dataSourceDisplay}.
  43881. */
  43882. readonly entities: EntityCollection;
  43883. /**
  43884. * Gets the set of {@link DataSource} instances to be visualized.
  43885. */
  43886. readonly dataSources: DataSourceCollection;
  43887. /**
  43888. * Gets the canvas.
  43889. */
  43890. readonly canvas: HTMLCanvasElement;
  43891. /**
  43892. * Gets the scene.
  43893. */
  43894. readonly scene: Scene;
  43895. /**
  43896. * Determines if shadows are cast by light sources.
  43897. */
  43898. shadows: boolean;
  43899. /**
  43900. * Determines if the terrain casts or shadows from light sources.
  43901. */
  43902. terrainShadows: ShadowMode;
  43903. /**
  43904. * Get the scene's shadow map
  43905. */
  43906. readonly shadowMap: ShadowMap;
  43907. /**
  43908. * Gets the collection of image layers that will be rendered on the globe.
  43909. */
  43910. readonly imageryLayers: ImageryLayerCollection;
  43911. /**
  43912. * The terrain provider providing surface geometry for the globe.
  43913. */
  43914. terrainProvider: TerrainProvider;
  43915. /**
  43916. * Gets the camera.
  43917. */
  43918. readonly camera: Camera;
  43919. /**
  43920. * Gets the post-process stages.
  43921. */
  43922. readonly postProcessStages: PostProcessStageCollection;
  43923. /**
  43924. * Gets the clock.
  43925. */
  43926. readonly clock: Clock;
  43927. /**
  43928. * Gets the clock view model.
  43929. */
  43930. readonly clockViewModel: ClockViewModel;
  43931. /**
  43932. * Gets the screen space event handler.
  43933. */
  43934. readonly screenSpaceEventHandler: ScreenSpaceEventHandler;
  43935. /**
  43936. * Gets or sets the target frame rate of the widget when <code>useDefaultRenderLoop</code>
  43937. * is true. If undefined, the browser's {@link requestAnimationFrame} implementation
  43938. * determines the frame rate. If defined, this value must be greater than 0. A value higher
  43939. * than the underlying requestAnimationFrame implementation will have no effect.
  43940. */
  43941. targetFrameRate: number;
  43942. /**
  43943. * Gets or sets whether or not this widget should control the render loop.
  43944. * If set to true the widget will use {@link requestAnimationFrame} to
  43945. * perform rendering and resizing of the widget, as well as drive the
  43946. * simulation clock. If set to false, you must manually call the
  43947. * <code>resize</code>, <code>render</code> methods
  43948. * as part of a custom render loop. If an error occurs during rendering, {@link Scene}'s
  43949. * <code>renderError</code> event will be raised and this property
  43950. * will be set to false. It must be set back to true to continue rendering
  43951. * after the error.
  43952. */
  43953. useDefaultRenderLoop: boolean;
  43954. /**
  43955. * Gets or sets a scaling factor for rendering resolution. Values less than 1.0 can improve
  43956. * performance on less powerful devices while values greater than 1.0 will render at a higher
  43957. * resolution and then scale down, resulting in improved visual fidelity.
  43958. * For example, if the widget is laid out at a size of 640x480, setting this value to 0.5
  43959. * will cause the scene to be rendered at 320x240 and then scaled up while setting
  43960. * it to 2.0 will cause the scene to be rendered at 1280x960 and then scaled down.
  43961. */
  43962. resolutionScale: number;
  43963. /**
  43964. * Boolean flag indicating if the browser's recommended resolution is used.
  43965. * If true, the browser's device pixel ratio is ignored and 1.0 is used instead,
  43966. * effectively rendering based on CSS pixels instead of device pixels. This can improve
  43967. * performance on less powerful devices that have high pixel density. When false, rendering
  43968. * will be in device pixels. {@link Viewer#resolutionScale} will still take effect whether
  43969. * this flag is true or false.
  43970. */
  43971. useBrowserRecommendedResolution: boolean;
  43972. /**
  43973. * Gets or sets whether or not data sources can temporarily pause
  43974. * animation in order to avoid showing an incomplete picture to the user.
  43975. * For example, if asynchronous primitives are being processed in the
  43976. * background, the clock will not advance until the geometry is ready.
  43977. */
  43978. allowDataSourcesToSuspendAnimation: boolean;
  43979. /**
  43980. * Gets or sets the Entity instance currently being tracked by the camera.
  43981. */
  43982. trackedEntity: Entity | undefined;
  43983. /**
  43984. * Gets or sets the object instance for which to display a selection indicator.
  43985. *
  43986. * If a user interactively picks a Cesium3DTilesFeature instance, then this property
  43987. * will contain a transient Entity instance with a property named "feature" that is
  43988. * the instance that was picked.
  43989. */
  43990. selectedEntity: Entity | undefined;
  43991. /**
  43992. * Gets the event that is raised when the selected entity changes.
  43993. */
  43994. readonly selectedEntityChanged: Event;
  43995. /**
  43996. * Gets the event that is raised when the tracked entity changes.
  43997. */
  43998. readonly trackedEntityChanged: Event;
  43999. /**
  44000. * Gets or sets the data source to track with the viewer's clock.
  44001. */
  44002. clockTrackedDataSource: DataSource;
  44003. /**
  44004. * Extends the base viewer functionality with the provided mixin.
  44005. * A mixin may add additional properties, functions, or other behavior
  44006. * to the provided viewer instance.
  44007. * @param mixin - The Viewer mixin to add to this instance.
  44008. * @param [options] - The options object to be passed to the mixin function.
  44009. */
  44010. extend(mixin: Viewer.ViewerMixin, options?: any): void;
  44011. /**
  44012. * Resizes the widget to match the container size.
  44013. * This function is called automatically as needed unless
  44014. * <code>useDefaultRenderLoop</code> is set to false.
  44015. */
  44016. resize(): void;
  44017. /**
  44018. * This forces the widget to re-think its layout, including
  44019. * widget sizes and credit placement.
  44020. */
  44021. forceResize(): void;
  44022. /**
  44023. * Renders the scene. This function is called automatically
  44024. * unless <code>useDefaultRenderLoop</code> is set to false;
  44025. */
  44026. render(): void;
  44027. /**
  44028. * @returns true if the object has been destroyed, false otherwise.
  44029. */
  44030. isDestroyed(): boolean;
  44031. /**
  44032. * Destroys the widget. Should be called if permanently
  44033. * removing the widget from layout.
  44034. */
  44035. destroy(): void;
  44036. /**
  44037. * Asynchronously sets the camera to view the provided entity, entities, or data source.
  44038. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  44039. * this method waits for the data to be ready before performing the zoom.
  44040. *
  44041. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  44042. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  44043. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  44044. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  44045. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  44046. *
  44047. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  44048. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  44049. * determined from the offset, the heading will be north.</p>
  44050. * @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.
  44051. * @param [offset] - The offset from the center of the entity in the local east-north-up reference frame.
  44052. * @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.
  44053. */
  44054. zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, offset?: HeadingPitchRange): Promise<boolean>;
  44055. /**
  44056. * Flies the camera to the provided entity, entities, or data source.
  44057. * If the data source is still in the process of loading or the visualization is otherwise still loading,
  44058. * this method waits for the data to be ready before performing the flight.
  44059. *
  44060. * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
  44061. * The heading and the pitch angles are defined in the local east-north-up reference frame.
  44062. * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
  44063. * angles are above the plane. Negative pitch angles are below the plane. The range is the distance from the center. If the range is
  44064. * zero, a range will be computed such that the whole bounding sphere is visible.</p>
  44065. *
  44066. * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
  44067. * target will be the range. The heading will be determined from the offset. If the heading cannot be
  44068. * determined from the offset, the heading will be north.</p>
  44069. * @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.
  44070. * @param [options] - Object with the following properties:
  44071. * @param [options.duration = 3.0] - The duration of the flight in seconds.
  44072. * @param [options.maximumHeight] - The maximum height at the peak of the flight.
  44073. * @param [options.offset] - The offset from the target in the local east-north-up reference frame centered at the target.
  44074. * @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
  44075. */
  44076. flyTo(target: Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud | Promise<Entity | Entity[] | EntityCollection | DataSource | ImageryLayer | Cesium3DTileset | TimeDynamicPointCloud>, options?: {
  44077. duration?: number;
  44078. maximumHeight?: number;
  44079. offset?: HeadingPitchRange;
  44080. }): Promise<boolean>;
  44081. }
  44082. /**
  44083. * A mixin which adds the {@link Cesium3DTilesInspector} widget to the {@link Viewer} widget.
  44084. * Rather than being called directly, this function is normally passed as
  44085. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44086. * @example
  44087. * const viewer = new Cesium.Viewer('cesiumContainer');
  44088. * viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
  44089. * @param viewer - The viewer instance.
  44090. */
  44091. export function viewerCesium3DTilesInspectorMixin(viewer: Viewer): void;
  44092. /**
  44093. * A mixin which adds the CesiumInspector widget to the Viewer widget.
  44094. * Rather than being called directly, this function is normally passed as
  44095. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44096. * @example
  44097. * const viewer = new Cesium.Viewer('cesiumContainer');
  44098. * viewer.extend(Cesium.viewerCesiumInspectorMixin);
  44099. * @param viewer - The viewer instance.
  44100. */
  44101. export function viewerCesiumInspectorMixin(viewer: Viewer): void;
  44102. /**
  44103. * A mixin which adds default drag and drop support for CZML files to the Viewer widget.
  44104. * Rather than being called directly, this function is normally passed as
  44105. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44106. * @example
  44107. * // Add basic drag and drop support and pop up an alert window on error.
  44108. * const viewer = new Cesium.Viewer('cesiumContainer');
  44109. * viewer.extend(Cesium.viewerDragDropMixin);
  44110. * viewer.dropError.addEventListener(function(viewerArg, source, error) {
  44111. * window.alert('Error processing ' + source + ':' + error);
  44112. * });
  44113. * @param viewer - The viewer instance.
  44114. * @param [options] - Object with the following properties:
  44115. * @param [options.dropTarget = viewer.container] - The DOM element which will serve as the drop target.
  44116. * @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.
  44117. * @param [options.flyToOnDrop = true] - When true, dropping files will fly to the data source once it is loaded.
  44118. * @param [options.clampToGround = true] - When true, datasources are clamped to the ground.
  44119. * @param [options.proxy] - The proxy to be used for KML network links.
  44120. */
  44121. export function viewerDragDropMixin(viewer: Viewer, options?: {
  44122. dropTarget?: Element | string;
  44123. clearOnDrop?: boolean;
  44124. flyToOnDrop?: boolean;
  44125. clampToGround?: boolean;
  44126. proxy?: Proxy;
  44127. }): void;
  44128. /**
  44129. * A mixin which adds the {@link PerformanceWatchdog} widget to the {@link Viewer} widget.
  44130. * Rather than being called directly, this function is normally passed as
  44131. * a parameter to {@link Viewer#extend}, as shown in the example below.
  44132. * @example
  44133. * const viewer = new Cesium.Viewer('cesiumContainer');
  44134. * viewer.extend(Cesium.viewerPerformanceWatchdogMixin, {
  44135. * lowFrameRateMessage : 'Why is this going so <em>slowly</em>?'
  44136. * });
  44137. * @param viewer - The viewer instance.
  44138. * @param [options] - An object with properties.
  44139. * @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
  44140. * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure
  44141. * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks.
  44142. */
  44143. export function viewerPerformanceWatchdogMixin(viewer: Viewer, options?: {
  44144. lowFrameRateMessage?: string;
  44145. }): void;
  44146. /**
  44147. * Create a Command from a given function, for use with ViewModels.
  44148. *
  44149. * A Command is a function with an extra <code>canExecute</code> observable property to determine
  44150. * whether the command can be executed. When executed, a Command function will check the
  44151. * value of <code>canExecute</code> and throw if false. It also provides events for when
  44152. * a command has been or is about to be executed.
  44153. * @param func - The function to execute.
  44154. * @param [canExecute = true] - A boolean indicating whether the function can currently be executed.
  44155. */
  44156. export function createCommand(func: (...params: any[]) => any, canExecute?: boolean): void;
  44157. }
  44158. declare module "cesium/Source/Core/ArcGISTiledElevationTerrainProvider" { import { ArcGISTiledElevationTerrainProvider } from 'cesium'; export default ArcGISTiledElevationTerrainProvider; }
  44159. declare module "cesium/Source/Core/AssociativeArray" { import { AssociativeArray } from 'cesium'; export default AssociativeArray; }
  44160. declare module "cesium/Source/Core/AxisAlignedBoundingBox" { import { AxisAlignedBoundingBox } from 'cesium'; export default AxisAlignedBoundingBox; }
  44161. declare module "cesium/Source/Core/BingMapsGeocoderService" { import { BingMapsGeocoderService } from 'cesium'; export default BingMapsGeocoderService; }
  44162. declare module "cesium/Source/Core/BoundingRectangle" { import { BoundingRectangle } from 'cesium'; export default BoundingRectangle; }
  44163. declare module "cesium/Source/Core/BoundingSphere" { import { BoundingSphere } from 'cesium'; export default BoundingSphere; }
  44164. declare module "cesium/Source/Core/BoxGeometry" { import { BoxGeometry } from 'cesium'; export default BoxGeometry; }
  44165. declare module "cesium/Source/Core/BoxOutlineGeometry" { import { BoxOutlineGeometry } from 'cesium'; export default BoxOutlineGeometry; }
  44166. declare module "cesium/Source/Core/Cartesian2" { import { Cartesian2 } from 'cesium'; export default Cartesian2; }
  44167. declare module "cesium/Source/Core/Cartesian3" { import { Cartesian3 } from 'cesium'; export default Cartesian3; }
  44168. declare module "cesium/Source/Core/Cartesian4" { import { Cartesian4 } from 'cesium'; export default Cartesian4; }
  44169. declare module "cesium/Source/Core/Cartographic" { import { Cartographic } from 'cesium'; export default Cartographic; }
  44170. declare module "cesium/Source/Core/CartographicGeocoderService" { import { CartographicGeocoderService } from 'cesium'; export default CartographicGeocoderService; }
  44171. declare module "cesium/Source/Core/CatmullRomSpline" { import { CatmullRomSpline } from 'cesium'; export default CatmullRomSpline; }
  44172. declare module "cesium/Source/Core/CesiumTerrainProvider" { import { CesiumTerrainProvider } from 'cesium'; export default CesiumTerrainProvider; }
  44173. declare module "cesium/Source/Core/CircleGeometry" { import { CircleGeometry } from 'cesium'; export default CircleGeometry; }
  44174. declare module "cesium/Source/Core/CircleOutlineGeometry" { import { CircleOutlineGeometry } from 'cesium'; export default CircleOutlineGeometry; }
  44175. declare module "cesium/Source/Core/Clock" { import { Clock } from 'cesium'; export default Clock; }
  44176. declare module "cesium/Source/Core/Color" { import { Color } from 'cesium'; export default Color; }
  44177. declare module "cesium/Source/Core/ColorGeometryInstanceAttribute" { import { ColorGeometryInstanceAttribute } from 'cesium'; export default ColorGeometryInstanceAttribute; }
  44178. declare module "cesium/Source/Core/CompressedTextureBuffer" { import { CompressedTextureBuffer } from 'cesium'; export default CompressedTextureBuffer; }
  44179. declare module "cesium/Source/Core/ConstantSpline" { import { ConstantSpline } from 'cesium'; export default ConstantSpline; }
  44180. declare module "cesium/Source/Core/CoplanarPolygonGeometry" { import { CoplanarPolygonGeometry } from 'cesium'; export default CoplanarPolygonGeometry; }
  44181. declare module "cesium/Source/Core/CoplanarPolygonOutlineGeometry" { import { CoplanarPolygonOutlineGeometry } from 'cesium'; export default CoplanarPolygonOutlineGeometry; }
  44182. declare module "cesium/Source/Core/CorridorGeometry" { import { CorridorGeometry } from 'cesium'; export default CorridorGeometry; }
  44183. declare module "cesium/Source/Core/CorridorOutlineGeometry" { import { CorridorOutlineGeometry } from 'cesium'; export default CorridorOutlineGeometry; }
  44184. declare module "cesium/Source/Core/Credit" { import { Credit } from 'cesium'; export default Credit; }
  44185. declare module "cesium/Source/Core/CubicRealPolynomial" { import { CubicRealPolynomial } from 'cesium'; export default CubicRealPolynomial; }
  44186. declare module "cesium/Source/Core/CullingVolume" { import { CullingVolume } from 'cesium'; export default CullingVolume; }
  44187. declare module "cesium/Source/Core/CustomHeightmapTerrainProvider" { import { CustomHeightmapTerrainProvider } from 'cesium'; export default CustomHeightmapTerrainProvider; }
  44188. declare module "cesium/Source/Core/CylinderGeometry" { import { CylinderGeometry } from 'cesium'; export default CylinderGeometry; }
  44189. declare module "cesium/Source/Core/CylinderOutlineGeometry" { import { CylinderOutlineGeometry } from 'cesium'; export default CylinderOutlineGeometry; }
  44190. declare module "cesium/Source/Core/DefaultProxy" { import { DefaultProxy } from 'cesium'; export default DefaultProxy; }
  44191. declare module "cesium/Source/Core/DeveloperError" { import { DeveloperError } from 'cesium'; export default DeveloperError; }
  44192. declare module "cesium/Source/Core/DistanceDisplayCondition" { import { DistanceDisplayCondition } from 'cesium'; export default DistanceDisplayCondition; }
  44193. declare module "cesium/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute" { import { DistanceDisplayConditionGeometryInstanceAttribute } from 'cesium'; export default DistanceDisplayConditionGeometryInstanceAttribute; }
  44194. declare module "cesium/Source/Core/EasingFunction" { import { EasingFunction } from 'cesium'; export default EasingFunction; }
  44195. declare module "cesium/Source/Core/EllipseGeometry" { import { EllipseGeometry } from 'cesium'; export default EllipseGeometry; }
  44196. declare module "cesium/Source/Core/EllipseOutlineGeometry" { import { EllipseOutlineGeometry } from 'cesium'; export default EllipseOutlineGeometry; }
  44197. declare module "cesium/Source/Core/Ellipsoid" { import { Ellipsoid } from 'cesium'; export default Ellipsoid; }
  44198. declare module "cesium/Source/Core/EllipsoidGeodesic" { import { EllipsoidGeodesic } from 'cesium'; export default EllipsoidGeodesic; }
  44199. declare module "cesium/Source/Core/EllipsoidGeometry" { import { EllipsoidGeometry } from 'cesium'; export default EllipsoidGeometry; }
  44200. declare module "cesium/Source/Core/EllipsoidOutlineGeometry" { import { EllipsoidOutlineGeometry } from 'cesium'; export default EllipsoidOutlineGeometry; }
  44201. declare module "cesium/Source/Core/EllipsoidRhumbLine" { import { EllipsoidRhumbLine } from 'cesium'; export default EllipsoidRhumbLine; }
  44202. declare module "cesium/Source/Core/EllipsoidTangentPlane" { import { EllipsoidTangentPlane } from 'cesium'; export default EllipsoidTangentPlane; }
  44203. declare module "cesium/Source/Core/EllipsoidTerrainProvider" { import { EllipsoidTerrainProvider } from 'cesium'; export default EllipsoidTerrainProvider; }
  44204. declare module "cesium/Source/Core/Event" { import { Event } from 'cesium'; export default Event; }
  44205. declare module "cesium/Source/Core/EventHelper" { import { EventHelper } from 'cesium'; export default EventHelper; }
  44206. declare module "cesium/Source/Core/ExperimentalFeatures" { import { ExperimentalFeatures } from 'cesium'; export default ExperimentalFeatures; }
  44207. declare module "cesium/Source/Core/FeatureDetection" { import { FeatureDetection } from 'cesium'; export default FeatureDetection; }
  44208. declare module "cesium/Source/Core/FrustumGeometry" { import { FrustumGeometry } from 'cesium'; export default FrustumGeometry; }
  44209. declare module "cesium/Source/Core/FrustumOutlineGeometry" { import { FrustumOutlineGeometry } from 'cesium'; export default FrustumOutlineGeometry; }
  44210. declare module "cesium/Source/Core/Fullscreen" { import { Fullscreen } from 'cesium'; export default Fullscreen; }
  44211. declare module "cesium/Source/Core/GeocoderService" { import { GeocoderService } from 'cesium'; export default GeocoderService; }
  44212. declare module "cesium/Source/Core/GeographicProjection" { import { GeographicProjection } from 'cesium'; export default GeographicProjection; }
  44213. declare module "cesium/Source/Core/GeographicTilingScheme" { import { GeographicTilingScheme } from 'cesium'; export default GeographicTilingScheme; }
  44214. declare module "cesium/Source/Core/Geometry" { import { Geometry } from 'cesium'; export default Geometry; }
  44215. declare module "cesium/Source/Core/GeometryAttribute" { import { GeometryAttribute } from 'cesium'; export default GeometryAttribute; }
  44216. declare module "cesium/Source/Core/GeometryAttributes" { import { GeometryAttributes } from 'cesium'; export default GeometryAttributes; }
  44217. declare module "cesium/Source/Core/GeometryFactory" { import { GeometryFactory } from 'cesium'; export default GeometryFactory; }
  44218. declare module "cesium/Source/Core/GeometryInstance" { import { GeometryInstance } from 'cesium'; export default GeometryInstance; }
  44219. declare module "cesium/Source/Core/GeometryInstanceAttribute" { import { GeometryInstanceAttribute } from 'cesium'; export default GeometryInstanceAttribute; }
  44220. declare module "cesium/Source/Core/GeometryPipeline" { import { GeometryPipeline } from 'cesium'; export default GeometryPipeline; }
  44221. declare module "cesium/Source/Core/GoogleEarthEnterpriseMetadata" { import { GoogleEarthEnterpriseMetadata } from 'cesium'; export default GoogleEarthEnterpriseMetadata; }
  44222. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainData" { import { GoogleEarthEnterpriseTerrainData } from 'cesium'; export default GoogleEarthEnterpriseTerrainData; }
  44223. declare module "cesium/Source/Core/GoogleEarthEnterpriseTerrainProvider" { import { GoogleEarthEnterpriseTerrainProvider } from 'cesium'; export default GoogleEarthEnterpriseTerrainProvider; }
  44224. declare module "cesium/Source/Core/GregorianDate" { import { GregorianDate } from 'cesium'; export default GregorianDate; }
  44225. declare module "cesium/Source/Core/GroundPolylineGeometry" { import { GroundPolylineGeometry } from 'cesium'; export default GroundPolylineGeometry; }
  44226. declare module "cesium/Source/Core/HeadingPitchRange" { import { HeadingPitchRange } from 'cesium'; export default HeadingPitchRange; }
  44227. declare module "cesium/Source/Core/HeadingPitchRoll" { import { HeadingPitchRoll } from 'cesium'; export default HeadingPitchRoll; }
  44228. declare module "cesium/Source/Core/HeightmapTerrainData" { import { HeightmapTerrainData } from 'cesium'; export default HeightmapTerrainData; }
  44229. declare module "cesium/Source/Core/HermitePolynomialApproximation" { import { HermitePolynomialApproximation } from 'cesium'; export default HermitePolynomialApproximation; }
  44230. declare module "cesium/Source/Core/HermiteSpline" { import { HermiteSpline } from 'cesium'; export default HermiteSpline; }
  44231. declare module "cesium/Source/Core/HilbertOrder" { import { HilbertOrder } from 'cesium'; export default HilbertOrder; }
  44232. declare module "cesium/Source/Core/InterpolationAlgorithm" { import { InterpolationAlgorithm } from 'cesium'; export default InterpolationAlgorithm; }
  44233. declare module "cesium/Source/Core/IntersectionTests" { import { IntersectionTests } from 'cesium'; export default IntersectionTests; }
  44234. declare module "cesium/Source/Core/Intersections2D" { import { Intersections2D } from 'cesium'; export default Intersections2D; }
  44235. declare module "cesium/Source/Core/Interval" { import { Interval } from 'cesium'; export default Interval; }
  44236. declare module "cesium/Source/Core/Ion" { import { Ion } from 'cesium'; export default Ion; }
  44237. declare module "cesium/Source/Core/IonGeocoderService" { import { IonGeocoderService } from 'cesium'; export default IonGeocoderService; }
  44238. declare module "cesium/Source/Core/IonResource" { import { IonResource } from 'cesium'; export default IonResource; }
  44239. declare module "cesium/Source/Core/Iso8601" { import { Iso8601 } from 'cesium'; export default Iso8601; }
  44240. declare module "cesium/Source/Core/JulianDate" { import { JulianDate } from 'cesium'; export default JulianDate; }
  44241. declare module "cesium/Source/Core/LagrangePolynomialApproximation" { import { LagrangePolynomialApproximation } from 'cesium'; export default LagrangePolynomialApproximation; }
  44242. declare module "cesium/Source/Core/LeapSecond" { import { LeapSecond } from 'cesium'; export default LeapSecond; }
  44243. declare module "cesium/Source/Core/LinearApproximation" { import { LinearApproximation } from 'cesium'; export default LinearApproximation; }
  44244. declare module "cesium/Source/Core/LinearSpline" { import { LinearSpline } from 'cesium'; export default LinearSpline; }
  44245. declare module "cesium/Source/Core/MapProjection" { import { MapProjection } from 'cesium'; export default MapProjection; }
  44246. declare module "cesium/Source/Core/Math" { import { Math } from 'cesium'; export default Math; }
  44247. declare module "cesium/Source/Core/Matrix2" { import { Matrix2 } from 'cesium'; export default Matrix2; }
  44248. declare module "cesium/Source/Core/Matrix3" { import { Matrix3 } from 'cesium'; export default Matrix3; }
  44249. declare module "cesium/Source/Core/Matrix4" { import { Matrix4 } from 'cesium'; export default Matrix4; }
  44250. declare module "cesium/Source/Core/MorphWeightSpline" { import { MorphWeightSpline } from 'cesium'; export default MorphWeightSpline; }
  44251. declare module "cesium/Source/Core/NearFarScalar" { import { NearFarScalar } from 'cesium'; export default NearFarScalar; }
  44252. declare module "cesium/Source/Core/Occluder" { import { Occluder } from 'cesium'; export default Occluder; }
  44253. declare module "cesium/Source/Core/OpenCageGeocoderService" { import { OpenCageGeocoderService } from 'cesium'; export default OpenCageGeocoderService; }
  44254. declare module "cesium/Source/Core/OrientedBoundingBox" { import { OrientedBoundingBox } from 'cesium'; export default OrientedBoundingBox; }
  44255. declare module "cesium/Source/Core/OrthographicFrustum" { import { OrthographicFrustum } from 'cesium'; export default OrthographicFrustum; }
  44256. declare module "cesium/Source/Core/OrthographicOffCenterFrustum" { import { OrthographicOffCenterFrustum } from 'cesium'; export default OrthographicOffCenterFrustum; }
  44257. declare module "cesium/Source/Core/Packable" { import { Packable } from 'cesium'; export default Packable; }
  44258. declare module "cesium/Source/Core/PackableForInterpolation" { import { PackableForInterpolation } from 'cesium'; export default PackableForInterpolation; }
  44259. declare module "cesium/Source/Core/PeliasGeocoderService" { import { PeliasGeocoderService } from 'cesium'; export default PeliasGeocoderService; }
  44260. declare module "cesium/Source/Core/PerspectiveFrustum" { import { PerspectiveFrustum } from 'cesium'; export default PerspectiveFrustum; }
  44261. declare module "cesium/Source/Core/PerspectiveOffCenterFrustum" { import { PerspectiveOffCenterFrustum } from 'cesium'; export default PerspectiveOffCenterFrustum; }
  44262. declare module "cesium/Source/Core/PinBuilder" { import { PinBuilder } from 'cesium'; export default PinBuilder; }
  44263. declare module "cesium/Source/Core/Plane" { import { Plane } from 'cesium'; export default Plane; }
  44264. declare module "cesium/Source/Core/PlaneGeometry" { import { PlaneGeometry } from 'cesium'; export default PlaneGeometry; }
  44265. declare module "cesium/Source/Core/PlaneOutlineGeometry" { import { PlaneOutlineGeometry } from 'cesium'; export default PlaneOutlineGeometry; }
  44266. declare module "cesium/Source/Core/PolygonGeometry" { import { PolygonGeometry } from 'cesium'; export default PolygonGeometry; }
  44267. declare module "cesium/Source/Core/PolygonHierarchy" { import { PolygonHierarchy } from 'cesium'; export default PolygonHierarchy; }
  44268. declare module "cesium/Source/Core/PolygonOutlineGeometry" { import { PolygonOutlineGeometry } from 'cesium'; export default PolygonOutlineGeometry; }
  44269. declare module "cesium/Source/Core/PolylineGeometry" { import { PolylineGeometry } from 'cesium'; export default PolylineGeometry; }
  44270. declare module "cesium/Source/Core/PolylineVolumeGeometry" { import { PolylineVolumeGeometry } from 'cesium'; export default PolylineVolumeGeometry; }
  44271. declare module "cesium/Source/Core/PolylineVolumeOutlineGeometry" { import { PolylineVolumeOutlineGeometry } from 'cesium'; export default PolylineVolumeOutlineGeometry; }
  44272. declare module "cesium/Source/Core/Proxy" { import { Proxy } from 'cesium'; export default Proxy; }
  44273. declare module "cesium/Source/Core/QuadraticRealPolynomial" { import { QuadraticRealPolynomial } from 'cesium'; export default QuadraticRealPolynomial; }
  44274. declare module "cesium/Source/Core/QuantizedMeshTerrainData" { import { QuantizedMeshTerrainData } from 'cesium'; export default QuantizedMeshTerrainData; }
  44275. declare module "cesium/Source/Core/QuarticRealPolynomial" { import { QuarticRealPolynomial } from 'cesium'; export default QuarticRealPolynomial; }
  44276. declare module "cesium/Source/Core/Quaternion" { import { Quaternion } from 'cesium'; export default Quaternion; }
  44277. declare module "cesium/Source/Core/QuaternionSpline" { import { QuaternionSpline } from 'cesium'; export default QuaternionSpline; }
  44278. declare module "cesium/Source/Core/Queue" { import { Queue } from 'cesium'; export default Queue; }
  44279. declare module "cesium/Source/Core/Ray" { import { Ray } from 'cesium'; export default Ray; }
  44280. declare module "cesium/Source/Core/Rectangle" { import { Rectangle } from 'cesium'; export default Rectangle; }
  44281. declare module "cesium/Source/Core/RectangleGeometry" { import { RectangleGeometry } from 'cesium'; export default RectangleGeometry; }
  44282. declare module "cesium/Source/Core/RectangleOutlineGeometry" { import { RectangleOutlineGeometry } from 'cesium'; export default RectangleOutlineGeometry; }
  44283. declare module "cesium/Source/Core/Request" { import { Request } from 'cesium'; export default Request; }
  44284. declare module "cesium/Source/Core/RequestErrorEvent" { import { RequestErrorEvent } from 'cesium'; export default RequestErrorEvent; }
  44285. declare module "cesium/Source/Core/RequestScheduler" { import { RequestScheduler } from 'cesium'; export default RequestScheduler; }
  44286. declare module "cesium/Source/Core/Resource" { import { Resource } from 'cesium'; export default Resource; }
  44287. declare module "cesium/Source/Core/RuntimeError" { import { RuntimeError } from 'cesium'; export default RuntimeError; }
  44288. declare module "cesium/Source/Core/ScreenSpaceEventHandler" { import { ScreenSpaceEventHandler } from 'cesium'; export default ScreenSpaceEventHandler; }
  44289. declare module "cesium/Source/Core/ShowGeometryInstanceAttribute" { import { ShowGeometryInstanceAttribute } from 'cesium'; export default ShowGeometryInstanceAttribute; }
  44290. declare module "cesium/Source/Core/Simon1994PlanetaryPositions" { import { Simon1994PlanetaryPositions } from 'cesium'; export default Simon1994PlanetaryPositions; }
  44291. declare module "cesium/Source/Core/SimplePolylineGeometry" { import { SimplePolylineGeometry } from 'cesium'; export default SimplePolylineGeometry; }
  44292. declare module "cesium/Source/Core/SphereGeometry" { import { SphereGeometry } from 'cesium'; export default SphereGeometry; }
  44293. declare module "cesium/Source/Core/SphereOutlineGeometry" { import { SphereOutlineGeometry } from 'cesium'; export default SphereOutlineGeometry; }
  44294. declare module "cesium/Source/Core/Spherical" { import { Spherical } from 'cesium'; export default Spherical; }
  44295. declare module "cesium/Source/Core/Spline" { import { Spline } from 'cesium'; export default Spline; }
  44296. declare module "cesium/Source/Core/SteppedSpline" { import { SteppedSpline } from 'cesium'; export default SteppedSpline; }
  44297. declare module "cesium/Source/Core/TaskProcessor" { import { TaskProcessor } from 'cesium'; export default TaskProcessor; }
  44298. declare module "cesium/Source/Core/TerrainData" { import { TerrainData } from 'cesium'; export default TerrainData; }
  44299. declare module "cesium/Source/Core/TerrainProvider" { import { TerrainProvider } from 'cesium'; export default TerrainProvider; }
  44300. declare module "cesium/Source/Core/TileAvailability" { import { TileAvailability } from 'cesium'; export default TileAvailability; }
  44301. declare module "cesium/Source/Core/TileProviderError" { import { TileProviderError } from 'cesium'; export default TileProviderError; }
  44302. declare module "cesium/Source/Core/TilingScheme" { import { TilingScheme } from 'cesium'; export default TilingScheme; }
  44303. declare module "cesium/Source/Core/TimeInterval" { import { TimeInterval } from 'cesium'; export default TimeInterval; }
  44304. declare module "cesium/Source/Core/TimeIntervalCollection" { import { TimeIntervalCollection } from 'cesium'; export default TimeIntervalCollection; }
  44305. declare module "cesium/Source/Core/Transforms" { import { Transforms } from 'cesium'; export default Transforms; }
  44306. declare module "cesium/Source/Core/TranslationRotationScale" { import { TranslationRotationScale } from 'cesium'; export default TranslationRotationScale; }
  44307. declare module "cesium/Source/Core/TridiagonalSystemSolver" { import { TridiagonalSystemSolver } from 'cesium'; export default TridiagonalSystemSolver; }
  44308. declare module "cesium/Source/Core/TrustedServers" { import { TrustedServers } from 'cesium'; export default TrustedServers; }
  44309. declare module "cesium/Source/Core/VRTheWorldTerrainProvider" { import { VRTheWorldTerrainProvider } from 'cesium'; export default VRTheWorldTerrainProvider; }
  44310. declare module "cesium/Source/Core/VertexFormat" { import { VertexFormat } from 'cesium'; export default VertexFormat; }
  44311. declare module "cesium/Source/Core/VideoSynchronizer" { import { VideoSynchronizer } from 'cesium'; export default VideoSynchronizer; }
  44312. declare module "cesium/Source/Core/WallGeometry" { import { WallGeometry } from 'cesium'; export default WallGeometry; }
  44313. declare module "cesium/Source/Core/WallOutlineGeometry" { import { WallOutlineGeometry } from 'cesium'; export default WallOutlineGeometry; }
  44314. declare module "cesium/Source/Core/WebMercatorProjection" { import { WebMercatorProjection } from 'cesium'; export default WebMercatorProjection; }
  44315. declare module "cesium/Source/Core/WebMercatorTilingScheme" { import { WebMercatorTilingScheme } from 'cesium'; export default WebMercatorTilingScheme; }
  44316. declare module "cesium/Source/Core/barycentricCoordinates" { import { barycentricCoordinates } from 'cesium'; export default barycentricCoordinates; }
  44317. declare module "cesium/Source/Core/binarySearch" { import { binarySearch } from 'cesium'; export default binarySearch; }
  44318. declare module "cesium/Source/Core/buildModuleUrl" { import { buildModuleUrl } from 'cesium'; export default buildModuleUrl; }
  44319. declare module "cesium/Source/Core/cancelAnimationFrame" { import { cancelAnimationFrame } from 'cesium'; export default cancelAnimationFrame; }
  44320. declare module "cesium/Source/Core/clone" { import { clone } from 'cesium'; export default clone; }
  44321. declare module "cesium/Source/Core/combine" { import { combine } from 'cesium'; export default combine; }
  44322. declare module "cesium/Source/Core/createGuid" { import { createGuid } from 'cesium'; export default createGuid; }
  44323. declare module "cesium/Source/Core/createWorldTerrain" { import { createWorldTerrain } from 'cesium'; export default createWorldTerrain; }
  44324. declare module "cesium/Source/Core/defaultValue" { import { defaultValue } from 'cesium'; export default defaultValue; }
  44325. declare module "cesium/Source/Core/defined" { import { defined } from 'cesium'; export default defined; }
  44326. declare module "cesium/Source/Core/destroyObject" { import { destroyObject } from 'cesium'; export default destroyObject; }
  44327. declare module "cesium/Source/Core/formatError" { import { formatError } from 'cesium'; export default formatError; }
  44328. declare module "cesium/Source/Core/getAbsoluteUri" { import { getAbsoluteUri } from 'cesium'; export default getAbsoluteUri; }
  44329. declare module "cesium/Source/Core/getBaseUri" { import { getBaseUri } from 'cesium'; export default getBaseUri; }
  44330. declare module "cesium/Source/Core/getExtensionFromUri" { import { getExtensionFromUri } from 'cesium'; export default getExtensionFromUri; }
  44331. declare module "cesium/Source/Core/getFilenameFromUri" { import { getFilenameFromUri } from 'cesium'; export default getFilenameFromUri; }
  44332. declare module "cesium/Source/Core/getImagePixels" { import { getImagePixels } from 'cesium'; export default getImagePixels; }
  44333. declare module "cesium/Source/Core/getTimestamp" { import { getTimestamp } from 'cesium'; export default getTimestamp; }
  44334. declare module "cesium/Source/Core/isLeapYear" { import { isLeapYear } from 'cesium'; export default isLeapYear; }
  44335. declare module "cesium/Source/Core/mergeSort" { import { mergeSort } from 'cesium'; export default mergeSort; }
  44336. declare module "cesium/Source/Core/objectToQuery" { import { objectToQuery } from 'cesium'; export default objectToQuery; }
  44337. declare module "cesium/Source/Core/pointInsideTriangle" { import { pointInsideTriangle } from 'cesium'; export default pointInsideTriangle; }
  44338. declare module "cesium/Source/Core/queryToObject" { import { queryToObject } from 'cesium'; export default queryToObject; }
  44339. declare module "cesium/Source/Core/requestAnimationFrame" { import { requestAnimationFrame } from 'cesium'; export default requestAnimationFrame; }
  44340. declare module "cesium/Source/Core/sampleTerrain" { import { sampleTerrain } from 'cesium'; export default sampleTerrain; }
  44341. declare module "cesium/Source/Core/sampleTerrainMostDetailed" { import { sampleTerrainMostDetailed } from 'cesium'; export default sampleTerrainMostDetailed; }
  44342. declare module "cesium/Source/Core/subdivideArray" { import { subdivideArray } from 'cesium'; export default subdivideArray; }
  44343. declare module "cesium/Source/Core/writeTextToCanvas" { import { writeTextToCanvas } from 'cesium'; export default writeTextToCanvas; }
  44344. declare module "cesium/Source/DataSources/BillboardGraphics" { import { BillboardGraphics } from 'cesium'; export default BillboardGraphics; }
  44345. declare module "cesium/Source/DataSources/BillboardVisualizer" { import { BillboardVisualizer } from 'cesium'; export default BillboardVisualizer; }
  44346. declare module "cesium/Source/DataSources/BoxGeometryUpdater" { import { BoxGeometryUpdater } from 'cesium'; export default BoxGeometryUpdater; }
  44347. declare module "cesium/Source/DataSources/BoxGraphics" { import { BoxGraphics } from 'cesium'; export default BoxGraphics; }
  44348. declare module "cesium/Source/DataSources/CallbackProperty" { import { CallbackProperty } from 'cesium'; export default CallbackProperty; }
  44349. declare module "cesium/Source/DataSources/Cesium3DTilesetGraphics" { import { Cesium3DTilesetGraphics } from 'cesium'; export default Cesium3DTilesetGraphics; }
  44350. declare module "cesium/Source/DataSources/Cesium3DTilesetVisualizer" { import { Cesium3DTilesetVisualizer } from 'cesium'; export default Cesium3DTilesetVisualizer; }
  44351. declare module "cesium/Source/DataSources/CheckerboardMaterialProperty" { import { CheckerboardMaterialProperty } from 'cesium'; export default CheckerboardMaterialProperty; }
  44352. declare module "cesium/Source/DataSources/ColorMaterialProperty" { import { ColorMaterialProperty } from 'cesium'; export default ColorMaterialProperty; }
  44353. declare module "cesium/Source/DataSources/CompositeEntityCollection" { import { CompositeEntityCollection } from 'cesium'; export default CompositeEntityCollection; }
  44354. declare module "cesium/Source/DataSources/CompositeMaterialProperty" { import { CompositeMaterialProperty } from 'cesium'; export default CompositeMaterialProperty; }
  44355. declare module "cesium/Source/DataSources/CompositePositionProperty" { import { CompositePositionProperty } from 'cesium'; export default CompositePositionProperty; }
  44356. declare module "cesium/Source/DataSources/CompositeProperty" { import { CompositeProperty } from 'cesium'; export default CompositeProperty; }
  44357. declare module "cesium/Source/DataSources/ConstantPositionProperty" { import { ConstantPositionProperty } from 'cesium'; export default ConstantPositionProperty; }
  44358. declare module "cesium/Source/DataSources/ConstantProperty" { import { ConstantProperty } from 'cesium'; export default ConstantProperty; }
  44359. declare module "cesium/Source/DataSources/CorridorGeometryUpdater" { import { CorridorGeometryUpdater } from 'cesium'; export default CorridorGeometryUpdater; }
  44360. declare module "cesium/Source/DataSources/CorridorGraphics" { import { CorridorGraphics } from 'cesium'; export default CorridorGraphics; }
  44361. declare module "cesium/Source/DataSources/CustomDataSource" { import { CustomDataSource } from 'cesium'; export default CustomDataSource; }
  44362. declare module "cesium/Source/DataSources/CylinderGeometryUpdater" { import { CylinderGeometryUpdater } from 'cesium'; export default CylinderGeometryUpdater; }
  44363. declare module "cesium/Source/DataSources/CylinderGraphics" { import { CylinderGraphics } from 'cesium'; export default CylinderGraphics; }
  44364. declare module "cesium/Source/DataSources/CzmlDataSource" { import { CzmlDataSource } from 'cesium'; export default CzmlDataSource; }
  44365. declare module "cesium/Source/DataSources/DataSource" { import { DataSource } from 'cesium'; export default DataSource; }
  44366. declare module "cesium/Source/DataSources/DataSourceClock" { import { DataSourceClock } from 'cesium'; export default DataSourceClock; }
  44367. declare module "cesium/Source/DataSources/DataSourceCollection" { import { DataSourceCollection } from 'cesium'; export default DataSourceCollection; }
  44368. declare module "cesium/Source/DataSources/DataSourceDisplay" { import { DataSourceDisplay } from 'cesium'; export default DataSourceDisplay; }
  44369. declare module "cesium/Source/DataSources/EllipseGeometryUpdater" { import { EllipseGeometryUpdater } from 'cesium'; export default EllipseGeometryUpdater; }
  44370. declare module "cesium/Source/DataSources/EllipseGraphics" { import { EllipseGraphics } from 'cesium'; export default EllipseGraphics; }
  44371. declare module "cesium/Source/DataSources/EllipsoidGeometryUpdater" { import { EllipsoidGeometryUpdater } from 'cesium'; export default EllipsoidGeometryUpdater; }
  44372. declare module "cesium/Source/DataSources/EllipsoidGraphics" { import { EllipsoidGraphics } from 'cesium'; export default EllipsoidGraphics; }
  44373. declare module "cesium/Source/DataSources/Entity" { import { Entity } from 'cesium'; export default Entity; }
  44374. declare module "cesium/Source/DataSources/EntityCluster" { import { EntityCluster } from 'cesium'; export default EntityCluster; }
  44375. declare module "cesium/Source/DataSources/EntityCollection" { import { EntityCollection } from 'cesium'; export default EntityCollection; }
  44376. declare module "cesium/Source/DataSources/EntityView" { import { EntityView } from 'cesium'; export default EntityView; }
  44377. declare module "cesium/Source/DataSources/GeoJsonDataSource" { import { GeoJsonDataSource } from 'cesium'; export default GeoJsonDataSource; }
  44378. declare module "cesium/Source/DataSources/GeometryUpdater" { import { GeometryUpdater } from 'cesium'; export default GeometryUpdater; }
  44379. declare module "cesium/Source/DataSources/GeometryVisualizer" { import { GeometryVisualizer } from 'cesium'; export default GeometryVisualizer; }
  44380. declare module "cesium/Source/DataSources/GpxDataSource" { import { GpxDataSource } from 'cesium'; export default GpxDataSource; }
  44381. declare module "cesium/Source/DataSources/GridMaterialProperty" { import { GridMaterialProperty } from 'cesium'; export default GridMaterialProperty; }
  44382. declare module "cesium/Source/DataSources/GroundGeometryUpdater" { import { GroundGeometryUpdater } from 'cesium'; export default GroundGeometryUpdater; }
  44383. declare module "cesium/Source/DataSources/ImageMaterialProperty" { import { ImageMaterialProperty } from 'cesium'; export default ImageMaterialProperty; }
  44384. declare module "cesium/Source/DataSources/KmlCamera" { import { KmlCamera } from 'cesium'; export default KmlCamera; }
  44385. declare module "cesium/Source/DataSources/KmlDataSource" { import { KmlDataSource } from 'cesium'; export default KmlDataSource; }
  44386. declare module "cesium/Source/DataSources/KmlLookAt" { import { KmlLookAt } from 'cesium'; export default KmlLookAt; }
  44387. declare module "cesium/Source/DataSources/KmlTour" { import { KmlTour } from 'cesium'; export default KmlTour; }
  44388. declare module "cesium/Source/DataSources/KmlTourFlyTo" { import { KmlTourFlyTo } from 'cesium'; export default KmlTourFlyTo; }
  44389. declare module "cesium/Source/DataSources/KmlTourWait" { import { KmlTourWait } from 'cesium'; export default KmlTourWait; }
  44390. declare module "cesium/Source/DataSources/LabelGraphics" { import { LabelGraphics } from 'cesium'; export default LabelGraphics; }
  44391. declare module "cesium/Source/DataSources/LabelVisualizer" { import { LabelVisualizer } from 'cesium'; export default LabelVisualizer; }
  44392. declare module "cesium/Source/DataSources/MaterialProperty" { import { MaterialProperty } from 'cesium'; export default MaterialProperty; }
  44393. declare module "cesium/Source/DataSources/ModelGraphics" { import { ModelGraphics } from 'cesium'; export default ModelGraphics; }
  44394. declare module "cesium/Source/DataSources/ModelVisualizer" { import { ModelVisualizer } from 'cesium'; export default ModelVisualizer; }
  44395. declare module "cesium/Source/DataSources/NodeTransformationProperty" { import { NodeTransformationProperty } from 'cesium'; export default NodeTransformationProperty; }
  44396. declare module "cesium/Source/DataSources/PathGraphics" { import { PathGraphics } from 'cesium'; export default PathGraphics; }
  44397. declare module "cesium/Source/DataSources/PathVisualizer" { import { PathVisualizer } from 'cesium'; export default PathVisualizer; }
  44398. declare module "cesium/Source/DataSources/PlaneGeometryUpdater" { import { PlaneGeometryUpdater } from 'cesium'; export default PlaneGeometryUpdater; }
  44399. declare module "cesium/Source/DataSources/PlaneGraphics" { import { PlaneGraphics } from 'cesium'; export default PlaneGraphics; }
  44400. declare module "cesium/Source/DataSources/PointGraphics" { import { PointGraphics } from 'cesium'; export default PointGraphics; }
  44401. declare module "cesium/Source/DataSources/PointVisualizer" { import { PointVisualizer } from 'cesium'; export default PointVisualizer; }
  44402. declare module "cesium/Source/DataSources/PolygonGeometryUpdater" { import { PolygonGeometryUpdater } from 'cesium'; export default PolygonGeometryUpdater; }
  44403. declare module "cesium/Source/DataSources/PolygonGraphics" { import { PolygonGraphics } from 'cesium'; export default PolygonGraphics; }
  44404. declare module "cesium/Source/DataSources/PolylineArrowMaterialProperty" { import { PolylineArrowMaterialProperty } from 'cesium'; export default PolylineArrowMaterialProperty; }
  44405. declare module "cesium/Source/DataSources/PolylineDashMaterialProperty" { import { PolylineDashMaterialProperty } from 'cesium'; export default PolylineDashMaterialProperty; }
  44406. declare module "cesium/Source/DataSources/PolylineGeometryUpdater" { import { PolylineGeometryUpdater } from 'cesium'; export default PolylineGeometryUpdater; }
  44407. declare module "cesium/Source/DataSources/PolylineGlowMaterialProperty" { import { PolylineGlowMaterialProperty } from 'cesium'; export default PolylineGlowMaterialProperty; }
  44408. declare module "cesium/Source/DataSources/PolylineGraphics" { import { PolylineGraphics } from 'cesium'; export default PolylineGraphics; }
  44409. declare module "cesium/Source/DataSources/PolylineOutlineMaterialProperty" { import { PolylineOutlineMaterialProperty } from 'cesium'; export default PolylineOutlineMaterialProperty; }
  44410. declare module "cesium/Source/DataSources/PolylineVisualizer" { import { PolylineVisualizer } from 'cesium'; export default PolylineVisualizer; }
  44411. declare module "cesium/Source/DataSources/PolylineVolumeGeometryUpdater" { import { PolylineVolumeGeometryUpdater } from 'cesium'; export default PolylineVolumeGeometryUpdater; }
  44412. declare module "cesium/Source/DataSources/PolylineVolumeGraphics" { import { PolylineVolumeGraphics } from 'cesium'; export default PolylineVolumeGraphics; }
  44413. declare module "cesium/Source/DataSources/PositionProperty" { import { PositionProperty } from 'cesium'; export default PositionProperty; }
  44414. declare module "cesium/Source/DataSources/PositionPropertyArray" { import { PositionPropertyArray } from 'cesium'; export default PositionPropertyArray; }
  44415. declare module "cesium/Source/DataSources/Property" { import { Property } from 'cesium'; export default Property; }
  44416. declare module "cesium/Source/DataSources/PropertyArray" { import { PropertyArray } from 'cesium'; export default PropertyArray; }
  44417. declare module "cesium/Source/DataSources/PropertyBag" { import { PropertyBag } from 'cesium'; export default PropertyBag; }
  44418. declare module "cesium/Source/DataSources/RectangleGeometryUpdater" { import { RectangleGeometryUpdater } from 'cesium'; export default RectangleGeometryUpdater; }
  44419. declare module "cesium/Source/DataSources/RectangleGraphics" { import { RectangleGraphics } from 'cesium'; export default RectangleGraphics; }
  44420. declare module "cesium/Source/DataSources/ReferenceProperty" { import { ReferenceProperty } from 'cesium'; export default ReferenceProperty; }
  44421. declare module "cesium/Source/DataSources/Rotation" { import { Rotation } from 'cesium'; export default Rotation; }
  44422. declare module "cesium/Source/DataSources/SampledPositionProperty" { import { SampledPositionProperty } from 'cesium'; export default SampledPositionProperty; }
  44423. declare module "cesium/Source/DataSources/SampledProperty" { import { SampledProperty } from 'cesium'; export default SampledProperty; }
  44424. declare module "cesium/Source/DataSources/StripeMaterialProperty" { import { StripeMaterialProperty } from 'cesium'; export default StripeMaterialProperty; }
  44425. declare module "cesium/Source/DataSources/TimeIntervalCollectionPositionProperty" { import { TimeIntervalCollectionPositionProperty } from 'cesium'; export default TimeIntervalCollectionPositionProperty; }
  44426. declare module "cesium/Source/DataSources/TimeIntervalCollectionProperty" { import { TimeIntervalCollectionProperty } from 'cesium'; export default TimeIntervalCollectionProperty; }
  44427. declare module "cesium/Source/DataSources/VelocityOrientationProperty" { import { VelocityOrientationProperty } from 'cesium'; export default VelocityOrientationProperty; }
  44428. declare module "cesium/Source/DataSources/VelocityVectorProperty" { import { VelocityVectorProperty } from 'cesium'; export default VelocityVectorProperty; }
  44429. declare module "cesium/Source/DataSources/Visualizer" { import { Visualizer } from 'cesium'; export default Visualizer; }
  44430. declare module "cesium/Source/DataSources/WallGeometryUpdater" { import { WallGeometryUpdater } from 'cesium'; export default WallGeometryUpdater; }
  44431. declare module "cesium/Source/DataSources/WallGraphics" { import { WallGraphics } from 'cesium'; export default WallGraphics; }
  44432. declare module "cesium/Source/DataSources/exportKml" { import { exportKml } from 'cesium'; export default exportKml; }
  44433. declare module "cesium/Source/Scene/Appearance" { import { Appearance } from 'cesium'; export default Appearance; }
  44434. declare module "cesium/Source/Scene/ArcGisMapServerImageryProvider" { import { ArcGisMapServerImageryProvider } from 'cesium'; export default ArcGisMapServerImageryProvider; }
  44435. declare module "cesium/Source/Scene/Billboard" { import { Billboard } from 'cesium'; export default Billboard; }
  44436. declare module "cesium/Source/Scene/BillboardCollection" { import { BillboardCollection } from 'cesium'; export default BillboardCollection; }
  44437. declare module "cesium/Source/Scene/BingMapsImageryProvider" { import { BingMapsImageryProvider } from 'cesium'; export default BingMapsImageryProvider; }
  44438. declare module "cesium/Source/Scene/BlendingState" { import { BlendingState } from 'cesium'; export default BlendingState; }
  44439. declare module "cesium/Source/Scene/BoxEmitter" { import { BoxEmitter } from 'cesium'; export default BoxEmitter; }
  44440. declare module "cesium/Source/Scene/Camera" { import { Camera } from 'cesium'; export default Camera; }
  44441. declare module "cesium/Source/Scene/CameraEventAggregator" { import { CameraEventAggregator } from 'cesium'; export default CameraEventAggregator; }
  44442. declare module "cesium/Source/Scene/Cesium3DTile" { import { Cesium3DTile } from 'cesium'; export default Cesium3DTile; }
  44443. declare module "cesium/Source/Scene/Cesium3DTileContent" { import { Cesium3DTileContent } from 'cesium'; export default Cesium3DTileContent; }
  44444. declare module "cesium/Source/Scene/Cesium3DTileFeature" { import { Cesium3DTileFeature } from 'cesium'; export default Cesium3DTileFeature; }
  44445. declare module "cesium/Source/Scene/Cesium3DTilePointFeature" { import { Cesium3DTilePointFeature } from 'cesium'; export default Cesium3DTilePointFeature; }
  44446. declare module "cesium/Source/Scene/Cesium3DTileStyle" { import { Cesium3DTileStyle } from 'cesium'; export default Cesium3DTileStyle; }
  44447. declare module "cesium/Source/Scene/Cesium3DTileset" { import { Cesium3DTileset } from 'cesium'; export default Cesium3DTileset; }
  44448. declare module "cesium/Source/Scene/CircleEmitter" { import { CircleEmitter } from 'cesium'; export default CircleEmitter; }
  44449. declare module "cesium/Source/Scene/ClassificationPrimitive" { import { ClassificationPrimitive } from 'cesium'; export default ClassificationPrimitive; }
  44450. declare module "cesium/Source/Scene/ClippingPlane" { import { ClippingPlane } from 'cesium'; export default ClippingPlane; }
  44451. declare module "cesium/Source/Scene/ClippingPlaneCollection" { import { ClippingPlaneCollection } from 'cesium'; export default ClippingPlaneCollection; }
  44452. declare module "cesium/Source/Scene/CloudCollection" { import { CloudCollection } from 'cesium'; export default CloudCollection; }
  44453. declare module "cesium/Source/Scene/ConditionsExpression" { import { ConditionsExpression } from 'cesium'; export default ConditionsExpression; }
  44454. declare module "cesium/Source/Scene/ConeEmitter" { import { ConeEmitter } from 'cesium'; export default ConeEmitter; }
  44455. declare module "cesium/Source/Scene/CreditDisplay" { import { CreditDisplay } from 'cesium'; export default CreditDisplay; }
  44456. declare module "cesium/Source/Scene/CumulusCloud" { import { CumulusCloud } from 'cesium'; export default CumulusCloud; }
  44457. declare module "cesium/Source/Scene/DebugAppearance" { import { DebugAppearance } from 'cesium'; export default DebugAppearance; }
  44458. declare module "cesium/Source/Scene/DebugCameraPrimitive" { import { DebugCameraPrimitive } from 'cesium'; export default DebugCameraPrimitive; }
  44459. declare module "cesium/Source/Scene/DebugModelMatrixPrimitive" { import { DebugModelMatrixPrimitive } from 'cesium'; export default DebugModelMatrixPrimitive; }
  44460. declare module "cesium/Source/Scene/DirectionalLight" { import { DirectionalLight } from 'cesium'; export default DirectionalLight; }
  44461. declare module "cesium/Source/Scene/DiscardEmptyTileImagePolicy" { import { DiscardEmptyTileImagePolicy } from 'cesium'; export default DiscardEmptyTileImagePolicy; }
  44462. declare module "cesium/Source/Scene/DiscardMissingTileImagePolicy" { import { DiscardMissingTileImagePolicy } from 'cesium'; export default DiscardMissingTileImagePolicy; }
  44463. declare module "cesium/Source/Scene/EllipsoidSurfaceAppearance" { import { EllipsoidSurfaceAppearance } from 'cesium'; export default EllipsoidSurfaceAppearance; }
  44464. declare module "cesium/Source/Scene/Expression" { import { Expression } from 'cesium'; export default Expression; }
  44465. declare module "cesium/Source/Scene/Fog" { import { Fog } from 'cesium'; export default Fog; }
  44466. declare module "cesium/Source/Scene/FrameRateMonitor" { import { FrameRateMonitor } from 'cesium'; export default FrameRateMonitor; }
  44467. declare module "cesium/Source/Scene/GetFeatureInfoFormat" { import { GetFeatureInfoFormat } from 'cesium'; export default GetFeatureInfoFormat; }
  44468. declare module "cesium/Source/Scene/Globe" { import { Globe } from 'cesium'; export default Globe; }
  44469. declare module "cesium/Source/Scene/GlobeTranslucency" { import { GlobeTranslucency } from 'cesium'; export default GlobeTranslucency; }
  44470. declare module "cesium/Source/Scene/GoogleEarthEnterpriseImageryProvider" { import { GoogleEarthEnterpriseImageryProvider } from 'cesium'; export default GoogleEarthEnterpriseImageryProvider; }
  44471. declare module "cesium/Source/Scene/GoogleEarthEnterpriseMapsProvider" { import { GoogleEarthEnterpriseMapsProvider } from 'cesium'; export default GoogleEarthEnterpriseMapsProvider; }
  44472. declare module "cesium/Source/Scene/GridImageryProvider" { import { GridImageryProvider } from 'cesium'; export default GridImageryProvider; }
  44473. declare module "cesium/Source/Scene/GroundPolylinePrimitive" { import { GroundPolylinePrimitive } from 'cesium'; export default GroundPolylinePrimitive; }
  44474. declare module "cesium/Source/Scene/GroundPrimitive" { import { GroundPrimitive } from 'cesium'; export default GroundPrimitive; }
  44475. declare module "cesium/Source/Scene/ImageBasedLighting" { import { ImageBasedLighting } from 'cesium'; export default ImageBasedLighting; }
  44476. declare module "cesium/Source/Scene/ImageryLayer" { import { ImageryLayer } from 'cesium'; export default ImageryLayer; }
  44477. declare module "cesium/Source/Scene/ImageryLayerCollection" { import { ImageryLayerCollection } from 'cesium'; export default ImageryLayerCollection; }
  44478. declare module "cesium/Source/Scene/ImageryLayerFeatureInfo" { import { ImageryLayerFeatureInfo } from 'cesium'; export default ImageryLayerFeatureInfo; }
  44479. declare module "cesium/Source/Scene/ImageryProvider" { import { ImageryProvider } from 'cesium'; export default ImageryProvider; }
  44480. declare module "cesium/Source/Scene/IonImageryProvider" { import { IonImageryProvider } from 'cesium'; export default IonImageryProvider; }
  44481. declare module "cesium/Source/Scene/Label" { import { Label } from 'cesium'; export default Label; }
  44482. declare module "cesium/Source/Scene/LabelCollection" { import { LabelCollection } from 'cesium'; export default LabelCollection; }
  44483. declare module "cesium/Source/Scene/Light" { import { Light } from 'cesium'; export default Light; }
  44484. declare module "cesium/Source/Scene/MapboxImageryProvider" { import { MapboxImageryProvider } from 'cesium'; export default MapboxImageryProvider; }
  44485. declare module "cesium/Source/Scene/MapboxStyleImageryProvider" { import { MapboxStyleImageryProvider } from 'cesium'; export default MapboxStyleImageryProvider; }
  44486. declare module "cesium/Source/Scene/Material" { import { Material } from 'cesium'; export default Material; }
  44487. declare module "cesium/Source/Scene/MaterialAppearance" { import { MaterialAppearance } from 'cesium'; export default MaterialAppearance; }
  44488. declare module "cesium/Source/Scene/Model" { import { Model } from 'cesium'; export default Model; }
  44489. declare module "cesium/Source/Scene/ModelAnimation" { import { ModelAnimation } from 'cesium'; export default ModelAnimation; }
  44490. declare module "cesium/Source/Scene/ModelAnimationCollection" { import { ModelAnimationCollection } from 'cesium'; export default ModelAnimationCollection; }
  44491. declare module "cesium/Source/Scene/ModelMaterial" { import { ModelMaterial } from 'cesium'; export default ModelMaterial; }
  44492. declare module "cesium/Source/Scene/ModelMesh" { import { ModelMesh } from 'cesium'; export default ModelMesh; }
  44493. declare module "cesium/Source/Scene/ModelNode" { import { ModelNode } from 'cesium'; export default ModelNode; }
  44494. declare module "cesium/Source/Scene/Moon" { import { Moon } from 'cesium'; export default Moon; }
  44495. declare module "cesium/Source/Scene/NeverTileDiscardPolicy" { import { NeverTileDiscardPolicy } from 'cesium'; export default NeverTileDiscardPolicy; }
  44496. declare module "cesium/Source/Scene/OpenStreetMapImageryProvider" { import { OpenStreetMapImageryProvider } from 'cesium'; export default OpenStreetMapImageryProvider; }
  44497. declare module "cesium/Source/Scene/Particle" { import { Particle } from 'cesium'; export default Particle; }
  44498. declare module "cesium/Source/Scene/ParticleBurst" { import { ParticleBurst } from 'cesium'; export default ParticleBurst; }
  44499. declare module "cesium/Source/Scene/ParticleEmitter" { import { ParticleEmitter } from 'cesium'; export default ParticleEmitter; }
  44500. declare module "cesium/Source/Scene/ParticleSystem" { import { ParticleSystem } from 'cesium'; export default ParticleSystem; }
  44501. declare module "cesium/Source/Scene/PerInstanceColorAppearance" { import { PerInstanceColorAppearance } from 'cesium'; export default PerInstanceColorAppearance; }
  44502. declare module "cesium/Source/Scene/PointCloudShading" { import { PointCloudShading } from 'cesium'; export default PointCloudShading; }
  44503. declare module "cesium/Source/Scene/PointPrimitive" { import { PointPrimitive } from 'cesium'; export default PointPrimitive; }
  44504. declare module "cesium/Source/Scene/PointPrimitiveCollection" { import { PointPrimitiveCollection } from 'cesium'; export default PointPrimitiveCollection; }
  44505. declare module "cesium/Source/Scene/Polyline" { import { Polyline } from 'cesium'; export default Polyline; }
  44506. declare module "cesium/Source/Scene/PolylineCollection" { import { PolylineCollection } from 'cesium'; export default PolylineCollection; }
  44507. declare module "cesium/Source/Scene/PolylineColorAppearance" { import { PolylineColorAppearance } from 'cesium'; export default PolylineColorAppearance; }
  44508. declare module "cesium/Source/Scene/PolylineMaterialAppearance" { import { PolylineMaterialAppearance } from 'cesium'; export default PolylineMaterialAppearance; }
  44509. declare module "cesium/Source/Scene/PostProcessStage" { import { PostProcessStage } from 'cesium'; export default PostProcessStage; }
  44510. declare module "cesium/Source/Scene/PostProcessStageCollection" { import { PostProcessStageCollection } from 'cesium'; export default PostProcessStageCollection; }
  44511. declare module "cesium/Source/Scene/PostProcessStageComposite" { import { PostProcessStageComposite } from 'cesium'; export default PostProcessStageComposite; }
  44512. declare module "cesium/Source/Scene/PostProcessStageLibrary" { import { PostProcessStageLibrary } from 'cesium'; export default PostProcessStageLibrary; }
  44513. declare module "cesium/Source/Scene/Primitive" { import { Primitive } from 'cesium'; export default Primitive; }
  44514. declare module "cesium/Source/Scene/PrimitiveCollection" { import { PrimitiveCollection } from 'cesium'; export default PrimitiveCollection; }
  44515. declare module "cesium/Source/Scene/Scene" { import { Scene } from 'cesium'; export default Scene; }
  44516. declare module "cesium/Source/Scene/SceneTransforms" { import { SceneTransforms } from 'cesium'; export default SceneTransforms; }
  44517. declare module "cesium/Source/Scene/ScreenSpaceCameraController" { import { ScreenSpaceCameraController } from 'cesium'; export default ScreenSpaceCameraController; }
  44518. declare module "cesium/Source/Scene/ShadowMap" { import { ShadowMap } from 'cesium'; export default ShadowMap; }
  44519. declare module "cesium/Source/Scene/SingleTileImageryProvider" { import { SingleTileImageryProvider } from 'cesium'; export default SingleTileImageryProvider; }
  44520. declare module "cesium/Source/Scene/SkyAtmosphere" { import { SkyAtmosphere } from 'cesium'; export default SkyAtmosphere; }
  44521. declare module "cesium/Source/Scene/SkyBox" { import { SkyBox } from 'cesium'; export default SkyBox; }
  44522. declare module "cesium/Source/Scene/SphereEmitter" { import { SphereEmitter } from 'cesium'; export default SphereEmitter; }
  44523. declare module "cesium/Source/Scene/StyleExpression" { import { StyleExpression } from 'cesium'; export default StyleExpression; }
  44524. declare module "cesium/Source/Scene/Sun" { import { Sun } from 'cesium'; export default Sun; }
  44525. declare module "cesium/Source/Scene/SunLight" { import { SunLight } from 'cesium'; export default SunLight; }
  44526. declare module "cesium/Source/Scene/TileCoordinatesImageryProvider" { import { TileCoordinatesImageryProvider } from 'cesium'; export default TileCoordinatesImageryProvider; }
  44527. declare module "cesium/Source/Scene/TileDiscardPolicy" { import { TileDiscardPolicy } from 'cesium'; export default TileDiscardPolicy; }
  44528. declare module "cesium/Source/Scene/TileMapServiceImageryProvider" { import { TileMapServiceImageryProvider } from 'cesium'; export default TileMapServiceImageryProvider; }
  44529. declare module "cesium/Source/Scene/TimeDynamicImagery" { import { TimeDynamicImagery } from 'cesium'; export default TimeDynamicImagery; }
  44530. declare module "cesium/Source/Scene/TimeDynamicPointCloud" { import { TimeDynamicPointCloud } from 'cesium'; export default TimeDynamicPointCloud; }
  44531. declare module "cesium/Source/Scene/UrlTemplateImageryProvider" { import { UrlTemplateImageryProvider } from 'cesium'; export default UrlTemplateImageryProvider; }
  44532. declare module "cesium/Source/Scene/ViewportQuad" { import { ViewportQuad } from 'cesium'; export default ViewportQuad; }
  44533. declare module "cesium/Source/Scene/WebMapServiceImageryProvider" { import { WebMapServiceImageryProvider } from 'cesium'; export default WebMapServiceImageryProvider; }
  44534. declare module "cesium/Source/Scene/WebMapTileServiceImageryProvider" { import { WebMapTileServiceImageryProvider } from 'cesium'; export default WebMapTileServiceImageryProvider; }
  44535. declare module "cesium/Source/Scene/createElevationBandMaterial" { import { createElevationBandMaterial } from 'cesium'; export default createElevationBandMaterial; }
  44536. declare module "cesium/Source/Scene/createOsmBuildings" { import { createOsmBuildings } from 'cesium'; export default createOsmBuildings; }
  44537. declare module "cesium/Source/Scene/createTangentSpaceDebugPrimitive" { import { createTangentSpaceDebugPrimitive } from 'cesium'; export default createTangentSpaceDebugPrimitive; }
  44538. declare module "cesium/Source/Scene/createWorldImagery" { import { createWorldImagery } from 'cesium'; export default createWorldImagery; }
  44539. declare module "cesium/Source/Widgets/ClockViewModel" { import { ClockViewModel } from 'cesium'; export default ClockViewModel; }
  44540. declare module "cesium/Source/Widgets/Command" { import { Command } from 'cesium'; export default Command; }
  44541. declare module "cesium/Source/Widgets/SvgPathBindingHandler" { import { SvgPathBindingHandler } from 'cesium'; export default SvgPathBindingHandler; }
  44542. declare module "cesium/Source/Widgets/ToggleButtonViewModel" { import { ToggleButtonViewModel } from 'cesium'; export default ToggleButtonViewModel; }
  44543. declare module "cesium/Source/Widgets/createCommand" { import { createCommand } from 'cesium'; export default createCommand; }
  44544. declare module "cesium/Source/Scene/ModelExperimental/CustomShader" { import { CustomShader } from 'cesium'; export default CustomShader; }
  44545. declare module "cesium/Source/Scene/ModelExperimental/ModelExperimental" { import { ModelExperimental } from 'cesium'; export default ModelExperimental; }
  44546. declare module "cesium/Source/Scene/ModelExperimental/ModelExperimentalAnimation" { import { ModelExperimentalAnimation } from 'cesium'; export default ModelExperimentalAnimation; }
  44547. declare module "cesium/Source/Scene/ModelExperimental/ModelExperimentalAnimationCollection" { import { ModelExperimentalAnimationCollection } from 'cesium'; export default ModelExperimentalAnimationCollection; }
  44548. declare module "cesium/Source/Scene/ModelExperimental/ModelFeature" { import { ModelFeature } from 'cesium'; export default ModelFeature; }
  44549. declare module "cesium/Source/Scene/ModelExperimental/TextureUniform" { import { TextureUniform } from 'cesium'; export default TextureUniform; }
  44550. declare module "cesium/Source/Widgets/Animation/Animation" { import { Animation } from 'cesium'; export default Animation; }
  44551. declare module "cesium/Source/Widgets/Animation/AnimationViewModel" { import { AnimationViewModel } from 'cesium'; export default AnimationViewModel; }
  44552. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPicker" { import { BaseLayerPicker } from 'cesium'; export default BaseLayerPicker; }
  44553. declare module "cesium/Source/Widgets/BaseLayerPicker/BaseLayerPickerViewModel" { import { BaseLayerPickerViewModel } from 'cesium'; export default BaseLayerPickerViewModel; }
  44554. declare module "cesium/Source/Widgets/BaseLayerPicker/ProviderViewModel" { import { ProviderViewModel } from 'cesium'; export default ProviderViewModel; }
  44555. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector" { import { Cesium3DTilesInspector } from 'cesium'; export default Cesium3DTilesInspector; }
  44556. declare module "cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel" { import { Cesium3DTilesInspectorViewModel } from 'cesium'; export default Cesium3DTilesInspectorViewModel; }
  44557. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspector" { import { CesiumInspector } from 'cesium'; export default CesiumInspector; }
  44558. declare module "cesium/Source/Widgets/CesiumInspector/CesiumInspectorViewModel" { import { CesiumInspectorViewModel } from 'cesium'; export default CesiumInspectorViewModel; }
  44559. declare module "cesium/Source/Widgets/CesiumWidget/CesiumWidget" { import { CesiumWidget } from 'cesium'; export default CesiumWidget; }
  44560. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButton" { import { FullscreenButton } from 'cesium'; export default FullscreenButton; }
  44561. declare module "cesium/Source/Widgets/FullscreenButton/FullscreenButtonViewModel" { import { FullscreenButtonViewModel } from 'cesium'; export default FullscreenButtonViewModel; }
  44562. declare module "cesium/Source/Widgets/Geocoder/Geocoder" { import { Geocoder } from 'cesium'; export default Geocoder; }
  44563. declare module "cesium/Source/Widgets/Geocoder/GeocoderViewModel" { import { GeocoderViewModel } from 'cesium'; export default GeocoderViewModel; }
  44564. declare module "cesium/Source/Widgets/HomeButton/HomeButton" { import { HomeButton } from 'cesium'; export default HomeButton; }
  44565. declare module "cesium/Source/Widgets/HomeButton/HomeButtonViewModel" { import { HomeButtonViewModel } from 'cesium'; export default HomeButtonViewModel; }
  44566. declare module "cesium/Source/Widgets/InfoBox/InfoBox" { import { InfoBox } from 'cesium'; export default InfoBox; }
  44567. declare module "cesium/Source/Widgets/InfoBox/InfoBoxViewModel" { import { InfoBoxViewModel } from 'cesium'; export default InfoBoxViewModel; }
  44568. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButton" { import { NavigationHelpButton } from 'cesium'; export default NavigationHelpButton; }
  44569. declare module "cesium/Source/Widgets/NavigationHelpButton/NavigationHelpButtonViewModel" { import { NavigationHelpButtonViewModel } from 'cesium'; export default NavigationHelpButtonViewModel; }
  44570. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdog" { import { PerformanceWatchdog } from 'cesium'; export default PerformanceWatchdog; }
  44571. declare module "cesium/Source/Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel" { import { PerformanceWatchdogViewModel } from 'cesium'; export default PerformanceWatchdogViewModel; }
  44572. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPicker" { import { ProjectionPicker } from 'cesium'; export default ProjectionPicker; }
  44573. declare module "cesium/Source/Widgets/ProjectionPicker/ProjectionPickerViewModel" { import { ProjectionPickerViewModel } from 'cesium'; export default ProjectionPickerViewModel; }
  44574. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePicker" { import { SceneModePicker } from 'cesium'; export default SceneModePicker; }
  44575. declare module "cesium/Source/Widgets/SceneModePicker/SceneModePickerViewModel" { import { SceneModePickerViewModel } from 'cesium'; export default SceneModePickerViewModel; }
  44576. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicator" { import { SelectionIndicator } from 'cesium'; export default SelectionIndicator; }
  44577. declare module "cesium/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel" { import { SelectionIndicatorViewModel } from 'cesium'; export default SelectionIndicatorViewModel; }
  44578. declare module "cesium/Source/Widgets/Timeline/Timeline" { import { Timeline } from 'cesium'; export default Timeline; }
  44579. declare module "cesium/Source/Widgets/VRButton/VRButton" { import { VRButton } from 'cesium'; export default VRButton; }
  44580. declare module "cesium/Source/Widgets/VRButton/VRButtonViewModel" { import { VRButtonViewModel } from 'cesium'; export default VRButtonViewModel; }
  44581. declare module "cesium/Source/Widgets/Viewer/Viewer" { import { Viewer } from 'cesium'; export default Viewer; }
  44582. declare module "cesium/Source/Widgets/Viewer/viewerCesium3DTilesInspectorMixin" { import { viewerCesium3DTilesInspectorMixin } from 'cesium'; export default viewerCesium3DTilesInspectorMixin; }
  44583. declare module "cesium/Source/Widgets/Viewer/viewerCesiumInspectorMixin" { import { viewerCesiumInspectorMixin } from 'cesium'; export default viewerCesiumInspectorMixin; }
  44584. declare module "cesium/Source/Widgets/Viewer/viewerDragDropMixin" { import { viewerDragDropMixin } from 'cesium'; export default viewerDragDropMixin; }
  44585. declare module "cesium/Source/Widgets/Viewer/viewerPerformanceWatchdogMixin" { import { viewerPerformanceWatchdogMixin } from 'cesium'; export default viewerPerformanceWatchdogMixin; }